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