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