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