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