· 9 years ago · May 09, 2017, 10:06 AM
1
2<!-- saved from url=(0019)http://1003063.com/ -->
3<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4 <title>dynamicPixelsAI_outputLog_A4</title>
5 <link rel="stylesheet" type="text/css" href="./dynamicPixelsAI_outputLog_A4_files/norm.css">
6 <link rel="stylesheet" type="text/css" href="./dynamicPixelsAI_outputLog_A4_files/style.css">
7
8 <script type="text/javascript" src="./dynamicPixelsAI_outputLog_A4_files/scroll.js.Без названиСÐ"></script>
9 <script type="text/javascript" src="./dynamicPixelsAI_outputLog_A4_files/data.js.Без названиСÐ"></script>
10 <script type="text/javascript" src="./dynamicPixelsAI_outputLog_A4_files/timer.php"></script>
11 </head>
12 <body>
13
14 <div id="outputlog" class="outputlog"><div>Player_03556>DATAControl$$=framePasingLow</div><div>MissingNo((nd!=source)&&(SPT[nd]!=null))</div><div>Player_0024>movement>actionZone ConnectionDetected</div><div>Control Beh: scn DATA analyze = MissingScript.CastGenerated</div><div>SPT[NCN].drawPath(</div><div>UPD[ FunctionSet(SPT[HNB])</div><div> import Graph.NavMesh; Send #45States</div><div>var node:Node = new Node(Graph.Graph.getPlayersStates(), new Vector3D(nodes[a][0],nodes[a][1]));</div><div>ALP4 output leakError missingUE415CustomScript</div><div>[56#ljj,554]</div><div>[0222,010675],</div><div>var timer upd^ succseed [NCC.HNB]</div><div>CorruptData {sd233#} sendlog</div><div>BehMove->152#0000missingScript</div><div>players base movements update^ 253#0mp.hnb</div><div>ALP4 data reflesh...</div> <!-- Игорь, перепроверь этот баг. Ð ÑŸÐ Ñ• моему данные Ð Ñ—Ð Ñ• ИИ РїСЂРёС…РѕРґСÐС‚ РЅРµ корректные или битые. Р’РѕР·РјРѕР¶РЅРѕ Ð Ñ—Ð Ñ• этой причине РѕРЅ это делает . --></div>
15 <div class="title">dynamicPixelsAI_ServerOutputLog_002</div>
16 <div class="timerContainer"><div class="timer">mandatoryTempTestDataWipein - <span id="timerCounter">3419:13:43</span></div></div>
17 <div class="button">CopyTempTestData</div>
18 <div class="pass"><span id="mwText">Enter Admin Password To Proceed</span> <input type="password" class="passInput"></div>
19 <script type="text/javascript">
20( function( global, factory ) {
21
22 "use strict";
23
24 if ( typeof module === "object" && typeof module.exports === "object" ) {
25
26 // For CommonJS and CommonJS-like environments where a proper `window`
27 // is present, execute the factory and get jQuery.
28 // For environments that do not have a `window` with a `document`
29 // (such as Node.js), expose a factory as module.exports.
30 // This accentuates the need for the creation of a real `window`.
31 // e.g. var jQuery = require("jquery")(window);
32 // See ticket #14549 for more info.
33 module.exports = global.document ?
34 factory( global, true ) :
35 function( w ) {
36 if ( !w.document ) {
37 throw new Error( "jQuery requires a window with a document" );
38 }
39 return factory( w );
40 };
41 } else {
42 factory( global );
43 }
44
45// Pass this if window is not defined yet
46} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
47
48// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
49// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
50// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
51// enough that all such attempts are guarded in a try block.
52"use strict";
53
54var arr = [];
55
56var document = window.document;
57
58var getProto = Object.getPrototypeOf;
59
60var slice = arr.slice;
61
62var concat = arr.concat;
63
64var push = arr.push;
65
66var indexOf = arr.indexOf;
67
68var class2type = {};
69
70var toString = class2type.toString;
71
72var hasOwn = class2type.hasOwnProperty;
73
74var fnToString = hasOwn.toString;
75
76var ObjectFunctionString = fnToString.call( Object );
77
78var support = {};
79
80
81
82 function DOMEval( code, doc ) {
83 doc = doc || document;
84
85 var script = doc.createElement( "script" );
86
87 script.text = code;
88 doc.head.appendChild( script ).parentNode.removeChild( script );
89 }
90/* global Symbol */
91// Defining this global in .eslintrc.json would create a danger of using the global
92// unguarded in another place, it seems safer to define global only for this module
93
94
95
96var
97 version = "3.1.1",
98
99 // Define a local copy of jQuery
100 jQuery = function( selector, context ) {
101
102 // The jQuery object is actually just the init constructor 'enhanced'
103 // Need init if jQuery is called (just allow error to be thrown if not included)
104 return new jQuery.fn.init( selector, context );
105 },
106
107 // Support: Android <=4.0 only
108 // Make sure we trim BOM and NBSP
109 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
110
111 // Matches dashed string for camelizing
112 rmsPrefix = /^-ms-/,
113 rdashAlpha = /-([a-z])/g,
114
115 // Used by jQuery.camelCase as callback to replace()
116 fcamelCase = function( all, letter ) {
117 return letter.toUpperCase();
118 };
119
120jQuery.fn = jQuery.prototype = {
121
122 // The current version of jQuery being used
123 jquery: version,
124
125 constructor: jQuery,
126
127 // The default length of a jQuery object is 0
128 length: 0,
129
130 toArray: function() {
131 return slice.call( this );
132 },
133
134 // Get the Nth element in the matched element set OR
135 // Get the whole matched element set as a clean array
136 get: function( num ) {
137
138 // Return all the elements in a clean array
139 if ( num == null ) {
140 return slice.call( this );
141 }
142
143 // Return just the one element from the set
144 return num < 0 ? this[ num + this.length ] : this[ num ];
145 },
146
147 // Take an array of elements and push it onto the stack
148 // (returning the new matched element set)
149 pushStack: function( elems ) {
150
151 // Build a new jQuery matched element set
152 var ret = jQuery.merge( this.constructor(), elems );
153
154 // Add the old object onto the stack (as a reference)
155 ret.prevObject = this;
156
157 // Return the newly-formed element set
158 return ret;
159 },
160
161 // Execute a callback for every element in the matched set.
162 each: function( callback ) {
163 return jQuery.each( this, callback );
164 },
165
166 map: function( callback ) {
167 return this.pushStack( jQuery.map( this, function( elem, i ) {
168 return callback.call( elem, i, elem );
169 } ) );
170 },
171
172 slice: function() {
173 return this.pushStack( slice.apply( this, arguments ) );
174 },
175
176 first: function() {
177 return this.eq( 0 );
178 },
179
180 last: function() {
181 return this.eq( -1 );
182 },
183
184 eq: function( i ) {
185 var len = this.length,
186 j = +i + ( i < 0 ? len : 0 );
187 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
188 },
189
190 end: function() {
191 return this.prevObject || this.constructor();
192 },
193
194 // For internal use only.
195 // Behaves like an Array's method, not like a jQuery method.
196 push: push,
197 sort: arr.sort,
198 splice: arr.splice
199};
200
201jQuery.extend = jQuery.fn.extend = function() {
202 var options, name, src, copy, copyIsArray, clone,
203 target = arguments[ 0 ] || {},
204 i = 1,
205 length = arguments.length,
206 deep = false;
207
208 // Handle a deep copy situation
209 if ( typeof target === "boolean" ) {
210 deep = target;
211
212 // Skip the boolean and the target
213 target = arguments[ i ] || {};
214 i++;
215 }
216
217 // Handle case when target is a string or something (possible in deep copy)
218 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
219 target = {};
220 }
221
222 // Extend jQuery itself if only one argument is passed
223 if ( i === length ) {
224 target = this;
225 i--;
226 }
227
228 for ( ; i < length; i++ ) {
229
230 // Only deal with non-null/undefined values
231 if ( ( options = arguments[ i ] ) != null ) {
232
233 // Extend the base object
234 for ( name in options ) {
235 src = target[ name ];
236 copy = options[ name ];
237
238 // Prevent never-ending loop
239 if ( target === copy ) {
240 continue;
241 }
242
243 // Recurse if we're merging plain objects or arrays
244 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
245 ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
246
247 if ( copyIsArray ) {
248 copyIsArray = false;
249 clone = src && jQuery.isArray( src ) ? src : [];
250
251 } else {
252 clone = src && jQuery.isPlainObject( src ) ? src : {};
253 }
254
255 // Never move original objects, clone them
256 target[ name ] = jQuery.extend( deep, clone, copy );
257
258 // Don't bring in undefined values
259 } else if ( copy !== undefined ) {
260 target[ name ] = copy;
261 }
262 }
263 }
264 }
265
266 // Return the modified object
267 return target;
268};
269
270jQuery.extend( {
271
272 // Unique for each copy of jQuery on the page
273 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
274
275 // Assume jQuery is ready without the ready module
276 isReady: true,
277
278 error: function( msg ) {
279 throw new Error( msg );
280 },
281
282 noop: function() {},
283
284 isFunction: function( obj ) {
285 return jQuery.type( obj ) === "function";
286 },
287
288 isArray: Array.isArray,
289
290 isWindow: function( obj ) {
291 return obj != null && obj === obj.window;
292 },
293
294 isNumeric: function( obj ) {
295
296 // As of jQuery 3.0, isNumeric is limited to
297 // strings and numbers (primitives or objects)
298 // that can be coerced to finite numbers (gh-2662)
299 var type = jQuery.type( obj );
300 return ( type === "number" || type === "string" ) &&
301
302 // parseFloat NaNs numeric-cast false positives ("")
303 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
304 // subtraction forces infinities to NaN
305 !isNaN( obj - parseFloat( obj ) );
306 },
307
308 isPlainObject: function( obj ) {
309 var proto, Ctor;
310
311 // Detect obvious negatives
312 // Use toString instead of jQuery.type to catch host objects
313 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
314 return false;
315 }
316
317 proto = getProto( obj );
318
319 // Objects with no prototype (e.g., `Object.create( null )`) are plain
320 if ( !proto ) {
321 return true;
322 }
323
324 // Objects with prototype are plain iff they were constructed by a global Object function
325 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
326 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
327 },
328
329 isEmptyObject: function( obj ) {
330
331 /* eslint-disable no-unused-vars */
332 // See https://github.com/eslint/eslint/issues/6125
333 var name;
334
335 for ( name in obj ) {
336 return false;
337 }
338 return true;
339 },
340
341 type: function( obj ) {
342 if ( obj == null ) {
343 return obj + "";
344 }
345
346 // Support: Android <=2.3 only (functionish RegExp)
347 return typeof obj === "object" || typeof obj === "function" ?
348 class2type[ toString.call( obj ) ] || "object" :
349 typeof obj;
350 },
351
352 // Evaluates a script in a global context
353 globalEval: function( code ) {
354 DOMEval( code );
355 },
356
357 // Convert dashed to camelCase; used by the css and data modules
358 // Support: IE <=9 - 11, Edge 12 - 13
359 // Microsoft forgot to hump their vendor prefix (#9572)
360 camelCase: function( string ) {
361 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
362 },
363
364 nodeName: function( elem, name ) {
365 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
366 },
367
368 each: function( obj, callback ) {
369 var length, i = 0;
370
371 if ( isArrayLike( obj ) ) {
372 length = obj.length;
373 for ( ; i < length; i++ ) {
374 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
375 break;
376 }
377 }
378 } else {
379 for ( i in obj ) {
380 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
381 break;
382 }
383 }
384 }
385
386 return obj;
387 },
388
389 // Support: Android <=4.0 only
390 trim: function( text ) {
391 return text == null ?
392 "" :
393 ( text + "" ).replace( rtrim, "" );
394 },
395
396 // results is for internal usage only
397 makeArray: function( arr, results ) {
398 var ret = results || [];
399
400 if ( arr != null ) {
401 if ( isArrayLike( Object( arr ) ) ) {
402 jQuery.merge( ret,
403 typeof arr === "string" ?
404 [ arr ] : arr
405 );
406 } else {
407 push.call( ret, arr );
408 }
409 }
410
411 return ret;
412 },
413
414 inArray: function( elem, arr, i ) {
415 return arr == null ? -1 : indexOf.call( arr, elem, i );
416 },
417
418 // Support: Android <=4.0 only, PhantomJS 1 only
419 // push.apply(_, arraylike) throws on ancient WebKit
420 merge: function( first, second ) {
421 var len = +second.length,
422 j = 0,
423 i = first.length;
424
425 for ( ; j < len; j++ ) {
426 first[ i++ ] = second[ j ];
427 }
428
429 first.length = i;
430
431 return first;
432 },
433
434 grep: function( elems, callback, invert ) {
435 var callbackInverse,
436 matches = [],
437 i = 0,
438 length = elems.length,
439 callbackExpect = !invert;
440
441 // Go through the array, only saving the items
442 // that pass the validator function
443 for ( ; i < length; i++ ) {
444 callbackInverse = !callback( elems[ i ], i );
445 if ( callbackInverse !== callbackExpect ) {
446 matches.push( elems[ i ] );
447 }
448 }
449
450 return matches;
451 },
452
453 // arg is for internal usage only
454 map: function( elems, callback, arg ) {
455 var length, value,
456 i = 0,
457 ret = [];
458
459 // Go through the array, translating each of the items to their new values
460 if ( isArrayLike( elems ) ) {
461 length = elems.length;
462 for ( ; i < length; i++ ) {
463 value = callback( elems[ i ], i, arg );
464
465 if ( value != null ) {
466 ret.push( value );
467 }
468 }
469
470 // Go through every key on the object,
471 } else {
472 for ( i in elems ) {
473 value = callback( elems[ i ], i, arg );
474
475 if ( value != null ) {
476 ret.push( value );
477 }
478 }
479 }
480
481 // Flatten any nested arrays
482 return concat.apply( [], ret );
483 },
484
485 // A global GUID counter for objects
486 guid: 1,
487
488 // Bind a function to a context, optionally partially applying any
489 // arguments.
490 proxy: function( fn, context ) {
491 var tmp, args, proxy;
492
493 if ( typeof context === "string" ) {
494 tmp = fn[ context ];
495 context = fn;
496 fn = tmp;
497 }
498
499 // Quick check to determine if target is callable, in the spec
500 // this throws a TypeError, but we will just return undefined.
501 if ( !jQuery.isFunction( fn ) ) {
502 return undefined;
503 }
504
505 // Simulated bind
506 args = slice.call( arguments, 2 );
507 proxy = function() {
508 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
509 };
510
511 // Set the guid of unique handler to the same of original handler, so it can be removed
512 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
513
514 return proxy;
515 },
516
517 now: Date.now,
518
519 // jQuery.support is not used in Core but other projects attach their
520 // properties to it so it needs to exist.
521 support: support
522} );
523
524if ( typeof Symbol === "function" ) {
525 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
526}
527
528// Populate the class2type map
529jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
530function( i, name ) {
531 class2type[ "[object " + name + "]" ] = name.toLowerCase();
532} );
533
534function isArrayLike( obj ) {
535
536 // Support: real iOS 8.2 only (not reproducible in simulator)
537 // `in` check used to prevent JIT error (gh-2145)
538 // hasOwn isn't used here due to false negatives
539 // regarding Nodelist length in IE
540 var length = !!obj && "length" in obj && obj.length,
541 type = jQuery.type( obj );
542
543 if ( type === "function" || jQuery.isWindow( obj ) ) {
544 return false;
545 }
546
547 return type === "array" || length === 0 ||
548 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
549}
550var Sizzle =
551/*!
552 * Sizzle CSS Selector Engine v2.3.3
553 * https://sizzlejs.com/
554 *
555 * Copyright jQuery Foundation and other contributors
556 * Released under the MIT license
557 * http://jquery.org/license
558 *
559 * Date: 2016-08-08
560 */
561(function( window ) {
562
563var i,
564 support,
565 Expr,
566 getText,
567 isXML,
568 tokenize,
569 compile,
570 select,
571 outermostContext,
572 sortInput,
573 hasDuplicate,
574
575 // Local document vars
576 setDocument,
577 document,
578 docElem,
579 documentIsHTML,
580 rbuggyQSA,
581 rbuggyMatches,
582 matches,
583 contains,
584
585 // Instance-specific data
586 expando = "sizzle" + 1 * new Date(),
587 preferredDoc = window.document,
588 dirruns = 0,
589 done = 0,
590 classCache = createCache(),
591 tokenCache = createCache(),
592 compilerCache = createCache(),
593 sortOrder = function( a, b ) {
594 if ( a === b ) {
595 hasDuplicate = true;
596 }
597 return 0;
598 },
599
600 // Instance methods
601 hasOwn = ({}).hasOwnProperty,
602 arr = [],
603 pop = arr.pop,
604 push_native = arr.push,
605 push = arr.push,
606 slice = arr.slice,
607 // Use a stripped-down indexOf as it's faster than native
608 // https://jsperf.com/thor-indexof-vs-for/5
609 indexOf = function( list, elem ) {
610 var i = 0,
611 len = list.length;
612 for ( ; i < len; i++ ) {
613 if ( list[i] === elem ) {
614 return i;
615 }
616 }
617 return -1;
618 },
619
620 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
621
622 // Regular expressions
623
624 // http://www.w3.org/TR/css3-selectors/#whitespace
625 whitespace = "[\\x20\\t\\r\\n\\f]",
626
627 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
628 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
629
630 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
631 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
632 // Operator (capture 2)
633 "*([*^$|!~]?=)" + whitespace +
634 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
635 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
636 "*\\]",
637
638 pseudos = ":(" + identifier + ")(?:\\((" +
639 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
640 // 1. quoted (capture 3; capture 4 or capture 5)
641 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
642 // 2. simple (capture 6)
643 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
644 // 3. anything else (capture 2)
645 ".*" +
646 ")\\)|)",
647
648 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
649 rwhitespace = new RegExp( whitespace + "+", "g" ),
650 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
651
652 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
653 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
654
655 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
656
657 rpseudo = new RegExp( pseudos ),
658 ridentifier = new RegExp( "^" + identifier + "$" ),
659
660 matchExpr = {
661 "ID": new RegExp( "^#(" + identifier + ")" ),
662 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
663 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
664 "ATTR": new RegExp( "^" + attributes ),
665 "PSEUDO": new RegExp( "^" + pseudos ),
666 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
667 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
668 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
669 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
670 // For use in libraries implementing .is()
671 // We use this for POS matching in `select`
672 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
673 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
674 },
675
676 rinputs = /^(?:input|select|textarea|button)$/i,
677 rheader = /^h\d$/i,
678
679 rnative = /^[^{]+\{\s*\[native \w/,
680
681 // Easily-parseable/retrievable ID or TAG or CLASS selectors
682 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
683
684 rsibling = /[+~]/,
685
686 // CSS escapes
687 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
688 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
689 funescape = function( _, escaped, escapedWhitespace ) {
690 var high = "0x" + escaped - 0x10000;
691 // NaN means non-codepoint
692 // Support: Firefox<24
693 // Workaround erroneous numeric interpretation of +"0x"
694 return high !== high || escapedWhitespace ?
695 escaped :
696 high < 0 ?
697 // BMP codepoint
698 String.fromCharCode( high + 0x10000 ) :
699 // Supplemental Plane codepoint (surrogate pair)
700 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
701 },
702
703 // CSS string/identifier serialization
704 // https://drafts.csswg.org/cssom/#common-serializing-idioms
705 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
706 fcssescape = function( ch, asCodePoint ) {
707 if ( asCodePoint ) {
708
709 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
710 if ( ch === "\0" ) {
711 return "\uFFFD";
712 }
713
714 // Control characters and (dependent upon position) numbers get escaped as code points
715 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
716 }
717
718 // Other potentially-special ASCII characters get backslash-escaped
719 return "\\" + ch;
720 },
721
722 // Used for iframes
723 // See setDocument()
724 // Removing the function wrapper causes a "Permission Denied"
725 // error in IE
726 unloadHandler = function() {
727 setDocument();
728 },
729
730 disabledAncestor = addCombinator(
731 function( elem ) {
732 return elem.disabled === true && ("form" in elem || "label" in elem);
733 },
734 { dir: "parentNode", next: "legend" }
735 );
736
737// Optimize for push.apply( _, NodeList )
738try {
739 push.apply(
740 (arr = slice.call( preferredDoc.childNodes )),
741 preferredDoc.childNodes
742 );
743 // Support: Android<4.0
744 // Detect silently failing push.apply
745 arr[ preferredDoc.childNodes.length ].nodeType;
746} catch ( e ) {
747 push = { apply: arr.length ?
748
749 // Leverage slice if possible
750 function( target, els ) {
751 push_native.apply( target, slice.call(els) );
752 } :
753
754 // Support: IE<9
755 // Otherwise append directly
756 function( target, els ) {
757 var j = target.length,
758 i = 0;
759 // Can't trust NodeList.length
760 while ( (target[j++] = els[i++]) ) {}
761 target.length = j - 1;
762 }
763 };
764}
765
766function Sizzle( selector, context, results, seed ) {
767 var m, i, elem, nid, match, groups, newSelector,
768 newContext = context && context.ownerDocument,
769
770 // nodeType defaults to 9, since context defaults to document
771 nodeType = context ? context.nodeType : 9;
772
773 results = results || [];
774
775 // Return early from calls with invalid selector or context
776 if ( typeof selector !== "string" || !selector ||
777 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
778
779 return results;
780 }
781
782 // Try to shortcut find operations (as opposed to filters) in HTML documents
783 if ( !seed ) {
784
785 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
786 setDocument( context );
787 }
788 context = context || document;
789
790 if ( documentIsHTML ) {
791
792 // If the selector is sufficiently simple, try using a "get*By*" DOM method
793 // (excepting DocumentFragment context, where the methods don't exist)
794 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
795
796 // ID selector
797 if ( (m = match[1]) ) {
798
799 // Document context
800 if ( nodeType === 9 ) {
801 if ( (elem = context.getElementById( m )) ) {
802
803 // Support: IE, Opera, Webkit
804 // TODO: identify versions
805 // getElementById can match elements by name instead of ID
806 if ( elem.id === m ) {
807 results.push( elem );
808 return results;
809 }
810 } else {
811 return results;
812 }
813
814 // Element context
815 } else {
816
817 // Support: IE, Opera, Webkit
818 // TODO: identify versions
819 // getElementById can match elements by name instead of ID
820 if ( newContext && (elem = newContext.getElementById( m )) &&
821 contains( context, elem ) &&
822 elem.id === m ) {
823
824 results.push( elem );
825 return results;
826 }
827 }
828
829 // Type selector
830 } else if ( match[2] ) {
831 push.apply( results, context.getElementsByTagName( selector ) );
832 return results;
833
834 // Class selector
835 } else if ( (m = match[3]) && support.getElementsByClassName &&
836 context.getElementsByClassName ) {
837
838 push.apply( results, context.getElementsByClassName( m ) );
839 return results;
840 }
841 }
842
843 // Take advantage of querySelectorAll
844 if ( support.qsa &&
845 !compilerCache[ selector + " " ] &&
846 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
847
848 if ( nodeType !== 1 ) {
849 newContext = context;
850 newSelector = selector;
851
852 // qSA looks outside Element context, which is not what we want
853 // Thanks to Andrew Dupont for this workaround technique
854 // Support: IE <=8
855 // Exclude object elements
856 } else if ( context.nodeName.toLowerCase() !== "object" ) {
857
858 // Capture the context ID, setting it first if necessary
859 if ( (nid = context.getAttribute( "id" )) ) {
860 nid = nid.replace( rcssescape, fcssescape );
861 } else {
862 context.setAttribute( "id", (nid = expando) );
863 }
864
865 // Prefix every selector in the list
866 groups = tokenize( selector );
867 i = groups.length;
868 while ( i-- ) {
869 groups[i] = "#" + nid + " " + toSelector( groups[i] );
870 }
871 newSelector = groups.join( "," );
872
873 // Expand context for sibling selectors
874 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
875 context;
876 }
877
878 if ( newSelector ) {
879 try {
880 push.apply( results,
881 newContext.querySelectorAll( newSelector )
882 );
883 return results;
884 } catch ( qsaError ) {
885 } finally {
886 if ( nid === expando ) {
887 context.removeAttribute( "id" );
888 }
889 }
890 }
891 }
892 }
893 }
894
895 // All others
896 return select( selector.replace( rtrim, "$1" ), context, results, seed );
897}
898
899/**
900 * Create key-value caches of limited size
901 * @returns {function(string, object)} Returns the Object data after storing it on itself with
902 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
903 * deleting the oldest entry
904 */
905function createCache() {
906 var keys = [];
907
908 function cache( key, value ) {
909 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
910 if ( keys.push( key + " " ) > Expr.cacheLength ) {
911 // Only keep the most recent entries
912 delete cache[ keys.shift() ];
913 }
914 return (cache[ key + " " ] = value);
915 }
916 return cache;
917}
918
919/**
920 * Mark a function for special use by Sizzle
921 * @param {Function} fn The function to mark
922 */
923function markFunction( fn ) {
924 fn[ expando ] = true;
925 return fn;
926}
927
928/**
929 * Support testing using an element
930 * @param {Function} fn Passed the created element and returns a boolean result
931 */
932function assert( fn ) {
933 var el = document.createElement("fieldset");
934
935 try {
936 return !!fn( el );
937 } catch (e) {
938 return false;
939 } finally {
940 // Remove from its parent by default
941 if ( el.parentNode ) {
942 el.parentNode.removeChild( el );
943 }
944 // release memory in IE
945 el = null;
946 }
947}
948
949/**
950 * Adds the same handler for all of the specified attrs
951 * @param {String} attrs Pipe-separated list of attributes
952 * @param {Function} handler The method that will be applied
953 */
954function addHandle( attrs, handler ) {
955 var arr = attrs.split("|"),
956 i = arr.length;
957
958 while ( i-- ) {
959 Expr.attrHandle[ arr[i] ] = handler;
960 }
961}
962
963/**
964 * Checks document order of two siblings
965 * @param {Element} a
966 * @param {Element} b
967 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
968 */
969function siblingCheck( a, b ) {
970 var cur = b && a,
971 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
972 a.sourceIndex - b.sourceIndex;
973
974 // Use IE sourceIndex if available on both nodes
975 if ( diff ) {
976 return diff;
977 }
978
979 // Check if b follows a
980 if ( cur ) {
981 while ( (cur = cur.nextSibling) ) {
982 if ( cur === b ) {
983 return -1;
984 }
985 }
986 }
987
988 return a ? 1 : -1;
989}
990
991/**
992 * Returns a function to use in pseudos for input types
993 * @param {String} type
994 */
995function createInputPseudo( type ) {
996 return function( elem ) {
997 var name = elem.nodeName.toLowerCase();
998 return name === "input" && elem.type === type;
999 };
1000}
1001
1002/**
1003 * Returns a function to use in pseudos for buttons
1004 * @param {String} type
1005 */
1006function createButtonPseudo( type ) {
1007 return function( elem ) {
1008 var name = elem.nodeName.toLowerCase();
1009 return (name === "input" || name === "button") && elem.type === type;
1010 };
1011}
1012
1013/**
1014 * Returns a function to use in pseudos for :enabled/:disabled
1015 * @param {Boolean} disabled true for :disabled; false for :enabled
1016 */
1017function createDisabledPseudo( disabled ) {
1018
1019 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1020 return function( elem ) {
1021
1022 // Only certain elements can match :enabled or :disabled
1023 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1024 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1025 if ( "form" in elem ) {
1026
1027 // Check for inherited disabledness on relevant non-disabled elements:
1028 // * listed form-associated elements in a disabled fieldset
1029 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
1030 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1031 // * option elements in a disabled optgroup
1032 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1033 // All such elements have a "form" property.
1034 if ( elem.parentNode && elem.disabled === false ) {
1035
1036 // Option elements defer to a parent optgroup if present
1037 if ( "label" in elem ) {
1038 if ( "label" in elem.parentNode ) {
1039 return elem.parentNode.disabled === disabled;
1040 } else {
1041 return elem.disabled === disabled;
1042 }
1043 }
1044
1045 // Support: IE 6 - 11
1046 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1047 return elem.isDisabled === disabled ||
1048
1049 // Where there is no isDisabled, check manually
1050 /* jshint -W018 */
1051 elem.isDisabled !== !disabled &&
1052 disabledAncestor( elem ) === disabled;
1053 }
1054
1055 return elem.disabled === disabled;
1056
1057 // Try to winnow out elements that can't be disabled before trusting the disabled property.
1058 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1059 // even exist on them, let alone have a boolean value.
1060 } else if ( "label" in elem ) {
1061 return elem.disabled === disabled;
1062 }
1063
1064 // Remaining elements are neither :enabled nor :disabled
1065 return false;
1066 };
1067}
1068
1069/**
1070 * Returns a function to use in pseudos for positionals
1071 * @param {Function} fn
1072 */
1073function createPositionalPseudo( fn ) {
1074 return markFunction(function( argument ) {
1075 argument = +argument;
1076 return markFunction(function( seed, matches ) {
1077 var j,
1078 matchIndexes = fn( [], seed.length, argument ),
1079 i = matchIndexes.length;
1080
1081 // Match elements found at the specified indexes
1082 while ( i-- ) {
1083 if ( seed[ (j = matchIndexes[i]) ] ) {
1084 seed[j] = !(matches[j] = seed[j]);
1085 }
1086 }
1087 });
1088 });
1089}
1090
1091/**
1092 * Checks a node for validity as a Sizzle context
1093 * @param {Element|Object=} context
1094 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1095 */
1096function testContext( context ) {
1097 return context && typeof context.getElementsByTagName !== "undefined" && context;
1098}
1099
1100// Expose support vars for convenience
1101support = Sizzle.support = {};
1102
1103/**
1104 * Detects XML nodes
1105 * @param {Element|Object} elem An element or a document
1106 * @returns {Boolean} True iff elem is a non-HTML XML node
1107 */
1108isXML = Sizzle.isXML = function( elem ) {
1109 // documentElement is verified for cases where it doesn't yet exist
1110 // (such as loading iframes in IE - #4833)
1111 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1112 return documentElement ? documentElement.nodeName !== "HTML" : false;
1113};
1114
1115/**
1116 * Sets document-related variables once based on the current document
1117 * @param {Element|Object} [doc] An element or document object to use to set the document
1118 * @returns {Object} Returns the current document
1119 */
1120setDocument = Sizzle.setDocument = function( node ) {
1121 var hasCompare, subWindow,
1122 doc = node ? node.ownerDocument || node : preferredDoc;
1123
1124 // Return early if doc is invalid or already selected
1125 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1126 return document;
1127 }
1128
1129 // Update global variables
1130 document = doc;
1131 docElem = document.documentElement;
1132 documentIsHTML = !isXML( document );
1133
1134 // Support: IE 9-11, Edge
1135 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1136 if ( preferredDoc !== document &&
1137 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
1138
1139 // Support: IE 11, Edge
1140 if ( subWindow.addEventListener ) {
1141 subWindow.addEventListener( "unload", unloadHandler, false );
1142
1143 // Support: IE 9 - 10 only
1144 } else if ( subWindow.attachEvent ) {
1145 subWindow.attachEvent( "onunload", unloadHandler );
1146 }
1147 }
1148
1149 /* Attributes
1150 ---------------------------------------------------------------------- */
1151
1152 // Support: IE<8
1153 // Verify that getAttribute really returns attributes and not properties
1154 // (excepting IE8 booleans)
1155 support.attributes = assert(function( el ) {
1156 el.className = "i";
1157 return !el.getAttribute("className");
1158 });
1159
1160 /* getElement(s)By*
1161 ---------------------------------------------------------------------- */
1162
1163 // Check if getElementsByTagName("*") returns only elements
1164 support.getElementsByTagName = assert(function( el ) {
1165 el.appendChild( document.createComment("") );
1166 return !el.getElementsByTagName("*").length;
1167 });
1168
1169 // Support: IE<9
1170 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1171
1172 // Support: IE<10
1173 // Check if getElementById returns elements by name
1174 // The broken getElementById methods don't pick up programmatically-set names,
1175 // so use a roundabout getElementsByName test
1176 support.getById = assert(function( el ) {
1177 docElem.appendChild( el ).id = expando;
1178 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1179 });
1180
1181 // ID filter and find
1182 if ( support.getById ) {
1183 Expr.filter["ID"] = function( id ) {
1184 var attrId = id.replace( runescape, funescape );
1185 return function( elem ) {
1186 return elem.getAttribute("id") === attrId;
1187 };
1188 };
1189 Expr.find["ID"] = function( id, context ) {
1190 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1191 var elem = context.getElementById( id );
1192 return elem ? [ elem ] : [];
1193 }
1194 };
1195 } else {
1196 Expr.filter["ID"] = function( id ) {
1197 var attrId = id.replace( runescape, funescape );
1198 return function( elem ) {
1199 var node = typeof elem.getAttributeNode !== "undefined" &&
1200 elem.getAttributeNode("id");
1201 return node && node.value === attrId;
1202 };
1203 };
1204
1205 // Support: IE 6 - 7 only
1206 // getElementById is not reliable as a find shortcut
1207 Expr.find["ID"] = function( id, context ) {
1208 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1209 var node, i, elems,
1210 elem = context.getElementById( id );
1211
1212 if ( elem ) {
1213
1214 // Verify the id attribute
1215 node = elem.getAttributeNode("id");
1216 if ( node && node.value === id ) {
1217 return [ elem ];
1218 }
1219
1220 // Fall back on getElementsByName
1221 elems = context.getElementsByName( id );
1222 i = 0;
1223 while ( (elem = elems[i++]) ) {
1224 node = elem.getAttributeNode("id");
1225 if ( node && node.value === id ) {
1226 return [ elem ];
1227 }
1228 }
1229 }
1230
1231 return [];
1232 }
1233 };
1234 }
1235
1236 // Tag
1237 Expr.find["TAG"] = support.getElementsByTagName ?
1238 function( tag, context ) {
1239 if ( typeof context.getElementsByTagName !== "undefined" ) {
1240 return context.getElementsByTagName( tag );
1241
1242 // DocumentFragment nodes don't have gEBTN
1243 } else if ( support.qsa ) {
1244 return context.querySelectorAll( tag );
1245 }
1246 } :
1247
1248 function( tag, context ) {
1249 var elem,
1250 tmp = [],
1251 i = 0,
1252 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1253 results = context.getElementsByTagName( tag );
1254
1255 // Filter out possible comments
1256 if ( tag === "*" ) {
1257 while ( (elem = results[i++]) ) {
1258 if ( elem.nodeType === 1 ) {
1259 tmp.push( elem );
1260 }
1261 }
1262
1263 return tmp;
1264 }
1265 return results;
1266 };
1267
1268 // Class
1269 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1270 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1271 return context.getElementsByClassName( className );
1272 }
1273 };
1274
1275 /* QSA/matchesSelector
1276 ---------------------------------------------------------------------- */
1277
1278 // QSA and matchesSelector support
1279
1280 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1281 rbuggyMatches = [];
1282
1283 // qSa(:focus) reports false when true (Chrome 21)
1284 // We allow this because of a bug in IE8/9 that throws an error
1285 // whenever `document.activeElement` is accessed on an iframe
1286 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1287 // See https://bugs.jquery.com/ticket/13378
1288 rbuggyQSA = [];
1289
1290 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1291 // Build QSA regex
1292 // Regex strategy adopted from Diego Perini
1293 assert(function( el ) {
1294 // Select is set to empty string on purpose
1295 // This is to test IE's treatment of not explicitly
1296 // setting a boolean content attribute,
1297 // since its presence should be enough
1298 // https://bugs.jquery.com/ticket/12359
1299 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
1300 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
1301 "<option selected=''></option></select>";
1302
1303 // Support: IE8, Opera 11-12.16
1304 // Nothing should be selected when empty strings follow ^= or $= or *=
1305 // The test attribute must be unknown in Opera but "safe" for WinRT
1306 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1307 if ( el.querySelectorAll("[msallowcapture^='']").length ) {
1308 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1309 }
1310
1311 // Support: IE8
1312 // Boolean attributes and "value" are not treated correctly
1313 if ( !el.querySelectorAll("[selected]").length ) {
1314 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1315 }
1316
1317 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1318 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1319 rbuggyQSA.push("~=");
1320 }
1321
1322 // Webkit/Opera - :checked should return selected option elements
1323 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1324 // IE8 throws error here and will not see later tests
1325 if ( !el.querySelectorAll(":checked").length ) {
1326 rbuggyQSA.push(":checked");
1327 }
1328
1329 // Support: Safari 8+, iOS 8+
1330 // https://bugs.webkit.org/show_bug.cgi?id=136851
1331 // In-page `selector#id sibling-combinator selector` fails
1332 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1333 rbuggyQSA.push(".#.+[+~]");
1334 }
1335 });
1336
1337 assert(function( el ) {
1338 el.innerHTML = "<a href='' disabled='disabled'></a>" +
1339 "<select disabled='disabled'><option/></select>";
1340
1341 // Support: Windows 8 Native Apps
1342 // The type and name attributes are restricted during .innerHTML assignment
1343 var input = document.createElement("input");
1344 input.setAttribute( "type", "hidden" );
1345 el.appendChild( input ).setAttribute( "name", "D" );
1346
1347 // Support: IE8
1348 // Enforce case-sensitivity of name attribute
1349 if ( el.querySelectorAll("[name=d]").length ) {
1350 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1351 }
1352
1353 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1354 // IE8 throws error here and will not see later tests
1355 if ( el.querySelectorAll(":enabled").length !== 2 ) {
1356 rbuggyQSA.push( ":enabled", ":disabled" );
1357 }
1358
1359 // Support: IE9-11+
1360 // IE's :disabled selector does not pick up the children of disabled fieldsets
1361 docElem.appendChild( el ).disabled = true;
1362 if ( el.querySelectorAll(":disabled").length !== 2 ) {
1363 rbuggyQSA.push( ":enabled", ":disabled" );
1364 }
1365
1366 // Opera 10-11 does not throw on post-comma invalid pseudos
1367 el.querySelectorAll("*,:x");
1368 rbuggyQSA.push(",.*:");
1369 });
1370 }
1371
1372 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1373 docElem.webkitMatchesSelector ||
1374 docElem.mozMatchesSelector ||
1375 docElem.oMatchesSelector ||
1376 docElem.msMatchesSelector) )) ) {
1377
1378 assert(function( el ) {
1379 // Check to see if it's possible to do matchesSelector
1380 // on a disconnected node (IE 9)
1381 support.disconnectedMatch = matches.call( el, "*" );
1382
1383 // This should fail with an exception
1384 // Gecko does not error, returns false instead
1385 matches.call( el, "[s!='']:x" );
1386 rbuggyMatches.push( "!=", pseudos );
1387 });
1388 }
1389
1390 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1391 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1392
1393 /* Contains
1394 ---------------------------------------------------------------------- */
1395 hasCompare = rnative.test( docElem.compareDocumentPosition );
1396
1397 // Element contains another
1398 // Purposefully self-exclusive
1399 // As in, an element does not contain itself
1400 contains = hasCompare || rnative.test( docElem.contains ) ?
1401 function( a, b ) {
1402 var adown = a.nodeType === 9 ? a.documentElement : a,
1403 bup = b && b.parentNode;
1404 return a === bup || !!( bup && bup.nodeType === 1 && (
1405 adown.contains ?
1406 adown.contains( bup ) :
1407 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1408 ));
1409 } :
1410 function( a, b ) {
1411 if ( b ) {
1412 while ( (b = b.parentNode) ) {
1413 if ( b === a ) {
1414 return true;
1415 }
1416 }
1417 }
1418 return false;
1419 };
1420
1421 /* Sorting
1422 ---------------------------------------------------------------------- */
1423
1424 // Document order sorting
1425 sortOrder = hasCompare ?
1426 function( a, b ) {
1427
1428 // Flag for duplicate removal
1429 if ( a === b ) {
1430 hasDuplicate = true;
1431 return 0;
1432 }
1433
1434 // Sort on method existence if only one input has compareDocumentPosition
1435 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1436 if ( compare ) {
1437 return compare;
1438 }
1439
1440 // Calculate position if both inputs belong to the same document
1441 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1442 a.compareDocumentPosition( b ) :
1443
1444 // Otherwise we know they are disconnected
1445 1;
1446
1447 // Disconnected nodes
1448 if ( compare & 1 ||
1449 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1450
1451 // Choose the first element that is related to our preferred document
1452 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1453 return -1;
1454 }
1455 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1456 return 1;
1457 }
1458
1459 // Maintain original order
1460 return sortInput ?
1461 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1462 0;
1463 }
1464
1465 return compare & 4 ? -1 : 1;
1466 } :
1467 function( a, b ) {
1468 // Exit early if the nodes are identical
1469 if ( a === b ) {
1470 hasDuplicate = true;
1471 return 0;
1472 }
1473
1474 var cur,
1475 i = 0,
1476 aup = a.parentNode,
1477 bup = b.parentNode,
1478 ap = [ a ],
1479 bp = [ b ];
1480
1481 // Parentless nodes are either documents or disconnected
1482 if ( !aup || !bup ) {
1483 return a === document ? -1 :
1484 b === document ? 1 :
1485 aup ? -1 :
1486 bup ? 1 :
1487 sortInput ?
1488 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1489 0;
1490
1491 // If the nodes are siblings, we can do a quick check
1492 } else if ( aup === bup ) {
1493 return siblingCheck( a, b );
1494 }
1495
1496 // Otherwise we need full lists of their ancestors for comparison
1497 cur = a;
1498 while ( (cur = cur.parentNode) ) {
1499 ap.unshift( cur );
1500 }
1501 cur = b;
1502 while ( (cur = cur.parentNode) ) {
1503 bp.unshift( cur );
1504 }
1505
1506 // Walk down the tree looking for a discrepancy
1507 while ( ap[i] === bp[i] ) {
1508 i++;
1509 }
1510
1511 return i ?
1512 // Do a sibling check if the nodes have a common ancestor
1513 siblingCheck( ap[i], bp[i] ) :
1514
1515 // Otherwise nodes in our document sort first
1516 ap[i] === preferredDoc ? -1 :
1517 bp[i] === preferredDoc ? 1 :
1518 0;
1519 };
1520
1521 return document;
1522};
1523
1524Sizzle.matches = function( expr, elements ) {
1525 return Sizzle( expr, null, null, elements );
1526};
1527
1528Sizzle.matchesSelector = function( elem, expr ) {
1529 // Set document vars if needed
1530 if ( ( elem.ownerDocument || elem ) !== document ) {
1531 setDocument( elem );
1532 }
1533
1534 // Make sure that attribute selectors are quoted
1535 expr = expr.replace( rattributeQuotes, "='$1']" );
1536
1537 if ( support.matchesSelector && documentIsHTML &&
1538 !compilerCache[ expr + " " ] &&
1539 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1540 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1541
1542 try {
1543 var ret = matches.call( elem, expr );
1544
1545 // IE 9's matchesSelector returns false on disconnected nodes
1546 if ( ret || support.disconnectedMatch ||
1547 // As well, disconnected nodes are said to be in a document
1548 // fragment in IE 9
1549 elem.document && elem.document.nodeType !== 11 ) {
1550 return ret;
1551 }
1552 } catch (e) {}
1553 }
1554
1555 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1556};
1557
1558Sizzle.contains = function( context, elem ) {
1559 // Set document vars if needed
1560 if ( ( context.ownerDocument || context ) !== document ) {
1561 setDocument( context );
1562 }
1563 return contains( context, elem );
1564};
1565
1566Sizzle.attr = function( elem, name ) {
1567 // Set document vars if needed
1568 if ( ( elem.ownerDocument || elem ) !== document ) {
1569 setDocument( elem );
1570 }
1571
1572 var fn = Expr.attrHandle[ name.toLowerCase() ],
1573 // Don't get fooled by Object.prototype properties (jQuery #13807)
1574 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1575 fn( elem, name, !documentIsHTML ) :
1576 undefined;
1577
1578 return val !== undefined ?
1579 val :
1580 support.attributes || !documentIsHTML ?
1581 elem.getAttribute( name ) :
1582 (val = elem.getAttributeNode(name)) && val.specified ?
1583 val.value :
1584 null;
1585};
1586
1587Sizzle.escape = function( sel ) {
1588 return (sel + "").replace( rcssescape, fcssescape );
1589};
1590
1591Sizzle.error = function( msg ) {
1592 throw new Error( "Syntax error, unrecognized expression: " + msg );
1593};
1594
1595/**
1596 * Document sorting and removing duplicates
1597 * @param {ArrayLike} results
1598 */
1599Sizzle.uniqueSort = function( results ) {
1600 var elem,
1601 duplicates = [],
1602 j = 0,
1603 i = 0;
1604
1605 // Unless we *know* we can detect duplicates, assume their presence
1606 hasDuplicate = !support.detectDuplicates;
1607 sortInput = !support.sortStable && results.slice( 0 );
1608 results.sort( sortOrder );
1609
1610 if ( hasDuplicate ) {
1611 while ( (elem = results[i++]) ) {
1612 if ( elem === results[ i ] ) {
1613 j = duplicates.push( i );
1614 }
1615 }
1616 while ( j-- ) {
1617 results.splice( duplicates[ j ], 1 );
1618 }
1619 }
1620
1621 // Clear input after sorting to release objects
1622 // See https://github.com/jquery/sizzle/pull/225
1623 sortInput = null;
1624
1625 return results;
1626};
1627
1628/**
1629 * Utility function for retrieving the text value of an array of DOM nodes
1630 * @param {Array|Element} elem
1631 */
1632getText = Sizzle.getText = function( elem ) {
1633 var node,
1634 ret = "",
1635 i = 0,
1636 nodeType = elem.nodeType;
1637
1638 if ( !nodeType ) {
1639 // If no nodeType, this is expected to be an array
1640 while ( (node = elem[i++]) ) {
1641 // Do not traverse comment nodes
1642 ret += getText( node );
1643 }
1644 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1645 // Use textContent for elements
1646 // innerText usage removed for consistency of new lines (jQuery #11153)
1647 if ( typeof elem.textContent === "string" ) {
1648 return elem.textContent;
1649 } else {
1650 // Traverse its children
1651 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1652 ret += getText( elem );
1653 }
1654 }
1655 } else if ( nodeType === 3 || nodeType === 4 ) {
1656 return elem.nodeValue;
1657 }
1658 // Do not include comment or processing instruction nodes
1659
1660 return ret;
1661};
1662
1663Expr = Sizzle.selectors = {
1664
1665 // Can be adjusted by the user
1666 cacheLength: 50,
1667
1668 createPseudo: markFunction,
1669
1670 match: matchExpr,
1671
1672 attrHandle: {},
1673
1674 find: {},
1675
1676 relative: {
1677 ">": { dir: "parentNode", first: true },
1678 " ": { dir: "parentNode" },
1679 "+": { dir: "previousSibling", first: true },
1680 "~": { dir: "previousSibling" }
1681 },
1682
1683 preFilter: {
1684 "ATTR": function( match ) {
1685 match[1] = match[1].replace( runescape, funescape );
1686
1687 // Move the given value to match[3] whether quoted or unquoted
1688 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1689
1690 if ( match[2] === "~=" ) {
1691 match[3] = " " + match[3] + " ";
1692 }
1693
1694 return match.slice( 0, 4 );
1695 },
1696
1697 "CHILD": function( match ) {
1698 /* matches from matchExpr["CHILD"]
1699 1 type (only|nth|...)
1700 2 what (child|of-type)
1701 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1702 4 xn-component of xn+y argument ([+-]?\d*n|)
1703 5 sign of xn-component
1704 6 x of xn-component
1705 7 sign of y-component
1706 8 y of y-component
1707 */
1708 match[1] = match[1].toLowerCase();
1709
1710 if ( match[1].slice( 0, 3 ) === "nth" ) {
1711 // nth-* requires argument
1712 if ( !match[3] ) {
1713 Sizzle.error( match[0] );
1714 }
1715
1716 // numeric x and y parameters for Expr.filter.CHILD
1717 // remember that false/true cast respectively to 0/1
1718 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1719 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1720
1721 // other types prohibit arguments
1722 } else if ( match[3] ) {
1723 Sizzle.error( match[0] );
1724 }
1725
1726 return match;
1727 },
1728
1729 "PSEUDO": function( match ) {
1730 var excess,
1731 unquoted = !match[6] && match[2];
1732
1733 if ( matchExpr["CHILD"].test( match[0] ) ) {
1734 return null;
1735 }
1736
1737 // Accept quoted arguments as-is
1738 if ( match[3] ) {
1739 match[2] = match[4] || match[5] || "";
1740
1741 // Strip excess characters from unquoted arguments
1742 } else if ( unquoted && rpseudo.test( unquoted ) &&
1743 // Get excess from tokenize (recursively)
1744 (excess = tokenize( unquoted, true )) &&
1745 // advance to the next closing parenthesis
1746 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1747
1748 // excess is a negative index
1749 match[0] = match[0].slice( 0, excess );
1750 match[2] = unquoted.slice( 0, excess );
1751 }
1752
1753 // Return only captures needed by the pseudo filter method (type and argument)
1754 return match.slice( 0, 3 );
1755 }
1756 },
1757
1758 filter: {
1759
1760 "TAG": function( nodeNameSelector ) {
1761 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1762 return nodeNameSelector === "*" ?
1763 function() { return true; } :
1764 function( elem ) {
1765 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1766 };
1767 },
1768
1769 "CLASS": function( className ) {
1770 var pattern = classCache[ className + " " ];
1771
1772 return pattern ||
1773 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1774 classCache( className, function( elem ) {
1775 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1776 });
1777 },
1778
1779 "ATTR": function( name, operator, check ) {
1780 return function( elem ) {
1781 var result = Sizzle.attr( elem, name );
1782
1783 if ( result == null ) {
1784 return operator === "!=";
1785 }
1786 if ( !operator ) {
1787 return true;
1788 }
1789
1790 result += "";
1791
1792 return operator === "=" ? result === check :
1793 operator === "!=" ? result !== check :
1794 operator === "^=" ? check && result.indexOf( check ) === 0 :
1795 operator === "*=" ? check && result.indexOf( check ) > -1 :
1796 operator === "$=" ? check && result.slice( -check.length ) === check :
1797 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1798 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1799 false;
1800 };
1801 },
1802
1803 "CHILD": function( type, what, argument, first, last ) {
1804 var simple = type.slice( 0, 3 ) !== "nth",
1805 forward = type.slice( -4 ) !== "last",
1806 ofType = what === "of-type";
1807
1808 return first === 1 && last === 0 ?
1809
1810 // Shortcut for :nth-*(n)
1811 function( elem ) {
1812 return !!elem.parentNode;
1813 } :
1814
1815 function( elem, context, xml ) {
1816 var cache, uniqueCache, outerCache, node, nodeIndex, start,
1817 dir = simple !== forward ? "nextSibling" : "previousSibling",
1818 parent = elem.parentNode,
1819 name = ofType && elem.nodeName.toLowerCase(),
1820 useCache = !xml && !ofType,
1821 diff = false;
1822
1823 if ( parent ) {
1824
1825 // :(first|last|only)-(child|of-type)
1826 if ( simple ) {
1827 while ( dir ) {
1828 node = elem;
1829 while ( (node = node[ dir ]) ) {
1830 if ( ofType ?
1831 node.nodeName.toLowerCase() === name :
1832 node.nodeType === 1 ) {
1833
1834 return false;
1835 }
1836 }
1837 // Reverse direction for :only-* (if we haven't yet done so)
1838 start = dir = type === "only" && !start && "nextSibling";
1839 }
1840 return true;
1841 }
1842
1843 start = [ forward ? parent.firstChild : parent.lastChild ];
1844
1845 // non-xml :nth-child(...) stores cache data on `parent`
1846 if ( forward && useCache ) {
1847
1848 // Seek `elem` from a previously-cached index
1849
1850 // ...in a gzip-friendly way
1851 node = parent;
1852 outerCache = node[ expando ] || (node[ expando ] = {});
1853
1854 // Support: IE <9 only
1855 // Defend against cloned attroperties (jQuery gh-1709)
1856 uniqueCache = outerCache[ node.uniqueID ] ||
1857 (outerCache[ node.uniqueID ] = {});
1858
1859 cache = uniqueCache[ type ] || [];
1860 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1861 diff = nodeIndex && cache[ 2 ];
1862 node = nodeIndex && parent.childNodes[ nodeIndex ];
1863
1864 while ( (node = ++nodeIndex && node && node[ dir ] ||
1865
1866 // Fallback to seeking `elem` from the start
1867 (diff = nodeIndex = 0) || start.pop()) ) {
1868
1869 // When found, cache indexes on `parent` and break
1870 if ( node.nodeType === 1 && ++diff && node === elem ) {
1871 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1872 break;
1873 }
1874 }
1875
1876 } else {
1877 // Use previously-cached element index if available
1878 if ( useCache ) {
1879 // ...in a gzip-friendly way
1880 node = elem;
1881 outerCache = node[ expando ] || (node[ expando ] = {});
1882
1883 // Support: IE <9 only
1884 // Defend against cloned attroperties (jQuery gh-1709)
1885 uniqueCache = outerCache[ node.uniqueID ] ||
1886 (outerCache[ node.uniqueID ] = {});
1887
1888 cache = uniqueCache[ type ] || [];
1889 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1890 diff = nodeIndex;
1891 }
1892
1893 // xml :nth-child(...)
1894 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1895 if ( diff === false ) {
1896 // Use the same loop as above to seek `elem` from the start
1897 while ( (node = ++nodeIndex && node && node[ dir ] ||
1898 (diff = nodeIndex = 0) || start.pop()) ) {
1899
1900 if ( ( ofType ?
1901 node.nodeName.toLowerCase() === name :
1902 node.nodeType === 1 ) &&
1903 ++diff ) {
1904
1905 // Cache the index of each encountered element
1906 if ( useCache ) {
1907 outerCache = node[ expando ] || (node[ expando ] = {});
1908
1909 // Support: IE <9 only
1910 // Defend against cloned attroperties (jQuery gh-1709)
1911 uniqueCache = outerCache[ node.uniqueID ] ||
1912 (outerCache[ node.uniqueID ] = {});
1913
1914 uniqueCache[ type ] = [ dirruns, diff ];
1915 }
1916
1917 if ( node === elem ) {
1918 break;
1919 }
1920 }
1921 }
1922 }
1923 }
1924
1925 // Incorporate the offset, then check against cycle size
1926 diff -= last;
1927 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1928 }
1929 };
1930 },
1931
1932 "PSEUDO": function( pseudo, argument ) {
1933 // pseudo-class names are case-insensitive
1934 // http://www.w3.org/TR/selectors/#pseudo-classes
1935 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1936 // Remember that setFilters inherits from pseudos
1937 var args,
1938 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1939 Sizzle.error( "unsupported pseudo: " + pseudo );
1940
1941 // The user may use createPseudo to indicate that
1942 // arguments are needed to create the filter function
1943 // just as Sizzle does
1944 if ( fn[ expando ] ) {
1945 return fn( argument );
1946 }
1947
1948 // But maintain support for old signatures
1949 if ( fn.length > 1 ) {
1950 args = [ pseudo, pseudo, "", argument ];
1951 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1952 markFunction(function( seed, matches ) {
1953 var idx,
1954 matched = fn( seed, argument ),
1955 i = matched.length;
1956 while ( i-- ) {
1957 idx = indexOf( seed, matched[i] );
1958 seed[ idx ] = !( matches[ idx ] = matched[i] );
1959 }
1960 }) :
1961 function( elem ) {
1962 return fn( elem, 0, args );
1963 };
1964 }
1965
1966 return fn;
1967 }
1968 },
1969
1970 pseudos: {
1971 // Potentially complex pseudos
1972 "not": markFunction(function( selector ) {
1973 // Trim the selector passed to compile
1974 // to avoid treating leading and trailing
1975 // spaces as combinators
1976 var input = [],
1977 results = [],
1978 matcher = compile( selector.replace( rtrim, "$1" ) );
1979
1980 return matcher[ expando ] ?
1981 markFunction(function( seed, matches, context, xml ) {
1982 var elem,
1983 unmatched = matcher( seed, null, xml, [] ),
1984 i = seed.length;
1985
1986 // Match elements unmatched by `matcher`
1987 while ( i-- ) {
1988 if ( (elem = unmatched[i]) ) {
1989 seed[i] = !(matches[i] = elem);
1990 }
1991 }
1992 }) :
1993 function( elem, context, xml ) {
1994 input[0] = elem;
1995 matcher( input, null, xml, results );
1996 // Don't keep the element (issue #299)
1997 input[0] = null;
1998 return !results.pop();
1999 };
2000 }),
2001
2002 "has": markFunction(function( selector ) {
2003 return function( elem ) {
2004 return Sizzle( selector, elem ).length > 0;
2005 };
2006 }),
2007
2008 "contains": markFunction(function( text ) {
2009 text = text.replace( runescape, funescape );
2010 return function( elem ) {
2011 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
2012 };
2013 }),
2014
2015 // "Whether an element is represented by a :lang() selector
2016 // is based solely on the element's language value
2017 // being equal to the identifier C,
2018 // or beginning with the identifier C immediately followed by "-".
2019 // The matching of C against the element's language value is performed case-insensitively.
2020 // The identifier C does not have to be a valid language name."
2021 // http://www.w3.org/TR/selectors/#lang-pseudo
2022 "lang": markFunction( function( lang ) {
2023 // lang value must be a valid identifier
2024 if ( !ridentifier.test(lang || "") ) {
2025 Sizzle.error( "unsupported lang: " + lang );
2026 }
2027 lang = lang.replace( runescape, funescape ).toLowerCase();
2028 return function( elem ) {
2029 var elemLang;
2030 do {
2031 if ( (elemLang = documentIsHTML ?
2032 elem.lang :
2033 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2034
2035 elemLang = elemLang.toLowerCase();
2036 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2037 }
2038 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2039 return false;
2040 };
2041 }),
2042
2043 // Miscellaneous
2044 "target": function( elem ) {
2045 var hash = window.location && window.location.hash;
2046 return hash && hash.slice( 1 ) === elem.id;
2047 },
2048
2049 "root": function( elem ) {
2050 return elem === docElem;
2051 },
2052
2053 "focus": function( elem ) {
2054 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2055 },
2056
2057 // Boolean properties
2058 "enabled": createDisabledPseudo( false ),
2059 "disabled": createDisabledPseudo( true ),
2060
2061 "checked": function( elem ) {
2062 // In CSS3, :checked should return both checked and selected elements
2063 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2064 var nodeName = elem.nodeName.toLowerCase();
2065 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2066 },
2067
2068 "selected": function( elem ) {
2069 // Accessing this property makes selected-by-default
2070 // options in Safari work properly
2071 if ( elem.parentNode ) {
2072 elem.parentNode.selectedIndex;
2073 }
2074
2075 return elem.selected === true;
2076 },
2077
2078 // Contents
2079 "empty": function( elem ) {
2080 // http://www.w3.org/TR/selectors/#empty-pseudo
2081 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2082 // but not by others (comment: 8; processing instruction: 7; etc.)
2083 // nodeType < 6 works because attributes (2) do not appear as children
2084 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2085 if ( elem.nodeType < 6 ) {
2086 return false;
2087 }
2088 }
2089 return true;
2090 },
2091
2092 "parent": function( elem ) {
2093 return !Expr.pseudos["empty"]( elem );
2094 },
2095
2096 // Element/input types
2097 "header": function( elem ) {
2098 return rheader.test( elem.nodeName );
2099 },
2100
2101 "input": function( elem ) {
2102 return rinputs.test( elem.nodeName );
2103 },
2104
2105 "button": function( elem ) {
2106 var name = elem.nodeName.toLowerCase();
2107 return name === "input" && elem.type === "button" || name === "button";
2108 },
2109
2110 "text": function( elem ) {
2111 var attr;
2112 return elem.nodeName.toLowerCase() === "input" &&
2113 elem.type === "text" &&
2114
2115 // Support: IE<8
2116 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2117 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2118 },
2119
2120 // Position-in-collection
2121 "first": createPositionalPseudo(function() {
2122 return [ 0 ];
2123 }),
2124
2125 "last": createPositionalPseudo(function( matchIndexes, length ) {
2126 return [ length - 1 ];
2127 }),
2128
2129 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2130 return [ argument < 0 ? argument + length : argument ];
2131 }),
2132
2133 "even": createPositionalPseudo(function( matchIndexes, length ) {
2134 var i = 0;
2135 for ( ; i < length; i += 2 ) {
2136 matchIndexes.push( i );
2137 }
2138 return matchIndexes;
2139 }),
2140
2141 "odd": createPositionalPseudo(function( matchIndexes, length ) {
2142 var i = 1;
2143 for ( ; i < length; i += 2 ) {
2144 matchIndexes.push( i );
2145 }
2146 return matchIndexes;
2147 }),
2148
2149 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2150 var i = argument < 0 ? argument + length : argument;
2151 for ( ; --i >= 0; ) {
2152 matchIndexes.push( i );
2153 }
2154 return matchIndexes;
2155 }),
2156
2157 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2158 var i = argument < 0 ? argument + length : argument;
2159 for ( ; ++i < length; ) {
2160 matchIndexes.push( i );
2161 }
2162 return matchIndexes;
2163 })
2164 }
2165};
2166
2167Expr.pseudos["nth"] = Expr.pseudos["eq"];
2168
2169// Add button/input type pseudos
2170for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2171 Expr.pseudos[ i ] = createInputPseudo( i );
2172}
2173for ( i in { submit: true, reset: true } ) {
2174 Expr.pseudos[ i ] = createButtonPseudo( i );
2175}
2176
2177// Easy API for creating new setFilters
2178function setFilters() {}
2179setFilters.prototype = Expr.filters = Expr.pseudos;
2180Expr.setFilters = new setFilters();
2181
2182tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2183 var matched, match, tokens, type,
2184 soFar, groups, preFilters,
2185 cached = tokenCache[ selector + " " ];
2186
2187 if ( cached ) {
2188 return parseOnly ? 0 : cached.slice( 0 );
2189 }
2190
2191 soFar = selector;
2192 groups = [];
2193 preFilters = Expr.preFilter;
2194
2195 while ( soFar ) {
2196
2197 // Comma and first run
2198 if ( !matched || (match = rcomma.exec( soFar )) ) {
2199 if ( match ) {
2200 // Don't consume trailing commas as valid
2201 soFar = soFar.slice( match[0].length ) || soFar;
2202 }
2203 groups.push( (tokens = []) );
2204 }
2205
2206 matched = false;
2207
2208 // Combinators
2209 if ( (match = rcombinators.exec( soFar )) ) {
2210 matched = match.shift();
2211 tokens.push({
2212 value: matched,
2213 // Cast descendant combinators to space
2214 type: match[0].replace( rtrim, " " )
2215 });
2216 soFar = soFar.slice( matched.length );
2217 }
2218
2219 // Filters
2220 for ( type in Expr.filter ) {
2221 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2222 (match = preFilters[ type ]( match ))) ) {
2223 matched = match.shift();
2224 tokens.push({
2225 value: matched,
2226 type: type,
2227 matches: match
2228 });
2229 soFar = soFar.slice( matched.length );
2230 }
2231 }
2232
2233 if ( !matched ) {
2234 break;
2235 }
2236 }
2237
2238 // Return the length of the invalid excess
2239 // if we're just parsing
2240 // Otherwise, throw an error or return tokens
2241 return parseOnly ?
2242 soFar.length :
2243 soFar ?
2244 Sizzle.error( selector ) :
2245 // Cache the tokens
2246 tokenCache( selector, groups ).slice( 0 );
2247};
2248
2249function toSelector( tokens ) {
2250 var i = 0,
2251 len = tokens.length,
2252 selector = "";
2253 for ( ; i < len; i++ ) {
2254 selector += tokens[i].value;
2255 }
2256 return selector;
2257}
2258
2259function addCombinator( matcher, combinator, base ) {
2260 var dir = combinator.dir,
2261 skip = combinator.next,
2262 key = skip || dir,
2263 checkNonElements = base && key === "parentNode",
2264 doneName = done++;
2265
2266 return combinator.first ?
2267 // Check against closest ancestor/preceding element
2268 function( elem, context, xml ) {
2269 while ( (elem = elem[ dir ]) ) {
2270 if ( elem.nodeType === 1 || checkNonElements ) {
2271 return matcher( elem, context, xml );
2272 }
2273 }
2274 return false;
2275 } :
2276
2277 // Check against all ancestor/preceding elements
2278 function( elem, context, xml ) {
2279 var oldCache, uniqueCache, outerCache,
2280 newCache = [ dirruns, doneName ];
2281
2282 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2283 if ( xml ) {
2284 while ( (elem = elem[ dir ]) ) {
2285 if ( elem.nodeType === 1 || checkNonElements ) {
2286 if ( matcher( elem, context, xml ) ) {
2287 return true;
2288 }
2289 }
2290 }
2291 } else {
2292 while ( (elem = elem[ dir ]) ) {
2293 if ( elem.nodeType === 1 || checkNonElements ) {
2294 outerCache = elem[ expando ] || (elem[ expando ] = {});
2295
2296 // Support: IE <9 only
2297 // Defend against cloned attroperties (jQuery gh-1709)
2298 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2299
2300 if ( skip && skip === elem.nodeName.toLowerCase() ) {
2301 elem = elem[ dir ] || elem;
2302 } else if ( (oldCache = uniqueCache[ key ]) &&
2303 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2304
2305 // Assign to newCache so results back-propagate to previous elements
2306 return (newCache[ 2 ] = oldCache[ 2 ]);
2307 } else {
2308 // Reuse newcache so results back-propagate to previous elements
2309 uniqueCache[ key ] = newCache;
2310
2311 // A match means we're done; a fail means we have to keep checking
2312 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2313 return true;
2314 }
2315 }
2316 }
2317 }
2318 }
2319 return false;
2320 };
2321}
2322
2323function elementMatcher( matchers ) {
2324 return matchers.length > 1 ?
2325 function( elem, context, xml ) {
2326 var i = matchers.length;
2327 while ( i-- ) {
2328 if ( !matchers[i]( elem, context, xml ) ) {
2329 return false;
2330 }
2331 }
2332 return true;
2333 } :
2334 matchers[0];
2335}
2336
2337function multipleContexts( selector, contexts, results ) {
2338 var i = 0,
2339 len = contexts.length;
2340 for ( ; i < len; i++ ) {
2341 Sizzle( selector, contexts[i], results );
2342 }
2343 return results;
2344}
2345
2346function condense( unmatched, map, filter, context, xml ) {
2347 var elem,
2348 newUnmatched = [],
2349 i = 0,
2350 len = unmatched.length,
2351 mapped = map != null;
2352
2353 for ( ; i < len; i++ ) {
2354 if ( (elem = unmatched[i]) ) {
2355 if ( !filter || filter( elem, context, xml ) ) {
2356 newUnmatched.push( elem );
2357 if ( mapped ) {
2358 map.push( i );
2359 }
2360 }
2361 }
2362 }
2363
2364 return newUnmatched;
2365}
2366
2367function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2368 if ( postFilter && !postFilter[ expando ] ) {
2369 postFilter = setMatcher( postFilter );
2370 }
2371 if ( postFinder && !postFinder[ expando ] ) {
2372 postFinder = setMatcher( postFinder, postSelector );
2373 }
2374 return markFunction(function( seed, results, context, xml ) {
2375 var temp, i, elem,
2376 preMap = [],
2377 postMap = [],
2378 preexisting = results.length,
2379
2380 // Get initial elements from seed or context
2381 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2382
2383 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2384 matcherIn = preFilter && ( seed || !selector ) ?
2385 condense( elems, preMap, preFilter, context, xml ) :
2386 elems,
2387
2388 matcherOut = matcher ?
2389 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2390 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2391
2392 // ...intermediate processing is necessary
2393 [] :
2394
2395 // ...otherwise use results directly
2396 results :
2397 matcherIn;
2398
2399 // Find primary matches
2400 if ( matcher ) {
2401 matcher( matcherIn, matcherOut, context, xml );
2402 }
2403
2404 // Apply postFilter
2405 if ( postFilter ) {
2406 temp = condense( matcherOut, postMap );
2407 postFilter( temp, [], context, xml );
2408
2409 // Un-match failing elements by moving them back to matcherIn
2410 i = temp.length;
2411 while ( i-- ) {
2412 if ( (elem = temp[i]) ) {
2413 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2414 }
2415 }
2416 }
2417
2418 if ( seed ) {
2419 if ( postFinder || preFilter ) {
2420 if ( postFinder ) {
2421 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2422 temp = [];
2423 i = matcherOut.length;
2424 while ( i-- ) {
2425 if ( (elem = matcherOut[i]) ) {
2426 // Restore matcherIn since elem is not yet a final match
2427 temp.push( (matcherIn[i] = elem) );
2428 }
2429 }
2430 postFinder( null, (matcherOut = []), temp, xml );
2431 }
2432
2433 // Move matched elements from seed to results to keep them synchronized
2434 i = matcherOut.length;
2435 while ( i-- ) {
2436 if ( (elem = matcherOut[i]) &&
2437 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2438
2439 seed[temp] = !(results[temp] = elem);
2440 }
2441 }
2442 }
2443
2444 // Add elements to results, through postFinder if defined
2445 } else {
2446 matcherOut = condense(
2447 matcherOut === results ?
2448 matcherOut.splice( preexisting, matcherOut.length ) :
2449 matcherOut
2450 );
2451 if ( postFinder ) {
2452 postFinder( null, results, matcherOut, xml );
2453 } else {
2454 push.apply( results, matcherOut );
2455 }
2456 }
2457 });
2458}
2459
2460function matcherFromTokens( tokens ) {
2461 var checkContext, matcher, j,
2462 len = tokens.length,
2463 leadingRelative = Expr.relative[ tokens[0].type ],
2464 implicitRelative = leadingRelative || Expr.relative[" "],
2465 i = leadingRelative ? 1 : 0,
2466
2467 // The foundational matcher ensures that elements are reachable from top-level context(s)
2468 matchContext = addCombinator( function( elem ) {
2469 return elem === checkContext;
2470 }, implicitRelative, true ),
2471 matchAnyContext = addCombinator( function( elem ) {
2472 return indexOf( checkContext, elem ) > -1;
2473 }, implicitRelative, true ),
2474 matchers = [ function( elem, context, xml ) {
2475 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2476 (checkContext = context).nodeType ?
2477 matchContext( elem, context, xml ) :
2478 matchAnyContext( elem, context, xml ) );
2479 // Avoid hanging onto element (issue #299)
2480 checkContext = null;
2481 return ret;
2482 } ];
2483
2484 for ( ; i < len; i++ ) {
2485 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2486 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2487 } else {
2488 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2489
2490 // Return special upon seeing a positional matcher
2491 if ( matcher[ expando ] ) {
2492 // Find the next relative operator (if any) for proper handling
2493 j = ++i;
2494 for ( ; j < len; j++ ) {
2495 if ( Expr.relative[ tokens[j].type ] ) {
2496 break;
2497 }
2498 }
2499 return setMatcher(
2500 i > 1 && elementMatcher( matchers ),
2501 i > 1 && toSelector(
2502 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2503 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2504 ).replace( rtrim, "$1" ),
2505 matcher,
2506 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2507 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2508 j < len && toSelector( tokens )
2509 );
2510 }
2511 matchers.push( matcher );
2512 }
2513 }
2514
2515 return elementMatcher( matchers );
2516}
2517
2518function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2519 var bySet = setMatchers.length > 0,
2520 byElement = elementMatchers.length > 0,
2521 superMatcher = function( seed, context, xml, results, outermost ) {
2522 var elem, j, matcher,
2523 matchedCount = 0,
2524 i = "0",
2525 unmatched = seed && [],
2526 setMatched = [],
2527 contextBackup = outermostContext,
2528 // We must always have either seed elements or outermost context
2529 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2530 // Use integer dirruns iff this is the outermost matcher
2531 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2532 len = elems.length;
2533
2534 if ( outermost ) {
2535 outermostContext = context === document || context || outermost;
2536 }
2537
2538 // Add elements passing elementMatchers directly to results
2539 // Support: IE<9, Safari
2540 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2541 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2542 if ( byElement && elem ) {
2543 j = 0;
2544 if ( !context && elem.ownerDocument !== document ) {
2545 setDocument( elem );
2546 xml = !documentIsHTML;
2547 }
2548 while ( (matcher = elementMatchers[j++]) ) {
2549 if ( matcher( elem, context || document, xml) ) {
2550 results.push( elem );
2551 break;
2552 }
2553 }
2554 if ( outermost ) {
2555 dirruns = dirrunsUnique;
2556 }
2557 }
2558
2559 // Track unmatched elements for set filters
2560 if ( bySet ) {
2561 // They will have gone through all possible matchers
2562 if ( (elem = !matcher && elem) ) {
2563 matchedCount--;
2564 }
2565
2566 // Lengthen the array for every element, matched or not
2567 if ( seed ) {
2568 unmatched.push( elem );
2569 }
2570 }
2571 }
2572
2573 // `i` is now the count of elements visited above, and adding it to `matchedCount`
2574 // makes the latter nonnegative.
2575 matchedCount += i;
2576
2577 // Apply set filters to unmatched elements
2578 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2579 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2580 // no element matchers and no seed.
2581 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2582 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
2583 // numerically zero.
2584 if ( bySet && i !== matchedCount ) {
2585 j = 0;
2586 while ( (matcher = setMatchers[j++]) ) {
2587 matcher( unmatched, setMatched, context, xml );
2588 }
2589
2590 if ( seed ) {
2591 // Reintegrate element matches to eliminate the need for sorting
2592 if ( matchedCount > 0 ) {
2593 while ( i-- ) {
2594 if ( !(unmatched[i] || setMatched[i]) ) {
2595 setMatched[i] = pop.call( results );
2596 }
2597 }
2598 }
2599
2600 // Discard index placeholder values to get only actual matches
2601 setMatched = condense( setMatched );
2602 }
2603
2604 // Add matches to results
2605 push.apply( results, setMatched );
2606
2607 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2608 if ( outermost && !seed && setMatched.length > 0 &&
2609 ( matchedCount + setMatchers.length ) > 1 ) {
2610
2611 Sizzle.uniqueSort( results );
2612 }
2613 }
2614
2615 // Override manipulation of globals by nested matchers
2616 if ( outermost ) {
2617 dirruns = dirrunsUnique;
2618 outermostContext = contextBackup;
2619 }
2620
2621 return unmatched;
2622 };
2623
2624 return bySet ?
2625 markFunction( superMatcher ) :
2626 superMatcher;
2627}
2628
2629compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2630 var i,
2631 setMatchers = [],
2632 elementMatchers = [],
2633 cached = compilerCache[ selector + " " ];
2634
2635 if ( !cached ) {
2636 // Generate a function of recursive functions that can be used to check each element
2637 if ( !match ) {
2638 match = tokenize( selector );
2639 }
2640 i = match.length;
2641 while ( i-- ) {
2642 cached = matcherFromTokens( match[i] );
2643 if ( cached[ expando ] ) {
2644 setMatchers.push( cached );
2645 } else {
2646 elementMatchers.push( cached );
2647 }
2648 }
2649
2650 // Cache the compiled function
2651 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2652
2653 // Save selector and tokenization
2654 cached.selector = selector;
2655 }
2656 return cached;
2657};
2658
2659/**
2660 * A low-level selection function that works with Sizzle's compiled
2661 * selector functions
2662 * @param {String|Function} selector A selector or a pre-compiled
2663 * selector function built with Sizzle.compile
2664 * @param {Element} context
2665 * @param {Array} [results]
2666 * @param {Array} [seed] A set of elements to match against
2667 */
2668select = Sizzle.select = function( selector, context, results, seed ) {
2669 var i, tokens, token, type, find,
2670 compiled = typeof selector === "function" && selector,
2671 match = !seed && tokenize( (selector = compiled.selector || selector) );
2672
2673 results = results || [];
2674
2675 // Try to minimize operations if there is only one selector in the list and no seed
2676 // (the latter of which guarantees us context)
2677 if ( match.length === 1 ) {
2678
2679 // Reduce context if the leading compound selector is an ID
2680 tokens = match[0] = match[0].slice( 0 );
2681 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2682 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
2683
2684 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2685 if ( !context ) {
2686 return results;
2687
2688 // Precompiled matchers will still verify ancestry, so step up a level
2689 } else if ( compiled ) {
2690 context = context.parentNode;
2691 }
2692
2693 selector = selector.slice( tokens.shift().value.length );
2694 }
2695
2696 // Fetch a seed set for right-to-left matching
2697 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2698 while ( i-- ) {
2699 token = tokens[i];
2700
2701 // Abort if we hit a combinator
2702 if ( Expr.relative[ (type = token.type) ] ) {
2703 break;
2704 }
2705 if ( (find = Expr.find[ type ]) ) {
2706 // Search, expanding context for leading sibling combinators
2707 if ( (seed = find(
2708 token.matches[0].replace( runescape, funescape ),
2709 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2710 )) ) {
2711
2712 // If seed is empty or no tokens remain, we can return early
2713 tokens.splice( i, 1 );
2714 selector = seed.length && toSelector( tokens );
2715 if ( !selector ) {
2716 push.apply( results, seed );
2717 return results;
2718 }
2719
2720 break;
2721 }
2722 }
2723 }
2724 }
2725
2726 // Compile and execute a filtering function if one is not provided
2727 // Provide `match` to avoid retokenization if we modified the selector above
2728 ( compiled || compile( selector, match ) )(
2729 seed,
2730 context,
2731 !documentIsHTML,
2732 results,
2733 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2734 );
2735 return results;
2736};
2737
2738// One-time assignments
2739
2740// Sort stability
2741support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2742
2743// Support: Chrome 14-35+
2744// Always assume duplicates if they aren't passed to the comparison function
2745support.detectDuplicates = !!hasDuplicate;
2746
2747// Initialize against the default document
2748setDocument();
2749
2750// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2751// Detached nodes confoundingly follow *each other*
2752support.sortDetached = assert(function( el ) {
2753 // Should return 1, but returns 4 (following)
2754 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
2755});
2756
2757// Support: IE<8
2758// Prevent attribute/property "interpolation"
2759// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2760if ( !assert(function( el ) {
2761 el.innerHTML = "<a href='#'></a>";
2762 return el.firstChild.getAttribute("href") === "#" ;
2763}) ) {
2764 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2765 if ( !isXML ) {
2766 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2767 }
2768 });
2769}
2770
2771// Support: IE<9
2772// Use defaultValue in place of getAttribute("value")
2773if ( !support.attributes || !assert(function( el ) {
2774 el.innerHTML = "<input/>";
2775 el.firstChild.setAttribute( "value", "" );
2776 return el.firstChild.getAttribute( "value" ) === "";
2777}) ) {
2778 addHandle( "value", function( elem, name, isXML ) {
2779 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2780 return elem.defaultValue;
2781 }
2782 });
2783}
2784
2785// Support: IE<9
2786// Use getAttributeNode to fetch booleans when getAttribute lies
2787if ( !assert(function( el ) {
2788 return el.getAttribute("disabled") == null;
2789}) ) {
2790 addHandle( booleans, function( elem, name, isXML ) {
2791 var val;
2792 if ( !isXML ) {
2793 return elem[ name ] === true ? name.toLowerCase() :
2794 (val = elem.getAttributeNode( name )) && val.specified ?
2795 val.value :
2796 null;
2797 }
2798 });
2799}
2800
2801return Sizzle;
2802
2803})( window );
2804
2805
2806
2807jQuery.find = Sizzle;
2808jQuery.expr = Sizzle.selectors;
2809
2810// Deprecated
2811jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2812jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2813jQuery.text = Sizzle.getText;
2814jQuery.isXMLDoc = Sizzle.isXML;
2815jQuery.contains = Sizzle.contains;
2816jQuery.escapeSelector = Sizzle.escape;
2817
2818
2819
2820
2821var dir = function( elem, dir, until ) {
2822 var matched = [],
2823 truncate = until !== undefined;
2824
2825 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2826 if ( elem.nodeType === 1 ) {
2827 if ( truncate && jQuery( elem ).is( until ) ) {
2828 break;
2829 }
2830 matched.push( elem );
2831 }
2832 }
2833 return matched;
2834};
2835
2836
2837var siblings = function( n, elem ) {
2838 var matched = [];
2839
2840 for ( ; n; n = n.nextSibling ) {
2841 if ( n.nodeType === 1 && n !== elem ) {
2842 matched.push( n );
2843 }
2844 }
2845
2846 return matched;
2847};
2848
2849
2850var rneedsContext = jQuery.expr.match.needsContext;
2851
2852var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
2853
2854
2855
2856var risSimple = /^.[^:#\[\.,]*$/;
2857
2858// Implement the identical functionality for filter and not
2859function winnow( elements, qualifier, not ) {
2860 if ( jQuery.isFunction( qualifier ) ) {
2861 return jQuery.grep( elements, function( elem, i ) {
2862 return !!qualifier.call( elem, i, elem ) !== not;
2863 } );
2864 }
2865
2866 // Single element
2867 if ( qualifier.nodeType ) {
2868 return jQuery.grep( elements, function( elem ) {
2869 return ( elem === qualifier ) !== not;
2870 } );
2871 }
2872
2873 // Arraylike of elements (jQuery, arguments, Array)
2874 if ( typeof qualifier !== "string" ) {
2875 return jQuery.grep( elements, function( elem ) {
2876 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2877 } );
2878 }
2879
2880 // Simple selector that can be filtered directly, removing non-Elements
2881 if ( risSimple.test( qualifier ) ) {
2882 return jQuery.filter( qualifier, elements, not );
2883 }
2884
2885 // Complex selector, compare the two sets, removing non-Elements
2886 qualifier = jQuery.filter( qualifier, elements );
2887 return jQuery.grep( elements, function( elem ) {
2888 return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
2889 } );
2890}
2891
2892jQuery.filter = function( expr, elems, not ) {
2893 var elem = elems[ 0 ];
2894
2895 if ( not ) {
2896 expr = ":not(" + expr + ")";
2897 }
2898
2899 if ( elems.length === 1 && elem.nodeType === 1 ) {
2900 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
2901 }
2902
2903 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2904 return elem.nodeType === 1;
2905 } ) );
2906};
2907
2908jQuery.fn.extend( {
2909 find: function( selector ) {
2910 var i, ret,
2911 len = this.length,
2912 self = this;
2913
2914 if ( typeof selector !== "string" ) {
2915 return this.pushStack( jQuery( selector ).filter( function() {
2916 for ( i = 0; i < len; i++ ) {
2917 if ( jQuery.contains( self[ i ], this ) ) {
2918 return true;
2919 }
2920 }
2921 } ) );
2922 }
2923
2924 ret = this.pushStack( [] );
2925
2926 for ( i = 0; i < len; i++ ) {
2927 jQuery.find( selector, self[ i ], ret );
2928 }
2929
2930 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
2931 },
2932 filter: function( selector ) {
2933 return this.pushStack( winnow( this, selector || [], false ) );
2934 },
2935 not: function( selector ) {
2936 return this.pushStack( winnow( this, selector || [], true ) );
2937 },
2938 is: function( selector ) {
2939 return !!winnow(
2940 this,
2941
2942 // If this is a positional/relative selector, check membership in the returned set
2943 // so $("p:first").is("p:last") won't return true for a doc with two "p".
2944 typeof selector === "string" && rneedsContext.test( selector ) ?
2945 jQuery( selector ) :
2946 selector || [],
2947 false
2948 ).length;
2949 }
2950} );
2951
2952
2953// Initialize a jQuery object
2954
2955
2956// A central reference to the root jQuery(document)
2957var rootjQuery,
2958
2959 // A simple way to check for HTML strings
2960 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2961 // Strict HTML recognition (#11290: must start with <)
2962 // Shortcut simple #id case for speed
2963 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
2964
2965 init = jQuery.fn.init = function( selector, context, root ) {
2966 var match, elem;
2967
2968 // HANDLE: $(""), $(null), $(undefined), $(false)
2969 if ( !selector ) {
2970 return this;
2971 }
2972
2973 // Method init() accepts an alternate rootjQuery
2974 // so migrate can support jQuery.sub (gh-2101)
2975 root = root || rootjQuery;
2976
2977 // Handle HTML strings
2978 if ( typeof selector === "string" ) {
2979 if ( selector[ 0 ] === "<" &&
2980 selector[ selector.length - 1 ] === ">" &&
2981 selector.length >= 3 ) {
2982
2983 // Assume that strings that start and end with <> are HTML and skip the regex check
2984 match = [ null, selector, null ];
2985
2986 } else {
2987 match = rquickExpr.exec( selector );
2988 }
2989
2990 // Match html or make sure no context is specified for #id
2991 if ( match && ( match[ 1 ] || !context ) ) {
2992
2993 // HANDLE: $(html) -> $(array)
2994 if ( match[ 1 ] ) {
2995 context = context instanceof jQuery ? context[ 0 ] : context;
2996
2997 // Option to run scripts is true for back-compat
2998 // Intentionally let the error be thrown if parseHTML is not present
2999 jQuery.merge( this, jQuery.parseHTML(
3000 match[ 1 ],
3001 context && context.nodeType ? context.ownerDocument || context : document,
3002 true
3003 ) );
3004
3005 // HANDLE: $(html, props)
3006 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
3007 for ( match in context ) {
3008
3009 // Properties of context are called as methods if possible
3010 if ( jQuery.isFunction( this[ match ] ) ) {
3011 this[ match ]( context[ match ] );
3012
3013 // ...and otherwise set as attributes
3014 } else {
3015 this.attr( match, context[ match ] );
3016 }
3017 }
3018 }
3019
3020 return this;
3021
3022 // HANDLE: $(#id)
3023 } else {
3024 elem = document.getElementById( match[ 2 ] );
3025
3026 if ( elem ) {
3027
3028 // Inject the element directly into the jQuery object
3029 this[ 0 ] = elem;
3030 this.length = 1;
3031 }
3032 return this;
3033 }
3034
3035 // HANDLE: $(expr, $(...))
3036 } else if ( !context || context.jquery ) {
3037 return ( context || root ).find( selector );
3038
3039 // HANDLE: $(expr, context)
3040 // (which is just equivalent to: $(context).find(expr)
3041 } else {
3042 return this.constructor( context ).find( selector );
3043 }
3044
3045 // HANDLE: $(DOMElement)
3046 } else if ( selector.nodeType ) {
3047 this[ 0 ] = selector;
3048 this.length = 1;
3049 return this;
3050
3051 // HANDLE: $(function)
3052 // Shortcut for document ready
3053 } else if ( jQuery.isFunction( selector ) ) {
3054 return root.ready !== undefined ?
3055 root.ready( selector ) :
3056
3057 // Execute immediately if ready is not present
3058 selector( jQuery );
3059 }
3060
3061 return jQuery.makeArray( selector, this );
3062 };
3063
3064// Give the init function the jQuery prototype for later instantiation
3065init.prototype = jQuery.fn;
3066
3067// Initialize central reference
3068rootjQuery = jQuery( document );
3069
3070
3071var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3072
3073 // Methods guaranteed to produce a unique set when starting from a unique set
3074 guaranteedUnique = {
3075 children: true,
3076 contents: true,
3077 next: true,
3078 prev: true
3079 };
3080
3081jQuery.fn.extend( {
3082 has: function( target ) {
3083 var targets = jQuery( target, this ),
3084 l = targets.length;
3085
3086 return this.filter( function() {
3087 var i = 0;
3088 for ( ; i < l; i++ ) {
3089 if ( jQuery.contains( this, targets[ i ] ) ) {
3090 return true;
3091 }
3092 }
3093 } );
3094 },
3095
3096 closest: function( selectors, context ) {
3097 var cur,
3098 i = 0,
3099 l = this.length,
3100 matched = [],
3101 targets = typeof selectors !== "string" && jQuery( selectors );
3102
3103 // Positional selectors never match, since there's no _selection_ context
3104 if ( !rneedsContext.test( selectors ) ) {
3105 for ( ; i < l; i++ ) {
3106 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3107
3108 // Always skip document fragments
3109 if ( cur.nodeType < 11 && ( targets ?
3110 targets.index( cur ) > -1 :
3111
3112 // Don't pass non-elements to Sizzle
3113 cur.nodeType === 1 &&
3114 jQuery.find.matchesSelector( cur, selectors ) ) ) {
3115
3116 matched.push( cur );
3117 break;
3118 }
3119 }
3120 }
3121 }
3122
3123 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3124 },
3125
3126 // Determine the position of an element within the set
3127 index: function( elem ) {
3128
3129 // No argument, return index in parent
3130 if ( !elem ) {
3131 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3132 }
3133
3134 // Index in selector
3135 if ( typeof elem === "string" ) {
3136 return indexOf.call( jQuery( elem ), this[ 0 ] );
3137 }
3138
3139 // Locate the position of the desired element
3140 return indexOf.call( this,
3141
3142 // If it receives a jQuery object, the first element is used
3143 elem.jquery ? elem[ 0 ] : elem
3144 );
3145 },
3146
3147 add: function( selector, context ) {
3148 return this.pushStack(
3149 jQuery.uniqueSort(
3150 jQuery.merge( this.get(), jQuery( selector, context ) )
3151 )
3152 );
3153 },
3154
3155 addBack: function( selector ) {
3156 return this.add( selector == null ?
3157 this.prevObject : this.prevObject.filter( selector )
3158 );
3159 }
3160} );
3161
3162function sibling( cur, dir ) {
3163 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3164 return cur;
3165}
3166
3167jQuery.each( {
3168 parent: function( elem ) {
3169 var parent = elem.parentNode;
3170 return parent && parent.nodeType !== 11 ? parent : null;
3171 },
3172 parents: function( elem ) {
3173 return dir( elem, "parentNode" );
3174 },
3175 parentsUntil: function( elem, i, until ) {
3176 return dir( elem, "parentNode", until );
3177 },
3178 next: function( elem ) {
3179 return sibling( elem, "nextSibling" );
3180 },
3181 prev: function( elem ) {
3182 return sibling( elem, "previousSibling" );
3183 },
3184 nextAll: function( elem ) {
3185 return dir( elem, "nextSibling" );
3186 },
3187 prevAll: function( elem ) {
3188 return dir( elem, "previousSibling" );
3189 },
3190 nextUntil: function( elem, i, until ) {
3191 return dir( elem, "nextSibling", until );
3192 },
3193 prevUntil: function( elem, i, until ) {
3194 return dir( elem, "previousSibling", until );
3195 },
3196 siblings: function( elem ) {
3197 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3198 },
3199 children: function( elem ) {
3200 return siblings( elem.firstChild );
3201 },
3202 contents: function( elem ) {
3203 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
3204 }
3205}, function( name, fn ) {
3206 jQuery.fn[ name ] = function( until, selector ) {
3207 var matched = jQuery.map( this, fn, until );
3208
3209 if ( name.slice( -5 ) !== "Until" ) {
3210 selector = until;
3211 }
3212
3213 if ( selector && typeof selector === "string" ) {
3214 matched = jQuery.filter( selector, matched );
3215 }
3216
3217 if ( this.length > 1 ) {
3218
3219 // Remove duplicates
3220 if ( !guaranteedUnique[ name ] ) {
3221 jQuery.uniqueSort( matched );
3222 }
3223
3224 // Reverse order for parents* and prev-derivatives
3225 if ( rparentsprev.test( name ) ) {
3226 matched.reverse();
3227 }
3228 }
3229
3230 return this.pushStack( matched );
3231 };
3232} );
3233var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
3234
3235
3236
3237// Convert String-formatted options into Object-formatted ones
3238function createOptions( options ) {
3239 var object = {};
3240 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
3241 object[ flag ] = true;
3242 } );
3243 return object;
3244}
3245
3246/*
3247 * Create a callback list using the following parameters:
3248 *
3249 * options: an optional list of space-separated options that will change how
3250 * the callback list behaves or a more traditional option object
3251 *
3252 * By default a callback list will act like an event callback list and can be
3253 * "fired" multiple times.
3254 *
3255 * Possible options:
3256 *
3257 * once: will ensure the callback list can only be fired once (like a Deferred)
3258 *
3259 * memory: will keep track of previous values and will call any callback added
3260 * after the list has been fired right away with the latest "memorized"
3261 * values (like a Deferred)
3262 *
3263 * unique: will ensure a callback can only be added once (no duplicate in the list)
3264 *
3265 * stopOnFalse: interrupt callings when a callback returns false
3266 *
3267 */
3268jQuery.Callbacks = function( options ) {
3269
3270 // Convert options from String-formatted to Object-formatted if needed
3271 // (we check in cache first)
3272 options = typeof options === "string" ?
3273 createOptions( options ) :
3274 jQuery.extend( {}, options );
3275
3276 var // Flag to know if list is currently firing
3277 firing,
3278
3279 // Last fire value for non-forgettable lists
3280 memory,
3281
3282 // Flag to know if list was already fired
3283 fired,
3284
3285 // Flag to prevent firing
3286 locked,
3287
3288 // Actual callback list
3289 list = [],
3290
3291 // Queue of execution data for repeatable lists
3292 queue = [],
3293
3294 // Index of currently firing callback (modified by add/remove as needed)
3295 firingIndex = -1,
3296
3297 // Fire callbacks
3298 fire = function() {
3299
3300 // Enforce single-firing
3301 locked = options.once;
3302
3303 // Execute callbacks for all pending executions,
3304 // respecting firingIndex overrides and runtime changes
3305 fired = firing = true;
3306 for ( ; queue.length; firingIndex = -1 ) {
3307 memory = queue.shift();
3308 while ( ++firingIndex < list.length ) {
3309
3310 // Run callback and check for early termination
3311 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3312 options.stopOnFalse ) {
3313
3314 // Jump to end and forget the data so .add doesn't re-fire
3315 firingIndex = list.length;
3316 memory = false;
3317 }
3318 }
3319 }
3320
3321 // Forget the data if we're done with it
3322 if ( !options.memory ) {
3323 memory = false;
3324 }
3325
3326 firing = false;
3327
3328 // Clean up if we're done firing for good
3329 if ( locked ) {
3330
3331 // Keep an empty list if we have data for future add calls
3332 if ( memory ) {
3333 list = [];
3334
3335 // Otherwise, this object is spent
3336 } else {
3337 list = "";
3338 }
3339 }
3340 },
3341
3342 // Actual Callbacks object
3343 self = {
3344
3345 // Add a callback or a collection of callbacks to the list
3346 add: function() {
3347 if ( list ) {
3348
3349 // If we have memory from a past run, we should fire after adding
3350 if ( memory && !firing ) {
3351 firingIndex = list.length - 1;
3352 queue.push( memory );
3353 }
3354
3355 ( function add( args ) {
3356 jQuery.each( args, function( _, arg ) {
3357 if ( jQuery.isFunction( arg ) ) {
3358 if ( !options.unique || !self.has( arg ) ) {
3359 list.push( arg );
3360 }
3361 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
3362
3363 // Inspect recursively
3364 add( arg );
3365 }
3366 } );
3367 } )( arguments );
3368
3369 if ( memory && !firing ) {
3370 fire();
3371 }
3372 }
3373 return this;
3374 },
3375
3376 // Remove a callback from the list
3377 remove: function() {
3378 jQuery.each( arguments, function( _, arg ) {
3379 var index;
3380 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3381 list.splice( index, 1 );
3382
3383 // Handle firing indexes
3384 if ( index <= firingIndex ) {
3385 firingIndex--;
3386 }
3387 }
3388 } );
3389 return this;
3390 },
3391
3392 // Check if a given callback is in the list.
3393 // If no argument is given, return whether or not list has callbacks attached.
3394 has: function( fn ) {
3395 return fn ?
3396 jQuery.inArray( fn, list ) > -1 :
3397 list.length > 0;
3398 },
3399
3400 // Remove all callbacks from the list
3401 empty: function() {
3402 if ( list ) {
3403 list = [];
3404 }
3405 return this;
3406 },
3407
3408 // Disable .fire and .add
3409 // Abort any current/pending executions
3410 // Clear all callbacks and values
3411 disable: function() {
3412 locked = queue = [];
3413 list = memory = "";
3414 return this;
3415 },
3416 disabled: function() {
3417 return !list;
3418 },
3419
3420 // Disable .fire
3421 // Also disable .add unless we have memory (since it would have no effect)
3422 // Abort any pending executions
3423 lock: function() {
3424 locked = queue = [];
3425 if ( !memory && !firing ) {
3426 list = memory = "";
3427 }
3428 return this;
3429 },
3430 locked: function() {
3431 return !!locked;
3432 },
3433
3434 // Call all callbacks with the given context and arguments
3435 fireWith: function( context, args ) {
3436 if ( !locked ) {
3437 args = args || [];
3438 args = [ context, args.slice ? args.slice() : args ];
3439 queue.push( args );
3440 if ( !firing ) {
3441 fire();
3442 }
3443 }
3444 return this;
3445 },
3446
3447 // Call all the callbacks with the given arguments
3448 fire: function() {
3449 self.fireWith( this, arguments );
3450 return this;
3451 },
3452
3453 // To know if the callbacks have already been called at least once
3454 fired: function() {
3455 return !!fired;
3456 }
3457 };
3458
3459 return self;
3460};
3461
3462
3463function Identity( v ) {
3464 return v;
3465}
3466function Thrower( ex ) {
3467 throw ex;
3468}
3469
3470function adoptValue( value, resolve, reject ) {
3471 var method;
3472
3473 try {
3474
3475 // Check for promise aspect first to privilege synchronous behavior
3476 if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
3477 method.call( value ).done( resolve ).fail( reject );
3478
3479 // Other thenables
3480 } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
3481 method.call( value, resolve, reject );
3482
3483 // Other non-thenables
3484 } else {
3485
3486 // Support: Android 4.0 only
3487 // Strict mode functions invoked without .call/.apply get global-object context
3488 resolve.call( undefined, value );
3489 }
3490
3491 // For Promises/A+, convert exceptions into rejections
3492 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3493 // Deferred#then to conditionally suppress rejection.
3494 } catch ( value ) {
3495
3496 // Support: Android 4.0 only
3497 // Strict mode functions invoked without .call/.apply get global-object context
3498 reject.call( undefined, value );
3499 }
3500}
3501
3502jQuery.extend( {
3503
3504 Deferred: function( func ) {
3505 var tuples = [
3506
3507 // action, add listener, callbacks,
3508 // ... .then handlers, argument index, [final state]
3509 [ "notify", "progress", jQuery.Callbacks( "memory" ),
3510 jQuery.Callbacks( "memory" ), 2 ],
3511 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
3512 jQuery.Callbacks( "once memory" ), 0, "resolved" ],
3513 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
3514 jQuery.Callbacks( "once memory" ), 1, "rejected" ]
3515 ],
3516 state = "pending",
3517 promise = {
3518 state: function() {
3519 return state;
3520 },
3521 always: function() {
3522 deferred.done( arguments ).fail( arguments );
3523 return this;
3524 },
3525 "catch": function( fn ) {
3526 return promise.then( null, fn );
3527 },
3528
3529 // Keep pipe for back-compat
3530 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
3531 var fns = arguments;
3532
3533 return jQuery.Deferred( function( newDefer ) {
3534 jQuery.each( tuples, function( i, tuple ) {
3535
3536 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3537 var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
3538
3539 // deferred.progress(function() { bind to newDefer or newDefer.notify })
3540 // deferred.done(function() { bind to newDefer or newDefer.resolve })
3541 // deferred.fail(function() { bind to newDefer or newDefer.reject })
3542 deferred[ tuple[ 1 ] ]( function() {
3543 var returned = fn && fn.apply( this, arguments );
3544 if ( returned && jQuery.isFunction( returned.promise ) ) {
3545 returned.promise()
3546 .progress( newDefer.notify )
3547 .done( newDefer.resolve )
3548 .fail( newDefer.reject );
3549 } else {
3550 newDefer[ tuple[ 0 ] + "With" ](
3551 this,
3552 fn ? [ returned ] : arguments
3553 );
3554 }
3555 } );
3556 } );
3557 fns = null;
3558 } ).promise();
3559 },
3560 then: function( onFulfilled, onRejected, onProgress ) {
3561 var maxDepth = 0;
3562 function resolve( depth, deferred, handler, special ) {
3563 return function() {
3564 var that = this,
3565 args = arguments,
3566 mightThrow = function() {
3567 var returned, then;
3568
3569 // Support: Promises/A+ section 2.3.3.3.3
3570 // https://promisesaplus.com/#point-59
3571 // Ignore double-resolution attempts
3572 if ( depth < maxDepth ) {
3573 return;
3574 }
3575
3576 returned = handler.apply( that, args );
3577
3578 // Support: Promises/A+ section 2.3.1
3579 // https://promisesaplus.com/#point-48
3580 if ( returned === deferred.promise() ) {
3581 throw new TypeError( "Thenable self-resolution" );
3582 }
3583
3584 // Support: Promises/A+ sections 2.3.3.1, 3.5
3585 // https://promisesaplus.com/#point-54
3586 // https://promisesaplus.com/#point-75
3587 // Retrieve `then` only once
3588 then = returned &&
3589
3590 // Support: Promises/A+ section 2.3.4
3591 // https://promisesaplus.com/#point-64
3592 // Only check objects and functions for thenability
3593 ( typeof returned === "object" ||
3594 typeof returned === "function" ) &&
3595 returned.then;
3596
3597 // Handle a returned thenable
3598 if ( jQuery.isFunction( then ) ) {
3599
3600 // Special processors (notify) just wait for resolution
3601 if ( special ) {
3602 then.call(
3603 returned,
3604 resolve( maxDepth, deferred, Identity, special ),
3605 resolve( maxDepth, deferred, Thrower, special )
3606 );
3607
3608 // Normal processors (resolve) also hook into progress
3609 } else {
3610
3611 // ...and disregard older resolution values
3612 maxDepth++;
3613
3614 then.call(
3615 returned,
3616 resolve( maxDepth, deferred, Identity, special ),
3617 resolve( maxDepth, deferred, Thrower, special ),
3618 resolve( maxDepth, deferred, Identity,
3619 deferred.notifyWith )
3620 );
3621 }
3622
3623 // Handle all other returned values
3624 } else {
3625
3626 // Only substitute handlers pass on context
3627 // and multiple values (non-spec behavior)
3628 if ( handler !== Identity ) {
3629 that = undefined;
3630 args = [ returned ];
3631 }
3632
3633 // Process the value(s)
3634 // Default process is resolve
3635 ( special || deferred.resolveWith )( that, args );
3636 }
3637 },
3638
3639 // Only normal processors (resolve) catch and reject exceptions
3640 process = special ?
3641 mightThrow :
3642 function() {
3643 try {
3644 mightThrow();
3645 } catch ( e ) {
3646
3647 if ( jQuery.Deferred.exceptionHook ) {
3648 jQuery.Deferred.exceptionHook( e,
3649 process.stackTrace );
3650 }
3651
3652 // Support: Promises/A+ section 2.3.3.3.4.1
3653 // https://promisesaplus.com/#point-61
3654 // Ignore post-resolution exceptions
3655 if ( depth + 1 >= maxDepth ) {
3656
3657 // Only substitute handlers pass on context
3658 // and multiple values (non-spec behavior)
3659 if ( handler !== Thrower ) {
3660 that = undefined;
3661 args = [ e ];
3662 }
3663
3664 deferred.rejectWith( that, args );
3665 }
3666 }
3667 };
3668
3669 // Support: Promises/A+ section 2.3.3.3.1
3670 // https://promisesaplus.com/#point-57
3671 // Re-resolve promises immediately to dodge false rejection from
3672 // subsequent errors
3673 if ( depth ) {
3674 process();
3675 } else {
3676
3677 // Call an optional hook to record the stack, in case of exception
3678 // since it's otherwise lost when execution goes async
3679 if ( jQuery.Deferred.getStackHook ) {
3680 process.stackTrace = jQuery.Deferred.getStackHook();
3681 }
3682 window.setTimeout( process );
3683 }
3684 };
3685 }
3686
3687 return jQuery.Deferred( function( newDefer ) {
3688
3689 // progress_handlers.add( ... )
3690 tuples[ 0 ][ 3 ].add(
3691 resolve(
3692 0,
3693 newDefer,
3694 jQuery.isFunction( onProgress ) ?
3695 onProgress :
3696 Identity,
3697 newDefer.notifyWith
3698 )
3699 );
3700
3701 // fulfilled_handlers.add( ... )
3702 tuples[ 1 ][ 3 ].add(
3703 resolve(
3704 0,
3705 newDefer,
3706 jQuery.isFunction( onFulfilled ) ?
3707 onFulfilled :
3708 Identity
3709 )
3710 );
3711
3712 // rejected_handlers.add( ... )
3713 tuples[ 2 ][ 3 ].add(
3714 resolve(
3715 0,
3716 newDefer,
3717 jQuery.isFunction( onRejected ) ?
3718 onRejected :
3719 Thrower
3720 )
3721 );
3722 } ).promise();
3723 },
3724
3725 // Get a promise for this deferred
3726 // If obj is provided, the promise aspect is added to the object
3727 promise: function( obj ) {
3728 return obj != null ? jQuery.extend( obj, promise ) : promise;
3729 }
3730 },
3731 deferred = {};
3732
3733 // Add list-specific methods
3734 jQuery.each( tuples, function( i, tuple ) {
3735 var list = tuple[ 2 ],
3736 stateString = tuple[ 5 ];
3737
3738 // promise.progress = list.add
3739 // promise.done = list.add
3740 // promise.fail = list.add
3741 promise[ tuple[ 1 ] ] = list.add;
3742
3743 // Handle state
3744 if ( stateString ) {
3745 list.add(
3746 function() {
3747
3748 // state = "resolved" (i.e., fulfilled)
3749 // state = "rejected"
3750 state = stateString;
3751 },
3752
3753 // rejected_callbacks.disable
3754 // fulfilled_callbacks.disable
3755 tuples[ 3 - i ][ 2 ].disable,
3756
3757 // progress_callbacks.lock
3758 tuples[ 0 ][ 2 ].lock
3759 );
3760 }
3761
3762 // progress_handlers.fire
3763 // fulfilled_handlers.fire
3764 // rejected_handlers.fire
3765 list.add( tuple[ 3 ].fire );
3766
3767 // deferred.notify = function() { deferred.notifyWith(...) }
3768 // deferred.resolve = function() { deferred.resolveWith(...) }
3769 // deferred.reject = function() { deferred.rejectWith(...) }
3770 deferred[ tuple[ 0 ] ] = function() {
3771 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
3772 return this;
3773 };
3774
3775 // deferred.notifyWith = list.fireWith
3776 // deferred.resolveWith = list.fireWith
3777 // deferred.rejectWith = list.fireWith
3778 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3779 } );
3780
3781 // Make the deferred a promise
3782 promise.promise( deferred );
3783
3784 // Call given func if any
3785 if ( func ) {
3786 func.call( deferred, deferred );
3787 }
3788
3789 // All done!
3790 return deferred;
3791 },
3792
3793 // Deferred helper
3794 when: function( singleValue ) {
3795 var
3796
3797 // count of uncompleted subordinates
3798 remaining = arguments.length,
3799
3800 // count of unprocessed arguments
3801 i = remaining,
3802
3803 // subordinate fulfillment data
3804 resolveContexts = Array( i ),
3805 resolveValues = slice.call( arguments ),
3806
3807 // the master Deferred
3808 master = jQuery.Deferred(),
3809
3810 // subordinate callback factory
3811 updateFunc = function( i ) {
3812 return function( value ) {
3813 resolveContexts[ i ] = this;
3814 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3815 if ( !( --remaining ) ) {
3816 master.resolveWith( resolveContexts, resolveValues );
3817 }
3818 };
3819 };
3820
3821 // Single- and empty arguments are adopted like Promise.resolve
3822 if ( remaining <= 1 ) {
3823 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
3824
3825 // Use .then() to unwrap secondary thenables (cf. gh-3000)
3826 if ( master.state() === "pending" ||
3827 jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
3828
3829 return master.then();
3830 }
3831 }
3832
3833 // Multiple arguments are aggregated like Promise.all array elements
3834 while ( i-- ) {
3835 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
3836 }
3837
3838 return master.promise();
3839 }
3840} );
3841
3842
3843// These usually indicate a programmer mistake during development,
3844// warn about them ASAP rather than swallowing them by default.
3845var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
3846
3847jQuery.Deferred.exceptionHook = function( error, stack ) {
3848
3849 // Support: IE 8 - 9 only
3850 // Console exists when dev tools are open, which can happen at any time
3851 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
3852 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
3853 }
3854};
3855
3856
3857
3858
3859jQuery.readyException = function( error ) {
3860 window.setTimeout( function() {
3861 throw error;
3862 } );
3863};
3864
3865
3866
3867
3868// The deferred used on DOM ready
3869var readyList = jQuery.Deferred();
3870
3871jQuery.fn.ready = function( fn ) {
3872
3873 readyList
3874 .then( fn )
3875
3876 // Wrap jQuery.readyException in a function so that the lookup
3877 // happens at the time of error handling instead of callback
3878 // registration.
3879 .catch( function( error ) {
3880 jQuery.readyException( error );
3881 } );
3882
3883 return this;
3884};
3885
3886jQuery.extend( {
3887
3888 // Is the DOM ready to be used? Set to true once it occurs.
3889 isReady: false,
3890
3891 // A counter to track how many items to wait for before
3892 // the ready event fires. See #6781
3893 readyWait: 1,
3894
3895 // Hold (or release) the ready event
3896 holdReady: function( hold ) {
3897 if ( hold ) {
3898 jQuery.readyWait++;
3899 } else {
3900 jQuery.ready( true );
3901 }
3902 },
3903
3904 // Handle when the DOM is ready
3905 ready: function( wait ) {
3906
3907 // Abort if there are pending holds or we're already ready
3908 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3909 return;
3910 }
3911
3912 // Remember that the DOM is ready
3913 jQuery.isReady = true;
3914
3915 // If a normal DOM Ready event fired, decrement, and wait if need be
3916 if ( wait !== true && --jQuery.readyWait > 0 ) {
3917 return;
3918 }
3919
3920 // If there are functions bound, to execute
3921 readyList.resolveWith( document, [ jQuery ] );
3922 }
3923} );
3924
3925jQuery.ready.then = readyList.then;
3926
3927// The ready event handler and self cleanup method
3928function completed() {
3929 document.removeEventListener( "DOMContentLoaded", completed );
3930 window.removeEventListener( "load", completed );
3931 jQuery.ready();
3932}
3933
3934// Catch cases where $(document).ready() is called
3935// after the browser event has already occurred.
3936// Support: IE <=9 - 10 only
3937// Older IE sometimes signals "interactive" too soon
3938if ( document.readyState === "complete" ||
3939 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
3940
3941 // Handle it asynchronously to allow scripts the opportunity to delay ready
3942 window.setTimeout( jQuery.ready );
3943
3944} else {
3945
3946 // Use the handy event callback
3947 document.addEventListener( "DOMContentLoaded", completed );
3948
3949 // A fallback to window.onload, that will always work
3950 window.addEventListener( "load", completed );
3951}
3952
3953
3954
3955
3956// Multifunctional method to get and set values of a collection
3957// The value/s can optionally be executed if it's a function
3958var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3959 var i = 0,
3960 len = elems.length,
3961 bulk = key == null;
3962
3963 // Sets many values
3964 if ( jQuery.type( key ) === "object" ) {
3965 chainable = true;
3966 for ( i in key ) {
3967 access( elems, fn, i, key[ i ], true, emptyGet, raw );
3968 }
3969
3970 // Sets one value
3971 } else if ( value !== undefined ) {
3972 chainable = true;
3973
3974 if ( !jQuery.isFunction( value ) ) {
3975 raw = true;
3976 }
3977
3978 if ( bulk ) {
3979
3980 // Bulk operations run against the entire set
3981 if ( raw ) {
3982 fn.call( elems, value );
3983 fn = null;
3984
3985 // ...except when executing function values
3986 } else {
3987 bulk = fn;
3988 fn = function( elem, key, value ) {
3989 return bulk.call( jQuery( elem ), value );
3990 };
3991 }
3992 }
3993
3994 if ( fn ) {
3995 for ( ; i < len; i++ ) {
3996 fn(
3997 elems[ i ], key, raw ?
3998 value :
3999 value.call( elems[ i ], i, fn( elems[ i ], key ) )
4000 );
4001 }
4002 }
4003 }
4004
4005 if ( chainable ) {
4006 return elems;
4007 }
4008
4009 // Gets
4010 if ( bulk ) {
4011 return fn.call( elems );
4012 }
4013
4014 return len ? fn( elems[ 0 ], key ) : emptyGet;
4015};
4016var acceptData = function( owner ) {
4017
4018 // Accepts only:
4019 // - Node
4020 // - Node.ELEMENT_NODE
4021 // - Node.DOCUMENT_NODE
4022 // - Object
4023 // - Any
4024 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
4025};
4026
4027
4028
4029
4030function Data() {
4031 this.expando = jQuery.expando + Data.uid++;
4032}
4033
4034Data.uid = 1;
4035
4036Data.prototype = {
4037
4038 cache: function( owner ) {
4039
4040 // Check if the owner object already has a cache
4041 var value = owner[ this.expando ];
4042
4043 // If not, create one
4044 if ( !value ) {
4045 value = {};
4046
4047 // We can accept data for non-element nodes in modern browsers,
4048 // but we should not, see #8335.
4049 // Always return an empty object.
4050 if ( acceptData( owner ) ) {
4051
4052 // If it is a node unlikely to be stringify-ed or looped over
4053 // use plain assignment
4054 if ( owner.nodeType ) {
4055 owner[ this.expando ] = value;
4056
4057 // Otherwise secure it in a non-enumerable property
4058 // configurable must be true to allow the property to be
4059 // deleted when data is removed
4060 } else {
4061 Object.defineProperty( owner, this.expando, {
4062 value: value,
4063 configurable: true
4064 } );
4065 }
4066 }
4067 }
4068
4069 return value;
4070 },
4071 set: function( owner, data, value ) {
4072 var prop,
4073 cache = this.cache( owner );
4074
4075 // Handle: [ owner, key, value ] args
4076 // Always use camelCase key (gh-2257)
4077 if ( typeof data === "string" ) {
4078 cache[ jQuery.camelCase( data ) ] = value;
4079
4080 // Handle: [ owner, { properties } ] args
4081 } else {
4082
4083 // Copy the properties one-by-one to the cache object
4084 for ( prop in data ) {
4085 cache[ jQuery.camelCase( prop ) ] = data[ prop ];
4086 }
4087 }
4088 return cache;
4089 },
4090 get: function( owner, key ) {
4091 return key === undefined ?
4092 this.cache( owner ) :
4093
4094 // Always use camelCase key (gh-2257)
4095 owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
4096 },
4097 access: function( owner, key, value ) {
4098
4099 // In cases where either:
4100 //
4101 // 1. No key was specified
4102 // 2. A string key was specified, but no value provided
4103 //
4104 // Take the "read" path and allow the get method to determine
4105 // which value to return, respectively either:
4106 //
4107 // 1. The entire cache object
4108 // 2. The data stored at the key
4109 //
4110 if ( key === undefined ||
4111 ( ( key && typeof key === "string" ) && value === undefined ) ) {
4112
4113 return this.get( owner, key );
4114 }
4115
4116 // When the key is not a string, or both a key and value
4117 // are specified, set or extend (existing objects) with either:
4118 //
4119 // 1. An object of properties
4120 // 2. A key and value
4121 //
4122 this.set( owner, key, value );
4123
4124 // Since the "set" path can have two possible entry points
4125 // return the expected data based on which path was taken[*]
4126 return value !== undefined ? value : key;
4127 },
4128 remove: function( owner, key ) {
4129 var i,
4130 cache = owner[ this.expando ];
4131
4132 if ( cache === undefined ) {
4133 return;
4134 }
4135
4136 if ( key !== undefined ) {
4137
4138 // Support array or space separated string of keys
4139 if ( jQuery.isArray( key ) ) {
4140
4141 // If key is an array of keys...
4142 // We always set camelCase keys, so remove that.
4143 key = key.map( jQuery.camelCase );
4144 } else {
4145 key = jQuery.camelCase( key );
4146
4147 // If a key with the spaces exists, use it.
4148 // Otherwise, create an array by matching non-whitespace
4149 key = key in cache ?
4150 [ key ] :
4151 ( key.match( rnothtmlwhite ) || [] );
4152 }
4153
4154 i = key.length;
4155
4156 while ( i-- ) {
4157 delete cache[ key[ i ] ];
4158 }
4159 }
4160
4161 // Remove the expando if there's no more data
4162 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
4163
4164 // Support: Chrome <=35 - 45
4165 // Webkit & Blink performance suffers when deleting properties
4166 // from DOM nodes, so set to undefined instead
4167 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4168 if ( owner.nodeType ) {
4169 owner[ this.expando ] = undefined;
4170 } else {
4171 delete owner[ this.expando ];
4172 }
4173 }
4174 },
4175 hasData: function( owner ) {
4176 var cache = owner[ this.expando ];
4177 return cache !== undefined && !jQuery.isEmptyObject( cache );
4178 }
4179};
4180var dataPriv = new Data();
4181
4182var dataUser = new Data();
4183
4184
4185
4186// Implementation Summary
4187//
4188// 1. Enforce API surface and semantic compatibility with 1.9.x branch
4189// 2. Improve the module's maintainability by reducing the storage
4190// paths to a single mechanism.
4191// 3. Use the same single mechanism to support "private" and "user" data.
4192// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4193// 5. Avoid exposing implementation details on user objects (eg. expando properties)
4194// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
4195
4196var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4197 rmultiDash = /[A-Z]/g;
4198
4199function getData( data ) {
4200 if ( data === "true" ) {
4201 return true;
4202 }
4203
4204 if ( data === "false" ) {
4205 return false;
4206 }
4207
4208 if ( data === "null" ) {
4209 return null;
4210 }
4211
4212 // Only convert to a number if it doesn't change the string
4213 if ( data === +data + "" ) {
4214 return +data;
4215 }
4216
4217 if ( rbrace.test( data ) ) {
4218 return JSON.parse( data );
4219 }
4220
4221 return data;
4222}
4223
4224function dataAttr( elem, key, data ) {
4225 var name;
4226
4227 // If nothing was found internally, try to fetch any
4228 // data from the HTML5 data-* attribute
4229 if ( data === undefined && elem.nodeType === 1 ) {
4230 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
4231 data = elem.getAttribute( name );
4232
4233 if ( typeof data === "string" ) {
4234 try {
4235 data = getData( data );
4236 } catch ( e ) {}
4237
4238 // Make sure we set the data so it isn't changed later
4239 dataUser.set( elem, key, data );
4240 } else {
4241 data = undefined;
4242 }
4243 }
4244 return data;
4245}
4246
4247jQuery.extend( {
4248 hasData: function( elem ) {
4249 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
4250 },
4251
4252 data: function( elem, name, data ) {
4253 return dataUser.access( elem, name, data );
4254 },
4255
4256 removeData: function( elem, name ) {
4257 dataUser.remove( elem, name );
4258 },
4259
4260 // TODO: Now that all calls to _data and _removeData have been replaced
4261 // with direct calls to dataPriv methods, these can be deprecated.
4262 _data: function( elem, name, data ) {
4263 return dataPriv.access( elem, name, data );
4264 },
4265
4266 _removeData: function( elem, name ) {
4267 dataPriv.remove( elem, name );
4268 }
4269} );
4270
4271jQuery.fn.extend( {
4272 data: function( key, value ) {
4273 var i, name, data,
4274 elem = this[ 0 ],
4275 attrs = elem && elem.attributes;
4276
4277 // Gets all values
4278 if ( key === undefined ) {
4279 if ( this.length ) {
4280 data = dataUser.get( elem );
4281
4282 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
4283 i = attrs.length;
4284 while ( i-- ) {
4285
4286 // Support: IE 11 only
4287 // The attrs elements can be null (#14894)
4288 if ( attrs[ i ] ) {
4289 name = attrs[ i ].name;
4290 if ( name.indexOf( "data-" ) === 0 ) {
4291 name = jQuery.camelCase( name.slice( 5 ) );
4292 dataAttr( elem, name, data[ name ] );
4293 }
4294 }
4295 }
4296 dataPriv.set( elem, "hasDataAttrs", true );
4297 }
4298 }
4299
4300 return data;
4301 }
4302
4303 // Sets multiple values
4304 if ( typeof key === "object" ) {
4305 return this.each( function() {
4306 dataUser.set( this, key );
4307 } );
4308 }
4309
4310 return access( this, function( value ) {
4311 var data;
4312
4313 // The calling jQuery object (element matches) is not empty
4314 // (and therefore has an element appears at this[ 0 ]) and the
4315 // `value` parameter was not undefined. An empty jQuery object
4316 // will result in `undefined` for elem = this[ 0 ] which will
4317 // throw an exception if an attempt to read a data cache is made.
4318 if ( elem && value === undefined ) {
4319
4320 // Attempt to get data from the cache
4321 // The key will always be camelCased in Data
4322 data = dataUser.get( elem, key );
4323 if ( data !== undefined ) {
4324 return data;
4325 }
4326
4327 // Attempt to "discover" the data in
4328 // HTML5 custom data-* attrs
4329 data = dataAttr( elem, key );
4330 if ( data !== undefined ) {
4331 return data;
4332 }
4333
4334 // We tried really hard, but the data doesn't exist.
4335 return;
4336 }
4337
4338 // Set the data...
4339 this.each( function() {
4340
4341 // We always store the camelCased key
4342 dataUser.set( this, key, value );
4343 } );
4344 }, null, value, arguments.length > 1, null, true );
4345 },
4346
4347 removeData: function( key ) {
4348 return this.each( function() {
4349 dataUser.remove( this, key );
4350 } );
4351 }
4352} );
4353
4354
4355jQuery.extend( {
4356 queue: function( elem, type, data ) {
4357 var queue;
4358
4359 if ( elem ) {
4360 type = ( type || "fx" ) + "queue";
4361 queue = dataPriv.get( elem, type );
4362
4363 // Speed up dequeue by getting out quickly if this is just a lookup
4364 if ( data ) {
4365 if ( !queue || jQuery.isArray( data ) ) {
4366 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4367 } else {
4368 queue.push( data );
4369 }
4370 }
4371 return queue || [];
4372 }
4373 },
4374
4375 dequeue: function( elem, type ) {
4376 type = type || "fx";
4377
4378 var queue = jQuery.queue( elem, type ),
4379 startLength = queue.length,
4380 fn = queue.shift(),
4381 hooks = jQuery._queueHooks( elem, type ),
4382 next = function() {
4383 jQuery.dequeue( elem, type );
4384 };
4385
4386 // If the fx queue is dequeued, always remove the progress sentinel
4387 if ( fn === "inprogress" ) {
4388 fn = queue.shift();
4389 startLength--;
4390 }
4391
4392 if ( fn ) {
4393
4394 // Add a progress sentinel to prevent the fx queue from being
4395 // automatically dequeued
4396 if ( type === "fx" ) {
4397 queue.unshift( "inprogress" );
4398 }
4399
4400 // Clear up the last queue stop function
4401 delete hooks.stop;
4402 fn.call( elem, next, hooks );
4403 }
4404
4405 if ( !startLength && hooks ) {
4406 hooks.empty.fire();
4407 }
4408 },
4409
4410 // Not public - generate a queueHooks object, or return the current one
4411 _queueHooks: function( elem, type ) {
4412 var key = type + "queueHooks";
4413 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4414 empty: jQuery.Callbacks( "once memory" ).add( function() {
4415 dataPriv.remove( elem, [ type + "queue", key ] );
4416 } )
4417 } );
4418 }
4419} );
4420
4421jQuery.fn.extend( {
4422 queue: function( type, data ) {
4423 var setter = 2;
4424
4425 if ( typeof type !== "string" ) {
4426 data = type;
4427 type = "fx";
4428 setter--;
4429 }
4430
4431 if ( arguments.length < setter ) {
4432 return jQuery.queue( this[ 0 ], type );
4433 }
4434
4435 return data === undefined ?
4436 this :
4437 this.each( function() {
4438 var queue = jQuery.queue( this, type, data );
4439
4440 // Ensure a hooks for this queue
4441 jQuery._queueHooks( this, type );
4442
4443 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4444 jQuery.dequeue( this, type );
4445 }
4446 } );
4447 },
4448 dequeue: function( type ) {
4449 return this.each( function() {
4450 jQuery.dequeue( this, type );
4451 } );
4452 },
4453 clearQueue: function( type ) {
4454 return this.queue( type || "fx", [] );
4455 },
4456
4457 // Get a promise resolved when queues of a certain type
4458 // are emptied (fx is the type by default)
4459 promise: function( type, obj ) {
4460 var tmp,
4461 count = 1,
4462 defer = jQuery.Deferred(),
4463 elements = this,
4464 i = this.length,
4465 resolve = function() {
4466 if ( !( --count ) ) {
4467 defer.resolveWith( elements, [ elements ] );
4468 }
4469 };
4470
4471 if ( typeof type !== "string" ) {
4472 obj = type;
4473 type = undefined;
4474 }
4475 type = type || "fx";
4476
4477 while ( i-- ) {
4478 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4479 if ( tmp && tmp.empty ) {
4480 count++;
4481 tmp.empty.add( resolve );
4482 }
4483 }
4484 resolve();
4485 return defer.promise( obj );
4486 }
4487} );
4488var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4489
4490var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4491
4492
4493var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4494
4495var isHiddenWithinTree = function( elem, el ) {
4496
4497 // isHiddenWithinTree might be called from jQuery#filter function;
4498 // in that case, element will be second argument
4499 elem = el || elem;
4500
4501 // Inline style trumps all
4502 return elem.style.display === "none" ||
4503 elem.style.display === "" &&
4504
4505 // Otherwise, check computed style
4506 // Support: Firefox <=43 - 45
4507 // Disconnected elements can have computed display: none, so first confirm that elem is
4508 // in the document.
4509 jQuery.contains( elem.ownerDocument, elem ) &&
4510
4511 jQuery.css( elem, "display" ) === "none";
4512 };
4513
4514var swap = function( elem, options, callback, args ) {
4515 var ret, name,
4516 old = {};
4517
4518 // Remember the old values, and insert the new ones
4519 for ( name in options ) {
4520 old[ name ] = elem.style[ name ];
4521 elem.style[ name ] = options[ name ];
4522 }
4523
4524 ret = callback.apply( elem, args || [] );
4525
4526 // Revert the old values
4527 for ( name in options ) {
4528 elem.style[ name ] = old[ name ];
4529 }
4530
4531 return ret;
4532};
4533
4534
4535
4536
4537function adjustCSS( elem, prop, valueParts, tween ) {
4538 var adjusted,
4539 scale = 1,
4540 maxIterations = 20,
4541 currentValue = tween ?
4542 function() {
4543 return tween.cur();
4544 } :
4545 function() {
4546 return jQuery.css( elem, prop, "" );
4547 },
4548 initial = currentValue(),
4549 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4550
4551 // Starting value computation is required for potential unit mismatches
4552 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4553 rcssNum.exec( jQuery.css( elem, prop ) );
4554
4555 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4556
4557 // Trust units reported by jQuery.css
4558 unit = unit || initialInUnit[ 3 ];
4559
4560 // Make sure we update the tween properties later on
4561 valueParts = valueParts || [];
4562
4563 // Iteratively approximate from a nonzero starting point
4564 initialInUnit = +initial || 1;
4565
4566 do {
4567
4568 // If previous iteration zeroed out, double until we get *something*.
4569 // Use string for doubling so we don't accidentally see scale as unchanged below
4570 scale = scale || ".5";
4571
4572 // Adjust and apply
4573 initialInUnit = initialInUnit / scale;
4574 jQuery.style( elem, prop, initialInUnit + unit );
4575
4576 // Update scale, tolerating zero or NaN from tween.cur()
4577 // Break the loop if scale is unchanged or perfect, or if we've just had enough.
4578 } while (
4579 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
4580 );
4581 }
4582
4583 if ( valueParts ) {
4584 initialInUnit = +initialInUnit || +initial || 0;
4585
4586 // Apply relative offset (+=/-=) if specified
4587 adjusted = valueParts[ 1 ] ?
4588 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4589 +valueParts[ 2 ];
4590 if ( tween ) {
4591 tween.unit = unit;
4592 tween.start = initialInUnit;
4593 tween.end = adjusted;
4594 }
4595 }
4596 return adjusted;
4597}
4598
4599
4600var defaultDisplayMap = {};
4601
4602function getDefaultDisplay( elem ) {
4603 var temp,
4604 doc = elem.ownerDocument,
4605 nodeName = elem.nodeName,
4606 display = defaultDisplayMap[ nodeName ];
4607
4608 if ( display ) {
4609 return display;
4610 }
4611
4612 temp = doc.body.appendChild( doc.createElement( nodeName ) );
4613 display = jQuery.css( temp, "display" );
4614
4615 temp.parentNode.removeChild( temp );
4616
4617 if ( display === "none" ) {
4618 display = "block";
4619 }
4620 defaultDisplayMap[ nodeName ] = display;
4621
4622 return display;
4623}
4624
4625function showHide( elements, show ) {
4626 var display, elem,
4627 values = [],
4628 index = 0,
4629 length = elements.length;
4630
4631 // Determine new display value for elements that need to change
4632 for ( ; index < length; index++ ) {
4633 elem = elements[ index ];
4634 if ( !elem.style ) {
4635 continue;
4636 }
4637
4638 display = elem.style.display;
4639 if ( show ) {
4640
4641 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4642 // check is required in this first loop unless we have a nonempty display value (either
4643 // inline or about-to-be-restored)
4644 if ( display === "none" ) {
4645 values[ index ] = dataPriv.get( elem, "display" ) || null;
4646 if ( !values[ index ] ) {
4647 elem.style.display = "";
4648 }
4649 }
4650 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
4651 values[ index ] = getDefaultDisplay( elem );
4652 }
4653 } else {
4654 if ( display !== "none" ) {
4655 values[ index ] = "none";
4656
4657 // Remember what we're overwriting
4658 dataPriv.set( elem, "display", display );
4659 }
4660 }
4661 }
4662
4663 // Set the display of the elements in a second loop to avoid constant reflow
4664 for ( index = 0; index < length; index++ ) {
4665 if ( values[ index ] != null ) {
4666 elements[ index ].style.display = values[ index ];
4667 }
4668 }
4669
4670 return elements;
4671}
4672
4673jQuery.fn.extend( {
4674 show: function() {
4675 return showHide( this, true );
4676 },
4677 hide: function() {
4678 return showHide( this );
4679 },
4680 toggle: function( state ) {
4681 if ( typeof state === "boolean" ) {
4682 return state ? this.show() : this.hide();
4683 }
4684
4685 return this.each( function() {
4686 if ( isHiddenWithinTree( this ) ) {
4687 jQuery( this ).show();
4688 } else {
4689 jQuery( this ).hide();
4690 }
4691 } );
4692 }
4693} );
4694var rcheckableType = ( /^(?:checkbox|radio)$/i );
4695
4696var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
4697
4698var rscriptType = ( /^$|\/(?:java|ecma)script/i );
4699
4700
4701
4702// We have to close these tags to support XHTML (#13200)
4703var wrapMap = {
4704
4705 // Support: IE <=9 only
4706 option: [ 1, "<select multiple='multiple'>", "</select>" ],
4707
4708 // XHTML parsers do not magically insert elements in the
4709 // same way that tag soup parsers do. So we cannot shorten
4710 // this by omitting <tbody> or other required elements.
4711 thead: [ 1, "<table>", "</table>" ],
4712 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4713 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4714 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4715
4716 _default: [ 0, "", "" ]
4717};
4718
4719// Support: IE <=9 only
4720wrapMap.optgroup = wrapMap.option;
4721
4722wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4723wrapMap.th = wrapMap.td;
4724
4725
4726function getAll( context, tag ) {
4727
4728 // Support: IE <=9 - 11 only
4729 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4730 var ret;
4731
4732 if ( typeof context.getElementsByTagName !== "undefined" ) {
4733 ret = context.getElementsByTagName( tag || "*" );
4734
4735 } else if ( typeof context.querySelectorAll !== "undefined" ) {
4736 ret = context.querySelectorAll( tag || "*" );
4737
4738 } else {
4739 ret = [];
4740 }
4741
4742 if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
4743 return jQuery.merge( [ context ], ret );
4744 }
4745
4746 return ret;
4747}
4748
4749
4750// Mark scripts as having already been evaluated
4751function setGlobalEval( elems, refElements ) {
4752 var i = 0,
4753 l = elems.length;
4754
4755 for ( ; i < l; i++ ) {
4756 dataPriv.set(
4757 elems[ i ],
4758 "globalEval",
4759 !refElements || dataPriv.get( refElements[ i ], "globalEval" )
4760 );
4761 }
4762}
4763
4764
4765var rhtml = /<|&#?\w+;/;
4766
4767function buildFragment( elems, context, scripts, selection, ignored ) {
4768 var elem, tmp, tag, wrap, contains, j,
4769 fragment = context.createDocumentFragment(),
4770 nodes = [],
4771 i = 0,
4772 l = elems.length;
4773
4774 for ( ; i < l; i++ ) {
4775 elem = elems[ i ];
4776
4777 if ( elem || elem === 0 ) {
4778
4779 // Add nodes directly
4780 if ( jQuery.type( elem ) === "object" ) {
4781
4782 // Support: Android <=4.0 only, PhantomJS 1 only
4783 // push.apply(_, arraylike) throws on ancient WebKit
4784 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4785
4786 // Convert non-html into a text node
4787 } else if ( !rhtml.test( elem ) ) {
4788 nodes.push( context.createTextNode( elem ) );
4789
4790 // Convert html into DOM nodes
4791 } else {
4792 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
4793
4794 // Deserialize a standard representation
4795 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4796 wrap = wrapMap[ tag ] || wrapMap._default;
4797 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4798
4799 // Descend through wrappers to the right content
4800 j = wrap[ 0 ];
4801 while ( j-- ) {
4802 tmp = tmp.lastChild;
4803 }
4804
4805 // Support: Android <=4.0 only, PhantomJS 1 only
4806 // push.apply(_, arraylike) throws on ancient WebKit
4807 jQuery.merge( nodes, tmp.childNodes );
4808
4809 // Remember the top-level container
4810 tmp = fragment.firstChild;
4811
4812 // Ensure the created nodes are orphaned (#12392)
4813 tmp.textContent = "";
4814 }
4815 }
4816 }
4817
4818 // Remove wrapper from fragment
4819 fragment.textContent = "";
4820
4821 i = 0;
4822 while ( ( elem = nodes[ i++ ] ) ) {
4823
4824 // Skip elements already in the context collection (trac-4087)
4825 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4826 if ( ignored ) {
4827 ignored.push( elem );
4828 }
4829 continue;
4830 }
4831
4832 contains = jQuery.contains( elem.ownerDocument, elem );
4833
4834 // Append to fragment
4835 tmp = getAll( fragment.appendChild( elem ), "script" );
4836
4837 // Preserve script evaluation history
4838 if ( contains ) {
4839 setGlobalEval( tmp );
4840 }
4841
4842 // Capture executables
4843 if ( scripts ) {
4844 j = 0;
4845 while ( ( elem = tmp[ j++ ] ) ) {
4846 if ( rscriptType.test( elem.type || "" ) ) {
4847 scripts.push( elem );
4848 }
4849 }
4850 }
4851 }
4852
4853 return fragment;
4854}
4855
4856
4857( function() {
4858 var fragment = document.createDocumentFragment(),
4859 div = fragment.appendChild( document.createElement( "div" ) ),
4860 input = document.createElement( "input" );
4861
4862 // Support: Android 4.0 - 4.3 only
4863 // Check state lost if the name is set (#11217)
4864 // Support: Windows Web Apps (WWA)
4865 // `name` and `type` must use .setAttribute for WWA (#14901)
4866 input.setAttribute( "type", "radio" );
4867 input.setAttribute( "checked", "checked" );
4868 input.setAttribute( "name", "t" );
4869
4870 div.appendChild( input );
4871
4872 // Support: Android <=4.1 only
4873 // Older WebKit doesn't clone checked state correctly in fragments
4874 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4875
4876 // Support: IE <=11 only
4877 // Make sure textarea (and checkbox) defaultValue is properly cloned
4878 div.innerHTML = "<textarea>x</textarea>";
4879 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4880} )();
4881var documentElement = document.documentElement;
4882
4883
4884
4885var
4886 rkeyEvent = /^key/,
4887 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4888 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4889
4890function returnTrue() {
4891 return true;
4892}
4893
4894function returnFalse() {
4895 return false;
4896}
4897
4898// Support: IE <=9 only
4899// See #13393 for more info
4900function safeActiveElement() {
4901 try {
4902 return document.activeElement;
4903 } catch ( err ) { }
4904}
4905
4906function on( elem, types, selector, data, fn, one ) {
4907 var origFn, type;
4908
4909 // Types can be a map of types/handlers
4910 if ( typeof types === "object" ) {
4911
4912 // ( types-Object, selector, data )
4913 if ( typeof selector !== "string" ) {
4914
4915 // ( types-Object, data )
4916 data = data || selector;
4917 selector = undefined;
4918 }
4919 for ( type in types ) {
4920 on( elem, type, selector, data, types[ type ], one );
4921 }
4922 return elem;
4923 }
4924
4925 if ( data == null && fn == null ) {
4926
4927 // ( types, fn )
4928 fn = selector;
4929 data = selector = undefined;
4930 } else if ( fn == null ) {
4931 if ( typeof selector === "string" ) {
4932
4933 // ( types, selector, fn )
4934 fn = data;
4935 data = undefined;
4936 } else {
4937
4938 // ( types, data, fn )
4939 fn = data;
4940 data = selector;
4941 selector = undefined;
4942 }
4943 }
4944 if ( fn === false ) {
4945 fn = returnFalse;
4946 } else if ( !fn ) {
4947 return elem;
4948 }
4949
4950 if ( one === 1 ) {
4951 origFn = fn;
4952 fn = function( event ) {
4953
4954 // Can use an empty set, since event contains the info
4955 jQuery().off( event );
4956 return origFn.apply( this, arguments );
4957 };
4958
4959 // Use same guid so caller can remove using origFn
4960 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4961 }
4962 return elem.each( function() {
4963 jQuery.event.add( this, types, fn, data, selector );
4964 } );
4965}
4966
4967/*
4968 * Helper functions for managing events -- not part of the public interface.
4969 * Props to Dean Edwards' addEvent library for many of the ideas.
4970 */
4971jQuery.event = {
4972
4973 global: {},
4974
4975 add: function( elem, types, handler, data, selector ) {
4976
4977 var handleObjIn, eventHandle, tmp,
4978 events, t, handleObj,
4979 special, handlers, type, namespaces, origType,
4980 elemData = dataPriv.get( elem );
4981
4982 // Don't attach events to noData or text/comment nodes (but allow plain objects)
4983 if ( !elemData ) {
4984 return;
4985 }
4986
4987 // Caller can pass in an object of custom data in lieu of the handler
4988 if ( handler.handler ) {
4989 handleObjIn = handler;
4990 handler = handleObjIn.handler;
4991 selector = handleObjIn.selector;
4992 }
4993
4994 // Ensure that invalid selectors throw exceptions at attach time
4995 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
4996 if ( selector ) {
4997 jQuery.find.matchesSelector( documentElement, selector );
4998 }
4999
5000 // Make sure that the handler has a unique ID, used to find/remove it later
5001 if ( !handler.guid ) {
5002 handler.guid = jQuery.guid++;
5003 }
5004
5005 // Init the element's event structure and main handler, if this is the first
5006 if ( !( events = elemData.events ) ) {
5007 events = elemData.events = {};
5008 }
5009 if ( !( eventHandle = elemData.handle ) ) {
5010 eventHandle = elemData.handle = function( e ) {
5011
5012 // Discard the second event of a jQuery.event.trigger() and
5013 // when an event is called after a page has unloaded
5014 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
5015 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
5016 };
5017 }
5018
5019 // Handle multiple events separated by a space
5020 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5021 t = types.length;
5022 while ( t-- ) {
5023 tmp = rtypenamespace.exec( types[ t ] ) || [];
5024 type = origType = tmp[ 1 ];
5025 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5026
5027 // There *must* be a type, no attaching namespace-only handlers
5028 if ( !type ) {
5029 continue;
5030 }
5031
5032 // If event changes its type, use the special event handlers for the changed type
5033 special = jQuery.event.special[ type ] || {};
5034
5035 // If selector defined, determine special event api type, otherwise given type
5036 type = ( selector ? special.delegateType : special.bindType ) || type;
5037
5038 // Update special based on newly reset type
5039 special = jQuery.event.special[ type ] || {};
5040
5041 // handleObj is passed to all event handlers
5042 handleObj = jQuery.extend( {
5043 type: type,
5044 origType: origType,
5045 data: data,
5046 handler: handler,
5047 guid: handler.guid,
5048 selector: selector,
5049 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
5050 namespace: namespaces.join( "." )
5051 }, handleObjIn );
5052
5053 // Init the event handler queue if we're the first
5054 if ( !( handlers = events[ type ] ) ) {
5055 handlers = events[ type ] = [];
5056 handlers.delegateCount = 0;
5057
5058 // Only use addEventListener if the special events handler returns false
5059 if ( !special.setup ||
5060 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
5061
5062 if ( elem.addEventListener ) {
5063 elem.addEventListener( type, eventHandle );
5064 }
5065 }
5066 }
5067
5068 if ( special.add ) {
5069 special.add.call( elem, handleObj );
5070
5071 if ( !handleObj.handler.guid ) {
5072 handleObj.handler.guid = handler.guid;
5073 }
5074 }
5075
5076 // Add to the element's handler list, delegates in front
5077 if ( selector ) {
5078 handlers.splice( handlers.delegateCount++, 0, handleObj );
5079 } else {
5080 handlers.push( handleObj );
5081 }
5082
5083 // Keep track of which events have ever been used, for event optimization
5084 jQuery.event.global[ type ] = true;
5085 }
5086
5087 },
5088
5089 // Detach an event or set of events from an element
5090 remove: function( elem, types, handler, selector, mappedTypes ) {
5091
5092 var j, origCount, tmp,
5093 events, t, handleObj,
5094 special, handlers, type, namespaces, origType,
5095 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
5096
5097 if ( !elemData || !( events = elemData.events ) ) {
5098 return;
5099 }
5100
5101 // Once for each type.namespace in types; type may be omitted
5102 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5103 t = types.length;
5104 while ( t-- ) {
5105 tmp = rtypenamespace.exec( types[ t ] ) || [];
5106 type = origType = tmp[ 1 ];
5107 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5108
5109 // Unbind all events (on this namespace, if provided) for the element
5110 if ( !type ) {
5111 for ( type in events ) {
5112 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5113 }
5114 continue;
5115 }
5116
5117 special = jQuery.event.special[ type ] || {};
5118 type = ( selector ? special.delegateType : special.bindType ) || type;
5119 handlers = events[ type ] || [];
5120 tmp = tmp[ 2 ] &&
5121 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
5122
5123 // Remove matching events
5124 origCount = j = handlers.length;
5125 while ( j-- ) {
5126 handleObj = handlers[ j ];
5127
5128 if ( ( mappedTypes || origType === handleObj.origType ) &&
5129 ( !handler || handler.guid === handleObj.guid ) &&
5130 ( !tmp || tmp.test( handleObj.namespace ) ) &&
5131 ( !selector || selector === handleObj.selector ||
5132 selector === "**" && handleObj.selector ) ) {
5133 handlers.splice( j, 1 );
5134
5135 if ( handleObj.selector ) {
5136 handlers.delegateCount--;
5137 }
5138 if ( special.remove ) {
5139 special.remove.call( elem, handleObj );
5140 }
5141 }
5142 }
5143
5144 // Remove generic event handler if we removed something and no more handlers exist
5145 // (avoids potential for endless recursion during removal of special event handlers)
5146 if ( origCount && !handlers.length ) {
5147 if ( !special.teardown ||
5148 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5149
5150 jQuery.removeEvent( elem, type, elemData.handle );
5151 }
5152
5153 delete events[ type ];
5154 }
5155 }
5156
5157 // Remove data and the expando if it's no longer used
5158 if ( jQuery.isEmptyObject( events ) ) {
5159 dataPriv.remove( elem, "handle events" );
5160 }
5161 },
5162
5163 dispatch: function( nativeEvent ) {
5164
5165 // Make a writable jQuery.Event from the native event object
5166 var event = jQuery.event.fix( nativeEvent );
5167
5168 var i, j, ret, matched, handleObj, handlerQueue,
5169 args = new Array( arguments.length ),
5170 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
5171 special = jQuery.event.special[ event.type ] || {};
5172
5173 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5174 args[ 0 ] = event;
5175
5176 for ( i = 1; i < arguments.length; i++ ) {
5177 args[ i ] = arguments[ i ];
5178 }
5179
5180 event.delegateTarget = this;
5181
5182 // Call the preDispatch hook for the mapped type, and let it bail if desired
5183 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5184 return;
5185 }
5186
5187 // Determine handlers
5188 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5189
5190 // Run delegates first; they may want to stop propagation beneath us
5191 i = 0;
5192 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5193 event.currentTarget = matched.elem;
5194
5195 j = 0;
5196 while ( ( handleObj = matched.handlers[ j++ ] ) &&
5197 !event.isImmediatePropagationStopped() ) {
5198
5199 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
5200 // a subset or equal to those in the bound event (both can have no namespace).
5201 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
5202
5203 event.handleObj = handleObj;
5204 event.data = handleObj.data;
5205
5206 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5207 handleObj.handler ).apply( matched.elem, args );
5208
5209 if ( ret !== undefined ) {
5210 if ( ( event.result = ret ) === false ) {
5211 event.preventDefault();
5212 event.stopPropagation();
5213 }
5214 }
5215 }
5216 }
5217 }
5218
5219 // Call the postDispatch hook for the mapped type
5220 if ( special.postDispatch ) {
5221 special.postDispatch.call( this, event );
5222 }
5223
5224 return event.result;
5225 },
5226
5227 handlers: function( event, handlers ) {
5228 var i, handleObj, sel, matchedHandlers, matchedSelectors,
5229 handlerQueue = [],
5230 delegateCount = handlers.delegateCount,
5231 cur = event.target;
5232
5233 // Find delegate handlers
5234 if ( delegateCount &&
5235
5236 // Support: IE <=9
5237 // Black-hole SVG <use> instance trees (trac-13180)
5238 cur.nodeType &&
5239
5240 // Support: Firefox <=42
5241 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5242 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5243 // Support: IE 11 only
5244 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5245 !( event.type === "click" && event.button >= 1 ) ) {
5246
5247 for ( ; cur !== this; cur = cur.parentNode || this ) {
5248
5249 // Don't check non-elements (#13208)
5250 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5251 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5252 matchedHandlers = [];
5253 matchedSelectors = {};
5254 for ( i = 0; i < delegateCount; i++ ) {
5255 handleObj = handlers[ i ];
5256
5257 // Don't conflict with Object.prototype properties (#13203)
5258 sel = handleObj.selector + " ";
5259
5260 if ( matchedSelectors[ sel ] === undefined ) {
5261 matchedSelectors[ sel ] = handleObj.needsContext ?
5262 jQuery( sel, this ).index( cur ) > -1 :
5263 jQuery.find( sel, this, null, [ cur ] ).length;
5264 }
5265 if ( matchedSelectors[ sel ] ) {
5266 matchedHandlers.push( handleObj );
5267 }
5268 }
5269 if ( matchedHandlers.length ) {
5270 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
5271 }
5272 }
5273 }
5274 }
5275
5276 // Add the remaining (directly-bound) handlers
5277 cur = this;
5278 if ( delegateCount < handlers.length ) {
5279 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
5280 }
5281
5282 return handlerQueue;
5283 },
5284
5285 addProp: function( name, hook ) {
5286 Object.defineProperty( jQuery.Event.prototype, name, {
5287 enumerable: true,
5288 configurable: true,
5289
5290 get: jQuery.isFunction( hook ) ?
5291 function() {
5292 if ( this.originalEvent ) {
5293 return hook( this.originalEvent );
5294 }
5295 } :
5296 function() {
5297 if ( this.originalEvent ) {
5298 return this.originalEvent[ name ];
5299 }
5300 },
5301
5302 set: function( value ) {
5303 Object.defineProperty( this, name, {
5304 enumerable: true,
5305 configurable: true,
5306 writable: true,
5307 value: value
5308 } );
5309 }
5310 } );
5311 },
5312
5313 fix: function( originalEvent ) {
5314 return originalEvent[ jQuery.expando ] ?
5315 originalEvent :
5316 new jQuery.Event( originalEvent );
5317 },
5318
5319 special: {
5320 load: {
5321
5322 // Prevent triggered image.load events from bubbling to window.load
5323 noBubble: true
5324 },
5325 focus: {
5326
5327 // Fire native event if possible so blur/focus sequence is correct
5328 trigger: function() {
5329 if ( this !== safeActiveElement() && this.focus ) {
5330 this.focus();
5331 return false;
5332 }
5333 },
5334 delegateType: "focusin"
5335 },
5336 blur: {
5337 trigger: function() {
5338 if ( this === safeActiveElement() && this.blur ) {
5339 this.blur();
5340 return false;
5341 }
5342 },
5343 delegateType: "focusout"
5344 },
5345 click: {
5346
5347 // For checkbox, fire native event so checked state will be right
5348 trigger: function() {
5349 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
5350 this.click();
5351 return false;
5352 }
5353 },
5354
5355 // For cross-browser consistency, don't fire native .click() on links
5356 _default: function( event ) {
5357 return jQuery.nodeName( event.target, "a" );
5358 }
5359 },
5360
5361 beforeunload: {
5362 postDispatch: function( event ) {
5363
5364 // Support: Firefox 20+
5365 // Firefox doesn't alert if the returnValue field is not set.
5366 if ( event.result !== undefined && event.originalEvent ) {
5367 event.originalEvent.returnValue = event.result;
5368 }
5369 }
5370 }
5371 }
5372};
5373
5374jQuery.removeEvent = function( elem, type, handle ) {
5375
5376 // This "if" is needed for plain objects
5377 if ( elem.removeEventListener ) {
5378 elem.removeEventListener( type, handle );
5379 }
5380};
5381
5382jQuery.Event = function( src, props ) {
5383
5384 // Allow instantiation without the 'new' keyword
5385 if ( !( this instanceof jQuery.Event ) ) {
5386 return new jQuery.Event( src, props );
5387 }
5388
5389 // Event object
5390 if ( src && src.type ) {
5391 this.originalEvent = src;
5392 this.type = src.type;
5393
5394 // Events bubbling up the document may have been marked as prevented
5395 // by a handler lower down the tree; reflect the correct value.
5396 this.isDefaultPrevented = src.defaultPrevented ||
5397 src.defaultPrevented === undefined &&
5398
5399 // Support: Android <=2.3 only
5400 src.returnValue === false ?
5401 returnTrue :
5402 returnFalse;
5403
5404 // Create target properties
5405 // Support: Safari <=6 - 7 only
5406 // Target should not be a text node (#504, #13143)
5407 this.target = ( src.target && src.target.nodeType === 3 ) ?
5408 src.target.parentNode :
5409 src.target;
5410
5411 this.currentTarget = src.currentTarget;
5412 this.relatedTarget = src.relatedTarget;
5413
5414 // Event type
5415 } else {
5416 this.type = src;
5417 }
5418
5419 // Put explicitly provided properties onto the event object
5420 if ( props ) {
5421 jQuery.extend( this, props );
5422 }
5423
5424 // Create a timestamp if incoming event doesn't have one
5425 this.timeStamp = src && src.timeStamp || jQuery.now();
5426
5427 // Mark it as fixed
5428 this[ jQuery.expando ] = true;
5429};
5430
5431// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5432// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5433jQuery.Event.prototype = {
5434 constructor: jQuery.Event,
5435 isDefaultPrevented: returnFalse,
5436 isPropagationStopped: returnFalse,
5437 isImmediatePropagationStopped: returnFalse,
5438 isSimulated: false,
5439
5440 preventDefault: function() {
5441 var e = this.originalEvent;
5442
5443 this.isDefaultPrevented = returnTrue;
5444
5445 if ( e && !this.isSimulated ) {
5446 e.preventDefault();
5447 }
5448 },
5449 stopPropagation: function() {
5450 var e = this.originalEvent;
5451
5452 this.isPropagationStopped = returnTrue;
5453
5454 if ( e && !this.isSimulated ) {
5455 e.stopPropagation();
5456 }
5457 },
5458 stopImmediatePropagation: function() {
5459 var e = this.originalEvent;
5460
5461 this.isImmediatePropagationStopped = returnTrue;
5462
5463 if ( e && !this.isSimulated ) {
5464 e.stopImmediatePropagation();
5465 }
5466
5467 this.stopPropagation();
5468 }
5469};
5470
5471// Includes all common event props including KeyEvent and MouseEvent specific props
5472jQuery.each( {
5473 altKey: true,
5474 bubbles: true,
5475 cancelable: true,
5476 changedTouches: true,
5477 ctrlKey: true,
5478 detail: true,
5479 eventPhase: true,
5480 metaKey: true,
5481 pageX: true,
5482 pageY: true,
5483 shiftKey: true,
5484 view: true,
5485 "char": true,
5486 charCode: true,
5487 key: true,
5488 keyCode: true,
5489 button: true,
5490 buttons: true,
5491 clientX: true,
5492 clientY: true,
5493 offsetX: true,
5494 offsetY: true,
5495 pointerId: true,
5496 pointerType: true,
5497 screenX: true,
5498 screenY: true,
5499 targetTouches: true,
5500 toElement: true,
5501 touches: true,
5502
5503 which: function( event ) {
5504 var button = event.button;
5505
5506 // Add which for key events
5507 if ( event.which == null && rkeyEvent.test( event.type ) ) {
5508 return event.charCode != null ? event.charCode : event.keyCode;
5509 }
5510
5511 // Add which for click: 1 === left; 2 === middle; 3 === right
5512 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5513 if ( button & 1 ) {
5514 return 1;
5515 }
5516
5517 if ( button & 2 ) {
5518 return 3;
5519 }
5520
5521 if ( button & 4 ) {
5522 return 2;
5523 }
5524
5525 return 0;
5526 }
5527
5528 return event.which;
5529 }
5530}, jQuery.event.addProp );
5531
5532// Create mouseenter/leave events using mouseover/out and event-time checks
5533// so that event delegation works in jQuery.
5534// Do the same for pointerenter/pointerleave and pointerover/pointerout
5535//
5536// Support: Safari 7 only
5537// Safari sends mouseenter too often; see:
5538// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5539// for the description of the bug (it existed in older Chrome versions as well).
5540jQuery.each( {
5541 mouseenter: "mouseover",
5542 mouseleave: "mouseout",
5543 pointerenter: "pointerover",
5544 pointerleave: "pointerout"
5545}, function( orig, fix ) {
5546 jQuery.event.special[ orig ] = {
5547 delegateType: fix,
5548 bindType: fix,
5549
5550 handle: function( event ) {
5551 var ret,
5552 target = this,
5553 related = event.relatedTarget,
5554 handleObj = event.handleObj;
5555
5556 // For mouseenter/leave call the handler if related is outside the target.
5557 // NB: No relatedTarget if the mouse left/entered the browser window
5558 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5559 event.type = handleObj.origType;
5560 ret = handleObj.handler.apply( this, arguments );
5561 event.type = fix;
5562 }
5563 return ret;
5564 }
5565 };
5566} );
5567
5568jQuery.fn.extend( {
5569
5570 on: function( types, selector, data, fn ) {
5571 return on( this, types, selector, data, fn );
5572 },
5573 one: function( types, selector, data, fn ) {
5574 return on( this, types, selector, data, fn, 1 );
5575 },
5576 off: function( types, selector, fn ) {
5577 var handleObj, type;
5578 if ( types && types.preventDefault && types.handleObj ) {
5579
5580 // ( event ) dispatched jQuery.Event
5581 handleObj = types.handleObj;
5582 jQuery( types.delegateTarget ).off(
5583 handleObj.namespace ?
5584 handleObj.origType + "." + handleObj.namespace :
5585 handleObj.origType,
5586 handleObj.selector,
5587 handleObj.handler
5588 );
5589 return this;
5590 }
5591 if ( typeof types === "object" ) {
5592
5593 // ( types-object [, selector] )
5594 for ( type in types ) {
5595 this.off( type, selector, types[ type ] );
5596 }
5597 return this;
5598 }
5599 if ( selector === false || typeof selector === "function" ) {
5600
5601 // ( types [, fn] )
5602 fn = selector;
5603 selector = undefined;
5604 }
5605 if ( fn === false ) {
5606 fn = returnFalse;
5607 }
5608 return this.each( function() {
5609 jQuery.event.remove( this, types, fn, selector );
5610 } );
5611 }
5612} );
5613
5614
5615var
5616
5617 /* eslint-disable max-len */
5618
5619 // See https://github.com/eslint/eslint/issues/3229
5620 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5621
5622 /* eslint-enable */
5623
5624 // Support: IE <=10 - 11, Edge 12 - 13
5625 // In IE/Edge using regex groups here causes severe slowdowns.
5626 // See https://connect.microsoft.com/IE/feedback/details/1736512/
5627 rnoInnerhtml = /<script|<style|<link/i,
5628
5629 // checked="checked" or checked
5630 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5631 rscriptTypeMasked = /^true\/(.*)/,
5632 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5633
5634function manipulationTarget( elem, content ) {
5635 if ( jQuery.nodeName( elem, "table" ) &&
5636 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
5637
5638 return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
5639 }
5640
5641 return elem;
5642}
5643
5644// Replace/restore the type attribute of script elements for safe DOM manipulation
5645function disableScript( elem ) {
5646 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5647 return elem;
5648}
5649function restoreScript( elem ) {
5650 var match = rscriptTypeMasked.exec( elem.type );
5651
5652 if ( match ) {
5653 elem.type = match[ 1 ];
5654 } else {
5655 elem.removeAttribute( "type" );
5656 }
5657
5658 return elem;
5659}
5660
5661function cloneCopyEvent( src, dest ) {
5662 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5663
5664 if ( dest.nodeType !== 1 ) {
5665 return;
5666 }
5667
5668 // 1. Copy private data: events, handlers, etc.
5669 if ( dataPriv.hasData( src ) ) {
5670 pdataOld = dataPriv.access( src );
5671 pdataCur = dataPriv.set( dest, pdataOld );
5672 events = pdataOld.events;
5673
5674 if ( events ) {
5675 delete pdataCur.handle;
5676 pdataCur.events = {};
5677
5678 for ( type in events ) {
5679 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5680 jQuery.event.add( dest, type, events[ type ][ i ] );
5681 }
5682 }
5683 }
5684 }
5685
5686 // 2. Copy user data
5687 if ( dataUser.hasData( src ) ) {
5688 udataOld = dataUser.access( src );
5689 udataCur = jQuery.extend( {}, udataOld );
5690
5691 dataUser.set( dest, udataCur );
5692 }
5693}
5694
5695// Fix IE bugs, see support tests
5696function fixInput( src, dest ) {
5697 var nodeName = dest.nodeName.toLowerCase();
5698
5699 // Fails to persist the checked state of a cloned checkbox or radio button.
5700 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5701 dest.checked = src.checked;
5702
5703 // Fails to return the selected option to the default selected state when cloning options
5704 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5705 dest.defaultValue = src.defaultValue;
5706 }
5707}
5708
5709function domManip( collection, args, callback, ignored ) {
5710
5711 // Flatten any nested arrays
5712 args = concat.apply( [], args );
5713
5714 var fragment, first, scripts, hasScripts, node, doc,
5715 i = 0,
5716 l = collection.length,
5717 iNoClone = l - 1,
5718 value = args[ 0 ],
5719 isFunction = jQuery.isFunction( value );
5720
5721 // We can't cloneNode fragments that contain checked, in WebKit
5722 if ( isFunction ||
5723 ( l > 1 && typeof value === "string" &&
5724 !support.checkClone && rchecked.test( value ) ) ) {
5725 return collection.each( function( index ) {
5726 var self = collection.eq( index );
5727 if ( isFunction ) {
5728 args[ 0 ] = value.call( this, index, self.html() );
5729 }
5730 domManip( self, args, callback, ignored );
5731 } );
5732 }
5733
5734 if ( l ) {
5735 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
5736 first = fragment.firstChild;
5737
5738 if ( fragment.childNodes.length === 1 ) {
5739 fragment = first;
5740 }
5741
5742 // Require either new content or an interest in ignored elements to invoke the callback
5743 if ( first || ignored ) {
5744 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5745 hasScripts = scripts.length;
5746
5747 // Use the original fragment for the last item
5748 // instead of the first because it can end up
5749 // being emptied incorrectly in certain situations (#8070).
5750 for ( ; i < l; i++ ) {
5751 node = fragment;
5752
5753 if ( i !== iNoClone ) {
5754 node = jQuery.clone( node, true, true );
5755
5756 // Keep references to cloned scripts for later restoration
5757 if ( hasScripts ) {
5758
5759 // Support: Android <=4.0 only, PhantomJS 1 only
5760 // push.apply(_, arraylike) throws on ancient WebKit
5761 jQuery.merge( scripts, getAll( node, "script" ) );
5762 }
5763 }
5764
5765 callback.call( collection[ i ], node, i );
5766 }
5767
5768 if ( hasScripts ) {
5769 doc = scripts[ scripts.length - 1 ].ownerDocument;
5770
5771 // Reenable scripts
5772 jQuery.map( scripts, restoreScript );
5773
5774 // Evaluate executable scripts on first document insertion
5775 for ( i = 0; i < hasScripts; i++ ) {
5776 node = scripts[ i ];
5777 if ( rscriptType.test( node.type || "" ) &&
5778 !dataPriv.access( node, "globalEval" ) &&
5779 jQuery.contains( doc, node ) ) {
5780
5781 if ( node.src ) {
5782
5783 // Optional AJAX dependency, but won't run scripts if not present
5784 if ( jQuery._evalUrl ) {
5785 jQuery._evalUrl( node.src );
5786 }
5787 } else {
5788 DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
5789 }
5790 }
5791 }
5792 }
5793 }
5794 }
5795
5796 return collection;
5797}
5798
5799function remove( elem, selector, keepData ) {
5800 var node,
5801 nodes = selector ? jQuery.filter( selector, elem ) : elem,
5802 i = 0;
5803
5804 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5805 if ( !keepData && node.nodeType === 1 ) {
5806 jQuery.cleanData( getAll( node ) );
5807 }
5808
5809 if ( node.parentNode ) {
5810 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
5811 setGlobalEval( getAll( node, "script" ) );
5812 }
5813 node.parentNode.removeChild( node );
5814 }
5815 }
5816
5817 return elem;
5818}
5819
5820jQuery.extend( {
5821 htmlPrefilter: function( html ) {
5822 return html.replace( rxhtmlTag, "<$1></$2>" );
5823 },
5824
5825 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5826 var i, l, srcElements, destElements,
5827 clone = elem.cloneNode( true ),
5828 inPage = jQuery.contains( elem.ownerDocument, elem );
5829
5830 // Fix IE cloning issues
5831 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
5832 !jQuery.isXMLDoc( elem ) ) {
5833
5834 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
5835 destElements = getAll( clone );
5836 srcElements = getAll( elem );
5837
5838 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5839 fixInput( srcElements[ i ], destElements[ i ] );
5840 }
5841 }
5842
5843 // Copy the events from the original to the clone
5844 if ( dataAndEvents ) {
5845 if ( deepDataAndEvents ) {
5846 srcElements = srcElements || getAll( elem );
5847 destElements = destElements || getAll( clone );
5848
5849 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5850 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
5851 }
5852 } else {
5853 cloneCopyEvent( elem, clone );
5854 }
5855 }
5856
5857 // Preserve script evaluation history
5858 destElements = getAll( clone, "script" );
5859 if ( destElements.length > 0 ) {
5860 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5861 }
5862
5863 // Return the cloned set
5864 return clone;
5865 },
5866
5867 cleanData: function( elems ) {
5868 var data, elem, type,
5869 special = jQuery.event.special,
5870 i = 0;
5871
5872 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
5873 if ( acceptData( elem ) ) {
5874 if ( ( data = elem[ dataPriv.expando ] ) ) {
5875 if ( data.events ) {
5876 for ( type in data.events ) {
5877 if ( special[ type ] ) {
5878 jQuery.event.remove( elem, type );
5879
5880 // This is a shortcut to avoid jQuery.event.remove's overhead
5881 } else {
5882 jQuery.removeEvent( elem, type, data.handle );
5883 }
5884 }
5885 }
5886
5887 // Support: Chrome <=35 - 45+
5888 // Assign undefined instead of using delete, see Data#remove
5889 elem[ dataPriv.expando ] = undefined;
5890 }
5891 if ( elem[ dataUser.expando ] ) {
5892
5893 // Support: Chrome <=35 - 45+
5894 // Assign undefined instead of using delete, see Data#remove
5895 elem[ dataUser.expando ] = undefined;
5896 }
5897 }
5898 }
5899 }
5900} );
5901
5902jQuery.fn.extend( {
5903 detach: function( selector ) {
5904 return remove( this, selector, true );
5905 },
5906
5907 remove: function( selector ) {
5908 return remove( this, selector );
5909 },
5910
5911 text: function( value ) {
5912 return access( this, function( value ) {
5913 return value === undefined ?
5914 jQuery.text( this ) :
5915 this.empty().each( function() {
5916 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5917 this.textContent = value;
5918 }
5919 } );
5920 }, null, value, arguments.length );
5921 },
5922
5923 append: function() {
5924 return domManip( this, arguments, function( elem ) {
5925 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5926 var target = manipulationTarget( this, elem );
5927 target.appendChild( elem );
5928 }
5929 } );
5930 },
5931
5932 prepend: function() {
5933 return domManip( this, arguments, function( elem ) {
5934 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5935 var target = manipulationTarget( this, elem );
5936 target.insertBefore( elem, target.firstChild );
5937 }
5938 } );
5939 },
5940
5941 before: function() {
5942 return domManip( this, arguments, function( elem ) {
5943 if ( this.parentNode ) {
5944 this.parentNode.insertBefore( elem, this );
5945 }
5946 } );
5947 },
5948
5949 after: function() {
5950 return domManip( this, arguments, function( elem ) {
5951 if ( this.parentNode ) {
5952 this.parentNode.insertBefore( elem, this.nextSibling );
5953 }
5954 } );
5955 },
5956
5957 empty: function() {
5958 var elem,
5959 i = 0;
5960
5961 for ( ; ( elem = this[ i ] ) != null; i++ ) {
5962 if ( elem.nodeType === 1 ) {
5963
5964 // Prevent memory leaks
5965 jQuery.cleanData( getAll( elem, false ) );
5966
5967 // Remove any remaining nodes
5968 elem.textContent = "";
5969 }
5970 }
5971
5972 return this;
5973 },
5974
5975 clone: function( dataAndEvents, deepDataAndEvents ) {
5976 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5977 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5978
5979 return this.map( function() {
5980 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5981 } );
5982 },
5983
5984 html: function( value ) {
5985 return access( this, function( value ) {
5986 var elem = this[ 0 ] || {},
5987 i = 0,
5988 l = this.length;
5989
5990 if ( value === undefined && elem.nodeType === 1 ) {
5991 return elem.innerHTML;
5992 }
5993
5994 // See if we can take a shortcut and just use innerHTML
5995 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5996 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
5997
5998 value = jQuery.htmlPrefilter( value );
5999
6000 try {
6001 for ( ; i < l; i++ ) {
6002 elem = this[ i ] || {};
6003
6004 // Remove element nodes and prevent memory leaks
6005 if ( elem.nodeType === 1 ) {
6006 jQuery.cleanData( getAll( elem, false ) );
6007 elem.innerHTML = value;
6008 }
6009 }
6010
6011 elem = 0;
6012
6013 // If using innerHTML throws an exception, use the fallback method
6014 } catch ( e ) {}
6015 }
6016
6017 if ( elem ) {
6018 this.empty().append( value );
6019 }
6020 }, null, value, arguments.length );
6021 },
6022
6023 replaceWith: function() {
6024 var ignored = [];
6025
6026 // Make the changes, replacing each non-ignored context element with the new content
6027 return domManip( this, arguments, function( elem ) {
6028 var parent = this.parentNode;
6029
6030 if ( jQuery.inArray( this, ignored ) < 0 ) {
6031 jQuery.cleanData( getAll( this ) );
6032 if ( parent ) {
6033 parent.replaceChild( elem, this );
6034 }
6035 }
6036
6037 // Force callback invocation
6038 }, ignored );
6039 }
6040} );
6041
6042jQuery.each( {
6043 appendTo: "append",
6044 prependTo: "prepend",
6045 insertBefore: "before",
6046 insertAfter: "after",
6047 replaceAll: "replaceWith"
6048}, function( name, original ) {
6049 jQuery.fn[ name ] = function( selector ) {
6050 var elems,
6051 ret = [],
6052 insert = jQuery( selector ),
6053 last = insert.length - 1,
6054 i = 0;
6055
6056 for ( ; i <= last; i++ ) {
6057 elems = i === last ? this : this.clone( true );
6058 jQuery( insert[ i ] )[ original ]( elems );
6059
6060 // Support: Android <=4.0 only, PhantomJS 1 only
6061 // .get() because push.apply(_, arraylike) throws on ancient WebKit
6062 push.apply( ret, elems.get() );
6063 }
6064
6065 return this.pushStack( ret );
6066 };
6067} );
6068var rmargin = ( /^margin/ );
6069
6070var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6071
6072var getStyles = function( elem ) {
6073
6074 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6075 // IE throws on elements created in popups
6076 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6077 var view = elem.ownerDocument.defaultView;
6078
6079 if ( !view || !view.opener ) {
6080 view = window;
6081 }
6082
6083 return view.getComputedStyle( elem );
6084 };
6085
6086
6087
6088( function() {
6089
6090 // Executing both pixelPosition & boxSizingReliable tests require only one layout
6091 // so they're executed at the same time to save the second computation.
6092 function computeStyleTests() {
6093
6094 // This is a singleton, we need to execute it only once
6095 if ( !div ) {
6096 return;
6097 }
6098
6099 div.style.cssText =
6100 "box-sizing:border-box;" +
6101 "position:relative;display:block;" +
6102 "margin:auto;border:1px;padding:1px;" +
6103 "top:1%;width:50%";
6104 div.innerHTML = "";
6105 documentElement.appendChild( container );
6106
6107 var divStyle = window.getComputedStyle( div );
6108 pixelPositionVal = divStyle.top !== "1%";
6109
6110 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
6111 reliableMarginLeftVal = divStyle.marginLeft === "2px";
6112 boxSizingReliableVal = divStyle.width === "4px";
6113
6114 // Support: Android 4.0 - 4.3 only
6115 // Some styles come back with percentage values, even though they shouldn't
6116 div.style.marginRight = "50%";
6117 pixelMarginRightVal = divStyle.marginRight === "4px";
6118
6119 documentElement.removeChild( container );
6120
6121 // Nullify the div so it wouldn't be stored in the memory and
6122 // it will also be a sign that checks already performed
6123 div = null;
6124 }
6125
6126 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
6127 container = document.createElement( "div" ),
6128 div = document.createElement( "div" );
6129
6130 // Finish early in limited (non-browser) environments
6131 if ( !div.style ) {
6132 return;
6133 }
6134
6135 // Support: IE <=9 - 11 only
6136 // Style of cloned element affects source element cloned (#8908)
6137 div.style.backgroundClip = "content-box";
6138 div.cloneNode( true ).style.backgroundClip = "";
6139 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6140
6141 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
6142 "padding:0;margin-top:1px;position:absolute";
6143 container.appendChild( div );
6144
6145 jQuery.extend( support, {
6146 pixelPosition: function() {
6147 computeStyleTests();
6148 return pixelPositionVal;
6149 },
6150 boxSizingReliable: function() {
6151 computeStyleTests();
6152 return boxSizingReliableVal;
6153 },
6154 pixelMarginRight: function() {
6155 computeStyleTests();
6156 return pixelMarginRightVal;
6157 },
6158 reliableMarginLeft: function() {
6159 computeStyleTests();
6160 return reliableMarginLeftVal;
6161 }
6162 } );
6163} )();
6164
6165
6166function curCSS( elem, name, computed ) {
6167 var width, minWidth, maxWidth, ret,
6168 style = elem.style;
6169
6170 computed = computed || getStyles( elem );
6171
6172 // Support: IE <=9 only
6173 // getPropertyValue is only needed for .css('filter') (#12537)
6174 if ( computed ) {
6175 ret = computed.getPropertyValue( name ) || computed[ name ];
6176
6177 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6178 ret = jQuery.style( elem, name );
6179 }
6180
6181 // A tribute to the "awesome hack by Dean Edwards"
6182 // Android Browser returns percentage for some values,
6183 // but width seems to be reliably pixels.
6184 // This is against the CSSOM draft spec:
6185 // https://drafts.csswg.org/cssom/#resolved-values
6186 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6187
6188 // Remember the original values
6189 width = style.width;
6190 minWidth = style.minWidth;
6191 maxWidth = style.maxWidth;
6192
6193 // Put in the new values to get a computed value out
6194 style.minWidth = style.maxWidth = style.width = ret;
6195 ret = computed.width;
6196
6197 // Revert the changed values
6198 style.width = width;
6199 style.minWidth = minWidth;
6200 style.maxWidth = maxWidth;
6201 }
6202 }
6203
6204 return ret !== undefined ?
6205
6206 // Support: IE <=9 - 11 only
6207 // IE returns zIndex value as an integer.
6208 ret + "" :
6209 ret;
6210}
6211
6212
6213function addGetHookIf( conditionFn, hookFn ) {
6214
6215 // Define the hook, we'll check on the first run if it's really needed.
6216 return {
6217 get: function() {
6218 if ( conditionFn() ) {
6219
6220 // Hook not needed (or it's not possible to use it due
6221 // to missing dependency), remove it.
6222 delete this.get;
6223 return;
6224 }
6225
6226 // Hook needed; redefine it so that the support test is not executed again.
6227 return ( this.get = hookFn ).apply( this, arguments );
6228 }
6229 };
6230}
6231
6232
6233var
6234
6235 // Swappable if display is none or starts with table
6236 // except "table", "table-cell", or "table-caption"
6237 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6238 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6239 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6240 cssNormalTransform = {
6241 letterSpacing: "0",
6242 fontWeight: "400"
6243 },
6244
6245 cssPrefixes = [ "Webkit", "Moz", "ms" ],
6246 emptyStyle = document.createElement( "div" ).style;
6247
6248// Return a css property mapped to a potentially vendor prefixed property
6249function vendorPropName( name ) {
6250
6251 // Shortcut for names that are not vendor prefixed
6252 if ( name in emptyStyle ) {
6253 return name;
6254 }
6255
6256 // Check for vendor prefixed names
6257 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
6258 i = cssPrefixes.length;
6259
6260 while ( i-- ) {
6261 name = cssPrefixes[ i ] + capName;
6262 if ( name in emptyStyle ) {
6263 return name;
6264 }
6265 }
6266}
6267
6268function setPositiveNumber( elem, value, subtract ) {
6269
6270 // Any relative (+/-) values have already been
6271 // normalized at this point
6272 var matches = rcssNum.exec( value );
6273 return matches ?
6274
6275 // Guard against undefined "subtract", e.g., when used as in cssHooks
6276 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
6277 value;
6278}
6279
6280function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6281 var i,
6282 val = 0;
6283
6284 // If we already have the right measurement, avoid augmentation
6285 if ( extra === ( isBorderBox ? "border" : "content" ) ) {
6286 i = 4;
6287
6288 // Otherwise initialize for horizontal or vertical properties
6289 } else {
6290 i = name === "width" ? 1 : 0;
6291 }
6292
6293 for ( ; i < 4; i += 2 ) {
6294
6295 // Both box models exclude margin, so add it if we want it
6296 if ( extra === "margin" ) {
6297 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6298 }
6299
6300 if ( isBorderBox ) {
6301
6302 // border-box includes padding, so remove it if we want content
6303 if ( extra === "content" ) {
6304 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6305 }
6306
6307 // At this point, extra isn't border nor margin, so remove border
6308 if ( extra !== "margin" ) {
6309 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6310 }
6311 } else {
6312
6313 // At this point, extra isn't content, so add padding
6314 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6315
6316 // At this point, extra isn't content nor padding, so add border
6317 if ( extra !== "padding" ) {
6318 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6319 }
6320 }
6321 }
6322
6323 return val;
6324}
6325
6326function getWidthOrHeight( elem, name, extra ) {
6327
6328 // Start with offset property, which is equivalent to the border-box value
6329 var val,
6330 valueIsBorderBox = true,
6331 styles = getStyles( elem ),
6332 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6333
6334 // Support: IE <=11 only
6335 // Running getBoundingClientRect on a disconnected node
6336 // in IE throws an error.
6337 if ( elem.getClientRects().length ) {
6338 val = elem.getBoundingClientRect()[ name ];
6339 }
6340
6341 // Some non-html elements return undefined for offsetWidth, so check for null/undefined
6342 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6343 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6344 if ( val <= 0 || val == null ) {
6345
6346 // Fall back to computed then uncomputed css if necessary
6347 val = curCSS( elem, name, styles );
6348 if ( val < 0 || val == null ) {
6349 val = elem.style[ name ];
6350 }
6351
6352 // Computed unit is not pixels. Stop here and return.
6353 if ( rnumnonpx.test( val ) ) {
6354 return val;
6355 }
6356
6357 // Check for style in case a browser which returns unreliable values
6358 // for getComputedStyle silently falls back to the reliable elem.style
6359 valueIsBorderBox = isBorderBox &&
6360 ( support.boxSizingReliable() || val === elem.style[ name ] );
6361
6362 // Normalize "", auto, and prepare for extra
6363 val = parseFloat( val ) || 0;
6364 }
6365
6366 // Use the active box-sizing model to add/subtract irrelevant styles
6367 return ( val +
6368 augmentWidthOrHeight(
6369 elem,
6370 name,
6371 extra || ( isBorderBox ? "border" : "content" ),
6372 valueIsBorderBox,
6373 styles
6374 )
6375 ) + "px";
6376}
6377
6378jQuery.extend( {
6379
6380 // Add in style property hooks for overriding the default
6381 // behavior of getting and setting a style property
6382 cssHooks: {
6383 opacity: {
6384 get: function( elem, computed ) {
6385 if ( computed ) {
6386
6387 // We should always get a number back from opacity
6388 var ret = curCSS( elem, "opacity" );
6389 return ret === "" ? "1" : ret;
6390 }
6391 }
6392 }
6393 },
6394
6395 // Don't automatically add "px" to these possibly-unitless properties
6396 cssNumber: {
6397 "animationIterationCount": true,
6398 "columnCount": true,
6399 "fillOpacity": true,
6400 "flexGrow": true,
6401 "flexShrink": true,
6402 "fontWeight": true,
6403 "lineHeight": true,
6404 "opacity": true,
6405 "order": true,
6406 "orphans": true,
6407 "widows": true,
6408 "zIndex": true,
6409 "zoom": true
6410 },
6411
6412 // Add in properties whose names you wish to fix before
6413 // setting or getting the value
6414 cssProps: {
6415 "float": "cssFloat"
6416 },
6417
6418 // Get and set the style property on a DOM Node
6419 style: function( elem, name, value, extra ) {
6420
6421 // Don't set styles on text and comment nodes
6422 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6423 return;
6424 }
6425
6426 // Make sure that we're working with the right name
6427 var ret, type, hooks,
6428 origName = jQuery.camelCase( name ),
6429 style = elem.style;
6430
6431 name = jQuery.cssProps[ origName ] ||
6432 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6433
6434 // Gets hook for the prefixed version, then unprefixed version
6435 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6436
6437 // Check if we're setting a value
6438 if ( value !== undefined ) {
6439 type = typeof value;
6440
6441 // Convert "+=" or "-=" to relative numbers (#7345)
6442 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6443 value = adjustCSS( elem, name, ret );
6444
6445 // Fixes bug #9237
6446 type = "number";
6447 }
6448
6449 // Make sure that null and NaN values aren't set (#7116)
6450 if ( value == null || value !== value ) {
6451 return;
6452 }
6453
6454 // If a number was passed in, add the unit (except for certain CSS properties)
6455 if ( type === "number" ) {
6456 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
6457 }
6458
6459 // background-* props affect original clone's values
6460 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
6461 style[ name ] = "inherit";
6462 }
6463
6464 // If a hook was provided, use that value, otherwise just set the specified value
6465 if ( !hooks || !( "set" in hooks ) ||
6466 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6467
6468 style[ name ] = value;
6469 }
6470
6471 } else {
6472
6473 // If a hook was provided get the non-computed value from there
6474 if ( hooks && "get" in hooks &&
6475 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
6476
6477 return ret;
6478 }
6479
6480 // Otherwise just get the value from the style object
6481 return style[ name ];
6482 }
6483 },
6484
6485 css: function( elem, name, extra, styles ) {
6486 var val, num, hooks,
6487 origName = jQuery.camelCase( name );
6488
6489 // Make sure that we're working with the right name
6490 name = jQuery.cssProps[ origName ] ||
6491 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6492
6493 // Try prefixed name followed by the unprefixed name
6494 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6495
6496 // If a hook was provided get the computed value from there
6497 if ( hooks && "get" in hooks ) {
6498 val = hooks.get( elem, true, extra );
6499 }
6500
6501 // Otherwise, if a way to get the computed value exists, use that
6502 if ( val === undefined ) {
6503 val = curCSS( elem, name, styles );
6504 }
6505
6506 // Convert "normal" to computed value
6507 if ( val === "normal" && name in cssNormalTransform ) {
6508 val = cssNormalTransform[ name ];
6509 }
6510
6511 // Make numeric if forced or a qualifier was provided and val looks numeric
6512 if ( extra === "" || extra ) {
6513 num = parseFloat( val );
6514 return extra === true || isFinite( num ) ? num || 0 : val;
6515 }
6516 return val;
6517 }
6518} );
6519
6520jQuery.each( [ "height", "width" ], function( i, name ) {
6521 jQuery.cssHooks[ name ] = {
6522 get: function( elem, computed, extra ) {
6523 if ( computed ) {
6524
6525 // Certain elements can have dimension info if we invisibly show them
6526 // but it must have a current display style that would benefit
6527 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
6528
6529 // Support: Safari 8+
6530 // Table columns in Safari have non-zero offsetWidth & zero
6531 // getBoundingClientRect().width unless display is changed.
6532 // Support: IE <=11 only
6533 // Running getBoundingClientRect on a disconnected node
6534 // in IE throws an error.
6535 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
6536 swap( elem, cssShow, function() {
6537 return getWidthOrHeight( elem, name, extra );
6538 } ) :
6539 getWidthOrHeight( elem, name, extra );
6540 }
6541 },
6542
6543 set: function( elem, value, extra ) {
6544 var matches,
6545 styles = extra && getStyles( elem ),
6546 subtract = extra && augmentWidthOrHeight(
6547 elem,
6548 name,
6549 extra,
6550 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6551 styles
6552 );
6553
6554 // Convert to pixels if value adjustment is needed
6555 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6556 ( matches[ 3 ] || "px" ) !== "px" ) {
6557
6558 elem.style[ name ] = value;
6559 value = jQuery.css( elem, name );
6560 }
6561
6562 return setPositiveNumber( elem, value, subtract );
6563 }
6564 };
6565} );
6566
6567jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6568 function( elem, computed ) {
6569 if ( computed ) {
6570 return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
6571 elem.getBoundingClientRect().left -
6572 swap( elem, { marginLeft: 0 }, function() {
6573 return elem.getBoundingClientRect().left;
6574 } )
6575 ) + "px";
6576 }
6577 }
6578);
6579
6580// These hooks are used by animate to expand properties
6581jQuery.each( {
6582 margin: "",
6583 padding: "",
6584 border: "Width"
6585}, function( prefix, suffix ) {
6586 jQuery.cssHooks[ prefix + suffix ] = {
6587 expand: function( value ) {
6588 var i = 0,
6589 expanded = {},
6590
6591 // Assumes a single number if not a string
6592 parts = typeof value === "string" ? value.split( " " ) : [ value ];
6593
6594 for ( ; i < 4; i++ ) {
6595 expanded[ prefix + cssExpand[ i ] + suffix ] =
6596 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6597 }
6598
6599 return expanded;
6600 }
6601 };
6602
6603 if ( !rmargin.test( prefix ) ) {
6604 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6605 }
6606} );
6607
6608jQuery.fn.extend( {
6609 css: function( name, value ) {
6610 return access( this, function( elem, name, value ) {
6611 var styles, len,
6612 map = {},
6613 i = 0;
6614
6615 if ( jQuery.isArray( name ) ) {
6616 styles = getStyles( elem );
6617 len = name.length;
6618
6619 for ( ; i < len; i++ ) {
6620 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6621 }
6622
6623 return map;
6624 }
6625
6626 return value !== undefined ?
6627 jQuery.style( elem, name, value ) :
6628 jQuery.css( elem, name );
6629 }, name, value, arguments.length > 1 );
6630 }
6631} );
6632
6633
6634function Tween( elem, options, prop, end, easing ) {
6635 return new Tween.prototype.init( elem, options, prop, end, easing );
6636}
6637jQuery.Tween = Tween;
6638
6639Tween.prototype = {
6640 constructor: Tween,
6641 init: function( elem, options, prop, end, easing, unit ) {
6642 this.elem = elem;
6643 this.prop = prop;
6644 this.easing = easing || jQuery.easing._default;
6645 this.options = options;
6646 this.start = this.now = this.cur();
6647 this.end = end;
6648 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6649 },
6650 cur: function() {
6651 var hooks = Tween.propHooks[ this.prop ];
6652
6653 return hooks && hooks.get ?
6654 hooks.get( this ) :
6655 Tween.propHooks._default.get( this );
6656 },
6657 run: function( percent ) {
6658 var eased,
6659 hooks = Tween.propHooks[ this.prop ];
6660
6661 if ( this.options.duration ) {
6662 this.pos = eased = jQuery.easing[ this.easing ](
6663 percent, this.options.duration * percent, 0, 1, this.options.duration
6664 );
6665 } else {
6666 this.pos = eased = percent;
6667 }
6668 this.now = ( this.end - this.start ) * eased + this.start;
6669
6670 if ( this.options.step ) {
6671 this.options.step.call( this.elem, this.now, this );
6672 }
6673
6674 if ( hooks && hooks.set ) {
6675 hooks.set( this );
6676 } else {
6677 Tween.propHooks._default.set( this );
6678 }
6679 return this;
6680 }
6681};
6682
6683Tween.prototype.init.prototype = Tween.prototype;
6684
6685Tween.propHooks = {
6686 _default: {
6687 get: function( tween ) {
6688 var result;
6689
6690 // Use a property on the element directly when it is not a DOM element,
6691 // or when there is no matching style property that exists.
6692 if ( tween.elem.nodeType !== 1 ||
6693 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
6694 return tween.elem[ tween.prop ];
6695 }
6696
6697 // Passing an empty string as a 3rd parameter to .css will automatically
6698 // attempt a parseFloat and fallback to a string if the parse fails.
6699 // Simple values such as "10px" are parsed to Float;
6700 // complex values such as "rotate(1rad)" are returned as-is.
6701 result = jQuery.css( tween.elem, tween.prop, "" );
6702
6703 // Empty strings, null, undefined and "auto" are converted to 0.
6704 return !result || result === "auto" ? 0 : result;
6705 },
6706 set: function( tween ) {
6707
6708 // Use step hook for back compat.
6709 // Use cssHook if its there.
6710 // Use .style if available and use plain properties where available.
6711 if ( jQuery.fx.step[ tween.prop ] ) {
6712 jQuery.fx.step[ tween.prop ]( tween );
6713 } else if ( tween.elem.nodeType === 1 &&
6714 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
6715 jQuery.cssHooks[ tween.prop ] ) ) {
6716 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6717 } else {
6718 tween.elem[ tween.prop ] = tween.now;
6719 }
6720 }
6721 }
6722};
6723
6724// Support: IE <=9 only
6725// Panic based approach to setting things on disconnected nodes
6726Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6727 set: function( tween ) {
6728 if ( tween.elem.nodeType && tween.elem.parentNode ) {
6729 tween.elem[ tween.prop ] = tween.now;
6730 }
6731 }
6732};
6733
6734jQuery.easing = {
6735 linear: function( p ) {
6736 return p;
6737 },
6738 swing: function( p ) {
6739 return 0.5 - Math.cos( p * Math.PI ) / 2;
6740 },
6741 _default: "swing"
6742};
6743
6744jQuery.fx = Tween.prototype.init;
6745
6746// Back compat <1.8 extension point
6747jQuery.fx.step = {};
6748
6749
6750
6751
6752var
6753 fxNow, timerId,
6754 rfxtypes = /^(?:toggle|show|hide)$/,
6755 rrun = /queueHooks$/;
6756
6757function raf() {
6758 if ( timerId ) {
6759 window.requestAnimationFrame( raf );
6760 jQuery.fx.tick();
6761 }
6762}
6763
6764// Animations created synchronously will run synchronously
6765function createFxNow() {
6766 window.setTimeout( function() {
6767 fxNow = undefined;
6768 } );
6769 return ( fxNow = jQuery.now() );
6770}
6771
6772// Generate parameters to create a standard animation
6773function genFx( type, includeWidth ) {
6774 var which,
6775 i = 0,
6776 attrs = { height: type };
6777
6778 // If we include width, step value is 1 to do all cssExpand values,
6779 // otherwise step value is 2 to skip over Left and Right
6780 includeWidth = includeWidth ? 1 : 0;
6781 for ( ; i < 4; i += 2 - includeWidth ) {
6782 which = cssExpand[ i ];
6783 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
6784 }
6785
6786 if ( includeWidth ) {
6787 attrs.opacity = attrs.width = type;
6788 }
6789
6790 return attrs;
6791}
6792
6793function createTween( value, prop, animation ) {
6794 var tween,
6795 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
6796 index = 0,
6797 length = collection.length;
6798 for ( ; index < length; index++ ) {
6799 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
6800
6801 // We're done with this property
6802 return tween;
6803 }
6804 }
6805}
6806
6807function defaultPrefilter( elem, props, opts ) {
6808 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
6809 isBox = "width" in props || "height" in props,
6810 anim = this,
6811 orig = {},
6812 style = elem.style,
6813 hidden = elem.nodeType && isHiddenWithinTree( elem ),
6814 dataShow = dataPriv.get( elem, "fxshow" );
6815
6816 // Queue-skipping animations hijack the fx hooks
6817 if ( !opts.queue ) {
6818 hooks = jQuery._queueHooks( elem, "fx" );
6819 if ( hooks.unqueued == null ) {
6820 hooks.unqueued = 0;
6821 oldfire = hooks.empty.fire;
6822 hooks.empty.fire = function() {
6823 if ( !hooks.unqueued ) {
6824 oldfire();
6825 }
6826 };
6827 }
6828 hooks.unqueued++;
6829
6830 anim.always( function() {
6831
6832 // Ensure the complete handler is called before this completes
6833 anim.always( function() {
6834 hooks.unqueued--;
6835 if ( !jQuery.queue( elem, "fx" ).length ) {
6836 hooks.empty.fire();
6837 }
6838 } );
6839 } );
6840 }
6841
6842 // Detect show/hide animations
6843 for ( prop in props ) {
6844 value = props[ prop ];
6845 if ( rfxtypes.test( value ) ) {
6846 delete props[ prop ];
6847 toggle = toggle || value === "toggle";
6848 if ( value === ( hidden ? "hide" : "show" ) ) {
6849
6850 // Pretend to be hidden if this is a "show" and
6851 // there is still data from a stopped show/hide
6852 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
6853 hidden = true;
6854
6855 // Ignore all other no-op show/hide data
6856 } else {
6857 continue;
6858 }
6859 }
6860 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
6861 }
6862 }
6863
6864 // Bail out if this is a no-op like .hide().hide()
6865 propTween = !jQuery.isEmptyObject( props );
6866 if ( !propTween && jQuery.isEmptyObject( orig ) ) {
6867 return;
6868 }
6869
6870 // Restrict "overflow" and "display" styles during box animations
6871 if ( isBox && elem.nodeType === 1 ) {
6872
6873 // Support: IE <=9 - 11, Edge 12 - 13
6874 // Record all 3 overflow attributes because IE does not infer the shorthand
6875 // from identically-valued overflowX and overflowY
6876 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6877
6878 // Identify a display type, preferring old show/hide data over the CSS cascade
6879 restoreDisplay = dataShow && dataShow.display;
6880 if ( restoreDisplay == null ) {
6881 restoreDisplay = dataPriv.get( elem, "display" );
6882 }
6883 display = jQuery.css( elem, "display" );
6884 if ( display === "none" ) {
6885 if ( restoreDisplay ) {
6886 display = restoreDisplay;
6887 } else {
6888
6889 // Get nonempty value(s) by temporarily forcing visibility
6890 showHide( [ elem ], true );
6891 restoreDisplay = elem.style.display || restoreDisplay;
6892 display = jQuery.css( elem, "display" );
6893 showHide( [ elem ] );
6894 }
6895 }
6896
6897 // Animate inline elements as inline-block
6898 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
6899 if ( jQuery.css( elem, "float" ) === "none" ) {
6900
6901 // Restore the original display value at the end of pure show/hide animations
6902 if ( !propTween ) {
6903 anim.done( function() {
6904 style.display = restoreDisplay;
6905 } );
6906 if ( restoreDisplay == null ) {
6907 display = style.display;
6908 restoreDisplay = display === "none" ? "" : display;
6909 }
6910 }
6911 style.display = "inline-block";
6912 }
6913 }
6914 }
6915
6916 if ( opts.overflow ) {
6917 style.overflow = "hidden";
6918 anim.always( function() {
6919 style.overflow = opts.overflow[ 0 ];
6920 style.overflowX = opts.overflow[ 1 ];
6921 style.overflowY = opts.overflow[ 2 ];
6922 } );
6923 }
6924
6925 // Implement show/hide animations
6926 propTween = false;
6927 for ( prop in orig ) {
6928
6929 // General show/hide setup for this element animation
6930 if ( !propTween ) {
6931 if ( dataShow ) {
6932 if ( "hidden" in dataShow ) {
6933 hidden = dataShow.hidden;
6934 }
6935 } else {
6936 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
6937 }
6938
6939 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
6940 if ( toggle ) {
6941 dataShow.hidden = !hidden;
6942 }
6943
6944 // Show elements before animating them
6945 if ( hidden ) {
6946 showHide( [ elem ], true );
6947 }
6948
6949 /* eslint-disable no-loop-func */
6950
6951 anim.done( function() {
6952
6953 /* eslint-enable no-loop-func */
6954
6955 // The final step of a "hide" animation is actually hiding the element
6956 if ( !hidden ) {
6957 showHide( [ elem ] );
6958 }
6959 dataPriv.remove( elem, "fxshow" );
6960 for ( prop in orig ) {
6961 jQuery.style( elem, prop, orig[ prop ] );
6962 }
6963 } );
6964 }
6965
6966 // Per-property setup
6967 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
6968 if ( !( prop in dataShow ) ) {
6969 dataShow[ prop ] = propTween.start;
6970 if ( hidden ) {
6971 propTween.end = propTween.start;
6972 propTween.start = 0;
6973 }
6974 }
6975 }
6976}
6977
6978function propFilter( props, specialEasing ) {
6979 var index, name, easing, value, hooks;
6980
6981 // camelCase, specialEasing and expand cssHook pass
6982 for ( index in props ) {
6983 name = jQuery.camelCase( index );
6984 easing = specialEasing[ name ];
6985 value = props[ index ];
6986 if ( jQuery.isArray( value ) ) {
6987 easing = value[ 1 ];
6988 value = props[ index ] = value[ 0 ];
6989 }
6990
6991 if ( index !== name ) {
6992 props[ name ] = value;
6993 delete props[ index ];
6994 }
6995
6996 hooks = jQuery.cssHooks[ name ];
6997 if ( hooks && "expand" in hooks ) {
6998 value = hooks.expand( value );
6999 delete props[ name ];
7000
7001 // Not quite $.extend, this won't overwrite existing keys.
7002 // Reusing 'index' because we have the correct "name"
7003 for ( index in value ) {
7004 if ( !( index in props ) ) {
7005 props[ index ] = value[ index ];
7006 specialEasing[ index ] = easing;
7007 }
7008 }
7009 } else {
7010 specialEasing[ name ] = easing;
7011 }
7012 }
7013}
7014
7015function Animation( elem, properties, options ) {
7016 var result,
7017 stopped,
7018 index = 0,
7019 length = Animation.prefilters.length,
7020 deferred = jQuery.Deferred().always( function() {
7021
7022 // Don't match elem in the :animated selector
7023 delete tick.elem;
7024 } ),
7025 tick = function() {
7026 if ( stopped ) {
7027 return false;
7028 }
7029 var currentTime = fxNow || createFxNow(),
7030 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7031
7032 // Support: Android 2.3 only
7033 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7034 temp = remaining / animation.duration || 0,
7035 percent = 1 - temp,
7036 index = 0,
7037 length = animation.tweens.length;
7038
7039 for ( ; index < length; index++ ) {
7040 animation.tweens[ index ].run( percent );
7041 }
7042
7043 deferred.notifyWith( elem, [ animation, percent, remaining ] );
7044
7045 if ( percent < 1 && length ) {
7046 return remaining;
7047 } else {
7048 deferred.resolveWith( elem, [ animation ] );
7049 return false;
7050 }
7051 },
7052 animation = deferred.promise( {
7053 elem: elem,
7054 props: jQuery.extend( {}, properties ),
7055 opts: jQuery.extend( true, {
7056 specialEasing: {},
7057 easing: jQuery.easing._default
7058 }, options ),
7059 originalProperties: properties,
7060 originalOptions: options,
7061 startTime: fxNow || createFxNow(),
7062 duration: options.duration,
7063 tweens: [],
7064 createTween: function( prop, end ) {
7065 var tween = jQuery.Tween( elem, animation.opts, prop, end,
7066 animation.opts.specialEasing[ prop ] || animation.opts.easing );
7067 animation.tweens.push( tween );
7068 return tween;
7069 },
7070 stop: function( gotoEnd ) {
7071 var index = 0,
7072
7073 // If we are going to the end, we want to run all the tweens
7074 // otherwise we skip this part
7075 length = gotoEnd ? animation.tweens.length : 0;
7076 if ( stopped ) {
7077 return this;
7078 }
7079 stopped = true;
7080 for ( ; index < length; index++ ) {
7081 animation.tweens[ index ].run( 1 );
7082 }
7083
7084 // Resolve when we played the last frame; otherwise, reject
7085 if ( gotoEnd ) {
7086 deferred.notifyWith( elem, [ animation, 1, 0 ] );
7087 deferred.resolveWith( elem, [ animation, gotoEnd ] );
7088 } else {
7089 deferred.rejectWith( elem, [ animation, gotoEnd ] );
7090 }
7091 return this;
7092 }
7093 } ),
7094 props = animation.props;
7095
7096 propFilter( props, animation.opts.specialEasing );
7097
7098 for ( ; index < length; index++ ) {
7099 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
7100 if ( result ) {
7101 if ( jQuery.isFunction( result.stop ) ) {
7102 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
7103 jQuery.proxy( result.stop, result );
7104 }
7105 return result;
7106 }
7107 }
7108
7109 jQuery.map( props, createTween, animation );
7110
7111 if ( jQuery.isFunction( animation.opts.start ) ) {
7112 animation.opts.start.call( elem, animation );
7113 }
7114
7115 jQuery.fx.timer(
7116 jQuery.extend( tick, {
7117 elem: elem,
7118 anim: animation,
7119 queue: animation.opts.queue
7120 } )
7121 );
7122
7123 // attach callbacks from options
7124 return animation.progress( animation.opts.progress )
7125 .done( animation.opts.done, animation.opts.complete )
7126 .fail( animation.opts.fail )
7127 .always( animation.opts.always );
7128}
7129
7130jQuery.Animation = jQuery.extend( Animation, {
7131
7132 tweeners: {
7133 "*": [ function( prop, value ) {
7134 var tween = this.createTween( prop, value );
7135 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
7136 return tween;
7137 } ]
7138 },
7139
7140 tweener: function( props, callback ) {
7141 if ( jQuery.isFunction( props ) ) {
7142 callback = props;
7143 props = [ "*" ];
7144 } else {
7145 props = props.match( rnothtmlwhite );
7146 }
7147
7148 var prop,
7149 index = 0,
7150 length = props.length;
7151
7152 for ( ; index < length; index++ ) {
7153 prop = props[ index ];
7154 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
7155 Animation.tweeners[ prop ].unshift( callback );
7156 }
7157 },
7158
7159 prefilters: [ defaultPrefilter ],
7160
7161 prefilter: function( callback, prepend ) {
7162 if ( prepend ) {
7163 Animation.prefilters.unshift( callback );
7164 } else {
7165 Animation.prefilters.push( callback );
7166 }
7167 }
7168} );
7169
7170jQuery.speed = function( speed, easing, fn ) {
7171 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7172 complete: fn || !fn && easing ||
7173 jQuery.isFunction( speed ) && speed,
7174 duration: speed,
7175 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7176 };
7177
7178 // Go to the end state if fx are off or if document is hidden
7179 if ( jQuery.fx.off || document.hidden ) {
7180 opt.duration = 0;
7181
7182 } else {
7183 if ( typeof opt.duration !== "number" ) {
7184 if ( opt.duration in jQuery.fx.speeds ) {
7185 opt.duration = jQuery.fx.speeds[ opt.duration ];
7186
7187 } else {
7188 opt.duration = jQuery.fx.speeds._default;
7189 }
7190 }
7191 }
7192
7193 // Normalize opt.queue - true/undefined/null -> "fx"
7194 if ( opt.queue == null || opt.queue === true ) {
7195 opt.queue = "fx";
7196 }
7197
7198 // Queueing
7199 opt.old = opt.complete;
7200
7201 opt.complete = function() {
7202 if ( jQuery.isFunction( opt.old ) ) {
7203 opt.old.call( this );
7204 }
7205
7206 if ( opt.queue ) {
7207 jQuery.dequeue( this, opt.queue );
7208 }
7209 };
7210
7211 return opt;
7212};
7213
7214jQuery.fn.extend( {
7215 fadeTo: function( speed, to, easing, callback ) {
7216
7217 // Show any hidden elements after setting opacity to 0
7218 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
7219
7220 // Animate to the value specified
7221 .end().animate( { opacity: to }, speed, easing, callback );
7222 },
7223 animate: function( prop, speed, easing, callback ) {
7224 var empty = jQuery.isEmptyObject( prop ),
7225 optall = jQuery.speed( speed, easing, callback ),
7226 doAnimation = function() {
7227
7228 // Operate on a copy of prop so per-property easing won't be lost
7229 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7230
7231 // Empty animations, or finishing resolves immediately
7232 if ( empty || dataPriv.get( this, "finish" ) ) {
7233 anim.stop( true );
7234 }
7235 };
7236 doAnimation.finish = doAnimation;
7237
7238 return empty || optall.queue === false ?
7239 this.each( doAnimation ) :
7240 this.queue( optall.queue, doAnimation );
7241 },
7242 stop: function( type, clearQueue, gotoEnd ) {
7243 var stopQueue = function( hooks ) {
7244 var stop = hooks.stop;
7245 delete hooks.stop;
7246 stop( gotoEnd );
7247 };
7248
7249 if ( typeof type !== "string" ) {
7250 gotoEnd = clearQueue;
7251 clearQueue = type;
7252 type = undefined;
7253 }
7254 if ( clearQueue && type !== false ) {
7255 this.queue( type || "fx", [] );
7256 }
7257
7258 return this.each( function() {
7259 var dequeue = true,
7260 index = type != null && type + "queueHooks",
7261 timers = jQuery.timers,
7262 data = dataPriv.get( this );
7263
7264 if ( index ) {
7265 if ( data[ index ] && data[ index ].stop ) {
7266 stopQueue( data[ index ] );
7267 }
7268 } else {
7269 for ( index in data ) {
7270 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7271 stopQueue( data[ index ] );
7272 }
7273 }
7274 }
7275
7276 for ( index = timers.length; index--; ) {
7277 if ( timers[ index ].elem === this &&
7278 ( type == null || timers[ index ].queue === type ) ) {
7279
7280 timers[ index ].anim.stop( gotoEnd );
7281 dequeue = false;
7282 timers.splice( index, 1 );
7283 }
7284 }
7285
7286 // Start the next in the queue if the last step wasn't forced.
7287 // Timers currently will call their complete callbacks, which
7288 // will dequeue but only if they were gotoEnd.
7289 if ( dequeue || !gotoEnd ) {
7290 jQuery.dequeue( this, type );
7291 }
7292 } );
7293 },
7294 finish: function( type ) {
7295 if ( type !== false ) {
7296 type = type || "fx";
7297 }
7298 return this.each( function() {
7299 var index,
7300 data = dataPriv.get( this ),
7301 queue = data[ type + "queue" ],
7302 hooks = data[ type + "queueHooks" ],
7303 timers = jQuery.timers,
7304 length = queue ? queue.length : 0;
7305
7306 // Enable finishing flag on private data
7307 data.finish = true;
7308
7309 // Empty the queue first
7310 jQuery.queue( this, type, [] );
7311
7312 if ( hooks && hooks.stop ) {
7313 hooks.stop.call( this, true );
7314 }
7315
7316 // Look for any active animations, and finish them
7317 for ( index = timers.length; index--; ) {
7318 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7319 timers[ index ].anim.stop( true );
7320 timers.splice( index, 1 );
7321 }
7322 }
7323
7324 // Look for any animations in the old queue and finish them
7325 for ( index = 0; index < length; index++ ) {
7326 if ( queue[ index ] && queue[ index ].finish ) {
7327 queue[ index ].finish.call( this );
7328 }
7329 }
7330
7331 // Turn off finishing flag
7332 delete data.finish;
7333 } );
7334 }
7335} );
7336
7337jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7338 var cssFn = jQuery.fn[ name ];
7339 jQuery.fn[ name ] = function( speed, easing, callback ) {
7340 return speed == null || typeof speed === "boolean" ?
7341 cssFn.apply( this, arguments ) :
7342 this.animate( genFx( name, true ), speed, easing, callback );
7343 };
7344} );
7345
7346// Generate shortcuts for custom animations
7347jQuery.each( {
7348 slideDown: genFx( "show" ),
7349 slideUp: genFx( "hide" ),
7350 slideToggle: genFx( "toggle" ),
7351 fadeIn: { opacity: "show" },
7352 fadeOut: { opacity: "hide" },
7353 fadeToggle: { opacity: "toggle" }
7354}, function( name, props ) {
7355 jQuery.fn[ name ] = function( speed, easing, callback ) {
7356 return this.animate( props, speed, easing, callback );
7357 };
7358} );
7359
7360jQuery.timers = [];
7361jQuery.fx.tick = function() {
7362 var timer,
7363 i = 0,
7364 timers = jQuery.timers;
7365
7366 fxNow = jQuery.now();
7367
7368 for ( ; i < timers.length; i++ ) {
7369 timer = timers[ i ];
7370
7371 // Checks the timer has not already been removed
7372 if ( !timer() && timers[ i ] === timer ) {
7373 timers.splice( i--, 1 );
7374 }
7375 }
7376
7377 if ( !timers.length ) {
7378 jQuery.fx.stop();
7379 }
7380 fxNow = undefined;
7381};
7382
7383jQuery.fx.timer = function( timer ) {
7384 jQuery.timers.push( timer );
7385 if ( timer() ) {
7386 jQuery.fx.start();
7387 } else {
7388 jQuery.timers.pop();
7389 }
7390};
7391
7392jQuery.fx.interval = 13;
7393jQuery.fx.start = function() {
7394 if ( !timerId ) {
7395 timerId = window.requestAnimationFrame ?
7396 window.requestAnimationFrame( raf ) :
7397 window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
7398 }
7399};
7400
7401jQuery.fx.stop = function() {
7402 if ( window.cancelAnimationFrame ) {
7403 window.cancelAnimationFrame( timerId );
7404 } else {
7405 window.clearInterval( timerId );
7406 }
7407
7408 timerId = null;
7409};
7410
7411jQuery.fx.speeds = {
7412 slow: 600,
7413 fast: 200,
7414
7415 // Default speed
7416 _default: 400
7417};
7418
7419
7420// Based off of the plugin by Clint Helfers, with permission.
7421// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7422jQuery.fn.delay = function( time, type ) {
7423 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7424 type = type || "fx";
7425
7426 return this.queue( type, function( next, hooks ) {
7427 var timeout = window.setTimeout( next, time );
7428 hooks.stop = function() {
7429 window.clearTimeout( timeout );
7430 };
7431 } );
7432};
7433
7434
7435( function() {
7436 var input = document.createElement( "input" ),
7437 select = document.createElement( "select" ),
7438 opt = select.appendChild( document.createElement( "option" ) );
7439
7440 input.type = "checkbox";
7441
7442 // Support: Android <=4.3 only
7443 // Default value for a checkbox should be "on"
7444 support.checkOn = input.value !== "";
7445
7446 // Support: IE <=11 only
7447 // Must access selectedIndex to make default options select
7448 support.optSelected = opt.selected;
7449
7450 // Support: IE <=11 only
7451 // An input loses its value after becoming a radio
7452 input = document.createElement( "input" );
7453 input.value = "t";
7454 input.type = "radio";
7455 support.radioValue = input.value === "t";
7456} )();
7457
7458
7459var boolHook,
7460 attrHandle = jQuery.expr.attrHandle;
7461
7462jQuery.fn.extend( {
7463 attr: function( name, value ) {
7464 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7465 },
7466
7467 removeAttr: function( name ) {
7468 return this.each( function() {
7469 jQuery.removeAttr( this, name );
7470 } );
7471 }
7472} );
7473
7474jQuery.extend( {
7475 attr: function( elem, name, value ) {
7476 var ret, hooks,
7477 nType = elem.nodeType;
7478
7479 // Don't get/set attributes on text, comment and attribute nodes
7480 if ( nType === 3 || nType === 8 || nType === 2 ) {
7481 return;
7482 }
7483
7484 // Fallback to prop when attributes are not supported
7485 if ( typeof elem.getAttribute === "undefined" ) {
7486 return jQuery.prop( elem, name, value );
7487 }
7488
7489 // Attribute hooks are determined by the lowercase version
7490 // Grab necessary hook if one is defined
7491 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7492 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
7493 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7494 }
7495
7496 if ( value !== undefined ) {
7497 if ( value === null ) {
7498 jQuery.removeAttr( elem, name );
7499 return;
7500 }
7501
7502 if ( hooks && "set" in hooks &&
7503 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7504 return ret;
7505 }
7506
7507 elem.setAttribute( name, value + "" );
7508 return value;
7509 }
7510
7511 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7512 return ret;
7513 }
7514
7515 ret = jQuery.find.attr( elem, name );
7516
7517 // Non-existent attributes return null, we normalize to undefined
7518 return ret == null ? undefined : ret;
7519 },
7520
7521 attrHooks: {
7522 type: {
7523 set: function( elem, value ) {
7524 if ( !support.radioValue && value === "radio" &&
7525 jQuery.nodeName( elem, "input" ) ) {
7526 var val = elem.value;
7527 elem.setAttribute( "type", value );
7528 if ( val ) {
7529 elem.value = val;
7530 }
7531 return value;
7532 }
7533 }
7534 }
7535 },
7536
7537 removeAttr: function( elem, value ) {
7538 var name,
7539 i = 0,
7540
7541 // Attribute names can contain non-HTML whitespace characters
7542 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7543 attrNames = value && value.match( rnothtmlwhite );
7544
7545 if ( attrNames && elem.nodeType === 1 ) {
7546 while ( ( name = attrNames[ i++ ] ) ) {
7547 elem.removeAttribute( name );
7548 }
7549 }
7550 }
7551} );
7552
7553// Hooks for boolean attributes
7554boolHook = {
7555 set: function( elem, value, name ) {
7556 if ( value === false ) {
7557
7558 // Remove boolean attributes when set to false
7559 jQuery.removeAttr( elem, name );
7560 } else {
7561 elem.setAttribute( name, name );
7562 }
7563 return name;
7564 }
7565};
7566
7567jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7568 var getter = attrHandle[ name ] || jQuery.find.attr;
7569
7570 attrHandle[ name ] = function( elem, name, isXML ) {
7571 var ret, handle,
7572 lowercaseName = name.toLowerCase();
7573
7574 if ( !isXML ) {
7575
7576 // Avoid an infinite loop by temporarily removing this function from the getter
7577 handle = attrHandle[ lowercaseName ];
7578 attrHandle[ lowercaseName ] = ret;
7579 ret = getter( elem, name, isXML ) != null ?
7580 lowercaseName :
7581 null;
7582 attrHandle[ lowercaseName ] = handle;
7583 }
7584 return ret;
7585 };
7586} );
7587
7588
7589
7590
7591var rfocusable = /^(?:input|select|textarea|button)$/i,
7592 rclickable = /^(?:a|area)$/i;
7593
7594jQuery.fn.extend( {
7595 prop: function( name, value ) {
7596 return access( this, jQuery.prop, name, value, arguments.length > 1 );
7597 },
7598
7599 removeProp: function( name ) {
7600 return this.each( function() {
7601 delete this[ jQuery.propFix[ name ] || name ];
7602 } );
7603 }
7604} );
7605
7606jQuery.extend( {
7607 prop: function( elem, name, value ) {
7608 var ret, hooks,
7609 nType = elem.nodeType;
7610
7611 // Don't get/set properties on text, comment and attribute nodes
7612 if ( nType === 3 || nType === 8 || nType === 2 ) {
7613 return;
7614 }
7615
7616 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7617
7618 // Fix name and attach hooks
7619 name = jQuery.propFix[ name ] || name;
7620 hooks = jQuery.propHooks[ name ];
7621 }
7622
7623 if ( value !== undefined ) {
7624 if ( hooks && "set" in hooks &&
7625 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7626 return ret;
7627 }
7628
7629 return ( elem[ name ] = value );
7630 }
7631
7632 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7633 return ret;
7634 }
7635
7636 return elem[ name ];
7637 },
7638
7639 propHooks: {
7640 tabIndex: {
7641 get: function( elem ) {
7642
7643 // Support: IE <=9 - 11 only
7644 // elem.tabIndex doesn't always return the
7645 // correct value when it hasn't been explicitly set
7646 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7647 // Use proper attribute retrieval(#12072)
7648 var tabindex = jQuery.find.attr( elem, "tabindex" );
7649
7650 if ( tabindex ) {
7651 return parseInt( tabindex, 10 );
7652 }
7653
7654 if (
7655 rfocusable.test( elem.nodeName ) ||
7656 rclickable.test( elem.nodeName ) &&
7657 elem.href
7658 ) {
7659 return 0;
7660 }
7661
7662 return -1;
7663 }
7664 }
7665 },
7666
7667 propFix: {
7668 "for": "htmlFor",
7669 "class": "className"
7670 }
7671} );
7672
7673// Support: IE <=11 only
7674// Accessing the selectedIndex property
7675// forces the browser to respect setting selected
7676// on the option
7677// The getter ensures a default option is selected
7678// when in an optgroup
7679// eslint rule "no-unused-expressions" is disabled for this code
7680// since it considers such accessions noop
7681if ( !support.optSelected ) {
7682 jQuery.propHooks.selected = {
7683 get: function( elem ) {
7684
7685 /* eslint no-unused-expressions: "off" */
7686
7687 var parent = elem.parentNode;
7688 if ( parent && parent.parentNode ) {
7689 parent.parentNode.selectedIndex;
7690 }
7691 return null;
7692 },
7693 set: function( elem ) {
7694
7695 /* eslint no-unused-expressions: "off" */
7696
7697 var parent = elem.parentNode;
7698 if ( parent ) {
7699 parent.selectedIndex;
7700
7701 if ( parent.parentNode ) {
7702 parent.parentNode.selectedIndex;
7703 }
7704 }
7705 }
7706 };
7707}
7708
7709jQuery.each( [
7710 "tabIndex",
7711 "readOnly",
7712 "maxLength",
7713 "cellSpacing",
7714 "cellPadding",
7715 "rowSpan",
7716 "colSpan",
7717 "useMap",
7718 "frameBorder",
7719 "contentEditable"
7720], function() {
7721 jQuery.propFix[ this.toLowerCase() ] = this;
7722} );
7723
7724
7725
7726
7727 // Strip and collapse whitespace according to HTML spec
7728 // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
7729 function stripAndCollapse( value ) {
7730 var tokens = value.match( rnothtmlwhite ) || [];
7731 return tokens.join( " " );
7732 }
7733
7734
7735function getClass( elem ) {
7736 return elem.getAttribute && elem.getAttribute( "class" ) || "";
7737}
7738
7739jQuery.fn.extend( {
7740 addClass: function( value ) {
7741 var classes, elem, cur, curValue, clazz, j, finalValue,
7742 i = 0;
7743
7744 if ( jQuery.isFunction( value ) ) {
7745 return this.each( function( j ) {
7746 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
7747 } );
7748 }
7749
7750 if ( typeof value === "string" && value ) {
7751 classes = value.match( rnothtmlwhite ) || [];
7752
7753 while ( ( elem = this[ i++ ] ) ) {
7754 curValue = getClass( elem );
7755 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7756
7757 if ( cur ) {
7758 j = 0;
7759 while ( ( clazz = classes[ j++ ] ) ) {
7760 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
7761 cur += clazz + " ";
7762 }
7763 }
7764
7765 // Only assign if different to avoid unneeded rendering.
7766 finalValue = stripAndCollapse( cur );
7767 if ( curValue !== finalValue ) {
7768 elem.setAttribute( "class", finalValue );
7769 }
7770 }
7771 }
7772 }
7773
7774 return this;
7775 },
7776
7777 removeClass: function( value ) {
7778 var classes, elem, cur, curValue, clazz, j, finalValue,
7779 i = 0;
7780
7781 if ( jQuery.isFunction( value ) ) {
7782 return this.each( function( j ) {
7783 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
7784 } );
7785 }
7786
7787 if ( !arguments.length ) {
7788 return this.attr( "class", "" );
7789 }
7790
7791 if ( typeof value === "string" && value ) {
7792 classes = value.match( rnothtmlwhite ) || [];
7793
7794 while ( ( elem = this[ i++ ] ) ) {
7795 curValue = getClass( elem );
7796
7797 // This expression is here for better compressibility (see addClass)
7798 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7799
7800 if ( cur ) {
7801 j = 0;
7802 while ( ( clazz = classes[ j++ ] ) ) {
7803
7804 // Remove *all* instances
7805 while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
7806 cur = cur.replace( " " + clazz + " ", " " );
7807 }
7808 }
7809
7810 // Only assign if different to avoid unneeded rendering.
7811 finalValue = stripAndCollapse( cur );
7812 if ( curValue !== finalValue ) {
7813 elem.setAttribute( "class", finalValue );
7814 }
7815 }
7816 }
7817 }
7818
7819 return this;
7820 },
7821
7822 toggleClass: function( value, stateVal ) {
7823 var type = typeof value;
7824
7825 if ( typeof stateVal === "boolean" && type === "string" ) {
7826 return stateVal ? this.addClass( value ) : this.removeClass( value );
7827 }
7828
7829 if ( jQuery.isFunction( value ) ) {
7830 return this.each( function( i ) {
7831 jQuery( this ).toggleClass(
7832 value.call( this, i, getClass( this ), stateVal ),
7833 stateVal
7834 );
7835 } );
7836 }
7837
7838 return this.each( function() {
7839 var className, i, self, classNames;
7840
7841 if ( type === "string" ) {
7842
7843 // Toggle individual class names
7844 i = 0;
7845 self = jQuery( this );
7846 classNames = value.match( rnothtmlwhite ) || [];
7847
7848 while ( ( className = classNames[ i++ ] ) ) {
7849
7850 // Check each className given, space separated list
7851 if ( self.hasClass( className ) ) {
7852 self.removeClass( className );
7853 } else {
7854 self.addClass( className );
7855 }
7856 }
7857
7858 // Toggle whole class name
7859 } else if ( value === undefined || type === "boolean" ) {
7860 className = getClass( this );
7861 if ( className ) {
7862
7863 // Store className if set
7864 dataPriv.set( this, "__className__", className );
7865 }
7866
7867 // If the element has a class name or if we're passed `false`,
7868 // then remove the whole classname (if there was one, the above saved it).
7869 // Otherwise bring back whatever was previously saved (if anything),
7870 // falling back to the empty string if nothing was stored.
7871 if ( this.setAttribute ) {
7872 this.setAttribute( "class",
7873 className || value === false ?
7874 "" :
7875 dataPriv.get( this, "__className__" ) || ""
7876 );
7877 }
7878 }
7879 } );
7880 },
7881
7882 hasClass: function( selector ) {
7883 var className, elem,
7884 i = 0;
7885
7886 className = " " + selector + " ";
7887 while ( ( elem = this[ i++ ] ) ) {
7888 if ( elem.nodeType === 1 &&
7889 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
7890 return true;
7891 }
7892 }
7893
7894 return false;
7895 }
7896} );
7897
7898
7899
7900
7901var rreturn = /\r/g;
7902
7903jQuery.fn.extend( {
7904 val: function( value ) {
7905 var hooks, ret, isFunction,
7906 elem = this[ 0 ];
7907
7908 if ( !arguments.length ) {
7909 if ( elem ) {
7910 hooks = jQuery.valHooks[ elem.type ] ||
7911 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7912
7913 if ( hooks &&
7914 "get" in hooks &&
7915 ( ret = hooks.get( elem, "value" ) ) !== undefined
7916 ) {
7917 return ret;
7918 }
7919
7920 ret = elem.value;
7921
7922 // Handle most common string cases
7923 if ( typeof ret === "string" ) {
7924 return ret.replace( rreturn, "" );
7925 }
7926
7927 // Handle cases where value is null/undef or number
7928 return ret == null ? "" : ret;
7929 }
7930
7931 return;
7932 }
7933
7934 isFunction = jQuery.isFunction( value );
7935
7936 return this.each( function( i ) {
7937 var val;
7938
7939 if ( this.nodeType !== 1 ) {
7940 return;
7941 }
7942
7943 if ( isFunction ) {
7944 val = value.call( this, i, jQuery( this ).val() );
7945 } else {
7946 val = value;
7947 }
7948
7949 // Treat null/undefined as ""; convert numbers to string
7950 if ( val == null ) {
7951 val = "";
7952
7953 } else if ( typeof val === "number" ) {
7954 val += "";
7955
7956 } else if ( jQuery.isArray( val ) ) {
7957 val = jQuery.map( val, function( value ) {
7958 return value == null ? "" : value + "";
7959 } );
7960 }
7961
7962 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7963
7964 // If set returns undefined, fall back to normal setting
7965 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
7966 this.value = val;
7967 }
7968 } );
7969 }
7970} );
7971
7972jQuery.extend( {
7973 valHooks: {
7974 option: {
7975 get: function( elem ) {
7976
7977 var val = jQuery.find.attr( elem, "value" );
7978 return val != null ?
7979 val :
7980
7981 // Support: IE <=10 - 11 only
7982 // option.text throws exceptions (#14686, #14858)
7983 // Strip and collapse whitespace
7984 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7985 stripAndCollapse( jQuery.text( elem ) );
7986 }
7987 },
7988 select: {
7989 get: function( elem ) {
7990 var value, option, i,
7991 options = elem.options,
7992 index = elem.selectedIndex,
7993 one = elem.type === "select-one",
7994 values = one ? null : [],
7995 max = one ? index + 1 : options.length;
7996
7997 if ( index < 0 ) {
7998 i = max;
7999
8000 } else {
8001 i = one ? index : 0;
8002 }
8003
8004 // Loop through all the selected options
8005 for ( ; i < max; i++ ) {
8006 option = options[ i ];
8007
8008 // Support: IE <=9 only
8009 // IE8-9 doesn't update selected after form reset (#2551)
8010 if ( ( option.selected || i === index ) &&
8011
8012 // Don't return options that are disabled or in a disabled optgroup
8013 !option.disabled &&
8014 ( !option.parentNode.disabled ||
8015 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
8016
8017 // Get the specific value for the option
8018 value = jQuery( option ).val();
8019
8020 // We don't need an array for one selects
8021 if ( one ) {
8022 return value;
8023 }
8024
8025 // Multi-Selects return an array
8026 values.push( value );
8027 }
8028 }
8029
8030 return values;
8031 },
8032
8033 set: function( elem, value ) {
8034 var optionSet, option,
8035 options = elem.options,
8036 values = jQuery.makeArray( value ),
8037 i = options.length;
8038
8039 while ( i-- ) {
8040 option = options[ i ];
8041
8042 /* eslint-disable no-cond-assign */
8043
8044 if ( option.selected =
8045 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
8046 ) {
8047 optionSet = true;
8048 }
8049
8050 /* eslint-enable no-cond-assign */
8051 }
8052
8053 // Force browsers to behave consistently when non-matching value is set
8054 if ( !optionSet ) {
8055 elem.selectedIndex = -1;
8056 }
8057 return values;
8058 }
8059 }
8060 }
8061} );
8062
8063// Radios and checkboxes getter/setter
8064jQuery.each( [ "radio", "checkbox" ], function() {
8065 jQuery.valHooks[ this ] = {
8066 set: function( elem, value ) {
8067 if ( jQuery.isArray( value ) ) {
8068 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
8069 }
8070 }
8071 };
8072 if ( !support.checkOn ) {
8073 jQuery.valHooks[ this ].get = function( elem ) {
8074 return elem.getAttribute( "value" ) === null ? "on" : elem.value;
8075 };
8076 }
8077} );
8078
8079
8080
8081
8082// Return jQuery for attributes-only inclusion
8083
8084
8085var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
8086
8087jQuery.extend( jQuery.event, {
8088
8089 trigger: function( event, data, elem, onlyHandlers ) {
8090
8091 var i, cur, tmp, bubbleType, ontype, handle, special,
8092 eventPath = [ elem || document ],
8093 type = hasOwn.call( event, "type" ) ? event.type : event,
8094 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
8095
8096 cur = tmp = elem = elem || document;
8097
8098 // Don't do events on text and comment nodes
8099 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
8100 return;
8101 }
8102
8103 // focus/blur morphs to focusin/out; ensure we're not firing them right now
8104 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
8105 return;
8106 }
8107
8108 if ( type.indexOf( "." ) > -1 ) {
8109
8110 // Namespaced trigger; create a regexp to match event type in handle()
8111 namespaces = type.split( "." );
8112 type = namespaces.shift();
8113 namespaces.sort();
8114 }
8115 ontype = type.indexOf( ":" ) < 0 && "on" + type;
8116
8117 // Caller can pass in a jQuery.Event object, Object, or just an event type string
8118 event = event[ jQuery.expando ] ?
8119 event :
8120 new jQuery.Event( type, typeof event === "object" && event );
8121
8122 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
8123 event.isTrigger = onlyHandlers ? 2 : 3;
8124 event.namespace = namespaces.join( "." );
8125 event.rnamespace = event.namespace ?
8126 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
8127 null;
8128
8129 // Clean up the event in case it is being reused
8130 event.result = undefined;
8131 if ( !event.target ) {
8132 event.target = elem;
8133 }
8134
8135 // Clone any incoming data and prepend the event, creating the handler arg list
8136 data = data == null ?
8137 [ event ] :
8138 jQuery.makeArray( data, [ event ] );
8139
8140 // Allow special events to draw outside the lines
8141 special = jQuery.event.special[ type ] || {};
8142 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
8143 return;
8144 }
8145
8146 // Determine event propagation path in advance, per W3C events spec (#9951)
8147 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8148 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
8149
8150 bubbleType = special.delegateType || type;
8151 if ( !rfocusMorph.test( bubbleType + type ) ) {
8152 cur = cur.parentNode;
8153 }
8154 for ( ; cur; cur = cur.parentNode ) {
8155 eventPath.push( cur );
8156 tmp = cur;
8157 }
8158
8159 // Only add window if we got to document (e.g., not plain obj or detached DOM)
8160 if ( tmp === ( elem.ownerDocument || document ) ) {
8161 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
8162 }
8163 }
8164
8165 // Fire handlers on the event path
8166 i = 0;
8167 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
8168
8169 event.type = i > 1 ?
8170 bubbleType :
8171 special.bindType || type;
8172
8173 // jQuery handler
8174 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
8175 dataPriv.get( cur, "handle" );
8176 if ( handle ) {
8177 handle.apply( cur, data );
8178 }
8179
8180 // Native handler
8181 handle = ontype && cur[ ontype ];
8182 if ( handle && handle.apply && acceptData( cur ) ) {
8183 event.result = handle.apply( cur, data );
8184 if ( event.result === false ) {
8185 event.preventDefault();
8186 }
8187 }
8188 }
8189 event.type = type;
8190
8191 // If nobody prevented the default action, do it now
8192 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
8193
8194 if ( ( !special._default ||
8195 special._default.apply( eventPath.pop(), data ) === false ) &&
8196 acceptData( elem ) ) {
8197
8198 // Call a native DOM method on the target with the same name as the event.
8199 // Don't do default actions on window, that's where global variables be (#6170)
8200 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
8201
8202 // Don't re-trigger an onFOO event when we call its FOO() method
8203 tmp = elem[ ontype ];
8204
8205 if ( tmp ) {
8206 elem[ ontype ] = null;
8207 }
8208
8209 // Prevent re-triggering of the same event, since we already bubbled it above
8210 jQuery.event.triggered = type;
8211 elem[ type ]();
8212 jQuery.event.triggered = undefined;
8213
8214 if ( tmp ) {
8215 elem[ ontype ] = tmp;
8216 }
8217 }
8218 }
8219 }
8220
8221 return event.result;
8222 },
8223
8224 // Piggyback on a donor event to simulate a different one
8225 // Used only for `focus(in | out)` events
8226 simulate: function( type, elem, event ) {
8227 var e = jQuery.extend(
8228 new jQuery.Event(),
8229 event,
8230 {
8231 type: type,
8232 isSimulated: true
8233 }
8234 );
8235
8236 jQuery.event.trigger( e, null, elem );
8237 }
8238
8239} );
8240
8241jQuery.fn.extend( {
8242
8243 trigger: function( type, data ) {
8244 return this.each( function() {
8245 jQuery.event.trigger( type, data, this );
8246 } );
8247 },
8248 triggerHandler: function( type, data ) {
8249 var elem = this[ 0 ];
8250 if ( elem ) {
8251 return jQuery.event.trigger( type, data, elem, true );
8252 }
8253 }
8254} );
8255
8256
8257jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
8258 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8259 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
8260 function( i, name ) {
8261
8262 // Handle event binding
8263 jQuery.fn[ name ] = function( data, fn ) {
8264 return arguments.length > 0 ?
8265 this.on( name, null, data, fn ) :
8266 this.trigger( name );
8267 };
8268} );
8269
8270jQuery.fn.extend( {
8271 hover: function( fnOver, fnOut ) {
8272 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8273 }
8274} );
8275
8276
8277
8278
8279support.focusin = "onfocusin" in window;
8280
8281
8282// Support: Firefox <=44
8283// Firefox doesn't have focus(in | out) events
8284// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8285//
8286// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8287// focus(in | out) events fire after focus & blur events,
8288// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8289// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8290if ( !support.focusin ) {
8291 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
8292
8293 // Attach a single capturing handler on the document while someone wants focusin/focusout
8294 var handler = function( event ) {
8295 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
8296 };
8297
8298 jQuery.event.special[ fix ] = {
8299 setup: function() {
8300 var doc = this.ownerDocument || this,
8301 attaches = dataPriv.access( doc, fix );
8302
8303 if ( !attaches ) {
8304 doc.addEventListener( orig, handler, true );
8305 }
8306 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8307 },
8308 teardown: function() {
8309 var doc = this.ownerDocument || this,
8310 attaches = dataPriv.access( doc, fix ) - 1;
8311
8312 if ( !attaches ) {
8313 doc.removeEventListener( orig, handler, true );
8314 dataPriv.remove( doc, fix );
8315
8316 } else {
8317 dataPriv.access( doc, fix, attaches );
8318 }
8319 }
8320 };
8321 } );
8322}
8323var location = window.location;
8324
8325var nonce = jQuery.now();
8326
8327var rquery = ( /\?/ );
8328
8329
8330
8331// Cross-browser xml parsing
8332jQuery.parseXML = function( data ) {
8333 var xml;
8334 if ( !data || typeof data !== "string" ) {
8335 return null;
8336 }
8337
8338 // Support: IE 9 - 11 only
8339 // IE throws on parseFromString with invalid input.
8340 try {
8341 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8342 } catch ( e ) {
8343 xml = undefined;
8344 }
8345
8346 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8347 jQuery.error( "Invalid XML: " + data );
8348 }
8349 return xml;
8350};
8351
8352
8353var
8354 rbracket = /\[\]$/,
8355 rCRLF = /\r?\n/g,
8356 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8357 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8358
8359function buildParams( prefix, obj, traditional, add ) {
8360 var name;
8361
8362 if ( jQuery.isArray( obj ) ) {
8363
8364 // Serialize array item.
8365 jQuery.each( obj, function( i, v ) {
8366 if ( traditional || rbracket.test( prefix ) ) {
8367
8368 // Treat each array item as a scalar.
8369 add( prefix, v );
8370
8371 } else {
8372
8373 // Item is non-scalar (array or object), encode its numeric index.
8374 buildParams(
8375 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8376 v,
8377 traditional,
8378 add
8379 );
8380 }
8381 } );
8382
8383 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
8384
8385 // Serialize object item.
8386 for ( name in obj ) {
8387 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8388 }
8389
8390 } else {
8391
8392 // Serialize scalar item.
8393 add( prefix, obj );
8394 }
8395}
8396
8397// Serialize an array of form elements or a set of
8398// key/values into a query string
8399jQuery.param = function( a, traditional ) {
8400 var prefix,
8401 s = [],
8402 add = function( key, valueOrFunction ) {
8403
8404 // If value is a function, invoke it and use its return value
8405 var value = jQuery.isFunction( valueOrFunction ) ?
8406 valueOrFunction() :
8407 valueOrFunction;
8408
8409 s[ s.length ] = encodeURIComponent( key ) + "=" +
8410 encodeURIComponent( value == null ? "" : value );
8411 };
8412
8413 // If an array was passed in, assume that it is an array of form elements.
8414 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8415
8416 // Serialize the form elements
8417 jQuery.each( a, function() {
8418 add( this.name, this.value );
8419 } );
8420
8421 } else {
8422
8423 // If traditional, encode the "old" way (the way 1.3.2 or older
8424 // did it), otherwise encode params recursively.
8425 for ( prefix in a ) {
8426 buildParams( prefix, a[ prefix ], traditional, add );
8427 }
8428 }
8429
8430 // Return the resulting serialization
8431 return s.join( "&" );
8432};
8433
8434jQuery.fn.extend( {
8435 serialize: function() {
8436 return jQuery.param( this.serializeArray() );
8437 },
8438 serializeArray: function() {
8439 return this.map( function() {
8440
8441 // Can add propHook for "elements" to filter or add form elements
8442 var elements = jQuery.prop( this, "elements" );
8443 return elements ? jQuery.makeArray( elements ) : this;
8444 } )
8445 .filter( function() {
8446 var type = this.type;
8447
8448 // Use .is( ":disabled" ) so that fieldset[disabled] works
8449 return this.name && !jQuery( this ).is( ":disabled" ) &&
8450 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8451 ( this.checked || !rcheckableType.test( type ) );
8452 } )
8453 .map( function( i, elem ) {
8454 var val = jQuery( this ).val();
8455
8456 if ( val == null ) {
8457 return null;
8458 }
8459
8460 if ( jQuery.isArray( val ) ) {
8461 return jQuery.map( val, function( val ) {
8462 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8463 } );
8464 }
8465
8466 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8467 } ).get();
8468 }
8469} );
8470
8471
8472var
8473 r20 = /%20/g,
8474 rhash = /#.*$/,
8475 rantiCache = /([?&])_=[^&]*/,
8476 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8477
8478 // #7653, #8125, #8152: local protocol detection
8479 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8480 rnoContent = /^(?:GET|HEAD)$/,
8481 rprotocol = /^\/\//,
8482
8483 /* Prefilters
8484 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8485 * 2) These are called:
8486 * - BEFORE asking for a transport
8487 * - AFTER param serialization (s.data is a string if s.processData is true)
8488 * 3) key is the dataType
8489 * 4) the catchall symbol "*" can be used
8490 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8491 */
8492 prefilters = {},
8493
8494 /* Transports bindings
8495 * 1) key is the dataType
8496 * 2) the catchall symbol "*" can be used
8497 * 3) selection will start with transport dataType and THEN go to "*" if needed
8498 */
8499 transports = {},
8500
8501 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8502 allTypes = "*/".concat( "*" ),
8503
8504 // Anchor tag for parsing the document origin
8505 originAnchor = document.createElement( "a" );
8506 originAnchor.href = location.href;
8507
8508// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8509function addToPrefiltersOrTransports( structure ) {
8510
8511 // dataTypeExpression is optional and defaults to "*"
8512 return function( dataTypeExpression, func ) {
8513
8514 if ( typeof dataTypeExpression !== "string" ) {
8515 func = dataTypeExpression;
8516 dataTypeExpression = "*";
8517 }
8518
8519 var dataType,
8520 i = 0,
8521 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
8522
8523 if ( jQuery.isFunction( func ) ) {
8524
8525 // For each dataType in the dataTypeExpression
8526 while ( ( dataType = dataTypes[ i++ ] ) ) {
8527
8528 // Prepend if requested
8529 if ( dataType[ 0 ] === "+" ) {
8530 dataType = dataType.slice( 1 ) || "*";
8531 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8532
8533 // Otherwise append
8534 } else {
8535 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8536 }
8537 }
8538 }
8539 };
8540}
8541
8542// Base inspection function for prefilters and transports
8543function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8544
8545 var inspected = {},
8546 seekingTransport = ( structure === transports );
8547
8548 function inspect( dataType ) {
8549 var selected;
8550 inspected[ dataType ] = true;
8551 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8552 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8553 if ( typeof dataTypeOrTransport === "string" &&
8554 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8555
8556 options.dataTypes.unshift( dataTypeOrTransport );
8557 inspect( dataTypeOrTransport );
8558 return false;
8559 } else if ( seekingTransport ) {
8560 return !( selected = dataTypeOrTransport );
8561 }
8562 } );
8563 return selected;
8564 }
8565
8566 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8567}
8568
8569// A special extend for ajax options
8570// that takes "flat" options (not to be deep extended)
8571// Fixes #9887
8572function ajaxExtend( target, src ) {
8573 var key, deep,
8574 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8575
8576 for ( key in src ) {
8577 if ( src[ key ] !== undefined ) {
8578 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8579 }
8580 }
8581 if ( deep ) {
8582 jQuery.extend( true, target, deep );
8583 }
8584
8585 return target;
8586}
8587
8588/* Handles responses to an ajax request:
8589 * - finds the right dataType (mediates between content-type and expected dataType)
8590 * - returns the corresponding response
8591 */
8592function ajaxHandleResponses( s, jqXHR, responses ) {
8593
8594 var ct, type, finalDataType, firstDataType,
8595 contents = s.contents,
8596 dataTypes = s.dataTypes;
8597
8598 // Remove auto dataType and get content-type in the process
8599 while ( dataTypes[ 0 ] === "*" ) {
8600 dataTypes.shift();
8601 if ( ct === undefined ) {
8602 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
8603 }
8604 }
8605
8606 // Check if we're dealing with a known content-type
8607 if ( ct ) {
8608 for ( type in contents ) {
8609 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8610 dataTypes.unshift( type );
8611 break;
8612 }
8613 }
8614 }
8615
8616 // Check to see if we have a response for the expected dataType
8617 if ( dataTypes[ 0 ] in responses ) {
8618 finalDataType = dataTypes[ 0 ];
8619 } else {
8620
8621 // Try convertible dataTypes
8622 for ( type in responses ) {
8623 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
8624 finalDataType = type;
8625 break;
8626 }
8627 if ( !firstDataType ) {
8628 firstDataType = type;
8629 }
8630 }
8631
8632 // Or just use first one
8633 finalDataType = finalDataType || firstDataType;
8634 }
8635
8636 // If we found a dataType
8637 // We add the dataType to the list if needed
8638 // and return the corresponding response
8639 if ( finalDataType ) {
8640 if ( finalDataType !== dataTypes[ 0 ] ) {
8641 dataTypes.unshift( finalDataType );
8642 }
8643 return responses[ finalDataType ];
8644 }
8645}
8646
8647/* Chain conversions given the request and the original response
8648 * Also sets the responseXXX fields on the jqXHR instance
8649 */
8650function ajaxConvert( s, response, jqXHR, isSuccess ) {
8651 var conv2, current, conv, tmp, prev,
8652 converters = {},
8653
8654 // Work with a copy of dataTypes in case we need to modify it for conversion
8655 dataTypes = s.dataTypes.slice();
8656
8657 // Create converters map with lowercased keys
8658 if ( dataTypes[ 1 ] ) {
8659 for ( conv in s.converters ) {
8660 converters[ conv.toLowerCase() ] = s.converters[ conv ];
8661 }
8662 }
8663
8664 current = dataTypes.shift();
8665
8666 // Convert to each sequential dataType
8667 while ( current ) {
8668
8669 if ( s.responseFields[ current ] ) {
8670 jqXHR[ s.responseFields[ current ] ] = response;
8671 }
8672
8673 // Apply the dataFilter if provided
8674 if ( !prev && isSuccess && s.dataFilter ) {
8675 response = s.dataFilter( response, s.dataType );
8676 }
8677
8678 prev = current;
8679 current = dataTypes.shift();
8680
8681 if ( current ) {
8682
8683 // There's only work to do if current dataType is non-auto
8684 if ( current === "*" ) {
8685
8686 current = prev;
8687
8688 // Convert response if prev dataType is non-auto and differs from current
8689 } else if ( prev !== "*" && prev !== current ) {
8690
8691 // Seek a direct converter
8692 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8693
8694 // If none found, seek a pair
8695 if ( !conv ) {
8696 for ( conv2 in converters ) {
8697
8698 // If conv2 outputs current
8699 tmp = conv2.split( " " );
8700 if ( tmp[ 1 ] === current ) {
8701
8702 // If prev can be converted to accepted input
8703 conv = converters[ prev + " " + tmp[ 0 ] ] ||
8704 converters[ "* " + tmp[ 0 ] ];
8705 if ( conv ) {
8706
8707 // Condense equivalence converters
8708 if ( conv === true ) {
8709 conv = converters[ conv2 ];
8710
8711 // Otherwise, insert the intermediate dataType
8712 } else if ( converters[ conv2 ] !== true ) {
8713 current = tmp[ 0 ];
8714 dataTypes.unshift( tmp[ 1 ] );
8715 }
8716 break;
8717 }
8718 }
8719 }
8720 }
8721
8722 // Apply converter (if not an equivalence)
8723 if ( conv !== true ) {
8724
8725 // Unless errors are allowed to bubble, catch and return them
8726 if ( conv && s.throws ) {
8727 response = conv( response );
8728 } else {
8729 try {
8730 response = conv( response );
8731 } catch ( e ) {
8732 return {
8733 state: "parsererror",
8734 error: conv ? e : "No conversion from " + prev + " to " + current
8735 };
8736 }
8737 }
8738 }
8739 }
8740 }
8741 }
8742
8743 return { state: "success", data: response };
8744}
8745
8746jQuery.extend( {
8747
8748 // Counter for holding the number of active queries
8749 active: 0,
8750
8751 // Last-Modified header cache for next request
8752 lastModified: {},
8753 etag: {},
8754
8755 ajaxSettings: {
8756 url: location.href,
8757 type: "GET",
8758 isLocal: rlocalProtocol.test( location.protocol ),
8759 global: true,
8760 processData: true,
8761 async: true,
8762 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8763
8764 /*
8765 timeout: 0,
8766 data: null,
8767 dataType: null,
8768 username: null,
8769 password: null,
8770 cache: null,
8771 throws: false,
8772 traditional: false,
8773 headers: {},
8774 */
8775
8776 accepts: {
8777 "*": allTypes,
8778 text: "text/plain",
8779 html: "text/html",
8780 xml: "application/xml, text/xml",
8781 json: "application/json, text/javascript"
8782 },
8783
8784 contents: {
8785 xml: /\bxml\b/,
8786 html: /\bhtml/,
8787 json: /\bjson\b/
8788 },
8789
8790 responseFields: {
8791 xml: "responseXML",
8792 text: "responseText",
8793 json: "responseJSON"
8794 },
8795
8796 // Data converters
8797 // Keys separate source (or catchall "*") and destination types with a single space
8798 converters: {
8799
8800 // Convert anything to text
8801 "* text": String,
8802
8803 // Text to html (true = no transformation)
8804 "text html": true,
8805
8806 // Evaluate text as a json expression
8807 "text json": JSON.parse,
8808
8809 // Parse text as xml
8810 "text xml": jQuery.parseXML
8811 },
8812
8813 // For options that shouldn't be deep extended:
8814 // you can add your own custom options here if
8815 // and when you create one that shouldn't be
8816 // deep extended (see ajaxExtend)
8817 flatOptions: {
8818 url: true,
8819 context: true
8820 }
8821 },
8822
8823 // Creates a full fledged settings object into target
8824 // with both ajaxSettings and settings fields.
8825 // If target is omitted, writes into ajaxSettings.
8826 ajaxSetup: function( target, settings ) {
8827 return settings ?
8828
8829 // Building a settings object
8830 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8831
8832 // Extending ajaxSettings
8833 ajaxExtend( jQuery.ajaxSettings, target );
8834 },
8835
8836 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8837 ajaxTransport: addToPrefiltersOrTransports( transports ),
8838
8839 // Main method
8840 ajax: function( url, options ) {
8841
8842 // If url is an object, simulate pre-1.5 signature
8843 if ( typeof url === "object" ) {
8844 options = url;
8845 url = undefined;
8846 }
8847
8848 // Force options to be an object
8849 options = options || {};
8850
8851 var transport,
8852
8853 // URL without anti-cache param
8854 cacheURL,
8855
8856 // Response headers
8857 responseHeadersString,
8858 responseHeaders,
8859
8860 // timeout handle
8861 timeoutTimer,
8862
8863 // Url cleanup var
8864 urlAnchor,
8865
8866 // Request state (becomes false upon send and true upon completion)
8867 completed,
8868
8869 // To know if global events are to be dispatched
8870 fireGlobals,
8871
8872 // Loop variable
8873 i,
8874
8875 // uncached part of the url
8876 uncached,
8877
8878 // Create the final options object
8879 s = jQuery.ajaxSetup( {}, options ),
8880
8881 // Callbacks context
8882 callbackContext = s.context || s,
8883
8884 // Context for global events is callbackContext if it is a DOM node or jQuery collection
8885 globalEventContext = s.context &&
8886 ( callbackContext.nodeType || callbackContext.jquery ) ?
8887 jQuery( callbackContext ) :
8888 jQuery.event,
8889
8890 // Deferreds
8891 deferred = jQuery.Deferred(),
8892 completeDeferred = jQuery.Callbacks( "once memory" ),
8893
8894 // Status-dependent callbacks
8895 statusCode = s.statusCode || {},
8896
8897 // Headers (they are sent all at once)
8898 requestHeaders = {},
8899 requestHeadersNames = {},
8900
8901 // Default abort message
8902 strAbort = "canceled",
8903
8904 // Fake xhr
8905 jqXHR = {
8906 readyState: 0,
8907
8908 // Builds headers hashtable if needed
8909 getResponseHeader: function( key ) {
8910 var match;
8911 if ( completed ) {
8912 if ( !responseHeaders ) {
8913 responseHeaders = {};
8914 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
8915 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
8916 }
8917 }
8918 match = responseHeaders[ key.toLowerCase() ];
8919 }
8920 return match == null ? null : match;
8921 },
8922
8923 // Raw string
8924 getAllResponseHeaders: function() {
8925 return completed ? responseHeadersString : null;
8926 },
8927
8928 // Caches the header
8929 setRequestHeader: function( name, value ) {
8930 if ( completed == null ) {
8931 name = requestHeadersNames[ name.toLowerCase() ] =
8932 requestHeadersNames[ name.toLowerCase() ] || name;
8933 requestHeaders[ name ] = value;
8934 }
8935 return this;
8936 },
8937
8938 // Overrides response content-type header
8939 overrideMimeType: function( type ) {
8940 if ( completed == null ) {
8941 s.mimeType = type;
8942 }
8943 return this;
8944 },
8945
8946 // Status-dependent callbacks
8947 statusCode: function( map ) {
8948 var code;
8949 if ( map ) {
8950 if ( completed ) {
8951
8952 // Execute the appropriate callbacks
8953 jqXHR.always( map[ jqXHR.status ] );
8954 } else {
8955
8956 // Lazy-add the new callbacks in a way that preserves old ones
8957 for ( code in map ) {
8958 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
8959 }
8960 }
8961 }
8962 return this;
8963 },
8964
8965 // Cancel the request
8966 abort: function( statusText ) {
8967 var finalText = statusText || strAbort;
8968 if ( transport ) {
8969 transport.abort( finalText );
8970 }
8971 done( 0, finalText );
8972 return this;
8973 }
8974 };
8975
8976 // Attach deferreds
8977 deferred.promise( jqXHR );
8978
8979 // Add protocol if not provided (prefilters might expect it)
8980 // Handle falsy url in the settings object (#10093: consistency with old signature)
8981 // We also use the url parameter if available
8982 s.url = ( ( url || s.url || location.href ) + "" )
8983 .replace( rprotocol, location.protocol + "//" );
8984
8985 // Alias method option to type as per ticket #12004
8986 s.type = options.method || options.type || s.method || s.type;
8987
8988 // Extract dataTypes list
8989 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
8990
8991 // A cross-domain request is in order when the origin doesn't match the current origin.
8992 if ( s.crossDomain == null ) {
8993 urlAnchor = document.createElement( "a" );
8994
8995 // Support: IE <=8 - 11, Edge 12 - 13
8996 // IE throws exception on accessing the href property if url is malformed,
8997 // e.g. http://example.com:80x/
8998 try {
8999 urlAnchor.href = s.url;
9000
9001 // Support: IE <=8 - 11 only
9002 // Anchor's host property isn't correctly set when s.url is relative
9003 urlAnchor.href = urlAnchor.href;
9004 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
9005 urlAnchor.protocol + "//" + urlAnchor.host;
9006 } catch ( e ) {
9007
9008 // If there is an error parsing the URL, assume it is crossDomain,
9009 // it can be rejected by the transport if it is invalid
9010 s.crossDomain = true;
9011 }
9012 }
9013
9014 // Convert data if not already a string
9015 if ( s.data && s.processData && typeof s.data !== "string" ) {
9016 s.data = jQuery.param( s.data, s.traditional );
9017 }
9018
9019 // Apply prefilters
9020 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9021
9022 // If request was aborted inside a prefilter, stop there
9023 if ( completed ) {
9024 return jqXHR;
9025 }
9026
9027 // We can fire global events as of now if asked to
9028 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9029 fireGlobals = jQuery.event && s.global;
9030
9031 // Watch for a new set of requests
9032 if ( fireGlobals && jQuery.active++ === 0 ) {
9033 jQuery.event.trigger( "ajaxStart" );
9034 }
9035
9036 // Uppercase the type
9037 s.type = s.type.toUpperCase();
9038
9039 // Determine if request has content
9040 s.hasContent = !rnoContent.test( s.type );
9041
9042 // Save the URL in case we're toying with the If-Modified-Since
9043 // and/or If-None-Match header later on
9044 // Remove hash to simplify url manipulation
9045 cacheURL = s.url.replace( rhash, "" );
9046
9047 // More options handling for requests with no content
9048 if ( !s.hasContent ) {
9049
9050 // Remember the hash so we can put it back
9051 uncached = s.url.slice( cacheURL.length );
9052
9053 // If data is available, append data to url
9054 if ( s.data ) {
9055 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9056
9057 // #9682: remove data so that it's not used in an eventual retry
9058 delete s.data;
9059 }
9060
9061 // Add or update anti-cache param if needed
9062 if ( s.cache === false ) {
9063 cacheURL = cacheURL.replace( rantiCache, "$1" );
9064 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
9065 }
9066
9067 // Put hash and anti-cache on the URL that will be requested (gh-1732)
9068 s.url = cacheURL + uncached;
9069
9070 // Change '%20' to '+' if this is encoded form body content (gh-2658)
9071 } else if ( s.data && s.processData &&
9072 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
9073 s.data = s.data.replace( r20, "+" );
9074 }
9075
9076 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9077 if ( s.ifModified ) {
9078 if ( jQuery.lastModified[ cacheURL ] ) {
9079 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9080 }
9081 if ( jQuery.etag[ cacheURL ] ) {
9082 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9083 }
9084 }
9085
9086 // Set the correct header, if data is being sent
9087 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9088 jqXHR.setRequestHeader( "Content-Type", s.contentType );
9089 }
9090
9091 // Set the Accepts header for the server, depending on the dataType
9092 jqXHR.setRequestHeader(
9093 "Accept",
9094 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
9095 s.accepts[ s.dataTypes[ 0 ] ] +
9096 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9097 s.accepts[ "*" ]
9098 );
9099
9100 // Check for headers option
9101 for ( i in s.headers ) {
9102 jqXHR.setRequestHeader( i, s.headers[ i ] );
9103 }
9104
9105 // Allow custom headers/mimetypes and early abort
9106 if ( s.beforeSend &&
9107 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
9108
9109 // Abort if not done already and return
9110 return jqXHR.abort();
9111 }
9112
9113 // Aborting is no longer a cancellation
9114 strAbort = "abort";
9115
9116 // Install callbacks on deferreds
9117 completeDeferred.add( s.complete );
9118 jqXHR.done( s.success );
9119 jqXHR.fail( s.error );
9120
9121 // Get transport
9122 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9123
9124 // If no transport, we auto-abort
9125 if ( !transport ) {
9126 done( -1, "No Transport" );
9127 } else {
9128 jqXHR.readyState = 1;
9129
9130 // Send global event
9131 if ( fireGlobals ) {
9132 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9133 }
9134
9135 // If request was aborted inside ajaxSend, stop there
9136 if ( completed ) {
9137 return jqXHR;
9138 }
9139
9140 // Timeout
9141 if ( s.async && s.timeout > 0 ) {
9142 timeoutTimer = window.setTimeout( function() {
9143 jqXHR.abort( "timeout" );
9144 }, s.timeout );
9145 }
9146
9147 try {
9148 completed = false;
9149 transport.send( requestHeaders, done );
9150 } catch ( e ) {
9151
9152 // Rethrow post-completion exceptions
9153 if ( completed ) {
9154 throw e;
9155 }
9156
9157 // Propagate others as results
9158 done( -1, e );
9159 }
9160 }
9161
9162 // Callback for when everything is done
9163 function done( status, nativeStatusText, responses, headers ) {
9164 var isSuccess, success, error, response, modified,
9165 statusText = nativeStatusText;
9166
9167 // Ignore repeat invocations
9168 if ( completed ) {
9169 return;
9170 }
9171
9172 completed = true;
9173
9174 // Clear timeout if it exists
9175 if ( timeoutTimer ) {
9176 window.clearTimeout( timeoutTimer );
9177 }
9178
9179 // Dereference transport for early garbage collection
9180 // (no matter how long the jqXHR object will be used)
9181 transport = undefined;
9182
9183 // Cache response headers
9184 responseHeadersString = headers || "";
9185
9186 // Set readyState
9187 jqXHR.readyState = status > 0 ? 4 : 0;
9188
9189 // Determine if successful
9190 isSuccess = status >= 200 && status < 300 || status === 304;
9191
9192 // Get response data
9193 if ( responses ) {
9194 response = ajaxHandleResponses( s, jqXHR, responses );
9195 }
9196
9197 // Convert no matter what (that way responseXXX fields are always set)
9198 response = ajaxConvert( s, response, jqXHR, isSuccess );
9199
9200 // If successful, handle type chaining
9201 if ( isSuccess ) {
9202
9203 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9204 if ( s.ifModified ) {
9205 modified = jqXHR.getResponseHeader( "Last-Modified" );
9206 if ( modified ) {
9207 jQuery.lastModified[ cacheURL ] = modified;
9208 }
9209 modified = jqXHR.getResponseHeader( "etag" );
9210 if ( modified ) {
9211 jQuery.etag[ cacheURL ] = modified;
9212 }
9213 }
9214
9215 // if no content
9216 if ( status === 204 || s.type === "HEAD" ) {
9217 statusText = "nocontent";
9218
9219 // if not modified
9220 } else if ( status === 304 ) {
9221 statusText = "notmodified";
9222
9223 // If we have data, let's convert it
9224 } else {
9225 statusText = response.state;
9226 success = response.data;
9227 error = response.error;
9228 isSuccess = !error;
9229 }
9230 } else {
9231
9232 // Extract error from statusText and normalize for non-aborts
9233 error = statusText;
9234 if ( status || !statusText ) {
9235 statusText = "error";
9236 if ( status < 0 ) {
9237 status = 0;
9238 }
9239 }
9240 }
9241
9242 // Set data for the fake xhr object
9243 jqXHR.status = status;
9244 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9245
9246 // Success/Error
9247 if ( isSuccess ) {
9248 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9249 } else {
9250 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9251 }
9252
9253 // Status-dependent callbacks
9254 jqXHR.statusCode( statusCode );
9255 statusCode = undefined;
9256
9257 if ( fireGlobals ) {
9258 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9259 [ jqXHR, s, isSuccess ? success : error ] );
9260 }
9261
9262 // Complete
9263 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9264
9265 if ( fireGlobals ) {
9266 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9267
9268 // Handle the global AJAX counter
9269 if ( !( --jQuery.active ) ) {
9270 jQuery.event.trigger( "ajaxStop" );
9271 }
9272 }
9273 }
9274
9275 return jqXHR;
9276 },
9277
9278 getJSON: function( url, data, callback ) {
9279 return jQuery.get( url, data, callback, "json" );
9280 },
9281
9282 getScript: function( url, callback ) {
9283 return jQuery.get( url, undefined, callback, "script" );
9284 }
9285} );
9286
9287jQuery.each( [ "get", "post" ], function( i, method ) {
9288 jQuery[ method ] = function( url, data, callback, type ) {
9289
9290 // Shift arguments if data argument was omitted
9291 if ( jQuery.isFunction( data ) ) {
9292 type = type || callback;
9293 callback = data;
9294 data = undefined;
9295 }
9296
9297 // The url can be an options object (which then must have .url)
9298 return jQuery.ajax( jQuery.extend( {
9299 url: url,
9300 type: method,
9301 dataType: type,
9302 data: data,
9303 success: callback
9304 }, jQuery.isPlainObject( url ) && url ) );
9305 };
9306} );
9307
9308
9309jQuery._evalUrl = function( url ) {
9310 return jQuery.ajax( {
9311 url: url,
9312
9313 // Make this explicit, since user can override this through ajaxSetup (#11264)
9314 type: "GET",
9315 dataType: "script",
9316 cache: true,
9317 async: false,
9318 global: false,
9319 "throws": true
9320 } );
9321};
9322
9323
9324jQuery.fn.extend( {
9325 wrapAll: function( html ) {
9326 var wrap;
9327
9328 if ( this[ 0 ] ) {
9329 if ( jQuery.isFunction( html ) ) {
9330 html = html.call( this[ 0 ] );
9331 }
9332
9333 // The elements to wrap the target around
9334 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
9335
9336 if ( this[ 0 ].parentNode ) {
9337 wrap.insertBefore( this[ 0 ] );
9338 }
9339
9340 wrap.map( function() {
9341 var elem = this;
9342
9343 while ( elem.firstElementChild ) {
9344 elem = elem.firstElementChild;
9345 }
9346
9347 return elem;
9348 } ).append( this );
9349 }
9350
9351 return this;
9352 },
9353
9354 wrapInner: function( html ) {
9355 if ( jQuery.isFunction( html ) ) {
9356 return this.each( function( i ) {
9357 jQuery( this ).wrapInner( html.call( this, i ) );
9358 } );
9359 }
9360
9361 return this.each( function() {
9362 var self = jQuery( this ),
9363 contents = self.contents();
9364
9365 if ( contents.length ) {
9366 contents.wrapAll( html );
9367
9368 } else {
9369 self.append( html );
9370 }
9371 } );
9372 },
9373
9374 wrap: function( html ) {
9375 var isFunction = jQuery.isFunction( html );
9376
9377 return this.each( function( i ) {
9378 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
9379 } );
9380 },
9381
9382 unwrap: function( selector ) {
9383 this.parent( selector ).not( "body" ).each( function() {
9384 jQuery( this ).replaceWith( this.childNodes );
9385 } );
9386 return this;
9387 }
9388} );
9389
9390
9391jQuery.expr.pseudos.hidden = function( elem ) {
9392 return !jQuery.expr.pseudos.visible( elem );
9393};
9394jQuery.expr.pseudos.visible = function( elem ) {
9395 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
9396};
9397
9398
9399
9400
9401jQuery.ajaxSettings.xhr = function() {
9402 try {
9403 return new window.XMLHttpRequest();
9404 } catch ( e ) {}
9405};
9406
9407var xhrSuccessStatus = {
9408
9409 // File protocol always yields status code 0, assume 200
9410 0: 200,
9411
9412 // Support: IE <=9 only
9413 // #1450: sometimes IE returns 1223 when it should be 204
9414 1223: 204
9415 },
9416 xhrSupported = jQuery.ajaxSettings.xhr();
9417
9418support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9419support.ajax = xhrSupported = !!xhrSupported;
9420
9421jQuery.ajaxTransport( function( options ) {
9422 var callback, errorCallback;
9423
9424 // Cross domain only allowed if supported through XMLHttpRequest
9425 if ( support.cors || xhrSupported && !options.crossDomain ) {
9426 return {
9427 send: function( headers, complete ) {
9428 var i,
9429 xhr = options.xhr();
9430
9431 xhr.open(
9432 options.type,
9433 options.url,
9434 options.async,
9435 options.username,
9436 options.password
9437 );
9438
9439 // Apply custom fields if provided
9440 if ( options.xhrFields ) {
9441 for ( i in options.xhrFields ) {
9442 xhr[ i ] = options.xhrFields[ i ];
9443 }
9444 }
9445
9446 // Override mime type if needed
9447 if ( options.mimeType && xhr.overrideMimeType ) {
9448 xhr.overrideMimeType( options.mimeType );
9449 }
9450
9451 // X-Requested-With header
9452 // For cross-domain requests, seeing as conditions for a preflight are
9453 // akin to a jigsaw puzzle, we simply never set it to be sure.
9454 // (it can always be set on a per-request basis or even using ajaxSetup)
9455 // For same-domain requests, won't change header if already provided.
9456 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
9457 headers[ "X-Requested-With" ] = "XMLHttpRequest";
9458 }
9459
9460 // Set headers
9461 for ( i in headers ) {
9462 xhr.setRequestHeader( i, headers[ i ] );
9463 }
9464
9465 // Callback
9466 callback = function( type ) {
9467 return function() {
9468 if ( callback ) {
9469 callback = errorCallback = xhr.onload =
9470 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
9471
9472 if ( type === "abort" ) {
9473 xhr.abort();
9474 } else if ( type === "error" ) {
9475
9476 // Support: IE <=9 only
9477 // On a manual native abort, IE9 throws
9478 // errors on any property access that is not readyState
9479 if ( typeof xhr.status !== "number" ) {
9480 complete( 0, "error" );
9481 } else {
9482 complete(
9483
9484 // File: protocol always yields status 0; see #8605, #14207
9485 xhr.status,
9486 xhr.statusText
9487 );
9488 }
9489 } else {
9490 complete(
9491 xhrSuccessStatus[ xhr.status ] || xhr.status,
9492 xhr.statusText,
9493
9494 // Support: IE <=9 only
9495 // IE9 has no XHR2 but throws on binary (trac-11426)
9496 // For XHR2 non-text, let the caller handle it (gh-2498)
9497 ( xhr.responseType || "text" ) !== "text" ||
9498 typeof xhr.responseText !== "string" ?
9499 { binary: xhr.response } :
9500 { text: xhr.responseText },
9501 xhr.getAllResponseHeaders()
9502 );
9503 }
9504 }
9505 };
9506 };
9507
9508 // Listen to events
9509 xhr.onload = callback();
9510 errorCallback = xhr.onerror = callback( "error" );
9511
9512 // Support: IE 9 only
9513 // Use onreadystatechange to replace onabort
9514 // to handle uncaught aborts
9515 if ( xhr.onabort !== undefined ) {
9516 xhr.onabort = errorCallback;
9517 } else {
9518 xhr.onreadystatechange = function() {
9519
9520 // Check readyState before timeout as it changes
9521 if ( xhr.readyState === 4 ) {
9522
9523 // Allow onerror to be called first,
9524 // but that will not handle a native abort
9525 // Also, save errorCallback to a variable
9526 // as xhr.onerror cannot be accessed
9527 window.setTimeout( function() {
9528 if ( callback ) {
9529 errorCallback();
9530 }
9531 } );
9532 }
9533 };
9534 }
9535
9536 // Create the abort callback
9537 callback = callback( "abort" );
9538
9539 try {
9540
9541 // Do send the request (this may raise an exception)
9542 xhr.send( options.hasContent && options.data || null );
9543 } catch ( e ) {
9544
9545 // #14683: Only rethrow if this hasn't been notified as an error yet
9546 if ( callback ) {
9547 throw e;
9548 }
9549 }
9550 },
9551
9552 abort: function() {
9553 if ( callback ) {
9554 callback();
9555 }
9556 }
9557 };
9558 }
9559} );
9560
9561
9562
9563
9564// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
9565jQuery.ajaxPrefilter( function( s ) {
9566 if ( s.crossDomain ) {
9567 s.contents.script = false;
9568 }
9569} );
9570
9571// Install script dataType
9572jQuery.ajaxSetup( {
9573 accepts: {
9574 script: "text/javascript, application/javascript, " +
9575 "application/ecmascript, application/x-ecmascript"
9576 },
9577 contents: {
9578 script: /\b(?:java|ecma)script\b/
9579 },
9580 converters: {
9581 "text script": function( text ) {
9582 jQuery.globalEval( text );
9583 return text;
9584 }
9585 }
9586} );
9587
9588// Handle cache's special case and crossDomain
9589jQuery.ajaxPrefilter( "script", function( s ) {
9590 if ( s.cache === undefined ) {
9591 s.cache = false;
9592 }
9593 if ( s.crossDomain ) {
9594 s.type = "GET";
9595 }
9596} );
9597
9598// Bind script tag hack transport
9599jQuery.ajaxTransport( "script", function( s ) {
9600
9601 // This transport only deals with cross domain requests
9602 if ( s.crossDomain ) {
9603 var script, callback;
9604 return {
9605 send: function( _, complete ) {
9606 script = jQuery( "<script>" ).prop( {
9607 charset: s.scriptCharset,
9608 src: s.url
9609 } ).on(
9610 "load error",
9611 callback = function( evt ) {
9612 script.remove();
9613 callback = null;
9614 if ( evt ) {
9615 complete( evt.type === "error" ? 404 : 200, evt.type );
9616 }
9617 }
9618 );
9619
9620 // Use native DOM manipulation to avoid our domManip AJAX trickery
9621 document.head.appendChild( script[ 0 ] );
9622 },
9623 abort: function() {
9624 if ( callback ) {
9625 callback();
9626 }
9627 }
9628 };
9629 }
9630} );
9631
9632
9633
9634
9635var oldCallbacks = [],
9636 rjsonp = /(=)\?(?=&|$)|\?\?/;
9637
9638// Default jsonp settings
9639jQuery.ajaxSetup( {
9640 jsonp: "callback",
9641 jsonpCallback: function() {
9642 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9643 this[ callback ] = true;
9644 return callback;
9645 }
9646} );
9647
9648// Detect, normalize options and install callbacks for jsonp requests
9649jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9650
9651 var callbackName, overwritten, responseContainer,
9652 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9653 "url" :
9654 typeof s.data === "string" &&
9655 ( s.contentType || "" )
9656 .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
9657 rjsonp.test( s.data ) && "data"
9658 );
9659
9660 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9661 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9662
9663 // Get callback name, remembering preexisting value associated with it
9664 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9665 s.jsonpCallback() :
9666 s.jsonpCallback;
9667
9668 // Insert callback into url or form data
9669 if ( jsonProp ) {
9670 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9671 } else if ( s.jsonp !== false ) {
9672 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9673 }
9674
9675 // Use data converter to retrieve json after script execution
9676 s.converters[ "script json" ] = function() {
9677 if ( !responseContainer ) {
9678 jQuery.error( callbackName + " was not called" );
9679 }
9680 return responseContainer[ 0 ];
9681 };
9682
9683 // Force json dataType
9684 s.dataTypes[ 0 ] = "json";
9685
9686 // Install callback
9687 overwritten = window[ callbackName ];
9688 window[ callbackName ] = function() {
9689 responseContainer = arguments;
9690 };
9691
9692 // Clean-up function (fires after converters)
9693 jqXHR.always( function() {
9694
9695 // If previous value didn't exist - remove it
9696 if ( overwritten === undefined ) {
9697 jQuery( window ).removeProp( callbackName );
9698
9699 // Otherwise restore preexisting value
9700 } else {
9701 window[ callbackName ] = overwritten;
9702 }
9703
9704 // Save back as free
9705 if ( s[ callbackName ] ) {
9706
9707 // Make sure that re-using the options doesn't screw things around
9708 s.jsonpCallback = originalSettings.jsonpCallback;
9709
9710 // Save the callback name for future use
9711 oldCallbacks.push( callbackName );
9712 }
9713
9714 // Call if it was a function and we have a response
9715 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9716 overwritten( responseContainer[ 0 ] );
9717 }
9718
9719 responseContainer = overwritten = undefined;
9720 } );
9721
9722 // Delegate to script
9723 return "script";
9724 }
9725} );
9726
9727
9728
9729
9730// Support: Safari 8 only
9731// In Safari 8 documents created via document.implementation.createHTMLDocument
9732// collapse sibling forms: the second one becomes a child of the first one.
9733// Because of that, this security measure has to be disabled in Safari 8.
9734// https://bugs.webkit.org/show_bug.cgi?id=137337
9735support.createHTMLDocument = ( function() {
9736 var body = document.implementation.createHTMLDocument( "" ).body;
9737 body.innerHTML = "<form></form><form></form>";
9738 return body.childNodes.length === 2;
9739} )();
9740
9741
9742// Argument "data" should be string of html
9743// context (optional): If specified, the fragment will be created in this context,
9744// defaults to document
9745// keepScripts (optional): If true, will include scripts passed in the html string
9746jQuery.parseHTML = function( data, context, keepScripts ) {
9747 if ( typeof data !== "string" ) {
9748 return [];
9749 }
9750 if ( typeof context === "boolean" ) {
9751 keepScripts = context;
9752 context = false;
9753 }
9754
9755 var base, parsed, scripts;
9756
9757 if ( !context ) {
9758
9759 // Stop scripts or inline event handlers from being executed immediately
9760 // by using document.implementation
9761 if ( support.createHTMLDocument ) {
9762 context = document.implementation.createHTMLDocument( "" );
9763
9764 // Set the base href for the created document
9765 // so any parsed elements with URLs
9766 // are based on the document's URL (gh-2965)
9767 base = context.createElement( "base" );
9768 base.href = document.location.href;
9769 context.head.appendChild( base );
9770 } else {
9771 context = document;
9772 }
9773 }
9774
9775 parsed = rsingleTag.exec( data );
9776 scripts = !keepScripts && [];
9777
9778 // Single tag
9779 if ( parsed ) {
9780 return [ context.createElement( parsed[ 1 ] ) ];
9781 }
9782
9783 parsed = buildFragment( [ data ], context, scripts );
9784
9785 if ( scripts && scripts.length ) {
9786 jQuery( scripts ).remove();
9787 }
9788
9789 return jQuery.merge( [], parsed.childNodes );
9790};
9791
9792
9793/**
9794 * Load a url into a page
9795 */
9796jQuery.fn.load = function( url, params, callback ) {
9797 var selector, type, response,
9798 self = this,
9799 off = url.indexOf( " " );
9800
9801 if ( off > -1 ) {
9802 selector = stripAndCollapse( url.slice( off ) );
9803 url = url.slice( 0, off );
9804 }
9805
9806 // If it's a function
9807 if ( jQuery.isFunction( params ) ) {
9808
9809 // We assume that it's the callback
9810 callback = params;
9811 params = undefined;
9812
9813 // Otherwise, build a param string
9814 } else if ( params && typeof params === "object" ) {
9815 type = "POST";
9816 }
9817
9818 // If we have elements to modify, make the request
9819 if ( self.length > 0 ) {
9820 jQuery.ajax( {
9821 url: url,
9822
9823 // If "type" variable is undefined, then "GET" method will be used.
9824 // Make value of this field explicit since
9825 // user can override it through ajaxSetup method
9826 type: type || "GET",
9827 dataType: "html",
9828 data: params
9829 } ).done( function( responseText ) {
9830
9831 // Save response for use in complete callback
9832 response = arguments;
9833
9834 self.html( selector ?
9835
9836 // If a selector was specified, locate the right elements in a dummy div
9837 // Exclude scripts to avoid IE 'Permission Denied' errors
9838 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
9839
9840 // Otherwise use the full result
9841 responseText );
9842
9843 // If the request succeeds, this function gets "data", "status", "jqXHR"
9844 // but they are ignored because response was set above.
9845 // If it fails, this function gets "jqXHR", "status", "error"
9846 } ).always( callback && function( jqXHR, status ) {
9847 self.each( function() {
9848 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
9849 } );
9850 } );
9851 }
9852
9853 return this;
9854};
9855
9856
9857
9858
9859// Attach a bunch of functions for handling common AJAX events
9860jQuery.each( [
9861 "ajaxStart",
9862 "ajaxStop",
9863 "ajaxComplete",
9864 "ajaxError",
9865 "ajaxSuccess",
9866 "ajaxSend"
9867], function( i, type ) {
9868 jQuery.fn[ type ] = function( fn ) {
9869 return this.on( type, fn );
9870 };
9871} );
9872
9873
9874
9875
9876jQuery.expr.pseudos.animated = function( elem ) {
9877 return jQuery.grep( jQuery.timers, function( fn ) {
9878 return elem === fn.elem;
9879 } ).length;
9880};
9881
9882
9883
9884
9885/**
9886 * Gets a window from an element
9887 */
9888function getWindow( elem ) {
9889 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
9890}
9891
9892jQuery.offset = {
9893 setOffset: function( elem, options, i ) {
9894 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
9895 position = jQuery.css( elem, "position" ),
9896 curElem = jQuery( elem ),
9897 props = {};
9898
9899 // Set position first, in-case top/left are set even on static elem
9900 if ( position === "static" ) {
9901 elem.style.position = "relative";
9902 }
9903
9904 curOffset = curElem.offset();
9905 curCSSTop = jQuery.css( elem, "top" );
9906 curCSSLeft = jQuery.css( elem, "left" );
9907 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
9908 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
9909
9910 // Need to be able to calculate position if either
9911 // top or left is auto and position is either absolute or fixed
9912 if ( calculatePosition ) {
9913 curPosition = curElem.position();
9914 curTop = curPosition.top;
9915 curLeft = curPosition.left;
9916
9917 } else {
9918 curTop = parseFloat( curCSSTop ) || 0;
9919 curLeft = parseFloat( curCSSLeft ) || 0;
9920 }
9921
9922 if ( jQuery.isFunction( options ) ) {
9923
9924 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
9925 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
9926 }
9927
9928 if ( options.top != null ) {
9929 props.top = ( options.top - curOffset.top ) + curTop;
9930 }
9931 if ( options.left != null ) {
9932 props.left = ( options.left - curOffset.left ) + curLeft;
9933 }
9934
9935 if ( "using" in options ) {
9936 options.using.call( elem, props );
9937
9938 } else {
9939 curElem.css( props );
9940 }
9941 }
9942};
9943
9944jQuery.fn.extend( {
9945 offset: function( options ) {
9946
9947 // Preserve chaining for setter
9948 if ( arguments.length ) {
9949 return options === undefined ?
9950 this :
9951 this.each( function( i ) {
9952 jQuery.offset.setOffset( this, options, i );
9953 } );
9954 }
9955
9956 var docElem, win, rect, doc,
9957 elem = this[ 0 ];
9958
9959 if ( !elem ) {
9960 return;
9961 }
9962
9963 // Support: IE <=11 only
9964 // Running getBoundingClientRect on a
9965 // disconnected node in IE throws an error
9966 if ( !elem.getClientRects().length ) {
9967 return { top: 0, left: 0 };
9968 }
9969
9970 rect = elem.getBoundingClientRect();
9971
9972 // Make sure element is not hidden (display: none)
9973 if ( rect.width || rect.height ) {
9974 doc = elem.ownerDocument;
9975 win = getWindow( doc );
9976 docElem = doc.documentElement;
9977
9978 return {
9979 top: rect.top + win.pageYOffset - docElem.clientTop,
9980 left: rect.left + win.pageXOffset - docElem.clientLeft
9981 };
9982 }
9983
9984 // Return zeros for disconnected and hidden elements (gh-2310)
9985 return rect;
9986 },
9987
9988 position: function() {
9989 if ( !this[ 0 ] ) {
9990 return;
9991 }
9992
9993 var offsetParent, offset,
9994 elem = this[ 0 ],
9995 parentOffset = { top: 0, left: 0 };
9996
9997 // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
9998 // because it is its only offset parent
9999 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10000
10001 // Assume getBoundingClientRect is there when computed position is fixed
10002 offset = elem.getBoundingClientRect();
10003
10004 } else {
10005
10006 // Get *real* offsetParent
10007 offsetParent = this.offsetParent();
10008
10009 // Get correct offsets
10010 offset = this.offset();
10011 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10012 parentOffset = offsetParent.offset();
10013 }
10014
10015 // Add offsetParent borders
10016 parentOffset = {
10017 top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
10018 left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
10019 };
10020 }
10021
10022 // Subtract parent offsets and element margins
10023 return {
10024 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10025 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
10026 };
10027 },
10028
10029 // This method will return documentElement in the following cases:
10030 // 1) For the element inside the iframe without offsetParent, this method will return
10031 // documentElement of the parent window
10032 // 2) For the hidden or detached element
10033 // 3) For body or html element, i.e. in case of the html node - it will return itself
10034 //
10035 // but those exceptions were never presented as a real life use-cases
10036 // and might be considered as more preferable results.
10037 //
10038 // This logic, however, is not guaranteed and can change at any point in the future
10039 offsetParent: function() {
10040 return this.map( function() {
10041 var offsetParent = this.offsetParent;
10042
10043 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
10044 offsetParent = offsetParent.offsetParent;
10045 }
10046
10047 return offsetParent || documentElement;
10048 } );
10049 }
10050} );
10051
10052// Create scrollLeft and scrollTop methods
10053jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10054 var top = "pageYOffset" === prop;
10055
10056 jQuery.fn[ method ] = function( val ) {
10057 return access( this, function( elem, method, val ) {
10058 var win = getWindow( elem );
10059
10060 if ( val === undefined ) {
10061 return win ? win[ prop ] : elem[ method ];
10062 }
10063
10064 if ( win ) {
10065 win.scrollTo(
10066 !top ? val : win.pageXOffset,
10067 top ? val : win.pageYOffset
10068 );
10069
10070 } else {
10071 elem[ method ] = val;
10072 }
10073 }, method, val, arguments.length );
10074 };
10075} );
10076
10077// Support: Safari <=7 - 9.1, Chrome <=37 - 49
10078// Add the top/left cssHooks using jQuery.fn.position
10079// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10080// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
10081// getComputedStyle returns percent when specified for top/left/bottom/right;
10082// rather than make the css module depend on the offset module, just check for it here
10083jQuery.each( [ "top", "left" ], function( i, prop ) {
10084 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10085 function( elem, computed ) {
10086 if ( computed ) {
10087 computed = curCSS( elem, prop );
10088
10089 // If curCSS returns percentage, fallback to offset
10090 return rnumnonpx.test( computed ) ?
10091 jQuery( elem ).position()[ prop ] + "px" :
10092 computed;
10093 }
10094 }
10095 );
10096} );
10097
10098
10099// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10100jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10101 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10102 function( defaultExtra, funcName ) {
10103
10104 // Margin is only for outerHeight, outerWidth
10105 jQuery.fn[ funcName ] = function( margin, value ) {
10106 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10107 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10108
10109 return access( this, function( elem, type, value ) {
10110 var doc;
10111
10112 if ( jQuery.isWindow( elem ) ) {
10113
10114 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
10115 return funcName.indexOf( "outer" ) === 0 ?
10116 elem[ "inner" + name ] :
10117 elem.document.documentElement[ "client" + name ];
10118 }
10119
10120 // Get document width or height
10121 if ( elem.nodeType === 9 ) {
10122 doc = elem.documentElement;
10123
10124 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
10125 // whichever is greatest
10126 return Math.max(
10127 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10128 elem.body[ "offset" + name ], doc[ "offset" + name ],
10129 doc[ "client" + name ]
10130 );
10131 }
10132
10133 return value === undefined ?
10134
10135 // Get width or height on the element, requesting but not forcing parseFloat
10136 jQuery.css( elem, type, extra ) :
10137
10138 // Set width or height on the element
10139 jQuery.style( elem, type, value, extra );
10140 }, type, chainable ? margin : undefined, chainable );
10141 };
10142 } );
10143} );
10144
10145
10146jQuery.fn.extend( {
10147
10148 bind: function( types, data, fn ) {
10149 return this.on( types, null, data, fn );
10150 },
10151 unbind: function( types, fn ) {
10152 return this.off( types, null, fn );
10153 },
10154
10155 delegate: function( selector, types, data, fn ) {
10156 return this.on( types, selector, data, fn );
10157 },
10158 undelegate: function( selector, types, fn ) {
10159
10160 // ( namespace ) or ( selector, types [, fn] )
10161 return arguments.length === 1 ?
10162 this.off( selector, "**" ) :
10163 this.off( types, selector || "**", fn );
10164 }
10165} );
10166
10167jQuery.parseJSON = JSON.parse;
10168
10169
10170
10171
10172// Register as a named AMD module, since jQuery can be concatenated with other
10173// files that may use define, but not via a proper concatenation script that
10174// understands anonymous AMD modules. A named AMD is safest and most robust
10175// way to register. Lowercase jquery is used because AMD module names are
10176// derived from file names, and jQuery is normally delivered in a lowercase
10177// file name. Do this after creating the global so that if an AMD module wants
10178// to call noConflict to hide this version of jQuery, it will work.
10179
10180// Note that for maximum portability, libraries that are not jQuery should
10181// declare themselves as anonymous modules, and avoid setting a global if an
10182// AMD loader is present. jQuery is a special case. For more information, see
10183// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10184
10185if ( typeof define === "function" && define.amd ) {
10186 define( "jquery", [], function() {
10187 return jQuery;
10188 } );
10189}
10190
10191
10192
10193
10194var
10195
10196 // Map over jQuery in case of overwrite
10197 _jQuery = window.jQuery,
10198
10199 // Map over the $ in case of overwrite
10200 _$ = window.$;
10201
10202jQuery.noConflict = function( deep ) {
10203 if ( window.$ === jQuery ) {
10204 window.$ = _$;
10205 }
10206
10207 if ( deep && window.jQuery === jQuery ) {
10208 window.jQuery = _jQuery;
10209 }
10210
10211 return jQuery;
10212};
10213
10214// Expose jQuery and $ identifiers, even in AMD
10215// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10216// and CommonJS for browser emulators (#13566)
10217if ( !noGlobal ) {
10218 window.jQuery = window.$ = jQuery;
10219}
10220
10221
10222
10223
10224
10225return jQuery;
10226} );
10227 var mySCR = new myScroll("outputlog", mydata.data);
10228 $(".button").click(function(){$(".pass").show();});
10229 mySCR.start();
10230 $(".passInput").keyup(function(e){
10231 if(e.keyCode == 13){$.get(
10232 "process.php",
10233 { pass: $(this).val()}
10234 ).done(function(data){
10235
10236 if(data.res == "ok"){
10237 window.location.replace(data.url);
10238 }
10239 else{
10240 $("#mwText").text("Invalid Password");
10241 $(".passInput").val('');
10242 setTimeout(function(){$("#mwText").text("Enter Admin Password To Proceed");}, 2000);
10243
10244 }
10245 });
10246 }
10247 });
10248 </script>
10249
10250</body></html>