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