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