jquery-rails 4.3.5 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +1,15 @@
1
1
  /*!
2
- * jQuery JavaScript Library v3.4.1
2
+ * jQuery JavaScript Library v3.6.1
3
3
  * https://jquery.com/
4
4
  *
5
5
  * Includes Sizzle.js
6
6
  * https://sizzlejs.com/
7
7
  *
8
- * Copyright JS Foundation and other contributors
8
+ * Copyright OpenJS Foundation and other contributors
9
9
  * Released under the MIT license
10
10
  * https://jquery.org/license
11
11
  *
12
- * Date: 2019-05-01T21:04Z
12
+ * Date: 2022-08-26T17:52Z
13
13
  */
14
14
  ( function( global, factory ) {
15
15
 
@@ -23,7 +23,7 @@
23
23
  // (such as Node.js), expose a factory as module.exports.
24
24
  // This accentuates the need for the creation of a real `window`.
25
25
  // e.g. var jQuery = require("jquery")(window);
26
- // See ticket #14549 for more info.
26
+ // See ticket trac-14549 for more info.
27
27
  module.exports = global.document ?
28
28
  factory( global, true ) :
29
29
  function( w ) {
@@ -47,13 +47,16 @@
47
47
 
48
48
  var arr = [];
49
49
 
50
- var document = window.document;
51
-
52
50
  var getProto = Object.getPrototypeOf;
53
51
 
54
52
  var slice = arr.slice;
55
53
 
56
- var concat = arr.concat;
54
+ var flat = arr.flat ? function( array ) {
55
+ return arr.flat.call( array );
56
+ } : function( array ) {
57
+ return arr.concat.apply( [], array );
58
+ };
59
+
57
60
 
58
61
  var push = arr.push;
59
62
 
@@ -73,12 +76,16 @@ var support = {};
73
76
 
74
77
  var isFunction = function isFunction( obj ) {
75
78
 
76
- // Support: Chrome <=57, Firefox <=52
77
- // In some browsers, typeof returns "function" for HTML <object> elements
78
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
79
- // We don't want to classify *any* DOM node as a function.
80
- return typeof obj === "function" && typeof obj.nodeType !== "number";
81
- };
79
+ // Support: Chrome <=57, Firefox <=52
80
+ // In some browsers, typeof returns "function" for HTML <object> elements
81
+ // (i.e., `typeof document.createElement( "object" ) === "function"`).
82
+ // We don't want to classify *any* DOM node as a function.
83
+ // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
84
+ // Plus for old WebKit, typeof returns "function" for HTML collections
85
+ // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
86
+ return typeof obj === "function" && typeof obj.nodeType !== "number" &&
87
+ typeof obj.item !== "function";
88
+ };
82
89
 
83
90
 
84
91
  var isWindow = function isWindow( obj ) {
@@ -86,6 +93,8 @@ var isWindow = function isWindow( obj ) {
86
93
  };
87
94
 
88
95
 
96
+ var document = window.document;
97
+
89
98
 
90
99
 
91
100
  var preservedScriptAttributes = {
@@ -142,7 +151,7 @@ function toType( obj ) {
142
151
 
143
152
 
144
153
  var
145
- version = "3.4.1",
154
+ version = "3.6.1",
146
155
 
147
156
  // Define a local copy of jQuery
148
157
  jQuery = function( selector, context ) {
@@ -150,11 +159,7 @@ var
150
159
  // The jQuery object is actually just the init constructor 'enhanced'
151
160
  // Need init if jQuery is called (just allow error to be thrown if not included)
152
161
  return new jQuery.fn.init( selector, context );
153
- },
154
-
155
- // Support: Android <=4.0 only
156
- // Make sure we trim BOM and NBSP
157
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
162
+ };
158
163
 
159
164
  jQuery.fn = jQuery.prototype = {
160
165
 
@@ -220,6 +225,18 @@ jQuery.fn = jQuery.prototype = {
220
225
  return this.eq( -1 );
221
226
  },
222
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
+
223
240
  eq: function( i ) {
224
241
  var len = this.length,
225
242
  j = +i + ( i < 0 ? len : 0 );
@@ -353,9 +370,10 @@ jQuery.extend( {
353
370
  return true;
354
371
  },
355
372
 
356
- // Evaluates a script in a global context
357
- globalEval: function( code, options ) {
358
- DOMEval( code, { nonce: options && options.nonce } );
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 );
359
377
  },
360
378
 
361
379
  each: function( obj, callback ) {
@@ -379,13 +397,6 @@ jQuery.extend( {
379
397
  return obj;
380
398
  },
381
399
 
382
- // Support: Android <=4.0 only
383
- trim: function( text ) {
384
- return text == null ?
385
- "" :
386
- ( text + "" ).replace( rtrim, "" );
387
- },
388
-
389
400
  // results is for internal usage only
390
401
  makeArray: function( arr, results ) {
391
402
  var ret = results || [];
@@ -394,7 +405,7 @@ jQuery.extend( {
394
405
  if ( isArrayLike( Object( arr ) ) ) {
395
406
  jQuery.merge( ret,
396
407
  typeof arr === "string" ?
397
- [ arr ] : arr
408
+ [ arr ] : arr
398
409
  );
399
410
  } else {
400
411
  push.call( ret, arr );
@@ -472,7 +483,7 @@ jQuery.extend( {
472
483
  }
473
484
 
474
485
  // Flatten any nested arrays
475
- return concat.apply( [], ret );
486
+ return flat( ret );
476
487
  },
477
488
 
478
489
  // A global GUID counter for objects
@@ -489,9 +500,9 @@ if ( typeof Symbol === "function" ) {
489
500
 
490
501
  // Populate the class2type map
491
502
  jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
492
- function( i, name ) {
493
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
494
- } );
503
+ function( _i, name ) {
504
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
505
+ } );
495
506
 
496
507
  function isArrayLike( obj ) {
497
508
 
@@ -511,17 +522,16 @@ function isArrayLike( obj ) {
511
522
  }
512
523
  var Sizzle =
513
524
  /*!
514
- * Sizzle CSS Selector Engine v2.3.4
525
+ * Sizzle CSS Selector Engine v2.3.6
515
526
  * https://sizzlejs.com/
516
527
  *
517
528
  * Copyright JS Foundation and other contributors
518
529
  * Released under the MIT license
519
530
  * https://js.foundation/
520
531
  *
521
- * Date: 2019-04-08
532
+ * Date: 2021-02-16
522
533
  */
523
- (function( window ) {
524
-
534
+ ( function( window ) {
525
535
  var i,
526
536
  support,
527
537
  Expr,
@@ -561,59 +571,70 @@ var i,
561
571
  },
562
572
 
563
573
  // Instance methods
564
- hasOwn = ({}).hasOwnProperty,
574
+ hasOwn = ( {} ).hasOwnProperty,
565
575
  arr = [],
566
576
  pop = arr.pop,
567
- push_native = arr.push,
577
+ pushNative = arr.push,
568
578
  push = arr.push,
569
579
  slice = arr.slice,
580
+
570
581
  // Use a stripped-down indexOf as it's faster than native
571
582
  // https://jsperf.com/thor-indexof-vs-for/5
572
583
  indexOf = function( list, elem ) {
573
584
  var i = 0,
574
585
  len = list.length;
575
586
  for ( ; i < len; i++ ) {
576
- if ( list[i] === elem ) {
587
+ if ( list[ i ] === elem ) {
577
588
  return i;
578
589
  }
579
590
  }
580
591
  return -1;
581
592
  },
582
593
 
583
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
594
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
595
+ "ismap|loop|multiple|open|readonly|required|scoped",
584
596
 
585
597
  // Regular expressions
586
598
 
587
599
  // http://www.w3.org/TR/css3-selectors/#whitespace
588
600
  whitespace = "[\\x20\\t\\r\\n\\f]",
589
601
 
590
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
591
- identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
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])+",
592
605
 
593
606
  // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
594
607
  attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
608
+
595
609
  // Operator (capture 2)
596
610
  "*([*^$|!~]?=)" + whitespace +
597
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
598
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
599
- "*\\]",
611
+
612
+ // "Attribute values must be CSS identifiers [capture 5]
613
+ // or strings [capture 3 or capture 4]"
614
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
615
+ whitespace + "*\\]",
600
616
 
601
617
  pseudos = ":(" + identifier + ")(?:\\((" +
618
+
602
619
  // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
603
620
  // 1. quoted (capture 3; capture 4 or capture 5)
604
621
  "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
622
+
605
623
  // 2. simple (capture 6)
606
624
  "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
625
+
607
626
  // 3. anything else (capture 2)
608
627
  ".*" +
609
628
  ")\\)|)",
610
629
 
611
630
  // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
612
631
  rwhitespace = new RegExp( whitespace + "+", "g" ),
613
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
632
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
633
+ whitespace + "+$", "g" ),
614
634
 
615
635
  rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
616
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
636
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
637
+ "*" ),
617
638
  rdescend = new RegExp( whitespace + "|>" ),
618
639
 
619
640
  rpseudo = new RegExp( pseudos ),
@@ -625,14 +646,16 @@ var i,
625
646
  "TAG": new RegExp( "^(" + identifier + "|[*])" ),
626
647
  "ATTR": new RegExp( "^" + attributes ),
627
648
  "PSEUDO": new RegExp( "^" + pseudos ),
628
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
629
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
630
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
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" ),
631
652
  "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
653
+
632
654
  // For use in libraries implementing .is()
633
655
  // We use this for POS matching in `select`
634
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
635
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
656
+ "needsContext": new RegExp( "^" + whitespace +
657
+ "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
658
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
636
659
  },
637
660
 
638
661
  rhtml = /HTML$/i,
@@ -648,18 +671,21 @@ var i,
648
671
 
649
672
  // CSS escapes
650
673
  // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
651
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
652
- funescape = function( _, escaped, escapedWhitespace ) {
653
- var high = "0x" + escaped - 0x10000;
654
- // NaN means non-codepoint
655
- // Support: Firefox<24
656
- // Workaround erroneous numeric interpretation of +"0x"
657
- return high !== high || escapedWhitespace ?
658
- escaped :
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
659
687
  high < 0 ?
660
- // BMP codepoint
661
688
  String.fromCharCode( high + 0x10000 ) :
662
- // Supplemental Plane codepoint (surrogate pair)
663
689
  String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
664
690
  },
665
691
 
@@ -675,7 +701,8 @@ var i,
675
701
  }
676
702
 
677
703
  // Control characters and (dependent upon position) numbers get escaped as code points
678
- return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
704
+ return ch.slice( 0, -1 ) + "\\" +
705
+ ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
679
706
  }
680
707
 
681
708
  // Other potentially-special ASCII characters get backslash-escaped
@@ -700,18 +727,20 @@ var i,
700
727
  // Optimize for push.apply( _, NodeList )
701
728
  try {
702
729
  push.apply(
703
- (arr = slice.call( preferredDoc.childNodes )),
730
+ ( arr = slice.call( preferredDoc.childNodes ) ),
704
731
  preferredDoc.childNodes
705
732
  );
733
+
706
734
  // Support: Android<4.0
707
735
  // Detect silently failing push.apply
736
+ // eslint-disable-next-line no-unused-expressions
708
737
  arr[ preferredDoc.childNodes.length ].nodeType;
709
738
  } catch ( e ) {
710
739
  push = { apply: arr.length ?
711
740
 
712
741
  // Leverage slice if possible
713
742
  function( target, els ) {
714
- push_native.apply( target, slice.call(els) );
743
+ pushNative.apply( target, slice.call( els ) );
715
744
  } :
716
745
 
717
746
  // Support: IE<9
@@ -719,8 +748,9 @@ try {
719
748
  function( target, els ) {
720
749
  var j = target.length,
721
750
  i = 0;
751
+
722
752
  // Can't trust NodeList.length
723
- while ( (target[j++] = els[i++]) ) {}
753
+ while ( ( target[ j++ ] = els[ i++ ] ) ) {}
724
754
  target.length = j - 1;
725
755
  }
726
756
  };
@@ -744,24 +774,21 @@ function Sizzle( selector, context, results, seed ) {
744
774
 
745
775
  // Try to shortcut find operations (as opposed to filters) in HTML documents
746
776
  if ( !seed ) {
747
-
748
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
749
- setDocument( context );
750
- }
777
+ setDocument( context );
751
778
  context = context || document;
752
779
 
753
780
  if ( documentIsHTML ) {
754
781
 
755
782
  // If the selector is sufficiently simple, try using a "get*By*" DOM method
756
783
  // (excepting DocumentFragment context, where the methods don't exist)
757
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
784
+ if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
758
785
 
759
786
  // ID selector
760
- if ( (m = match[1]) ) {
787
+ if ( ( m = match[ 1 ] ) ) {
761
788
 
762
789
  // Document context
763
790
  if ( nodeType === 9 ) {
764
- if ( (elem = context.getElementById( m )) ) {
791
+ if ( ( elem = context.getElementById( m ) ) ) {
765
792
 
766
793
  // Support: IE, Opera, Webkit
767
794
  // TODO: identify versions
@@ -780,7 +807,7 @@ function Sizzle( selector, context, results, seed ) {
780
807
  // Support: IE, Opera, Webkit
781
808
  // TODO: identify versions
782
809
  // getElementById can match elements by name instead of ID
783
- if ( newContext && (elem = newContext.getElementById( m )) &&
810
+ if ( newContext && ( elem = newContext.getElementById( m ) ) &&
784
811
  contains( context, elem ) &&
785
812
  elem.id === m ) {
786
813
 
@@ -790,12 +817,12 @@ function Sizzle( selector, context, results, seed ) {
790
817
  }
791
818
 
792
819
  // Type selector
793
- } else if ( match[2] ) {
820
+ } else if ( match[ 2 ] ) {
794
821
  push.apply( results, context.getElementsByTagName( selector ) );
795
822
  return results;
796
823
 
797
824
  // Class selector
798
- } else if ( (m = match[3]) && support.getElementsByClassName &&
825
+ } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
799
826
  context.getElementsByClassName ) {
800
827
 
801
828
  push.apply( results, context.getElementsByClassName( m ) );
@@ -806,11 +833,11 @@ function Sizzle( selector, context, results, seed ) {
806
833
  // Take advantage of querySelectorAll
807
834
  if ( support.qsa &&
808
835
  !nonnativeSelectorCache[ selector + " " ] &&
809
- (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
836
+ ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
810
837
 
811
838
  // Support: IE 8 only
812
839
  // Exclude object elements
813
- (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
840
+ ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
814
841
 
815
842
  newSelector = selector;
816
843
  newContext = context;
@@ -819,27 +846,36 @@ function Sizzle( selector, context, results, seed ) {
819
846
  // descendant combinators, which is not what we want.
820
847
  // In such cases, we work around the behavior by prefixing every selector in the
821
848
  // list with an ID selector referencing the scope context.
849
+ // The technique has to be used as well when a leading combinator is used
850
+ // as such selectors are not recognized by querySelectorAll.
822
851
  // Thanks to Andrew Dupont for this technique.
823
- if ( nodeType === 1 && rdescend.test( selector ) ) {
852
+ if ( nodeType === 1 &&
853
+ ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
824
854
 
825
- // Capture the context ID, setting it first if necessary
826
- if ( (nid = context.getAttribute( "id" )) ) {
827
- nid = nid.replace( rcssescape, fcssescape );
828
- } else {
829
- context.setAttribute( "id", (nid = expando) );
855
+ // Expand context for sibling selectors
856
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
857
+ context;
858
+
859
+ // We can use :scope instead of the ID hack if the browser
860
+ // supports it & if we're not changing the context.
861
+ if ( newContext !== context || !support.scope ) {
862
+
863
+ // Capture the context ID, setting it first if necessary
864
+ if ( ( nid = context.getAttribute( "id" ) ) ) {
865
+ nid = nid.replace( rcssescape, fcssescape );
866
+ } else {
867
+ context.setAttribute( "id", ( nid = expando ) );
868
+ }
830
869
  }
831
870
 
832
871
  // Prefix every selector in the list
833
872
  groups = tokenize( selector );
834
873
  i = groups.length;
835
874
  while ( i-- ) {
836
- groups[i] = "#" + nid + " " + toSelector( groups[i] );
875
+ groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
876
+ toSelector( groups[ i ] );
837
877
  }
838
878
  newSelector = groups.join( "," );
839
-
840
- // Expand context for sibling selectors
841
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
842
- context;
843
879
  }
844
880
 
845
881
  try {
@@ -872,12 +908,14 @@ function createCache() {
872
908
  var keys = [];
873
909
 
874
910
  function cache( key, value ) {
911
+
875
912
  // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
876
913
  if ( keys.push( key + " " ) > Expr.cacheLength ) {
914
+
877
915
  // Only keep the most recent entries
878
916
  delete cache[ keys.shift() ];
879
917
  }
880
- return (cache[ key + " " ] = value);
918
+ return ( cache[ key + " " ] = value );
881
919
  }
882
920
  return cache;
883
921
  }
@@ -896,17 +934,19 @@ function markFunction( fn ) {
896
934
  * @param {Function} fn Passed the created element and returns a boolean result
897
935
  */
898
936
  function assert( fn ) {
899
- var el = document.createElement("fieldset");
937
+ var el = document.createElement( "fieldset" );
900
938
 
901
939
  try {
902
940
  return !!fn( el );
903
- } catch (e) {
941
+ } catch ( e ) {
904
942
  return false;
905
943
  } finally {
944
+
906
945
  // Remove from its parent by default
907
946
  if ( el.parentNode ) {
908
947
  el.parentNode.removeChild( el );
909
948
  }
949
+
910
950
  // release memory in IE
911
951
  el = null;
912
952
  }
@@ -918,11 +958,11 @@ function assert( fn ) {
918
958
  * @param {Function} handler The method that will be applied
919
959
  */
920
960
  function addHandle( attrs, handler ) {
921
- var arr = attrs.split("|"),
961
+ var arr = attrs.split( "|" ),
922
962
  i = arr.length;
923
963
 
924
964
  while ( i-- ) {
925
- Expr.attrHandle[ arr[i] ] = handler;
965
+ Expr.attrHandle[ arr[ i ] ] = handler;
926
966
  }
927
967
  }
928
968
 
@@ -944,7 +984,7 @@ function siblingCheck( a, b ) {
944
984
 
945
985
  // Check if b follows a
946
986
  if ( cur ) {
947
- while ( (cur = cur.nextSibling) ) {
987
+ while ( ( cur = cur.nextSibling ) ) {
948
988
  if ( cur === b ) {
949
989
  return -1;
950
990
  }
@@ -972,7 +1012,7 @@ function createInputPseudo( type ) {
972
1012
  function createButtonPseudo( type ) {
973
1013
  return function( elem ) {
974
1014
  var name = elem.nodeName.toLowerCase();
975
- return (name === "input" || name === "button") && elem.type === type;
1015
+ return ( name === "input" || name === "button" ) && elem.type === type;
976
1016
  };
977
1017
  }
978
1018
 
@@ -1015,7 +1055,7 @@ function createDisabledPseudo( disabled ) {
1015
1055
  // Where there is no isDisabled, check manually
1016
1056
  /* jshint -W018 */
1017
1057
  elem.isDisabled !== !disabled &&
1018
- inDisabledFieldset( elem ) === disabled;
1058
+ inDisabledFieldset( elem ) === disabled;
1019
1059
  }
1020
1060
 
1021
1061
  return elem.disabled === disabled;
@@ -1037,21 +1077,21 @@ function createDisabledPseudo( disabled ) {
1037
1077
  * @param {Function} fn
1038
1078
  */
1039
1079
  function createPositionalPseudo( fn ) {
1040
- return markFunction(function( argument ) {
1080
+ return markFunction( function( argument ) {
1041
1081
  argument = +argument;
1042
- return markFunction(function( seed, matches ) {
1082
+ return markFunction( function( seed, matches ) {
1043
1083
  var j,
1044
1084
  matchIndexes = fn( [], seed.length, argument ),
1045
1085
  i = matchIndexes.length;
1046
1086
 
1047
1087
  // Match elements found at the specified indexes
1048
1088
  while ( i-- ) {
1049
- if ( seed[ (j = matchIndexes[i]) ] ) {
1050
- seed[j] = !(matches[j] = seed[j]);
1089
+ if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
1090
+ seed[ j ] = !( matches[ j ] = seed[ j ] );
1051
1091
  }
1052
1092
  }
1053
- });
1054
- });
1093
+ } );
1094
+ } );
1055
1095
  }
1056
1096
 
1057
1097
  /**
@@ -1072,8 +1112,8 @@ support = Sizzle.support = {};
1072
1112
  * @returns {Boolean} True iff elem is a non-HTML XML node
1073
1113
  */
1074
1114
  isXML = Sizzle.isXML = function( elem ) {
1075
- var namespace = elem.namespaceURI,
1076
- docElem = (elem.ownerDocument || elem).documentElement;
1115
+ var namespace = elem && elem.namespaceURI,
1116
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;
1077
1117
 
1078
1118
  // Support: IE <=8
1079
1119
  // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
@@ -1091,7 +1131,11 @@ setDocument = Sizzle.setDocument = function( node ) {
1091
1131
  doc = node ? node.ownerDocument || node : preferredDoc;
1092
1132
 
1093
1133
  // Return early if doc is invalid or already selected
1094
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1134
+ // Support: IE 11+, Edge 17 - 18+
1135
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1136
+ // two documents; shallow comparisons work.
1137
+ // eslint-disable-next-line eqeqeq
1138
+ if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
1095
1139
  return document;
1096
1140
  }
1097
1141
 
@@ -1100,10 +1144,14 @@ setDocument = Sizzle.setDocument = function( node ) {
1100
1144
  docElem = document.documentElement;
1101
1145
  documentIsHTML = !isXML( document );
1102
1146
 
1103
- // Support: IE 9-11, Edge
1147
+ // Support: IE 9 - 11+, Edge 12 - 18+
1104
1148
  // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1105
- if ( preferredDoc !== document &&
1106
- (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
1149
+ // Support: IE 11+, Edge 17 - 18+
1150
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1151
+ // two documents; shallow comparisons work.
1152
+ // eslint-disable-next-line eqeqeq
1153
+ if ( preferredDoc != document &&
1154
+ ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
1107
1155
 
1108
1156
  // Support: IE 11, Edge
1109
1157
  if ( subWindow.addEventListener ) {
@@ -1115,25 +1163,36 @@ setDocument = Sizzle.setDocument = function( node ) {
1115
1163
  }
1116
1164
  }
1117
1165
 
1166
+ // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
1167
+ // Safari 4 - 5 only, Opera <=11.6 - 12.x only
1168
+ // IE/Edge & older browsers don't support the :scope pseudo-class.
1169
+ // Support: Safari 6.0 only
1170
+ // Safari 6.0 supports :scope but it's an alias of :root there.
1171
+ support.scope = assert( function( el ) {
1172
+ docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
1173
+ return typeof el.querySelectorAll !== "undefined" &&
1174
+ !el.querySelectorAll( ":scope fieldset div" ).length;
1175
+ } );
1176
+
1118
1177
  /* Attributes
1119
1178
  ---------------------------------------------------------------------- */
1120
1179
 
1121
1180
  // Support: IE<8
1122
1181
  // Verify that getAttribute really returns attributes and not properties
1123
1182
  // (excepting IE8 booleans)
1124
- support.attributes = assert(function( el ) {
1183
+ support.attributes = assert( function( el ) {
1125
1184
  el.className = "i";
1126
- return !el.getAttribute("className");
1127
- });
1185
+ return !el.getAttribute( "className" );
1186
+ } );
1128
1187
 
1129
1188
  /* getElement(s)By*
1130
1189
  ---------------------------------------------------------------------- */
1131
1190
 
1132
1191
  // Check if getElementsByTagName("*") returns only elements
1133
- support.getElementsByTagName = assert(function( el ) {
1134
- el.appendChild( document.createComment("") );
1135
- return !el.getElementsByTagName("*").length;
1136
- });
1192
+ support.getElementsByTagName = assert( function( el ) {
1193
+ el.appendChild( document.createComment( "" ) );
1194
+ return !el.getElementsByTagName( "*" ).length;
1195
+ } );
1137
1196
 
1138
1197
  // Support: IE<9
1139
1198
  support.getElementsByClassName = rnative.test( document.getElementsByClassName );
@@ -1142,38 +1201,38 @@ setDocument = Sizzle.setDocument = function( node ) {
1142
1201
  // Check if getElementById returns elements by name
1143
1202
  // The broken getElementById methods don't pick up programmatically-set names,
1144
1203
  // so use a roundabout getElementsByName test
1145
- support.getById = assert(function( el ) {
1204
+ support.getById = assert( function( el ) {
1146
1205
  docElem.appendChild( el ).id = expando;
1147
1206
  return !document.getElementsByName || !document.getElementsByName( expando ).length;
1148
- });
1207
+ } );
1149
1208
 
1150
1209
  // ID filter and find
1151
1210
  if ( support.getById ) {
1152
- Expr.filter["ID"] = function( id ) {
1211
+ Expr.filter[ "ID" ] = function( id ) {
1153
1212
  var attrId = id.replace( runescape, funescape );
1154
1213
  return function( elem ) {
1155
- return elem.getAttribute("id") === attrId;
1214
+ return elem.getAttribute( "id" ) === attrId;
1156
1215
  };
1157
1216
  };
1158
- Expr.find["ID"] = function( id, context ) {
1217
+ Expr.find[ "ID" ] = function( id, context ) {
1159
1218
  if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1160
1219
  var elem = context.getElementById( id );
1161
1220
  return elem ? [ elem ] : [];
1162
1221
  }
1163
1222
  };
1164
1223
  } else {
1165
- Expr.filter["ID"] = function( id ) {
1224
+ Expr.filter[ "ID" ] = function( id ) {
1166
1225
  var attrId = id.replace( runescape, funescape );
1167
1226
  return function( elem ) {
1168
1227
  var node = typeof elem.getAttributeNode !== "undefined" &&
1169
- elem.getAttributeNode("id");
1228
+ elem.getAttributeNode( "id" );
1170
1229
  return node && node.value === attrId;
1171
1230
  };
1172
1231
  };
1173
1232
 
1174
1233
  // Support: IE 6 - 7 only
1175
1234
  // getElementById is not reliable as a find shortcut
1176
- Expr.find["ID"] = function( id, context ) {
1235
+ Expr.find[ "ID" ] = function( id, context ) {
1177
1236
  if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1178
1237
  var node, i, elems,
1179
1238
  elem = context.getElementById( id );
@@ -1181,7 +1240,7 @@ setDocument = Sizzle.setDocument = function( node ) {
1181
1240
  if ( elem ) {
1182
1241
 
1183
1242
  // Verify the id attribute
1184
- node = elem.getAttributeNode("id");
1243
+ node = elem.getAttributeNode( "id" );
1185
1244
  if ( node && node.value === id ) {
1186
1245
  return [ elem ];
1187
1246
  }
@@ -1189,8 +1248,8 @@ setDocument = Sizzle.setDocument = function( node ) {
1189
1248
  // Fall back on getElementsByName
1190
1249
  elems = context.getElementsByName( id );
1191
1250
  i = 0;
1192
- while ( (elem = elems[i++]) ) {
1193
- node = elem.getAttributeNode("id");
1251
+ while ( ( elem = elems[ i++ ] ) ) {
1252
+ node = elem.getAttributeNode( "id" );
1194
1253
  if ( node && node.value === id ) {
1195
1254
  return [ elem ];
1196
1255
  }
@@ -1203,7 +1262,7 @@ setDocument = Sizzle.setDocument = function( node ) {
1203
1262
  }
1204
1263
 
1205
1264
  // Tag
1206
- Expr.find["TAG"] = support.getElementsByTagName ?
1265
+ Expr.find[ "TAG" ] = support.getElementsByTagName ?
1207
1266
  function( tag, context ) {
1208
1267
  if ( typeof context.getElementsByTagName !== "undefined" ) {
1209
1268
  return context.getElementsByTagName( tag );
@@ -1218,12 +1277,13 @@ setDocument = Sizzle.setDocument = function( node ) {
1218
1277
  var elem,
1219
1278
  tmp = [],
1220
1279
  i = 0,
1280
+
1221
1281
  // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1222
1282
  results = context.getElementsByTagName( tag );
1223
1283
 
1224
1284
  // Filter out possible comments
1225
1285
  if ( tag === "*" ) {
1226
- while ( (elem = results[i++]) ) {
1286
+ while ( ( elem = results[ i++ ] ) ) {
1227
1287
  if ( elem.nodeType === 1 ) {
1228
1288
  tmp.push( elem );
1229
1289
  }
@@ -1235,7 +1295,7 @@ setDocument = Sizzle.setDocument = function( node ) {
1235
1295
  };
1236
1296
 
1237
1297
  // Class
1238
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1298
+ Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
1239
1299
  if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1240
1300
  return context.getElementsByClassName( className );
1241
1301
  }
@@ -1256,10 +1316,14 @@ setDocument = Sizzle.setDocument = function( node ) {
1256
1316
  // See https://bugs.jquery.com/ticket/13378
1257
1317
  rbuggyQSA = [];
1258
1318
 
1259
- if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1319
+ if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
1320
+
1260
1321
  // Build QSA regex
1261
1322
  // Regex strategy adopted from Diego Perini
1262
- assert(function( el ) {
1323
+ assert( function( el ) {
1324
+
1325
+ var input;
1326
+
1263
1327
  // Select is set to empty string on purpose
1264
1328
  // This is to test IE's treatment of not explicitly
1265
1329
  // setting a boolean content attribute,
@@ -1273,78 +1337,98 @@ setDocument = Sizzle.setDocument = function( node ) {
1273
1337
  // Nothing should be selected when empty strings follow ^= or $= or *=
1274
1338
  // The test attribute must be unknown in Opera but "safe" for WinRT
1275
1339
  // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1276
- if ( el.querySelectorAll("[msallowcapture^='']").length ) {
1340
+ if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
1277
1341
  rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1278
1342
  }
1279
1343
 
1280
1344
  // Support: IE8
1281
1345
  // Boolean attributes and "value" are not treated correctly
1282
- if ( !el.querySelectorAll("[selected]").length ) {
1346
+ if ( !el.querySelectorAll( "[selected]" ).length ) {
1283
1347
  rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1284
1348
  }
1285
1349
 
1286
1350
  // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1287
1351
  if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1288
- rbuggyQSA.push("~=");
1352
+ rbuggyQSA.push( "~=" );
1353
+ }
1354
+
1355
+ // Support: IE 11+, Edge 15 - 18+
1356
+ // IE 11/Edge don't find elements on a `[name='']` query in some cases.
1357
+ // Adding a temporary attribute to the document before the selection works
1358
+ // around the issue.
1359
+ // Interestingly, IE 10 & older don't seem to have the issue.
1360
+ input = document.createElement( "input" );
1361
+ input.setAttribute( "name", "" );
1362
+ el.appendChild( input );
1363
+ if ( !el.querySelectorAll( "[name='']" ).length ) {
1364
+ rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
1365
+ whitespace + "*(?:''|\"\")" );
1289
1366
  }
1290
1367
 
1291
1368
  // Webkit/Opera - :checked should return selected option elements
1292
1369
  // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1293
1370
  // IE8 throws error here and will not see later tests
1294
- if ( !el.querySelectorAll(":checked").length ) {
1295
- rbuggyQSA.push(":checked");
1371
+ if ( !el.querySelectorAll( ":checked" ).length ) {
1372
+ rbuggyQSA.push( ":checked" );
1296
1373
  }
1297
1374
 
1298
1375
  // Support: Safari 8+, iOS 8+
1299
1376
  // https://bugs.webkit.org/show_bug.cgi?id=136851
1300
1377
  // In-page `selector#id sibling-combinator selector` fails
1301
1378
  if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1302
- rbuggyQSA.push(".#.+[+~]");
1379
+ rbuggyQSA.push( ".#.+[+~]" );
1303
1380
  }
1304
- });
1305
1381
 
1306
- assert(function( el ) {
1382
+ // Support: Firefox <=3.6 - 5 only
1383
+ // Old Firefox doesn't throw on a badly-escaped identifier.
1384
+ el.querySelectorAll( "\\\f" );
1385
+ rbuggyQSA.push( "[\\r\\n\\f]" );
1386
+ } );
1387
+
1388
+ assert( function( el ) {
1307
1389
  el.innerHTML = "<a href='' disabled='disabled'></a>" +
1308
1390
  "<select disabled='disabled'><option/></select>";
1309
1391
 
1310
1392
  // Support: Windows 8 Native Apps
1311
1393
  // The type and name attributes are restricted during .innerHTML assignment
1312
- var input = document.createElement("input");
1394
+ var input = document.createElement( "input" );
1313
1395
  input.setAttribute( "type", "hidden" );
1314
1396
  el.appendChild( input ).setAttribute( "name", "D" );
1315
1397
 
1316
1398
  // Support: IE8
1317
1399
  // Enforce case-sensitivity of name attribute
1318
- if ( el.querySelectorAll("[name=d]").length ) {
1400
+ if ( el.querySelectorAll( "[name=d]" ).length ) {
1319
1401
  rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1320
1402
  }
1321
1403
 
1322
1404
  // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1323
1405
  // IE8 throws error here and will not see later tests
1324
- if ( el.querySelectorAll(":enabled").length !== 2 ) {
1406
+ if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
1325
1407
  rbuggyQSA.push( ":enabled", ":disabled" );
1326
1408
  }
1327
1409
 
1328
1410
  // Support: IE9-11+
1329
1411
  // IE's :disabled selector does not pick up the children of disabled fieldsets
1330
1412
  docElem.appendChild( el ).disabled = true;
1331
- if ( el.querySelectorAll(":disabled").length !== 2 ) {
1413
+ if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
1332
1414
  rbuggyQSA.push( ":enabled", ":disabled" );
1333
1415
  }
1334
1416
 
1417
+ // Support: Opera 10 - 11 only
1335
1418
  // Opera 10-11 does not throw on post-comma invalid pseudos
1336
- el.querySelectorAll("*,:x");
1337
- rbuggyQSA.push(",.*:");
1338
- });
1419
+ el.querySelectorAll( "*,:x" );
1420
+ rbuggyQSA.push( ",.*:" );
1421
+ } );
1339
1422
  }
1340
1423
 
1341
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1424
+ if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
1342
1425
  docElem.webkitMatchesSelector ||
1343
1426
  docElem.mozMatchesSelector ||
1344
1427
  docElem.oMatchesSelector ||
1345
- docElem.msMatchesSelector) )) ) {
1428
+ docElem.msMatchesSelector ) ) ) ) {
1429
+
1430
+ assert( function( el ) {
1346
1431
 
1347
- assert(function( el ) {
1348
1432
  // Check to see if it's possible to do matchesSelector
1349
1433
  // on a disconnected node (IE 9)
1350
1434
  support.disconnectedMatch = matches.call( el, "*" );
@@ -1353,11 +1437,11 @@ setDocument = Sizzle.setDocument = function( node ) {
1353
1437
  // Gecko does not error, returns false instead
1354
1438
  matches.call( el, "[s!='']:x" );
1355
1439
  rbuggyMatches.push( "!=", pseudos );
1356
- });
1440
+ } );
1357
1441
  }
1358
1442
 
1359
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1360
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1443
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
1444
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
1361
1445
 
1362
1446
  /* Contains
1363
1447
  ---------------------------------------------------------------------- */
@@ -1374,11 +1458,11 @@ setDocument = Sizzle.setDocument = function( node ) {
1374
1458
  adown.contains ?
1375
1459
  adown.contains( bup ) :
1376
1460
  a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1377
- ));
1461
+ ) );
1378
1462
  } :
1379
1463
  function( a, b ) {
1380
1464
  if ( b ) {
1381
- while ( (b = b.parentNode) ) {
1465
+ while ( ( b = b.parentNode ) ) {
1382
1466
  if ( b === a ) {
1383
1467
  return true;
1384
1468
  }
@@ -1407,7 +1491,11 @@ setDocument = Sizzle.setDocument = function( node ) {
1407
1491
  }
1408
1492
 
1409
1493
  // Calculate position if both inputs belong to the same document
1410
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1494
+ // Support: IE 11+, Edge 17 - 18+
1495
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1496
+ // two documents; shallow comparisons work.
1497
+ // eslint-disable-next-line eqeqeq
1498
+ compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
1411
1499
  a.compareDocumentPosition( b ) :
1412
1500
 
1413
1501
  // Otherwise we know they are disconnected
@@ -1415,13 +1503,24 @@ setDocument = Sizzle.setDocument = function( node ) {
1415
1503
 
1416
1504
  // Disconnected nodes
1417
1505
  if ( compare & 1 ||
1418
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1506
+ ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
1419
1507
 
1420
1508
  // Choose the first element that is related to our preferred document
1421
- if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1509
+ // Support: IE 11+, Edge 17 - 18+
1510
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1511
+ // two documents; shallow comparisons work.
1512
+ // eslint-disable-next-line eqeqeq
1513
+ if ( a == document || a.ownerDocument == preferredDoc &&
1514
+ contains( preferredDoc, a ) ) {
1422
1515
  return -1;
1423
1516
  }
1424
- if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1517
+
1518
+ // Support: IE 11+, Edge 17 - 18+
1519
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1520
+ // two documents; shallow comparisons work.
1521
+ // eslint-disable-next-line eqeqeq
1522
+ if ( b == document || b.ownerDocument == preferredDoc &&
1523
+ contains( preferredDoc, b ) ) {
1425
1524
  return 1;
1426
1525
  }
1427
1526
 
@@ -1434,6 +1533,7 @@ setDocument = Sizzle.setDocument = function( node ) {
1434
1533
  return compare & 4 ? -1 : 1;
1435
1534
  } :
1436
1535
  function( a, b ) {
1536
+
1437
1537
  // Exit early if the nodes are identical
1438
1538
  if ( a === b ) {
1439
1539
  hasDuplicate = true;
@@ -1449,8 +1549,14 @@ setDocument = Sizzle.setDocument = function( node ) {
1449
1549
 
1450
1550
  // Parentless nodes are either documents or disconnected
1451
1551
  if ( !aup || !bup ) {
1452
- return a === document ? -1 :
1453
- b === document ? 1 :
1552
+
1553
+ // Support: IE 11+, Edge 17 - 18+
1554
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1555
+ // two documents; shallow comparisons work.
1556
+ /* eslint-disable eqeqeq */
1557
+ return a == document ? -1 :
1558
+ b == document ? 1 :
1559
+ /* eslint-enable eqeqeq */
1454
1560
  aup ? -1 :
1455
1561
  bup ? 1 :
1456
1562
  sortInput ?
@@ -1464,26 +1570,32 @@ setDocument = Sizzle.setDocument = function( node ) {
1464
1570
 
1465
1571
  // Otherwise we need full lists of their ancestors for comparison
1466
1572
  cur = a;
1467
- while ( (cur = cur.parentNode) ) {
1573
+ while ( ( cur = cur.parentNode ) ) {
1468
1574
  ap.unshift( cur );
1469
1575
  }
1470
1576
  cur = b;
1471
- while ( (cur = cur.parentNode) ) {
1577
+ while ( ( cur = cur.parentNode ) ) {
1472
1578
  bp.unshift( cur );
1473
1579
  }
1474
1580
 
1475
1581
  // Walk down the tree looking for a discrepancy
1476
- while ( ap[i] === bp[i] ) {
1582
+ while ( ap[ i ] === bp[ i ] ) {
1477
1583
  i++;
1478
1584
  }
1479
1585
 
1480
1586
  return i ?
1587
+
1481
1588
  // Do a sibling check if the nodes have a common ancestor
1482
- siblingCheck( ap[i], bp[i] ) :
1589
+ siblingCheck( ap[ i ], bp[ i ] ) :
1483
1590
 
1484
1591
  // Otherwise nodes in our document sort first
1485
- ap[i] === preferredDoc ? -1 :
1486
- bp[i] === preferredDoc ? 1 :
1592
+ // Support: IE 11+, Edge 17 - 18+
1593
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1594
+ // two documents; shallow comparisons work.
1595
+ /* eslint-disable eqeqeq */
1596
+ ap[ i ] == preferredDoc ? -1 :
1597
+ bp[ i ] == preferredDoc ? 1 :
1598
+ /* eslint-enable eqeqeq */
1487
1599
  0;
1488
1600
  };
1489
1601
 
@@ -1495,10 +1607,7 @@ Sizzle.matches = function( expr, elements ) {
1495
1607
  };
1496
1608
 
1497
1609
  Sizzle.matchesSelector = function( elem, expr ) {
1498
- // Set document vars if needed
1499
- if ( ( elem.ownerDocument || elem ) !== document ) {
1500
- setDocument( elem );
1501
- }
1610
+ setDocument( elem );
1502
1611
 
1503
1612
  if ( support.matchesSelector && documentIsHTML &&
1504
1613
  !nonnativeSelectorCache[ expr + " " ] &&
@@ -1510,12 +1619,13 @@ Sizzle.matchesSelector = function( elem, expr ) {
1510
1619
 
1511
1620
  // IE 9's matchesSelector returns false on disconnected nodes
1512
1621
  if ( ret || support.disconnectedMatch ||
1513
- // As well, disconnected nodes are said to be in a document
1514
- // fragment in IE 9
1515
- elem.document && elem.document.nodeType !== 11 ) {
1622
+
1623
+ // As well, disconnected nodes are said to be in a document
1624
+ // fragment in IE 9
1625
+ elem.document && elem.document.nodeType !== 11 ) {
1516
1626
  return ret;
1517
1627
  }
1518
- } catch (e) {
1628
+ } catch ( e ) {
1519
1629
  nonnativeSelectorCache( expr, true );
1520
1630
  }
1521
1631
  }
@@ -1524,20 +1634,31 @@ Sizzle.matchesSelector = function( elem, expr ) {
1524
1634
  };
1525
1635
 
1526
1636
  Sizzle.contains = function( context, elem ) {
1637
+
1527
1638
  // Set document vars if needed
1528
- if ( ( context.ownerDocument || context ) !== document ) {
1639
+ // Support: IE 11+, Edge 17 - 18+
1640
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1641
+ // two documents; shallow comparisons work.
1642
+ // eslint-disable-next-line eqeqeq
1643
+ if ( ( context.ownerDocument || context ) != document ) {
1529
1644
  setDocument( context );
1530
1645
  }
1531
1646
  return contains( context, elem );
1532
1647
  };
1533
1648
 
1534
1649
  Sizzle.attr = function( elem, name ) {
1650
+
1535
1651
  // Set document vars if needed
1536
- if ( ( elem.ownerDocument || elem ) !== document ) {
1652
+ // Support: IE 11+, Edge 17 - 18+
1653
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1654
+ // two documents; shallow comparisons work.
1655
+ // eslint-disable-next-line eqeqeq
1656
+ if ( ( elem.ownerDocument || elem ) != document ) {
1537
1657
  setDocument( elem );
1538
1658
  }
1539
1659
 
1540
1660
  var fn = Expr.attrHandle[ name.toLowerCase() ],
1661
+
1541
1662
  // Don't get fooled by Object.prototype properties (jQuery #13807)
1542
1663
  val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1543
1664
  fn( elem, name, !documentIsHTML ) :
@@ -1547,13 +1668,13 @@ Sizzle.attr = function( elem, name ) {
1547
1668
  val :
1548
1669
  support.attributes || !documentIsHTML ?
1549
1670
  elem.getAttribute( name ) :
1550
- (val = elem.getAttributeNode(name)) && val.specified ?
1671
+ ( val = elem.getAttributeNode( name ) ) && val.specified ?
1551
1672
  val.value :
1552
1673
  null;
1553
1674
  };
1554
1675
 
1555
1676
  Sizzle.escape = function( sel ) {
1556
- return (sel + "").replace( rcssescape, fcssescape );
1677
+ return ( sel + "" ).replace( rcssescape, fcssescape );
1557
1678
  };
1558
1679
 
1559
1680
  Sizzle.error = function( msg ) {
@@ -1576,7 +1697,7 @@ Sizzle.uniqueSort = function( results ) {
1576
1697
  results.sort( sortOrder );
1577
1698
 
1578
1699
  if ( hasDuplicate ) {
1579
- while ( (elem = results[i++]) ) {
1700
+ while ( ( elem = results[ i++ ] ) ) {
1580
1701
  if ( elem === results[ i ] ) {
1581
1702
  j = duplicates.push( i );
1582
1703
  }
@@ -1604,17 +1725,21 @@ getText = Sizzle.getText = function( elem ) {
1604
1725
  nodeType = elem.nodeType;
1605
1726
 
1606
1727
  if ( !nodeType ) {
1728
+
1607
1729
  // If no nodeType, this is expected to be an array
1608
- while ( (node = elem[i++]) ) {
1730
+ while ( ( node = elem[ i++ ] ) ) {
1731
+
1609
1732
  // Do not traverse comment nodes
1610
1733
  ret += getText( node );
1611
1734
  }
1612
1735
  } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1736
+
1613
1737
  // Use textContent for elements
1614
1738
  // innerText usage removed for consistency of new lines (jQuery #11153)
1615
1739
  if ( typeof elem.textContent === "string" ) {
1616
1740
  return elem.textContent;
1617
1741
  } else {
1742
+
1618
1743
  // Traverse its children
1619
1744
  for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1620
1745
  ret += getText( elem );
@@ -1623,6 +1748,7 @@ getText = Sizzle.getText = function( elem ) {
1623
1748
  } else if ( nodeType === 3 || nodeType === 4 ) {
1624
1749
  return elem.nodeValue;
1625
1750
  }
1751
+
1626
1752
  // Do not include comment or processing instruction nodes
1627
1753
 
1628
1754
  return ret;
@@ -1650,19 +1776,21 @@ Expr = Sizzle.selectors = {
1650
1776
 
1651
1777
  preFilter: {
1652
1778
  "ATTR": function( match ) {
1653
- match[1] = match[1].replace( runescape, funescape );
1779
+ match[ 1 ] = match[ 1 ].replace( runescape, funescape );
1654
1780
 
1655
1781
  // Move the given value to match[3] whether quoted or unquoted
1656
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1782
+ match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
1783
+ match[ 5 ] || "" ).replace( runescape, funescape );
1657
1784
 
1658
- if ( match[2] === "~=" ) {
1659
- match[3] = " " + match[3] + " ";
1785
+ if ( match[ 2 ] === "~=" ) {
1786
+ match[ 3 ] = " " + match[ 3 ] + " ";
1660
1787
  }
1661
1788
 
1662
1789
  return match.slice( 0, 4 );
1663
1790
  },
1664
1791
 
1665
1792
  "CHILD": function( match ) {
1793
+
1666
1794
  /* matches from matchExpr["CHILD"]
1667
1795
  1 type (only|nth|...)
1668
1796
  2 what (child|of-type)
@@ -1673,22 +1801,25 @@ Expr = Sizzle.selectors = {
1673
1801
  7 sign of y-component
1674
1802
  8 y of y-component
1675
1803
  */
1676
- match[1] = match[1].toLowerCase();
1804
+ match[ 1 ] = match[ 1 ].toLowerCase();
1805
+
1806
+ if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
1677
1807
 
1678
- if ( match[1].slice( 0, 3 ) === "nth" ) {
1679
1808
  // nth-* requires argument
1680
- if ( !match[3] ) {
1681
- Sizzle.error( match[0] );
1809
+ if ( !match[ 3 ] ) {
1810
+ Sizzle.error( match[ 0 ] );
1682
1811
  }
1683
1812
 
1684
1813
  // numeric x and y parameters for Expr.filter.CHILD
1685
1814
  // remember that false/true cast respectively to 0/1
1686
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1687
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1815
+ match[ 4 ] = +( match[ 4 ] ?
1816
+ match[ 5 ] + ( match[ 6 ] || 1 ) :
1817
+ 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
1818
+ match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
1688
1819
 
1689
- // other types prohibit arguments
1690
- } else if ( match[3] ) {
1691
- Sizzle.error( match[0] );
1820
+ // other types prohibit arguments
1821
+ } else if ( match[ 3 ] ) {
1822
+ Sizzle.error( match[ 0 ] );
1692
1823
  }
1693
1824
 
1694
1825
  return match;
@@ -1696,26 +1827,28 @@ Expr = Sizzle.selectors = {
1696
1827
 
1697
1828
  "PSEUDO": function( match ) {
1698
1829
  var excess,
1699
- unquoted = !match[6] && match[2];
1830
+ unquoted = !match[ 6 ] && match[ 2 ];
1700
1831
 
1701
- if ( matchExpr["CHILD"].test( match[0] ) ) {
1832
+ if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
1702
1833
  return null;
1703
1834
  }
1704
1835
 
1705
1836
  // Accept quoted arguments as-is
1706
- if ( match[3] ) {
1707
- match[2] = match[4] || match[5] || "";
1837
+ if ( match[ 3 ] ) {
1838
+ match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
1708
1839
 
1709
1840
  // Strip excess characters from unquoted arguments
1710
1841
  } else if ( unquoted && rpseudo.test( unquoted ) &&
1842
+
1711
1843
  // Get excess from tokenize (recursively)
1712
- (excess = tokenize( unquoted, true )) &&
1844
+ ( excess = tokenize( unquoted, true ) ) &&
1845
+
1713
1846
  // advance to the next closing parenthesis
1714
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1847
+ ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
1715
1848
 
1716
1849
  // excess is a negative index
1717
- match[0] = match[0].slice( 0, excess );
1718
- match[2] = unquoted.slice( 0, excess );
1850
+ match[ 0 ] = match[ 0 ].slice( 0, excess );
1851
+ match[ 2 ] = unquoted.slice( 0, excess );
1719
1852
  }
1720
1853
 
1721
1854
  // Return only captures needed by the pseudo filter method (type and argument)
@@ -1728,7 +1861,9 @@ Expr = Sizzle.selectors = {
1728
1861
  "TAG": function( nodeNameSelector ) {
1729
1862
  var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1730
1863
  return nodeNameSelector === "*" ?
1731
- function() { return true; } :
1864
+ function() {
1865
+ return true;
1866
+ } :
1732
1867
  function( elem ) {
1733
1868
  return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1734
1869
  };
@@ -1738,10 +1873,16 @@ Expr = Sizzle.selectors = {
1738
1873
  var pattern = classCache[ className + " " ];
1739
1874
 
1740
1875
  return pattern ||
1741
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1742
- classCache( className, function( elem ) {
1743
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1744
- });
1876
+ ( pattern = new RegExp( "(^|" + whitespace +
1877
+ ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
1878
+ className, function( elem ) {
1879
+ return pattern.test(
1880
+ typeof elem.className === "string" && elem.className ||
1881
+ typeof elem.getAttribute !== "undefined" &&
1882
+ elem.getAttribute( "class" ) ||
1883
+ ""
1884
+ );
1885
+ } );
1745
1886
  },
1746
1887
 
1747
1888
  "ATTR": function( name, operator, check ) {
@@ -1757,6 +1898,8 @@ Expr = Sizzle.selectors = {
1757
1898
 
1758
1899
  result += "";
1759
1900
 
1901
+ /* eslint-disable max-len */
1902
+
1760
1903
  return operator === "=" ? result === check :
1761
1904
  operator === "!=" ? result !== check :
1762
1905
  operator === "^=" ? check && result.indexOf( check ) === 0 :
@@ -1765,10 +1908,12 @@ Expr = Sizzle.selectors = {
1765
1908
  operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1766
1909
  operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1767
1910
  false;
1911
+ /* eslint-enable max-len */
1912
+
1768
1913
  };
1769
1914
  },
1770
1915
 
1771
- "CHILD": function( type, what, argument, first, last ) {
1916
+ "CHILD": function( type, what, _argument, first, last ) {
1772
1917
  var simple = type.slice( 0, 3 ) !== "nth",
1773
1918
  forward = type.slice( -4 ) !== "last",
1774
1919
  ofType = what === "of-type";
@@ -1780,7 +1925,7 @@ Expr = Sizzle.selectors = {
1780
1925
  return !!elem.parentNode;
1781
1926
  } :
1782
1927
 
1783
- function( elem, context, xml ) {
1928
+ function( elem, _context, xml ) {
1784
1929
  var cache, uniqueCache, outerCache, node, nodeIndex, start,
1785
1930
  dir = simple !== forward ? "nextSibling" : "previousSibling",
1786
1931
  parent = elem.parentNode,
@@ -1794,7 +1939,7 @@ Expr = Sizzle.selectors = {
1794
1939
  if ( simple ) {
1795
1940
  while ( dir ) {
1796
1941
  node = elem;
1797
- while ( (node = node[ dir ]) ) {
1942
+ while ( ( node = node[ dir ] ) ) {
1798
1943
  if ( ofType ?
1799
1944
  node.nodeName.toLowerCase() === name :
1800
1945
  node.nodeType === 1 ) {
@@ -1802,6 +1947,7 @@ Expr = Sizzle.selectors = {
1802
1947
  return false;
1803
1948
  }
1804
1949
  }
1950
+
1805
1951
  // Reverse direction for :only-* (if we haven't yet done so)
1806
1952
  start = dir = type === "only" && !start && "nextSibling";
1807
1953
  }
@@ -1817,22 +1963,22 @@ Expr = Sizzle.selectors = {
1817
1963
 
1818
1964
  // ...in a gzip-friendly way
1819
1965
  node = parent;
1820
- outerCache = node[ expando ] || (node[ expando ] = {});
1966
+ outerCache = node[ expando ] || ( node[ expando ] = {} );
1821
1967
 
1822
1968
  // Support: IE <9 only
1823
1969
  // Defend against cloned attroperties (jQuery gh-1709)
1824
1970
  uniqueCache = outerCache[ node.uniqueID ] ||
1825
- (outerCache[ node.uniqueID ] = {});
1971
+ ( outerCache[ node.uniqueID ] = {} );
1826
1972
 
1827
1973
  cache = uniqueCache[ type ] || [];
1828
1974
  nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1829
1975
  diff = nodeIndex && cache[ 2 ];
1830
1976
  node = nodeIndex && parent.childNodes[ nodeIndex ];
1831
1977
 
1832
- while ( (node = ++nodeIndex && node && node[ dir ] ||
1978
+ while ( ( node = ++nodeIndex && node && node[ dir ] ||
1833
1979
 
1834
1980
  // Fallback to seeking `elem` from the start
1835
- (diff = nodeIndex = 0) || start.pop()) ) {
1981
+ ( diff = nodeIndex = 0 ) || start.pop() ) ) {
1836
1982
 
1837
1983
  // When found, cache indexes on `parent` and break
1838
1984
  if ( node.nodeType === 1 && ++diff && node === elem ) {
@@ -1842,16 +1988,18 @@ Expr = Sizzle.selectors = {
1842
1988
  }
1843
1989
 
1844
1990
  } else {
1991
+
1845
1992
  // Use previously-cached element index if available
1846
1993
  if ( useCache ) {
1994
+
1847
1995
  // ...in a gzip-friendly way
1848
1996
  node = elem;
1849
- outerCache = node[ expando ] || (node[ expando ] = {});
1997
+ outerCache = node[ expando ] || ( node[ expando ] = {} );
1850
1998
 
1851
1999
  // Support: IE <9 only
1852
2000
  // Defend against cloned attroperties (jQuery gh-1709)
1853
2001
  uniqueCache = outerCache[ node.uniqueID ] ||
1854
- (outerCache[ node.uniqueID ] = {});
2002
+ ( outerCache[ node.uniqueID ] = {} );
1855
2003
 
1856
2004
  cache = uniqueCache[ type ] || [];
1857
2005
  nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
@@ -1861,9 +2009,10 @@ Expr = Sizzle.selectors = {
1861
2009
  // xml :nth-child(...)
1862
2010
  // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1863
2011
  if ( diff === false ) {
2012
+
1864
2013
  // Use the same loop as above to seek `elem` from the start
1865
- while ( (node = ++nodeIndex && node && node[ dir ] ||
1866
- (diff = nodeIndex = 0) || start.pop()) ) {
2014
+ while ( ( node = ++nodeIndex && node && node[ dir ] ||
2015
+ ( diff = nodeIndex = 0 ) || start.pop() ) ) {
1867
2016
 
1868
2017
  if ( ( ofType ?
1869
2018
  node.nodeName.toLowerCase() === name :
@@ -1872,12 +2021,13 @@ Expr = Sizzle.selectors = {
1872
2021
 
1873
2022
  // Cache the index of each encountered element
1874
2023
  if ( useCache ) {
1875
- outerCache = node[ expando ] || (node[ expando ] = {});
2024
+ outerCache = node[ expando ] ||
2025
+ ( node[ expando ] = {} );
1876
2026
 
1877
2027
  // Support: IE <9 only
1878
2028
  // Defend against cloned attroperties (jQuery gh-1709)
1879
2029
  uniqueCache = outerCache[ node.uniqueID ] ||
1880
- (outerCache[ node.uniqueID ] = {});
2030
+ ( outerCache[ node.uniqueID ] = {} );
1881
2031
 
1882
2032
  uniqueCache[ type ] = [ dirruns, diff ];
1883
2033
  }
@@ -1898,6 +2048,7 @@ Expr = Sizzle.selectors = {
1898
2048
  },
1899
2049
 
1900
2050
  "PSEUDO": function( pseudo, argument ) {
2051
+
1901
2052
  // pseudo-class names are case-insensitive
1902
2053
  // http://www.w3.org/TR/selectors/#pseudo-classes
1903
2054
  // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
@@ -1917,15 +2068,15 @@ Expr = Sizzle.selectors = {
1917
2068
  if ( fn.length > 1 ) {
1918
2069
  args = [ pseudo, pseudo, "", argument ];
1919
2070
  return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1920
- markFunction(function( seed, matches ) {
2071
+ markFunction( function( seed, matches ) {
1921
2072
  var idx,
1922
2073
  matched = fn( seed, argument ),
1923
2074
  i = matched.length;
1924
2075
  while ( i-- ) {
1925
- idx = indexOf( seed, matched[i] );
1926
- seed[ idx ] = !( matches[ idx ] = matched[i] );
2076
+ idx = indexOf( seed, matched[ i ] );
2077
+ seed[ idx ] = !( matches[ idx ] = matched[ i ] );
1927
2078
  }
1928
- }) :
2079
+ } ) :
1929
2080
  function( elem ) {
1930
2081
  return fn( elem, 0, args );
1931
2082
  };
@@ -1936,8 +2087,10 @@ Expr = Sizzle.selectors = {
1936
2087
  },
1937
2088
 
1938
2089
  pseudos: {
2090
+
1939
2091
  // Potentially complex pseudos
1940
- "not": markFunction(function( selector ) {
2092
+ "not": markFunction( function( selector ) {
2093
+
1941
2094
  // Trim the selector passed to compile
1942
2095
  // to avoid treating leading and trailing
1943
2096
  // spaces as combinators
@@ -1946,39 +2099,40 @@ Expr = Sizzle.selectors = {
1946
2099
  matcher = compile( selector.replace( rtrim, "$1" ) );
1947
2100
 
1948
2101
  return matcher[ expando ] ?
1949
- markFunction(function( seed, matches, context, xml ) {
2102
+ markFunction( function( seed, matches, _context, xml ) {
1950
2103
  var elem,
1951
2104
  unmatched = matcher( seed, null, xml, [] ),
1952
2105
  i = seed.length;
1953
2106
 
1954
2107
  // Match elements unmatched by `matcher`
1955
2108
  while ( i-- ) {
1956
- if ( (elem = unmatched[i]) ) {
1957
- seed[i] = !(matches[i] = elem);
2109
+ if ( ( elem = unmatched[ i ] ) ) {
2110
+ seed[ i ] = !( matches[ i ] = elem );
1958
2111
  }
1959
2112
  }
1960
- }) :
1961
- function( elem, context, xml ) {
1962
- input[0] = elem;
2113
+ } ) :
2114
+ function( elem, _context, xml ) {
2115
+ input[ 0 ] = elem;
1963
2116
  matcher( input, null, xml, results );
2117
+
1964
2118
  // Don't keep the element (issue #299)
1965
- input[0] = null;
2119
+ input[ 0 ] = null;
1966
2120
  return !results.pop();
1967
2121
  };
1968
- }),
2122
+ } ),
1969
2123
 
1970
- "has": markFunction(function( selector ) {
2124
+ "has": markFunction( function( selector ) {
1971
2125
  return function( elem ) {
1972
2126
  return Sizzle( selector, elem ).length > 0;
1973
2127
  };
1974
- }),
2128
+ } ),
1975
2129
 
1976
- "contains": markFunction(function( text ) {
2130
+ "contains": markFunction( function( text ) {
1977
2131
  text = text.replace( runescape, funescape );
1978
2132
  return function( elem ) {
1979
2133
  return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
1980
2134
  };
1981
- }),
2135
+ } ),
1982
2136
 
1983
2137
  // "Whether an element is represented by a :lang() selector
1984
2138
  // is based solely on the element's language value
@@ -1988,25 +2142,26 @@ Expr = Sizzle.selectors = {
1988
2142
  // The identifier C does not have to be a valid language name."
1989
2143
  // http://www.w3.org/TR/selectors/#lang-pseudo
1990
2144
  "lang": markFunction( function( lang ) {
2145
+
1991
2146
  // lang value must be a valid identifier
1992
- if ( !ridentifier.test(lang || "") ) {
2147
+ if ( !ridentifier.test( lang || "" ) ) {
1993
2148
  Sizzle.error( "unsupported lang: " + lang );
1994
2149
  }
1995
2150
  lang = lang.replace( runescape, funescape ).toLowerCase();
1996
2151
  return function( elem ) {
1997
2152
  var elemLang;
1998
2153
  do {
1999
- if ( (elemLang = documentIsHTML ?
2154
+ if ( ( elemLang = documentIsHTML ?
2000
2155
  elem.lang :
2001
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2156
+ elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
2002
2157
 
2003
2158
  elemLang = elemLang.toLowerCase();
2004
2159
  return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2005
2160
  }
2006
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2161
+ } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
2007
2162
  return false;
2008
2163
  };
2009
- }),
2164
+ } ),
2010
2165
 
2011
2166
  // Miscellaneous
2012
2167
  "target": function( elem ) {
@@ -2019,7 +2174,9 @@ Expr = Sizzle.selectors = {
2019
2174
  },
2020
2175
 
2021
2176
  "focus": function( elem ) {
2022
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2177
+ return elem === document.activeElement &&
2178
+ ( !document.hasFocus || document.hasFocus() ) &&
2179
+ !!( elem.type || elem.href || ~elem.tabIndex );
2023
2180
  },
2024
2181
 
2025
2182
  // Boolean properties
@@ -2027,16 +2184,20 @@ Expr = Sizzle.selectors = {
2027
2184
  "disabled": createDisabledPseudo( true ),
2028
2185
 
2029
2186
  "checked": function( elem ) {
2187
+
2030
2188
  // In CSS3, :checked should return both checked and selected elements
2031
2189
  // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2032
2190
  var nodeName = elem.nodeName.toLowerCase();
2033
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2191
+ return ( nodeName === "input" && !!elem.checked ) ||
2192
+ ( nodeName === "option" && !!elem.selected );
2034
2193
  },
2035
2194
 
2036
2195
  "selected": function( elem ) {
2196
+
2037
2197
  // Accessing this property makes selected-by-default
2038
2198
  // options in Safari work properly
2039
2199
  if ( elem.parentNode ) {
2200
+ // eslint-disable-next-line no-unused-expressions
2040
2201
  elem.parentNode.selectedIndex;
2041
2202
  }
2042
2203
 
@@ -2045,6 +2206,7 @@ Expr = Sizzle.selectors = {
2045
2206
 
2046
2207
  // Contents
2047
2208
  "empty": function( elem ) {
2209
+
2048
2210
  // http://www.w3.org/TR/selectors/#empty-pseudo
2049
2211
  // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2050
2212
  // but not by others (comment: 8; processing instruction: 7; etc.)
@@ -2058,7 +2220,7 @@ Expr = Sizzle.selectors = {
2058
2220
  },
2059
2221
 
2060
2222
  "parent": function( elem ) {
2061
- return !Expr.pseudos["empty"]( elem );
2223
+ return !Expr.pseudos[ "empty" ]( elem );
2062
2224
  },
2063
2225
 
2064
2226
  // Element/input types
@@ -2082,39 +2244,40 @@ Expr = Sizzle.selectors = {
2082
2244
 
2083
2245
  // Support: IE<8
2084
2246
  // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2085
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2247
+ ( ( attr = elem.getAttribute( "type" ) ) == null ||
2248
+ attr.toLowerCase() === "text" );
2086
2249
  },
2087
2250
 
2088
2251
  // Position-in-collection
2089
- "first": createPositionalPseudo(function() {
2252
+ "first": createPositionalPseudo( function() {
2090
2253
  return [ 0 ];
2091
- }),
2254
+ } ),
2092
2255
 
2093
- "last": createPositionalPseudo(function( matchIndexes, length ) {
2256
+ "last": createPositionalPseudo( function( _matchIndexes, length ) {
2094
2257
  return [ length - 1 ];
2095
- }),
2258
+ } ),
2096
2259
 
2097
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2260
+ "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
2098
2261
  return [ argument < 0 ? argument + length : argument ];
2099
- }),
2262
+ } ),
2100
2263
 
2101
- "even": createPositionalPseudo(function( matchIndexes, length ) {
2264
+ "even": createPositionalPseudo( function( matchIndexes, length ) {
2102
2265
  var i = 0;
2103
2266
  for ( ; i < length; i += 2 ) {
2104
2267
  matchIndexes.push( i );
2105
2268
  }
2106
2269
  return matchIndexes;
2107
- }),
2270
+ } ),
2108
2271
 
2109
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
2272
+ "odd": createPositionalPseudo( function( matchIndexes, length ) {
2110
2273
  var i = 1;
2111
2274
  for ( ; i < length; i += 2 ) {
2112
2275
  matchIndexes.push( i );
2113
2276
  }
2114
2277
  return matchIndexes;
2115
- }),
2278
+ } ),
2116
2279
 
2117
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2280
+ "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
2118
2281
  var i = argument < 0 ?
2119
2282
  argument + length :
2120
2283
  argument > length ?
@@ -2124,19 +2287,19 @@ Expr = Sizzle.selectors = {
2124
2287
  matchIndexes.push( i );
2125
2288
  }
2126
2289
  return matchIndexes;
2127
- }),
2290
+ } ),
2128
2291
 
2129
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2292
+ "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
2130
2293
  var i = argument < 0 ? argument + length : argument;
2131
2294
  for ( ; ++i < length; ) {
2132
2295
  matchIndexes.push( i );
2133
2296
  }
2134
2297
  return matchIndexes;
2135
- })
2298
+ } )
2136
2299
  }
2137
2300
  };
2138
2301
 
2139
- Expr.pseudos["nth"] = Expr.pseudos["eq"];
2302
+ Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
2140
2303
 
2141
2304
  // Add button/input type pseudos
2142
2305
  for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
@@ -2167,37 +2330,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2167
2330
  while ( soFar ) {
2168
2331
 
2169
2332
  // Comma and first run
2170
- if ( !matched || (match = rcomma.exec( soFar )) ) {
2333
+ if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
2171
2334
  if ( match ) {
2335
+
2172
2336
  // Don't consume trailing commas as valid
2173
- soFar = soFar.slice( match[0].length ) || soFar;
2337
+ soFar = soFar.slice( match[ 0 ].length ) || soFar;
2174
2338
  }
2175
- groups.push( (tokens = []) );
2339
+ groups.push( ( tokens = [] ) );
2176
2340
  }
2177
2341
 
2178
2342
  matched = false;
2179
2343
 
2180
2344
  // Combinators
2181
- if ( (match = rcombinators.exec( soFar )) ) {
2345
+ if ( ( match = rcombinators.exec( soFar ) ) ) {
2182
2346
  matched = match.shift();
2183
- tokens.push({
2347
+ tokens.push( {
2184
2348
  value: matched,
2349
+
2185
2350
  // Cast descendant combinators to space
2186
- type: match[0].replace( rtrim, " " )
2187
- });
2351
+ type: match[ 0 ].replace( rtrim, " " )
2352
+ } );
2188
2353
  soFar = soFar.slice( matched.length );
2189
2354
  }
2190
2355
 
2191
2356
  // Filters
2192
2357
  for ( type in Expr.filter ) {
2193
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2194
- (match = preFilters[ type ]( match ))) ) {
2358
+ if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
2359
+ ( match = preFilters[ type ]( match ) ) ) ) {
2195
2360
  matched = match.shift();
2196
- tokens.push({
2361
+ tokens.push( {
2197
2362
  value: matched,
2198
2363
  type: type,
2199
2364
  matches: match
2200
- });
2365
+ } );
2201
2366
  soFar = soFar.slice( matched.length );
2202
2367
  }
2203
2368
  }
@@ -2214,6 +2379,7 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2214
2379
  soFar.length :
2215
2380
  soFar ?
2216
2381
  Sizzle.error( selector ) :
2382
+
2217
2383
  // Cache the tokens
2218
2384
  tokenCache( selector, groups ).slice( 0 );
2219
2385
  };
@@ -2223,7 +2389,7 @@ function toSelector( tokens ) {
2223
2389
  len = tokens.length,
2224
2390
  selector = "";
2225
2391
  for ( ; i < len; i++ ) {
2226
- selector += tokens[i].value;
2392
+ selector += tokens[ i ].value;
2227
2393
  }
2228
2394
  return selector;
2229
2395
  }
@@ -2236,9 +2402,10 @@ function addCombinator( matcher, combinator, base ) {
2236
2402
  doneName = done++;
2237
2403
 
2238
2404
  return combinator.first ?
2405
+
2239
2406
  // Check against closest ancestor/preceding element
2240
2407
  function( elem, context, xml ) {
2241
- while ( (elem = elem[ dir ]) ) {
2408
+ while ( ( elem = elem[ dir ] ) ) {
2242
2409
  if ( elem.nodeType === 1 || checkNonElements ) {
2243
2410
  return matcher( elem, context, xml );
2244
2411
  }
@@ -2253,7 +2420,7 @@ function addCombinator( matcher, combinator, base ) {
2253
2420
 
2254
2421
  // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2255
2422
  if ( xml ) {
2256
- while ( (elem = elem[ dir ]) ) {
2423
+ while ( ( elem = elem[ dir ] ) ) {
2257
2424
  if ( elem.nodeType === 1 || checkNonElements ) {
2258
2425
  if ( matcher( elem, context, xml ) ) {
2259
2426
  return true;
@@ -2261,27 +2428,29 @@ function addCombinator( matcher, combinator, base ) {
2261
2428
  }
2262
2429
  }
2263
2430
  } else {
2264
- while ( (elem = elem[ dir ]) ) {
2431
+ while ( ( elem = elem[ dir ] ) ) {
2265
2432
  if ( elem.nodeType === 1 || checkNonElements ) {
2266
- outerCache = elem[ expando ] || (elem[ expando ] = {});
2433
+ outerCache = elem[ expando ] || ( elem[ expando ] = {} );
2267
2434
 
2268
2435
  // Support: IE <9 only
2269
2436
  // Defend against cloned attroperties (jQuery gh-1709)
2270
- uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2437
+ uniqueCache = outerCache[ elem.uniqueID ] ||
2438
+ ( outerCache[ elem.uniqueID ] = {} );
2271
2439
 
2272
2440
  if ( skip && skip === elem.nodeName.toLowerCase() ) {
2273
2441
  elem = elem[ dir ] || elem;
2274
- } else if ( (oldCache = uniqueCache[ key ]) &&
2442
+ } else if ( ( oldCache = uniqueCache[ key ] ) &&
2275
2443
  oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2276
2444
 
2277
2445
  // Assign to newCache so results back-propagate to previous elements
2278
- return (newCache[ 2 ] = oldCache[ 2 ]);
2446
+ return ( newCache[ 2 ] = oldCache[ 2 ] );
2279
2447
  } else {
2448
+
2280
2449
  // Reuse newcache so results back-propagate to previous elements
2281
2450
  uniqueCache[ key ] = newCache;
2282
2451
 
2283
2452
  // A match means we're done; a fail means we have to keep checking
2284
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2453
+ if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
2285
2454
  return true;
2286
2455
  }
2287
2456
  }
@@ -2297,20 +2466,20 @@ function elementMatcher( matchers ) {
2297
2466
  function( elem, context, xml ) {
2298
2467
  var i = matchers.length;
2299
2468
  while ( i-- ) {
2300
- if ( !matchers[i]( elem, context, xml ) ) {
2469
+ if ( !matchers[ i ]( elem, context, xml ) ) {
2301
2470
  return false;
2302
2471
  }
2303
2472
  }
2304
2473
  return true;
2305
2474
  } :
2306
- matchers[0];
2475
+ matchers[ 0 ];
2307
2476
  }
2308
2477
 
2309
2478
  function multipleContexts( selector, contexts, results ) {
2310
2479
  var i = 0,
2311
2480
  len = contexts.length;
2312
2481
  for ( ; i < len; i++ ) {
2313
- Sizzle( selector, contexts[i], results );
2482
+ Sizzle( selector, contexts[ i ], results );
2314
2483
  }
2315
2484
  return results;
2316
2485
  }
@@ -2323,7 +2492,7 @@ function condense( unmatched, map, filter, context, xml ) {
2323
2492
  mapped = map != null;
2324
2493
 
2325
2494
  for ( ; i < len; i++ ) {
2326
- if ( (elem = unmatched[i]) ) {
2495
+ if ( ( elem = unmatched[ i ] ) ) {
2327
2496
  if ( !filter || filter( elem, context, xml ) ) {
2328
2497
  newUnmatched.push( elem );
2329
2498
  if ( mapped ) {
@@ -2343,14 +2512,18 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
2343
2512
  if ( postFinder && !postFinder[ expando ] ) {
2344
2513
  postFinder = setMatcher( postFinder, postSelector );
2345
2514
  }
2346
- return markFunction(function( seed, results, context, xml ) {
2515
+ return markFunction( function( seed, results, context, xml ) {
2347
2516
  var temp, i, elem,
2348
2517
  preMap = [],
2349
2518
  postMap = [],
2350
2519
  preexisting = results.length,
2351
2520
 
2352
2521
  // Get initial elements from seed or context
2353
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2522
+ elems = seed || multipleContexts(
2523
+ selector || "*",
2524
+ context.nodeType ? [ context ] : context,
2525
+ []
2526
+ ),
2354
2527
 
2355
2528
  // Prefilter to get matcher input, preserving a map for seed-results synchronization
2356
2529
  matcherIn = preFilter && ( seed || !selector ) ?
@@ -2358,6 +2531,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
2358
2531
  elems,
2359
2532
 
2360
2533
  matcherOut = matcher ?
2534
+
2361
2535
  // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2362
2536
  postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2363
2537
 
@@ -2381,8 +2555,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
2381
2555
  // Un-match failing elements by moving them back to matcherIn
2382
2556
  i = temp.length;
2383
2557
  while ( i-- ) {
2384
- if ( (elem = temp[i]) ) {
2385
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2558
+ if ( ( elem = temp[ i ] ) ) {
2559
+ matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
2386
2560
  }
2387
2561
  }
2388
2562
  }
@@ -2390,25 +2564,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
2390
2564
  if ( seed ) {
2391
2565
  if ( postFinder || preFilter ) {
2392
2566
  if ( postFinder ) {
2567
+
2393
2568
  // Get the final matcherOut by condensing this intermediate into postFinder contexts
2394
2569
  temp = [];
2395
2570
  i = matcherOut.length;
2396
2571
  while ( i-- ) {
2397
- if ( (elem = matcherOut[i]) ) {
2572
+ if ( ( elem = matcherOut[ i ] ) ) {
2573
+
2398
2574
  // Restore matcherIn since elem is not yet a final match
2399
- temp.push( (matcherIn[i] = elem) );
2575
+ temp.push( ( matcherIn[ i ] = elem ) );
2400
2576
  }
2401
2577
  }
2402
- postFinder( null, (matcherOut = []), temp, xml );
2578
+ postFinder( null, ( matcherOut = [] ), temp, xml );
2403
2579
  }
2404
2580
 
2405
2581
  // Move matched elements from seed to results to keep them synchronized
2406
2582
  i = matcherOut.length;
2407
2583
  while ( i-- ) {
2408
- if ( (elem = matcherOut[i]) &&
2409
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2584
+ if ( ( elem = matcherOut[ i ] ) &&
2585
+ ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
2410
2586
 
2411
- seed[temp] = !(results[temp] = elem);
2587
+ seed[ temp ] = !( results[ temp ] = elem );
2412
2588
  }
2413
2589
  }
2414
2590
  }
@@ -2426,14 +2602,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
2426
2602
  push.apply( results, matcherOut );
2427
2603
  }
2428
2604
  }
2429
- });
2605
+ } );
2430
2606
  }
2431
2607
 
2432
2608
  function matcherFromTokens( tokens ) {
2433
2609
  var checkContext, matcher, j,
2434
2610
  len = tokens.length,
2435
- leadingRelative = Expr.relative[ tokens[0].type ],
2436
- implicitRelative = leadingRelative || Expr.relative[" "],
2611
+ leadingRelative = Expr.relative[ tokens[ 0 ].type ],
2612
+ implicitRelative = leadingRelative || Expr.relative[ " " ],
2437
2613
  i = leadingRelative ? 1 : 0,
2438
2614
 
2439
2615
  // The foundational matcher ensures that elements are reachable from top-level context(s)
@@ -2445,38 +2621,43 @@ function matcherFromTokens( tokens ) {
2445
2621
  }, implicitRelative, true ),
2446
2622
  matchers = [ function( elem, context, xml ) {
2447
2623
  var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2448
- (checkContext = context).nodeType ?
2624
+ ( checkContext = context ).nodeType ?
2449
2625
  matchContext( elem, context, xml ) :
2450
2626
  matchAnyContext( elem, context, xml ) );
2627
+
2451
2628
  // Avoid hanging onto element (issue #299)
2452
2629
  checkContext = null;
2453
2630
  return ret;
2454
2631
  } ];
2455
2632
 
2456
2633
  for ( ; i < len; i++ ) {
2457
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2458
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2634
+ if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
2635
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
2459
2636
  } else {
2460
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2637
+ matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
2461
2638
 
2462
2639
  // Return special upon seeing a positional matcher
2463
2640
  if ( matcher[ expando ] ) {
2641
+
2464
2642
  // Find the next relative operator (if any) for proper handling
2465
2643
  j = ++i;
2466
2644
  for ( ; j < len; j++ ) {
2467
- if ( Expr.relative[ tokens[j].type ] ) {
2645
+ if ( Expr.relative[ tokens[ j ].type ] ) {
2468
2646
  break;
2469
2647
  }
2470
2648
  }
2471
2649
  return setMatcher(
2472
2650
  i > 1 && elementMatcher( matchers ),
2473
2651
  i > 1 && toSelector(
2474
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2475
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2652
+
2653
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2654
+ tokens
2655
+ .slice( 0, i - 1 )
2656
+ .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
2476
2657
  ).replace( rtrim, "$1" ),
2477
2658
  matcher,
2478
2659
  i < j && matcherFromTokens( tokens.slice( i, j ) ),
2479
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2660
+ j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
2480
2661
  j < len && toSelector( tokens )
2481
2662
  );
2482
2663
  }
@@ -2497,28 +2678,40 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2497
2678
  unmatched = seed && [],
2498
2679
  setMatched = [],
2499
2680
  contextBackup = outermostContext,
2681
+
2500
2682
  // We must always have either seed elements or outermost context
2501
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2683
+ elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
2684
+
2502
2685
  // Use integer dirruns iff this is the outermost matcher
2503
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2686
+ dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
2504
2687
  len = elems.length;
2505
2688
 
2506
2689
  if ( outermost ) {
2507
- outermostContext = context === document || context || outermost;
2690
+
2691
+ // Support: IE 11+, Edge 17 - 18+
2692
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
2693
+ // two documents; shallow comparisons work.
2694
+ // eslint-disable-next-line eqeqeq
2695
+ outermostContext = context == document || context || outermost;
2508
2696
  }
2509
2697
 
2510
2698
  // Add elements passing elementMatchers directly to results
2511
2699
  // Support: IE<9, Safari
2512
2700
  // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2513
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2701
+ for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
2514
2702
  if ( byElement && elem ) {
2515
2703
  j = 0;
2516
- if ( !context && elem.ownerDocument !== document ) {
2704
+
2705
+ // Support: IE 11+, Edge 17 - 18+
2706
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
2707
+ // two documents; shallow comparisons work.
2708
+ // eslint-disable-next-line eqeqeq
2709
+ if ( !context && elem.ownerDocument != document ) {
2517
2710
  setDocument( elem );
2518
2711
  xml = !documentIsHTML;
2519
2712
  }
2520
- while ( (matcher = elementMatchers[j++]) ) {
2521
- if ( matcher( elem, context || document, xml) ) {
2713
+ while ( ( matcher = elementMatchers[ j++ ] ) ) {
2714
+ if ( matcher( elem, context || document, xml ) ) {
2522
2715
  results.push( elem );
2523
2716
  break;
2524
2717
  }
@@ -2530,8 +2723,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2530
2723
 
2531
2724
  // Track unmatched elements for set filters
2532
2725
  if ( bySet ) {
2726
+
2533
2727
  // They will have gone through all possible matchers
2534
- if ( (elem = !matcher && elem) ) {
2728
+ if ( ( elem = !matcher && elem ) ) {
2535
2729
  matchedCount--;
2536
2730
  }
2537
2731
 
@@ -2555,16 +2749,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2555
2749
  // numerically zero.
2556
2750
  if ( bySet && i !== matchedCount ) {
2557
2751
  j = 0;
2558
- while ( (matcher = setMatchers[j++]) ) {
2752
+ while ( ( matcher = setMatchers[ j++ ] ) ) {
2559
2753
  matcher( unmatched, setMatched, context, xml );
2560
2754
  }
2561
2755
 
2562
2756
  if ( seed ) {
2757
+
2563
2758
  // Reintegrate element matches to eliminate the need for sorting
2564
2759
  if ( matchedCount > 0 ) {
2565
2760
  while ( i-- ) {
2566
- if ( !(unmatched[i] || setMatched[i]) ) {
2567
- setMatched[i] = pop.call( results );
2761
+ if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
2762
+ setMatched[ i ] = pop.call( results );
2568
2763
  }
2569
2764
  }
2570
2765
  }
@@ -2605,13 +2800,14 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2605
2800
  cached = compilerCache[ selector + " " ];
2606
2801
 
2607
2802
  if ( !cached ) {
2803
+
2608
2804
  // Generate a function of recursive functions that can be used to check each element
2609
2805
  if ( !match ) {
2610
2806
  match = tokenize( selector );
2611
2807
  }
2612
2808
  i = match.length;
2613
2809
  while ( i-- ) {
2614
- cached = matcherFromTokens( match[i] );
2810
+ cached = matcherFromTokens( match[ i ] );
2615
2811
  if ( cached[ expando ] ) {
2616
2812
  setMatchers.push( cached );
2617
2813
  } else {
@@ -2620,7 +2816,10 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2620
2816
  }
2621
2817
 
2622
2818
  // Cache the compiled function
2623
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2819
+ cached = compilerCache(
2820
+ selector,
2821
+ matcherFromGroupMatchers( elementMatchers, setMatchers )
2822
+ );
2624
2823
 
2625
2824
  // Save selector and tokenization
2626
2825
  cached.selector = selector;
@@ -2640,7 +2839,7 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2640
2839
  select = Sizzle.select = function( selector, context, results, seed ) {
2641
2840
  var i, tokens, token, type, find,
2642
2841
  compiled = typeof selector === "function" && selector,
2643
- match = !seed && tokenize( (selector = compiled.selector || selector) );
2842
+ match = !seed && tokenize( ( selector = compiled.selector || selector ) );
2644
2843
 
2645
2844
  results = results || [];
2646
2845
 
@@ -2649,11 +2848,12 @@ select = Sizzle.select = function( selector, context, results, seed ) {
2649
2848
  if ( match.length === 1 ) {
2650
2849
 
2651
2850
  // Reduce context if the leading compound selector is an ID
2652
- tokens = match[0] = match[0].slice( 0 );
2653
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2654
- context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
2851
+ tokens = match[ 0 ] = match[ 0 ].slice( 0 );
2852
+ if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
2853
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
2655
2854
 
2656
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2855
+ context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
2856
+ .replace( runescape, funescape ), context ) || [] )[ 0 ];
2657
2857
  if ( !context ) {
2658
2858
  return results;
2659
2859
 
@@ -2666,20 +2866,22 @@ select = Sizzle.select = function( selector, context, results, seed ) {
2666
2866
  }
2667
2867
 
2668
2868
  // Fetch a seed set for right-to-left matching
2669
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2869
+ i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
2670
2870
  while ( i-- ) {
2671
- token = tokens[i];
2871
+ token = tokens[ i ];
2672
2872
 
2673
2873
  // Abort if we hit a combinator
2674
- if ( Expr.relative[ (type = token.type) ] ) {
2874
+ if ( Expr.relative[ ( type = token.type ) ] ) {
2675
2875
  break;
2676
2876
  }
2677
- if ( (find = Expr.find[ type ]) ) {
2877
+ if ( ( find = Expr.find[ type ] ) ) {
2878
+
2678
2879
  // Search, expanding context for leading sibling combinators
2679
- if ( (seed = find(
2680
- token.matches[0].replace( runescape, funescape ),
2681
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2682
- )) ) {
2880
+ if ( ( seed = find(
2881
+ token.matches[ 0 ].replace( runescape, funescape ),
2882
+ rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
2883
+ context
2884
+ ) ) ) {
2683
2885
 
2684
2886
  // If seed is empty or no tokens remain, we can return early
2685
2887
  tokens.splice( i, 1 );
@@ -2710,7 +2912,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
2710
2912
  // One-time assignments
2711
2913
 
2712
2914
  // Sort stability
2713
- support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2915
+ support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
2714
2916
 
2715
2917
  // Support: Chrome 14-35+
2716
2918
  // Always assume duplicates if they aren't passed to the comparison function
@@ -2721,58 +2923,59 @@ setDocument();
2721
2923
 
2722
2924
  // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2723
2925
  // Detached nodes confoundingly follow *each other*
2724
- support.sortDetached = assert(function( el ) {
2926
+ support.sortDetached = assert( function( el ) {
2927
+
2725
2928
  // Should return 1, but returns 4 (following)
2726
- return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
2727
- });
2929
+ return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
2930
+ } );
2728
2931
 
2729
2932
  // Support: IE<8
2730
2933
  // Prevent attribute/property "interpolation"
2731
2934
  // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2732
- if ( !assert(function( el ) {
2935
+ if ( !assert( function( el ) {
2733
2936
  el.innerHTML = "<a href='#'></a>";
2734
- return el.firstChild.getAttribute("href") === "#" ;
2735
- }) ) {
2937
+ return el.firstChild.getAttribute( "href" ) === "#";
2938
+ } ) ) {
2736
2939
  addHandle( "type|href|height|width", function( elem, name, isXML ) {
2737
2940
  if ( !isXML ) {
2738
2941
  return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2739
2942
  }
2740
- });
2943
+ } );
2741
2944
  }
2742
2945
 
2743
2946
  // Support: IE<9
2744
2947
  // Use defaultValue in place of getAttribute("value")
2745
- if ( !support.attributes || !assert(function( el ) {
2948
+ if ( !support.attributes || !assert( function( el ) {
2746
2949
  el.innerHTML = "<input/>";
2747
2950
  el.firstChild.setAttribute( "value", "" );
2748
2951
  return el.firstChild.getAttribute( "value" ) === "";
2749
- }) ) {
2750
- addHandle( "value", function( elem, name, isXML ) {
2952
+ } ) ) {
2953
+ addHandle( "value", function( elem, _name, isXML ) {
2751
2954
  if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2752
2955
  return elem.defaultValue;
2753
2956
  }
2754
- });
2957
+ } );
2755
2958
  }
2756
2959
 
2757
2960
  // Support: IE<9
2758
2961
  // Use getAttributeNode to fetch booleans when getAttribute lies
2759
- if ( !assert(function( el ) {
2760
- return el.getAttribute("disabled") == null;
2761
- }) ) {
2962
+ if ( !assert( function( el ) {
2963
+ return el.getAttribute( "disabled" ) == null;
2964
+ } ) ) {
2762
2965
  addHandle( booleans, function( elem, name, isXML ) {
2763
2966
  var val;
2764
2967
  if ( !isXML ) {
2765
2968
  return elem[ name ] === true ? name.toLowerCase() :
2766
- (val = elem.getAttributeNode( name )) && val.specified ?
2969
+ ( val = elem.getAttributeNode( name ) ) && val.specified ?
2767
2970
  val.value :
2768
- null;
2971
+ null;
2769
2972
  }
2770
- });
2973
+ } );
2771
2974
  }
2772
2975
 
2773
2976
  return Sizzle;
2774
2977
 
2775
- })( window );
2978
+ } )( window );
2776
2979
 
2777
2980
 
2778
2981
 
@@ -2825,9 +3028,9 @@ var rneedsContext = jQuery.expr.match.needsContext;
2825
3028
 
2826
3029
  function nodeName( elem, name ) {
2827
3030
 
2828
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3031
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
2829
3032
 
2830
- };
3033
+ }
2831
3034
  var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
2832
3035
 
2833
3036
 
@@ -2926,8 +3129,8 @@ jQuery.fn.extend( {
2926
3129
  var rootjQuery,
2927
3130
 
2928
3131
  // A simple way to check for HTML strings
2929
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2930
- // Strict HTML recognition (#11290: must start with <)
3132
+ // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
3133
+ // Strict HTML recognition (trac-11290: must start with <)
2931
3134
  // Shortcut simple #id case for speed
2932
3135
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
2933
3136
 
@@ -3141,7 +3344,7 @@ jQuery.each( {
3141
3344
  parents: function( elem ) {
3142
3345
  return dir( elem, "parentNode" );
3143
3346
  },
3144
- parentsUntil: function( elem, i, until ) {
3347
+ parentsUntil: function( elem, _i, until ) {
3145
3348
  return dir( elem, "parentNode", until );
3146
3349
  },
3147
3350
  next: function( elem ) {
@@ -3156,10 +3359,10 @@ jQuery.each( {
3156
3359
  prevAll: function( elem ) {
3157
3360
  return dir( elem, "previousSibling" );
3158
3361
  },
3159
- nextUntil: function( elem, i, until ) {
3362
+ nextUntil: function( elem, _i, until ) {
3160
3363
  return dir( elem, "nextSibling", until );
3161
3364
  },
3162
- prevUntil: function( elem, i, until ) {
3365
+ prevUntil: function( elem, _i, until ) {
3163
3366
  return dir( elem, "previousSibling", until );
3164
3367
  },
3165
3368
  siblings: function( elem ) {
@@ -3169,7 +3372,13 @@ jQuery.each( {
3169
3372
  return siblings( elem.firstChild );
3170
3373
  },
3171
3374
  contents: function( elem ) {
3172
- if ( typeof elem.contentDocument !== "undefined" ) {
3375
+ if ( elem.contentDocument != null &&
3376
+
3377
+ // Support: IE 11+
3378
+ // <object> elements with no `data` attribute has an object
3379
+ // `contentDocument` with a `null` prototype.
3380
+ getProto( elem.contentDocument ) ) {
3381
+
3173
3382
  return elem.contentDocument;
3174
3383
  }
3175
3384
 
@@ -3512,7 +3721,7 @@ jQuery.extend( {
3512
3721
  var fns = arguments;
3513
3722
 
3514
3723
  return jQuery.Deferred( function( newDefer ) {
3515
- jQuery.each( tuples, function( i, tuple ) {
3724
+ jQuery.each( tuples, function( _i, tuple ) {
3516
3725
 
3517
3726
  // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3518
3727
  var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
@@ -3792,8 +4001,8 @@ jQuery.extend( {
3792
4001
  resolveContexts = Array( i ),
3793
4002
  resolveValues = slice.call( arguments ),
3794
4003
 
3795
- // the master Deferred
3796
- master = jQuery.Deferred(),
4004
+ // the primary Deferred
4005
+ primary = jQuery.Deferred(),
3797
4006
 
3798
4007
  // subordinate callback factory
3799
4008
  updateFunc = function( i ) {
@@ -3801,30 +4010,30 @@ jQuery.extend( {
3801
4010
  resolveContexts[ i ] = this;
3802
4011
  resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3803
4012
  if ( !( --remaining ) ) {
3804
- master.resolveWith( resolveContexts, resolveValues );
4013
+ primary.resolveWith( resolveContexts, resolveValues );
3805
4014
  }
3806
4015
  };
3807
4016
  };
3808
4017
 
3809
4018
  // Single- and empty arguments are adopted like Promise.resolve
3810
4019
  if ( remaining <= 1 ) {
3811
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
4020
+ adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
3812
4021
  !remaining );
3813
4022
 
3814
4023
  // Use .then() to unwrap secondary thenables (cf. gh-3000)
3815
- if ( master.state() === "pending" ||
4024
+ if ( primary.state() === "pending" ||
3816
4025
  isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
3817
4026
 
3818
- return master.then();
4027
+ return primary.then();
3819
4028
  }
3820
4029
  }
3821
4030
 
3822
4031
  // Multiple arguments are aggregated like Promise.all array elements
3823
4032
  while ( i-- ) {
3824
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
4033
+ adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
3825
4034
  }
3826
4035
 
3827
- return master.promise();
4036
+ return primary.promise();
3828
4037
  }
3829
4038
  } );
3830
4039
 
@@ -3878,7 +4087,7 @@ jQuery.extend( {
3878
4087
  isReady: false,
3879
4088
 
3880
4089
  // A counter to track how many items to wait for before
3881
- // the ready event fires. See #6781
4090
+ // the ready event fires. See trac-6781
3882
4091
  readyWait: 1,
3883
4092
 
3884
4093
  // Handle when the DOM is ready
@@ -3965,7 +4174,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3965
4174
  // ...except when executing function values
3966
4175
  } else {
3967
4176
  bulk = fn;
3968
- fn = function( elem, key, value ) {
4177
+ fn = function( elem, _key, value ) {
3969
4178
  return bulk.call( jQuery( elem ), value );
3970
4179
  };
3971
4180
  }
@@ -3975,8 +4184,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3975
4184
  for ( ; i < len; i++ ) {
3976
4185
  fn(
3977
4186
  elems[ i ], key, raw ?
3978
- value :
3979
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
4187
+ value :
4188
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
3980
4189
  );
3981
4190
  }
3982
4191
  }
@@ -4000,13 +4209,13 @@ var rmsPrefix = /^-ms-/,
4000
4209
  rdashAlpha = /-([a-z])/g;
4001
4210
 
4002
4211
  // Used by camelCase as callback to replace()
4003
- function fcamelCase( all, letter ) {
4212
+ function fcamelCase( _all, letter ) {
4004
4213
  return letter.toUpperCase();
4005
4214
  }
4006
4215
 
4007
4216
  // Convert dashed to camelCase; used by the css and data modules
4008
4217
  // Support: IE <=9 - 11, Edge 12 - 15
4009
- // Microsoft forgot to hump their vendor prefix (#9572)
4218
+ // Microsoft forgot to hump their vendor prefix (trac-9572)
4010
4219
  function camelCase( string ) {
4011
4220
  return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4012
4221
  }
@@ -4042,7 +4251,7 @@ Data.prototype = {
4042
4251
  value = {};
4043
4252
 
4044
4253
  // We can accept data for non-element nodes in modern browsers,
4045
- // but we should not, see #8335.
4254
+ // but we should not, see trac-8335.
4046
4255
  // Always return an empty object.
4047
4256
  if ( acceptData( owner ) ) {
4048
4257
 
@@ -4281,7 +4490,7 @@ jQuery.fn.extend( {
4281
4490
  while ( i-- ) {
4282
4491
 
4283
4492
  // Support: IE 11 only
4284
- // The attrs elements can be null (#14894)
4493
+ // The attrs elements can be null (trac-14894)
4285
4494
  if ( attrs[ i ] ) {
4286
4495
  name = attrs[ i ].name;
4287
4496
  if ( name.indexOf( "data-" ) === 0 ) {
@@ -4528,27 +4737,6 @@ var isHiddenWithinTree = function( elem, el ) {
4528
4737
  jQuery.css( elem, "display" ) === "none";
4529
4738
  };
4530
4739
 
4531
- var swap = function( elem, options, callback, args ) {
4532
- var ret, name,
4533
- old = {};
4534
-
4535
- // Remember the old values, and insert the new ones
4536
- for ( name in options ) {
4537
- old[ name ] = elem.style[ name ];
4538
- elem.style[ name ] = options[ name ];
4539
- }
4540
-
4541
- ret = callback.apply( elem, args || [] );
4542
-
4543
- // Revert the old values
4544
- for ( name in options ) {
4545
- elem.style[ name ] = old[ name ];
4546
- }
4547
-
4548
- return ret;
4549
- };
4550
-
4551
-
4552
4740
 
4553
4741
 
4554
4742
  function adjustCSS( elem, prop, valueParts, tween ) {
@@ -4719,11 +4907,40 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4719
4907
 
4720
4908
 
4721
4909
 
4722
- // We have to close these tags to support XHTML (#13200)
4723
- var wrapMap = {
4910
+ ( function() {
4911
+ var fragment = document.createDocumentFragment(),
4912
+ div = fragment.appendChild( document.createElement( "div" ) ),
4913
+ input = document.createElement( "input" );
4914
+
4915
+ // Support: Android 4.0 - 4.3 only
4916
+ // Check state lost if the name is set (trac-11217)
4917
+ // Support: Windows Web Apps (WWA)
4918
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
4919
+ input.setAttribute( "type", "radio" );
4920
+ input.setAttribute( "checked", "checked" );
4921
+ input.setAttribute( "name", "t" );
4922
+
4923
+ div.appendChild( input );
4924
+
4925
+ // Support: Android <=4.1 only
4926
+ // Older WebKit doesn't clone checked state correctly in fragments
4927
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4928
+
4929
+ // Support: IE <=11 only
4930
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
4931
+ div.innerHTML = "<textarea>x</textarea>";
4932
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4724
4933
 
4725
4934
  // Support: IE <=9 only
4726
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
4935
+ // IE <=9 replaces <option> tags with their contents when inserted outside of
4936
+ // the select element.
4937
+ div.innerHTML = "<option></option>";
4938
+ support.option = !!div.lastChild;
4939
+ } )();
4940
+
4941
+
4942
+ // We have to close these tags to support XHTML (trac-13200)
4943
+ var wrapMap = {
4727
4944
 
4728
4945
  // XHTML parsers do not magically insert elements in the
4729
4946
  // same way that tag soup parsers do. So we cannot shorten
@@ -4736,17 +4953,19 @@ var wrapMap = {
4736
4953
  _default: [ 0, "", "" ]
4737
4954
  };
4738
4955
 
4739
- // Support: IE <=9 only
4740
- wrapMap.optgroup = wrapMap.option;
4741
-
4742
4956
  wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4743
4957
  wrapMap.th = wrapMap.td;
4744
4958
 
4959
+ // Support: IE <=9 only
4960
+ if ( !support.option ) {
4961
+ wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
4962
+ }
4963
+
4745
4964
 
4746
4965
  function getAll( context, tag ) {
4747
4966
 
4748
4967
  // Support: IE <=9 - 11 only
4749
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4968
+ // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
4750
4969
  var ret;
4751
4970
 
4752
4971
  if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -4829,7 +5048,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
4829
5048
  // Remember the top-level container
4830
5049
  tmp = fragment.firstChild;
4831
5050
 
4832
- // Ensure the created nodes are orphaned (#12392)
5051
+ // Ensure the created nodes are orphaned (trac-12392)
4833
5052
  tmp.textContent = "";
4834
5053
  }
4835
5054
  }
@@ -4874,36 +5093,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
4874
5093
  }
4875
5094
 
4876
5095
 
4877
- ( function() {
4878
- var fragment = document.createDocumentFragment(),
4879
- div = fragment.appendChild( document.createElement( "div" ) ),
4880
- input = document.createElement( "input" );
4881
-
4882
- // Support: Android 4.0 - 4.3 only
4883
- // Check state lost if the name is set (#11217)
4884
- // Support: Windows Web Apps (WWA)
4885
- // `name` and `type` must use .setAttribute for WWA (#14901)
4886
- input.setAttribute( "type", "radio" );
4887
- input.setAttribute( "checked", "checked" );
4888
- input.setAttribute( "name", "t" );
4889
-
4890
- div.appendChild( input );
4891
-
4892
- // Support: Android <=4.1 only
4893
- // Older WebKit doesn't clone checked state correctly in fragments
4894
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4895
-
4896
- // Support: IE <=11 only
4897
- // Make sure textarea (and checkbox) defaultValue is properly cloned
4898
- div.innerHTML = "<textarea>x</textarea>";
4899
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4900
- } )();
4901
-
4902
-
4903
- var
4904
- rkeyEvent = /^key/,
4905
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4906
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5096
+ var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4907
5097
 
4908
5098
  function returnTrue() {
4909
5099
  return true;
@@ -5008,8 +5198,8 @@ jQuery.event = {
5008
5198
  special, handlers, type, namespaces, origType,
5009
5199
  elemData = dataPriv.get( elem );
5010
5200
 
5011
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
5012
- if ( !elemData ) {
5201
+ // Only attach events to objects that accept data
5202
+ if ( !acceptData( elem ) ) {
5013
5203
  return;
5014
5204
  }
5015
5205
 
@@ -5033,7 +5223,7 @@ jQuery.event = {
5033
5223
 
5034
5224
  // Init the element's event structure and main handler, if this is the first
5035
5225
  if ( !( events = elemData.events ) ) {
5036
- events = elemData.events = {};
5226
+ events = elemData.events = Object.create( null );
5037
5227
  }
5038
5228
  if ( !( eventHandle = elemData.handle ) ) {
5039
5229
  eventHandle = elemData.handle = function( e ) {
@@ -5191,12 +5381,15 @@ jQuery.event = {
5191
5381
 
5192
5382
  dispatch: function( nativeEvent ) {
5193
5383
 
5194
- // Make a writable jQuery.Event from the native event object
5195
- var event = jQuery.event.fix( nativeEvent );
5196
-
5197
5384
  var i, j, ret, matched, handleObj, handlerQueue,
5198
5385
  args = new Array( arguments.length ),
5199
- handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
5386
+
5387
+ // Make a writable jQuery.Event from the native event object
5388
+ event = jQuery.event.fix( nativeEvent ),
5389
+
5390
+ handlers = (
5391
+ dataPriv.get( this, "events" ) || Object.create( null )
5392
+ )[ event.type ] || [],
5200
5393
  special = jQuery.event.special[ event.type ] || {};
5201
5394
 
5202
5395
  // Use the fix-ed jQuery.Event rather than the (read-only) native event
@@ -5276,15 +5469,15 @@ jQuery.event = {
5276
5469
 
5277
5470
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5278
5471
 
5279
- // Don't check non-elements (#13208)
5280
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5472
+ // Don't check non-elements (trac-13208)
5473
+ // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
5281
5474
  if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5282
5475
  matchedHandlers = [];
5283
5476
  matchedSelectors = {};
5284
5477
  for ( i = 0; i < delegateCount; i++ ) {
5285
5478
  handleObj = handlers[ i ];
5286
5479
 
5287
- // Don't conflict with Object.prototype properties (#13203)
5480
+ // Don't conflict with Object.prototype properties (trac-13203)
5288
5481
  sel = handleObj.selector + " ";
5289
5482
 
5290
5483
  if ( matchedSelectors[ sel ] === undefined ) {
@@ -5320,12 +5513,12 @@ jQuery.event = {
5320
5513
  get: isFunction( hook ) ?
5321
5514
  function() {
5322
5515
  if ( this.originalEvent ) {
5323
- return hook( this.originalEvent );
5516
+ return hook( this.originalEvent );
5324
5517
  }
5325
5518
  } :
5326
5519
  function() {
5327
5520
  if ( this.originalEvent ) {
5328
- return this.originalEvent[ name ];
5521
+ return this.originalEvent[ name ];
5329
5522
  }
5330
5523
  },
5331
5524
 
@@ -5464,7 +5657,13 @@ function leverageNative( el, type, expectSync ) {
5464
5657
  // Cancel the outer synthetic event
5465
5658
  event.stopImmediatePropagation();
5466
5659
  event.preventDefault();
5467
- return result.value;
5660
+
5661
+ // Support: Chrome 86+
5662
+ // In Chrome, if an element having a focusout handler is blurred by
5663
+ // clicking outside of it, it invokes the handler synchronously. If
5664
+ // that handler calls `.remove()` on the element, the data is cleared,
5665
+ // leaving `result` undefined. We need to guard against this.
5666
+ return result && result.value;
5468
5667
  }
5469
5668
 
5470
5669
  // If this is an inner synthetic event for an event with a bubbling surrogate
@@ -5532,7 +5731,7 @@ jQuery.Event = function( src, props ) {
5532
5731
 
5533
5732
  // Create target properties
5534
5733
  // Support: Safari <=6 - 7 only
5535
- // Target should not be a text node (#504, #13143)
5734
+ // Target should not be a text node (trac-504, trac-13143)
5536
5735
  this.target = ( src.target && src.target.nodeType === 3 ) ?
5537
5736
  src.target.parentNode :
5538
5737
  src.target;
@@ -5629,34 +5828,7 @@ jQuery.each( {
5629
5828
  targetTouches: true,
5630
5829
  toElement: true,
5631
5830
  touches: true,
5632
-
5633
- which: function( event ) {
5634
- var button = event.button;
5635
-
5636
- // Add which for key events
5637
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
5638
- return event.charCode != null ? event.charCode : event.keyCode;
5639
- }
5640
-
5641
- // Add which for click: 1 === left; 2 === middle; 3 === right
5642
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5643
- if ( button & 1 ) {
5644
- return 1;
5645
- }
5646
-
5647
- if ( button & 2 ) {
5648
- return 3;
5649
- }
5650
-
5651
- if ( button & 4 ) {
5652
- return 2;
5653
- }
5654
-
5655
- return 0;
5656
- }
5657
-
5658
- return event.which;
5659
- }
5831
+ which: true
5660
5832
  }, jQuery.event.addProp );
5661
5833
 
5662
5834
  jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
@@ -5682,6 +5854,12 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
5682
5854
  return true;
5683
5855
  },
5684
5856
 
5857
+ // Suppress native focus or blur if we're currently inside
5858
+ // a leveraged native-event stack
5859
+ _default: function( event ) {
5860
+ return dataPriv.get( event.target, type );
5861
+ },
5862
+
5685
5863
  delegateType: delegateType
5686
5864
  };
5687
5865
  } );
@@ -5771,13 +5949,6 @@ jQuery.fn.extend( {
5771
5949
 
5772
5950
  var
5773
5951
 
5774
- /* eslint-disable max-len */
5775
-
5776
- // See https://github.com/eslint/eslint/issues/3229
5777
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5778
-
5779
- /* eslint-enable */
5780
-
5781
5952
  // Support: IE <=10 - 11, Edge 12 - 13 only
5782
5953
  // In IE/Edge using regex groups here causes severe slowdowns.
5783
5954
  // See https://connect.microsoft.com/IE/feedback/details/1736512/
@@ -5785,7 +5956,8 @@ var
5785
5956
 
5786
5957
  // checked="checked" or checked
5787
5958
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5788
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5959
+
5960
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5789
5961
 
5790
5962
  // Prefer a tbody over its parent table for containing new rows
5791
5963
  function manipulationTarget( elem, content ) {
@@ -5814,7 +5986,7 @@ function restoreScript( elem ) {
5814
5986
  }
5815
5987
 
5816
5988
  function cloneCopyEvent( src, dest ) {
5817
- var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5989
+ var i, l, type, pdataOld, udataOld, udataCur, events;
5818
5990
 
5819
5991
  if ( dest.nodeType !== 1 ) {
5820
5992
  return;
@@ -5822,13 +5994,11 @@ function cloneCopyEvent( src, dest ) {
5822
5994
 
5823
5995
  // 1. Copy private data: events, handlers, etc.
5824
5996
  if ( dataPriv.hasData( src ) ) {
5825
- pdataOld = dataPriv.access( src );
5826
- pdataCur = dataPriv.set( dest, pdataOld );
5997
+ pdataOld = dataPriv.get( src );
5827
5998
  events = pdataOld.events;
5828
5999
 
5829
6000
  if ( events ) {
5830
- delete pdataCur.handle;
5831
- pdataCur.events = {};
6001
+ dataPriv.remove( dest, "handle events" );
5832
6002
 
5833
6003
  for ( type in events ) {
5834
6004
  for ( i = 0, l = events[ type ].length; i < l; i++ ) {
@@ -5864,7 +6034,7 @@ function fixInput( src, dest ) {
5864
6034
  function domManip( collection, args, callback, ignored ) {
5865
6035
 
5866
6036
  // Flatten any nested arrays
5867
- args = concat.apply( [], args );
6037
+ args = flat( args );
5868
6038
 
5869
6039
  var fragment, first, scripts, hasScripts, node, doc,
5870
6040
  i = 0,
@@ -5901,7 +6071,7 @@ function domManip( collection, args, callback, ignored ) {
5901
6071
 
5902
6072
  // Use the original fragment for the last item
5903
6073
  // instead of the first because it can end up
5904
- // being emptied incorrectly in certain situations (#8070).
6074
+ // being emptied incorrectly in certain situations (trac-8070).
5905
6075
  for ( ; i < l; i++ ) {
5906
6076
  node = fragment;
5907
6077
 
@@ -5939,9 +6109,15 @@ function domManip( collection, args, callback, ignored ) {
5939
6109
  if ( jQuery._evalUrl && !node.noModule ) {
5940
6110
  jQuery._evalUrl( node.src, {
5941
6111
  nonce: node.nonce || node.getAttribute( "nonce" )
5942
- } );
6112
+ }, doc );
5943
6113
  }
5944
6114
  } else {
6115
+
6116
+ // Unwrap a CDATA section containing script contents. This shouldn't be
6117
+ // needed as in XML documents they're already not visible when
6118
+ // inspecting element contents and in HTML documents they have no
6119
+ // meaning but we're preserving that logic for backwards compatibility.
6120
+ // This will be removed completely in 4.0. See gh-4904.
5945
6121
  DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
5946
6122
  }
5947
6123
  }
@@ -5976,7 +6152,7 @@ function remove( elem, selector, keepData ) {
5976
6152
 
5977
6153
  jQuery.extend( {
5978
6154
  htmlPrefilter: function( html ) {
5979
- return html.replace( rxhtmlTag, "<$1></$2>" );
6155
+ return html;
5980
6156
  },
5981
6157
 
5982
6158
  clone: function( elem, dataAndEvents, deepDataAndEvents ) {
@@ -6224,9 +6400,12 @@ jQuery.each( {
6224
6400
  } );
6225
6401
  var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6226
6402
 
6403
+ var rcustomProp = /^--/;
6404
+
6405
+
6227
6406
  var getStyles = function( elem ) {
6228
6407
 
6229
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6408
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6230
6409
  // IE throws on elements created in popups
6231
6410
  // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6232
6411
  var view = elem.ownerDocument.defaultView;
@@ -6238,8 +6417,38 @@ var getStyles = function( elem ) {
6238
6417
  return view.getComputedStyle( elem );
6239
6418
  };
6240
6419
 
6420
+ var swap = function( elem, options, callback ) {
6421
+ var ret, name,
6422
+ old = {};
6423
+
6424
+ // Remember the old values, and insert the new ones
6425
+ for ( name in options ) {
6426
+ old[ name ] = elem.style[ name ];
6427
+ elem.style[ name ] = options[ name ];
6428
+ }
6429
+
6430
+ ret = callback.call( elem );
6431
+
6432
+ // Revert the old values
6433
+ for ( name in options ) {
6434
+ elem.style[ name ] = old[ name ];
6435
+ }
6436
+
6437
+ return ret;
6438
+ };
6439
+
6440
+
6241
6441
  var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6242
6442
 
6443
+ var whitespace = "[\\x20\\t\\r\\n\\f]";
6444
+
6445
+
6446
+ var rtrimCSS = new RegExp(
6447
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6448
+ "g"
6449
+ );
6450
+
6451
+
6243
6452
 
6244
6453
 
6245
6454
  ( function() {
@@ -6295,7 +6504,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6295
6504
  }
6296
6505
 
6297
6506
  var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
6298
- reliableMarginLeftVal,
6507
+ reliableTrDimensionsVal, reliableMarginLeftVal,
6299
6508
  container = document.createElement( "div" ),
6300
6509
  div = document.createElement( "div" );
6301
6510
 
@@ -6305,7 +6514,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6305
6514
  }
6306
6515
 
6307
6516
  // Support: IE <=9 - 11 only
6308
- // Style of cloned element affects source element cloned (#8908)
6517
+ // Style of cloned element affects source element cloned (trac-8908)
6309
6518
  div.style.backgroundClip = "content-box";
6310
6519
  div.cloneNode( true ).style.backgroundClip = "";
6311
6520
  support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6330,6 +6539,54 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6330
6539
  scrollboxSize: function() {
6331
6540
  computeStyleTests();
6332
6541
  return scrollboxSizeVal;
6542
+ },
6543
+
6544
+ // Support: IE 9 - 11+, Edge 15 - 18+
6545
+ // IE/Edge misreport `getComputedStyle` of table rows with width/height
6546
+ // set in CSS while `offset*` properties report correct values.
6547
+ // Behavior in IE 9 is more subtle than in newer versions & it passes
6548
+ // some versions of this test; make sure not to make it pass there!
6549
+ //
6550
+ // Support: Firefox 70+
6551
+ // Only Firefox includes border widths
6552
+ // in computed dimensions. (gh-4529)
6553
+ reliableTrDimensions: function() {
6554
+ var table, tr, trChild, trStyle;
6555
+ if ( reliableTrDimensionsVal == null ) {
6556
+ table = document.createElement( "table" );
6557
+ tr = document.createElement( "tr" );
6558
+ trChild = document.createElement( "div" );
6559
+
6560
+ table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
6561
+ tr.style.cssText = "border:1px solid";
6562
+
6563
+ // Support: Chrome 86+
6564
+ // Height set through cssText does not get applied.
6565
+ // Computed height then comes back as 0.
6566
+ tr.style.height = "1px";
6567
+ trChild.style.height = "9px";
6568
+
6569
+ // Support: Android 8 Chrome 86+
6570
+ // In our bodyBackground.html iframe,
6571
+ // display for all div elements is set to "inline",
6572
+ // which causes a problem only in Android 8 Chrome 86.
6573
+ // Ensuring the div is display: block
6574
+ // gets around this issue.
6575
+ trChild.style.display = "block";
6576
+
6577
+ documentElement
6578
+ .appendChild( table )
6579
+ .appendChild( tr )
6580
+ .appendChild( trChild );
6581
+
6582
+ trStyle = window.getComputedStyle( tr );
6583
+ reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
6584
+ parseInt( trStyle.borderTopWidth, 10 ) +
6585
+ parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
6586
+
6587
+ documentElement.removeChild( table );
6588
+ }
6589
+ return reliableTrDimensionsVal;
6333
6590
  }
6334
6591
  } );
6335
6592
  } )();
@@ -6337,6 +6594,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6337
6594
 
6338
6595
  function curCSS( elem, name, computed ) {
6339
6596
  var width, minWidth, maxWidth, ret,
6597
+ isCustomProp = rcustomProp.test( name ),
6340
6598
 
6341
6599
  // Support: Firefox 51+
6342
6600
  // Retrieving style before computed somehow
@@ -6347,11 +6605,22 @@ function curCSS( elem, name, computed ) {
6347
6605
  computed = computed || getStyles( elem );
6348
6606
 
6349
6607
  // getPropertyValue is needed for:
6350
- // .css('filter') (IE 9 only, #12537)
6351
- // .css('--customProperty) (#3144)
6608
+ // .css('filter') (IE 9 only, trac-12537)
6609
+ // .css('--customProperty) (gh-3144)
6352
6610
  if ( computed ) {
6353
6611
  ret = computed.getPropertyValue( name ) || computed[ name ];
6354
6612
 
6613
+ // trim whitespace for custom property (issue gh-4926)
6614
+ if ( isCustomProp ) {
6615
+
6616
+ // rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
6617
+ // as whitespace while CSS does not, but this is not a problem
6618
+ // because CSS preprocessing replaces them with U+000A LINE FEED
6619
+ // (which *is* CSS whitespace)
6620
+ // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
6621
+ ret = ret.replace( rtrimCSS, "$1" );
6622
+ }
6623
+
6355
6624
  if ( ret === "" && !isAttached( elem ) ) {
6356
6625
  ret = jQuery.style( elem, name );
6357
6626
  }
@@ -6447,14 +6716,13 @@ var
6447
6716
  // except "table", "table-cell", or "table-caption"
6448
6717
  // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6449
6718
  rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6450
- rcustomProp = /^--/,
6451
6719
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6452
6720
  cssNormalTransform = {
6453
6721
  letterSpacing: "0",
6454
6722
  fontWeight: "400"
6455
6723
  };
6456
6724
 
6457
- function setPositiveNumber( elem, value, subtract ) {
6725
+ function setPositiveNumber( _elem, value, subtract ) {
6458
6726
 
6459
6727
  // Any relative (+/-) values have already been
6460
6728
  // normalized at this point
@@ -6559,17 +6827,26 @@ function getWidthOrHeight( elem, dimension, extra ) {
6559
6827
  }
6560
6828
 
6561
6829
 
6562
- // Fall back to offsetWidth/offsetHeight when value is "auto"
6563
- // This happens for inline elements with no explicit setting (gh-3571)
6564
- // Support: Android <=4.1 - 4.3 only
6565
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
6566
- // Support: IE 9-11 only
6567
- // Also use offsetWidth/offsetHeight for when box sizing is unreliable
6568
- // We use getClientRects() to check for hidden/disconnected.
6569
- // In those cases, the computed value can be trusted to be border-box
6830
+ // Support: IE 9 - 11 only
6831
+ // Use offsetWidth/offsetHeight for when box sizing is unreliable.
6832
+ // In those cases, the computed value can be trusted to be border-box.
6570
6833
  if ( ( !support.boxSizingReliable() && isBorderBox ||
6834
+
6835
+ // Support: IE 10 - 11+, Edge 15 - 18+
6836
+ // IE/Edge misreport `getComputedStyle` of table rows with width/height
6837
+ // set in CSS while `offset*` properties report correct values.
6838
+ // Interestingly, in some cases IE 9 doesn't suffer from this issue.
6839
+ !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
6840
+
6841
+ // Fall back to offsetWidth/offsetHeight when value is "auto"
6842
+ // This happens for inline elements with no explicit setting (gh-3571)
6571
6843
  val === "auto" ||
6844
+
6845
+ // Support: Android <=4.1 - 4.3 only
6846
+ // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
6572
6847
  !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
6848
+
6849
+ // Make sure the element is visible & connected
6573
6850
  elem.getClientRects().length ) {
6574
6851
 
6575
6852
  isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
@@ -6674,15 +6951,15 @@ jQuery.extend( {
6674
6951
  if ( value !== undefined ) {
6675
6952
  type = typeof value;
6676
6953
 
6677
- // Convert "+=" or "-=" to relative numbers (#7345)
6954
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
6678
6955
  if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6679
6956
  value = adjustCSS( elem, name, ret );
6680
6957
 
6681
- // Fixes bug #9237
6958
+ // Fixes bug trac-9237
6682
6959
  type = "number";
6683
6960
  }
6684
6961
 
6685
- // Make sure that null and NaN values aren't set (#7116)
6962
+ // Make sure that null and NaN values aren't set (trac-7116)
6686
6963
  if ( value == null || value !== value ) {
6687
6964
  return;
6688
6965
  }
@@ -6764,7 +7041,7 @@ jQuery.extend( {
6764
7041
  }
6765
7042
  } );
6766
7043
 
6767
- jQuery.each( [ "height", "width" ], function( i, dimension ) {
7044
+ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
6768
7045
  jQuery.cssHooks[ dimension ] = {
6769
7046
  get: function( elem, computed, extra ) {
6770
7047
  if ( computed ) {
@@ -6780,10 +7057,10 @@ jQuery.each( [ "height", "width" ], function( i, dimension ) {
6780
7057
  // Running getBoundingClientRect on a disconnected node
6781
7058
  // in IE throws an error.
6782
7059
  ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
6783
- swap( elem, cssShow, function() {
6784
- return getWidthOrHeight( elem, dimension, extra );
6785
- } ) :
6786
- getWidthOrHeight( elem, dimension, extra );
7060
+ swap( elem, cssShow, function() {
7061
+ return getWidthOrHeight( elem, dimension, extra );
7062
+ } ) :
7063
+ getWidthOrHeight( elem, dimension, extra );
6787
7064
  }
6788
7065
  },
6789
7066
 
@@ -6842,7 +7119,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6842
7119
  swap( elem, { marginLeft: 0 }, function() {
6843
7120
  return elem.getBoundingClientRect().left;
6844
7121
  } )
6845
- ) + "px";
7122
+ ) + "px";
6846
7123
  }
6847
7124
  }
6848
7125
  );
@@ -6981,7 +7258,7 @@ Tween.propHooks = {
6981
7258
  if ( jQuery.fx.step[ tween.prop ] ) {
6982
7259
  jQuery.fx.step[ tween.prop ]( tween );
6983
7260
  } else if ( tween.elem.nodeType === 1 && (
6984
- jQuery.cssHooks[ tween.prop ] ||
7261
+ jQuery.cssHooks[ tween.prop ] ||
6985
7262
  tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
6986
7263
  jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6987
7264
  } else {
@@ -7226,7 +7503,7 @@ function defaultPrefilter( elem, props, opts ) {
7226
7503
 
7227
7504
  anim.done( function() {
7228
7505
 
7229
- /* eslint-enable no-loop-func */
7506
+ /* eslint-enable no-loop-func */
7230
7507
 
7231
7508
  // The final step of a "hide" animation is actually hiding the element
7232
7509
  if ( !hidden ) {
@@ -7306,7 +7583,7 @@ function Animation( elem, properties, options ) {
7306
7583
  remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7307
7584
 
7308
7585
  // Support: Android 2.3 only
7309
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7586
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
7310
7587
  temp = remaining / animation.duration || 0,
7311
7588
  percent = 1 - temp,
7312
7589
  index = 0,
@@ -7346,7 +7623,7 @@ function Animation( elem, properties, options ) {
7346
7623
  tweens: [],
7347
7624
  createTween: function( prop, end ) {
7348
7625
  var tween = jQuery.Tween( elem, animation.opts, prop, end,
7349
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
7626
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
7350
7627
  animation.tweens.push( tween );
7351
7628
  return tween;
7352
7629
  },
@@ -7519,7 +7796,8 @@ jQuery.fn.extend( {
7519
7796
  anim.stop( true );
7520
7797
  }
7521
7798
  };
7522
- doAnimation.finish = doAnimation;
7799
+
7800
+ doAnimation.finish = doAnimation;
7523
7801
 
7524
7802
  return empty || optall.queue === false ?
7525
7803
  this.each( doAnimation ) :
@@ -7537,7 +7815,7 @@ jQuery.fn.extend( {
7537
7815
  clearQueue = type;
7538
7816
  type = undefined;
7539
7817
  }
7540
- if ( clearQueue && type !== false ) {
7818
+ if ( clearQueue ) {
7541
7819
  this.queue( type || "fx", [] );
7542
7820
  }
7543
7821
 
@@ -7620,7 +7898,7 @@ jQuery.fn.extend( {
7620
7898
  }
7621
7899
  } );
7622
7900
 
7623
- jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7901
+ jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
7624
7902
  var cssFn = jQuery.fn[ name ];
7625
7903
  jQuery.fn[ name ] = function( speed, easing, callback ) {
7626
7904
  return speed == null || typeof speed === "boolean" ?
@@ -7695,7 +7973,6 @@ jQuery.fx.speeds = {
7695
7973
 
7696
7974
 
7697
7975
  // Based off of the plugin by Clint Helfers, with permission.
7698
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7699
7976
  jQuery.fn.delay = function( time, type ) {
7700
7977
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7701
7978
  type = type || "fx";
@@ -7841,7 +8118,7 @@ boolHook = {
7841
8118
  }
7842
8119
  };
7843
8120
 
7844
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8121
+ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
7845
8122
  var getter = attrHandle[ name ] || jQuery.find.attr;
7846
8123
 
7847
8124
  attrHandle[ name ] = function( elem, name, isXML ) {
@@ -7920,8 +8197,7 @@ jQuery.extend( {
7920
8197
  // Support: IE <=9 - 11 only
7921
8198
  // elem.tabIndex doesn't always return the
7922
8199
  // correct value when it hasn't been explicitly set
7923
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7924
- // Use proper attribute retrieval(#12072)
8200
+ // Use proper attribute retrieval (trac-12072)
7925
8201
  var tabindex = jQuery.find.attr( elem, "tabindex" );
7926
8202
 
7927
8203
  if ( tabindex ) {
@@ -8025,8 +8301,7 @@ function classesToArray( value ) {
8025
8301
 
8026
8302
  jQuery.fn.extend( {
8027
8303
  addClass: function( value ) {
8028
- var classes, elem, cur, curValue, clazz, j, finalValue,
8029
- i = 0;
8304
+ var classNames, cur, curValue, className, i, finalValue;
8030
8305
 
8031
8306
  if ( isFunction( value ) ) {
8032
8307
  return this.each( function( j ) {
@@ -8034,36 +8309,35 @@ jQuery.fn.extend( {
8034
8309
  } );
8035
8310
  }
8036
8311
 
8037
- classes = classesToArray( value );
8312
+ classNames = classesToArray( value );
8038
8313
 
8039
- if ( classes.length ) {
8040
- while ( ( elem = this[ i++ ] ) ) {
8041
- curValue = getClass( elem );
8042
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8314
+ if ( classNames.length ) {
8315
+ return this.each( function() {
8316
+ curValue = getClass( this );
8317
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8043
8318
 
8044
8319
  if ( cur ) {
8045
- j = 0;
8046
- while ( ( clazz = classes[ j++ ] ) ) {
8047
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8048
- cur += clazz + " ";
8320
+ for ( i = 0; i < classNames.length; i++ ) {
8321
+ className = classNames[ i ];
8322
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
8323
+ cur += className + " ";
8049
8324
  }
8050
8325
  }
8051
8326
 
8052
8327
  // Only assign if different to avoid unneeded rendering.
8053
8328
  finalValue = stripAndCollapse( cur );
8054
8329
  if ( curValue !== finalValue ) {
8055
- elem.setAttribute( "class", finalValue );
8330
+ this.setAttribute( "class", finalValue );
8056
8331
  }
8057
8332
  }
8058
- }
8333
+ } );
8059
8334
  }
8060
8335
 
8061
8336
  return this;
8062
8337
  },
8063
8338
 
8064
8339
  removeClass: function( value ) {
8065
- var classes, elem, cur, curValue, clazz, j, finalValue,
8066
- i = 0;
8340
+ var classNames, cur, curValue, className, i, finalValue;
8067
8341
 
8068
8342
  if ( isFunction( value ) ) {
8069
8343
  return this.each( function( j ) {
@@ -8075,45 +8349,42 @@ jQuery.fn.extend( {
8075
8349
  return this.attr( "class", "" );
8076
8350
  }
8077
8351
 
8078
- classes = classesToArray( value );
8352
+ classNames = classesToArray( value );
8079
8353
 
8080
- if ( classes.length ) {
8081
- while ( ( elem = this[ i++ ] ) ) {
8082
- curValue = getClass( elem );
8354
+ if ( classNames.length ) {
8355
+ return this.each( function() {
8356
+ curValue = getClass( this );
8083
8357
 
8084
8358
  // This expression is here for better compressibility (see addClass)
8085
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8359
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8086
8360
 
8087
8361
  if ( cur ) {
8088
- j = 0;
8089
- while ( ( clazz = classes[ j++ ] ) ) {
8362
+ for ( i = 0; i < classNames.length; i++ ) {
8363
+ className = classNames[ i ];
8090
8364
 
8091
8365
  // Remove *all* instances
8092
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8093
- cur = cur.replace( " " + clazz + " ", " " );
8366
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
8367
+ cur = cur.replace( " " + className + " ", " " );
8094
8368
  }
8095
8369
  }
8096
8370
 
8097
8371
  // Only assign if different to avoid unneeded rendering.
8098
8372
  finalValue = stripAndCollapse( cur );
8099
8373
  if ( curValue !== finalValue ) {
8100
- elem.setAttribute( "class", finalValue );
8374
+ this.setAttribute( "class", finalValue );
8101
8375
  }
8102
8376
  }
8103
- }
8377
+ } );
8104
8378
  }
8105
8379
 
8106
8380
  return this;
8107
8381
  },
8108
8382
 
8109
8383
  toggleClass: function( value, stateVal ) {
8110
- var type = typeof value,
8384
+ var classNames, className, i, self,
8385
+ type = typeof value,
8111
8386
  isValidValue = type === "string" || Array.isArray( value );
8112
8387
 
8113
- if ( typeof stateVal === "boolean" && isValidValue ) {
8114
- return stateVal ? this.addClass( value ) : this.removeClass( value );
8115
- }
8116
-
8117
8388
  if ( isFunction( value ) ) {
8118
8389
  return this.each( function( i ) {
8119
8390
  jQuery( this ).toggleClass(
@@ -8123,17 +8394,20 @@ jQuery.fn.extend( {
8123
8394
  } );
8124
8395
  }
8125
8396
 
8126
- return this.each( function() {
8127
- var className, i, self, classNames;
8397
+ if ( typeof stateVal === "boolean" && isValidValue ) {
8398
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
8399
+ }
8400
+
8401
+ classNames = classesToArray( value );
8128
8402
 
8403
+ return this.each( function() {
8129
8404
  if ( isValidValue ) {
8130
8405
 
8131
8406
  // Toggle individual class names
8132
- i = 0;
8133
8407
  self = jQuery( this );
8134
- classNames = classesToArray( value );
8135
8408
 
8136
- while ( ( className = classNames[ i++ ] ) ) {
8409
+ for ( i = 0; i < classNames.length; i++ ) {
8410
+ className = classNames[ i ];
8137
8411
 
8138
8412
  // Check each className given, space separated list
8139
8413
  if ( self.hasClass( className ) ) {
@@ -8159,8 +8433,8 @@ jQuery.fn.extend( {
8159
8433
  if ( this.setAttribute ) {
8160
8434
  this.setAttribute( "class",
8161
8435
  className || value === false ?
8162
- "" :
8163
- dataPriv.get( this, "__className__" ) || ""
8436
+ "" :
8437
+ dataPriv.get( this, "__className__" ) || ""
8164
8438
  );
8165
8439
  }
8166
8440
  }
@@ -8175,7 +8449,7 @@ jQuery.fn.extend( {
8175
8449
  while ( ( elem = this[ i++ ] ) ) {
8176
8450
  if ( elem.nodeType === 1 &&
8177
8451
  ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
8178
- return true;
8452
+ return true;
8179
8453
  }
8180
8454
  }
8181
8455
 
@@ -8267,7 +8541,7 @@ jQuery.extend( {
8267
8541
  val :
8268
8542
 
8269
8543
  // Support: IE <=10 - 11 only
8270
- // option.text throws exceptions (#14686, #14858)
8544
+ // option.text throws exceptions (trac-14686, trac-14858)
8271
8545
  // Strip and collapse whitespace
8272
8546
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8273
8547
  stripAndCollapse( jQuery.text( elem ) );
@@ -8294,7 +8568,7 @@ jQuery.extend( {
8294
8568
  option = options[ i ];
8295
8569
 
8296
8570
  // Support: IE <=9 only
8297
- // IE8-9 doesn't update selected after form reset (#2551)
8571
+ // IE8-9 doesn't update selected after form reset (trac-2551)
8298
8572
  if ( ( option.selected || i === index ) &&
8299
8573
 
8300
8574
  // Don't return options that are disabled or in a disabled optgroup
@@ -8437,8 +8711,8 @@ jQuery.extend( jQuery.event, {
8437
8711
  return;
8438
8712
  }
8439
8713
 
8440
- // Determine event propagation path in advance, per W3C events spec (#9951)
8441
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8714
+ // Determine event propagation path in advance, per W3C events spec (trac-9951)
8715
+ // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
8442
8716
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8443
8717
 
8444
8718
  bubbleType = special.delegateType || type;
@@ -8465,7 +8739,7 @@ jQuery.extend( jQuery.event, {
8465
8739
  special.bindType || type;
8466
8740
 
8467
8741
  // jQuery handler
8468
- handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
8742
+ handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
8469
8743
  dataPriv.get( cur, "handle" );
8470
8744
  if ( handle ) {
8471
8745
  handle.apply( cur, data );
@@ -8490,7 +8764,7 @@ jQuery.extend( jQuery.event, {
8490
8764
  acceptData( elem ) ) {
8491
8765
 
8492
8766
  // Call a native DOM method on the target with the same name as the event.
8493
- // Don't do default actions on window, that's where global variables be (#6170)
8767
+ // Don't do default actions on window, that's where global variables be (trac-6170)
8494
8768
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8495
8769
 
8496
8770
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -8576,7 +8850,10 @@ if ( !support.focusin ) {
8576
8850
 
8577
8851
  jQuery.event.special[ fix ] = {
8578
8852
  setup: function() {
8579
- var doc = this.ownerDocument || this,
8853
+
8854
+ // Handle: regular nodes (via `this.ownerDocument`), window
8855
+ // (via `this.document`) & document (via `this`).
8856
+ var doc = this.ownerDocument || this.document || this,
8580
8857
  attaches = dataPriv.access( doc, fix );
8581
8858
 
8582
8859
  if ( !attaches ) {
@@ -8585,7 +8862,7 @@ if ( !support.focusin ) {
8585
8862
  dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8586
8863
  },
8587
8864
  teardown: function() {
8588
- var doc = this.ownerDocument || this,
8865
+ var doc = this.ownerDocument || this.document || this,
8589
8866
  attaches = dataPriv.access( doc, fix ) - 1;
8590
8867
 
8591
8868
  if ( !attaches ) {
@@ -8601,7 +8878,7 @@ if ( !support.focusin ) {
8601
8878
  }
8602
8879
  var location = window.location;
8603
8880
 
8604
- var nonce = Date.now();
8881
+ var nonce = { guid: Date.now() };
8605
8882
 
8606
8883
  var rquery = ( /\?/ );
8607
8884
 
@@ -8609,7 +8886,7 @@ var rquery = ( /\?/ );
8609
8886
 
8610
8887
  // Cross-browser xml parsing
8611
8888
  jQuery.parseXML = function( data ) {
8612
- var xml;
8889
+ var xml, parserErrorElem;
8613
8890
  if ( !data || typeof data !== "string" ) {
8614
8891
  return null;
8615
8892
  }
@@ -8618,12 +8895,17 @@ jQuery.parseXML = function( data ) {
8618
8895
  // IE throws on parseFromString with invalid input.
8619
8896
  try {
8620
8897
  xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8621
- } catch ( e ) {
8622
- xml = undefined;
8623
- }
8898
+ } catch ( e ) {}
8624
8899
 
8625
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8626
- jQuery.error( "Invalid XML: " + data );
8900
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
8901
+ if ( !xml || parserErrorElem ) {
8902
+ jQuery.error( "Invalid XML: " + (
8903
+ parserErrorElem ?
8904
+ jQuery.map( parserErrorElem.childNodes, function( el ) {
8905
+ return el.textContent;
8906
+ } ).join( "\n" ) :
8907
+ data
8908
+ ) );
8627
8909
  }
8628
8910
  return xml;
8629
8911
  };
@@ -8724,16 +9006,14 @@ jQuery.fn.extend( {
8724
9006
  // Can add propHook for "elements" to filter or add form elements
8725
9007
  var elements = jQuery.prop( this, "elements" );
8726
9008
  return elements ? jQuery.makeArray( elements ) : this;
8727
- } )
8728
- .filter( function() {
9009
+ } ).filter( function() {
8729
9010
  var type = this.type;
8730
9011
 
8731
9012
  // Use .is( ":disabled" ) so that fieldset[disabled] works
8732
9013
  return this.name && !jQuery( this ).is( ":disabled" ) &&
8733
9014
  rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8734
9015
  ( this.checked || !rcheckableType.test( type ) );
8735
- } )
8736
- .map( function( i, elem ) {
9016
+ } ).map( function( _i, elem ) {
8737
9017
  var val = jQuery( this ).val();
8738
9018
 
8739
9019
  if ( val == null ) {
@@ -8758,7 +9038,7 @@ var
8758
9038
  rantiCache = /([?&])_=[^&]*/,
8759
9039
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8760
9040
 
8761
- // #7653, #8125, #8152: local protocol detection
9041
+ // trac-7653, trac-8125, trac-8152: local protocol detection
8762
9042
  rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8763
9043
  rnoContent = /^(?:GET|HEAD)$/,
8764
9044
  rprotocol = /^\/\//,
@@ -8781,12 +9061,13 @@ var
8781
9061
  */
8782
9062
  transports = {},
8783
9063
 
8784
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
9064
+ // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
8785
9065
  allTypes = "*/".concat( "*" ),
8786
9066
 
8787
9067
  // Anchor tag for parsing the document origin
8788
9068
  originAnchor = document.createElement( "a" );
8789
- originAnchor.href = location.href;
9069
+
9070
+ originAnchor.href = location.href;
8790
9071
 
8791
9072
  // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8792
9073
  function addToPrefiltersOrTransports( structure ) {
@@ -8851,7 +9132,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
8851
9132
 
8852
9133
  // A special extend for ajax options
8853
9134
  // that takes "flat" options (not to be deep extended)
8854
- // Fixes #9887
9135
+ // Fixes trac-9887
8855
9136
  function ajaxExtend( target, src ) {
8856
9137
  var key, deep,
8857
9138
  flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9167,8 +9448,8 @@ jQuery.extend( {
9167
9448
  // Context for global events is callbackContext if it is a DOM node or jQuery collection
9168
9449
  globalEventContext = s.context &&
9169
9450
  ( callbackContext.nodeType || callbackContext.jquery ) ?
9170
- jQuery( callbackContext ) :
9171
- jQuery.event,
9451
+ jQuery( callbackContext ) :
9452
+ jQuery.event,
9172
9453
 
9173
9454
  // Deferreds
9174
9455
  deferred = jQuery.Deferred(),
@@ -9262,12 +9543,12 @@ jQuery.extend( {
9262
9543
  deferred.promise( jqXHR );
9263
9544
 
9264
9545
  // Add protocol if not provided (prefilters might expect it)
9265
- // Handle falsy url in the settings object (#10093: consistency with old signature)
9546
+ // Handle falsy url in the settings object (trac-10093: consistency with old signature)
9266
9547
  // We also use the url parameter if available
9267
9548
  s.url = ( ( url || s.url || location.href ) + "" )
9268
9549
  .replace( rprotocol, location.protocol + "//" );
9269
9550
 
9270
- // Alias method option to type as per ticket #12004
9551
+ // Alias method option to type as per ticket trac-12004
9271
9552
  s.type = options.method || options.type || s.method || s.type;
9272
9553
 
9273
9554
  // Extract dataTypes list
@@ -9310,7 +9591,7 @@ jQuery.extend( {
9310
9591
  }
9311
9592
 
9312
9593
  // We can fire global events as of now if asked to
9313
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9594
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
9314
9595
  fireGlobals = jQuery.event && s.global;
9315
9596
 
9316
9597
  // Watch for a new set of requests
@@ -9339,14 +9620,15 @@ jQuery.extend( {
9339
9620
  if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9340
9621
  cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9341
9622
 
9342
- // #9682: remove data so that it's not used in an eventual retry
9623
+ // trac-9682: remove data so that it's not used in an eventual retry
9343
9624
  delete s.data;
9344
9625
  }
9345
9626
 
9346
9627
  // Add or update anti-cache param if needed
9347
9628
  if ( s.cache === false ) {
9348
9629
  cacheURL = cacheURL.replace( rantiCache, "$1" );
9349
- uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
9630
+ uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
9631
+ uncached;
9350
9632
  }
9351
9633
 
9352
9634
  // Put hash and anti-cache on the URL that will be requested (gh-1732)
@@ -9479,6 +9761,13 @@ jQuery.extend( {
9479
9761
  response = ajaxHandleResponses( s, jqXHR, responses );
9480
9762
  }
9481
9763
 
9764
+ // Use a noop converter for missing script but not if jsonp
9765
+ if ( !isSuccess &&
9766
+ jQuery.inArray( "script", s.dataTypes ) > -1 &&
9767
+ jQuery.inArray( "json", s.dataTypes ) < 0 ) {
9768
+ s.converters[ "text script" ] = function() {};
9769
+ }
9770
+
9482
9771
  // Convert no matter what (that way responseXXX fields are always set)
9483
9772
  response = ajaxConvert( s, response, jqXHR, isSuccess );
9484
9773
 
@@ -9569,7 +9858,7 @@ jQuery.extend( {
9569
9858
  }
9570
9859
  } );
9571
9860
 
9572
- jQuery.each( [ "get", "post" ], function( i, method ) {
9861
+ jQuery.each( [ "get", "post" ], function( _i, method ) {
9573
9862
  jQuery[ method ] = function( url, data, callback, type ) {
9574
9863
 
9575
9864
  // Shift arguments if data argument was omitted
@@ -9590,12 +9879,21 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
9590
9879
  };
9591
9880
  } );
9592
9881
 
9882
+ jQuery.ajaxPrefilter( function( s ) {
9883
+ var i;
9884
+ for ( i in s.headers ) {
9885
+ if ( i.toLowerCase() === "content-type" ) {
9886
+ s.contentType = s.headers[ i ] || "";
9887
+ }
9888
+ }
9889
+ } );
9890
+
9593
9891
 
9594
- jQuery._evalUrl = function( url, options ) {
9892
+ jQuery._evalUrl = function( url, options, doc ) {
9595
9893
  return jQuery.ajax( {
9596
9894
  url: url,
9597
9895
 
9598
- // Make this explicit, since user can override this through ajaxSetup (#11264)
9896
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
9599
9897
  type: "GET",
9600
9898
  dataType: "script",
9601
9899
  cache: true,
@@ -9609,7 +9907,7 @@ jQuery._evalUrl = function( url, options ) {
9609
9907
  "text script": function() {}
9610
9908
  },
9611
9909
  dataFilter: function( response ) {
9612
- jQuery.globalEval( response, options );
9910
+ jQuery.globalEval( response, options, doc );
9613
9911
  }
9614
9912
  } );
9615
9913
  };
@@ -9704,7 +10002,7 @@ var xhrSuccessStatus = {
9704
10002
  0: 200,
9705
10003
 
9706
10004
  // Support: IE <=9 only
9707
- // #1450: sometimes IE returns 1223 when it should be 204
10005
+ // trac-1450: sometimes IE returns 1223 when it should be 204
9708
10006
  1223: 204
9709
10007
  },
9710
10008
  xhrSupported = jQuery.ajaxSettings.xhr();
@@ -9776,7 +10074,7 @@ jQuery.ajaxTransport( function( options ) {
9776
10074
  } else {
9777
10075
  complete(
9778
10076
 
9779
- // File: protocol always yields status 0; see #8605, #14207
10077
+ // File: protocol always yields status 0; see trac-8605, trac-14207
9780
10078
  xhr.status,
9781
10079
  xhr.statusText
9782
10080
  );
@@ -9837,7 +10135,7 @@ jQuery.ajaxTransport( function( options ) {
9837
10135
  xhr.send( options.hasContent && options.data || null );
9838
10136
  } catch ( e ) {
9839
10137
 
9840
- // #14683: Only rethrow if this hasn't been notified as an error yet
10138
+ // trac-14683: Only rethrow if this hasn't been notified as an error yet
9841
10139
  if ( callback ) {
9842
10140
  throw e;
9843
10141
  }
@@ -9931,7 +10229,7 @@ var oldCallbacks = [],
9931
10229
  jQuery.ajaxSetup( {
9932
10230
  jsonp: "callback",
9933
10231
  jsonpCallback: function() {
9934
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
10232
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
9935
10233
  this[ callback ] = true;
9936
10234
  return callback;
9937
10235
  }
@@ -10148,23 +10446,6 @@ jQuery.fn.load = function( url, params, callback ) {
10148
10446
 
10149
10447
 
10150
10448
 
10151
- // Attach a bunch of functions for handling common AJAX events
10152
- jQuery.each( [
10153
- "ajaxStart",
10154
- "ajaxStop",
10155
- "ajaxComplete",
10156
- "ajaxError",
10157
- "ajaxSuccess",
10158
- "ajaxSend"
10159
- ], function( i, type ) {
10160
- jQuery.fn[ type ] = function( fn ) {
10161
- return this.on( type, fn );
10162
- };
10163
- } );
10164
-
10165
-
10166
-
10167
-
10168
10449
  jQuery.expr.pseudos.animated = function( elem ) {
10169
10450
  return jQuery.grep( jQuery.timers, function( fn ) {
10170
10451
  return elem === fn.elem;
@@ -10371,7 +10652,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
10371
10652
  // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
10372
10653
  // getComputedStyle returns percent when specified for top/left/bottom/right;
10373
10654
  // rather than make the css module depend on the offset module, just check for it here
10374
- jQuery.each( [ "top", "left" ], function( i, prop ) {
10655
+ jQuery.each( [ "top", "left" ], function( _i, prop ) {
10375
10656
  jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10376
10657
  function( elem, computed ) {
10377
10658
  if ( computed ) {
@@ -10389,8 +10670,11 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
10389
10670
 
10390
10671
  // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10391
10672
  jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10392
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10393
- function( defaultExtra, funcName ) {
10673
+ jQuery.each( {
10674
+ padding: "inner" + name,
10675
+ content: type,
10676
+ "": "outer" + name
10677
+ }, function( defaultExtra, funcName ) {
10394
10678
 
10395
10679
  // Margin is only for outerHeight, outerWidth
10396
10680
  jQuery.fn[ funcName ] = function( margin, value ) {
@@ -10434,25 +10718,19 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10434
10718
  } );
10435
10719
 
10436
10720
 
10437
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10438
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10439
- "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10440
- function( i, name ) {
10441
-
10442
- // Handle event binding
10443
- jQuery.fn[ name ] = function( data, fn ) {
10444
- return arguments.length > 0 ?
10445
- this.on( name, null, data, fn ) :
10446
- this.trigger( name );
10721
+ jQuery.each( [
10722
+ "ajaxStart",
10723
+ "ajaxStop",
10724
+ "ajaxComplete",
10725
+ "ajaxError",
10726
+ "ajaxSuccess",
10727
+ "ajaxSend"
10728
+ ], function( _i, type ) {
10729
+ jQuery.fn[ type ] = function( fn ) {
10730
+ return this.on( type, fn );
10447
10731
  };
10448
10732
  } );
10449
10733
 
10450
- jQuery.fn.extend( {
10451
- hover: function( fnOver, fnOut ) {
10452
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
10453
- }
10454
- } );
10455
-
10456
10734
 
10457
10735
 
10458
10736
 
@@ -10474,9 +10752,37 @@ jQuery.fn.extend( {
10474
10752
  return arguments.length === 1 ?
10475
10753
  this.off( selector, "**" ) :
10476
10754
  this.off( types, selector || "**", fn );
10755
+ },
10756
+
10757
+ hover: function( fnOver, fnOut ) {
10758
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
10477
10759
  }
10478
10760
  } );
10479
10761
 
10762
+ jQuery.each(
10763
+ ( "blur focus focusin focusout resize scroll click dblclick " +
10764
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10765
+ "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10766
+ function( _i, name ) {
10767
+
10768
+ // Handle event binding
10769
+ jQuery.fn[ name ] = function( data, fn ) {
10770
+ return arguments.length > 0 ?
10771
+ this.on( name, null, data, fn ) :
10772
+ this.trigger( name );
10773
+ };
10774
+ }
10775
+ );
10776
+
10777
+
10778
+
10779
+
10780
+ // Support: Android <=4.0 only
10781
+ // Make sure we trim BOM and NBSP
10782
+ // Require that the "whitespace run" starts from a non-whitespace
10783
+ // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
10784
+ var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
10785
+
10480
10786
  // Bind a function to a context, optionally partially applying any
10481
10787
  // arguments.
10482
10788
  // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
@@ -10539,6 +10845,11 @@ jQuery.isNumeric = function( obj ) {
10539
10845
  !isNaN( obj - parseFloat( obj ) );
10540
10846
  };
10541
10847
 
10848
+ jQuery.trim = function( text ) {
10849
+ return text == null ?
10850
+ "" :
10851
+ ( text + "" ).replace( rtrim, "$1" );
10852
+ };
10542
10853
 
10543
10854
 
10544
10855
 
@@ -10585,9 +10896,9 @@ jQuery.noConflict = function( deep ) {
10585
10896
  };
10586
10897
 
10587
10898
  // Expose jQuery and $ identifiers, even in AMD
10588
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10589
- // and CommonJS for browser emulators (#13566)
10590
- if ( !noGlobal ) {
10899
+ // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
10900
+ // and CommonJS for browser emulators (trac-13566)
10901
+ if ( typeof noGlobal === "undefined" ) {
10591
10902
  window.jQuery = window.$ = jQuery;
10592
10903
  }
10593
10904