Facebook
From golab, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 81
  1. /*!
  2.  * jQuery JavaScript Library v3.6.1
  3.  * https://jquery.com/
  4.  *
  5.  * Includes Sizzle.js
  6.  * https://sizzlejs.com/
  7.  *
  8.  * Copyright OpenJS Foundation and other contributors
  9.  * Released under the MIT license
  10.  * https://jquery.org/license
  11.  *
  12.  * Date: 2022-08-26T17:52Z
  13.  */
  14. ( function( global, factory ) {
  15.  
  16.         "use strict";
  17.  
  18.         if ( typeof module === "object" && typeof module.exports === "object" ) {
  19.  
  20.                 // For CommonJS and CommonJS-like environments where a proper `window`
  21.                 // is present, execute the factory and get jQuery.
  22.                 // For environments that do not have a `window` with a `document`
  23.                 // (such as Node.js), expose a factory as module.exports.
  24.                 // This accentuates the need for the creation of a real `window`.
  25.                 // e.g. var jQuery = require("jquery")(window);
  26.                 // See ticket trac-14549 for more info.
  27.                 module.exports = global.document ?
  28.                         factory( global, true ) :
  29.                         function( w ) {
  30.                                 if ( !w.document ) {
  31.                                         throw new Error( "jQuery requires a window with a document" );
  32.                                 }
  33.                                 return factory( w );
  34.                         };
  35.         } else {
  36.                 factory( global );
  37.         }
  38.  
  39. // Pass this if window is not defined yet
  40. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  41.  
  42. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  43. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  44. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  45. // enough that all such attempts are guarded in a try block.
  46. "use strict";
  47.  
  48. var arr = [];
  49.  
  50. var getProto = Object.getPrototypeOf;
  51.  
  52. var slice = arr.slice;
  53.  
  54. var flat = arr.flat ? function( array ) {
  55.         return arr.flat.call( array );
  56. } : function( array ) {
  57.         return arr.concat.apply( [], array );
  58. };
  59.  
  60.  
  61. var push = arr.push;
  62.  
  63. var indexOf = arr.indexOf;
  64.  
  65. var class2type = {};
  66.  
  67. var toString = class2type.toString;
  68.  
  69. var hasOwn = class2type.hasOwnProperty;
  70.  
  71. var fnToString = hasOwn.toString;
  72.  
  73. var ObjectFunctionString = fnToString.call( Object );
  74.  
  75. var support = {};
  76.  
  77. var isFunction = function isFunction( obj ) {
  78.  
  79.                 // Support: Chrome <=57, Firefox <=52
  80.                 // In some browsers, typeof returns "function" for HTML <object> elements
  81.                 // (i.e., `typeof document.createElement( "object" ) === "function"`).
  82.                 // We don't want to classify *any* DOM node as a function.
  83.                 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
  84.                 // Plus for old WebKit, typeof returns "function" for HTML collections
  85.                 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
  86.                 return typeof obj === "function" && typeof obj.nodeType !== "number" &&
  87.                         typeof obj.item !== "function";
  88.         };
  89.  
  90.  
  91. var isWindow = function isWindow( obj ) {
  92.                 return obj != null && obj === obj.window;
  93.         };
  94.  
  95.  
  96. var document = window.document;
  97.  
  98.  
  99.  
  100.         var preservedScriptAttributes = {
  101.                 type: true,
  102.                 src: true,
  103.                 nonce: true,
  104.                 noModule: true
  105.         };
  106.  
  107.         function DOMEval( code, node, doc ) {
  108.                 doc = doc || document;
  109.  
  110.                 var i, val,
  111.                         script = doc.createElement( "script" );
  112.  
  113.                 script.text = code;
  114.                 if ( node ) {
  115.                         for ( i in preservedScriptAttributes ) {
  116.  
  117.                                 // Support: Firefox 64+, Edge 18+
  118.                                 // Some browsers don't support the "nonce" property on scripts.
  119.                                 // On the other hand, just using `getAttribute` is not enough as
  120.                                 // the `nonce` attribute is reset to an empty string whenever it
  121.                                 // becomes browsing-context connected.
  122.                                 // See https://github.com/whatwg/html/issues/2369
  123.                                 // See https://html.spec.whatwg.org/#nonce-attributes
  124.                                 // The `node.getAttribute` check was added for the sake of
  125.                                 // `jQuery.globalEval` so that it can fake a nonce-containing node
  126.                                 // via an object.
  127.                                 val = node[ i ] || node.getAttribute && node.getAttribute( i );
  128.                                 if ( val ) {
  129.                                         script.setAttribute( i, val );
  130.                                 }
  131.                         }
  132.                 }
  133.                 doc.head.appendChild( script ).parentNode.removeChild( script );
  134.         }
  135.  
  136.  
  137. function toType( obj ) {
  138.         if ( obj == null ) {
  139.                 return obj + "";
  140.         }
  141.  
  142.         // Support: Android <=2.3 only (functionish RegExp)
  143.         return typeof obj === "object" || typeof obj === "function" ?
  144.                 class2type[ toString.call( obj ) ] || "object" :
  145.                 typeof obj;
  146. }
  147. /* global Symbol */
  148. // Defining this global in .eslintrc.json would create a danger of using the global
  149. // unguarded in another place, it seems safer to define global only for this module
  150.  
  151.  
  152.  
  153. var
  154.         version = "3.6.1",
  155.  
  156.         // Define a local copy of jQuery
  157.         jQuery = function( selector, context ) {
  158.  
  159.                 // The jQuery object is actually just the init constructor 'enhanced'
  160.                 // Need init if jQuery is called (just allow error to be thrown if not included)
  161.                 return new jQuery.fn.init( selector, context );
  162.         };
  163.  
  164. jQuery.fn = jQuery.prototype = {
  165.  
  166.         // The current version of jQuery being used
  167.         jquery: version,
  168.  
  169.         constructor: jQuery,
  170.  
  171.         // The default length of a jQuery object is 0
  172.         length: 0,
  173.  
  174.         toArray: function() {
  175.                 return slice.call( this );
  176.         },
  177.  
  178.         // Get the Nth element in the matched element set OR
  179.         // Get the whole matched element set as a clean array
  180.         get: function( num ) {
  181.  
  182.                 // Return all the elements in a clean array
  183.                 if ( num == null ) {
  184.                         return slice.call( this );
  185.                 }
  186.  
  187.                 // Return just the one element from the set
  188.                 return num < 0 ? this[ num + this.length ] : this[ num ];
  189.         },
  190.  
  191.         // Take an array of elements and push it onto the stack
  192.         // (returning the new matched element set)
  193.         pushStack: function( elems ) {
  194.  
  195.                 // Build a new jQuery matched element set
  196.                 var ret = jQuery.merge( this.constructor(), elems );
  197.  
  198.                 // Add the old object onto the stack (as a reference)
  199.                 ret.prevObject = this;
  200.  
  201.                 // Return the newly-formed element set
  202.                 return ret;
  203.         },
  204.  
  205.         // Execute a callback for every element in the matched set.
  206.         each: function( callback ) {
  207.                 return jQuery.each( this, callback );
  208.         },
  209.  
  210.         map: function( callback ) {
  211.                 return this.pushStack( jQuery.map( this, function( elem, i ) {
  212.                         return callback.call( elem, i, elem );
  213.                 } ) );
  214.         },
  215.  
  216.         slice: function() {
  217.                 return this.pushStack( slice.apply( this, arguments ) );
  218.         },
  219.  
  220.         first: function() {
  221.                 return this.eq( 0 );
  222.         },
  223.  
  224.         last: function() {
  225.                 return this.eq( -1 );
  226.         },
  227.  
  228.         even: function() {
  229.                 return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  230.                         return ( i + 1 ) % 2;
  231.                 } ) );
  232.         },
  233.  
  234.         odd: function() {
  235.                 return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  236.                         return i % 2;
  237.                 } ) );
  238.         },
  239.  
  240.         eq: function( i ) {
  241.                 var len = this.length,
  242.                         j = +i + ( i < 0 ? len : 0 );
  243.                 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  244.         },
  245.  
  246.         end: function() {
  247.                 return this.prevObject || this.constructor();
  248.         },
  249.  
  250.         // For internal use only.
  251.         // Behaves like an Array's method, not like a jQuery method.
  252.         push: push,
  253.         sort: arr.sort,
  254.         splice: arr.splice
  255. };
  256.  
  257. jQuery.extend = jQuery.fn.extend = function() {
  258.         var options, name, src, copy, copyIsArray, clone,
  259.                 target = arguments[ 0 ] || {},
  260.                 i = 1,
  261.                 length = arguments.length,
  262.                 deep = false;
  263.  
  264.         // Handle a deep copy situation
  265.         if ( typeof target === "boolean" ) {
  266.                 deep = target;
  267.  
  268.                 // Skip the boolean and the target
  269.                 target = arguments[ i ] || {};
  270.                 i++;
  271.         }
  272.  
  273.         // Handle case when target is a string or something (possible in deep copy)
  274.         if ( typeof target !== "object" && !isFunction( target ) ) {
  275.                 target = {};
  276.         }
  277.  
  278.         // Extend jQuery itself if only one argument is passed
  279.         if ( i === length ) {
  280.                 target = this;
  281.                 i--;
  282.         }
  283.  
  284.         for ( ; i < length; i++ ) {
  285.  
  286.                 // Only deal with non-null/undefined values
  287.                 if ( ( options = arguments[ i ] ) != null ) {
  288.  
  289.                         // Extend the base object
  290.                         for ( name in options ) {
  291.                                 copy = options[ name ];
  292.  
  293.                                 // Prevent Object.prototype pollution
  294.                                 // Prevent never-ending loop
  295.                                 if ( name === "__proto__" || target === copy ) {
  296.                                         continue;
  297.                                 }
  298.  
  299.                                 // Recurse if we're merging plain objects or arrays
  300.                                 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  301.                                         ( copyIsArray = Array.isArray( copy ) ) ) ) {
  302.                                         src = target[ name ];
  303.  
  304.                                         // Ensure proper type for the source value
  305.                                         if ( copyIsArray && !Array.isArray( src ) ) {
  306.                                                 clone = [];
  307.                                         } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  308.                                                 clone = {};
  309.                                         } else {
  310.                                                 clone = src;
  311.                                         }
  312.                                         copyIsArray = false;
  313.  
  314.                                         // Never move original objects, clone them
  315.                                         target[ name ] = jQuery.extend( deep, clone, copy );
  316.  
  317.                                 // Don't bring in undefined values
  318.                                 } else if ( copy !== undefined ) {
  319.                                         target[ name ] = copy;
  320.                                 }
  321.                         }
  322.                 }
  323.         }
  324.  
  325.         // Return the modified object
  326.         return target;
  327. };
  328.  
  329. jQuery.extend( {
  330.  
  331.         // Unique for each copy of jQuery on the page
  332.         expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  333.  
  334.         // Assume jQuery is ready without the ready module
  335.         isReady: true,
  336.  
  337.         error: function( msg ) {
  338.                 throw new Error( msg );
  339.         },
  340.  
  341.         noop: function() {},
  342.  
  343.         isPlainObject: function( obj ) {
  344.                 var proto, Ctor;
  345.  
  346.                 // Detect obvious negatives
  347.                 // Use toString instead of jQuery.type to catch host objects
  348.                 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  349.                         return false;
  350.                 }
  351.  
  352.                 proto = getProto( obj );
  353.  
  354.                 // Objects with no prototype (e.g., `Object.create( null )`) are plain
  355.                 if ( !proto ) {
  356.                         return true;
  357.                 }
  358.  
  359.                 // Objects with prototype are plain iff they were constructed by a global Object function
  360.                 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  361.                 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  362.         },
  363.  
  364.         isEmptyObject: function( obj ) {
  365.                 var name;
  366.  
  367.                 for ( name in obj ) {
  368.                         return false;
  369.                 }
  370.                 return true;
  371.         },
  372.  
  373.         // Evaluates a script in a provided context; falls back to the global one
  374.         // if not specified.
  375.         globalEval: function( code, options, doc ) {
  376.                 DOMEval( code, { nonce: options && options.nonce }, doc );
  377.         },
  378.  
  379.         each: function( obj, callback ) {
  380.                 var length, i = 0;
  381.  
  382.                 if ( isArrayLike( obj ) ) {
  383.                         length = obj.length;
  384.                         for ( ; i < length; i++ ) {
  385.                                 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  386.                                         break;
  387.                                 }
  388.                         }
  389.                 } else {
  390.                         for ( i in obj ) {
  391.                                 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  392.                                         break;
  393.                                 }
  394.                         }
  395.                 }
  396.  
  397.                 return obj;
  398.         },
  399.  
  400.         // results is for internal usage only
  401.         makeArray: function( arr, results ) {
  402.                 var ret = results || [];
  403.  
  404.                 if ( arr != null ) {
  405.                         if ( isArrayLike( Object( arr ) ) ) {
  406.                                 jQuery.merge( ret,
  407.                                         typeof arr === "string" ?
  408.                                                 [ arr ] : arr
  409.                                 );
  410.                         } else {
  411.                                 push.call( ret, arr );
  412.                         }
  413.                 }
  414.  
  415.                 return ret;
  416.         },
  417.  
  418.         inArray: function( elem, arr, i ) {
  419.                 return arr == null ? -1 : indexOf.call( arr, elem, i );
  420.         },
  421.  
  422.         // Support: Android <=4.0 only, PhantomJS 1 only
  423.         // push.apply(_, arraylike) throws on ancient WebKit
  424.         merge: function( first, second ) {
  425.                 var len = +second.length,
  426.                         j = 0,
  427.                         i = first.length;
  428.  
  429.                 for ( ; j < len; j++ ) {
  430.                         first[ i++ ] = second[ j ];
  431.                 }
  432.  
  433.                 first.length = i;
  434.  
  435.                 return first;
  436.         },
  437.  
  438.         grep: function( elems, callback, invert ) {
  439.                 var callbackInverse,
  440.                         matches = [],
  441.                         i = 0,
  442.                         length = elems.length,
  443.                         callbackExpect = !invert;
  444.  
  445.                 // Go through the array, only saving the items
  446.                 // that pass the validator function
  447.                 for ( ; i < length; i++ ) {
  448.                         callbackInverse = !callback( elems[ i ], i );
  449.                         if ( callbackInverse !== callbackExpect ) {
  450.                                 matches.push( elems[ i ] );
  451.                         }
  452.                 }
  453.  
  454.                 return matches;
  455.         },
  456.  
  457.         // arg is for internal usage only
  458.         map: function( elems, callback, arg ) {
  459.                 var length, value,
  460.                         i = 0,
  461.                         ret = [];
  462.  
  463.                 // Go through the array, translating each of the items to their new values
  464.                 if ( isArrayLike( elems ) ) {
  465.                         length = elems.length;
  466.                         for ( ; i < length; i++ ) {
  467.                                 value = callback( elems[ i ], i, arg );
  468.  
  469.                                 if ( value != null ) {
  470.                                         ret.push( value );
  471.                                 }
  472.                         }
  473.  
  474.                 // Go through every key on the object,
  475.                 } else {
  476.                         for ( i in elems ) {
  477.                                 value = callback( elems[ i ], i, arg );
  478.  
  479.                                 if ( value != null ) {
  480.                                         ret.push( value );
  481.                                 }
  482.                         }
  483.                 }
  484.  
  485.                 // Flatten any nested arrays
  486.                 return flat( ret );
  487.         },
  488.  
  489.         // A global GUID counter for objects
  490.         guid: 1,
  491.  
  492.         // jQuery.support is not used in Core but other projects attach their
  493.         // properties to it so it needs to exist.
  494.         support: support
  495. } );
  496.  
  497. if ( typeof Symbol === "function" ) {
  498.         jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  499. }
  500.  
  501. // Populate the class2type map
  502. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  503.         function( _i, name ) {
  504.                 class2type[ "[object " + name + "]" ] = name.toLowerCase();
  505.         } );
  506.  
  507. function isArrayLike( obj ) {
  508.  
  509.         // Support: real iOS 8.2 only (not reproducible in simulator)
  510.         // `in` check used to prevent JIT error (gh-2145)
  511.         // hasOwn isn't used here due to false negatives
  512.         // regarding Nodelist length in IE
  513.         var length = !!obj && "length" in obj && obj.length,
  514.                 type = toType( obj );
  515.  
  516.         if ( isFunction( obj ) || isWindow( obj ) ) {
  517.                 return false;
  518.         }
  519.  
  520.         return type === "array" || length === 0 ||
  521.                 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  522. }
  523. var Sizzle =
  524. /*!
  525.  * Sizzle CSS Selector Engine v2.3.6
  526.  * https://sizzlejs.com/
  527.  *
  528.  * Copyright JS Foundation and other contributors
  529.  * Released under the MIT license
  530.  * https://js.foundation/
  531.  *
  532.  * Date: 2021-02-16
  533.  */
  534. ( function( window ) {
  535. var i,
  536.         support,
  537.         Expr,
  538.         getText,
  539.         isXML,
  540.         tokenize,
  541.         compile,
  542.         select,
  543.         outermostContext,
  544.         sortInput,
  545.         hasDuplicate,
  546.  
  547.         // Local document vars
  548.         setDocument,
  549.         document,
  550.         docElem,
  551.         documentIsHTML,
  552.         rbuggyQSA,
  553.         rbuggyMatches,
  554.         matches,
  555.         contains,
  556.  
  557.         // Instance-specific data
  558.         expando = "sizzle" + 1 * new Date(),
  559.         preferredDoc = window.document,
  560.         dirruns = 0,
  561.         done = 0,
  562.         classCache = createCache(),
  563.         tokenCache = createCache(),
  564.         compilerCache = createCache(),
  565.         nonnativeSelectorCache = createCache(),
  566.         sortOrder = function( a, b ) {
  567.                 if ( a === b ) {
  568.                         hasDuplicate = true;
  569.                 }
  570.                 return 0;
  571.         },
  572.  
  573.         // Instance methods
  574.         hasOwn = ( {} ).hasOwnProperty,
  575.         arr = [],
  576.         pop = arr.pop,
  577.         pushNative = arr.push,
  578.         push = arr.push,
  579.         slice = arr.slice,
  580.  
  581.         // Use a stripped-down indexOf as it's faster than native
  582.         // https://jsperf.com/thor-indexof-vs-for/5
  583.         indexOf = function( list, elem ) {
  584.                 var i = 0,
  585.                         len = list.length;
  586.                 for ( ; i < len; i++ ) {
  587.                         if ( list[ i ] === elem ) {
  588.                                 return i;
  589.                         }
  590.                 }
  591.                 return -1;
  592.         },
  593.  
  594.         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  595.                 "ismap|loop|multiple|open|readonly|required|scoped",
  596.  
  597.         // Regular expressions
  598.  
  599.         // http://www.w3.org/TR/css3-selectors/#whitespace
  600.         whitespace = "[\\x20\\t\\r\\n\\f]",
  601.  
  602.         // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  603.         identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  604.                 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  605.  
  606.         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  607.         attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  608.  
  609.                 // Operator (capture 2)
  610.                 "*([*^$|!~]?=)" + whitespace +
  611.  
  612.                 // "Attribute values must be CSS identifiers [capture 5]
  613.                 // or strings [capture 3 or capture 4]"
  614.                 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  615.                 whitespace + "*\\]",
  616.  
  617.         pseudos = ":(" + identifier + ")(?:\\((" +
  618.  
  619.                 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  620.                 // 1. quoted (capture 3; capture 4 or capture 5)
  621.                 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  622.  
  623.                 // 2. simple (capture 6)
  624.                 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  625.  
  626.                 // 3. anything else (capture 2)
  627.                 ".*" +
  628.                 ")\\)|)",
  629.  
  630.         // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  631.         rwhitespace = new RegExp( whitespace + "+", "g" ),
  632.         rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  633.                 whitespace + "+$", "g" ),
  634.  
  635.         rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  636.         rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  637.                 "*" ),
  638.         rdescend = new RegExp( whitespace + "|>" ),
  639.  
  640.         rpseudo = new RegExp( pseudos ),
  641.         ridentifier = new RegExp( "^" + identifier + "$" ),
  642.  
  643.         matchExpr = {
  644.                 "ID": new RegExp( "^#(" + identifier + ")" ),
  645.                 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  646.                 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  647.                 "ATTR": new RegExp( "^" + attributes ),
  648.                 "PSEUDO": new RegExp( "^" + pseudos ),
  649.                 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  650.                         whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  651.                         whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  652.                 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  653.  
  654.                 // For use in libraries implementing .is()
  655.                 // We use this for POS matching in `select`
  656.                 "needsContext": new RegExp( "^" + whitespace +
  657.                         "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  658.                         "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  659.         },
  660.  
  661.         rhtml = /HTML$/i,
  662.         rinputs = /^(?:input|select|textarea|button)$/i,
  663.         rheader = /^h\d$/i,
  664.  
  665.         rnative = /^[^{]+\{\s*\[native \w/,
  666.  
  667.         // Easily-parseable/retrievable ID or TAG or CLASS selectors
  668.         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  669.  
  670.         rsibling = /[+~]/,
  671.  
  672.         // CSS escapes
  673.         // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  674.         runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  675.         funescape = function( escape, nonHex ) {
  676.                 var high = "0x" + escape.slice( 1 ) - 0x10000;
  677.  
  678.                 return nonHex ?
  679.  
  680.                         // Strip the backslash prefix from a non-hex escape sequence
  681.                         nonHex :
  682.  
  683.                         // Replace a hexadecimal escape sequence with the encoded Unicode code point
  684.                         // Support: IE <=11+
  685.                         // For values outside the Basic Multilingual Plane (BMP), manually construct a
  686.                         // surrogate pair
  687.                         high < 0 ?
  688.                                 String.fromCharCode( high + 0x10000 ) :
  689.                                 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  690.         },
  691.  
  692.         // CSS string/identifier serialization
  693.         // https://drafts.csswg.org/cssom/#common-serializing-idioms
  694.         rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  695.         fcssescape = function( ch, asCodePoint ) {
  696.                 if ( asCodePoint ) {
  697.  
  698.                         // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  699.                         if ( ch === "\0" ) {
  700.                                 return "\uFFFD";
  701.                         }
  702.  
  703.                         // Control characters and (dependent upon position) numbers get escaped as code points
  704.                         return ch.slice( 0, -1 ) + "\\" +
  705.                                 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  706.                 }
  707.  
  708.                 // Other potentially-special ASCII characters get backslash-escaped
  709.                 return "\\" + ch;
  710.         },
  711.  
  712.         // Used for iframes
  713.         // See setDocument()
  714.         // Removing the function wrapper causes a "Permission Denied"
  715.         // error in IE
  716.         unloadHandler = function() {
  717.                 setDocument();
  718.         },
  719.  
  720.         inDisabledFieldset = addCombinator(
  721.                 function( elem ) {
  722.                         return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  723.                 },
  724.                 { dir: "parentNode", next: "legend" }
  725.         );
  726.  
  727. // Optimize for push.apply( _, NodeList )
  728. try {
  729.         push.apply(
  730.                 ( arr = slice.call( preferredDoc.childNodes ) ),
  731.                 preferredDoc.childNodes
  732.         );
  733.  
  734.         // Support: Android<4.0
  735.         // Detect silently failing push.apply
  736.         // eslint-disable-next-line no-unused-expressions
  737.         arr[ preferredDoc.childNodes.length ].nodeType;
  738. } catch ( e ) {
  739.         push = { apply: arr.length ?
  740.  
  741.                 // Leverage slice if possible
  742.                 function( target, els ) {
  743.                         pushNative.apply( target, slice.call( els ) );
  744.                 } :
  745.  
  746.                 // Support: IE<9
  747.                 // Otherwise append directly
  748.                 function( target, els ) {
  749.                         var j = target.length,
  750.                                 i = 0;
  751.  
  752.                         // Can't trust NodeList.length
  753.                         while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  754.                         target.length = j - 1;
  755.                 }
  756.         };
  757. }
  758.  
  759. function Sizzle( selector, context, results, seed ) {
  760.         var m, i, elem, nid, match, groups, newSelector,
  761.                 newContext = context && context.ownerDocument,
  762.  
  763.                 // nodeType defaults to 9, since context defaults to document
  764.                 nodeType = context ? context.nodeType : 9;
  765.  
  766.         results = results || [];
  767.  
  768.         // Return early from calls with invalid selector or context
  769.         if ( typeof selector !== "string" || !selector ||
  770.                 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  771.  
  772.                 return results;
  773.         }
  774.  
  775.         // Try to shortcut find operations (as opposed to filters) in HTML documents
  776.         if ( !seed ) {
  777.                 setDocument( context );
  778.                 context = context || document;
  779.  
  780.                 if ( documentIsHTML ) {
  781.  
  782.                         // If the selector is sufficiently simple, try using a "get*By*" DOM method
  783.                         // (excepting DocumentFragment context, where the methods don't exist)
  784.                         if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  785.  
  786.                                 // ID selector
  787.                                 if ( ( m = match[ 1 ] ) ) {
  788.  
  789.                                         // Document context
  790.                                         if ( nodeType === 9 ) {
  791.                                                 if ( ( elem = context.getElementById( m ) ) ) {
  792.  
  793.                                                         // Support: IE, Opera, Webkit
  794.                                                         // TODO: identify versions
  795.                                                         // getElementById can match elements by name instead of ID
  796.                                                         if ( elem.id === m ) {
  797.                                                                 results.push( elem );
  798.                                                                 return results;
  799.                                                         }
  800.                                                 } else {
  801.                                                         return results;
  802.                                                 }
  803.  
  804.                                         // Element context
  805.                                         } else {
  806.  
  807.                                                 // Support: IE, Opera, Webkit
  808.                                                 // TODO: identify versions
  809.                                                 // getElementById can match elements by name instead of ID
  810.                                                 if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  811.                                                         contains( context, elem ) &&
  812.                                                         elem.id === m ) {
  813.  
  814.                                                         results.push( elem );
  815.                                                         return results;
  816.                                                 }
  817.                                         }
  818.  
  819.                                 // Type selector
  820.                                 } else if ( match[ 2 ] ) {
  821.                                         push.apply( results, context.getElementsByTagName( selector ) );
  822.                                         return results;
  823.  
  824.                                 // Class selector
  825.                                 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  826.                                         context.getElementsByClassName ) {
  827.  
  828.                                         push.apply( results, context.getElementsByClassName( m ) );
  829.                                         return results;
  830.                                 }
  831.                         }
  832.  
  833.                         // Take advantage of querySelectorAll
  834.                         if ( support.qsa &&
  835.                                 !nonnativeSelectorCache[ selector + " " ] &&
  836.                                 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  837.  
  838.                                 // Support: IE 8 only
  839.                                 // Exclude object elements
  840.                                 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  841.  
  842.                                 newSelector = selector;
  843.                                 newContext = context;
  844.  
  845.                                 // qSA considers elements outside a scoping root when evaluating child or
  846.                                 // descendant combinators, which is not what we want.
  847.                                 // In such cases, we work around the behavior by prefixing every selector in the
  848.                                 // list with an ID selector referencing the scope context.
  849.                                 // The technique has to be used as well when a leading combinator is used
  850.                                 // as such selectors are not recognized by querySelectorAll.
  851.                                 // Thanks to Andrew Dupont for this technique.
  852.                                 if ( nodeType === 1 &&
  853.                                         ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  854.  
  855.                                         // Expand context for sibling selectors
  856.                                         newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  857.                                                 context;
  858.  
  859.                                         // We can use :scope instead of the ID hack if the browser
  860.                                         // supports it & if we're not changing the context.
  861.                                         if ( newContext !== context || !support.scope ) {
  862.  
  863.                                                 // Capture the context ID, setting it first if necessary
  864.                                                 if ( ( nid = context.getAttribute( "id" ) ) ) {
  865.                                                         nid = nid.replace( rcssescape, fcssescape );
  866.                                                 } else {
  867.                                                         context.setAttribute( "id", ( nid = expando ) );
  868.                                                 }
  869.                                         }
  870.  
  871.                                         // Prefix every selector in the list
  872.                                         groups = tokenize( selector );
  873.                                         i = groups.length;
  874.                                         while ( i-- ) {
  875.                                                 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  876.                                                         toSelector( groups[ i ] );
  877.                                         }
  878.                                         newSelector = groups.join( "," );
  879.                                 }
  880.  
  881.                                 try {
  882.                                         push.apply( results,
  883.                                                 newContext.querySelectorAll( newSelector )
  884.                                         );
  885.                                         return results;
  886.                                 } catch ( qsaError ) {
  887.                                         nonnativeSelectorCache( selector, true );
  888.                                 } finally {
  889.                                         if ( nid === expando ) {
  890.                                                 context.removeAttribute( "id" );
  891.                                         }
  892.                                 }
  893.                         }
  894.                 }
  895.         }
  896.  
  897.         // All others
  898.         return select( selector.replace( rtrim, "$1" ), context, results, seed );
  899. }
  900.  
  901. /**
  902.  * Create key-value caches of limited size
  903.  * @returns {function(string, object)} Returns the Object data after storing it on itself with
  904.  *      property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  905.  *      deleting the oldest entry
  906.  */
  907. function createCache() {
  908.         var keys = [];
  909.  
  910.         function cache( key, value ) {
  911.  
  912.                 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  913.                 if ( keys.push( key + " " ) > Expr.cacheLength ) {
  914.  
  915.                         // Only keep the most recent entries
  916.                         delete cache[ keys.shift() ];
  917.                 }
  918.                 return ( cache[ key + " " ] = value );
  919.         }
  920.         return cache;
  921. }
  922.  
  923. /**
  924.  * Mark a function for special use by Sizzle
  925.  * @param {Function} fn The function to mark
  926.  */
  927. function markFunction( fn ) {
  928.         fn[ expando ] = true;
  929.         return fn;
  930. }
  931.  
  932. /**
  933.  * Support testing using an element
  934.  * @param {Function} fn Passed the created element and returns a boolean result
  935.  */
  936. function assert( fn ) {
  937.         var el = document.createElement( "fieldset" );
  938.  
  939.         try {
  940.                 return !!fn( el );
  941.         } catch ( e ) {
  942.                 return false;
  943.         } finally {
  944.  
  945.                 // Remove from its parent by default
  946.                 if ( el.parentNode ) {
  947.                         el.parentNode.removeChild( el );
  948.                 }
  949.  
  950.                 // release memory in IE
  951.                 el = null;
  952.         }
  953. }
  954.  
  955. /**
  956.  * Adds the same handler for all of the specified attrs
  957.  * @param {String} attrs Pipe-separated list of attributes
  958.  * @param {Function} handler The method that will be applied
  959.  */
  960. function addHandle( attrs, handler ) {
  961.         var arr = attrs.split( "|" ),
  962.                 i = arr.length;
  963.  
  964.         while ( i-- ) {
  965.                 Expr.attrHandle[ arr[ i ] ] = handler;
  966.         }
  967. }
  968.  
  969. /**
  970.  * Checks document order of two siblings
  971.  * @param {Element} a
  972.  * @param {Element} b
  973.  * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  974.  */
  975. function siblingCheck( a, b ) {
  976.         var cur = b && a,
  977.                 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  978.                         a.sourceIndex - b.sourceIndex;
  979.  
  980.         // Use IE sourceIndex if available on both nodes
  981.         if ( diff ) {
  982.                 return diff;
  983.         }
  984.  
  985.         // Check if b follows a
  986.         if ( cur ) {
  987.                 while ( ( cur = cur.nextSibling ) ) {
  988.                         if ( cur === b ) {
  989.                                 return -1;
  990.                         }
  991.                 }
  992.         }
  993.  
  994.         return a ? 1 : -1;
  995. }
  996.  
  997. /**
  998.  * Returns a function to use in pseudos for input types
  999.  * @param {String} type
  1000.  */
  1001. function createInputPseudo( type ) {
  1002.         return function( elem ) {
  1003.                 var name = elem.nodeName.toLowerCase();
  1004.                 return name === "input" && elem.type === type;
  1005.         };
  1006. }
  1007.  
  1008. /**
  1009.  * Returns a function to use in pseudos for buttons
  1010.  * @param {String} type
  1011.  */
  1012. function createButtonPseudo( type ) {
  1013.         return function( elem ) {
  1014.                 var name = elem.nodeName.toLowerCase();
  1015.                 return ( name === "input" || name === "button" ) && elem.type === type;
  1016.         };
  1017. }
  1018.  
  1019. /**
  1020.  * Returns a function to use in pseudos for :enabled/:disabled
  1021.  * @param {Boolean} disabled true for :disabled; false for :enabled
  1022.  */
  1023. function createDisabledPseudo( disabled ) {
  1024.  
  1025.         // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  1026.         return function( elem ) {
  1027.  
  1028.                 // Only certain elements can match :enabled or :disabled
  1029.                 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  1030.                 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  1031.                 if ( "form" in elem ) {
  1032.  
  1033.                         // Check for inherited disabledness on relevant non-disabled elements:
  1034.                         // * listed form-associated elements in a disabled fieldset
  1035.                         //   https://html.spec.whatwg.org/multipage/forms.html#category-listed
  1036.                         //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  1037.                         // * option elements in a disabled optgroup
  1038.                         //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  1039.                         // All such elements have a "form" property.
  1040.                         if ( elem.parentNode && elem.disabled === false ) {
  1041.  
  1042.                                 // Option elements defer to a parent optgroup if present
  1043.                                 if ( "label" in elem ) {
  1044.                                         if ( "label" in elem.parentNode ) {
  1045.                                                 return elem.parentNode.disabled === disabled;
  1046.                                         } else {
  1047.                                                 return elem.disabled === disabled;
  1048.                                         }
  1049.                                 }
  1050.  
  1051.                                 // Support: IE 6 - 11
  1052.                                 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  1053.                                 return elem.isDisabled === disabled ||
  1054.  
  1055.                                         // Where there is no isDisabled, check manually
  1056.                                         /* jshint -W018 */
  1057.                                         elem.isDisabled !== !disabled &&
  1058.                                         inDisabledFieldset( elem ) === disabled;
  1059.                         }
  1060.  
  1061.                         return elem.disabled === disabled;
  1062.  
  1063.                 // Try to winnow out elements that can't be disabled before trusting the disabled property.
  1064.                 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  1065.                 // even exist on them, let alone have a boolean value.
  1066.                 } else if ( "label" in elem ) {
  1067.                         return elem.disabled === disabled;
  1068.                 }
  1069.  
  1070.                 // Remaining elements are neither :enabled nor :disabled
  1071.                 return false;
  1072.         };
  1073. }
  1074.  
  1075. /**
  1076.  * Returns a function to use in pseudos for positionals
  1077.  * @param {Function} fn
  1078.  */
  1079. function createPositionalPseudo( fn ) {
  1080.         return markFunction( function( argument ) {
  1081.                 argument = +argument;
  1082.                 return markFunction( function( seed, matches ) {
  1083.                         var j,
  1084.                                 matchIndexes = fn( [], seed.length, argument ),
  1085.                                 i = matchIndexes.length;
  1086.  
  1087.                         // Match elements found at the specified indexes
  1088.                         while ( i-- ) {
  1089.                                 if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  1090.                                         seed[ j ] = !( matches[ j ] = seed[ j ] );
  1091.                                 }
  1092.                         }
  1093.                 } );
  1094.         } );
  1095. }
  1096.  
  1097. /**
  1098.  * Checks a node for validity as a Sizzle context
  1099.  * @param {Element|Object=} context
  1100.  * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  1101.  */
  1102. function testContext( context ) {
  1103.         return context && typeof context.getElementsByTagName !== "undefined" && context;
  1104. }
  1105.  
  1106. // Expose support vars for convenience
  1107. support = Sizzle.support = {};
  1108.  
  1109. /**
  1110.  * Detects XML nodes
  1111.  * @param {Element|Object} elem An element or a document
  1112.  * @returns {Boolean} True iff elem is a non-HTML XML node
  1113.  */
  1114. isXML = Sizzle.isXML = function( elem ) {
  1115.         var namespace = elem && elem.namespaceURI,
  1116.                 docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  1117.  
  1118.         // Support: IE <=8
  1119.         // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  1120.         // https://bugs.jquery.com/ticket/4833
  1121.         return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  1122. };
  1123.  
  1124. /**
  1125.  * Sets document-related variables once based on the current document
  1126.  * @param {Element|Object} [doc] An element or document object to use to set the document
  1127.  * @returns {Object} Returns the current document
  1128.  */
  1129. setDocument = Sizzle.setDocument = function( node ) {
  1130.         var hasCompare, subWindow,
  1131.                 doc = node ? node.ownerDocument || node : preferredDoc;
  1132.  
  1133.         // Return early if doc is invalid or already selected
  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 ) {
  1139.                 return document;
  1140.         }
  1141.  
  1142.         // Update global variables
  1143.         document = doc;
  1144.         docElem = document.documentElement;
  1145.         documentIsHTML = !isXML( document );
  1146.  
  1147.         // Support: IE 9 - 11+, Edge 12 - 18+
  1148.         // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  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 ) {
  1155.  
  1156.                 // Support: IE 11, Edge
  1157.                 if ( subWindow.addEventListener ) {
  1158.                         subWindow.addEventListener( "unload", unloadHandler, false );
  1159.  
  1160.                 // Support: IE 9 - 10 only
  1161.                 } else if ( subWindow.attachEvent ) {
  1162.                         subWindow.attachEvent( "onunload", unloadHandler );
  1163.                 }
  1164.         }
  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.  
  1177.         /* Attributes
  1178.         ---------------------------------------------------------------------- */
  1179.  
  1180.         // Support: IE<8
  1181.         // Verify that getAttribute really returns attributes and not properties
  1182.         // (excepting IE8 booleans)
  1183.         support.attributes = assert( function( el ) {
  1184.                 el.className = "i";
  1185.                 return !el.getAttribute( "className" );
  1186.         } );
  1187.  
  1188.         /* getElement(s)By*
  1189.         ---------------------------------------------------------------------- */
  1190.  
  1191.         // Check if getElementsByTagName("*") returns only elements
  1192.         support.getElementsByTagName = assert( function( el ) {
  1193.                 el.appendChild( document.createComment( "" ) );
  1194.                 return !el.getElementsByTagName( "*" ).length;
  1195.         } );
  1196.  
  1197.         // Support: IE<9
  1198.         support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  1199.  
  1200.         // Support: IE<10
  1201.         // Check if getElementById returns elements by name
  1202.         // The broken getElementById methods don't pick up programmatically-set names,
  1203.         // so use a roundabout getElementsByName test
  1204.         support.getById = assert( function( el ) {
  1205.                 docElem.appendChild( el ).id = expando;
  1206.                 return !document.getElementsByName || !document.getElementsByName( expando ).length;
  1207.         } );
  1208.  
  1209.         // ID filter and find
  1210.         if ( support.getById ) {
  1211.                 Expr.filter[ "ID" ] = function( id ) {
  1212.                         var attrId = id.replace( runescape, funescape );
  1213.                         return function( elem ) {
  1214.                                 return elem.getAttribute( "id" ) === attrId;
  1215.                         };
  1216.                 };
  1217.                 Expr.find[ "ID" ] = function( id, context ) {
  1218.                         if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1219.                                 var elem = context.getElementById( id );
  1220.                                 return elem ? [ elem ] : [];
  1221.                         }
  1222.                 };
  1223.         } else {
  1224.                 Expr.filter[ "ID" ] =  function( id ) {
  1225.                         var attrId = id.replace( runescape, funescape );
  1226.                         return function( elem ) {
  1227.                                 var node = typeof elem.getAttributeNode !== "undefined" &&
  1228.                                         elem.getAttributeNode( "id" );
  1229.                                 return node && node.value === attrId;
  1230.                         };
  1231.                 };
  1232.  
  1233.                 // Support: IE 6 - 7 only
  1234.                 // getElementById is not reliable as a find shortcut
  1235.                 Expr.find[ "ID" ] = function( id, context ) {
  1236.                         if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1237.                                 var node, i, elems,
  1238.                                         elem = context.getElementById( id );
  1239.  
  1240.                                 if ( elem ) {
  1241.  
  1242.                                         // Verify the id attribute
  1243.                                         node = elem.getAttributeNode( "id" );
  1244.                                         if ( node && node.value === id ) {
  1245.                                                 return [ elem ];
  1246.                                         }
  1247.  
  1248.                                         // Fall back on getElementsByName
  1249.                                         elems = context.getElementsByName( id );
  1250.                                         i = 0;
  1251.                                         while ( ( elem = elems[ i++ ] ) ) {
  1252.                                                 node = elem.getAttributeNode( "id" );
  1253.                                                 if ( node && node.value === id ) {
  1254.                                                         return [ elem ];
  1255.                                                 }
  1256.                                         }
  1257.                                 }
  1258.  
  1259.                                 return [];
  1260.                         }
  1261.                 };
  1262.         }
  1263.  
  1264.         // Tag
  1265.         Expr.find[ "TAG" ] = support.getElementsByTagName ?
  1266.                 function( tag, context ) {
  1267.                         if ( typeof context.getElementsByTagName !== "undefined" ) {
  1268.                                 return context.getElementsByTagName( tag );
  1269.  
  1270.                         // DocumentFragment nodes don't have gEBTN
  1271.                         } else if ( support.qsa ) {
  1272.                                 return context.querySelectorAll( tag );
  1273.                         }
  1274.                 } :
  1275.  
  1276.                 function( tag, context ) {
  1277.                         var elem,
  1278.                                 tmp = [],
  1279.                                 i = 0,
  1280.  
  1281.                                 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1282.                                 results = context.getElementsByTagName( tag );
  1283.  
  1284.                         // Filter out possible comments
  1285.                         if ( tag === "*" ) {
  1286.                                 while ( ( elem = results[ i++ ] ) ) {
  1287.                                         if ( elem.nodeType === 1 ) {
  1288.                                                 tmp.push( elem );
  1289.                                         }
  1290.                                 }
  1291.  
  1292.                                 return tmp;
  1293.                         }
  1294.                         return results;
  1295.                 };
  1296.  
  1297.         // Class
  1298.         Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  1299.                 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1300.                         return context.getElementsByClassName( className );
  1301.                 }
  1302.         };
  1303.  
  1304.         /* QSA/matchesSelector
  1305.         ---------------------------------------------------------------------- */
  1306.  
  1307.         // QSA and matchesSelector support
  1308.  
  1309.         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1310.         rbuggyMatches = [];
  1311.  
  1312.         // qSa(:focus) reports false when true (Chrome 21)
  1313.         // We allow this because of a bug in IE8/9 that throws an error
  1314.         // whenever `document.activeElement` is accessed on an iframe
  1315.         // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1316.         // See https://bugs.jquery.com/ticket/13378
  1317.         rbuggyQSA = [];
  1318.  
  1319.         if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  1320.  
  1321.                 // Build QSA regex
  1322.                 // Regex strategy adopted from Diego Perini
  1323.                 assert( function( el ) {
  1324.  
  1325.                         var input;
  1326.  
  1327.                         // Select is set to empty string on purpose
  1328.                         // This is to test IE's treatment of not explicitly
  1329.                         // setting a boolean content attribute,
  1330.                         // since its presence should be enough
  1331.                         // https://bugs.jquery.com/ticket/12359
  1332.                         docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1333.                                 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1334.                                 "<option selected=''></option></select>";
  1335.  
  1336.                         // Support: IE8, Opera 11-12.16
  1337.                         // Nothing should be selected when empty strings follow ^= or $= or *=
  1338.                         // The test attribute must be unknown in Opera but "safe" for WinRT
  1339.                         // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1340.                         if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  1341.                                 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1342.                         }
  1343.  
  1344.                         // Support: IE8
  1345.                         // Boolean attributes and "value" are not treated correctly
  1346.                         if ( !el.querySelectorAll( "[selected]" ).length ) {
  1347.                                 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1348.                         }
  1349.  
  1350.                         // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1351.                         if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  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 + "*(?:''|\"\")" );
  1366.                         }
  1367.  
  1368.                         // Webkit/Opera - :checked should return selected option elements
  1369.                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1370.                         // IE8 throws error here and will not see later tests
  1371.                         if ( !el.querySelectorAll( ":checked" ).length ) {
  1372.                                 rbuggyQSA.push( ":checked" );
  1373.                         }
  1374.  
  1375.                         // Support: Safari 8+, iOS 8+
  1376.                         // https://bugs.webkit.org/show_bug.cgi?id=136851
  1377.                         // In-page `selector#id sibling-combinator selector` fails
  1378.                         if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1379.                                 rbuggyQSA.push( ".#.+[+~]" );
  1380.                         }
  1381.  
  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 ) {
  1389.                         el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1390.                                 "<select disabled='disabled'><option/></select>";
  1391.  
  1392.                         // Support: Windows 8 Native Apps
  1393.                         // The type and name attributes are restricted during .innerHTML assignment
  1394.                         var input = document.createElement( "input" );
  1395.                         input.setAttribute( "type", "hidden" );
  1396.                         el.appendChild( input ).setAttribute( "name", "D" );
  1397.  
  1398.                         // Support: IE8
  1399.                         // Enforce case-sensitivity of name attribute
  1400.                         if ( el.querySelectorAll( "[name=d]" ).length ) {
  1401.                                 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1402.                         }
  1403.  
  1404.                         // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1405.                         // IE8 throws error here and will not see later tests
  1406.                         if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  1407.                                 rbuggyQSA.push( ":enabled", ":disabled" );
  1408.                         }
  1409.  
  1410.                         // Support: IE9-11+
  1411.                         // IE's :disabled selector does not pick up the children of disabled fieldsets
  1412.                         docElem.appendChild( el ).disabled = true;
  1413.                         if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1414.                                 rbuggyQSA.push( ":enabled", ":disabled" );
  1415.                         }
  1416.  
  1417.                         // Support: Opera 10 - 11 only
  1418.                         // Opera 10-11 does not throw on post-comma invalid pseudos
  1419.                         el.querySelectorAll( "*,:x" );
  1420.                         rbuggyQSA.push( ",.*:" );
  1421.                 } );
  1422.         }
  1423.  
  1424.         if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  1425.                 docElem.webkitMatchesSelector ||
  1426.                 docElem.mozMatchesSelector ||
  1427.                 docElem.oMatchesSelector ||
  1428.                 docElem.msMatchesSelector ) ) ) ) {
  1429.  
  1430.                 assert( function( el ) {
  1431.  
  1432.                         // Check to see if it's possible to do matchesSelector
  1433.                         // on a disconnected node (IE 9)
  1434.                         support.disconnectedMatch = matches.call( el, "*" );
  1435.  
  1436.                         // This should fail with an exception
  1437.                         // Gecko does not error, returns false instead
  1438.                         matches.call( el, "[s!='']:x" );
  1439.                         rbuggyMatches.push( "!=", pseudos );
  1440.                 } );
  1441.         }
  1442.  
  1443.         rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1444.         rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  1445.  
  1446.         /* Contains
  1447.         ---------------------------------------------------------------------- */
  1448.         hasCompare = rnative.test( docElem.compareDocumentPosition );
  1449.  
  1450.         // Element contains another
  1451.         // Purposefully self-exclusive
  1452.         // As in, an element does not contain itself
  1453.         contains = hasCompare || rnative.test( docElem.contains ) ?
  1454.                 function( a, b ) {
  1455.                         var adown = a.nodeType === 9 ? a.documentElement : a,
  1456.                                 bup = b && b.parentNode;
  1457.                         return a === bup || !!( bup && bup.nodeType === 1 && (
  1458.                                 adown.contains ?
  1459.                                         adown.contains( bup ) :
  1460.                                         a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1461.                         ) );
  1462.                 } :
  1463.                 function( a, b ) {
  1464.                         if ( b ) {
  1465.                                 while ( ( b = b.parentNode ) ) {
  1466.                                         if ( b === a ) {
  1467.                                                 return true;
  1468.                                         }
  1469.                                 }
  1470.                         }
  1471.                         return false;
  1472.                 };
  1473.  
  1474.         /* Sorting
  1475.         ---------------------------------------------------------------------- */
  1476.  
  1477.         // Document order sorting
  1478.         sortOrder = hasCompare ?
  1479.         function( a, b ) {
  1480.  
  1481.                 // Flag for duplicate removal
  1482.                 if ( a === b ) {
  1483.                         hasDuplicate = true;
  1484.                         return 0;
  1485.                 }
  1486.  
  1487.                 // Sort on method existence if only one input has compareDocumentPosition
  1488.                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1489.                 if ( compare ) {
  1490.                         return compare;
  1491.                 }
  1492.  
  1493.                 // Calculate position if both inputs belong to the same document
  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 ) ?
  1499.                         a.compareDocumentPosition( b ) :
  1500.  
  1501.                         // Otherwise we know they are disconnected
  1502.                         1;
  1503.  
  1504.                 // Disconnected nodes
  1505.                 if ( compare & 1 ||
  1506.                         ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1507.  
  1508.                         // Choose the first element that is related to our preferred document
  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 ) ) {
  1515.                                 return -1;
  1516.                         }
  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 ) ) {
  1524.                                 return 1;
  1525.                         }
  1526.  
  1527.                         // Maintain original order
  1528.                         return sortInput ?
  1529.                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1530.                                 0;
  1531.                 }
  1532.  
  1533.                 return compare & 4 ? -1 : 1;
  1534.         } :
  1535.         function( a, b ) {
  1536.  
  1537.                 // Exit early if the nodes are identical
  1538.                 if ( a === b ) {
  1539.                         hasDuplicate = true;
  1540.                         return 0;
  1541.                 }
  1542.  
  1543.                 var cur,
  1544.                         i = 0,
  1545.                         aup = a.parentNode,
  1546.                         bup = b.parentNode,
  1547.                         ap = [ a ],
  1548.                         bp = [ b ];
  1549.  
  1550.                 // Parentless nodes are either documents or disconnected
  1551.                 if ( !aup || !bup ) {
  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 */
  1560.                                 aup ? -1 :
  1561.                                 bup ? 1 :
  1562.                                 sortInput ?
  1563.                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1564.                                 0;
  1565.  
  1566.                 // If the nodes are siblings, we can do a quick check
  1567.                 } else if ( aup === bup ) {
  1568.                         return siblingCheck( a, b );
  1569.                 }
  1570.  
  1571.                 // Otherwise we need full lists of their ancestors for comparison
  1572.                 cur = a;
  1573.                 while ( ( cur = cur.parentNode ) ) {
  1574.                         ap.unshift( cur );
  1575.                 }
  1576.                 cur = b;
  1577.                 while ( ( cur = cur.parentNode ) ) {
  1578.                         bp.unshift( cur );
  1579.                 }
  1580.  
  1581.                 // Walk down the tree looking for a discrepancy
  1582.                 while ( ap[ i ] === bp[ i ] ) {
  1583.                         i++;
  1584.                 }
  1585.  
  1586.                 return i ?
  1587.  
  1588.                         // Do a sibling check if the nodes have a common ancestor
  1589.                         siblingCheck( ap[ i ], bp[ i ] ) :
  1590.  
  1591.                         // Otherwise nodes in our document sort first
  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 */
  1599.                         0;
  1600.         };
  1601.  
  1602.         return document;
  1603. };
  1604.  
  1605. Sizzle.matches = function( expr, elements ) {
  1606.         return Sizzle( expr, null, null, elements );
  1607. };
  1608.  
  1609. Sizzle.matchesSelector = function( elem, expr ) {
  1610.         setDocument( elem );
  1611.  
  1612.         if ( support.matchesSelector && documentIsHTML &&
  1613.                 !nonnativeSelectorCache[ expr + " " ] &&
  1614.                 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1615.                 ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
  1616.  
  1617.                 try {
  1618.                         var ret = matches.call( elem, expr );
  1619.  
  1620.                         // IE 9's matchesSelector returns false on disconnected nodes
  1621.                         if ( ret || support.disconnectedMatch ||
  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 ) {
  1626.                                 return ret;
  1627.                         }
  1628.                 } catch ( e ) {
  1629.                         nonnativeSelectorCache( expr, true );
  1630.                 }
  1631.         }
  1632.  
  1633.         return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1634. };
  1635.  
  1636. Sizzle.contains = function( context, elem ) {
  1637.  
  1638.         // Set document vars if needed
  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 ) {
  1644.                 setDocument( context );
  1645.         }
  1646.         return contains( context, elem );
  1647. };
  1648.  
  1649. Sizzle.attr = function( elem, name ) {
  1650.  
  1651.         // Set document vars if needed
  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 ) {
  1657.                 setDocument( elem );
  1658.         }
  1659.  
  1660.         var fn = Expr.attrHandle[ name.toLowerCase() ],
  1661.  
  1662.                 // Don't get fooled by Object.prototype properties (jQuery #13807)
  1663.                 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1664.                         fn( elem, name, !documentIsHTML ) :
  1665.                         undefined;
  1666.  
  1667.         return val !== undefined ?
  1668.                 val :
  1669.                 support.attributes || !documentIsHTML ?
  1670.                         elem.getAttribute( name ) :
  1671.                         ( val = elem.getAttributeNode( name ) ) && val.specified ?
  1672.                                 val.value :
  1673.                                 null;
  1674. };
  1675.  
  1676. Sizzle.escape = function( sel ) {
  1677.         return ( sel + "" ).replace( rcssescape, fcssescape );
  1678. };
  1679.  
  1680. Sizzle.error = function( msg ) {
  1681.         throw new Error( "Syntax error, unrecognized expression: " + msg );
  1682. };
  1683.  
  1684. /**
  1685.  * Document sorting and removing duplicates
  1686.  * @param {ArrayLike} results
  1687.  */
  1688. Sizzle.uniqueSort = function( results ) {
  1689.         var elem,
  1690.                 duplicates = [],
  1691.                 j = 0,
  1692.                 i = 0;
  1693.  
  1694.         // Unless we *know* we can detect duplicates, assume their presence
  1695.         hasDuplicate = !support.detectDuplicates;
  1696.         sortInput = !support.sortStable && results.slice( 0 );
  1697.         results.sort( sortOrder );
  1698.  
  1699.         if ( hasDuplicate ) {
  1700.                 while ( ( elem = results[ i++ ] ) ) {
  1701.                         if ( elem === results[ i ] ) {
  1702.                                 j = duplicates.push( i );
  1703.                         }
  1704.                 }
  1705.                 while ( j-- ) {
  1706.                         results.splice( duplicates[ j ], 1 );
  1707.                 }
  1708.         }
  1709.  
  1710.         // Clear input after sorting to release objects
  1711.         // See https://github.com/jquery/sizzle/pull/225
  1712.         sortInput = null;
  1713.  
  1714.         return results;
  1715. };
  1716.  
  1717. /**
  1718.  * Utility function for retrieving the text value of an array of DOM nodes
  1719.  * @param {Array|Element} elem
  1720.  */
  1721. getText = Sizzle.getText = function( elem ) {
  1722.         var node,
  1723.                 ret = "",
  1724.                 i = 0,
  1725.                 nodeType = elem.nodeType;
  1726.  
  1727.         if ( !nodeType ) {
  1728.  
  1729.                 // If no nodeType, this is expected to be an array
  1730.                 while ( ( node = elem[ i++ ] ) ) {
  1731.  
  1732.                         // Do not traverse comment nodes
  1733.                         ret += getText( node );
  1734.                 }
  1735.         } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1736.  
  1737.                 // Use textContent for elements
  1738.                 // innerText usage removed for consistency of new lines (jQuery #11153)
  1739.                 if ( typeof elem.textContent === "string" ) {
  1740.                         return elem.textContent;
  1741.                 } else {
  1742.  
  1743.                         // Traverse its children
  1744.                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1745.                                 ret += getText( elem );
  1746.                         }
  1747.                 }
  1748.         } else if ( nodeType === 3 || nodeType === 4 ) {
  1749.                 return elem.nodeValue;
  1750.         }
  1751.  
  1752.         // Do not include comment or processing instruction nodes
  1753.  
  1754.         return ret;
  1755. };
  1756.  
  1757. Expr = Sizzle.selectors = {
  1758.  
  1759.         // Can be adjusted by the user
  1760.         cacheLength: 50,
  1761.  
  1762.         createPseudo: markFunction,
  1763.  
  1764.         match: matchExpr,
  1765.  
  1766.         attrHandle: {},
  1767.  
  1768.         find: {},
  1769.  
  1770.         relative: {
  1771.                 ">": { dir: "parentNode", first: true },
  1772.                 " ": { dir: "parentNode" },
  1773.                 "+": { dir: "previousSibling", first: true },
  1774.                 "~": { dir: "previousSibling" }
  1775.         },
  1776.  
  1777.         preFilter: {
  1778.                 "ATTR": function( match ) {
  1779.                         match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1780.  
  1781.                         // Move the given value to match[3] whether quoted or unquoted
  1782.                         match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  1783.                                 match[ 5 ] || "" ).replace( runescape, funescape );
  1784.  
  1785.                         if ( match[ 2 ] === "~=" ) {
  1786.                                 match[ 3 ] = " " + match[ 3 ] + " ";
  1787.                         }
  1788.  
  1789.                         return match.slice( 0, 4 );
  1790.                 },
  1791.  
  1792.                 "CHILD": function( match ) {
  1793.  
  1794.                         /* matches from matchExpr["CHILD"]
  1795.                                 1 type (only|nth|...)
  1796.                                 2 what (child|of-type)
  1797.                                 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1798.                                 4 xn-component of xn+y argument ([+-]?\d*n|)
  1799.                                 5 sign of xn-component
  1800.                                 6 x of xn-component
  1801.                                 7 sign of y-component
  1802.                                 8 y of y-component
  1803.                         */
  1804.                         match[ 1 ] = match[ 1 ].toLowerCase();
  1805.  
  1806.                         if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1807.  
  1808.                                 // nth-* requires argument
  1809.                                 if ( !match[ 3 ] ) {
  1810.                                         Sizzle.error( match[ 0 ] );
  1811.                                 }
  1812.  
  1813.                                 // numeric x and y parameters for Expr.filter.CHILD
  1814.                                 // remember that false/true cast respectively to 0/1
  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" );
  1819.  
  1820.                                 // other types prohibit arguments
  1821.                         } else if ( match[ 3 ] ) {
  1822.                                 Sizzle.error( match[ 0 ] );
  1823.                         }
  1824.  
  1825.                         return match;
  1826.                 },
  1827.  
  1828.                 "PSEUDO": function( match ) {
  1829.                         var excess,
  1830.                                 unquoted = !match[ 6 ] && match[ 2 ];
  1831.  
  1832.                         if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  1833.                                 return null;
  1834.                         }
  1835.  
  1836.                         // Accept quoted arguments as-is
  1837.                         if ( match[ 3 ] ) {
  1838.                                 match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1839.  
  1840.                         // Strip excess characters from unquoted arguments
  1841.                         } else if ( unquoted && rpseudo.test( unquoted ) &&
  1842.  
  1843.                                 // Get excess from tokenize (recursively)
  1844.                                 ( excess = tokenize( unquoted, true ) ) &&
  1845.  
  1846.                                 // advance to the next closing parenthesis
  1847.                                 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1848.  
  1849.                                 // excess is a negative index
  1850.                                 match[ 0 ] = match[ 0 ].slice( 0, excess );
  1851.                                 match[ 2 ] = unquoted.slice( 0, excess );
  1852.                         }
  1853.  
  1854.                         // Return only captures needed by the pseudo filter method (type and argument)
  1855.                         return match.slice( 0, 3 );
  1856.                 }
  1857.         },
  1858.  
  1859.         filter: {
  1860.  
  1861.                 "TAG": function( nodeNameSelector ) {
  1862.                         var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1863.                         return nodeNameSelector === "*" ?
  1864.                                 function() {
  1865.                                         return true;
  1866.                                 } :
  1867.                                 function( elem ) {
  1868.                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1869.                                 };
  1870.                 },
  1871.  
  1872.                 "CLASS": function( className ) {
  1873.                         var pattern = classCache[ className + " " ];
  1874.  
  1875.                         return pattern ||
  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.                                 } );
  1886.                 },
  1887.  
  1888.                 "ATTR": function( name, operator, check ) {
  1889.                         return function( elem ) {
  1890.                                 var result = Sizzle.attr( elem, name );
  1891.  
  1892.                                 if ( result == null ) {
  1893.                                         return operator === "!=";
  1894.                                 }
  1895.                                 if ( !operator ) {
  1896.                                         return true;
  1897.                                 }
  1898.  
  1899.                                 result += "";
  1900.  
  1901.                                 /* eslint-disable max-len */
  1902.  
  1903.                                 return operator === "=" ? result === check :
  1904.                                         operator === "!=" ? result !== check :
  1905.                                         operator === "^=" ? check && result.indexOf( check ) === 0 :
  1906.                                         operator === "*=" ? check && result.indexOf( check ) > -1 :
  1907.                                         operator === "$=" ? check && result.slice( -check.length ) === check :
  1908.                                         operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1909.                                         operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1910.                                         false;
  1911.                                 /* eslint-enable max-len */
  1912.  
  1913.                         };
  1914.                 },
  1915.  
  1916.                 "CHILD": function( type, what, _argument, first, last ) {
  1917.                         var simple = type.slice( 0, 3 ) !== "nth",
  1918.                                 forward = type.slice( -4 ) !== "last",
  1919.                                 ofType = what === "of-type";
  1920.  
  1921.                         return first === 1 && last === 0 ?
  1922.  
  1923.                                 // Shortcut for :nth-*(n)
  1924.                                 function( elem ) {
  1925.                                         return !!elem.parentNode;
  1926.                                 } :
  1927.  
  1928.                                 function( elem, _context, xml ) {
  1929.                                         var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1930.                                                 dir = simple !== forward ? "nextSibling" : "previousSibling",
  1931.                                                 parent = elem.parentNode,
  1932.                                                 name = ofType && elem.nodeName.toLowerCase(),
  1933.                                                 useCache = !xml && !ofType,
  1934.                                                 diff = false;
  1935.  
  1936.                                         if ( parent ) {
  1937.  
  1938.                                                 // :(first|last|only)-(child|of-type)
  1939.                                                 if ( simple ) {
  1940.                                                         while ( dir ) {
  1941.                                                                 node = elem;
  1942.                                                                 while ( ( node = node[ dir ] ) ) {
  1943.                                                                         if ( ofType ?
  1944.                                                                                 node.nodeName.toLowerCase() === name :
  1945.                                                                                 node.nodeType === 1 ) {
  1946.  
  1947.                                                                                 return false;
  1948.                                                                         }
  1949.                                                                 }
  1950.  
  1951.                                                                 // Reverse direction for :only-* (if we haven't yet done so)
  1952.                                                                 start = dir = type === "only" && !start && "nextSibling";
  1953.                                                         }
  1954.                                                         return true;
  1955.                                                 }
  1956.  
  1957.                                                 start = [ forward ? parent.firstChild : parent.lastChild ];
  1958.  
  1959.                                                 // non-xml :nth-child(...) stores cache data on `parent`
  1960.                                                 if ( forward && useCache ) {
  1961.  
  1962.                                                         // Seek `elem` from a previously-cached index
  1963.  
  1964.                                                         // ...in a gzip-friendly way
  1965.                                                         node = parent;
  1966.                                                         outerCache = node[ expando ] || ( node[ expando ] = {} );
  1967.  
  1968.                                                         // Support: IE <9 only
  1969.                                                         // Defend against cloned attroperties (jQuery gh-1709)
  1970.                                                         uniqueCache = outerCache[ node.uniqueID ] ||
  1971.                                                                 ( outerCache[ node.uniqueID ] = {} );
  1972.  
  1973.                                                         cache = uniqueCache[ type ] || [];
  1974.                                                         nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1975.                                                         diff = nodeIndex && cache[ 2 ];
  1976.                                                         node = nodeIndex && parent.childNodes[ nodeIndex ];
  1977.  
  1978.                                                         while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1979.  
  1980.                                                                 // Fallback to seeking `elem` from the start
  1981.                                                                 ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1982.  
  1983.                                                                 // When found, cache indexes on `parent` and break
  1984.                                                                 if ( node.nodeType === 1 && ++diff && node === elem ) {
  1985.                                                                         uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1986.                                                                         break;
  1987.                                                                 }
  1988.                                                         }
  1989.  
  1990.                                                 } else {
  1991.  
  1992.                                                         // Use previously-cached element index if available
  1993.                                                         if ( useCache ) {
  1994.  
  1995.                                                                 // ...in a gzip-friendly way
  1996.                                                                 node = elem;
  1997.                                                                 outerCache = node[ expando ] || ( node[ expando ] = {} );
  1998.  
  1999.                                                                 // Support: IE <9 only
  2000.                                                                 // Defend against cloned attroperties (jQuery gh-1709)
  2001.                                                                 uniqueCache = outerCache[ node.uniqueID ] ||
  2002.                                                                         ( outerCache[ node.uniqueID ] = {} );
  2003.  
  2004.                                                                 cache = uniqueCache[ type ] || [];
  2005.                                                                 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  2006.                                                                 diff = nodeIndex;
  2007.                                                         }
  2008.  
  2009.                                                         // xml :nth-child(...)
  2010.                                                         // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  2011.                                                         if ( diff === false ) {
  2012.  
  2013.                                                                 // Use the same loop as above to seek `elem` from the start
  2014.                                                                 while ( ( node = ++nodeIndex && node && node[ dir ] ||
  2015.                                                                         ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  2016.  
  2017.                                                                         if ( ( ofType ?
  2018.                                                                                 node.nodeName.toLowerCase() === name :
  2019.                                                                                 node.nodeType === 1 ) &&
  2020.                                                                                 ++diff ) {
  2021.  
  2022.                                                                                 // Cache the index of each encountered element
  2023.                                                                                 if ( useCache ) {
  2024.                                                                                         outerCache = node[ expando ] ||
  2025.                                                                                                 ( node[ expando ] = {} );
  2026.  
  2027.                                                                                         // Support: IE <9 only
  2028.                                                                                         // Defend against cloned attroperties (jQuery gh-1709)
  2029.                                                                                         uniqueCache = outerCache[ node.uniqueID ] ||
  2030.                                                                                                 ( outerCache[ node.uniqueID ] = {} );
  2031.  
  2032.                                                                                         uniqueCache[ type ] = [ dirruns, diff ];
  2033.                                                                                 }
  2034.  
  2035.                                                                                 if ( node === elem ) {
  2036.                                                                                         break;
  2037.                                                                                 }
  2038.                                                                         }
  2039.                                                                 }
  2040.                                                         }
  2041.                                                 }
  2042.  
  2043.                                                 // Incorporate the offset, then check against cycle size
  2044.                                                 diff -= last;
  2045.                                                 return diff === first || ( diff % first === 0 && diff / first >= 0 );
  2046.                                         }
  2047.                                 };
  2048.                 },
  2049.  
  2050.                 "PSEUDO": function( pseudo, argument ) {
  2051.  
  2052.                         // pseudo-class names are case-insensitive
  2053.                         // http://www.w3.org/TR/selectors/#pseudo-classes
  2054.                         // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  2055.                         // Remember that setFilters inherits from pseudos
  2056.                         var args,
  2057.                                 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  2058.                                         Sizzle.error( "unsupported pseudo: " + pseudo );
  2059.  
  2060.                         // The user may use createPseudo to indicate that
  2061.                         // arguments are needed to create the filter function
  2062.                         // just as Sizzle does
  2063.                         if ( fn[ expando ] ) {
  2064.                                 return fn( argument );
  2065.                         }
  2066.  
  2067.                         // But maintain support for old signatures
  2068.                         if ( fn.length > 1 ) {
  2069.                                 args = [ pseudo, pseudo, "", argument ];
  2070.                                 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  2071.                                         markFunction( function( seed, matches ) {
  2072.                                                 var idx,
  2073.                                                         matched = fn( seed, argument ),
  2074.                                                         i = matched.length;
  2075.                                                 while ( i-- ) {
  2076.                                                         idx = indexOf( seed, matched[ i ] );
  2077.                                                         seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  2078.                                                 }
  2079.                                         } ) :
  2080.                                         function( elem ) {
  2081.                                                 return fn( elem, 0, args );
  2082.                                         };
  2083.                         }
  2084.  
  2085.                         return fn;
  2086.                 }
  2087.         },
  2088.  
  2089.         pseudos: {
  2090.  
  2091.                 // Potentially complex pseudos
  2092.                 "not": markFunction( function( selector ) {
  2093.  
  2094.                         // Trim the selector passed to compile
  2095.                         // to avoid treating leading and trailing
  2096.                         // spaces as combinators
  2097.                         var input = [],
  2098.                                 results = [],
  2099.                                 matcher = compile( selector.replace( rtrim, "$1" ) );
  2100.  
  2101.                         return matcher[ expando ] ?
  2102.                                 markFunction( function( seed, matches, _context, xml ) {
  2103.                                         var elem,
  2104.                                                 unmatched = matcher( seed, null, xml, [] ),
  2105.                                                 i = seed.length;
  2106.  
  2107.                                         // Match elements unmatched by `matcher`
  2108.                                         while ( i-- ) {
  2109.                                                 if ( ( elem = unmatched[ i ] ) ) {
  2110.                                                         seed[ i ] = !( matches[ i ] = elem );
  2111.                                                 }
  2112.                                         }
  2113.                                 } ) :
  2114.                                 function( elem, _context, xml ) {
  2115.                                         input[ 0 ] = elem;
  2116.                                         matcher( input, null, xml, results );
  2117.  
  2118.                                         // Don't keep the element (issue #299)
  2119.                                         input[ 0 ] = null;
  2120.                                         return !results.pop();
  2121.                                 };
  2122.                 } ),
  2123.  
  2124.                 "has": markFunction( function( selector ) {
  2125.                         return function( elem ) {
  2126.                                 return Sizzle( selector, elem ).length > 0;
  2127.                         };
  2128.                 } ),
  2129.  
  2130.                 "contains": markFunction( function( text ) {
  2131.                         text = text.replace( runescape, funescape );
  2132.                         return function( elem ) {
  2133.                                 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  2134.                         };
  2135.                 } ),
  2136.  
  2137.                 // "Whether an element is represented by a :lang() selector
  2138.                 // is based solely on the element's language value
  2139.                 // being equal to the identifier C,
  2140.                 // or beginning with the identifier C immediately followed by "-".
  2141.                 // The matching of C against the element's language value is performed case-insensitively.
  2142.                 // The identifier C does not have to be a valid language name."
  2143.                 // http://www.w3.org/TR/selectors/#lang-pseudo
  2144.                 "lang": markFunction( function( lang ) {
  2145.  
  2146.                         // lang value must be a valid identifier
  2147.                         if ( !ridentifier.test( lang || "" ) ) {
  2148.                                 Sizzle.error( "unsupported lang: " + lang );
  2149.                         }
  2150.                         lang = lang.replace( runescape, funescape ).toLowerCase();
  2151.                         return function( elem ) {
  2152.                                 var elemLang;
  2153.                                 do {
  2154.                                         if ( ( elemLang = documentIsHTML ?
  2155.                                                 elem.lang :
  2156.                                                 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  2157.  
  2158.                                                 elemLang = elemLang.toLowerCase();
  2159.                                                 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  2160.                                         }
  2161.                                 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  2162.                                 return false;
  2163.                         };
  2164.                 } ),
  2165.  
  2166.                 // Miscellaneous
  2167.                 "target": function( elem ) {
  2168.                         var hash = window.location && window.location.hash;
  2169.                         return hash && hash.slice( 1 ) === elem.id;
  2170.                 },
  2171.  
  2172.                 "root": function( elem ) {
  2173.                         return elem === docElem;
  2174.                 },
  2175.  
  2176.                 "focus": function( elem ) {
  2177.                         return elem === document.activeElement &&
  2178.                                 ( !document.hasFocus || document.hasFocus() ) &&
  2179.                                 !!( elem.type || elem.href || ~elem.tabIndex );
  2180.                 },
  2181.  
  2182.                 // Boolean properties
  2183.                 "enabled": createDisabledPseudo( false ),
  2184.                 "disabled": createDisabledPseudo( true ),
  2185.  
  2186.                 "checked": function( elem ) {
  2187.  
  2188.                         // In CSS3, :checked should return both checked and selected elements
  2189.                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  2190.                         var nodeName = elem.nodeName.toLowerCase();
  2191.                         return ( nodeName === "input" && !!elem.checked ) ||
  2192.                                 ( nodeName === "option" && !!elem.selected );
  2193.                 },
  2194.  
  2195.                 "selected": function( elem ) {
  2196.  
  2197.                         // Accessing this property makes selected-by-default
  2198.                         // options in Safari work properly
  2199.                         if ( elem.parentNode ) {
  2200.                                 // eslint-disable-next-line no-unused-expressions
  2201.                                 elem.parentNode.selectedIndex;
  2202.                         }
  2203.  
  2204.                         return elem.selected === true;
  2205.                 },
  2206.  
  2207.                 // Contents
  2208.                 "empty": function( elem ) {
  2209.  
  2210.                         // http://www.w3.org/TR/selectors/#empty-pseudo
  2211.                         // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  2212.                         //   but not by others (comment: 8; processing instruction: 7; etc.)
  2213.                         // nodeType < 6 works because attributes (2) do not appear as children
  2214.                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2215.                                 if ( elem.nodeType < 6 ) {
  2216.                                         return false;
  2217.                                 }
  2218.                         }
  2219.                         return true;
  2220.                 },
  2221.  
  2222.                 "parent": function( elem ) {
  2223.                         return !Expr.pseudos[ "empty" ]( elem );
  2224.                 },
  2225.  
  2226.                 // Element/input types
  2227.                 "header": function( elem ) {
  2228.                         return rheader.test( elem.nodeName );
  2229.                 },
  2230.  
  2231.                 "input": function( elem ) {
  2232.                         return rinputs.test( elem.nodeName );
  2233.                 },
  2234.  
  2235.                 "button": function( elem ) {
  2236.                         var name = elem.nodeName.toLowerCase();
  2237.                         return name === "input" && elem.type === "button" || name === "button";
  2238.                 },
  2239.  
  2240.                 "text": function( elem ) {
  2241.                         var attr;
  2242.                         return elem.nodeName.toLowerCase() === "input" &&
  2243.                                 elem.type === "text" &&
  2244.  
  2245.                                 // Support: IE<8
  2246.                                 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  2247.                                 ( ( attr = elem.getAttribute( "type" ) ) == null ||
  2248.                                         attr.toLowerCase() === "text" );
  2249.                 },
  2250.  
  2251.                 // Position-in-collection
  2252.                 "first": createPositionalPseudo( function() {
  2253.                         return [ 0 ];
  2254.                 } ),
  2255.  
  2256.                 "last": createPositionalPseudo( function( _matchIndexes, length ) {
  2257.                         return [ length - 1 ];
  2258.                 } ),
  2259.  
  2260.                 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  2261.                         return [ argument < 0 ? argument + length : argument ];
  2262.                 } ),
  2263.  
  2264.                 "even": createPositionalPseudo( function( matchIndexes, length ) {
  2265.                         var i = 0;
  2266.                         for ( ; i < length; i += 2 ) {
  2267.                                 matchIndexes.push( i );
  2268.                         }
  2269.                         return matchIndexes;
  2270.                 } ),
  2271.  
  2272.                 "odd": createPositionalPseudo( function( matchIndexes, length ) {
  2273.                         var i = 1;
  2274.                         for ( ; i < length; i += 2 ) {
  2275.                                 matchIndexes.push( i );
  2276.                         }
  2277.                         return matchIndexes;
  2278.                 } ),
  2279.  
  2280.                 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  2281.                         var i = argument < 0 ?
  2282.                                 argument + length :
  2283.                                 argument > length ?
  2284.                                         length :
  2285.                                         argument;
  2286.                         for ( ; --i >= 0; ) {
  2287.                                 matchIndexes.push( i );
  2288.                         }
  2289.                         return matchIndexes;
  2290.                 } ),
  2291.  
  2292.                 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  2293.                         var i = argument < 0 ? argument + length : argument;
  2294.                         for ( ; ++i < length; ) {
  2295.                                 matchIndexes.push( i );
  2296.                         }
  2297.                         return matchIndexes;
  2298.                 } )
  2299.         }
  2300. };
  2301.  
  2302. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  2303.  
  2304. // Add button/input type pseudos
  2305. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  2306.         Expr.pseudos[ i ] = createInputPseudo( i );
  2307. }
  2308. for ( i in { submit: true, reset: true } ) {
  2309.         Expr.pseudos[ i ] = createButtonPseudo( i );
  2310. }
  2311.  
  2312. // Easy API for creating new setFilters
  2313. function setFilters() {}
  2314. setFilters.prototype = Expr.filters = Expr.pseudos;
  2315. Expr.setFilters = new setFilters();
  2316.  
  2317. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  2318.         var matched, match, tokens, type,
  2319.                 soFar, groups, preFilters,
  2320.                 cached = tokenCache[ selector + " " ];
  2321.  
  2322.         if ( cached ) {
  2323.                 return parseOnly ? 0 : cached.slice( 0 );
  2324.         }
  2325.  
  2326.         soFar = selector;
  2327.         groups = [];
  2328.         preFilters = Expr.preFilter;
  2329.  
  2330.         while ( soFar ) {
  2331.  
  2332.                 // Comma and first run
  2333.                 if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  2334.                         if ( match ) {
  2335.  
  2336.                                 // Don't consume trailing commas as valid
  2337.                                 soFar = soFar.slice( match[ 0 ].length ) || soFar;
  2338.                         }
  2339.                         groups.push( ( tokens = [] ) );
  2340.                 }
  2341.  
  2342.                 matched = false;
  2343.  
  2344.                 // Combinators
  2345.                 if ( ( match = rcombinators.exec( soFar ) ) ) {
  2346.                         matched = match.shift();
  2347.                         tokens.push( {
  2348.                                 value: matched,
  2349.  
  2350.                                 // Cast descendant combinators to space
  2351.                                 type: match[ 0 ].replace( rtrim, " " )
  2352.                         } );
  2353.                         soFar = soFar.slice( matched.length );
  2354.                 }
  2355.  
  2356.                 // Filters
  2357.                 for ( type in Expr.filter ) {
  2358.                         if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  2359.                                 ( match = preFilters[ type ]( match ) ) ) ) {
  2360.                                 matched = match.shift();
  2361.                                 tokens.push( {
  2362.                                         value: matched,
  2363.                                         type: type,
  2364.                                         matches: match
  2365.                                 } );
  2366.                                 soFar = soFar.slice( matched.length );
  2367.                         }
  2368.                 }
  2369.  
  2370.                 if ( !matched ) {
  2371.                         break;
  2372.                 }
  2373.         }
  2374.  
  2375.         // Return the length of the invalid excess
  2376.         // if we're just parsing
  2377.         // Otherwise, throw an error or return tokens
  2378.         return parseOnly ?
  2379.                 soFar.length :
  2380.                 soFar ?
  2381.                         Sizzle.error( selector ) :
  2382.  
  2383.                         // Cache the tokens
  2384.                         tokenCache( selector, groups ).slice( 0 );
  2385. };
  2386.  
  2387. function toSelector( tokens ) {
  2388.         var i = 0,
  2389.                 len = tokens.length,
  2390.                 selector = "";
  2391.         for ( ; i < len; i++ ) {
  2392.                 selector += tokens[ i ].value;
  2393.         }
  2394.         return selector;
  2395. }
  2396.  
  2397. function addCombinator( matcher, combinator, base ) {
  2398.         var dir = combinator.dir,
  2399.                 skip = combinator.next,
  2400.                 key = skip || dir,
  2401.                 checkNonElements = base && key === "parentNode",
  2402.                 doneName = done++;
  2403.  
  2404.         return combinator.first ?
  2405.  
  2406.                 // Check against closest ancestor/preceding element
  2407.                 function( elem, context, xml ) {
  2408.                         while ( ( elem = elem[ dir ] ) ) {
  2409.                                 if ( elem.nodeType === 1 || checkNonElements ) {
  2410.                                         return matcher( elem, context, xml );
  2411.                                 }
  2412.                         }
  2413.                         return false;
  2414.                 } :
  2415.  
  2416.                 // Check against all ancestor/preceding elements
  2417.                 function( elem, context, xml ) {
  2418.                         var oldCache, uniqueCache, outerCache,
  2419.                                 newCache = [ dirruns, doneName ];
  2420.  
  2421.                         // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  2422.                         if ( xml ) {
  2423.                                 while ( ( elem = elem[ dir ] ) ) {
  2424.                                         if ( elem.nodeType === 1 || checkNonElements ) {
  2425.                                                 if ( matcher( elem, context, xml ) ) {
  2426.                                                         return true;
  2427.                                                 }
  2428.                                         }
  2429.                                 }
  2430.                         } else {
  2431.                                 while ( ( elem = elem[ dir ] ) ) {
  2432.                                         if ( elem.nodeType === 1 || checkNonElements ) {
  2433.                                                 outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  2434.  
  2435.                                                 // Support: IE <9 only
  2436.                                                 // Defend against cloned attroperties (jQuery gh-1709)
  2437.                                                 uniqueCache = outerCache[ elem.uniqueID ] ||
  2438.                                                         ( outerCache[ elem.uniqueID ] = {} );
  2439.  
  2440.                                                 if ( skip && skip === elem.nodeName.toLowerCase() ) {
  2441.                                                         elem = elem[ dir ] || elem;
  2442.                                                 } else if ( ( oldCache = uniqueCache[ key ] ) &&
  2443.                                                         oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  2444.  
  2445.                                                         // Assign to newCache so results back-propagate to previous elements
  2446.                                                         return ( newCache[ 2 ] = oldCache[ 2 ] );
  2447.                                                 } else {
  2448.  
  2449.                                                         // Reuse newcache so results back-propagate to previous elements
  2450.                                                         uniqueCache[ key ] = newCache;
  2451.  
  2452.                                                         // A match means we're done; a fail means we have to keep checking
  2453.                                                         if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  2454.                                                                 return true;
  2455.                                                         }
  2456.                                                 }
  2457.                                         }
  2458.                                 }
  2459.                         }
  2460.                         return false;
  2461.                 };
  2462. }
  2463.  
  2464. function elementMatcher( matchers ) {
  2465.         return matchers.length > 1 ?
  2466.                 function( elem, context, xml ) {
  2467.                         var i = matchers.length;
  2468.                         while ( i-- ) {
  2469.                                 if ( !matchers[ i ]( elem, context, xml ) ) {
  2470.                                         return false;
  2471.                                 }
  2472.                         }
  2473.                         return true;
  2474.                 } :
  2475.                 matchers[ 0 ];
  2476. }
  2477.  
  2478. function multipleContexts( selector, contexts, results ) {
  2479.         var i = 0,
  2480.                 len = contexts.length;
  2481.         for ( ; i < len; i++ ) {
  2482.                 Sizzle( selector, contexts[ i ], results );
  2483.         }
  2484.         return results;
  2485. }
  2486.  
  2487. function condense( unmatched, map, filter, context, xml ) {
  2488.         var elem,
  2489.                 newUnmatched = [],
  2490.                 i = 0,
  2491.                 len = unmatched.length,
  2492.                 mapped = map != null;
  2493.  
  2494.         for ( ; i < len; i++ ) {
  2495.                 if ( ( elem = unmatched[ i ] ) ) {
  2496.                         if ( !filter || filter( elem, context, xml ) ) {
  2497.                                 newUnmatched.push( elem );
  2498.                                 if ( mapped ) {
  2499.                                         map.push( i );
  2500.                                 }
  2501.                         }
  2502.                 }
  2503.         }
  2504.  
  2505.         return newUnmatched;
  2506. }
  2507.  
  2508. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2509.         if ( postFilter && !postFilter[ expando ] ) {
  2510.                 postFilter = setMatcher( postFilter );
  2511.         }
  2512.         if ( postFinder && !postFinder[ expando ] ) {
  2513.                 postFinder = setMatcher( postFinder, postSelector );
  2514.         }
  2515.         return markFunction( function( seed, results, context, xml ) {
  2516.                 var temp, i, elem,
  2517.                         preMap = [],
  2518.                         postMap = [],
  2519.                         preexisting = results.length,
  2520.  
  2521.                         // Get initial elements from seed or context
  2522.                         elems = seed || multipleContexts(
  2523.                                 selector || "*",
  2524.                                 context.nodeType ? [ context ] : context,
  2525.                                 []
  2526.                         ),
  2527.  
  2528.                         // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2529.                         matcherIn = preFilter && ( seed || !selector ) ?
  2530.                                 condense( elems, preMap, preFilter, context, xml ) :
  2531.                                 elems,
  2532.  
  2533.                         matcherOut = matcher ?
  2534.  
  2535.                                 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2536.                                 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2537.  
  2538.                                         // ...intermediate processing is necessary
  2539.                                         [] :
  2540.  
  2541.                                         // ...otherwise use results directly
  2542.                                         results :
  2543.                                 matcherIn;
  2544.  
  2545.                 // Find primary matches
  2546.                 if ( matcher ) {
  2547.                         matcher( matcherIn, matcherOut, context, xml );
  2548.                 }
  2549.  
  2550.                 // Apply postFilter
  2551.                 if ( postFilter ) {
  2552.                         temp = condense( matcherOut, postMap );
  2553.                         postFilter( temp, [], context, xml );
  2554.  
  2555.                         // Un-match failing elements by moving them back to matcherIn
  2556.                         i = temp.length;
  2557.                         while ( i-- ) {
  2558.                                 if ( ( elem = temp[ i ] ) ) {
  2559.                                         matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2560.                                 }
  2561.                         }
  2562.                 }
  2563.  
  2564.                 if ( seed ) {
  2565.                         if ( postFinder || preFilter ) {
  2566.                                 if ( postFinder ) {
  2567.  
  2568.                                         // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2569.                                         temp = [];
  2570.                                         i = matcherOut.length;
  2571.                                         while ( i-- ) {
  2572.                                                 if ( ( elem = matcherOut[ i ] ) ) {
  2573.  
  2574.                                                         // Restore matcherIn since elem is not yet a final match
  2575.                                                         temp.push( ( matcherIn[ i ] = elem ) );
  2576.                                                 }
  2577.                                         }
  2578.                                         postFinder( null, ( matcherOut = [] ), temp, xml );
  2579.                                 }
  2580.  
  2581.                                 // Move matched elements from seed to results to keep them synchronized
  2582.                                 i = matcherOut.length;
  2583.                                 while ( i-- ) {
  2584.                                         if ( ( elem = matcherOut[ i ] ) &&
  2585.                                                 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  2586.  
  2587.                                                 seed[ temp ] = !( results[ temp ] = elem );
  2588.                                         }
  2589.                                 }
  2590.                         }
  2591.  
  2592.                 // Add elements to results, through postFinder if defined
  2593.                 } else {
  2594.                         matcherOut = condense(
  2595.                                 matcherOut === results ?
  2596.                                         matcherOut.splice( preexisting, matcherOut.length ) :
  2597.                                         matcherOut
  2598.                         );
  2599.                         if ( postFinder ) {
  2600.                                 postFinder( null, results, matcherOut, xml );
  2601.                         } else {
  2602.                                 push.apply( results, matcherOut );
  2603.                         }
  2604.                 }
  2605.         } );
  2606. }
  2607.  
  2608. function matcherFromTokens( tokens ) {
  2609.         var checkContext, matcher, j,
  2610.                 len = tokens.length,
  2611.                 leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2612.                 implicitRelative = leadingRelative || Expr.relative[ " " ],
  2613.                 i = leadingRelative ? 1 : 0,
  2614.  
  2615.                 // The foundational matcher ensures that elements are reachable from top-level context(s)
  2616.                 matchContext = addCombinator( function( elem ) {
  2617.                         return elem === checkContext;
  2618.                 }, implicitRelative, true ),
  2619.                 matchAnyContext = addCombinator( function( elem ) {
  2620.                         return indexOf( checkContext, elem ) > -1;
  2621.                 }, implicitRelative, true ),
  2622.                 matchers = [ function( elem, context, xml ) {
  2623.                         var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2624.                                 ( checkContext = context ).nodeType ?
  2625.                                         matchContext( elem, context, xml ) :
  2626.                                         matchAnyContext( elem, context, xml ) );
  2627.  
  2628.                         // Avoid hanging onto element (issue #299)
  2629.                         checkContext = null;
  2630.                         return ret;
  2631.                 } ];
  2632.  
  2633.         for ( ; i < len; i++ ) {
  2634.                 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2635.                         matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2636.                 } else {
  2637.                         matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2638.  
  2639.                         // Return special upon seeing a positional matcher
  2640.                         if ( matcher[ expando ] ) {
  2641.  
  2642.                                 // Find the next relative operator (if any) for proper handling
  2643.                                 j = ++i;
  2644.                                 for ( ; j < len; j++ ) {
  2645.                                         if ( Expr.relative[ tokens[ j ].type ] ) {
  2646.                                                 break;
  2647.                                         }
  2648.                                 }
  2649.                                 return setMatcher(
  2650.                                         i > 1 && elementMatcher( matchers ),
  2651.                                         i > 1 && toSelector(
  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 === " " ? "*" : "" } )
  2657.                                         ).replace( rtrim, "$1" ),
  2658.                                         matcher,
  2659.                                         i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2660.                                         j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2661.                                         j < len && toSelector( tokens )
  2662.                                 );
  2663.                         }
  2664.                         matchers.push( matcher );
  2665.                 }
  2666.         }
  2667.  
  2668.         return elementMatcher( matchers );
  2669. }
  2670.  
  2671. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2672.         var bySet = setMatchers.length > 0,
  2673.                 byElement = elementMatchers.length > 0,
  2674.                 superMatcher = function( seed, context, xml, results, outermost ) {
  2675.                         var elem, j, matcher,
  2676.                                 matchedCount = 0,
  2677.                                 i = "0",
  2678.                                 unmatched = seed && [],
  2679.                                 setMatched = [],
  2680.                                 contextBackup = outermostContext,
  2681.  
  2682.                                 // We must always have either seed elements or outermost context
  2683.                                 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  2684.  
  2685.                                 // Use integer dirruns iff this is the outermost matcher
  2686.                                 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2687.                                 len = elems.length;
  2688.  
  2689.                         if ( 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;
  2696.                         }
  2697.  
  2698.                         // Add elements passing elementMatchers directly to results
  2699.                         // Support: IE<9, Safari
  2700.                         // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2701.                         for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2702.                                 if ( byElement && elem ) {
  2703.                                         j = 0;
  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 ) {
  2710.                                                 setDocument( elem );
  2711.                                                 xml = !documentIsHTML;
  2712.                                         }
  2713.                                         while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2714.                                                 if ( matcher( elem, context || document, xml ) ) {
  2715.                                                         results.push( elem );
  2716.                                                         break;
  2717.                                                 }
  2718.                                         }
  2719.                                         if ( outermost ) {
  2720.                                                 dirruns = dirrunsUnique;
  2721.                                         }
  2722.                                 }
  2723.  
  2724.                                 // Track unmatched elements for set filters
  2725.                                 if ( bySet ) {
  2726.  
  2727.                                         // They will have gone through all possible matchers
  2728.                                         if ( ( elem = !matcher && elem ) ) {
  2729.                                                 matchedCount--;
  2730.                                         }
  2731.  
  2732.                                         // Lengthen the array for every element, matched or not
  2733.                                         if ( seed ) {
  2734.                                                 unmatched.push( elem );
  2735.                                         }
  2736.                                 }
  2737.                         }
  2738.  
  2739.                         // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2740.                         // makes the latter nonnegative.
  2741.                         matchedCount += i;
  2742.  
  2743.                         // Apply set filters to unmatched elements
  2744.                         // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2745.                         // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2746.                         // no element matchers and no seed.
  2747.                         // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2748.                         // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2749.                         // numerically zero.
  2750.                         if ( bySet && i !== matchedCount ) {
  2751.                                 j = 0;
  2752.                                 while ( ( matcher = setMatchers[ j++ ] ) ) {
  2753.                                         matcher( unmatched, setMatched, context, xml );
  2754.                                 }
  2755.  
  2756.                                 if ( seed ) {
  2757.  
  2758.                                         // Reintegrate element matches to eliminate the need for sorting
  2759.                                         if ( matchedCount > 0 ) {
  2760.                                                 while ( i-- ) {
  2761.                                                         if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2762.                                                                 setMatched[ i ] = pop.call( results );
  2763.                                                         }
  2764.                                                 }
  2765.                                         }
  2766.  
  2767.                                         // Discard index placeholder values to get only actual matches
  2768.                                         setMatched = condense( setMatched );
  2769.                                 }
  2770.  
  2771.                                 // Add matches to results
  2772.                                 push.apply( results, setMatched );
  2773.  
  2774.                                 // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2775.                                 if ( outermost && !seed && setMatched.length > 0 &&
  2776.                                         ( matchedCount + setMatchers.length ) > 1 ) {
  2777.  
  2778.                                         Sizzle.uniqueSort( results );
  2779.                                 }
  2780.                         }
  2781.  
  2782.                         // Override manipulation of globals by nested matchers
  2783.                         if ( outermost ) {
  2784.                                 dirruns = dirrunsUnique;
  2785.                                 outermostContext = contextBackup;
  2786.                         }
  2787.  
  2788.                         return unmatched;
  2789.                 };
  2790.  
  2791.         return bySet ?
  2792.                 markFunction( superMatcher ) :
  2793.                 superMatcher;
  2794. }
  2795.  
  2796. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2797.         var i,
  2798.                 setMatchers = [],
  2799.                 elementMatchers = [],
  2800.                 cached = compilerCache[ selector + " " ];
  2801.  
  2802.         if ( !cached ) {
  2803.  
  2804.                 // Generate a function of recursive functions that can be used to check each element
  2805.                 if ( !match ) {
  2806.                         match = tokenize( selector );
  2807.                 }
  2808.                 i = match.length;
  2809.                 while ( i-- ) {
  2810.                         cached = matcherFromTokens( match[ i ] );
  2811.                         if ( cached[ expando ] ) {
  2812.                                 setMatchers.push( cached );
  2813.                         } else {
  2814.                                 elementMatchers.push( cached );
  2815.                         }
  2816.                 }
  2817.  
  2818.                 // Cache the compiled function
  2819.                 cached = compilerCache(
  2820.                         selector,
  2821.                         matcherFromGroupMatchers( elementMatchers, setMatchers )
  2822.                 );
  2823.  
  2824.                 // Save selector and tokenization
  2825.                 cached.selector = selector;
  2826.         }
  2827.         return cached;
  2828. };
  2829.  
  2830. /**
  2831.  * A low-level selection function that works with Sizzle's compiled
  2832.  *  selector functions
  2833.  * @param {String|Function} selector A selector or a pre-compiled
  2834.  *  selector function built with Sizzle.compile
  2835.  * @param {Element} context
  2836.  * @param {Array} [results]
  2837.  * @param {Array} [seed] A set of elements to match against
  2838.  */
  2839. select = Sizzle.select = function( selector, context, results, seed ) {
  2840.         var i, tokens, token, type, find,
  2841.                 compiled = typeof selector === "function" && selector,
  2842.                 match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2843.  
  2844.         results = results || [];
  2845.  
  2846.         // Try to minimize operations if there is only one selector in the list and no seed
  2847.         // (the latter of which guarantees us context)
  2848.         if ( match.length === 1 ) {
  2849.  
  2850.                 // Reduce context if the leading compound selector is an ID
  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 ] ) {
  2854.  
  2855.                         context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  2856.                                 .replace( runescape, funescape ), context ) || [] )[ 0 ];
  2857.                         if ( !context ) {
  2858.                                 return results;
  2859.  
  2860.                         // Precompiled matchers will still verify ancestry, so step up a level
  2861.                         } else if ( compiled ) {
  2862.                                 context = context.parentNode;
  2863.                         }
  2864.  
  2865.                         selector = selector.slice( tokens.shift().value.length );
  2866.                 }
  2867.  
  2868.                 // Fetch a seed set for right-to-left matching
  2869.                 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  2870.                 while ( i-- ) {
  2871.                         token = tokens[ i ];
  2872.  
  2873.                         // Abort if we hit a combinator
  2874.                         if ( Expr.relative[ ( type = token.type ) ] ) {
  2875.                                 break;
  2876.                         }
  2877.                         if ( ( find = Expr.find[ type ] ) ) {
  2878.  
  2879.                                 // Search, expanding context for leading sibling combinators
  2880.                                 if ( ( seed = find(
  2881.                                         token.matches[ 0 ].replace( runescape, funescape ),
  2882.                                         rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  2883.                                                 context
  2884.                                 ) ) ) {
  2885.  
  2886.                                         // If seed is empty or no tokens remain, we can return early
  2887.                                         tokens.splice( i, 1 );
  2888.                                         selector = seed.length && toSelector( tokens );
  2889.                                         if ( !selector ) {
  2890.                                                 push.apply( results, seed );
  2891.                                                 return results;
  2892.                                         }
  2893.  
  2894.                                         break;
  2895.                                 }
  2896.                         }
  2897.                 }
  2898.         }
  2899.  
  2900.         // Compile and execute a filtering function if one is not provided
  2901.         // Provide `match` to avoid retokenization if we modified the selector above
  2902.         ( compiled || compile( selector, match ) )(
  2903.                 seed,
  2904.                 context,
  2905.                 !documentIsHTML,
  2906.                 results,
  2907.                 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2908.         );
  2909.         return results;
  2910. };
  2911.  
  2912. // One-time assignments
  2913.  
  2914. // Sort stability
  2915. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2916.  
  2917. // Support: Chrome 14-35+
  2918. // Always assume duplicates if they aren't passed to the comparison function
  2919. support.detectDuplicates = !!hasDuplicate;
  2920.  
  2921. // Initialize against the default document
  2922. setDocument();
  2923.  
  2924. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2925. // Detached nodes confoundingly follow *each other*
  2926. support.sortDetached = assert( function( el ) {
  2927.  
  2928.         // Should return 1, but returns 4 (following)
  2929.         return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2930. } );
  2931.  
  2932. // Support: IE<8
  2933. // Prevent attribute/property "interpolation"
  2934. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2935. if ( !assert( function( el ) {
  2936.         el.innerHTML = "<a href='#'></a>";
  2937.         return el.firstChild.getAttribute( "href" ) === "#";
  2938. } ) ) {
  2939.         addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2940.                 if ( !isXML ) {
  2941.                         return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2942.                 }
  2943.         } );
  2944. }
  2945.  
  2946. // Support: IE<9
  2947. // Use defaultValue in place of getAttribute("value")
  2948. if ( !support.attributes || !assert( function( el ) {
  2949.         el.innerHTML = "<input/>";
  2950.         el.firstChild.setAttribute( "value", "" );
  2951.         return el.firstChild.getAttribute( "value" ) === "";
  2952. } ) ) {
  2953.         addHandle( "value", function( elem, _name, isXML ) {
  2954.                 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2955.                         return elem.defaultValue;
  2956.                 }
  2957.         } );
  2958. }
  2959.  
  2960. // Support: IE<9
  2961. // Use getAttributeNode to fetch booleans when getAttribute lies
  2962. if ( !assert( function( el ) {
  2963.         return el.getAttribute( "disabled" ) == null;
  2964. } ) ) {
  2965.         addHandle( booleans, function( elem, name, isXML ) {
  2966.                 var val;
  2967.                 if ( !isXML ) {
  2968.                         return elem[ name ] === true ? name.toLowerCase() :
  2969.                                 ( val = elem.getAttributeNode( name ) ) && val.specified ?
  2970.                                         val.value :
  2971.                                         null;
  2972.                 }
  2973.         } );
  2974. }
  2975.  
  2976. return Sizzle;
  2977.  
  2978. } )( window );
  2979.  
  2980.  
  2981.  
  2982. jQuery.find = Sizzle;
  2983. jQuery.expr = Sizzle.selectors;
  2984.  
  2985. // Deprecated
  2986. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2987. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2988. jQuery.text = Sizzle.getText;
  2989. jQuery.isXMLDoc = Sizzle.isXML;
  2990. jQuery.contains = Sizzle.contains;
  2991. jQuery.escapeSelector = Sizzle.escape;
  2992.  
  2993.  
  2994.  
  2995.  
  2996. var dir = function( elem, dir, until ) {
  2997.         var matched = [],
  2998.                 truncate = until !== undefined;
  2999.  
  3000.         while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  3001.                 if ( elem.nodeType === 1 ) {
  3002.                         if ( truncate && jQuery( elem ).is( until ) ) {
  3003.                                 break;
  3004.                         }
  3005.                         matched.push( elem );
  3006.                 }
  3007.         }
  3008.         return matched;
  3009. };
  3010.  
  3011.  
  3012. var siblings = function( n, elem ) {
  3013.         var matched = [];
  3014.  
  3015.         for ( ; n; n = n.nextSibling ) {
  3016.                 if ( n.nodeType === 1 && n !== elem ) {
  3017.                         matched.push( n );
  3018.                 }
  3019.         }
  3020.  
  3021.         return matched;
  3022. };
  3023.  
  3024.  
  3025. var rneedsContext = jQuery.expr.match.needsContext;
  3026.  
  3027.  
  3028.  
  3029. function nodeName( elem, name ) {
  3030.  
  3031.         return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  3032.  
  3033. }
  3034. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  3035.  
  3036.  
  3037.  
  3038. // Implement the identical functionality for filter and not
  3039. function winnow( elements, qualifier, not ) {
  3040.         if ( isFunction( qualifier ) ) {
  3041.                 return jQuery.grep( elements, function( elem, i ) {
  3042.                         return !!qualifier.call( elem, i, elem ) !== not;
  3043.                 } );
  3044.         }
  3045.  
  3046.         // Single element
  3047.         if ( qualifier.nodeType ) {
  3048.                 return jQuery.grep( elements, function( elem ) {
  3049.                         return ( elem === qualifier ) !== not;
  3050.                 } );
  3051.         }
  3052.  
  3053.         // Arraylike of elements (jQuery, arguments, Array)
  3054.         if ( typeof qualifier !== "string" ) {
  3055.                 return jQuery.grep( elements, function( elem ) {
  3056.                         return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  3057.                 } );
  3058.         }
  3059.  
  3060.         // Filtered directly for both simple and complex selectors
  3061.         return jQuery.filter( qualifier, elements, not );
  3062. }
  3063.  
  3064. jQuery.filter = function( expr, elems, not ) {
  3065.         var elem = elems[ 0 ];
  3066.  
  3067.         if ( not ) {
  3068.                 expr = ":not(" + expr + ")";
  3069.         }
  3070.  
  3071.         if ( elems.length === 1 && elem.nodeType === 1 ) {
  3072.                 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  3073.         }
  3074.  
  3075.         return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  3076.                 return elem.nodeType === 1;
  3077.         } ) );
  3078. };
  3079.  
  3080. jQuery.fn.extend( {
  3081.         find: function( selector ) {
  3082.                 var i, ret,
  3083.                         len = this.length,
  3084.                         self = this;
  3085.  
  3086.                 if ( typeof selector !== "string" ) {
  3087.                         return this.pushStack( jQuery( selector ).filter( function() {
  3088.                                 for ( i = 0; i < len; i++ ) {
  3089.                                         if ( jQuery.contains( self[ i ], this ) ) {
  3090.                                                 return true;
  3091.                                         }
  3092.                                 }
  3093.                         } ) );
  3094.                 }
  3095.  
  3096.                 ret = this.pushStack( [] );
  3097.  
  3098.                 for ( i = 0; i < len; i++ ) {
  3099.                         jQuery.find( selector, self[ i ], ret );
  3100.                 }
  3101.  
  3102.                 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  3103.         },
  3104.         filter: function( selector ) {
  3105.                 return this.pushStack( winnow( this, selector || [], false ) );
  3106.         },
  3107.         not: function( selector ) {
  3108.                 return this.pushStack( winnow( this, selector || [], true ) );
  3109.         },
  3110.         is: function( selector ) {
  3111.                 return !!winnow(
  3112.                         this,
  3113.  
  3114.                         // If this is a positional/relative selector, check membership in the returned set
  3115.                         // so $("p:first").is("p:last") won't return true for a doc with two "p".
  3116.                         typeof selector === "string" && rneedsContext.test( selector ) ?
  3117.                                 jQuery( selector ) :
  3118.                                 selector || [],
  3119.                         false
  3120.                 ).length;
  3121.         }
  3122. } );
  3123.  
  3124.  
  3125. // Initialize a jQuery object
  3126.  
  3127.  
  3128. // A central reference to the root jQuery(document)
  3129. var rootjQuery,
  3130.  
  3131.         // A simple way to check for HTML strings
  3132.         // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
  3133.         // Strict HTML recognition (trac-11290: must start with <)
  3134.         // Shortcut simple #id case for speed
  3135.         rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  3136.  
  3137.         init = jQuery.fn.init = function( selector, context, root ) {
  3138.                 var match, elem;
  3139.  
  3140.                 // HANDLE: $(""), $(null), $(undefined), $(false)
  3141.                 if ( !selector ) {
  3142.                         return this;
  3143.                 }
  3144.  
  3145.                 // Method init() accepts an alternate rootjQuery
  3146.                 // so migrate can support jQuery.sub (gh-2101)
  3147.                 root = root || rootjQuery;
  3148.  
  3149.                 // Handle HTML strings
  3150.                 if ( typeof selector === "string" ) {
  3151.                         if ( selector[ 0 ] === "<" &&
  3152.                                 selector[ selector.length - 1 ] === ">" &&
  3153.                                 selector.length >= 3 ) {
  3154.  
  3155.                                 // Assume that strings that start and end with <> are HTML and skip the regex check
  3156.                                 match = [ null, selector, null ];
  3157.  
  3158.                         } else {
  3159.                                 match = rquickExpr.exec( selector );
  3160.                         }
  3161.  
  3162.                         // Match html or make sure no context is specified for #id
  3163.                         if ( match && ( match[ 1 ] || !context ) ) {
  3164.  
  3165.                                 // HANDLE: $(html) -> $(array)
  3166.                                 if ( match[ 1 ] ) {
  3167.                                         context = context instanceof jQuery ? context[ 0 ] : context;
  3168.  
  3169.                                         // Option to run scripts is true for back-compat
  3170.                                         // Intentionally let the error be thrown if parseHTML is not present
  3171.                                         jQuery.merge( this, jQuery.parseHTML(
  3172.                                                 match[ 1 ],
  3173.                                                 context && context.nodeType ? context.ownerDocument || context : document,
  3174.                                                 true
  3175.                                         ) );
  3176.  
  3177.                                         // HANDLE: $(html, props)
  3178.                                         if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  3179.                                                 for ( match in context ) {
  3180.  
  3181.                                                         // Properties of context are called as methods if possible
  3182.                                                         if ( isFunction( this[ match ] ) ) {
  3183.                                                                 this[ match ]( context[ match ] );
  3184.  
  3185.                                                         // ...and otherwise set as attributes
  3186.                                                         } else {
  3187.                                                                 this.attr( match, context[ match ] );
  3188.                                                         }
  3189.                                                 }
  3190.                                         }
  3191.  
  3192.                                         return this;
  3193.  
  3194.                                 // HANDLE: $(#id)
  3195.                                 } else {
  3196.                                         elem = document.getElementById( match[ 2 ] );
  3197.  
  3198.                                         if ( elem ) {
  3199.  
  3200.                                                 // Inject the element directly into the jQuery object
  3201.                                                 this[ 0 ] = elem;
  3202.                                                 this.length = 1;
  3203.                                         }
  3204.                                         return this;
  3205.                                 }
  3206.  
  3207.                         // HANDLE: $(expr, $(...))
  3208.                         } else if ( !context || context.jquery ) {
  3209.                                 return ( context || root ).find( selector );
  3210.  
  3211.                         // HANDLE: $(expr, context)
  3212.                         // (which is just equivalent to: $(context).find(expr)
  3213.                         } else {
  3214.                                 return this.constructor( context ).find( selector );
  3215.                         }
  3216.  
  3217.                 // HANDLE: $(DOMElement)
  3218.                 } else if ( selector.nodeType ) {
  3219.                         this[ 0 ] = selector;
  3220.                         this.length = 1;
  3221.                         return this;
  3222.  
  3223.                 // HANDLE: $(function)
  3224.                 // Shortcut for document ready
  3225.                 } else if ( isFunction( selector ) ) {
  3226.                         return root.ready !== undefined ?
  3227.                                 root.ready( selector ) :
  3228.  
  3229.                                 // Execute immediately if ready is not present
  3230.                                 selector( jQuery );
  3231.                 }
  3232.  
  3233.                 return jQuery.makeArray( selector, this );
  3234.         };
  3235.  
  3236. // Give the init function the jQuery prototype for later instantiation
  3237. init.prototype = jQuery.fn;
  3238.  
  3239. // Initialize central reference
  3240. rootjQuery = jQuery( document );
  3241.  
  3242.  
  3243. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  3244.  
  3245.         // Methods guaranteed to produce a unique set when starting from a unique set
  3246.         guaranteedUnique = {
  3247.                 children: true,
  3248.                 contents: true,
  3249.                 next: true,
  3250.                 prev: true
  3251.         };
  3252.  
  3253. jQuery.fn.extend( {
  3254.         has: function( target ) {
  3255.                 var targets = jQuery( target, this ),
  3256.                         l = targets.length;
  3257.  
  3258.                 return this.filter( function() {
  3259.                         var i = 0;
  3260.                         for ( ; i < l; i++ ) {
  3261.                                 if ( jQuery.contains( this, targets[ i ] ) ) {
  3262.                                         return true;
  3263.                                 }
  3264.                         }
  3265.                 } );
  3266.         },
  3267.  
  3268.         closest: function( selectors, context ) {
  3269.                 var cur,
  3270.                         i = 0,
  3271.                         l = this.length,
  3272.                         matched = [],
  3273.                         targets = typeof selectors !== "string" && jQuery( selectors );
  3274.  
  3275.                 // Positional selectors never match, since there's no _selection_ context
  3276.                 if ( !rneedsContext.test( selectors ) ) {
  3277.                         for ( ; i < l; i++ ) {
  3278.                                 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  3279.  
  3280.                                         // Always skip document fragments
  3281.                                         if ( cur.nodeType < 11 && ( targets ?
  3282.                                                 targets.index( cur ) > -1 :
  3283.  
  3284.                                                 // Don't pass non-elements to Sizzle
  3285.                                                 cur.nodeType === 1 &&
  3286.                                                         jQuery.find.matchesSelector( cur, selectors ) ) ) {
  3287.  
  3288.                                                 matched.push( cur );
  3289.                                                 break;
  3290.                                         }
  3291.                                 }
  3292.                         }
  3293.                 }
  3294.  
  3295.                 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  3296.         },
  3297.  
  3298.         // Determine the position of an element within the set
  3299.         index: function( elem ) {
  3300.  
  3301.                 // No argument, return index in parent
  3302.                 if ( !elem ) {
  3303.                         return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  3304.                 }
  3305.  
  3306.                 // Index in selector
  3307.                 if ( typeof elem === "string" ) {
  3308.                         return indexOf.call( jQuery( elem ), this[ 0 ] );
  3309.                 }
  3310.  
  3311.                 // Locate the position of the desired element
  3312.                 return indexOf.call( this,
  3313.  
  3314.                         // If it receives a jQuery object, the first element is used
  3315.                         elem.jquery ? elem[ 0 ] : elem
  3316.                 );
  3317.         },
  3318.  
  3319.         add: function( selector, context ) {
  3320.                 return this.pushStack(
  3321.                         jQuery.uniqueSort(
  3322.                                 jQuery.merge( this.get(), jQuery( selector, context ) )
  3323.                         )
  3324.                 );
  3325.         },
  3326.  
  3327.         addBack: function( selector ) {
  3328.                 return this.add( selector == null ?
  3329.                         this.prevObject : this.prevObject.filter( selector )
  3330.                 );
  3331.         }
  3332. } );
  3333.  
  3334. function sibling( cur, dir ) {
  3335.         while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  3336.         return cur;
  3337. }
  3338.  
  3339. jQuery.each( {
  3340.         parent: function( elem ) {
  3341.                 var parent = elem.parentNode;
  3342.                 return parent && parent.nodeType !== 11 ? parent : null;
  3343.         },
  3344.         parents: function( elem ) {
  3345.                 return dir( elem, "parentNode" );
  3346.         },
  3347.         parentsUntil: function( elem, _i, until ) {
  3348.                 return dir( elem, "parentNode", until );
  3349.         },
  3350.         next: function( elem ) {
  3351.                 return sibling( elem, "nextSibling" );
  3352.         },
  3353.         prev: function( elem ) {
  3354.                 return sibling( elem, "previousSibling" );
  3355.         },
  3356.         nextAll: function( elem ) {
  3357.                 return dir( elem, "nextSibling" );
  3358.         },
  3359.         prevAll: function( elem ) {
  3360.                 return dir( elem, "previousSibling" );
  3361.         },
  3362.         nextUntil: function( elem, _i, until ) {
  3363.                 return dir( elem, "nextSibling", until );
  3364.         },
  3365.         prevUntil: function( elem, _i, until ) {
  3366.                 return dir( elem, "previousSibling", until );
  3367.         },
  3368.         siblings: function( elem ) {
  3369.                 return siblings( ( elem.parentNode || {} ).firstChild, elem );
  3370.         },
  3371.         children: function( elem ) {
  3372.                 return siblings( elem.firstChild );
  3373.         },
  3374.         contents: function( elem ) {
  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.  
  3382.                         return elem.contentDocument;
  3383.                 }
  3384.  
  3385.                 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  3386.                 // Treat the template element as a regular one in browsers that
  3387.                 // don't support it.
  3388.                 if ( nodeName( elem, "template" ) ) {
  3389.                         elem = elem.content || elem;
  3390.                 }
  3391.  
  3392.                 return jQuery.merge( [], elem.childNodes );
  3393.         }
  3394. }, function( name, fn ) {
  3395.         jQuery.fn[ name ] = function( until, selector ) {
  3396.                 var matched = jQuery.map( this, fn, until );
  3397.  
  3398.                 if ( name.slice( -5 ) !== "Until" ) {
  3399.                         selector = until;
  3400.                 }
  3401.  
  3402.                 if ( selector && typeof selector === "string" ) {
  3403.                         matched = jQuery.filter( selector, matched );
  3404.                 }
  3405.  
  3406.                 if ( this.length > 1 ) {
  3407.  
  3408.                         // Remove duplicates
  3409.                         if ( !guaranteedUnique[ name ] ) {
  3410.                                 jQuery.uniqueSort( matched );
  3411.                         }
  3412.  
  3413.                         // Reverse order for parents* and prev-derivatives
  3414.                         if ( rparentsprev.test( name ) ) {
  3415.                                 matched.reverse();
  3416.                         }
  3417.                 }
  3418.  
  3419.                 return this.pushStack( matched );
  3420.         };
  3421. } );
  3422. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  3423.  
  3424.  
  3425.  
  3426. // Convert String-formatted options into Object-formatted ones
  3427. function createOptions( options ) {
  3428.         var object = {};
  3429.         jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  3430.                 object[ flag ] = true;
  3431.         } );
  3432.         return object;
  3433. }
  3434.  
  3435. /*
  3436.  * Create a callback list using the following parameters:
  3437.  *
  3438.  *      options: an optional list of space-separated options that will change how
  3439.  *                      the callback list behaves or a more traditional option object
  3440.  *
  3441.  * By default a callback list will act like an event callback list and can be
  3442.  * "fired" multiple times.
  3443.  *
  3444.  * Possible options:
  3445.  *
  3446.  *      once:                   will ensure the callback list can only be fired once (like a Deferred)
  3447.  *
  3448.  *      memory:                 will keep track of previous values and will call any callback added
  3449.  *                                      after the list has been fired right away with the latest "memorized"
  3450.  *                                      values (like a Deferred)
  3451.  *
  3452.  *      unique:                 will ensure a callback can only be added once (no duplicate in the list)
  3453.  *
  3454.  *      stopOnFalse:    interrupt callings when a callback returns false
  3455.  *
  3456.  */
  3457. jQuery.Callbacks = function( options ) {
  3458.  
  3459.         // Convert options from String-formatted to Object-formatted if needed
  3460.         // (we check in cache first)
  3461.         options = typeof options === "string" ?
  3462.                 createOptions( options ) :
  3463.                 jQuery.extend( {}, options );
  3464.  
  3465.         var // Flag to know if list is currently firing
  3466.                 firing,
  3467.  
  3468.                 // Last fire value for non-forgettable lists
  3469.                 memory,
  3470.  
  3471.                 // Flag to know if list was already fired
  3472.                 fired,
  3473.  
  3474.                 // Flag to prevent firing
  3475.                 locked,
  3476.  
  3477.                 // Actual callback list
  3478.                 list = [],
  3479.  
  3480.                 // Queue of execution data for repeatable lists
  3481.                 queue = [],
  3482.  
  3483.                 // Index of currently firing callback (modified by add/remove as needed)
  3484.                 firingIndex = -1,
  3485.  
  3486.                 // Fire callbacks
  3487.                 fire = function() {
  3488.  
  3489.                         // Enforce single-firing
  3490.                         locked = locked || options.once;
  3491.  
  3492.                         // Execute callbacks for all pending executions,
  3493.                         // respecting firingIndex overrides and runtime changes
  3494.                         fired = firing = true;
  3495.                         for ( ; queue.length; firingIndex = -1 ) {
  3496.                                 memory = queue.shift();
  3497.                                 while ( ++firingIndex < list.length ) {
  3498.  
  3499.                                         // Run callback and check for early termination
  3500.                                         if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  3501.                                                 options.stopOnFalse ) {
  3502.  
  3503.                                                 // Jump to end and forget the data so .add doesn't re-fire
  3504.                                                 firingIndex = list.length;
  3505.                                                 memory = false;
  3506.                                         }
  3507.                                 }
  3508.                         }
  3509.  
  3510.                         // Forget the data if we're done with it
  3511.                         if ( !options.memory ) {
  3512.                                 memory = false;
  3513.                         }
  3514.  
  3515.                         firing = false;
  3516.  
  3517.                         // Clean up if we're done firing for good
  3518.                         if ( locked ) {
  3519.  
  3520.                                 // Keep an empty list if we have data for future add calls
  3521.                                 if ( memory ) {
  3522.                                         list = [];
  3523.  
  3524.                                 // Otherwise, this object is spent
  3525.                                 } else {
  3526.                                         list = "";
  3527.                                 }
  3528.                         }
  3529.                 },
  3530.  
  3531.                 // Actual Callbacks object
  3532.                 self = {
  3533.  
  3534.                         // Add a callback or a collection of callbacks to the list
  3535.                         add: function() {
  3536.                                 if ( list ) {
  3537.  
  3538.                                         // If we have memory from a past run, we should fire after adding
  3539.                                         if ( memory && !firing ) {
  3540.                                                 firingIndex = list.length - 1;
  3541.                                                 queue.push( memory );
  3542.                                         }
  3543.  
  3544.                                         ( function add( args ) {
  3545.                                                 jQuery.each( args, function( _, arg ) {
  3546.                                                         if ( isFunction( arg ) ) {
  3547.                                                                 if ( !options.unique || !self.has( arg ) ) {
  3548.                                                                         list.push( arg );
  3549.                                                                 }
  3550.                                                         } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  3551.  
  3552.                                                                 // Inspect recursively
  3553.                                                                 add( arg );
  3554.                                                         }
  3555.                                                 } );
  3556.                                         } )( arguments );
  3557.  
  3558.                                         if ( memory && !firing ) {
  3559.                                                 fire();
  3560.                                         }
  3561.                                 }
  3562.                                 return this;
  3563.                         },
  3564.  
  3565.                         // Remove a callback from the list
  3566.                         remove: function() {
  3567.                                 jQuery.each( arguments, function( _, arg ) {
  3568.                                         var index;
  3569.                                         while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  3570.                                                 list.splice( index, 1 );
  3571.  
  3572.                                                 // Handle firing indexes
  3573.                                                 if ( index <= firingIndex ) {
  3574.                                                         firingIndex--;
  3575.                                                 }
  3576.                                         }
  3577.                                 } );
  3578.                                 return this;
  3579.                         },
  3580.  
  3581.                         // Check if a given callback is in the list.
  3582.                         // If no argument is given, return whether or not list has callbacks attached.
  3583.                         has: function( fn ) {
  3584.                                 return fn ?
  3585.                                         jQuery.inArray( fn, list ) > -1 :
  3586.                                         list.length > 0;
  3587.                         },
  3588.  
  3589.                         // Remove all callbacks from the list
  3590.                         empty: function() {
  3591.                                 if ( list ) {
  3592.                                         list = [];
  3593.                                 }
  3594.                                 return this;
  3595.                         },
  3596.  
  3597.                         // Disable .fire and .add
  3598.                         // Abort any current/pending executions
  3599.                         // Clear all callbacks and values
  3600.                         disable: function() {
  3601.                                 locked = queue = [];
  3602.                                 list = memory = "";
  3603.                                 return this;
  3604.                         },
  3605.                         disabled: function() {
  3606.                                 return !list;
  3607.                         },
  3608.  
  3609.                         // Disable .fire
  3610.                         // Also disable .add unless we have memory (since it would have no effect)
  3611.                         // Abort any pending executions
  3612.                         lock: function() {
  3613.                                 locked = queue = [];
  3614.                                 if ( !memory && !firing ) {
  3615.                                         list = memory = "";
  3616.                                 }
  3617.                                 return this;
  3618.                         },
  3619.                         locked: function() {
  3620.                                 return !!locked;
  3621.                         },
  3622.  
  3623.                         // Call all callbacks with the given context and arguments
  3624.                         fireWith: function( context, args ) {
  3625.                                 if ( !locked ) {
  3626.                                         args = args || [];
  3627.                                         args = [ context, args.slice ? args.slice() : args ];
  3628.                                         queue.push( args );
  3629.                                         if ( !firing ) {
  3630.                                                 fire();
  3631.                                         }
  3632.                                 }
  3633.                                 return this;
  3634.                         },
  3635.  
  3636.                         // Call all the callbacks with the given arguments
  3637.                         fire: function() {
  3638.                                 self.fireWith( this, arguments );
  3639.                                 return this;
  3640.                         },
  3641.  
  3642.                         // To know if the callbacks have already been called at least once
  3643.                         fired: function() {
  3644.                                 return !!fired;
  3645.                         }
  3646.                 };
  3647.  
  3648.         return self;
  3649. };
  3650.  
  3651.  
  3652. function Identity( v ) {
  3653.         return v;
  3654. }
  3655. function Thrower( ex ) {
  3656.         throw ex;
  3657. }
  3658.  
  3659. function adoptValue( value, resolve, reject, noValue ) {
  3660.         var method;
  3661.  
  3662.         try {
  3663.  
  3664.                 // Check for promise aspect first to privilege synchronous behavior
  3665.                 if ( value && isFunction( ( method = value.promise ) ) ) {
  3666.                         method.call( value ).done( resolve ).fail( reject );
  3667.  
  3668.                 // Other thenables
  3669.                 } else if ( value && isFunction( ( method = value.then ) ) ) {
  3670.                         method.call( value, resolve, reject );
  3671.  
  3672.                 // Other non-thenables
  3673.                 } else {
  3674.  
  3675.                         // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  3676.                         // * false: [ value ].slice( 0 ) => resolve( value )
  3677.                         // * true: [ value ].slice( 1 ) => resolve()
  3678.                         resolve.apply( undefined, [ value ].slice( noValue ) );
  3679.                 }
  3680.  
  3681.         // For Promises/A+, convert exceptions into rejections
  3682.         // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3683.         // Deferred#then to conditionally suppress rejection.
  3684.         } catch ( value ) {
  3685.  
  3686.                 // Support: Android 4.0 only
  3687.                 // Strict mode functions invoked without .call/.apply get global-object context
  3688.                 reject.apply( undefined, [ value ] );
  3689.         }
  3690. }
  3691.  
  3692. jQuery.extend( {
  3693.  
  3694.         Deferred: function( func ) {
  3695.                 var tuples = [
  3696.  
  3697.                                 // action, add listener, callbacks,
  3698.                                 // ... .then handlers, argument index, [final state]
  3699.                                 [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3700.                                         jQuery.Callbacks( "memory" ), 2 ],
  3701.                                 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3702.                                         jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3703.                                 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3704.                                         jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3705.                         ],
  3706.                         state = "pending",
  3707.                         promise = {
  3708.                                 state: function() {
  3709.                                         return state;
  3710.                                 },
  3711.                                 always: function() {
  3712.                                         deferred.done( arguments ).fail( arguments );
  3713.                                         return this;
  3714.                                 },
  3715.                                 "catch": function( fn ) {
  3716.                                         return promise.then( null, fn );
  3717.                                 },
  3718.  
  3719.                                 // Keep pipe for back-compat
  3720.                                 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3721.                                         var fns = arguments;
  3722.  
  3723.                                         return jQuery.Deferred( function( newDefer ) {
  3724.                                                 jQuery.each( tuples, function( _i, tuple ) {
  3725.  
  3726.                                                         // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3727.                                                         var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3728.  
  3729.                                                         // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3730.                                                         // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3731.                                                         // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3732.                                                         deferred[ tuple[ 1 ] ]( function() {
  3733.                                                                 var returned = fn && fn.apply( this, arguments );
  3734.                                                                 if ( returned && isFunction( returned.promise ) ) {
  3735.                                                                         returned.promise()
  3736.                                                                                 .progress( newDefer.notify )
  3737.                                                                                 .done( newDefer.resolve )
  3738.                                                                                 .fail( newDefer.reject );
  3739.                                                                 } else {
  3740.                                                                         newDefer[ tuple[ 0 ] + "With" ](
  3741.                                                                                 this,
  3742.                                                                                 fn ? [ returned ] : arguments
  3743.                                                                         );
  3744.                                                                 }
  3745.                                                         } );
  3746.                                                 } );
  3747.                                                 fns = null;
  3748.                                         } ).promise();
  3749.                                 },
  3750.                                 then: function( onFulfilled, onRejected, onProgress ) {
  3751.                                         var maxDepth = 0;
  3752.                                         function resolve( depth, deferred, handler, special ) {
  3753.                                                 return function() {
  3754.                                                         var that = this,
  3755.                                                                 args = arguments,
  3756.                                                                 mightThrow = function() {
  3757.                                                                         var returned, then;
  3758.  
  3759.                                                                         // Support: Promises/A+ section 2.3.3.3.3
  3760.                                                                         // https://promisesaplus.com/#point-59
  3761.                                                                         // Ignore double-resolution attempts
  3762.                                                                         if ( depth < maxDepth ) {
  3763.                                                                                 return;
  3764.                                                                         }
  3765.  
  3766.                                                                         returned = handler.apply( that, args );
  3767.  
  3768.                                                                         // Support: Promises/A+ section 2.3.1
  3769.                                                                         // https://promisesaplus.com/#point-48
  3770.                                                                         if ( returned === deferred.promise() ) {
  3771.                                                                                 throw new TypeError( "Thenable self-resolution" );
  3772.                                                                         }
  3773.  
  3774.                                                                         // Support: Promises/A+ sections 2.3.3.1, 3.5
  3775.                                                                         // https://promisesaplus.com/#point-54
  3776.                                                                         // https://promisesaplus.com/#point-75
  3777.                                                                         // Retrieve `then` only once
  3778.                                                                         then = returned &&
  3779.  
  3780.                                                                                 // Support: Promises/A+ section 2.3.4
  3781.                                                                                 // https://promisesaplus.com/#point-64
  3782.                                                                                 // Only check objects and functions for thenability
  3783.                                                                                 ( typeof returned === "object" ||
  3784.                                                                                         typeof returned === "function" ) &&
  3785.                                                                                 returned.then;
  3786.  
  3787.                                                                         // Handle a returned thenable
  3788.                                                                         if ( isFunction( then ) ) {
  3789.  
  3790.                                                                                 // Special processors (notify) just wait for resolution
  3791.                                                                                 if ( special ) {
  3792.                                                                                         then.call(
  3793.                                                                                                 returned,
  3794.                                                                                                 resolve( maxDepth, deferred, Identity, special ),
  3795.                                                                                                 resolve( maxDepth, deferred, Thrower, special )
  3796.                                                                                         );
  3797.  
  3798.                                                                                 // Normal processors (resolve) also hook into progress
  3799.                                                                                 } else {
  3800.  
  3801.                                                                                         // ...and disregard older resolution values
  3802.                                                                                         maxDepth++;
  3803.  
  3804.                                                                                         then.call(
  3805.                                                                                                 returned,
  3806.                                                                                                 resolve( maxDepth, deferred, Identity, special ),
  3807.                                                                                                 resolve( maxDepth, deferred, Thrower, special ),
  3808.                                                                                                 resolve( maxDepth, deferred, Identity,
  3809.                                                                                                         deferred.notifyWith )
  3810.                                                                                         );
  3811.                                                                                 }
  3812.  
  3813.                                                                         // Handle all other returned values
  3814.                                                                         } else {
  3815.  
  3816.                                                                                 // Only substitute handlers pass on context
  3817.                                                                                 // and multiple values (non-spec behavior)
  3818.                                                                                 if ( handler !== Identity ) {
  3819.                                                                                         that = undefined;
  3820.                                                                                         args = [ returned ];
  3821.                                                                                 }
  3822.  
  3823.                                                                                 // Process the value(s)
  3824.                                                                                 // Default process is resolve
  3825.                                                                                 ( special || deferred.resolveWith )( that, args );
  3826.                                                                         }
  3827.                                                                 },
  3828.  
  3829.                                                                 // Only normal processors (resolve) catch and reject exceptions
  3830.                                                                 process = special ?
  3831.                                                                         mightThrow :
  3832.                                                                         function() {
  3833.                                                                                 try {
  3834.                                                                                         mightThrow();
  3835.                                                                                 } catch ( e ) {
  3836.  
  3837.                                                                                         if ( jQuery.Deferred.exceptionHook ) {
  3838.                                                                                                 jQuery.Deferred.exceptionHook( e,
  3839.                                                                                                         process.stackTrace );
  3840.                                                                                         }
  3841.  
  3842.                                                                                         // Support: Promises/A+ section 2.3.3.3.4.1
  3843.                                                                                         // https://promisesaplus.com/#point-61
  3844.                                                                                         // Ignore post-resolution exceptions
  3845.                                                                                         if ( depth + 1 >= maxDepth ) {
  3846.