jQuery Core slim

JavaScript library for DOM operations

当前为 2022-12-21 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/446667/1130436/jQuery%20Core%20slim.js

  1. /*!
  2. * jQuery JavaScript Library v3.6.3 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector
  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-12-20T21:28Z
  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.3 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector",
  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.9
  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: 2022-12-19
  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.  
  883. // `qSA` may not throw for unrecognized parts using forgiving parsing:
  884. // https://drafts.csswg.org/selectors/#forgiving-selector
  885. // like the `:has()` pseudo-class:
  886. // https://drafts.csswg.org/selectors/#relational
  887. // `CSS.supports` is still expected to return `false` then:
  888. // https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn
  889. // https://drafts.csswg.org/css-conditional-4/#dfn-support-selector
  890. if ( support.cssSupportsSelector &&
  891.  
  892. // eslint-disable-next-line no-undef
  893. !CSS.supports( "selector(:is(" + newSelector + "))" ) ) {
  894.  
  895. // Support: IE 11+
  896. // Throw to get to the same code path as an error directly in qSA.
  897. // Note: once we only support browser supporting
  898. // `CSS.supports('selector(...)')`, we can most likely drop
  899. // the `try-catch`. IE doesn't implement the API.
  900. throw new Error();
  901. }
  902.  
  903. push.apply( results,
  904. newContext.querySelectorAll( newSelector )
  905. );
  906. return results;
  907. } catch ( qsaError ) {
  908. nonnativeSelectorCache( selector, true );
  909. } finally {
  910. if ( nid === expando ) {
  911. context.removeAttribute( "id" );
  912. }
  913. }
  914. }
  915. }
  916. }
  917.  
  918. // All others
  919. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  920. }
  921.  
  922. /**
  923. * Create key-value caches of limited size
  924. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  925. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  926. * deleting the oldest entry
  927. */
  928. function createCache() {
  929. var keys = [];
  930.  
  931. function cache( key, value ) {
  932.  
  933. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  934. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  935.  
  936. // Only keep the most recent entries
  937. delete cache[ keys.shift() ];
  938. }
  939. return ( cache[ key + " " ] = value );
  940. }
  941. return cache;
  942. }
  943.  
  944. /**
  945. * Mark a function for special use by Sizzle
  946. * @param {Function} fn The function to mark
  947. */
  948. function markFunction( fn ) {
  949. fn[ expando ] = true;
  950. return fn;
  951. }
  952.  
  953. /**
  954. * Support testing using an element
  955. * @param {Function} fn Passed the created element and returns a boolean result
  956. */
  957. function assert( fn ) {
  958. var el = document.createElement( "fieldset" );
  959.  
  960. try {
  961. return !!fn( el );
  962. } catch ( e ) {
  963. return false;
  964. } finally {
  965.  
  966. // Remove from its parent by default
  967. if ( el.parentNode ) {
  968. el.parentNode.removeChild( el );
  969. }
  970.  
  971. // release memory in IE
  972. el = null;
  973. }
  974. }
  975.  
  976. /**
  977. * Adds the same handler for all of the specified attrs
  978. * @param {String} attrs Pipe-separated list of attributes
  979. * @param {Function} handler The method that will be applied
  980. */
  981. function addHandle( attrs, handler ) {
  982. var arr = attrs.split( "|" ),
  983. i = arr.length;
  984.  
  985. while ( i-- ) {
  986. Expr.attrHandle[ arr[ i ] ] = handler;
  987. }
  988. }
  989.  
  990. /**
  991. * Checks document order of two siblings
  992. * @param {Element} a
  993. * @param {Element} b
  994. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  995. */
  996. function siblingCheck( a, b ) {
  997. var cur = b && a,
  998. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  999. a.sourceIndex - b.sourceIndex;
  1000.  
  1001. // Use IE sourceIndex if available on both nodes
  1002. if ( diff ) {
  1003. return diff;
  1004. }
  1005.  
  1006. // Check if b follows a
  1007. if ( cur ) {
  1008. while ( ( cur = cur.nextSibling ) ) {
  1009. if ( cur === b ) {
  1010. return -1;
  1011. }
  1012. }
  1013. }
  1014.  
  1015. return a ? 1 : -1;
  1016. }
  1017.  
  1018. /**
  1019. * Returns a function to use in pseudos for input types
  1020. * @param {String} type
  1021. */
  1022. function createInputPseudo( type ) {
  1023. return function( elem ) {
  1024. var name = elem.nodeName.toLowerCase();
  1025. return name === "input" && elem.type === type;
  1026. };
  1027. }
  1028.  
  1029. /**
  1030. * Returns a function to use in pseudos for buttons
  1031. * @param {String} type
  1032. */
  1033. function createButtonPseudo( type ) {
  1034. return function( elem ) {
  1035. var name = elem.nodeName.toLowerCase();
  1036. return ( name === "input" || name === "button" ) && elem.type === type;
  1037. };
  1038. }
  1039.  
  1040. /**
  1041. * Returns a function to use in pseudos for :enabled/:disabled
  1042. * @param {Boolean} disabled true for :disabled; false for :enabled
  1043. */
  1044. function createDisabledPseudo( disabled ) {
  1045.  
  1046. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  1047. return function( elem ) {
  1048.  
  1049. // Only certain elements can match :enabled or :disabled
  1050. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  1051. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  1052. if ( "form" in elem ) {
  1053.  
  1054. // Check for inherited disabledness on relevant non-disabled elements:
  1055. // * listed form-associated elements in a disabled fieldset
  1056. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  1057. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  1058. // * option elements in a disabled optgroup
  1059. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  1060. // All such elements have a "form" property.
  1061. if ( elem.parentNode && elem.disabled === false ) {
  1062.  
  1063. // Option elements defer to a parent optgroup if present
  1064. if ( "label" in elem ) {
  1065. if ( "label" in elem.parentNode ) {
  1066. return elem.parentNode.disabled === disabled;
  1067. } else {
  1068. return elem.disabled === disabled;
  1069. }
  1070. }
  1071.  
  1072. // Support: IE 6 - 11
  1073. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  1074. return elem.isDisabled === disabled ||
  1075.  
  1076. // Where there is no isDisabled, check manually
  1077. /* jshint -W018 */
  1078. elem.isDisabled !== !disabled &&
  1079. inDisabledFieldset( elem ) === disabled;
  1080. }
  1081.  
  1082. return elem.disabled === disabled;
  1083.  
  1084. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  1085. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  1086. // even exist on them, let alone have a boolean value.
  1087. } else if ( "label" in elem ) {
  1088. return elem.disabled === disabled;
  1089. }
  1090.  
  1091. // Remaining elements are neither :enabled nor :disabled
  1092. return false;
  1093. };
  1094. }
  1095.  
  1096. /**
  1097. * Returns a function to use in pseudos for positionals
  1098. * @param {Function} fn
  1099. */
  1100. function createPositionalPseudo( fn ) {
  1101. return markFunction( function( argument ) {
  1102. argument = +argument;
  1103. return markFunction( function( seed, matches ) {
  1104. var j,
  1105. matchIndexes = fn( [], seed.length, argument ),
  1106. i = matchIndexes.length;
  1107.  
  1108. // Match elements found at the specified indexes
  1109. while ( i-- ) {
  1110. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  1111. seed[ j ] = !( matches[ j ] = seed[ j ] );
  1112. }
  1113. }
  1114. } );
  1115. } );
  1116. }
  1117.  
  1118. /**
  1119. * Checks a node for validity as a Sizzle context
  1120. * @param {Element|Object=} context
  1121. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  1122. */
  1123. function testContext( context ) {
  1124. return context && typeof context.getElementsByTagName !== "undefined" && context;
  1125. }
  1126.  
  1127. // Expose support vars for convenience
  1128. support = Sizzle.support = {};
  1129.  
  1130. /**
  1131. * Detects XML nodes
  1132. * @param {Element|Object} elem An element or a document
  1133. * @returns {Boolean} True iff elem is a non-HTML XML node
  1134. */
  1135. isXML = Sizzle.isXML = function( elem ) {
  1136. var namespace = elem && elem.namespaceURI,
  1137. docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  1138.  
  1139. // Support: IE <=8
  1140. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  1141. // https://bugs.jquery.com/ticket/4833
  1142. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  1143. };
  1144.  
  1145. /**
  1146. * Sets document-related variables once based on the current document
  1147. * @param {Element|Object} [doc] An element or document object to use to set the document
  1148. * @returns {Object} Returns the current document
  1149. */
  1150. setDocument = Sizzle.setDocument = function( node ) {
  1151. var hasCompare, subWindow,
  1152. doc = node ? node.ownerDocument || node : preferredDoc;
  1153.  
  1154. // Return early if doc is invalid or already selected
  1155. // Support: IE 11+, Edge 17 - 18+
  1156. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1157. // two documents; shallow comparisons work.
  1158. // eslint-disable-next-line eqeqeq
  1159. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  1160. return document;
  1161. }
  1162.  
  1163. // Update global variables
  1164. document = doc;
  1165. docElem = document.documentElement;
  1166. documentIsHTML = !isXML( document );
  1167.  
  1168. // Support: IE 9 - 11+, Edge 12 - 18+
  1169. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  1170. // Support: IE 11+, Edge 17 - 18+
  1171. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1172. // two documents; shallow comparisons work.
  1173. // eslint-disable-next-line eqeqeq
  1174. if ( preferredDoc != document &&
  1175. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  1176.  
  1177. // Support: IE 11, Edge
  1178. if ( subWindow.addEventListener ) {
  1179. subWindow.addEventListener( "unload", unloadHandler, false );
  1180.  
  1181. // Support: IE 9 - 10 only
  1182. } else if ( subWindow.attachEvent ) {
  1183. subWindow.attachEvent( "onunload", unloadHandler );
  1184. }
  1185. }
  1186.  
  1187. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  1188. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  1189. // IE/Edge & older browsers don't support the :scope pseudo-class.
  1190. // Support: Safari 6.0 only
  1191. // Safari 6.0 supports :scope but it's an alias of :root there.
  1192. support.scope = assert( function( el ) {
  1193. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  1194. return typeof el.querySelectorAll !== "undefined" &&
  1195. !el.querySelectorAll( ":scope fieldset div" ).length;
  1196. } );
  1197.  
  1198. // Support: Chrome 105+, Firefox 104+, Safari 15.4+
  1199. // Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`.
  1200. //
  1201. // `:is()` uses a forgiving selector list as an argument and is widely
  1202. // implemented, so it's a good one to test against.
  1203. support.cssSupportsSelector = assert( function() {
  1204. /* eslint-disable no-undef */
  1205.  
  1206. return CSS.supports( "selector(*)" ) &&
  1207.  
  1208. // Support: Firefox 78-81 only
  1209. // In old Firefox, `:is()` didn't use forgiving parsing. In that case,
  1210. // fail this test as there's no selector to test against that.
  1211. // `CSS.supports` uses unforgiving parsing
  1212. document.querySelectorAll( ":is(:jqfake)" ) &&
  1213.  
  1214. // `*` is needed as Safari & newer Chrome implemented something in between
  1215. // for `:has()` - it throws in `qSA` if it only contains an unsupported
  1216. // argument but multiple ones, one of which is supported, are fine.
  1217. // We want to play safe in case `:is()` gets the same treatment.
  1218. !CSS.supports( "selector(:is(*,:jqfake))" );
  1219.  
  1220. /* eslint-enable */
  1221. } );
  1222.  
  1223. /* Attributes
  1224. ---------------------------------------------------------------------- */
  1225.  
  1226. // Support: IE<8
  1227. // Verify that getAttribute really returns attributes and not properties
  1228. // (excepting IE8 booleans)
  1229. support.attributes = assert( function( el ) {
  1230. el.className = "i";
  1231. return !el.getAttribute( "className" );
  1232. } );
  1233.  
  1234. /* getElement(s)By*
  1235. ---------------------------------------------------------------------- */
  1236.  
  1237. // Check if getElementsByTagName("*") returns only elements
  1238. support.getElementsByTagName = assert( function( el ) {
  1239. el.appendChild( document.createComment( "" ) );
  1240. return !el.getElementsByTagName( "*" ).length;
  1241. } );
  1242.  
  1243. // Support: IE<9
  1244. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  1245.  
  1246. // Support: IE<10
  1247. // Check if getElementById returns elements by name
  1248. // The broken getElementById methods don't pick up programmatically-set names,
  1249. // so use a roundabout getElementsByName test
  1250. support.getById = assert( function( el ) {
  1251. docElem.appendChild( el ).id = expando;
  1252. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  1253. } );
  1254.  
  1255. // ID filter and find
  1256. if ( support.getById ) {
  1257. Expr.filter[ "ID" ] = function( id ) {
  1258. var attrId = id.replace( runescape, funescape );
  1259. return function( elem ) {
  1260. return elem.getAttribute( "id" ) === attrId;
  1261. };
  1262. };
  1263. Expr.find[ "ID" ] = function( id, context ) {
  1264. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1265. var elem = context.getElementById( id );
  1266. return elem ? [ elem ] : [];
  1267. }
  1268. };
  1269. } else {
  1270. Expr.filter[ "ID" ] = function( id ) {
  1271. var attrId = id.replace( runescape, funescape );
  1272. return function( elem ) {
  1273. var node = typeof elem.getAttributeNode !== "undefined" &&
  1274. elem.getAttributeNode( "id" );
  1275. return node && node.value === attrId;
  1276. };
  1277. };
  1278.  
  1279. // Support: IE 6 - 7 only
  1280. // getElementById is not reliable as a find shortcut
  1281. Expr.find[ "ID" ] = function( id, context ) {
  1282. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1283. var node, i, elems,
  1284. elem = context.getElementById( id );
  1285.  
  1286. if ( elem ) {
  1287.  
  1288. // Verify the id attribute
  1289. node = elem.getAttributeNode( "id" );
  1290. if ( node && node.value === id ) {
  1291. return [ elem ];
  1292. }
  1293.  
  1294. // Fall back on getElementsByName
  1295. elems = context.getElementsByName( id );
  1296. i = 0;
  1297. while ( ( elem = elems[ i++ ] ) ) {
  1298. node = elem.getAttributeNode( "id" );
  1299. if ( node && node.value === id ) {
  1300. return [ elem ];
  1301. }
  1302. }
  1303. }
  1304.  
  1305. return [];
  1306. }
  1307. };
  1308. }
  1309.  
  1310. // Tag
  1311. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  1312. function( tag, context ) {
  1313. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1314. return context.getElementsByTagName( tag );
  1315.  
  1316. // DocumentFragment nodes don't have gEBTN
  1317. } else if ( support.qsa ) {
  1318. return context.querySelectorAll( tag );
  1319. }
  1320. } :
  1321.  
  1322. function( tag, context ) {
  1323. var elem,
  1324. tmp = [],
  1325. i = 0,
  1326.  
  1327. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1328. results = context.getElementsByTagName( tag );
  1329.  
  1330. // Filter out possible comments
  1331. if ( tag === "*" ) {
  1332. while ( ( elem = results[ i++ ] ) ) {
  1333. if ( elem.nodeType === 1 ) {
  1334. tmp.push( elem );
  1335. }
  1336. }
  1337.  
  1338. return tmp;
  1339. }
  1340. return results;
  1341. };
  1342.  
  1343. // Class
  1344. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  1345. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1346. return context.getElementsByClassName( className );
  1347. }
  1348. };
  1349.  
  1350. /* QSA/matchesSelector
  1351. ---------------------------------------------------------------------- */
  1352.  
  1353. // QSA and matchesSelector support
  1354.  
  1355. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1356. rbuggyMatches = [];
  1357.  
  1358. // qSa(:focus) reports false when true (Chrome 21)
  1359. // We allow this because of a bug in IE8/9 that throws an error
  1360. // whenever `document.activeElement` is accessed on an iframe
  1361. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1362. // See https://bugs.jquery.com/ticket/13378
  1363. rbuggyQSA = [];
  1364.  
  1365. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  1366.  
  1367. // Build QSA regex
  1368. // Regex strategy adopted from Diego Perini
  1369. assert( function( el ) {
  1370.  
  1371. var input;
  1372.  
  1373. // Select is set to empty string on purpose
  1374. // This is to test IE's treatment of not explicitly
  1375. // setting a boolean content attribute,
  1376. // since its presence should be enough
  1377. // https://bugs.jquery.com/ticket/12359
  1378. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1379. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1380. "<option selected=''></option></select>";
  1381.  
  1382. // Support: IE8, Opera 11-12.16
  1383. // Nothing should be selected when empty strings follow ^= or $= or *=
  1384. // The test attribute must be unknown in Opera but "safe" for WinRT
  1385. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1386. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  1387. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1388. }
  1389.  
  1390. // Support: IE8
  1391. // Boolean attributes and "value" are not treated correctly
  1392. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1393. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1394. }
  1395.  
  1396. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1397. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1398. rbuggyQSA.push( "~=" );
  1399. }
  1400.  
  1401. // Support: IE 11+, Edge 15 - 18+
  1402. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1403. // Adding a temporary attribute to the document before the selection works
  1404. // around the issue.
  1405. // Interestingly, IE 10 & older don't seem to have the issue.
  1406. input = document.createElement( "input" );
  1407. input.setAttribute( "name", "" );
  1408. el.appendChild( input );
  1409. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1410. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1411. whitespace + "*(?:''|\"\")" );
  1412. }
  1413.  
  1414. // Webkit/Opera - :checked should return selected option elements
  1415. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1416. // IE8 throws error here and will not see later tests
  1417. if ( !el.querySelectorAll( ":checked" ).length ) {
  1418. rbuggyQSA.push( ":checked" );
  1419. }
  1420.  
  1421. // Support: Safari 8+, iOS 8+
  1422. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1423. // In-page `selector#id sibling-combinator selector` fails
  1424. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1425. rbuggyQSA.push( ".#.+[+~]" );
  1426. }
  1427.  
  1428. // Support: Firefox <=3.6 - 5 only
  1429. // Old Firefox doesn't throw on a badly-escaped identifier.
  1430. el.querySelectorAll( "\\\f" );
  1431. rbuggyQSA.push( "[\\r\\n\\f]" );
  1432. } );
  1433.  
  1434. assert( function( el ) {
  1435. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1436. "<select disabled='disabled'><option/></select>";
  1437.  
  1438. // Support: Windows 8 Native Apps
  1439. // The type and name attributes are restricted during .innerHTML assignment
  1440. var input = document.createElement( "input" );
  1441. input.setAttribute( "type", "hidden" );
  1442. el.appendChild( input ).setAttribute( "name", "D" );
  1443.  
  1444. // Support: IE8
  1445. // Enforce case-sensitivity of name attribute
  1446. if ( el.querySelectorAll( "[name=d]" ).length ) {
  1447. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1448. }
  1449.  
  1450. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1451. // IE8 throws error here and will not see later tests
  1452. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  1453. rbuggyQSA.push( ":enabled", ":disabled" );
  1454. }
  1455.  
  1456. // Support: IE9-11+
  1457. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1458. docElem.appendChild( el ).disabled = true;
  1459. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1460. rbuggyQSA.push( ":enabled", ":disabled" );
  1461. }
  1462.  
  1463. // Support: Opera 10 - 11 only
  1464. // Opera 10-11 does not throw on post-comma invalid pseudos
  1465. el.querySelectorAll( "*,:x" );
  1466. rbuggyQSA.push( ",.*:" );
  1467. } );
  1468. }
  1469.  
  1470. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  1471. docElem.webkitMatchesSelector ||
  1472. docElem.mozMatchesSelector ||
  1473. docElem.oMatchesSelector ||
  1474. docElem.msMatchesSelector ) ) ) ) {
  1475.  
  1476. assert( function( el ) {
  1477.  
  1478. // Check to see if it's possible to do matchesSelector
  1479. // on a disconnected node (IE 9)
  1480. support.disconnectedMatch = matches.call( el, "*" );
  1481.  
  1482. // This should fail with an exception
  1483. // Gecko does not error, returns false instead
  1484. matches.call( el, "[s!='']:x" );
  1485. rbuggyMatches.push( "!=", pseudos );
  1486. } );
  1487. }
  1488.  
  1489. if ( !support.cssSupportsSelector ) {
  1490.  
  1491. // Support: Chrome 105+, Safari 15.4+
  1492. // `:has()` uses a forgiving selector list as an argument so our regular
  1493. // `try-catch` mechanism fails to catch `:has()` with arguments not supported
  1494. // natively like `:has(:contains("Foo"))`. Where supported & spec-compliant,
  1495. // we now use `CSS.supports("selector(:is(SELECTOR_TO_BE_TESTED))")`, but
  1496. // outside that we mark `:has` as buggy.
  1497. rbuggyQSA.push( ":has" );
  1498. }
  1499.  
  1500. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1501. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  1502.  
  1503. /* Contains
  1504. ---------------------------------------------------------------------- */
  1505. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1506.  
  1507. // Element contains another
  1508. // Purposefully self-exclusive
  1509. // As in, an element does not contain itself
  1510. contains = hasCompare || rnative.test( docElem.contains ) ?
  1511. function( a, b ) {
  1512.  
  1513. // Support: IE <9 only
  1514. // IE doesn't have `contains` on `document` so we need to check for
  1515. // `documentElement` presence.
  1516. // We need to fall back to `a` when `documentElement` is missing
  1517. // as `ownerDocument` of elements within `<template/>` may have
  1518. // a null one - a default behavior of all modern browsers.
  1519. var adown = a.nodeType === 9 && a.documentElement || a,
  1520. bup = b && b.parentNode;
  1521. return a === bup || !!( bup && bup.nodeType === 1 && (
  1522. adown.contains ?
  1523. adown.contains( bup ) :
  1524. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1525. ) );
  1526. } :
  1527. function( a, b ) {
  1528. if ( b ) {
  1529. while ( ( b = b.parentNode ) ) {
  1530. if ( b === a ) {
  1531. return true;
  1532. }
  1533. }
  1534. }
  1535. return false;
  1536. };
  1537.  
  1538. /* Sorting
  1539. ---------------------------------------------------------------------- */
  1540.  
  1541. // Document order sorting
  1542. sortOrder = hasCompare ?
  1543. function( a, b ) {
  1544.  
  1545. // Flag for duplicate removal
  1546. if ( a === b ) {
  1547. hasDuplicate = true;
  1548. return 0;
  1549. }
  1550.  
  1551. // Sort on method existence if only one input has compareDocumentPosition
  1552. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1553. if ( compare ) {
  1554. return compare;
  1555. }
  1556.  
  1557. // Calculate position if both inputs belong to the same document
  1558. // Support: IE 11+, Edge 17 - 18+
  1559. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1560. // two documents; shallow comparisons work.
  1561. // eslint-disable-next-line eqeqeq
  1562. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1563. a.compareDocumentPosition( b ) :
  1564.  
  1565. // Otherwise we know they are disconnected
  1566. 1;
  1567.  
  1568. // Disconnected nodes
  1569. if ( compare & 1 ||
  1570. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1571.  
  1572. // Choose the first element that is related to our preferred document
  1573. // Support: IE 11+, Edge 17 - 18+
  1574. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1575. // two documents; shallow comparisons work.
  1576. // eslint-disable-next-line eqeqeq
  1577. if ( a == document || a.ownerDocument == preferredDoc &&
  1578. contains( preferredDoc, a ) ) {
  1579. return -1;
  1580. }
  1581.  
  1582. // Support: IE 11+, Edge 17 - 18+
  1583. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1584. // two documents; shallow comparisons work.
  1585. // eslint-disable-next-line eqeqeq
  1586. if ( b == document || b.ownerDocument == preferredDoc &&
  1587. contains( preferredDoc, b ) ) {
  1588. return 1;
  1589. }
  1590.  
  1591. // Maintain original order
  1592. return sortInput ?
  1593. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1594. 0;
  1595. }
  1596.  
  1597. return compare & 4 ? -1 : 1;
  1598. } :
  1599. function( a, b ) {
  1600.  
  1601. // Exit early if the nodes are identical
  1602. if ( a === b ) {
  1603. hasDuplicate = true;
  1604. return 0;
  1605. }
  1606.  
  1607. var cur,
  1608. i = 0,
  1609. aup = a.parentNode,
  1610. bup = b.parentNode,
  1611. ap = [ a ],
  1612. bp = [ b ];
  1613.  
  1614. // Parentless nodes are either documents or disconnected
  1615. if ( !aup || !bup ) {
  1616.  
  1617. // Support: IE 11+, Edge 17 - 18+
  1618. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1619. // two documents; shallow comparisons work.
  1620. /* eslint-disable eqeqeq */
  1621. return a == document ? -1 :
  1622. b == document ? 1 :
  1623. /* eslint-enable eqeqeq */
  1624. aup ? -1 :
  1625. bup ? 1 :
  1626. sortInput ?
  1627. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1628. 0;
  1629.  
  1630. // If the nodes are siblings, we can do a quick check
  1631. } else if ( aup === bup ) {
  1632. return siblingCheck( a, b );
  1633. }
  1634.  
  1635. // Otherwise we need full lists of their ancestors for comparison
  1636. cur = a;
  1637. while ( ( cur = cur.parentNode ) ) {
  1638. ap.unshift( cur );
  1639. }
  1640. cur = b;
  1641. while ( ( cur = cur.parentNode ) ) {
  1642. bp.unshift( cur );
  1643. }
  1644.  
  1645. // Walk down the tree looking for a discrepancy
  1646. while ( ap[ i ] === bp[ i ] ) {
  1647. i++;
  1648. }
  1649.  
  1650. return i ?
  1651.  
  1652. // Do a sibling check if the nodes have a common ancestor
  1653. siblingCheck( ap[ i ], bp[ i ] ) :
  1654.  
  1655. // Otherwise nodes in our document sort first
  1656. // Support: IE 11+, Edge 17 - 18+
  1657. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1658. // two documents; shallow comparisons work.
  1659. /* eslint-disable eqeqeq */
  1660. ap[ i ] == preferredDoc ? -1 :
  1661. bp[ i ] == preferredDoc ? 1 :
  1662. /* eslint-enable eqeqeq */
  1663. 0;
  1664. };
  1665.  
  1666. return document;
  1667. };
  1668.  
  1669. Sizzle.matches = function( expr, elements ) {
  1670. return Sizzle( expr, null, null, elements );
  1671. };
  1672.  
  1673. Sizzle.matchesSelector = function( elem, expr ) {
  1674. setDocument( elem );
  1675.  
  1676. if ( support.matchesSelector && documentIsHTML &&
  1677. !nonnativeSelectorCache[ expr + " " ] &&
  1678. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1679. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1680.  
  1681. try {
  1682. var ret = matches.call( elem, expr );
  1683.  
  1684. // IE 9's matchesSelector returns false on disconnected nodes
  1685. if ( ret || support.disconnectedMatch ||
  1686.  
  1687. // As well, disconnected nodes are said to be in a document
  1688. // fragment in IE 9
  1689. elem.document && elem.document.nodeType !== 11 ) {
  1690. return ret;
  1691. }
  1692. } catch ( e ) {
  1693. nonnativeSelectorCache( expr, true );
  1694. }
  1695. }
  1696.  
  1697. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1698. };
  1699.  
  1700. Sizzle.contains = function( context, elem ) {
  1701.  
  1702. // Set document vars if needed
  1703. // Support: IE 11+, Edge 17 - 18+
  1704. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1705. // two documents; shallow comparisons work.
  1706. // eslint-disable-next-line eqeqeq
  1707. if ( ( context.ownerDocument || context ) != document ) {
  1708. setDocument( context );
  1709. }
  1710. return contains( context, elem );
  1711. };
  1712.  
  1713. Sizzle.attr = function( elem, name ) {
  1714.  
  1715. // Set document vars if needed
  1716. // Support: IE 11+, Edge 17 - 18+
  1717. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1718. // two documents; shallow comparisons work.
  1719. // eslint-disable-next-line eqeqeq
  1720. if ( ( elem.ownerDocument || elem ) != document ) {
  1721. setDocument( elem );
  1722. }
  1723.  
  1724. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1725.  
  1726. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1727. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1728. fn( elem, name, !documentIsHTML ) :
  1729. undefined;
  1730.  
  1731. return val !== undefined ?
  1732. val :
  1733. support.attributes || !documentIsHTML ?
  1734. elem.getAttribute( name ) :
  1735. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  1736. val.value :
  1737. null;
  1738. };
  1739.  
  1740. Sizzle.escape = function( sel ) {
  1741. return ( sel + "" ).replace( rcssescape, fcssescape );
  1742. };
  1743.  
  1744. Sizzle.error = function( msg ) {
  1745. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1746. };
  1747.  
  1748. /**
  1749. * Document sorting and removing duplicates
  1750. * @param {ArrayLike} results
  1751. */
  1752. Sizzle.uniqueSort = function( results ) {
  1753. var elem,
  1754. duplicates = [],
  1755. j = 0,
  1756. i = 0;
  1757.  
  1758. // Unless we *know* we can detect duplicates, assume their presence
  1759. hasDuplicate = !support.detectDuplicates;
  1760. sortInput = !support.sortStable && results.slice( 0 );
  1761. results.sort( sortOrder );
  1762.  
  1763. if ( hasDuplicate ) {
  1764. while ( ( elem = results[ i++ ] ) ) {
  1765. if ( elem === results[ i ] ) {
  1766. j = duplicates.push( i );
  1767. }
  1768. }
  1769. while ( j-- ) {
  1770. results.splice( duplicates[ j ], 1 );
  1771. }
  1772. }
  1773.  
  1774. // Clear input after sorting to release objects
  1775. // See https://github.com/jquery/sizzle/pull/225
  1776. sortInput = null;
  1777.  
  1778. return results;
  1779. };
  1780.  
  1781. /**
  1782. * Utility function for retrieving the text value of an array of DOM nodes
  1783. * @param {Array|Element} elem
  1784. */
  1785. getText = Sizzle.getText = function( elem ) {
  1786. var node,
  1787. ret = "",
  1788. i = 0,
  1789. nodeType = elem.nodeType;
  1790.  
  1791. if ( !nodeType ) {
  1792.  
  1793. // If no nodeType, this is expected to be an array
  1794. while ( ( node = elem[ i++ ] ) ) {
  1795.  
  1796. // Do not traverse comment nodes
  1797. ret += getText( node );
  1798. }
  1799. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1800.  
  1801. // Use textContent for elements
  1802. // innerText usage removed for consistency of new lines (jQuery #11153)
  1803. if ( typeof elem.textContent === "string" ) {
  1804. return elem.textContent;
  1805. } else {
  1806.  
  1807. // Traverse its children
  1808. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1809. ret += getText( elem );
  1810. }
  1811. }
  1812. } else if ( nodeType === 3 || nodeType === 4 ) {
  1813. return elem.nodeValue;
  1814. }
  1815.  
  1816. // Do not include comment or processing instruction nodes
  1817.  
  1818. return ret;
  1819. };
  1820.  
  1821. Expr = Sizzle.selectors = {
  1822.  
  1823. // Can be adjusted by the user
  1824. cacheLength: 50,
  1825.  
  1826. createPseudo: markFunction,
  1827.  
  1828. match: matchExpr,
  1829.  
  1830. attrHandle: {},
  1831.  
  1832. find: {},
  1833.  
  1834. relative: {
  1835. ">": { dir: "parentNode", first: true },
  1836. " ": { dir: "parentNode" },
  1837. "+": { dir: "previousSibling", first: true },
  1838. "~": { dir: "previousSibling" }
  1839. },
  1840.  
  1841. preFilter: {
  1842. "ATTR": function( match ) {
  1843. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1844.  
  1845. // Move the given value to match[3] whether quoted or unquoted
  1846. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  1847. match[ 5 ] || "" ).replace( runescape, funescape );
  1848.  
  1849. if ( match[ 2 ] === "~=" ) {
  1850. match[ 3 ] = " " + match[ 3 ] + " ";
  1851. }
  1852.  
  1853. return match.slice( 0, 4 );
  1854. },
  1855.  
  1856. "CHILD": function( match ) {
  1857.  
  1858. /* matches from matchExpr["CHILD"]
  1859. 1 type (only|nth|...)
  1860. 2 what (child|of-type)
  1861. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1862. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1863. 5 sign of xn-component
  1864. 6 x of xn-component
  1865. 7 sign of y-component
  1866. 8 y of y-component
  1867. */
  1868. match[ 1 ] = match[ 1 ].toLowerCase();
  1869.  
  1870. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1871.  
  1872. // nth-* requires argument
  1873. if ( !match[ 3 ] ) {
  1874. Sizzle.error( match[ 0 ] );
  1875. }
  1876.  
  1877. // numeric x and y parameters for Expr.filter.CHILD
  1878. // remember that false/true cast respectively to 0/1
  1879. match[ 4 ] = +( match[ 4 ] ?
  1880. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1881. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  1882. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1883.  
  1884. // other types prohibit arguments
  1885. } else if ( match[ 3 ] ) {
  1886. Sizzle.error( match[ 0 ] );
  1887. }
  1888.  
  1889. return match;
  1890. },
  1891.  
  1892. "PSEUDO": function( match ) {
  1893. var excess,
  1894. unquoted = !match[ 6 ] && match[ 2 ];
  1895.  
  1896. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  1897. return null;
  1898. }
  1899.  
  1900. // Accept quoted arguments as-is
  1901. if ( match[ 3 ] ) {
  1902. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1903.  
  1904. // Strip excess characters from unquoted arguments
  1905. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1906.  
  1907. // Get excess from tokenize (recursively)
  1908. ( excess = tokenize( unquoted, true ) ) &&
  1909.  
  1910. // advance to the next closing parenthesis
  1911. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1912.  
  1913. // excess is a negative index
  1914. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1915. match[ 2 ] = unquoted.slice( 0, excess );
  1916. }
  1917.  
  1918. // Return only captures needed by the pseudo filter method (type and argument)
  1919. return match.slice( 0, 3 );
  1920. }
  1921. },
  1922.  
  1923. filter: {
  1924.  
  1925. "TAG": function( nodeNameSelector ) {
  1926. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1927. return nodeNameSelector === "*" ?
  1928. function() {
  1929. return true;
  1930. } :
  1931. function( elem ) {
  1932. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1933. };
  1934. },
  1935.  
  1936. "CLASS": function( className ) {
  1937. var pattern = classCache[ className + " " ];
  1938.  
  1939. return pattern ||
  1940. ( pattern = new RegExp( "(^|" + whitespace +
  1941. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  1942. className, function( elem ) {
  1943. return pattern.test(
  1944. typeof elem.className === "string" && elem.className ||
  1945. typeof elem.getAttribute !== "undefined" &&
  1946. elem.getAttribute( "class" ) ||
  1947. ""
  1948. );
  1949. } );
  1950. },
  1951.  
  1952. "ATTR": function( name, operator, check ) {
  1953. return function( elem ) {
  1954. var result = Sizzle.attr( elem, name );
  1955.  
  1956. if ( result == null ) {
  1957. return operator === "!=";
  1958. }
  1959. if ( !operator ) {
  1960. return true;
  1961. }
  1962.  
  1963. result += "";
  1964.  
  1965. /* eslint-disable max-len */
  1966.  
  1967. return operator === "=" ? result === check :
  1968. operator === "!=" ? result !== check :
  1969. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1970. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1971. operator === "$=" ? check && result.slice( -check.length ) === check :
  1972. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1973. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1974. false;
  1975. /* eslint-enable max-len */
  1976.  
  1977. };
  1978. },
  1979.  
  1980. "CHILD": function( type, what, _argument, first, last ) {
  1981. var simple = type.slice( 0, 3 ) !== "nth",
  1982. forward = type.slice( -4 ) !== "last",
  1983. ofType = what === "of-type";
  1984.  
  1985. return first === 1 && last === 0 ?
  1986.  
  1987. // Shortcut for :nth-*(n)
  1988. function( elem ) {
  1989. return !!elem.parentNode;
  1990. } :
  1991.  
  1992. function( elem, _context, xml ) {
  1993. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1994. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1995. parent = elem.parentNode,
  1996. name = ofType && elem.nodeName.toLowerCase(),
  1997. useCache = !xml && !ofType,
  1998. diff = false;
  1999.  
  2000. if ( parent ) {
  2001.  
  2002. // :(first|last|only)-(child|of-type)
  2003. if ( simple ) {
  2004. while ( dir ) {
  2005. node = elem;
  2006. while ( ( node = node[ dir ] ) ) {
  2007. if ( ofType ?
  2008. node.nodeName.toLowerCase() === name :
  2009. node.nodeType === 1 ) {
  2010.  
  2011. return false;
  2012. }
  2013. }
  2014.  
  2015. // Reverse direction for :only-* (if we haven't yet done so)
  2016. start = dir = type === "only" && !start && "nextSibling";
  2017. }
  2018. return true;
  2019. }
  2020.  
  2021. start = [ forward ? parent.firstChild : parent.lastChild ];
  2022.  
  2023. // non-xml :nth-child(...) stores cache data on `parent`
  2024. if ( forward && useCache ) {
  2025.  
  2026. // Seek `elem` from a previously-cached index
  2027.  
  2028. // ...in a gzip-friendly way
  2029. node = parent;
  2030. outerCache = node[ expando ] || ( node[ expando ] = {} );
  2031.  
  2032. // Support: IE <9 only
  2033. // Defend against cloned attroperties (jQuery gh-1709)
  2034. uniqueCache = outerCache[ node.uniqueID ] ||
  2035. ( outerCache[ node.uniqueID ] = {} );
  2036.  
  2037. cache = uniqueCache[ type ] || [];
  2038. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  2039. diff = nodeIndex && cache[ 2 ];
  2040. node = nodeIndex && parent.childNodes[ nodeIndex ];
  2041.  
  2042. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  2043.  
  2044. // Fallback to seeking `elem` from the start
  2045. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  2046.  
  2047. // When found, cache indexes on `parent` and break
  2048. if ( node.nodeType === 1 && ++diff && node === elem ) {
  2049. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  2050. break;
  2051. }
  2052. }
  2053.  
  2054. } else {
  2055.  
  2056. // Use previously-cached element index if available
  2057. if ( useCache ) {
  2058.  
  2059. // ...in a gzip-friendly way
  2060. node = elem;
  2061. outerCache = node[ expando ] || ( node[ expando ] = {} );
  2062.  
  2063. // Support: IE <9 only
  2064. // Defend against cloned attroperties (jQuery gh-1709)
  2065. uniqueCache = outerCache[ node.uniqueID ] ||
  2066. ( outerCache[ node.uniqueID ] = {} );
  2067.  
  2068. cache = uniqueCache[ type ] || [];
  2069. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  2070. diff = nodeIndex;
  2071. }
  2072.  
  2073. // xml :nth-child(...)
  2074. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  2075. if ( diff === false ) {
  2076.  
  2077. // Use the same loop as above to seek `elem` from the start
  2078. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  2079. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  2080.  
  2081. if ( ( ofType ?
  2082. node.nodeName.toLowerCase() === name :
  2083. node.nodeType === 1 ) &&
  2084. ++diff ) {
  2085.  
  2086. // Cache the index of each encountered element
  2087. if ( useCache ) {
  2088. outerCache = node[ expando ] ||
  2089. ( node[ expando ] = {} );
  2090.  
  2091. // Support: IE <9 only
  2092. // Defend against cloned attroperties (jQuery gh-1709)
  2093. uniqueCache = outerCache[ node.uniqueID ] ||
  2094. ( outerCache[ node.uniqueID ] = {} );
  2095.  
  2096. uniqueCache[ type ] = [ dirruns, diff ];
  2097. }
  2098.  
  2099. if ( node === elem ) {
  2100. break;
  2101. }
  2102. }
  2103. }
  2104. }
  2105. }
  2106.  
  2107. // Incorporate the offset, then check against cycle size
  2108. diff -= last;
  2109. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  2110. }
  2111. };
  2112. },
  2113.  
  2114. "PSEUDO": function( pseudo, argument ) {
  2115.  
  2116. // pseudo-class names are case-insensitive
  2117. // http://www.w3.org/TR/selectors/#pseudo-classes
  2118. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  2119. // Remember that setFilters inherits from pseudos
  2120. var args,
  2121. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  2122. Sizzle.error( "unsupported pseudo: " + pseudo );
  2123.  
  2124. // The user may use createPseudo to indicate that
  2125. // arguments are needed to create the filter function
  2126. // just as Sizzle does
  2127. if ( fn[ expando ] ) {
  2128. return fn( argument );
  2129. }
  2130.  
  2131. // But maintain support for old signatures
  2132. if ( fn.length > 1 ) {
  2133. args = [ pseudo, pseudo, "", argument ];
  2134. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  2135. markFunction( function( seed, matches ) {
  2136. var idx,
  2137. matched = fn( seed, argument ),
  2138. i = matched.length;
  2139. while ( i-- ) {
  2140. idx = indexOf( seed, matched[ i ] );
  2141. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  2142. }
  2143. } ) :
  2144. function( elem ) {
  2145. return fn( elem, 0, args );
  2146. };
  2147. }
  2148.  
  2149. return fn;
  2150. }
  2151. },
  2152.  
  2153. pseudos: {
  2154.  
  2155. // Potentially complex pseudos
  2156. "not": markFunction( function( selector ) {
  2157.  
  2158. // Trim the selector passed to compile
  2159. // to avoid treating leading and trailing
  2160. // spaces as combinators
  2161. var input = [],
  2162. results = [],
  2163. matcher = compile( selector.replace( rtrim, "$1" ) );
  2164.  
  2165. return matcher[ expando ] ?
  2166. markFunction( function( seed, matches, _context, xml ) {
  2167. var elem,
  2168. unmatched = matcher( seed, null, xml, [] ),
  2169. i = seed.length;
  2170.  
  2171. // Match elements unmatched by `matcher`
  2172. while ( i-- ) {
  2173. if ( ( elem = unmatched[ i ] ) ) {
  2174. seed[ i ] = !( matches[ i ] = elem );
  2175. }
  2176. }
  2177. } ) :
  2178. function( elem, _context, xml ) {
  2179. input[ 0 ] = elem;
  2180. matcher( input, null, xml, results );
  2181.  
  2182. // Don't keep the element (issue #299)
  2183. input[ 0 ] = null;
  2184. return !results.pop();
  2185. };
  2186. } ),
  2187.  
  2188. "has": markFunction( function( selector ) {
  2189. return function( elem ) {
  2190. return Sizzle( selector, elem ).length > 0;
  2191. };
  2192. } ),
  2193.  
  2194. "contains": markFunction( function( text ) {
  2195. text = text.replace( runescape, funescape );
  2196. return function( elem ) {
  2197. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  2198. };
  2199. } ),
  2200.  
  2201. // "Whether an element is represented by a :lang() selector
  2202. // is based solely on the element's language value
  2203. // being equal to the identifier C,
  2204. // or beginning with the identifier C immediately followed by "-".
  2205. // The matching of C against the element's language value is performed case-insensitively.
  2206. // The identifier C does not have to be a valid language name."
  2207. // http://www.w3.org/TR/selectors/#lang-pseudo
  2208. "lang": markFunction( function( lang ) {
  2209.  
  2210. // lang value must be a valid identifier
  2211. if ( !ridentifier.test( lang || "" ) ) {
  2212. Sizzle.error( "unsupported lang: " + lang );
  2213. }
  2214. lang = lang.replace( runescape, funescape ).toLowerCase();
  2215. return function( elem ) {
  2216. var elemLang;
  2217. do {
  2218. if ( ( elemLang = documentIsHTML ?
  2219. elem.lang :
  2220. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  2221.  
  2222. elemLang = elemLang.toLowerCase();
  2223. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  2224. }
  2225. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  2226. return false;
  2227. };
  2228. } ),
  2229.  
  2230. // Miscellaneous
  2231. "target": function( elem ) {
  2232. var hash = window.location && window.location.hash;
  2233. return hash && hash.slice( 1 ) === elem.id;
  2234. },
  2235.  
  2236. "root": function( elem ) {
  2237. return elem === docElem;
  2238. },
  2239.  
  2240. "focus": function( elem ) {
  2241. return elem === document.activeElement &&
  2242. ( !document.hasFocus || document.hasFocus() ) &&
  2243. !!( elem.type || elem.href || ~elem.tabIndex );
  2244. },
  2245.  
  2246. // Boolean properties
  2247. "enabled": createDisabledPseudo( false ),
  2248. "disabled": createDisabledPseudo( true ),
  2249.  
  2250. "checked": function( elem ) {
  2251.  
  2252. // In CSS3, :checked should return both checked and selected elements
  2253. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  2254. var nodeName = elem.nodeName.toLowerCase();
  2255. return ( nodeName === "input" && !!elem.checked ) ||
  2256. ( nodeName === "option" && !!elem.selected );
  2257. },
  2258.  
  2259. "selected": function( elem ) {
  2260.  
  2261. // Accessing this property makes selected-by-default
  2262. // options in Safari work properly
  2263. if ( elem.parentNode ) {
  2264. // eslint-disable-next-line no-unused-expressions
  2265. elem.parentNode.selectedIndex;
  2266. }
  2267.  
  2268. return elem.selected === true;
  2269. },
  2270.  
  2271. // Contents
  2272. "empty": function( elem ) {
  2273.  
  2274. // http://www.w3.org/TR/selectors/#empty-pseudo
  2275. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  2276. // but not by others (comment: 8; processing instruction: 7; etc.)
  2277. // nodeType < 6 works because attributes (2) do not appear as children
  2278. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2279. if ( elem.nodeType < 6 ) {
  2280. return false;
  2281. }
  2282. }
  2283. return true;
  2284. },
  2285.  
  2286. "parent": function( elem ) {
  2287. return !Expr.pseudos[ "empty" ]( elem );
  2288. },
  2289.  
  2290. // Element/input types
  2291. "header": function( elem ) {
  2292. return rheader.test( elem.nodeName );
  2293. },
  2294.  
  2295. "input": function( elem ) {
  2296. return rinputs.test( elem.nodeName );
  2297. },
  2298.  
  2299. "button": function( elem ) {
  2300. var name = elem.nodeName.toLowerCase();
  2301. return name === "input" && elem.type === "button" || name === "button";
  2302. },
  2303.  
  2304. "text": function( elem ) {
  2305. var attr;
  2306. return elem.nodeName.toLowerCase() === "input" &&
  2307. elem.type === "text" &&
  2308.  
  2309. // Support: IE <10 only
  2310. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  2311. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  2312. attr.toLowerCase() === "text" );
  2313. },
  2314.  
  2315. // Position-in-collection
  2316. "first": createPositionalPseudo( function() {
  2317. return [ 0 ];
  2318. } ),
  2319.  
  2320. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  2321. return [ length - 1 ];
  2322. } ),
  2323.  
  2324. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  2325. return [ argument < 0 ? argument + length : argument ];
  2326. } ),
  2327.  
  2328. "even": createPositionalPseudo( function( matchIndexes, length ) {
  2329. var i = 0;
  2330. for ( ; i < length; i += 2 ) {
  2331. matchIndexes.push( i );
  2332. }
  2333. return matchIndexes;
  2334. } ),
  2335.  
  2336. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  2337. var i = 1;
  2338. for ( ; i < length; i += 2 ) {
  2339. matchIndexes.push( i );
  2340. }
  2341. return matchIndexes;
  2342. } ),
  2343.  
  2344. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  2345. var i = argument < 0 ?
  2346. argument + length :
  2347. argument > length ?
  2348. length :
  2349. argument;
  2350. for ( ; --i >= 0; ) {
  2351. matchIndexes.push( i );
  2352. }
  2353. return matchIndexes;
  2354. } ),
  2355.  
  2356. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  2357. var i = argument < 0 ? argument + length : argument;
  2358. for ( ; ++i < length; ) {
  2359. matchIndexes.push( i );
  2360. }
  2361. return matchIndexes;
  2362. } )
  2363. }
  2364. };
  2365.  
  2366. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  2367.  
  2368. // Add button/input type pseudos
  2369. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  2370. Expr.pseudos[ i ] = createInputPseudo( i );
  2371. }
  2372. for ( i in { submit: true, reset: true } ) {
  2373. Expr.pseudos[ i ] = createButtonPseudo( i );
  2374. }
  2375.  
  2376. // Easy API for creating new setFilters
  2377. function setFilters() {}
  2378. setFilters.prototype = Expr.filters = Expr.pseudos;
  2379. Expr.setFilters = new setFilters();
  2380.  
  2381. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  2382. var matched, match, tokens, type,
  2383. soFar, groups, preFilters,
  2384. cached = tokenCache[ selector + " " ];
  2385.  
  2386. if ( cached ) {
  2387. return parseOnly ? 0 : cached.slice( 0 );
  2388. }
  2389.  
  2390. soFar = selector;
  2391. groups = [];
  2392. preFilters = Expr.preFilter;
  2393.  
  2394. while ( soFar ) {
  2395.  
  2396. // Comma and first run
  2397. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  2398. if ( match ) {
  2399.  
  2400. // Don't consume trailing commas as valid
  2401. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  2402. }
  2403. groups.push( ( tokens = [] ) );
  2404. }
  2405.  
  2406. matched = false;
  2407.  
  2408. // Combinators
  2409. if ( ( match = rcombinators.exec( soFar ) ) ) {
  2410. matched = match.shift();
  2411. tokens.push( {
  2412. value: matched,
  2413.  
  2414. // Cast descendant combinators to space
  2415. type: match[ 0 ].replace( rtrim, " " )
  2416. } );
  2417. soFar = soFar.slice( matched.length );
  2418. }
  2419.  
  2420. // Filters
  2421. for ( type in Expr.filter ) {
  2422. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  2423. ( match = preFilters[ type ]( match ) ) ) ) {
  2424. matched = match.shift();
  2425. tokens.push( {
  2426. value: matched,
  2427. type: type,
  2428. matches: match
  2429. } );
  2430. soFar = soFar.slice( matched.length );
  2431. }
  2432. }
  2433.  
  2434. if ( !matched ) {
  2435. break;
  2436. }
  2437. }
  2438.  
  2439. // Return the length of the invalid excess
  2440. // if we're just parsing
  2441. // Otherwise, throw an error or return tokens
  2442. return parseOnly ?
  2443. soFar.length :
  2444. soFar ?
  2445. Sizzle.error( selector ) :
  2446.  
  2447. // Cache the tokens
  2448. tokenCache( selector, groups ).slice( 0 );
  2449. };
  2450.  
  2451. function toSelector( tokens ) {
  2452. var i = 0,
  2453. len = tokens.length,
  2454. selector = "";
  2455. for ( ; i < len; i++ ) {
  2456. selector += tokens[ i ].value;
  2457. }
  2458. return selector;
  2459. }
  2460.  
  2461. function addCombinator( matcher, combinator, base ) {
  2462. var dir = combinator.dir,
  2463. skip = combinator.next,
  2464. key = skip || dir,
  2465. checkNonElements = base && key === "parentNode",
  2466. doneName = done++;
  2467.  
  2468. return combinator.first ?
  2469.  
  2470. // Check against closest ancestor/preceding element
  2471. function( elem, context, xml ) {
  2472. while ( ( elem = elem[ dir ] ) ) {
  2473. if ( elem.nodeType === 1 || checkNonElements ) {
  2474. return matcher( elem, context, xml );
  2475. }
  2476. }
  2477. return false;
  2478. } :
  2479.  
  2480. // Check against all ancestor/preceding elements
  2481. function( elem, context, xml ) {
  2482. var oldCache, uniqueCache, outerCache,
  2483. newCache = [ dirruns, doneName ];
  2484.  
  2485. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  2486. if ( xml ) {
  2487. while ( ( elem = elem[ dir ] ) ) {
  2488. if ( elem.nodeType === 1 || checkNonElements ) {
  2489. if ( matcher( elem, context, xml ) ) {
  2490. return true;
  2491. }
  2492. }
  2493. }
  2494. } else {
  2495. while ( ( elem = elem[ dir ] ) ) {
  2496. if ( elem.nodeType === 1 || checkNonElements ) {
  2497. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  2498.  
  2499. // Support: IE <9 only
  2500. // Defend against cloned attroperties (jQuery gh-1709)
  2501. uniqueCache = outerCache[ elem.uniqueID ] ||
  2502. ( outerCache[ elem.uniqueID ] = {} );
  2503.  
  2504. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  2505. elem = elem[ dir ] || elem;
  2506. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  2507. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  2508.  
  2509. // Assign to newCache so results back-propagate to previous elements
  2510. return ( newCache[ 2 ] = oldCache[ 2 ] );
  2511. } else {
  2512.  
  2513. // Reuse newcache so results back-propagate to previous elements
  2514. uniqueCache[ key ] = newCache;
  2515.  
  2516. // A match means we're done; a fail means we have to keep checking
  2517. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  2518. return true;
  2519. }
  2520. }
  2521. }
  2522. }
  2523. }
  2524. return false;
  2525. };
  2526. }
  2527.  
  2528. function elementMatcher( matchers ) {
  2529. return matchers.length > 1 ?
  2530. function( elem, context, xml ) {
  2531. var i = matchers.length;
  2532. while ( i-- ) {
  2533. if ( !matchers[ i ]( elem, context, xml ) ) {
  2534. return false;
  2535. }
  2536. }
  2537. return true;
  2538. } :
  2539. matchers[ 0 ];
  2540. }
  2541.  
  2542. function multipleContexts( selector, contexts, results ) {
  2543. var i = 0,
  2544. len = contexts.length;
  2545. for ( ; i < len; i++ ) {
  2546. Sizzle( selector, contexts[ i ], results );
  2547. }
  2548. return results;
  2549. }
  2550.  
  2551. function condense( unmatched, map, filter, context, xml ) {
  2552. var elem,
  2553. newUnmatched = [],
  2554. i = 0,
  2555. len = unmatched.length,
  2556. mapped = map != null;
  2557.  
  2558. for ( ; i < len; i++ ) {
  2559. if ( ( elem = unmatched[ i ] ) ) {
  2560. if ( !filter || filter( elem, context, xml ) ) {
  2561. newUnmatched.push( elem );
  2562. if ( mapped ) {
  2563. map.push( i );
  2564. }
  2565. }
  2566. }
  2567. }
  2568.  
  2569. return newUnmatched;
  2570. }
  2571.  
  2572. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2573. if ( postFilter && !postFilter[ expando ] ) {
  2574. postFilter = setMatcher( postFilter );
  2575. }
  2576. if ( postFinder && !postFinder[ expando ] ) {
  2577. postFinder = setMatcher( postFinder, postSelector );
  2578. }
  2579. return markFunction( function( seed, results, context, xml ) {
  2580. var temp, i, elem,
  2581. preMap = [],
  2582. postMap = [],
  2583. preexisting = results.length,
  2584.  
  2585. // Get initial elements from seed or context
  2586. elems = seed || multipleContexts(
  2587. selector || "*",
  2588. context.nodeType ? [ context ] : context,
  2589. []
  2590. ),
  2591.  
  2592. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2593. matcherIn = preFilter && ( seed || !selector ) ?
  2594. condense( elems, preMap, preFilter, context, xml ) :
  2595. elems,
  2596.  
  2597. matcherOut = matcher ?
  2598.  
  2599. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2600. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2601.  
  2602. // ...intermediate processing is necessary
  2603. [] :
  2604.  
  2605. // ...otherwise use results directly
  2606. results :
  2607. matcherIn;
  2608.  
  2609. // Find primary matches
  2610. if ( matcher ) {
  2611. matcher( matcherIn, matcherOut, context, xml );
  2612. }
  2613.  
  2614. // Apply postFilter
  2615. if ( postFilter ) {
  2616. temp = condense( matcherOut, postMap );
  2617. postFilter( temp, [], context, xml );
  2618.  
  2619. // Un-match failing elements by moving them back to matcherIn
  2620. i = temp.length;
  2621. while ( i-- ) {
  2622. if ( ( elem = temp[ i ] ) ) {
  2623. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2624. }
  2625. }
  2626. }
  2627.  
  2628. if ( seed ) {
  2629. if ( postFinder || preFilter ) {
  2630. if ( postFinder ) {
  2631.  
  2632. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2633. temp = [];
  2634. i = matcherOut.length;
  2635. while ( i-- ) {
  2636. if ( ( elem = matcherOut[ i ] ) ) {
  2637.  
  2638. // Restore matcherIn since elem is not yet a final match
  2639. temp.push( ( matcherIn[ i ] = elem ) );
  2640. }
  2641. }
  2642. postFinder( null, ( matcherOut = [] ), temp, xml );
  2643. }
  2644.  
  2645. // Move matched elements from seed to results to keep them synchronized
  2646. i = matcherOut.length;
  2647. while ( i-- ) {
  2648. if ( ( elem = matcherOut[ i ] ) &&
  2649. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  2650.  
  2651. seed[ temp ] = !( results[ temp ] = elem );
  2652. }
  2653. }
  2654. }
  2655.  
  2656. // Add elements to results, through postFinder if defined
  2657. } else {
  2658. matcherOut = condense(
  2659. matcherOut === results ?
  2660. matcherOut.splice( preexisting, matcherOut.length ) :
  2661. matcherOut
  2662. );
  2663. if ( postFinder ) {
  2664. postFinder( null, results, matcherOut, xml );
  2665. } else {
  2666. push.apply( results, matcherOut );
  2667. }
  2668. }
  2669. } );
  2670. }
  2671.  
  2672. function matcherFromTokens( tokens ) {
  2673. var checkContext, matcher, j,
  2674. len = tokens.length,
  2675. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2676. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2677. i = leadingRelative ? 1 : 0,
  2678.  
  2679. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2680. matchContext = addCombinator( function( elem ) {
  2681. return elem === checkContext;
  2682. }, implicitRelative, true ),
  2683. matchAnyContext = addCombinator( function( elem ) {
  2684. return indexOf( checkContext, elem ) > -1;
  2685. }, implicitRelative, true ),
  2686. matchers = [ function( elem, context, xml ) {
  2687. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2688. ( checkContext = context ).nodeType ?
  2689. matchContext( elem, context, xml ) :
  2690. matchAnyContext( elem, context, xml ) );
  2691.  
  2692. // Avoid hanging onto element (issue #299)
  2693. checkContext = null;
  2694. return ret;
  2695. } ];
  2696.  
  2697. for ( ; i < len; i++ ) {
  2698. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2699. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2700. } else {
  2701. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2702.  
  2703. // Return special upon seeing a positional matcher
  2704. if ( matcher[ expando ] ) {
  2705.  
  2706. // Find the next relative operator (if any) for proper handling
  2707. j = ++i;
  2708. for ( ; j < len; j++ ) {
  2709. if ( Expr.relative[ tokens[ j ].type ] ) {
  2710. break;
  2711. }
  2712. }
  2713. return setMatcher(
  2714. i > 1 && elementMatcher( matchers ),
  2715. i > 1 && toSelector(
  2716.  
  2717. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2718. tokens
  2719. .slice( 0, i - 1 )
  2720. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2721. ).replace( rtrim, "$1" ),
  2722. matcher,
  2723. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2724. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2725. j < len && toSelector( tokens )
  2726. );
  2727. }
  2728. matchers.push( matcher );
  2729. }
  2730. }
  2731.  
  2732. return elementMatcher( matchers );
  2733. }
  2734.  
  2735. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2736. var bySet = setMatchers.length > 0,
  2737. byElement = elementMatchers.length > 0,
  2738. superMatcher = function( seed, context, xml, results, outermost ) {
  2739. var elem, j, matcher,
  2740. matchedCount = 0,
  2741. i = "0",
  2742. unmatched = seed && [],
  2743. setMatched = [],
  2744. contextBackup = outermostContext,
  2745.  
  2746. // We must always have either seed elements or outermost context
  2747. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  2748.  
  2749. // Use integer dirruns iff this is the outermost matcher
  2750. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2751. len = elems.length;
  2752.  
  2753. if ( outermost ) {
  2754.  
  2755. // Support: IE 11+, Edge 17 - 18+
  2756. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2757. // two documents; shallow comparisons work.
  2758. // eslint-disable-next-line eqeqeq
  2759. outermostContext = context == document || context || outermost;
  2760. }
  2761.  
  2762. // Add elements passing elementMatchers directly to results
  2763. // Support: IE<9, Safari
  2764. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2765. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2766. if ( byElement && elem ) {
  2767. j = 0;
  2768.  
  2769. // Support: IE 11+, Edge 17 - 18+
  2770. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2771. // two documents; shallow comparisons work.
  2772. // eslint-disable-next-line eqeqeq
  2773. if ( !context && elem.ownerDocument != document ) {
  2774. setDocument( elem );
  2775. xml = !documentIsHTML;
  2776. }
  2777. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2778. if ( matcher( elem, context || document, xml ) ) {
  2779. results.push( elem );
  2780. break;
  2781. }
  2782. }
  2783. if ( outermost ) {
  2784. dirruns = dirrunsUnique;
  2785. }
  2786. }
  2787.  
  2788. // Track unmatched elements for set filters
  2789. if ( bySet ) {
  2790.  
  2791. // They will have gone through all possible matchers
  2792. if ( ( elem = !matcher && elem ) ) {
  2793. matchedCount--;
  2794. }
  2795.  
  2796. // Lengthen the array for every element, matched or not
  2797. if ( seed ) {
  2798. unmatched.push( elem );
  2799. }
  2800. }
  2801. }
  2802.  
  2803. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2804. // makes the latter nonnegative.
  2805. matchedCount += i;
  2806.  
  2807. // Apply set filters to unmatched elements
  2808. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2809. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2810. // no element matchers and no seed.
  2811. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2812. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2813. // numerically zero.
  2814. if ( bySet && i !== matchedCount ) {
  2815. j = 0;
  2816. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2817. matcher( unmatched, setMatched, context, xml );
  2818. }
  2819.  
  2820. if ( seed ) {
  2821.  
  2822. // Reintegrate element matches to eliminate the need for sorting
  2823. if ( matchedCount > 0 ) {
  2824. while ( i-- ) {
  2825. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2826. setMatched[ i ] = pop.call( results );
  2827. }
  2828. }
  2829. }
  2830.  
  2831. // Discard index placeholder values to get only actual matches
  2832. setMatched = condense( setMatched );
  2833. }
  2834.  
  2835. // Add matches to results
  2836. push.apply( results, setMatched );
  2837.  
  2838. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2839. if ( outermost && !seed && setMatched.length > 0 &&
  2840. ( matchedCount + setMatchers.length ) > 1 ) {
  2841.  
  2842. Sizzle.uniqueSort( results );
  2843. }
  2844. }
  2845.  
  2846. // Override manipulation of globals by nested matchers
  2847. if ( outermost ) {
  2848. dirruns = dirrunsUnique;
  2849. outermostContext = contextBackup;
  2850. }
  2851.  
  2852. return unmatched;
  2853. };
  2854.  
  2855. return bySet ?
  2856. markFunction( superMatcher ) :
  2857. superMatcher;
  2858. }
  2859.  
  2860. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2861. var i,
  2862. setMatchers = [],
  2863. elementMatchers = [],
  2864. cached = compilerCache[ selector + " " ];
  2865.  
  2866. if ( !cached ) {
  2867.  
  2868. // Generate a function of recursive functions that can be used to check each element
  2869. if ( !match ) {
  2870. match = tokenize( selector );
  2871. }
  2872. i = match.length;
  2873. while ( i-- ) {
  2874. cached = matcherFromTokens( match[ i ] );
  2875. if ( cached[ expando ] ) {
  2876. setMatchers.push( cached );
  2877. } else {
  2878. elementMatchers.push( cached );
  2879. }
  2880. }
  2881.  
  2882. // Cache the compiled function
  2883. cached = compilerCache(
  2884. selector,
  2885. matcherFromGroupMatchers( elementMatchers, setMatchers )
  2886. );
  2887.  
  2888. // Save selector and tokenization
  2889. cached.selector = selector;
  2890. }
  2891. return cached;
  2892. };
  2893.  
  2894. /**
  2895. * A low-level selection function that works with Sizzle's compiled
  2896. * selector functions
  2897. * @param {String|Function} selector A selector or a pre-compiled
  2898. * selector function built with Sizzle.compile
  2899. * @param {Element} context
  2900. * @param {Array} [results]
  2901. * @param {Array} [seed] A set of elements to match against
  2902. */
  2903. select = Sizzle.select = function( selector, context, results, seed ) {
  2904. var i, tokens, token, type, find,
  2905. compiled = typeof selector === "function" && selector,
  2906. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2907.  
  2908. results = results || [];
  2909.  
  2910. // Try to minimize operations if there is only one selector in the list and no seed
  2911. // (the latter of which guarantees us context)
  2912. if ( match.length === 1 ) {
  2913.  
  2914. // Reduce context if the leading compound selector is an ID
  2915. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2916. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2917. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2918.  
  2919. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  2920. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  2921. if ( !context ) {
  2922. return results;
  2923.  
  2924. // Precompiled matchers will still verify ancestry, so step up a level
  2925. } else if ( compiled ) {
  2926. context = context.parentNode;
  2927. }
  2928.  
  2929. selector = selector.slice( tokens.shift().value.length );
  2930. }
  2931.  
  2932. // Fetch a seed set for right-to-left matching
  2933. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  2934. while ( i-- ) {
  2935. token = tokens[ i ];
  2936.  
  2937. // Abort if we hit a combinator
  2938. if ( Expr.relative[ ( type = token.type ) ] ) {
  2939. break;
  2940. }
  2941. if ( ( find = Expr.find[ type ] ) ) {
  2942.  
  2943. // Search, expanding context for leading sibling combinators
  2944. if ( ( seed = find(
  2945. token.matches[ 0 ].replace( runescape, funescape ),
  2946. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  2947. context
  2948. ) ) ) {
  2949.  
  2950. // If seed is empty or no tokens remain, we can return early
  2951. tokens.splice( i, 1 );
  2952. selector = seed.length && toSelector( tokens );
  2953. if ( !selector ) {
  2954. push.apply( results, seed );
  2955. return results;
  2956. }
  2957.  
  2958. break;
  2959. }
  2960. }
  2961. }
  2962. }
  2963.  
  2964. // Compile and execute a filtering function if one is not provided
  2965. // Provide `match` to avoid retokenization if we modified the selector above
  2966. ( compiled || compile( selector, match ) )(
  2967. seed,
  2968. context,
  2969. !documentIsHTML,
  2970. results,
  2971. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2972. );
  2973. return results;
  2974. };
  2975.  
  2976. // One-time assignments
  2977.  
  2978. // Sort stability
  2979. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2980.  
  2981. // Support: Chrome 14-35+
  2982. // Always assume duplicates if they aren't passed to the comparison function
  2983. support.detectDuplicates = !!hasDuplicate;
  2984.  
  2985. // Initialize against the default document
  2986. setDocument();
  2987.  
  2988. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2989. // Detached nodes confoundingly follow *each other*
  2990. support.sortDetached = assert( function( el ) {
  2991.  
  2992. // Should return 1, but returns 4 (following)
  2993. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2994. } );
  2995.  
  2996. // Support: IE<8
  2997. // Prevent attribute/property "interpolation"
  2998. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2999. if ( !assert( function( el ) {
  3000. el.innerHTML = "<a href='#'></a>";
  3001. return el.firstChild.getAttribute( "href" ) === "#";
  3002. } ) ) {
  3003. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  3004. if ( !isXML ) {
  3005. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  3006. }
  3007. } );
  3008. }
  3009.  
  3010. // Support: IE<9
  3011. // Use defaultValue in place of getAttribute("value")
  3012. if ( !support.attributes || !assert( function( el ) {
  3013. el.innerHTML = "<input/>";
  3014. el.firstChild.setAttribute( "value", "" );
  3015. return el.firstChild.getAttribute( "value" ) === "";
  3016. } ) ) {
  3017. addHandle( "value", function( elem, _name, isXML ) {
  3018. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  3019. return elem.defaultValue;
  3020. }
  3021. } );
  3022. }
  3023.  
  3024. // Support: IE<9
  3025. // Use getAttributeNode to fetch booleans when getAttribute lies
  3026. if ( !assert( function( el ) {
  3027. return el.getAttribute( "disabled" ) == null;
  3028. } ) ) {
  3029. addHandle( booleans, function( elem, name, isXML ) {
  3030. var val;
  3031. if ( !isXML ) {
  3032. return elem[ name ] === true ? name.toLowerCase() :
  3033. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  3034. val.value :
  3035. null;
  3036. }
  3037. } );
  3038. }
  3039.  
  3040. return Sizzle;
  3041.  
  3042. } )( window );
  3043.  
  3044.  
  3045.  
  3046. jQuery.find = Sizzle;
  3047. jQuery.expr = Sizzle.selectors;
  3048.  
  3049. // Deprecated
  3050. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  3051. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  3052. jQuery.text = Sizzle.getText;
  3053. jQuery.isXMLDoc = Sizzle.isXML;
  3054. jQuery.contains = Sizzle.contains;
  3055. jQuery.escapeSelector = Sizzle.escape;
  3056.  
  3057.  
  3058.  
  3059.  
  3060. var dir = function( elem, dir, until ) {
  3061. var matched = [],
  3062. truncate = until !== undefined;
  3063.  
  3064. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  3065. if ( elem.nodeType === 1 ) {
  3066. if ( truncate && jQuery( elem ).is( until ) ) {
  3067. break;
  3068. }
  3069. matched.push( elem );
  3070. }
  3071. }
  3072. return matched;
  3073. };
  3074.  
  3075.  
  3076. var siblings = function( n, elem ) {
  3077. var matched = [];
  3078.  
  3079. for ( ; n; n = n.nextSibling ) {
  3080. if ( n.nodeType === 1 && n !== elem ) {
  3081. matched.push( n );
  3082. }
  3083. }
  3084.  
  3085. return matched;
  3086. };
  3087.  
  3088.  
  3089. var rneedsContext = jQuery.expr.match.needsContext;
  3090.  
  3091.  
  3092.  
  3093. function nodeName( elem, name ) {
  3094.  
  3095. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  3096.  
  3097. }
  3098. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  3099.  
  3100.  
  3101.  
  3102. // Implement the identical functionality for filter and not
  3103. function winnow( elements, qualifier, not ) {
  3104. if ( isFunction( qualifier ) ) {
  3105. return jQuery.grep( elements, function( elem, i ) {
  3106. return !!qualifier.call( elem, i, elem ) !== not;
  3107. } );
  3108. }
  3109.  
  3110. // Single element
  3111. if ( qualifier.nodeType ) {
  3112. return jQuery.grep( elements, function( elem ) {
  3113. return ( elem === qualifier ) !== not;
  3114. } );
  3115. }
  3116.  
  3117. // Arraylike of elements (jQuery, arguments, Array)
  3118. if ( typeof qualifier !== "string" ) {
  3119. return jQuery.grep( elements, function( elem ) {
  3120. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  3121. } );
  3122. }
  3123.  
  3124. // Filtered directly for both simple and complex selectors
  3125. return jQuery.filter( qualifier, elements, not );
  3126. }
  3127.  
  3128. jQuery.filter = function( expr, elems, not ) {
  3129. var elem = elems[ 0 ];
  3130.  
  3131. if ( not ) {
  3132. expr = ":not(" + expr + ")";
  3133. }
  3134.  
  3135. if ( elems.length === 1 && elem.nodeType === 1 ) {
  3136. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  3137. }
  3138.  
  3139. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  3140. return elem.nodeType === 1;
  3141. } ) );
  3142. };
  3143.  
  3144. jQuery.fn.extend( {
  3145. find: function( selector ) {
  3146. var i, ret,
  3147. len = this.length,
  3148. self = this;
  3149.  
  3150. if ( typeof selector !== "string" ) {
  3151. return this.pushStack( jQuery( selector ).filter( function() {
  3152. for ( i = 0; i < len; i++ ) {
  3153. if ( jQuery.contains( self[ i ], this ) ) {
  3154. return true;
  3155. }
  3156. }
  3157. } ) );
  3158. }
  3159.  
  3160. ret = this.pushStack( [] );
  3161.  
  3162. for ( i = 0; i < len; i++ ) {
  3163. jQuery.find( selector, self[ i ], ret );
  3164. }
  3165.  
  3166. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  3167. },
  3168. filter: function( selector ) {
  3169. return this.pushStack( winnow( this, selector || [], false ) );
  3170. },
  3171. not: function( selector ) {
  3172. return this.pushStack( winnow( this, selector || [], true ) );
  3173. },
  3174. is: function( selector ) {
  3175. return !!winnow(
  3176. this,
  3177.  
  3178. // If this is a positional/relative selector, check membership in the returned set
  3179. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  3180. typeof selector === "string" && rneedsContext.test( selector ) ?
  3181. jQuery( selector ) :
  3182. selector || [],
  3183. false
  3184. ).length;
  3185. }
  3186. } );
  3187.  
  3188.  
  3189. // Initialize a jQuery object
  3190.  
  3191.  
  3192. // A central reference to the root jQuery(document)
  3193. var rootjQuery,
  3194.  
  3195. // A simple way to check for HTML strings
  3196. // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
  3197. // Strict HTML recognition (trac-11290: must start with <)
  3198. // Shortcut simple #id case for speed
  3199. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  3200.  
  3201. init = jQuery.fn.init = function( selector, context, root ) {
  3202. var match, elem;
  3203.  
  3204. // HANDLE: $(""), $(null), $(undefined), $(false)
  3205. if ( !selector ) {
  3206. return this;
  3207. }
  3208.  
  3209. // Method init() accepts an alternate rootjQuery
  3210. // so migrate can support jQuery.sub (gh-2101)
  3211. root = root || rootjQuery;
  3212.  
  3213. // Handle HTML strings
  3214. if ( typeof selector === "string" ) {
  3215. if ( selector[ 0 ] === "<" &&
  3216. selector[ selector.length - 1 ] === ">" &&
  3217. selector.length >= 3 ) {
  3218.  
  3219. // Assume that strings that start and end with <> are HTML and skip the regex check
  3220. match = [ null, selector, null ];
  3221.  
  3222. } else {
  3223. match = rquickExpr.exec( selector );
  3224. }
  3225.  
  3226. // Match html or make sure no context is specified for #id
  3227. if ( match && ( match[ 1 ] || !context ) ) {
  3228.  
  3229. // HANDLE: $(html) -> $(array)
  3230. if ( match[ 1 ] ) {
  3231. context = context instanceof jQuery ? context[ 0 ] : context;
  3232.  
  3233. // Option to run scripts is true for back-compat
  3234. // Intentionally let the error be thrown if parseHTML is not present
  3235. jQuery.merge( this, jQuery.parseHTML(
  3236. match[ 1 ],
  3237. context && context.nodeType ? context.ownerDocument || context : document,
  3238. true
  3239. ) );
  3240.  
  3241. // HANDLE: $(html, props)
  3242. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  3243. for ( match in context ) {
  3244.  
  3245. // Properties of context are called as methods if possible
  3246. if ( isFunction( this[ match ] ) ) {
  3247. this[ match ]( context[ match ] );
  3248.  
  3249. // ...and otherwise set as attributes
  3250. } else {
  3251. this.attr( match, context[ match ] );
  3252. }
  3253. }
  3254. }
  3255.  
  3256. return this;
  3257.  
  3258. // HANDLE: $(#id)
  3259. } else {
  3260. elem = document.getElementById( match[ 2 ] );
  3261.  
  3262. if ( elem ) {
  3263.  
  3264. // Inject the element directly into the jQuery object
  3265. this[ 0 ] = elem;
  3266. this.length = 1;
  3267. }
  3268. return this;
  3269. }
  3270.  
  3271. // HANDLE: $(expr, $(...))
  3272. } else if ( !context || context.jquery ) {
  3273. return ( context || root ).find( selector );
  3274.  
  3275. // HANDLE: $(expr, context)
  3276. // (which is just equivalent to: $(context).find(expr)
  3277. } else {
  3278. return this.constructor( context ).find( selector );
  3279. }
  3280.  
  3281. // HANDLE: $(DOMElement)
  3282. } else if ( selector.nodeType ) {
  3283. this[ 0 ] = selector;
  3284. this.length = 1;
  3285. return this;
  3286.  
  3287. // HANDLE: $(function)
  3288. // Shortcut for document ready
  3289. } else if ( isFunction( selector ) ) {
  3290. return root.ready !== undefined ?
  3291. root.ready( selector ) :
  3292.  
  3293. // Execute immediately if ready is not present
  3294. selector( jQuery );
  3295. }
  3296.  
  3297. return jQuery.makeArray( selector, this );
  3298. };
  3299.  
  3300. // Give the init function the jQuery prototype for later instantiation
  3301. init.prototype = jQuery.fn;
  3302.  
  3303. // Initialize central reference
  3304. rootjQuery = jQuery( document );
  3305.  
  3306.  
  3307. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  3308.  
  3309. // Methods guaranteed to produce a unique set when starting from a unique set
  3310. guaranteedUnique = {
  3311. children: true,
  3312. contents: true,
  3313. next: true,
  3314. prev: true
  3315. };
  3316.  
  3317. jQuery.fn.extend( {
  3318. has: function( target ) {
  3319. var targets = jQuery( target, this ),
  3320. l = targets.length;
  3321.  
  3322. return this.filter( function() {
  3323. var i = 0;
  3324. for ( ; i < l; i++ ) {
  3325. if ( jQuery.contains( this, targets[ i ] ) ) {
  3326. return true;
  3327. }
  3328. }
  3329. } );
  3330. },
  3331.  
  3332. closest: function( selectors, context ) {
  3333. var cur,
  3334. i = 0,
  3335. l = this.length,
  3336. matched = [],
  3337. targets = typeof selectors !== "string" && jQuery( selectors );
  3338.  
  3339. // Positional selectors never match, since there's no _selection_ context
  3340. if ( !rneedsContext.test( selectors ) ) {
  3341. for ( ; i < l; i++ ) {
  3342. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  3343.  
  3344. // Always skip document fragments
  3345. if ( cur.nodeType < 11 && ( targets ?
  3346. targets.index( cur ) > -1 :
  3347.  
  3348. // Don't pass non-elements to Sizzle
  3349. cur.nodeType === 1 &&
  3350. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  3351.  
  3352. matched.push( cur );
  3353. break;
  3354. }
  3355. }
  3356. }
  3357. }
  3358.  
  3359. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  3360. },
  3361.  
  3362. // Determine the position of an element within the set
  3363. index: function( elem ) {
  3364.  
  3365. // No argument, return index in parent
  3366. if ( !elem ) {
  3367. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  3368. }
  3369.  
  3370. // Index in selector
  3371. if ( typeof elem === "string" ) {
  3372. return indexOf.call( jQuery( elem ), this[ 0 ] );
  3373. }
  3374.  
  3375. // Locate the position of the desired element
  3376. return indexOf.call( this,
  3377.  
  3378. // If it receives a jQuery object, the first element is used
  3379. elem.jquery ? elem[ 0 ] : elem
  3380. );
  3381. },
  3382.  
  3383. add: function( selector, context ) {
  3384. return this.pushStack(
  3385. jQuery.uniqueSort(
  3386. jQuery.merge( this.get(), jQuery( selector, context ) )
  3387. )
  3388. );
  3389. },
  3390.  
  3391. addBack: function( selector ) {
  3392. return this.add( selector == null ?
  3393. this.prevObject : this.prevObject.filter( selector )
  3394. );
  3395. }
  3396. } );
  3397.  
  3398. function sibling( cur, dir ) {
  3399. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  3400. return cur;
  3401. }
  3402.  
  3403. jQuery.each( {
  3404. parent: function( elem ) {
  3405. var parent = elem.parentNode;
  3406. return parent && parent.nodeType !== 11 ? parent : null;
  3407. },
  3408. parents: function( elem ) {
  3409. return dir( elem, "parentNode" );
  3410. },
  3411. parentsUntil: function( elem, _i, until ) {
  3412. return dir( elem, "parentNode", until );
  3413. },
  3414. next: function( elem ) {
  3415. return sibling( elem, "nextSibling" );
  3416. },
  3417. prev: function( elem ) {
  3418. return sibling( elem, "previousSibling" );
  3419. },
  3420. nextAll: function( elem ) {
  3421. return dir( elem, "nextSibling" );
  3422. },
  3423. prevAll: function( elem ) {
  3424. return dir( elem, "previousSibling" );
  3425. },
  3426. nextUntil: function( elem, _i, until ) {
  3427. return dir( elem, "nextSibling", until );
  3428. },
  3429. prevUntil: function( elem, _i, until ) {
  3430. return dir( elem, "previousSibling", until );
  3431. },
  3432. siblings: function( elem ) {
  3433. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  3434. },
  3435. children: function( elem ) {
  3436. return siblings( elem.firstChild );
  3437. },
  3438. contents: function( elem ) {
  3439. if ( elem.contentDocument != null &&
  3440.  
  3441. // Support: IE 11+
  3442. // <object> elements with no `data` attribute has an object
  3443. // `contentDocument` with a `null` prototype.
  3444. getProto( elem.contentDocument ) ) {
  3445.  
  3446. return elem.contentDocument;
  3447. }
  3448.  
  3449. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  3450. // Treat the template element as a regular one in browsers that
  3451. // don't support it.
  3452. if ( nodeName( elem, "template" ) ) {
  3453. elem = elem.content || elem;
  3454. }
  3455.  
  3456. return jQuery.merge( [], elem.childNodes );
  3457. }
  3458. }, function( name, fn ) {
  3459. jQuery.fn[ name ] = function( until, selector ) {
  3460. var matched = jQuery.map( this, fn, until );
  3461.  
  3462. if ( name.slice( -5 ) !== "Until" ) {
  3463. selector = until;
  3464. }
  3465.  
  3466. if ( selector && typeof selector === "string" ) {
  3467. matched = jQuery.filter( selector, matched );
  3468. }
  3469.  
  3470. if ( this.length > 1 ) {
  3471.  
  3472. // Remove duplicates
  3473. if ( !guaranteedUnique[ name ] ) {
  3474. jQuery.uniqueSort( matched );
  3475. }
  3476.  
  3477. // Reverse order for parents* and prev-derivatives
  3478. if ( rparentsprev.test( name ) ) {
  3479. matched.reverse();
  3480. }
  3481. }
  3482.  
  3483. return this.pushStack( matched );
  3484. };
  3485. } );
  3486. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  3487.  
  3488.  
  3489.  
  3490. // Convert String-formatted options into Object-formatted ones
  3491. function createOptions( options ) {
  3492. var object = {};
  3493. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  3494. object[ flag ] = true;
  3495. } );
  3496. return object;
  3497. }
  3498.  
  3499. /*
  3500. * Create a callback list using the following parameters:
  3501. *
  3502. * options: an optional list of space-separated options that will change how
  3503. * the callback list behaves or a more traditional option object
  3504. *
  3505. * By default a callback list will act like an event callback list and can be
  3506. * "fired" multiple times.
  3507. *
  3508. * Possible options:
  3509. *
  3510. * once: will ensure the callback list can only be fired once (like a Deferred)
  3511. *
  3512. * memory: will keep track of previous values and will call any callback added
  3513. * after the list has been fired right away with the latest "memorized"
  3514. * values (like a Deferred)
  3515. *
  3516. * unique: will ensure a callback can only be added once (no duplicate in the list)
  3517. *
  3518. * stopOnFalse: interrupt callings when a callback returns false
  3519. *
  3520. */
  3521. jQuery.Callbacks = function( options ) {
  3522.  
  3523. // Convert options from String-formatted to Object-formatted if needed
  3524. // (we check in cache first)
  3525. options = typeof options === "string" ?
  3526. createOptions( options ) :
  3527. jQuery.extend( {}, options );
  3528.  
  3529. var // Flag to know if list is currently firing
  3530. firing,
  3531.  
  3532. // Last fire value for non-forgettable lists
  3533. memory,
  3534.  
  3535. // Flag to know if list was already fired
  3536. fired,
  3537.  
  3538. // Flag to prevent firing
  3539. locked,
  3540.  
  3541. // Actual callback list
  3542. list = [],
  3543.  
  3544. // Queue of execution data for repeatable lists
  3545. queue = [],
  3546.  
  3547. // Index of currently firing callback (modified by add/remove as needed)
  3548. firingIndex = -1,
  3549.  
  3550. // Fire callbacks
  3551. fire = function() {
  3552.  
  3553. // Enforce single-firing
  3554. locked = locked || options.once;
  3555.  
  3556. // Execute callbacks for all pending executions,
  3557. // respecting firingIndex overrides and runtime changes
  3558. fired = firing = true;
  3559. for ( ; queue.length; firingIndex = -1 ) {
  3560. memory = queue.shift();
  3561. while ( ++firingIndex < list.length ) {
  3562.  
  3563. // Run callback and check for early termination
  3564. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  3565. options.stopOnFalse ) {
  3566.  
  3567. // Jump to end and forget the data so .add doesn't re-fire
  3568. firingIndex = list.length;
  3569. memory = false;
  3570. }
  3571. }
  3572. }
  3573.  
  3574. // Forget the data if we're done with it
  3575. if ( !options.memory ) {
  3576. memory = false;
  3577. }
  3578.  
  3579. firing = false;
  3580.  
  3581. // Clean up if we're done firing for good
  3582. if ( locked ) {
  3583.  
  3584. // Keep an empty list if we have data for future add calls
  3585. if ( memory ) {
  3586. list = [];
  3587.  
  3588. // Otherwise, this object is spent
  3589. } else {
  3590. list = "";
  3591. }
  3592. }
  3593. },
  3594.  
  3595. // Actual Callbacks object
  3596. self = {
  3597.  
  3598. // Add a callback or a collection of callbacks to the list
  3599. add: function() {
  3600. if ( list ) {
  3601.  
  3602. // If we have memory from a past run, we should fire after adding
  3603. if ( memory && !firing ) {
  3604. firingIndex = list.length - 1;
  3605. queue.push( memory );
  3606. }
  3607.  
  3608. ( function add( args ) {
  3609. jQuery.each( args, function( _, arg ) {
  3610. if ( isFunction( arg ) ) {
  3611. if ( !options.unique || !self.has( arg ) ) {
  3612. list.push( arg );
  3613. }
  3614. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  3615.  
  3616. // Inspect recursively
  3617. add( arg );
  3618. }
  3619. } );
  3620. } )( arguments );
  3621.  
  3622. if ( memory && !firing ) {
  3623. fire();
  3624. }
  3625. }
  3626. return this;
  3627. },
  3628.  
  3629. // Remove a callback from the list
  3630. remove: function() {
  3631. jQuery.each( arguments, function( _, arg ) {
  3632. var index;
  3633. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  3634. list.splice( index, 1 );
  3635.  
  3636. // Handle firing indexes
  3637. if ( index <= firingIndex ) {
  3638. firingIndex--;
  3639. }
  3640. }
  3641. } );
  3642. return this;
  3643. },
  3644.  
  3645. // Check if a given callback is in the list.
  3646. // If no argument is given, return whether or not list has callbacks attached.
  3647. has: function( fn ) {
  3648. return fn ?
  3649. jQuery.inArray( fn, list ) > -1 :
  3650. list.length > 0;
  3651. },
  3652.  
  3653. // Remove all callbacks from the list
  3654. empty: function() {
  3655. if ( list ) {
  3656. list = [];
  3657. }
  3658. return this;
  3659. },
  3660.  
  3661. // Disable .fire and .add
  3662. // Abort any current/pending executions
  3663. // Clear all callbacks and values
  3664. disable: function() {
  3665. locked = queue = [];
  3666. list = memory = "";
  3667. return this;
  3668. },
  3669. disabled: function() {
  3670. return !list;
  3671. },
  3672.  
  3673. // Disable .fire
  3674. // Also disable .add unless we have memory (since it would have no effect)
  3675. // Abort any pending executions
  3676. lock: function() {
  3677. locked = queue = [];
  3678. if ( !memory && !firing ) {
  3679. list = memory = "";
  3680. }
  3681. return this;
  3682. },
  3683. locked: function() {
  3684. return !!locked;
  3685. },
  3686.  
  3687. // Call all callbacks with the given context and arguments
  3688. fireWith: function( context, args ) {
  3689. if ( !locked ) {
  3690. args = args || [];
  3691. args = [ context, args.slice ? args.slice() : args ];
  3692. queue.push( args );
  3693. if ( !firing ) {
  3694. fire();
  3695. }
  3696. }
  3697. return this;
  3698. },
  3699.  
  3700. // Call all the callbacks with the given arguments
  3701. fire: function() {
  3702. self.fireWith( this, arguments );
  3703. return this;
  3704. },
  3705.  
  3706. // To know if the callbacks have already been called at least once
  3707. fired: function() {
  3708. return !!fired;
  3709. }
  3710. };
  3711.  
  3712. return self;
  3713. };
  3714.  
  3715.  
  3716. function Identity( v ) {
  3717. return v;
  3718. }
  3719. function Thrower( ex ) {
  3720. throw ex;
  3721. }
  3722.  
  3723. function adoptValue( value, resolve, reject, noValue ) {
  3724. var method;
  3725.  
  3726. try {
  3727.  
  3728. // Check for promise aspect first to privilege synchronous behavior
  3729. if ( value && isFunction( ( method = value.promise ) ) ) {
  3730. method.call( value ).done( resolve ).fail( reject );
  3731.  
  3732. // Other thenables
  3733. } else if ( value && isFunction( ( method = value.then ) ) ) {
  3734. method.call( value, resolve, reject );
  3735.  
  3736. // Other non-thenables
  3737. } else {
  3738.  
  3739. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  3740. // * false: [ value ].slice( 0 ) => resolve( value )
  3741. // * true: [ value ].slice( 1 ) => resolve()
  3742. resolve.apply( undefined, [ value ].slice( noValue ) );
  3743. }
  3744.  
  3745. // For Promises/A+, convert exceptions into rejections
  3746. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3747. // Deferred#then to conditionally suppress rejection.
  3748. } catch ( value ) {
  3749.  
  3750. // Support: Android 4.0 only
  3751. // Strict mode functions invoked without .call/.apply get global-object context
  3752. reject.apply( undefined, [ value ] );
  3753. }
  3754. }
  3755.  
  3756. jQuery.extend( {
  3757.  
  3758. Deferred: function( func ) {
  3759. var tuples = [
  3760.  
  3761. // action, add listener, callbacks,
  3762. // ... .then handlers, argument index, [final state]
  3763. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3764. jQuery.Callbacks( "memory" ), 2 ],
  3765. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3766. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3767. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3768. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3769. ],
  3770. state = "pending",
  3771. promise = {
  3772. state: function() {
  3773. return state;
  3774. },
  3775. always: function() {
  3776. deferred.done( arguments ).fail( arguments );
  3777. return this;
  3778. },
  3779. "catch": function( fn ) {
  3780. return promise.then( null, fn );
  3781. },
  3782.  
  3783. // Keep pipe for back-compat
  3784. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3785. var fns = arguments;
  3786.  
  3787. return jQuery.Deferred( function( newDefer ) {
  3788. jQuery.each( tuples, function( _i, tuple ) {
  3789.  
  3790. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3791. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3792.  
  3793. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3794. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3795. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3796. deferred[ tuple[ 1 ] ]( function() {
  3797. var returned = fn && fn.apply( this, arguments );
  3798. if ( returned && isFunction( returned.promise ) ) {
  3799. returned.promise()
  3800. .progress( newDefer.notify )
  3801. .done( newDefer.resolve )
  3802. .fail( newDefer.reject );
  3803. } else {
  3804. newDefer[ tuple[ 0 ] + "With" ](
  3805. this,
  3806. fn ? [ returned ] : arguments
  3807. );
  3808. }
  3809. } );
  3810. } );
  3811. fns = null;
  3812. } ).promise();
  3813. },
  3814. then: function( onFulfilled, onRejected, onProgress ) {
  3815. var maxDepth = 0;
  3816. function resolve( depth, deferred, handler, special ) {
  3817. return function() {
  3818. var that = this,
  3819. args = arguments,
  3820. mightThrow = function() {
  3821. var returned, then;
  3822.  
  3823. // Support: Promises/A+ section 2.3.3.3.3
  3824. // https://promisesaplus.com/#point-59
  3825. // Ignore double-resolution attempts
  3826. if ( depth < maxDepth ) {
  3827. return;
  3828. }
  3829.  
  3830. returned = handler.apply( that, args );
  3831.  
  3832. // Support: Promises/A+ section 2.3.1
  3833. // https://promisesaplus.com/#point-48
  3834. if ( returned === deferred.promise() ) {
  3835. throw new TypeError( "Thenable self-resolution" );
  3836. }
  3837.  
  3838. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3839. // https://promisesaplus.com/#point-54
  3840. // https://promisesaplus.com/#point-75
  3841. // Retrieve `then` only once
  3842. then = returned &&
  3843.  
  3844. // Support: Promises/A+ section 2.3.4
  3845. // https://promisesaplus.com/#point-64
  3846. // Only check objects and functions for thenability
  3847. ( typeof returned === "object" ||
  3848. typeof returned === "function" ) &&
  3849. returned.then;
  3850.  
  3851. // Handle a returned thenable
  3852. if ( isFunction( then ) ) {
  3853.  
  3854. // Special processors (notify) just wait for resolution
  3855. if ( special ) {
  3856. then.call(
  3857. returned,
  3858. resolve( maxDepth, deferred, Identity, special ),
  3859. resolve( maxDepth, deferred, Thrower, special )
  3860. );
  3861.  
  3862. // Normal processors (resolve) also hook into progress
  3863. } else {
  3864.  
  3865. // ...and disregard older resolution values
  3866. maxDepth++;
  3867.  
  3868. then.call(
  3869. returned,
  3870. resolve( maxDepth, deferred, Identity, special ),
  3871. resolve( maxDepth, deferred, Thrower, special ),
  3872. resolve( maxDepth, deferred, Identity,
  3873. deferred.notifyWith )
  3874. );
  3875. }
  3876.  
  3877. // Handle all other returned values
  3878. } else {
  3879.  
  3880. // Only substitute handlers pass on context
  3881. // and multiple values (non-spec behavior)
  3882. if ( handler !== Identity ) {
  3883. that = undefined;
  3884. args = [ returned ];
  3885. }
  3886.  
  3887. // Process the value(s)
  3888. // Default process is resolve
  3889. ( special || deferred.resolveWith )( that, args );
  3890. }
  3891. },
  3892.  
  3893. // Only normal processors (resolve) catch and reject exceptions
  3894. process = special ?
  3895. mightThrow :
  3896. function() {
  3897. try {
  3898. mightThrow();
  3899. } catch ( e ) {
  3900.  
  3901. if ( jQuery.Deferred.exceptionHook ) {
  3902. jQuery.Deferred.exceptionHook( e,
  3903. process.stackTrace );
  3904. }
  3905.  
  3906. // Support: Promises/A+ section 2.3.3.3.4.1
  3907. // https://promisesaplus.com/#point-61
  3908. // Ignore post-resolution exceptions
  3909. if ( depth + 1 >= maxDepth ) {
  3910.  
  3911. // Only substitute handlers pass on context
  3912. // and multiple values (non-spec behavior)
  3913. if ( handler !== Thrower ) {
  3914. that = undefined;
  3915. args = [ e ];
  3916. }
  3917.  
  3918. deferred.rejectWith( that, args );
  3919. }
  3920. }
  3921. };
  3922.  
  3923. // Support: Promises/A+ section 2.3.3.3.1
  3924. // https://promisesaplus.com/#point-57
  3925. // Re-resolve promises immediately to dodge false rejection from
  3926. // subsequent errors
  3927. if ( depth ) {
  3928. process();
  3929. } else {
  3930.  
  3931. // Call an optional hook to record the stack, in case of exception
  3932. // since it's otherwise lost when execution goes async
  3933. if ( jQuery.Deferred.getStackHook ) {
  3934. process.stackTrace = jQuery.Deferred.getStackHook();
  3935. }
  3936. window.setTimeout( process );
  3937. }
  3938. };
  3939. }
  3940.  
  3941. return jQuery.Deferred( function( newDefer ) {
  3942.  
  3943. // progress_handlers.add( ... )
  3944. tuples[ 0 ][ 3 ].add(
  3945. resolve(
  3946. 0,
  3947. newDefer,
  3948. isFunction( onProgress ) ?
  3949. onProgress :
  3950. Identity,
  3951. newDefer.notifyWith
  3952. )
  3953. );
  3954.  
  3955. // fulfilled_handlers.add( ... )
  3956. tuples[ 1 ][ 3 ].add(
  3957. resolve(
  3958. 0,
  3959. newDefer,
  3960. isFunction( onFulfilled ) ?
  3961. onFulfilled :
  3962. Identity
  3963. )
  3964. );
  3965.  
  3966. // rejected_handlers.add( ... )
  3967. tuples[ 2 ][ 3 ].add(
  3968. resolve(
  3969. 0,
  3970. newDefer,
  3971. isFunction( onRejected ) ?
  3972. onRejected :
  3973. Thrower
  3974. )
  3975. );
  3976. } ).promise();
  3977. },
  3978.  
  3979. // Get a promise for this deferred
  3980. // If obj is provided, the promise aspect is added to the object
  3981. promise: function( obj ) {
  3982. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3983. }
  3984. },
  3985. deferred = {};
  3986.  
  3987. // Add list-specific methods
  3988. jQuery.each( tuples, function( i, tuple ) {
  3989. var list = tuple[ 2 ],
  3990. stateString = tuple[ 5 ];
  3991.  
  3992. // promise.progress = list.add
  3993. // promise.done = list.add
  3994. // promise.fail = list.add
  3995. promise[ tuple[ 1 ] ] = list.add;
  3996.  
  3997. // Handle state
  3998. if ( stateString ) {
  3999. list.add(
  4000. function() {
  4001.  
  4002. // state = "resolved" (i.e., fulfilled)
  4003. // state = "rejected"
  4004. state = stateString;
  4005. },
  4006.  
  4007. // rejected_callbacks.disable
  4008. // fulfilled_callbacks.disable
  4009. tuples[ 3 - i ][ 2 ].disable,
  4010.  
  4011. // rejected_handlers.disable
  4012. // fulfilled_handlers.disable
  4013. tuples[ 3 - i ][ 3 ].disable,
  4014.  
  4015. // progress_callbacks.lock
  4016. tuples[ 0 ][ 2 ].lock,
  4017.  
  4018. // progress_handlers.lock
  4019. tuples[ 0 ][ 3 ].lock
  4020. );
  4021. }
  4022.  
  4023. // progress_handlers.fire
  4024. // fulfilled_handlers.fire
  4025. // rejected_handlers.fire
  4026. list.add( tuple[ 3 ].fire );
  4027.  
  4028. // deferred.notify = function() { deferred.notifyWith(...) }
  4029. // deferred.resolve = function() { deferred.resolveWith(...) }
  4030. // deferred.reject = function() { deferred.rejectWith(...) }
  4031. deferred[ tuple[ 0 ] ] = function() {
  4032. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  4033. return this;
  4034. };
  4035.  
  4036. // deferred.notifyWith = list.fireWith
  4037. // deferred.resolveWith = list.fireWith
  4038. // deferred.rejectWith = list.fireWith
  4039. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  4040. } );
  4041.  
  4042. // Make the deferred a promise
  4043. promise.promise( deferred );
  4044.  
  4045. // Call given func if any
  4046. if ( func ) {
  4047. func.call( deferred, deferred );
  4048. }
  4049.  
  4050. // All done!
  4051. return deferred;
  4052. },
  4053.  
  4054. // Deferred helper
  4055. when: function( singleValue ) {
  4056. var
  4057.  
  4058. // count of uncompleted subordinates
  4059. remaining = arguments.length,
  4060.  
  4061. // count of unprocessed arguments
  4062. i = remaining,
  4063.  
  4064. // subordinate fulfillment data
  4065. resolveContexts = Array( i ),
  4066. resolveValues = slice.call( arguments ),
  4067.  
  4068. // the primary Deferred
  4069. primary = jQuery.Deferred(),
  4070.  
  4071. // subordinate callback factory
  4072. updateFunc = function( i ) {
  4073. return function( value ) {
  4074. resolveContexts[ i ] = this;
  4075. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  4076. if ( !( --remaining ) ) {
  4077. primary.resolveWith( resolveContexts, resolveValues );
  4078. }
  4079. };
  4080. };
  4081.  
  4082. // Single- and empty arguments are adopted like Promise.resolve
  4083. if ( remaining <= 1 ) {
  4084. adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
  4085. !remaining );
  4086.  
  4087. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  4088. if ( primary.state() === "pending" ||
  4089. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  4090.  
  4091. return primary.then();
  4092. }
  4093. }
  4094.  
  4095. // Multiple arguments are aggregated like Promise.all array elements
  4096. while ( i-- ) {
  4097. adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
  4098. }
  4099.  
  4100. return primary.promise();
  4101. }
  4102. } );
  4103.  
  4104.  
  4105. // These usually indicate a programmer mistake during development,
  4106. // warn about them ASAP rather than swallowing them by default.
  4107. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  4108.  
  4109. jQuery.Deferred.exceptionHook = function( error, stack ) {
  4110.  
  4111. // Support: IE 8 - 9 only
  4112. // Console exists when dev tools are open, which can happen at any time
  4113. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  4114. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  4115. }
  4116. };
  4117.  
  4118.  
  4119.  
  4120.  
  4121. jQuery.readyException = function( error ) {
  4122. window.setTimeout( function() {
  4123. throw error;
  4124. } );
  4125. };
  4126.  
  4127.  
  4128.  
  4129.  
  4130. // The deferred used on DOM ready
  4131. var readyList = jQuery.Deferred();
  4132.  
  4133. jQuery.fn.ready = function( fn ) {
  4134.  
  4135. readyList
  4136. .then( fn )
  4137.  
  4138. // Wrap jQuery.readyException in a function so that the lookup
  4139. // happens at the time of error handling instead of callback
  4140. // registration.
  4141. .catch( function( error ) {
  4142. jQuery.readyException( error );
  4143. } );
  4144.  
  4145. return this;
  4146. };
  4147.  
  4148. jQuery.extend( {
  4149.  
  4150. // Is the DOM ready to be used? Set to true once it occurs.
  4151. isReady: false,
  4152.  
  4153. // A counter to track how many items to wait for before
  4154. // the ready event fires. See trac-6781
  4155. readyWait: 1,
  4156.  
  4157. // Handle when the DOM is ready
  4158. ready: function( wait ) {
  4159.  
  4160. // Abort if there are pending holds or we're already ready
  4161. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  4162. return;
  4163. }
  4164.  
  4165. // Remember that the DOM is ready
  4166. jQuery.isReady = true;
  4167.  
  4168. // If a normal DOM Ready event fired, decrement, and wait if need be
  4169. if ( wait !== true && --jQuery.readyWait > 0 ) {
  4170. return;
  4171. }
  4172.  
  4173. // If there are functions bound, to execute
  4174. readyList.resolveWith( document, [ jQuery ] );
  4175. }
  4176. } );
  4177.  
  4178. jQuery.ready.then = readyList.then;
  4179.  
  4180. // The ready event handler and self cleanup method
  4181. function completed() {
  4182. document.removeEventListener( "DOMContentLoaded", completed );
  4183. window.removeEventListener( "load", completed );
  4184. jQuery.ready();
  4185. }
  4186.  
  4187. // Catch cases where $(document).ready() is called
  4188. // after the browser event has already occurred.
  4189. // Support: IE <=9 - 10 only
  4190. // Older IE sometimes signals "interactive" too soon
  4191. if ( document.readyState === "complete" ||
  4192. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  4193.  
  4194. // Handle it asynchronously to allow scripts the opportunity to delay ready
  4195. window.setTimeout( jQuery.ready );
  4196.  
  4197. } else {
  4198.  
  4199. // Use the handy event callback
  4200. document.addEventListener( "DOMContentLoaded", completed );
  4201.  
  4202. // A fallback to window.onload, that will always work
  4203. window.addEventListener( "load", completed );
  4204. }
  4205.  
  4206.  
  4207.  
  4208.  
  4209. // Multifunctional method to get and set values of a collection
  4210. // The value/s can optionally be executed if it's a function
  4211. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  4212. var i = 0,
  4213. len = elems.length,
  4214. bulk = key == null;
  4215.  
  4216. // Sets many values
  4217. if ( toType( key ) === "object" ) {
  4218. chainable = true;
  4219. for ( i in key ) {
  4220. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  4221. }
  4222.  
  4223. // Sets one value
  4224. } else if ( value !== undefined ) {
  4225. chainable = true;
  4226.  
  4227. if ( !isFunction( value ) ) {
  4228. raw = true;
  4229. }
  4230.  
  4231. if ( bulk ) {
  4232.  
  4233. // Bulk operations run against the entire set
  4234. if ( raw ) {
  4235. fn.call( elems, value );
  4236. fn = null;
  4237.  
  4238. // ...except when executing function values
  4239. } else {
  4240. bulk = fn;
  4241. fn = function( elem, _key, value ) {
  4242. return bulk.call( jQuery( elem ), value );
  4243. };
  4244. }
  4245. }
  4246.  
  4247. if ( fn ) {
  4248. for ( ; i < len; i++ ) {
  4249. fn(
  4250. elems[ i ], key, raw ?
  4251. value :
  4252. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  4253. );
  4254. }
  4255. }
  4256. }
  4257.  
  4258. if ( chainable ) {
  4259. return elems;
  4260. }
  4261.  
  4262. // Gets
  4263. if ( bulk ) {
  4264. return fn.call( elems );
  4265. }
  4266.  
  4267. return len ? fn( elems[ 0 ], key ) : emptyGet;
  4268. };
  4269.  
  4270.  
  4271. // Matches dashed string for camelizing
  4272. var rmsPrefix = /^-ms-/,
  4273. rdashAlpha = /-([a-z])/g;
  4274.  
  4275. // Used by camelCase as callback to replace()
  4276. function fcamelCase( _all, letter ) {
  4277. return letter.toUpperCase();
  4278. }
  4279.  
  4280. // Convert dashed to camelCase; used by the css and data modules
  4281. // Support: IE <=9 - 11, Edge 12 - 15
  4282. // Microsoft forgot to hump their vendor prefix (trac-9572)
  4283. function camelCase( string ) {
  4284. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  4285. }
  4286. var acceptData = function( owner ) {
  4287.  
  4288. // Accepts only:
  4289. // - Node
  4290. // - Node.ELEMENT_NODE
  4291. // - Node.DOCUMENT_NODE
  4292. // - Object
  4293. // - Any
  4294. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  4295. };
  4296.  
  4297.  
  4298.  
  4299.  
  4300. function Data() {
  4301. this.expando = jQuery.expando + Data.uid++;
  4302. }
  4303.  
  4304. Data.uid = 1;
  4305.  
  4306. Data.prototype = {
  4307.  
  4308. cache: function( owner ) {
  4309.  
  4310. // Check if the owner object already has a cache
  4311. var value = owner[ this.expando ];
  4312.  
  4313. // If not, create one
  4314. if ( !value ) {
  4315. value = {};
  4316.  
  4317. // We can accept data for non-element nodes in modern browsers,
  4318. // but we should not, see trac-8335.
  4319. // Always return an empty object.
  4320. if ( acceptData( owner ) ) {
  4321.  
  4322. // If it is a node unlikely to be stringify-ed or looped over
  4323. // use plain assignment
  4324. if ( owner.nodeType ) {
  4325. owner[ this.expando ] = value;
  4326.  
  4327. // Otherwise secure it in a non-enumerable property
  4328. // configurable must be true to allow the property to be
  4329. // deleted when data is removed
  4330. } else {
  4331. Object.defineProperty( owner, this.expando, {
  4332. value: value,
  4333. configurable: true
  4334. } );
  4335. }
  4336. }
  4337. }
  4338.  
  4339. return value;
  4340. },
  4341. set: function( owner, data, value ) {
  4342. var prop,
  4343. cache = this.cache( owner );
  4344.  
  4345. // Handle: [ owner, key, value ] args
  4346. // Always use camelCase key (gh-2257)
  4347. if ( typeof data === "string" ) {
  4348. cache[ camelCase( data ) ] = value;
  4349.  
  4350. // Handle: [ owner, { properties } ] args
  4351. } else {
  4352.  
  4353. // Copy the properties one-by-one to the cache object
  4354. for ( prop in data ) {
  4355. cache[ camelCase( prop ) ] = data[ prop ];
  4356. }
  4357. }
  4358. return cache;
  4359. },
  4360. get: function( owner, key ) {
  4361. return key === undefined ?
  4362. this.cache( owner ) :
  4363.  
  4364. // Always use camelCase key (gh-2257)
  4365. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  4366. },
  4367. access: function( owner, key, value ) {
  4368.  
  4369. // In cases where either:
  4370. //
  4371. // 1. No key was specified
  4372. // 2. A string key was specified, but no value provided
  4373. //
  4374. // Take the "read" path and allow the get method to determine
  4375. // which value to return, respectively either:
  4376. //
  4377. // 1. The entire cache object
  4378. // 2. The data stored at the key
  4379. //
  4380. if ( key === undefined ||
  4381. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  4382.  
  4383. return this.get( owner, key );
  4384. }
  4385.  
  4386. // When the key is not a string, or both a key and value
  4387. // are specified, set or extend (existing objects) with either:
  4388. //
  4389. // 1. An object of properties
  4390. // 2. A key and value
  4391. //
  4392. this.set( owner, key, value );
  4393.  
  4394. // Since the "set" path can have two possible entry points
  4395. // return the expected data based on which path was taken[*]
  4396. return value !== undefined ? value : key;
  4397. },
  4398. remove: function( owner, key ) {
  4399. var i,
  4400. cache = owner[ this.expando ];
  4401.  
  4402. if ( cache === undefined ) {
  4403. return;
  4404. }
  4405.  
  4406. if ( key !== undefined ) {
  4407.  
  4408. // Support array or space separated string of keys
  4409. if ( Array.isArray( key ) ) {
  4410.  
  4411. // If key is an array of keys...
  4412. // We always set camelCase keys, so remove that.
  4413. key = key.map( camelCase );
  4414. } else {
  4415. key = camelCase( key );
  4416.  
  4417. // If a key with the spaces exists, use it.
  4418. // Otherwise, create an array by matching non-whitespace
  4419. key = key in cache ?
  4420. [ key ] :
  4421. ( key.match( rnothtmlwhite ) || [] );
  4422. }
  4423.  
  4424. i = key.length;
  4425.  
  4426. while ( i-- ) {
  4427. delete cache[ key[ i ] ];
  4428. }
  4429. }
  4430.  
  4431. // Remove the expando if there's no more data
  4432. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  4433.  
  4434. // Support: Chrome <=35 - 45
  4435. // Webkit & Blink performance suffers when deleting properties
  4436. // from DOM nodes, so set to undefined instead
  4437. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  4438. if ( owner.nodeType ) {
  4439. owner[ this.expando ] = undefined;
  4440. } else {
  4441. delete owner[ this.expando ];
  4442. }
  4443. }
  4444. },
  4445. hasData: function( owner ) {
  4446. var cache = owner[ this.expando ];
  4447. return cache !== undefined && !jQuery.isEmptyObject( cache );
  4448. }
  4449. };
  4450. var dataPriv = new Data();
  4451.  
  4452. var dataUser = new Data();
  4453.  
  4454.  
  4455.  
  4456. // Implementation Summary
  4457. //
  4458. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  4459. // 2. Improve the module's maintainability by reducing the storage
  4460. // paths to a single mechanism.
  4461. // 3. Use the same single mechanism to support "private" and "user" data.
  4462. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  4463. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  4464. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  4465.  
  4466. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  4467. rmultiDash = /[A-Z]/g;
  4468.  
  4469. function getData( data ) {
  4470. if ( data === "true" ) {
  4471. return true;
  4472. }
  4473.  
  4474. if ( data === "false" ) {
  4475. return false;
  4476. }
  4477.  
  4478. if ( data === "null" ) {
  4479. return null;
  4480. }
  4481.  
  4482. // Only convert to a number if it doesn't change the string
  4483. if ( data === +data + "" ) {
  4484. return +data;
  4485. }
  4486.  
  4487. if ( rbrace.test( data ) ) {
  4488. return JSON.parse( data );
  4489. }
  4490.  
  4491. return data;
  4492. }
  4493.  
  4494. function dataAttr( elem, key, data ) {
  4495. var name;
  4496.  
  4497. // If nothing was found internally, try to fetch any
  4498. // data from the HTML5 data-* attribute
  4499. if ( data === undefined && elem.nodeType === 1 ) {
  4500. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  4501. data = elem.getAttribute( name );
  4502.  
  4503. if ( typeof data === "string" ) {
  4504. try {
  4505. data = getData( data );
  4506. } catch ( e ) {}
  4507.  
  4508. // Make sure we set the data so it isn't changed later
  4509. dataUser.set( elem, key, data );
  4510. } else {
  4511. data = undefined;
  4512. }
  4513. }
  4514. return data;
  4515. }
  4516.  
  4517. jQuery.extend( {
  4518. hasData: function( elem ) {
  4519. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  4520. },
  4521.  
  4522. data: function( elem, name, data ) {
  4523. return dataUser.access( elem, name, data );
  4524. },
  4525.  
  4526. removeData: function( elem, name ) {
  4527. dataUser.remove( elem, name );
  4528. },
  4529.  
  4530. // TODO: Now that all calls to _data and _removeData have been replaced
  4531. // with direct calls to dataPriv methods, these can be deprecated.
  4532. _data: function( elem, name, data ) {
  4533. return dataPriv.access( elem, name, data );
  4534. },
  4535.  
  4536. _removeData: function( elem, name ) {
  4537. dataPriv.remove( elem, name );
  4538. }
  4539. } );
  4540.  
  4541. jQuery.fn.extend( {
  4542. data: function( key, value ) {
  4543. var i, name, data,
  4544. elem = this[ 0 ],
  4545. attrs = elem && elem.attributes;
  4546.  
  4547. // Gets all values
  4548. if ( key === undefined ) {
  4549. if ( this.length ) {
  4550. data = dataUser.get( elem );
  4551.  
  4552. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  4553. i = attrs.length;
  4554. while ( i-- ) {
  4555.  
  4556. // Support: IE 11 only
  4557. // The attrs elements can be null (trac-14894)
  4558. if ( attrs[ i ] ) {
  4559. name = attrs[ i ].name;
  4560. if ( name.indexOf( "data-" ) === 0 ) {
  4561. name = camelCase( name.slice( 5 ) );
  4562. dataAttr( elem, name, data[ name ] );
  4563. }
  4564. }
  4565. }
  4566. dataPriv.set( elem, "hasDataAttrs", true );
  4567. }
  4568. }
  4569.  
  4570. return data;
  4571. }
  4572.  
  4573. // Sets multiple values
  4574. if ( typeof key === "object" ) {
  4575. return this.each( function() {
  4576. dataUser.set( this, key );
  4577. } );
  4578. }
  4579.  
  4580. return access( this, function( value ) {
  4581. var data;
  4582.  
  4583. // The calling jQuery object (element matches) is not empty
  4584. // (and therefore has an element appears at this[ 0 ]) and the
  4585. // `value` parameter was not undefined. An empty jQuery object
  4586. // will result in `undefined` for elem = this[ 0 ] which will
  4587. // throw an exception if an attempt to read a data cache is made.
  4588. if ( elem && value === undefined ) {
  4589.  
  4590. // Attempt to get data from the cache
  4591. // The key will always be camelCased in Data
  4592. data = dataUser.get( elem, key );
  4593. if ( data !== undefined ) {
  4594. return data;
  4595. }
  4596.  
  4597. // Attempt to "discover" the data in
  4598. // HTML5 custom data-* attrs
  4599. data = dataAttr( elem, key );
  4600. if ( data !== undefined ) {
  4601. return data;
  4602. }
  4603.  
  4604. // We tried really hard, but the data doesn't exist.
  4605. return;
  4606. }
  4607.  
  4608. // Set the data...
  4609. this.each( function() {
  4610.  
  4611. // We always store the camelCased key
  4612. dataUser.set( this, key, value );
  4613. } );
  4614. }, null, value, arguments.length > 1, null, true );
  4615. },
  4616.  
  4617. removeData: function( key ) {
  4618. return this.each( function() {
  4619. dataUser.remove( this, key );
  4620. } );
  4621. }
  4622. } );
  4623.  
  4624.  
  4625. jQuery.extend( {
  4626. queue: function( elem, type, data ) {
  4627. var queue;
  4628.  
  4629. if ( elem ) {
  4630. type = ( type || "fx" ) + "queue";
  4631. queue = dataPriv.get( elem, type );
  4632.  
  4633. // Speed up dequeue by getting out quickly if this is just a lookup
  4634. if ( data ) {
  4635. if ( !queue || Array.isArray( data ) ) {
  4636. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  4637. } else {
  4638. queue.push( data );
  4639. }
  4640. }
  4641. return queue || [];
  4642. }
  4643. },
  4644.  
  4645. dequeue: function( elem, type ) {
  4646. type = type || "fx";
  4647.  
  4648. var queue = jQuery.queue( elem, type ),
  4649. startLength = queue.length,
  4650. fn = queue.shift(),
  4651. hooks = jQuery._queueHooks( elem, type ),
  4652. next = function() {
  4653. jQuery.dequeue( elem, type );
  4654. };
  4655.  
  4656. // If the fx queue is dequeued, always remove the progress sentinel
  4657. if ( fn === "inprogress" ) {
  4658. fn = queue.shift();
  4659. startLength--;
  4660. }
  4661.  
  4662. if ( fn ) {
  4663.  
  4664. // Add a progress sentinel to prevent the fx queue from being
  4665. // automatically dequeued
  4666. if ( type === "fx" ) {
  4667. queue.unshift( "inprogress" );
  4668. }
  4669.  
  4670. // Clear up the last queue stop function
  4671. delete hooks.stop;
  4672. fn.call( elem, next, hooks );
  4673. }
  4674.  
  4675. if ( !startLength && hooks ) {
  4676. hooks.empty.fire();
  4677. }
  4678. },
  4679.  
  4680. // Not public - generate a queueHooks object, or return the current one
  4681. _queueHooks: function( elem, type ) {
  4682. var key = type + "queueHooks";
  4683. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  4684. empty: jQuery.Callbacks( "once memory" ).add( function() {
  4685. dataPriv.remove( elem, [ type + "queue", key ] );
  4686. } )
  4687. } );
  4688. }
  4689. } );
  4690.  
  4691. jQuery.fn.extend( {
  4692. queue: function( type, data ) {
  4693. var setter = 2;
  4694.  
  4695. if ( typeof type !== "string" ) {
  4696. data = type;
  4697. type = "fx";
  4698. setter--;
  4699. }
  4700.  
  4701. if ( arguments.length < setter ) {
  4702. return jQuery.queue( this[ 0 ], type );
  4703. }
  4704.  
  4705. return data === undefined ?
  4706. this :
  4707. this.each( function() {
  4708. var queue = jQuery.queue( this, type, data );
  4709.  
  4710. // Ensure a hooks for this queue
  4711. jQuery._queueHooks( this, type );
  4712.  
  4713. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  4714. jQuery.dequeue( this, type );
  4715. }
  4716. } );
  4717. },
  4718. dequeue: function( type ) {
  4719. return this.each( function() {
  4720. jQuery.dequeue( this, type );
  4721. } );
  4722. },
  4723. clearQueue: function( type ) {
  4724. return this.queue( type || "fx", [] );
  4725. },
  4726.  
  4727. // Get a promise resolved when queues of a certain type
  4728. // are emptied (fx is the type by default)
  4729. promise: function( type, obj ) {
  4730. var tmp,
  4731. count = 1,
  4732. defer = jQuery.Deferred(),
  4733. elements = this,
  4734. i = this.length,
  4735. resolve = function() {
  4736. if ( !( --count ) ) {
  4737. defer.resolveWith( elements, [ elements ] );
  4738. }
  4739. };
  4740.  
  4741. if ( typeof type !== "string" ) {
  4742. obj = type;
  4743. type = undefined;
  4744. }
  4745. type = type || "fx";
  4746.  
  4747. while ( i-- ) {
  4748. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  4749. if ( tmp && tmp.empty ) {
  4750. count++;
  4751. tmp.empty.add( resolve );
  4752. }
  4753. }
  4754. resolve();
  4755. return defer.promise( obj );
  4756. }
  4757. } );
  4758. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  4759.  
  4760. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  4761.  
  4762.  
  4763. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  4764.  
  4765. var documentElement = document.documentElement;
  4766.  
  4767.  
  4768.  
  4769. var isAttached = function( elem ) {
  4770. return jQuery.contains( elem.ownerDocument, elem );
  4771. },
  4772. composed = { composed: true };
  4773.  
  4774. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  4775. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  4776. // Support: iOS 10.0-10.2 only
  4777. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  4778. // leading to errors. We need to check for `getRootNode`.
  4779. if ( documentElement.getRootNode ) {
  4780. isAttached = function( elem ) {
  4781. return jQuery.contains( elem.ownerDocument, elem ) ||
  4782. elem.getRootNode( composed ) === elem.ownerDocument;
  4783. };
  4784. }
  4785. var isHiddenWithinTree = function( elem, el ) {
  4786.  
  4787. // isHiddenWithinTree might be called from jQuery#filter function;
  4788. // in that case, element will be second argument
  4789. elem = el || elem;
  4790.  
  4791. // Inline style trumps all
  4792. return elem.style.display === "none" ||
  4793. elem.style.display === "" &&
  4794.  
  4795. // Otherwise, check computed style
  4796. // Support: Firefox <=43 - 45
  4797. // Disconnected elements can have computed display: none, so first confirm that elem is
  4798. // in the document.
  4799. isAttached( elem ) &&
  4800.  
  4801. jQuery.css( elem, "display" ) === "none";
  4802. };
  4803.  
  4804.  
  4805.  
  4806. function adjustCSS( elem, prop, valueParts, tween ) {
  4807. var adjusted, scale,
  4808. maxIterations = 20,
  4809. currentValue = tween ?
  4810. function() {
  4811. return tween.cur();
  4812. } :
  4813. function() {
  4814. return jQuery.css( elem, prop, "" );
  4815. },
  4816. initial = currentValue(),
  4817. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  4818.  
  4819. // Starting value computation is required for potential unit mismatches
  4820. initialInUnit = elem.nodeType &&
  4821. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  4822. rcssNum.exec( jQuery.css( elem, prop ) );
  4823.  
  4824. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  4825.  
  4826. // Support: Firefox <=54
  4827. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  4828. initial = initial / 2;
  4829.  
  4830. // Trust units reported by jQuery.css
  4831. unit = unit || initialInUnit[ 3 ];
  4832.  
  4833. // Iteratively approximate from a nonzero starting point
  4834. initialInUnit = +initial || 1;
  4835.  
  4836. while ( maxIterations-- ) {
  4837.  
  4838. // Evaluate and update our best guess (doubling guesses that zero out).
  4839. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  4840. jQuery.style( elem, prop, initialInUnit + unit );
  4841. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  4842. maxIterations = 0;
  4843. }
  4844. initialInUnit = initialInUnit / scale;
  4845.  
  4846. }
  4847.  
  4848. initialInUnit = initialInUnit * 2;
  4849. jQuery.style( elem, prop, initialInUnit + unit );
  4850.  
  4851. // Make sure we update the tween properties later on
  4852. valueParts = valueParts || [];
  4853. }
  4854.  
  4855. if ( valueParts ) {
  4856. initialInUnit = +initialInUnit || +initial || 0;
  4857.  
  4858. // Apply relative offset (+=/-=) if specified
  4859. adjusted = valueParts[ 1 ] ?
  4860. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  4861. +valueParts[ 2 ];
  4862. if ( tween ) {
  4863. tween.unit = unit;
  4864. tween.start = initialInUnit;
  4865. tween.end = adjusted;
  4866. }
  4867. }
  4868. return adjusted;
  4869. }
  4870.  
  4871.  
  4872. var defaultDisplayMap = {};
  4873.  
  4874. function getDefaultDisplay( elem ) {
  4875. var temp,
  4876. doc = elem.ownerDocument,
  4877. nodeName = elem.nodeName,
  4878. display = defaultDisplayMap[ nodeName ];
  4879.  
  4880. if ( display ) {
  4881. return display;
  4882. }
  4883.  
  4884. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  4885. display = jQuery.css( temp, "display" );
  4886.  
  4887. temp.parentNode.removeChild( temp );
  4888.  
  4889. if ( display === "none" ) {
  4890. display = "block";
  4891. }
  4892. defaultDisplayMap[ nodeName ] = display;
  4893.  
  4894. return display;
  4895. }
  4896.  
  4897. function showHide( elements, show ) {
  4898. var display, elem,
  4899. values = [],
  4900. index = 0,
  4901. length = elements.length;
  4902.  
  4903. // Determine new display value for elements that need to change
  4904. for ( ; index < length; index++ ) {
  4905. elem = elements[ index ];
  4906. if ( !elem.style ) {
  4907. continue;
  4908. }
  4909.  
  4910. display = elem.style.display;
  4911. if ( show ) {
  4912.  
  4913. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  4914. // check is required in this first loop unless we have a nonempty display value (either
  4915. // inline or about-to-be-restored)
  4916. if ( display === "none" ) {
  4917. values[ index ] = dataPriv.get( elem, "display" ) || null;
  4918. if ( !values[ index ] ) {
  4919. elem.style.display = "";
  4920. }
  4921. }
  4922. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  4923. values[ index ] = getDefaultDisplay( elem );
  4924. }
  4925. } else {
  4926. if ( display !== "none" ) {
  4927. values[ index ] = "none";
  4928.  
  4929. // Remember what we're overwriting
  4930. dataPriv.set( elem, "display", display );
  4931. }
  4932. }
  4933. }
  4934.  
  4935. // Set the display of the elements in a second loop to avoid constant reflow
  4936. for ( index = 0; index < length; index++ ) {
  4937. if ( values[ index ] != null ) {
  4938. elements[ index ].style.display = values[ index ];
  4939. }
  4940. }
  4941.  
  4942. return elements;
  4943. }
  4944.  
  4945. jQuery.fn.extend( {
  4946. show: function() {
  4947. return showHide( this, true );
  4948. },
  4949. hide: function() {
  4950. return showHide( this );
  4951. },
  4952. toggle: function( state ) {
  4953. if ( typeof state === "boolean" ) {
  4954. return state ? this.show() : this.hide();
  4955. }
  4956.  
  4957. return this.each( function() {
  4958. if ( isHiddenWithinTree( this ) ) {
  4959. jQuery( this ).show();
  4960. } else {
  4961. jQuery( this ).hide();
  4962. }
  4963. } );
  4964. }
  4965. } );
  4966. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  4967.  
  4968. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  4969.  
  4970. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  4971.  
  4972.  
  4973.  
  4974. ( function() {
  4975. var fragment = document.createDocumentFragment(),
  4976. div = fragment.appendChild( document.createElement( "div" ) ),
  4977. input = document.createElement( "input" );
  4978.  
  4979. // Support: Android 4.0 - 4.3 only
  4980. // Check state lost if the name is set (trac-11217)
  4981. // Support: Windows Web Apps (WWA)
  4982. // `name` and `type` must use .setAttribute for WWA (trac-14901)
  4983. input.setAttribute( "type", "radio" );
  4984. input.setAttribute( "checked", "checked" );
  4985. input.setAttribute( "name", "t" );
  4986.  
  4987. div.appendChild( input );
  4988.  
  4989. // Support: Android <=4.1 only
  4990. // Older WebKit doesn't clone checked state correctly in fragments
  4991. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4992.  
  4993. // Support: IE <=11 only
  4994. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4995. div.innerHTML = "<textarea>x</textarea>";
  4996. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4997.  
  4998. // Support: IE <=9 only
  4999. // IE <=9 replaces <option> tags with their contents when inserted outside of
  5000. // the select element.
  5001. div.innerHTML = "<option></option>";
  5002. support.option = !!div.lastChild;
  5003. } )();
  5004.  
  5005.  
  5006. // We have to close these tags to support XHTML (trac-13200)
  5007. var wrapMap = {
  5008.  
  5009. // XHTML parsers do not magically insert elements in the
  5010. // same way that tag soup parsers do. So we cannot shorten
  5011. // this by omitting <tbody> or other required elements.
  5012. thead: [ 1, "<table>", "</table>" ],
  5013. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  5014. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  5015. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  5016.  
  5017. _default: [ 0, "", "" ]
  5018. };
  5019.  
  5020. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  5021. wrapMap.th = wrapMap.td;
  5022.  
  5023. // Support: IE <=9 only
  5024. if ( !support.option ) {
  5025. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  5026. }
  5027.  
  5028.  
  5029. function getAll( context, tag ) {
  5030.  
  5031. // Support: IE <=9 - 11 only
  5032. // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
  5033. var ret;
  5034.  
  5035. if ( typeof context.getElementsByTagName !== "undefined" ) {
  5036. ret = context.getElementsByTagName( tag || "*" );
  5037.  
  5038. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  5039. ret = context.querySelectorAll( tag || "*" );
  5040.  
  5041. } else {
  5042. ret = [];
  5043. }
  5044.  
  5045. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  5046. return jQuery.merge( [ context ], ret );
  5047. }
  5048.  
  5049. return ret;
  5050. }
  5051.  
  5052.  
  5053. // Mark scripts as having already been evaluated
  5054. function setGlobalEval( elems, refElements ) {
  5055. var i = 0,
  5056. l = elems.length;
  5057.  
  5058. for ( ; i < l; i++ ) {
  5059. dataPriv.set(
  5060. elems[ i ],
  5061. "globalEval",
  5062. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  5063. );
  5064. }
  5065. }
  5066.  
  5067.  
  5068. var rhtml = /<|&#?\w+;/;
  5069.  
  5070. function buildFragment( elems, context, scripts, selection, ignored ) {
  5071. var elem, tmp, tag, wrap, attached, j,
  5072. fragment = context.createDocumentFragment(),
  5073. nodes = [],
  5074. i = 0,
  5075. l = elems.length;
  5076.  
  5077. for ( ; i < l; i++ ) {
  5078. elem = elems[ i ];
  5079.  
  5080. if ( elem || elem === 0 ) {
  5081.  
  5082. // Add nodes directly
  5083. if ( toType( elem ) === "object" ) {
  5084.  
  5085. // Support: Android <=4.0 only, PhantomJS 1 only
  5086. // push.apply(_, arraylike) throws on ancient WebKit
  5087. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  5088.  
  5089. // Convert non-html into a text node
  5090. } else if ( !rhtml.test( elem ) ) {
  5091. nodes.push( context.createTextNode( elem ) );
  5092.  
  5093. // Convert html into DOM nodes
  5094. } else {
  5095. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  5096.  
  5097. // Deserialize a standard representation
  5098. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  5099. wrap = wrapMap[ tag ] || wrapMap._default;
  5100. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  5101.  
  5102. // Descend through wrappers to the right content
  5103. j = wrap[ 0 ];
  5104. while ( j-- ) {
  5105. tmp = tmp.lastChild;
  5106. }
  5107.  
  5108. // Support: Android <=4.0 only, PhantomJS 1 only
  5109. // push.apply(_, arraylike) throws on ancient WebKit
  5110. jQuery.merge( nodes, tmp.childNodes );
  5111.  
  5112. // Remember the top-level container
  5113. tmp = fragment.firstChild;
  5114.  
  5115. // Ensure the created nodes are orphaned (trac-12392)
  5116. tmp.textContent = "";
  5117. }
  5118. }
  5119. }
  5120.  
  5121. // Remove wrapper from fragment
  5122. fragment.textContent = "";
  5123.  
  5124. i = 0;
  5125. while ( ( elem = nodes[ i++ ] ) ) {
  5126.  
  5127. // Skip elements already in the context collection (trac-4087)
  5128. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  5129. if ( ignored ) {
  5130. ignored.push( elem );
  5131. }
  5132. continue;
  5133. }
  5134.  
  5135. attached = isAttached( elem );
  5136.  
  5137. // Append to fragment
  5138. tmp = getAll( fragment.appendChild( elem ), "script" );
  5139.  
  5140. // Preserve script evaluation history
  5141. if ( attached ) {
  5142. setGlobalEval( tmp );
  5143. }
  5144.  
  5145. // Capture executables
  5146. if ( scripts ) {
  5147. j = 0;
  5148. while ( ( elem = tmp[ j++ ] ) ) {
  5149. if ( rscriptType.test( elem.type || "" ) ) {
  5150. scripts.push( elem );
  5151. }
  5152. }
  5153. }
  5154. }
  5155.  
  5156. return fragment;
  5157. }
  5158.  
  5159.  
  5160. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  5161.  
  5162. function returnTrue() {
  5163. return true;
  5164. }
  5165.  
  5166. function returnFalse() {
  5167. return false;
  5168. }
  5169.  
  5170. // Support: IE <=9 - 11+
  5171. // focus() and blur() are asynchronous, except when they are no-op.
  5172. // So expect focus to be synchronous when the element is already active,
  5173. // and blur to be synchronous when the element is not already active.
  5174. // (focus and blur are always synchronous in other supported browsers,
  5175. // this just defines when we can count on it).
  5176. function expectSync( elem, type ) {
  5177. return ( elem === safeActiveElement() ) === ( type === "focus" );
  5178. }
  5179.  
  5180. // Support: IE <=9 only
  5181. // Accessing document.activeElement can throw unexpectedly
  5182. // https://bugs.jquery.com/ticket/13393
  5183. function safeActiveElement() {
  5184. try {
  5185. return document.activeElement;
  5186. } catch ( err ) { }
  5187. }
  5188.  
  5189. function on( elem, types, selector, data, fn, one ) {
  5190. var origFn, type;
  5191.  
  5192. // Types can be a map of types/handlers
  5193. if ( typeof types === "object" ) {
  5194.  
  5195. // ( types-Object, selector, data )
  5196. if ( typeof selector !== "string" ) {
  5197.  
  5198. // ( types-Object, data )
  5199. data = data || selector;
  5200. selector = undefined;
  5201. }
  5202. for ( type in types ) {
  5203. on( elem, type, selector, data, types[ type ], one );
  5204. }
  5205. return elem;
  5206. }
  5207.  
  5208. if ( data == null && fn == null ) {
  5209.  
  5210. // ( types, fn )
  5211. fn = selector;
  5212. data = selector = undefined;
  5213. } else if ( fn == null ) {
  5214. if ( typeof selector === "string" ) {
  5215.  
  5216. // ( types, selector, fn )
  5217. fn = data;
  5218. data = undefined;
  5219. } else {
  5220.  
  5221. // ( types, data, fn )
  5222. fn = data;
  5223. data = selector;
  5224. selector = undefined;
  5225. }
  5226. }
  5227. if ( fn === false ) {
  5228. fn = returnFalse;
  5229. } else if ( !fn ) {
  5230. return elem;
  5231. }
  5232.  
  5233. if ( one === 1 ) {
  5234. origFn = fn;
  5235. fn = function( event ) {
  5236.  
  5237. // Can use an empty set, since event contains the info
  5238. jQuery().off( event );
  5239. return origFn.apply( this, arguments );
  5240. };
  5241.  
  5242. // Use same guid so caller can remove using origFn
  5243. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  5244. }
  5245. return elem.each( function() {
  5246. jQuery.event.add( this, types, fn, data, selector );
  5247. } );
  5248. }
  5249.  
  5250. /*
  5251. * Helper functions for managing events -- not part of the public interface.
  5252. * Props to Dean Edwards' addEvent library for many of the ideas.
  5253. */
  5254. jQuery.event = {
  5255.  
  5256. global: {},
  5257.  
  5258. add: function( elem, types, handler, data, selector ) {
  5259.  
  5260. var handleObjIn, eventHandle, tmp,
  5261. events, t, handleObj,
  5262. special, handlers, type, namespaces, origType,
  5263. elemData = dataPriv.get( elem );
  5264.  
  5265. // Only attach events to objects that accept data
  5266. if ( !acceptData( elem ) ) {
  5267. return;
  5268. }
  5269.  
  5270. // Caller can pass in an object of custom data in lieu of the handler
  5271. if ( handler.handler ) {
  5272. handleObjIn = handler;
  5273. handler = handleObjIn.handler;
  5274. selector = handleObjIn.selector;
  5275. }
  5276.  
  5277. // Ensure that invalid selectors throw exceptions at attach time
  5278. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  5279. if ( selector ) {
  5280. jQuery.find.matchesSelector( documentElement, selector );
  5281. }
  5282.  
  5283. // Make sure that the handler has a unique ID, used to find/remove it later
  5284. if ( !handler.guid ) {
  5285. handler.guid = jQuery.guid++;
  5286. }
  5287.  
  5288. // Init the element's event structure and main handler, if this is the first
  5289. if ( !( events = elemData.events ) ) {
  5290. events = elemData.events = Object.create( null );
  5291. }
  5292. if ( !( eventHandle = elemData.handle ) ) {
  5293. eventHandle = elemData.handle = function( e ) {
  5294.  
  5295. // Discard the second event of a jQuery.event.trigger() and
  5296. // when an event is called after a page has unloaded
  5297. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  5298. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  5299. };
  5300. }
  5301.  
  5302. // Handle multiple events separated by a space
  5303. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  5304. t = types.length;
  5305. while ( t-- ) {
  5306. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5307. type = origType = tmp[ 1 ];
  5308. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5309.  
  5310. // There *must* be a type, no attaching namespace-only handlers
  5311. if ( !type ) {
  5312. continue;
  5313. }
  5314.  
  5315. // If event changes its type, use the special event handlers for the changed type
  5316. special = jQuery.event.special[ type ] || {};
  5317.  
  5318. // If selector defined, determine special event api type, otherwise given type
  5319. type = ( selector ? special.delegateType : special.bindType ) || type;
  5320.  
  5321. // Update special based on newly reset type
  5322. special = jQuery.event.special[ type ] || {};
  5323.  
  5324. // handleObj is passed to all event handlers
  5325. handleObj = jQuery.extend( {
  5326. type: type,
  5327. origType: origType,
  5328. data: data,
  5329. handler: handler,
  5330. guid: handler.guid,
  5331. selector: selector,
  5332. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  5333. namespace: namespaces.join( "." )
  5334. }, handleObjIn );
  5335.  
  5336. // Init the event handler queue if we're the first
  5337. if ( !( handlers = events[ type ] ) ) {
  5338. handlers = events[ type ] = [];
  5339. handlers.delegateCount = 0;
  5340.  
  5341. // Only use addEventListener if the special events handler returns false
  5342. if ( !special.setup ||
  5343. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  5344.  
  5345. if ( elem.addEventListener ) {
  5346. elem.addEventListener( type, eventHandle );
  5347. }
  5348. }
  5349. }
  5350.  
  5351. if ( special.add ) {
  5352. special.add.call( elem, handleObj );
  5353.  
  5354. if ( !handleObj.handler.guid ) {
  5355. handleObj.handler.guid = handler.guid;
  5356. }
  5357. }
  5358.  
  5359. // Add to the element's handler list, delegates in front
  5360. if ( selector ) {
  5361. handlers.splice( handlers.delegateCount++, 0, handleObj );
  5362. } else {
  5363. handlers.push( handleObj );
  5364. }
  5365.  
  5366. // Keep track of which events have ever been used, for event optimization
  5367. jQuery.event.global[ type ] = true;
  5368. }
  5369.  
  5370. },
  5371.  
  5372. // Detach an event or set of events from an element
  5373. remove: function( elem, types, handler, selector, mappedTypes ) {
  5374.  
  5375. var j, origCount, tmp,
  5376. events, t, handleObj,
  5377. special, handlers, type, namespaces, origType,
  5378. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  5379.  
  5380. if ( !elemData || !( events = elemData.events ) ) {
  5381. return;
  5382. }
  5383.  
  5384. // Once for each type.namespace in types; type may be omitted
  5385. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  5386. t = types.length;
  5387. while ( t-- ) {
  5388. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5389. type = origType = tmp[ 1 ];
  5390. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5391.  
  5392. // Unbind all events (on this namespace, if provided) for the element
  5393. if ( !type ) {
  5394. for ( type in events ) {
  5395. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  5396. }
  5397. continue;
  5398. }
  5399.  
  5400. special = jQuery.event.special[ type ] || {};
  5401. type = ( selector ? special.delegateType : special.bindType ) || type;
  5402. handlers = events[ type ] || [];
  5403. tmp = tmp[ 2 ] &&
  5404. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  5405.  
  5406. // Remove matching events
  5407. origCount = j = handlers.length;
  5408. while ( j-- ) {
  5409. handleObj = handlers[ j ];
  5410.  
  5411. if ( ( mappedTypes || origType === handleObj.origType ) &&
  5412. ( !handler || handler.guid === handleObj.guid ) &&
  5413. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  5414. ( !selector || selector === handleObj.selector ||
  5415. selector === "**" && handleObj.selector ) ) {
  5416. handlers.splice( j, 1 );
  5417.  
  5418. if ( handleObj.selector ) {
  5419. handlers.delegateCount--;
  5420. }
  5421. if ( special.remove ) {
  5422. special.remove.call( elem, handleObj );
  5423. }
  5424. }
  5425. }
  5426.  
  5427. // Remove generic event handler if we removed something and no more handlers exist
  5428. // (avoids potential for endless recursion during removal of special event handlers)
  5429. if ( origCount && !handlers.length ) {
  5430. if ( !special.teardown ||
  5431. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  5432.  
  5433. jQuery.removeEvent( elem, type, elemData.handle );
  5434. }
  5435.  
  5436. delete events[ type ];
  5437. }
  5438. }
  5439.  
  5440. // Remove data and the expando if it's no longer used
  5441. if ( jQuery.isEmptyObject( events ) ) {
  5442. dataPriv.remove( elem, "handle events" );
  5443. }
  5444. },
  5445.  
  5446. dispatch: function( nativeEvent ) {
  5447.  
  5448. var i, j, ret, matched, handleObj, handlerQueue,
  5449. args = new Array( arguments.length ),
  5450.  
  5451. // Make a writable jQuery.Event from the native event object
  5452. event = jQuery.event.fix( nativeEvent ),
  5453.  
  5454. handlers = (
  5455. dataPriv.get( this, "events" ) || Object.create( null )
  5456. )[ event.type ] || [],
  5457. special = jQuery.event.special[ event.type ] || {};
  5458.  
  5459. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  5460. args[ 0 ] = event;
  5461.  
  5462. for ( i = 1; i < arguments.length; i++ ) {
  5463. args[ i ] = arguments[ i ];
  5464. }
  5465.  
  5466. event.delegateTarget = this;
  5467.  
  5468. // Call the preDispatch hook for the mapped type, and let it bail if desired
  5469. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  5470. return;
  5471. }
  5472.  
  5473. // Determine handlers
  5474. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  5475.  
  5476. // Run delegates first; they may want to stop propagation beneath us
  5477. i = 0;
  5478. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  5479. event.currentTarget = matched.elem;
  5480.  
  5481. j = 0;
  5482. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  5483. !event.isImmediatePropagationStopped() ) {
  5484.  
  5485. // If the event is namespaced, then each handler is only invoked if it is
  5486. // specially universal or its namespaces are a superset of the event's.
  5487. if ( !event.rnamespace || handleObj.namespace === false ||
  5488. event.rnamespace.test( handleObj.namespace ) ) {
  5489.  
  5490. event.handleObj = handleObj;
  5491. event.data = handleObj.data;
  5492.  
  5493. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  5494. handleObj.handler ).apply( matched.elem, args );
  5495.  
  5496. if ( ret !== undefined ) {
  5497. if ( ( event.result = ret ) === false ) {
  5498. event.preventDefault();
  5499. event.stopPropagation();
  5500. }
  5501. }
  5502. }
  5503. }
  5504. }
  5505.  
  5506. // Call the postDispatch hook for the mapped type
  5507. if ( special.postDispatch ) {
  5508. special.postDispatch.call( this, event );
  5509. }
  5510.  
  5511. return event.result;
  5512. },
  5513.  
  5514. handlers: function( event, handlers ) {
  5515. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  5516. handlerQueue = [],
  5517. delegateCount = handlers.delegateCount,
  5518. cur = event.target;
  5519.  
  5520. // Find delegate handlers
  5521. if ( delegateCount &&
  5522.  
  5523. // Support: IE <=9
  5524. // Black-hole SVG <use> instance trees (trac-13180)
  5525. cur.nodeType &&
  5526.  
  5527. // Support: Firefox <=42
  5528. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  5529. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  5530. // Support: IE 11 only
  5531. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  5532. !( event.type === "click" && event.button >= 1 ) ) {
  5533.  
  5534. for ( ; cur !== this; cur = cur.parentNode || this ) {
  5535.  
  5536. // Don't check non-elements (trac-13208)
  5537. // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
  5538. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  5539. matchedHandlers = [];
  5540. matchedSelectors = {};
  5541. for ( i = 0; i < delegateCount; i++ ) {
  5542. handleObj = handlers[ i ];
  5543.  
  5544. // Don't conflict with Object.prototype properties (trac-13203)
  5545. sel = handleObj.selector + " ";
  5546.  
  5547. if ( matchedSelectors[ sel ] === undefined ) {
  5548. matchedSelectors[ sel ] = handleObj.needsContext ?
  5549. jQuery( sel, this ).index( cur ) > -1 :
  5550. jQuery.find( sel, this, null, [ cur ] ).length;
  5551. }
  5552. if ( matchedSelectors[ sel ] ) {
  5553. matchedHandlers.push( handleObj );
  5554. }
  5555. }
  5556. if ( matchedHandlers.length ) {
  5557. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  5558. }
  5559. }
  5560. }
  5561. }
  5562.  
  5563. // Add the remaining (directly-bound) handlers
  5564. cur = this;
  5565. if ( delegateCount < handlers.length ) {
  5566. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  5567. }
  5568.  
  5569. return handlerQueue;
  5570. },
  5571.  
  5572. addProp: function( name, hook ) {
  5573. Object.defineProperty( jQuery.Event.prototype, name, {
  5574. enumerable: true,
  5575. configurable: true,
  5576.  
  5577. get: isFunction( hook ) ?
  5578. function() {
  5579. if ( this.originalEvent ) {
  5580. return hook( this.originalEvent );
  5581. }
  5582. } :
  5583. function() {
  5584. if ( this.originalEvent ) {
  5585. return this.originalEvent[ name ];
  5586. }
  5587. },
  5588.  
  5589. set: function( value ) {
  5590. Object.defineProperty( this, name, {
  5591. enumerable: true,
  5592. configurable: true,
  5593. writable: true,
  5594. value: value
  5595. } );
  5596. }
  5597. } );
  5598. },
  5599.  
  5600. fix: function( originalEvent ) {
  5601. return originalEvent[ jQuery.expando ] ?
  5602. originalEvent :
  5603. new jQuery.Event( originalEvent );
  5604. },
  5605.  
  5606. special: {
  5607. load: {
  5608.  
  5609. // Prevent triggered image.load events from bubbling to window.load
  5610. noBubble: true
  5611. },
  5612. click: {
  5613.  
  5614. // Utilize native event to ensure correct state for checkable inputs
  5615. setup: function( data ) {
  5616.  
  5617. // For mutual compressibility with _default, replace `this` access with a local var.
  5618. // `|| data` is dead code meant only to preserve the variable through minification.
  5619. var el = this || data;
  5620.  
  5621. // Claim the first handler
  5622. if ( rcheckableType.test( el.type ) &&
  5623. el.click && nodeName( el, "input" ) ) {
  5624.  
  5625. // dataPriv.set( el, "click", ... )
  5626. leverageNative( el, "click", returnTrue );
  5627. }
  5628.  
  5629. // Return false to allow normal processing in the caller
  5630. return false;
  5631. },
  5632. trigger: function( data ) {
  5633.  
  5634. // For mutual compressibility with _default, replace `this` access with a local var.
  5635. // `|| data` is dead code meant only to preserve the variable through minification.
  5636. var el = this || data;
  5637.  
  5638. // Force setup before triggering a click
  5639. if ( rcheckableType.test( el.type ) &&
  5640. el.click && nodeName( el, "input" ) ) {
  5641.  
  5642. leverageNative( el, "click" );
  5643. }
  5644.  
  5645. // Return non-false to allow normal event-path propagation
  5646. return true;
  5647. },
  5648.  
  5649. // For cross-browser consistency, suppress native .click() on links
  5650. // Also prevent it if we're currently inside a leveraged native-event stack
  5651. _default: function( event ) {
  5652. var target = event.target;
  5653. return rcheckableType.test( target.type ) &&
  5654. target.click && nodeName( target, "input" ) &&
  5655. dataPriv.get( target, "click" ) ||
  5656. nodeName( target, "a" );
  5657. }
  5658. },
  5659.  
  5660. beforeunload: {
  5661. postDispatch: function( event ) {
  5662.  
  5663. // Support: Firefox 20+
  5664. // Firefox doesn't alert if the returnValue field is not set.
  5665. if ( event.result !== undefined && event.originalEvent ) {
  5666. event.originalEvent.returnValue = event.result;
  5667. }
  5668. }
  5669. }
  5670. }
  5671. };
  5672.  
  5673. // Ensure the presence of an event listener that handles manually-triggered
  5674. // synthetic events by interrupting progress until reinvoked in response to
  5675. // *native* events that it fires directly, ensuring that state changes have
  5676. // already occurred before other listeners are invoked.
  5677. function leverageNative( el, type, expectSync ) {
  5678.  
  5679. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  5680. if ( !expectSync ) {
  5681. if ( dataPriv.get( el, type ) === undefined ) {
  5682. jQuery.event.add( el, type, returnTrue );
  5683. }
  5684. return;
  5685. }
  5686.  
  5687. // Register the controller as a special universal handler for all event namespaces
  5688. dataPriv.set( el, type, false );
  5689. jQuery.event.add( el, type, {
  5690. namespace: false,
  5691. handler: function( event ) {
  5692. var notAsync, result,
  5693. saved = dataPriv.get( this, type );
  5694.  
  5695. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  5696.  
  5697. // Interrupt processing of the outer synthetic .trigger()ed event
  5698. // Saved data should be false in such cases, but might be a leftover capture object
  5699. // from an async native handler (gh-4350)
  5700. if ( !saved.length ) {
  5701.  
  5702. // Store arguments for use when handling the inner native event
  5703. // There will always be at least one argument (an event object), so this array
  5704. // will not be confused with a leftover capture object.
  5705. saved = slice.call( arguments );
  5706. dataPriv.set( this, type, saved );
  5707.  
  5708. // Trigger the native event and capture its result
  5709. // Support: IE <=9 - 11+
  5710. // focus() and blur() are asynchronous
  5711. notAsync = expectSync( this, type );
  5712. this[ type ]();
  5713. result = dataPriv.get( this, type );
  5714. if ( saved !== result || notAsync ) {
  5715. dataPriv.set( this, type, false );
  5716. } else {
  5717. result = {};
  5718. }
  5719. if ( saved !== result ) {
  5720.  
  5721. // Cancel the outer synthetic event
  5722. event.stopImmediatePropagation();
  5723. event.preventDefault();
  5724.  
  5725. // Support: Chrome 86+
  5726. // In Chrome, if an element having a focusout handler is blurred by
  5727. // clicking outside of it, it invokes the handler synchronously. If
  5728. // that handler calls `.remove()` on the element, the data is cleared,
  5729. // leaving `result` undefined. We need to guard against this.
  5730. return result && result.value;
  5731. }
  5732.  
  5733. // If this is an inner synthetic event for an event with a bubbling surrogate
  5734. // (focus or blur), assume that the surrogate already propagated from triggering the
  5735. // native event and prevent that from happening again here.
  5736. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  5737. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  5738. // less bad than duplication.
  5739. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  5740. event.stopPropagation();
  5741. }
  5742.  
  5743. // If this is a native event triggered above, everything is now in order
  5744. // Fire an inner synthetic event with the original arguments
  5745. } else if ( saved.length ) {
  5746.  
  5747. // ...and capture the result
  5748. dataPriv.set( this, type, {
  5749. value: jQuery.event.trigger(
  5750.  
  5751. // Support: IE <=9 - 11+
  5752. // Extend with the prototype to reset the above stopImmediatePropagation()
  5753. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  5754. saved.slice( 1 ),
  5755. this
  5756. )
  5757. } );
  5758.  
  5759. // Abort handling of the native event
  5760. event.stopImmediatePropagation();
  5761. }
  5762. }
  5763. } );
  5764. }
  5765.  
  5766. jQuery.removeEvent = function( elem, type, handle ) {
  5767.  
  5768. // This "if" is needed for plain objects
  5769. if ( elem.removeEventListener ) {
  5770. elem.removeEventListener( type, handle );
  5771. }
  5772. };
  5773.  
  5774. jQuery.Event = function( src, props ) {
  5775.  
  5776. // Allow instantiation without the 'new' keyword
  5777. if ( !( this instanceof jQuery.Event ) ) {
  5778. return new jQuery.Event( src, props );
  5779. }
  5780.  
  5781. // Event object
  5782. if ( src && src.type ) {
  5783. this.originalEvent = src;
  5784. this.type = src.type;
  5785.  
  5786. // Events bubbling up the document may have been marked as prevented
  5787. // by a handler lower down the tree; reflect the correct value.
  5788. this.isDefaultPrevented = src.defaultPrevented ||
  5789. src.defaultPrevented === undefined &&
  5790.  
  5791. // Support: Android <=2.3 only
  5792. src.returnValue === false ?
  5793. returnTrue :
  5794. returnFalse;
  5795.  
  5796. // Create target properties
  5797. // Support: Safari <=6 - 7 only
  5798. // Target should not be a text node (trac-504, trac-13143)
  5799. this.target = ( src.target && src.target.nodeType === 3 ) ?
  5800. src.target.parentNode :
  5801. src.target;
  5802.  
  5803. this.currentTarget = src.currentTarget;
  5804. this.relatedTarget = src.relatedTarget;
  5805.  
  5806. // Event type
  5807. } else {
  5808. this.type = src;
  5809. }
  5810.  
  5811. // Put explicitly provided properties onto the event object
  5812. if ( props ) {
  5813. jQuery.extend( this, props );
  5814. }
  5815.  
  5816. // Create a timestamp if incoming event doesn't have one
  5817. this.timeStamp = src && src.timeStamp || Date.now();
  5818.  
  5819. // Mark it as fixed
  5820. this[ jQuery.expando ] = true;
  5821. };
  5822.  
  5823. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  5824. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  5825. jQuery.Event.prototype = {
  5826. constructor: jQuery.Event,
  5827. isDefaultPrevented: returnFalse,
  5828. isPropagationStopped: returnFalse,
  5829. isImmediatePropagationStopped: returnFalse,
  5830. isSimulated: false,
  5831.  
  5832. preventDefault: function() {
  5833. var e = this.originalEvent;
  5834.  
  5835. this.isDefaultPrevented = returnTrue;
  5836.  
  5837. if ( e && !this.isSimulated ) {
  5838. e.preventDefault();
  5839. }
  5840. },
  5841. stopPropagation: function() {
  5842. var e = this.originalEvent;
  5843.  
  5844. this.isPropagationStopped = returnTrue;
  5845.  
  5846. if ( e && !this.isSimulated ) {
  5847. e.stopPropagation();
  5848. }
  5849. },
  5850. stopImmediatePropagation: function() {
  5851. var e = this.originalEvent;
  5852.  
  5853. this.isImmediatePropagationStopped = returnTrue;
  5854.  
  5855. if ( e && !this.isSimulated ) {
  5856. e.stopImmediatePropagation();
  5857. }
  5858.  
  5859. this.stopPropagation();
  5860. }
  5861. };
  5862.  
  5863. // Includes all common event props including KeyEvent and MouseEvent specific props
  5864. jQuery.each( {
  5865. altKey: true,
  5866. bubbles: true,
  5867. cancelable: true,
  5868. changedTouches: true,
  5869. ctrlKey: true,
  5870. detail: true,
  5871. eventPhase: true,
  5872. metaKey: true,
  5873. pageX: true,
  5874. pageY: true,
  5875. shiftKey: true,
  5876. view: true,
  5877. "char": true,
  5878. code: true,
  5879. charCode: true,
  5880. key: true,
  5881. keyCode: true,
  5882. button: true,
  5883. buttons: true,
  5884. clientX: true,
  5885. clientY: true,
  5886. offsetX: true,
  5887. offsetY: true,
  5888. pointerId: true,
  5889. pointerType: true,
  5890. screenX: true,
  5891. screenY: true,
  5892. targetTouches: true,
  5893. toElement: true,
  5894. touches: true,
  5895. which: true
  5896. }, jQuery.event.addProp );
  5897.  
  5898. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  5899. jQuery.event.special[ type ] = {
  5900.  
  5901. // Utilize native event if possible so blur/focus sequence is correct
  5902. setup: function() {
  5903.  
  5904. // Claim the first handler
  5905. // dataPriv.set( this, "focus", ... )
  5906. // dataPriv.set( this, "blur", ... )
  5907. leverageNative( this, type, expectSync );
  5908.  
  5909. // Return false to allow normal processing in the caller
  5910. return false;
  5911. },
  5912. trigger: function() {
  5913.  
  5914. // Force setup before trigger
  5915. leverageNative( this, type );
  5916.  
  5917. // Return non-false to allow normal event-path propagation
  5918. return true;
  5919. },
  5920.  
  5921. // Suppress native focus or blur if we're currently inside
  5922. // a leveraged native-event stack
  5923. _default: function( event ) {
  5924. return dataPriv.get( event.target, type );
  5925. },
  5926.  
  5927. delegateType: delegateType
  5928. };
  5929. } );
  5930.  
  5931. // Create mouseenter/leave events using mouseover/out and event-time checks
  5932. // so that event delegation works in jQuery.
  5933. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  5934. //
  5935. // Support: Safari 7 only
  5936. // Safari sends mouseenter too often; see:
  5937. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  5938. // for the description of the bug (it existed in older Chrome versions as well).
  5939. jQuery.each( {
  5940. mouseenter: "mouseover",
  5941. mouseleave: "mouseout",
  5942. pointerenter: "pointerover",
  5943. pointerleave: "pointerout"
  5944. }, function( orig, fix ) {
  5945. jQuery.event.special[ orig ] = {
  5946. delegateType: fix,
  5947. bindType: fix,
  5948.  
  5949. handle: function( event ) {
  5950. var ret,
  5951. target = this,
  5952. related = event.relatedTarget,
  5953. handleObj = event.handleObj;
  5954.  
  5955. // For mouseenter/leave call the handler if related is outside the target.
  5956. // NB: No relatedTarget if the mouse left/entered the browser window
  5957. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  5958. event.type = handleObj.origType;
  5959. ret = handleObj.handler.apply( this, arguments );
  5960. event.type = fix;
  5961. }
  5962. return ret;
  5963. }
  5964. };
  5965. } );
  5966.  
  5967. jQuery.fn.extend( {
  5968.  
  5969. on: function( types, selector, data, fn ) {
  5970. return on( this, types, selector, data, fn );
  5971. },
  5972. one: function( types, selector, data, fn ) {
  5973. return on( this, types, selector, data, fn, 1 );
  5974. },
  5975. off: function( types, selector, fn ) {
  5976. var handleObj, type;
  5977. if ( types && types.preventDefault && types.handleObj ) {
  5978.  
  5979. // ( event ) dispatched jQuery.Event
  5980. handleObj = types.handleObj;
  5981. jQuery( types.delegateTarget ).off(
  5982. handleObj.namespace ?
  5983. handleObj.origType + "." + handleObj.namespace :
  5984. handleObj.origType,
  5985. handleObj.selector,
  5986. handleObj.handler
  5987. );
  5988. return this;
  5989. }
  5990. if ( typeof types === "object" ) {
  5991.  
  5992. // ( types-object [, selector] )
  5993. for ( type in types ) {
  5994. this.off( type, selector, types[ type ] );
  5995. }
  5996. return this;
  5997. }
  5998. if ( selector === false || typeof selector === "function" ) {
  5999.  
  6000. // ( types [, fn] )
  6001. fn = selector;
  6002. selector = undefined;
  6003. }
  6004. if ( fn === false ) {
  6005. fn = returnFalse;
  6006. }
  6007. return this.each( function() {
  6008. jQuery.event.remove( this, types, fn, selector );
  6009. } );
  6010. }
  6011. } );
  6012.  
  6013.  
  6014. var
  6015.  
  6016. // Support: IE <=10 - 11, Edge 12 - 13 only
  6017. // In IE/Edge using regex groups here causes severe slowdowns.
  6018. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  6019. rnoInnerhtml = /<script|<style|<link/i,
  6020.  
  6021. // checked="checked" or checked
  6022. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  6023.  
  6024. rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  6025.  
  6026. // Prefer a tbody over its parent table for containing new rows
  6027. function manipulationTarget( elem, content ) {
  6028. if ( nodeName( elem, "table" ) &&
  6029. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  6030.  
  6031. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  6032. }
  6033.  
  6034. return elem;
  6035. }
  6036.  
  6037. // Replace/restore the type attribute of script elements for safe DOM manipulation
  6038. function disableScript( elem ) {
  6039. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  6040. return elem;
  6041. }
  6042. function restoreScript( elem ) {
  6043. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  6044. elem.type = elem.type.slice( 5 );
  6045. } else {
  6046. elem.removeAttribute( "type" );
  6047. }
  6048.  
  6049. return elem;
  6050. }
  6051.  
  6052. function cloneCopyEvent( src, dest ) {
  6053. var i, l, type, pdataOld, udataOld, udataCur, events;
  6054.  
  6055. if ( dest.nodeType !== 1 ) {
  6056. return;
  6057. }
  6058.  
  6059. // 1. Copy private data: events, handlers, etc.
  6060. if ( dataPriv.hasData( src ) ) {
  6061. pdataOld = dataPriv.get( src );
  6062. events = pdataOld.events;
  6063.  
  6064. if ( events ) {
  6065. dataPriv.remove( dest, "handle events" );
  6066.  
  6067. for ( type in events ) {
  6068. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  6069. jQuery.event.add( dest, type, events[ type ][ i ] );
  6070. }
  6071. }
  6072. }
  6073. }
  6074.  
  6075. // 2. Copy user data
  6076. if ( dataUser.hasData( src ) ) {
  6077. udataOld = dataUser.access( src );
  6078. udataCur = jQuery.extend( {}, udataOld );
  6079.  
  6080. dataUser.set( dest, udataCur );
  6081. }
  6082. }
  6083.  
  6084. // Fix IE bugs, see support tests
  6085. function fixInput( src, dest ) {
  6086. var nodeName = dest.nodeName.toLowerCase();
  6087.  
  6088. // Fails to persist the checked state of a cloned checkbox or radio button.
  6089. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  6090. dest.checked = src.checked;
  6091.  
  6092. // Fails to return the selected option to the default selected state when cloning options
  6093. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  6094. dest.defaultValue = src.defaultValue;
  6095. }
  6096. }
  6097.  
  6098. function domManip( collection, args, callback, ignored ) {
  6099.  
  6100. // Flatten any nested arrays
  6101. args = flat( args );
  6102.  
  6103. var fragment, first, scripts, hasScripts, node, doc,
  6104. i = 0,
  6105. l = collection.length,
  6106. iNoClone = l - 1,
  6107. value = args[ 0 ],
  6108. valueIsFunction = isFunction( value );
  6109.  
  6110. // We can't cloneNode fragments that contain checked, in WebKit
  6111. if ( valueIsFunction ||
  6112. ( l > 1 && typeof value === "string" &&
  6113. !support.checkClone && rchecked.test( value ) ) ) {
  6114. return collection.each( function( index ) {
  6115. var self = collection.eq( index );
  6116. if ( valueIsFunction ) {
  6117. args[ 0 ] = value.call( this, index, self.html() );
  6118. }
  6119. domManip( self, args, callback, ignored );
  6120. } );
  6121. }
  6122.  
  6123. if ( l ) {
  6124. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  6125. first = fragment.firstChild;
  6126.  
  6127. if ( fragment.childNodes.length === 1 ) {
  6128. fragment = first;
  6129. }
  6130.  
  6131. // Require either new content or an interest in ignored elements to invoke the callback
  6132. if ( first || ignored ) {
  6133. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  6134. hasScripts = scripts.length;
  6135.  
  6136. // Use the original fragment for the last item
  6137. // instead of the first because it can end up
  6138. // being emptied incorrectly in certain situations (trac-8070).
  6139. for ( ; i < l; i++ ) {
  6140. node = fragment;
  6141.  
  6142. if ( i !== iNoClone ) {
  6143. node = jQuery.clone( node, true, true );
  6144.  
  6145. // Keep references to cloned scripts for later restoration
  6146. if ( hasScripts ) {
  6147.  
  6148. // Support: Android <=4.0 only, PhantomJS 1 only
  6149. // push.apply(_, arraylike) throws on ancient WebKit
  6150. jQuery.merge( scripts, getAll( node, "script" ) );
  6151. }
  6152. }
  6153.  
  6154. callback.call( collection[ i ], node, i );
  6155. }
  6156.  
  6157. if ( hasScripts ) {
  6158. doc = scripts[ scripts.length - 1 ].ownerDocument;
  6159.  
  6160. // Reenable scripts
  6161. jQuery.map( scripts, restoreScript );
  6162.  
  6163. // Evaluate executable scripts on first document insertion
  6164. for ( i = 0; i < hasScripts; i++ ) {
  6165. node = scripts[ i ];
  6166. if ( rscriptType.test( node.type || "" ) &&
  6167. !dataPriv.access( node, "globalEval" ) &&
  6168. jQuery.contains( doc, node ) ) {
  6169.  
  6170. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  6171.  
  6172. // Optional AJAX dependency, but won't run scripts if not present
  6173. if ( jQuery._evalUrl && !node.noModule ) {
  6174. jQuery._evalUrl( node.src, {
  6175. nonce: node.nonce || node.getAttribute( "nonce" )
  6176. }, doc );
  6177. }
  6178. } else {
  6179.  
  6180. // Unwrap a CDATA section containing script contents. This shouldn't be
  6181. // needed as in XML documents they're already not visible when
  6182. // inspecting element contents and in HTML documents they have no
  6183. // meaning but we're preserving that logic for backwards compatibility.
  6184. // This will be removed completely in 4.0. See gh-4904.
  6185. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  6186. }
  6187. }
  6188. }
  6189. }
  6190. }
  6191. }
  6192.  
  6193. return collection;
  6194. }
  6195.  
  6196. function remove( elem, selector, keepData ) {
  6197. var node,
  6198. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  6199. i = 0;
  6200.  
  6201. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  6202. if ( !keepData && node.nodeType === 1 ) {
  6203. jQuery.cleanData( getAll( node ) );
  6204. }
  6205.  
  6206. if ( node.parentNode ) {
  6207. if ( keepData && isAttached( node ) ) {
  6208. setGlobalEval( getAll( node, "script" ) );
  6209. }
  6210. node.parentNode.removeChild( node );
  6211. }
  6212. }
  6213.  
  6214. return elem;
  6215. }
  6216.  
  6217. jQuery.extend( {
  6218. htmlPrefilter: function( html ) {
  6219. return html;
  6220. },
  6221.  
  6222. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  6223. var i, l, srcElements, destElements,
  6224. clone = elem.cloneNode( true ),
  6225. inPage = isAttached( elem );
  6226.  
  6227. // Fix IE cloning issues
  6228. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  6229. !jQuery.isXMLDoc( elem ) ) {
  6230.  
  6231. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  6232. destElements = getAll( clone );
  6233. srcElements = getAll( elem );
  6234.  
  6235. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  6236. fixInput( srcElements[ i ], destElements[ i ] );
  6237. }
  6238. }
  6239.  
  6240. // Copy the events from the original to the clone
  6241. if ( dataAndEvents ) {
  6242. if ( deepDataAndEvents ) {
  6243. srcElements = srcElements || getAll( elem );
  6244. destElements = destElements || getAll( clone );
  6245.  
  6246. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  6247. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  6248. }
  6249. } else {
  6250. cloneCopyEvent( elem, clone );
  6251. }
  6252. }
  6253.  
  6254. // Preserve script evaluation history
  6255. destElements = getAll( clone, "script" );
  6256. if ( destElements.length > 0 ) {
  6257. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  6258. }
  6259.  
  6260. // Return the cloned set
  6261. return clone;
  6262. },
  6263.  
  6264. cleanData: function( elems ) {
  6265. var data, elem, type,
  6266. special = jQuery.event.special,
  6267. i = 0;
  6268.  
  6269. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  6270. if ( acceptData( elem ) ) {
  6271. if ( ( data = elem[ dataPriv.expando ] ) ) {
  6272. if ( data.events ) {
  6273. for ( type in data.events ) {
  6274. if ( special[ type ] ) {
  6275. jQuery.event.remove( elem, type );
  6276.  
  6277. // This is a shortcut to avoid jQuery.event.remove's overhead
  6278. } else {
  6279. jQuery.removeEvent( elem, type, data.handle );
  6280. }
  6281. }
  6282. }
  6283.  
  6284. // Support: Chrome <=35 - 45+
  6285. // Assign undefined instead of using delete, see Data#remove
  6286. elem[ dataPriv.expando ] = undefined;
  6287. }
  6288. if ( elem[ dataUser.expando ] ) {
  6289.  
  6290. // Support: Chrome <=35 - 45+
  6291. // Assign undefined instead of using delete, see Data#remove
  6292. elem[ dataUser.expando ] = undefined;
  6293. }
  6294. }
  6295. }
  6296. }
  6297. } );
  6298.  
  6299. jQuery.fn.extend( {
  6300. detach: function( selector ) {
  6301. return remove( this, selector, true );
  6302. },
  6303.  
  6304. remove: function( selector ) {
  6305. return remove( this, selector );
  6306. },
  6307.  
  6308. text: function( value ) {
  6309. return access( this, function( value ) {
  6310. return value === undefined ?
  6311. jQuery.text( this ) :
  6312. this.empty().each( function() {
  6313. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6314. this.textContent = value;
  6315. }
  6316. } );
  6317. }, null, value, arguments.length );
  6318. },
  6319.  
  6320. append: function() {
  6321. return domManip( this, arguments, function( elem ) {
  6322. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6323. var target = manipulationTarget( this, elem );
  6324. target.appendChild( elem );
  6325. }
  6326. } );
  6327. },
  6328.  
  6329. prepend: function() {
  6330. return domManip( this, arguments, function( elem ) {
  6331. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6332. var target = manipulationTarget( this, elem );
  6333. target.insertBefore( elem, target.firstChild );
  6334. }
  6335. } );
  6336. },
  6337.  
  6338. before: function() {
  6339. return domManip( this, arguments, function( elem ) {
  6340. if ( this.parentNode ) {
  6341. this.parentNode.insertBefore( elem, this );
  6342. }
  6343. } );
  6344. },
  6345.  
  6346. after: function() {
  6347. return domManip( this, arguments, function( elem ) {
  6348. if ( this.parentNode ) {
  6349. this.parentNode.insertBefore( elem, this.nextSibling );
  6350. }
  6351. } );
  6352. },
  6353.  
  6354. empty: function() {
  6355. var elem,
  6356. i = 0;
  6357.  
  6358. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  6359. if ( elem.nodeType === 1 ) {
  6360.  
  6361. // Prevent memory leaks
  6362. jQuery.cleanData( getAll( elem, false ) );
  6363.  
  6364. // Remove any remaining nodes
  6365. elem.textContent = "";
  6366. }
  6367. }
  6368.  
  6369. return this;
  6370. },
  6371.  
  6372. clone: function( dataAndEvents, deepDataAndEvents ) {
  6373. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  6374. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  6375.  
  6376. return this.map( function() {
  6377. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  6378. } );
  6379. },
  6380.  
  6381. html: function( value ) {
  6382. return access( this, function( value ) {
  6383. var elem = this[ 0 ] || {},
  6384. i = 0,
  6385. l = this.length;
  6386.  
  6387. if ( value === undefined && elem.nodeType === 1 ) {
  6388. return elem.innerHTML;
  6389. }
  6390.  
  6391. // See if we can take a shortcut and just use innerHTML
  6392. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  6393. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  6394.  
  6395. value = jQuery.htmlPrefilter( value );
  6396.  
  6397. try {
  6398. for ( ; i < l; i++ ) {
  6399. elem = this[ i ] || {};
  6400.  
  6401. // Remove element nodes and prevent memory leaks
  6402. if ( elem.nodeType === 1 ) {
  6403. jQuery.cleanData( getAll( elem, false ) );
  6404. elem.innerHTML = value;
  6405. }
  6406. }
  6407.  
  6408. elem = 0;
  6409.  
  6410. // If using innerHTML throws an exception, use the fallback method
  6411. } catch ( e ) {}
  6412. }
  6413.  
  6414. if ( elem ) {
  6415. this.empty().append( value );
  6416. }
  6417. }, null, value, arguments.length );
  6418. },
  6419.  
  6420. replaceWith: function() {
  6421. var ignored = [];
  6422.  
  6423. // Make the changes, replacing each non-ignored context element with the new content
  6424. return domManip( this, arguments, function( elem ) {
  6425. var parent = this.parentNode;
  6426.  
  6427. if ( jQuery.inArray( this, ignored ) < 0 ) {
  6428. jQuery.cleanData( getAll( this ) );
  6429. if ( parent ) {
  6430. parent.replaceChild( elem, this );
  6431. }
  6432. }
  6433.  
  6434. // Force callback invocation
  6435. }, ignored );
  6436. }
  6437. } );
  6438.  
  6439. jQuery.each( {
  6440. appendTo: "append",
  6441. prependTo: "prepend",
  6442. insertBefore: "before",
  6443. insertAfter: "after",
  6444. replaceAll: "replaceWith"
  6445. }, function( name, original ) {
  6446. jQuery.fn[ name ] = function( selector ) {
  6447. var elems,
  6448. ret = [],
  6449. insert = jQuery( selector ),
  6450. last = insert.length - 1,
  6451. i = 0;
  6452.  
  6453. for ( ; i <= last; i++ ) {
  6454. elems = i === last ? this : this.clone( true );
  6455. jQuery( insert[ i ] )[ original ]( elems );
  6456.  
  6457. // Support: Android <=4.0 only, PhantomJS 1 only
  6458. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  6459. push.apply( ret, elems.get() );
  6460. }
  6461.  
  6462. return this.pushStack( ret );
  6463. };
  6464. } );
  6465. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  6466.  
  6467. var rcustomProp = /^--/;
  6468.  
  6469.  
  6470. var getStyles = function( elem ) {
  6471.  
  6472. // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
  6473. // IE throws on elements created in popups
  6474. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  6475. var view = elem.ownerDocument.defaultView;
  6476.  
  6477. if ( !view || !view.opener ) {
  6478. view = window;
  6479. }
  6480.  
  6481. return view.getComputedStyle( elem );
  6482. };
  6483.  
  6484. var swap = function( elem, options, callback ) {
  6485. var ret, name,
  6486. old = {};
  6487.  
  6488. // Remember the old values, and insert the new ones
  6489. for ( name in options ) {
  6490. old[ name ] = elem.style[ name ];
  6491. elem.style[ name ] = options[ name ];
  6492. }
  6493.  
  6494. ret = callback.call( elem );
  6495.  
  6496. // Revert the old values
  6497. for ( name in options ) {
  6498. elem.style[ name ] = old[ name ];
  6499. }
  6500.  
  6501. return ret;
  6502. };
  6503.  
  6504.  
  6505. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  6506.  
  6507. var whitespace = "[\\x20\\t\\r\\n\\f]";
  6508.  
  6509.  
  6510. var rtrimCSS = new RegExp(
  6511. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  6512. "g"
  6513. );
  6514.  
  6515.  
  6516.  
  6517.  
  6518. ( function() {
  6519.  
  6520. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  6521. // so they're executed at the same time to save the second computation.
  6522. function computeStyleTests() {
  6523.  
  6524. // This is a singleton, we need to execute it only once
  6525. if ( !div ) {
  6526. return;
  6527. }
  6528.  
  6529. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  6530. "margin-top:1px;padding:0;border:0";
  6531. div.style.cssText =
  6532. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  6533. "margin:auto;border:1px;padding:1px;" +
  6534. "width:60%;top:1%";
  6535. documentElement.appendChild( container ).appendChild( div );
  6536.  
  6537. var divStyle = window.getComputedStyle( div );
  6538. pixelPositionVal = divStyle.top !== "1%";
  6539.  
  6540. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  6541. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  6542.  
  6543. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  6544. // Some styles come back with percentage values, even though they shouldn't
  6545. div.style.right = "60%";
  6546. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  6547.  
  6548. // Support: IE 9 - 11 only
  6549. // Detect misreporting of content dimensions for box-sizing:border-box elements
  6550. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  6551.  
  6552. // Support: IE 9 only
  6553. // Detect overflow:scroll screwiness (gh-3699)
  6554. // Support: Chrome <=64
  6555. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  6556. div.style.position = "absolute";
  6557. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  6558.  
  6559. documentElement.removeChild( container );
  6560.  
  6561. // Nullify the div so it wouldn't be stored in the memory and
  6562. // it will also be a sign that checks already performed
  6563. div = null;
  6564. }
  6565.  
  6566. function roundPixelMeasures( measure ) {
  6567. return Math.round( parseFloat( measure ) );
  6568. }
  6569.  
  6570. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  6571. reliableTrDimensionsVal, reliableMarginLeftVal,
  6572. container = document.createElement( "div" ),
  6573. div = document.createElement( "div" );
  6574.  
  6575. // Finish early in limited (non-browser) environments
  6576. if ( !div.style ) {
  6577. return;
  6578. }
  6579.  
  6580. // Support: IE <=9 - 11 only
  6581. // Style of cloned element affects source element cloned (trac-8908)
  6582. div.style.backgroundClip = "content-box";
  6583. div.cloneNode( true ).style.backgroundClip = "";
  6584. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  6585.  
  6586. jQuery.extend( support, {
  6587. boxSizingReliable: function() {
  6588. computeStyleTests();
  6589. return boxSizingReliableVal;
  6590. },
  6591. pixelBoxStyles: function() {
  6592. computeStyleTests();
  6593. return pixelBoxStylesVal;
  6594. },
  6595. pixelPosition: function() {
  6596. computeStyleTests();
  6597. return pixelPositionVal;
  6598. },
  6599. reliableMarginLeft: function() {
  6600. computeStyleTests();
  6601. return reliableMarginLeftVal;
  6602. },
  6603. scrollboxSize: function() {
  6604. computeStyleTests();
  6605. return scrollboxSizeVal;
  6606. },
  6607.  
  6608. // Support: IE 9 - 11+, Edge 15 - 18+
  6609. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  6610. // set in CSS while `offset*` properties report correct values.
  6611. // Behavior in IE 9 is more subtle than in newer versions & it passes
  6612. // some versions of this test; make sure not to make it pass there!
  6613. //
  6614. // Support: Firefox 70+
  6615. // Only Firefox includes border widths
  6616. // in computed dimensions. (gh-4529)
  6617. reliableTrDimensions: function() {
  6618. var table, tr, trChild, trStyle;
  6619. if ( reliableTrDimensionsVal == null ) {
  6620. table = document.createElement( "table" );
  6621. tr = document.createElement( "tr" );
  6622. trChild = document.createElement( "div" );
  6623.  
  6624. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  6625. tr.style.cssText = "border:1px solid";
  6626.  
  6627. // Support: Chrome 86+
  6628. // Height set through cssText does not get applied.
  6629. // Computed height then comes back as 0.
  6630. tr.style.height = "1px";
  6631. trChild.style.height = "9px";
  6632.  
  6633. // Support: Android 8 Chrome 86+
  6634. // In our bodyBackground.html iframe,
  6635. // display for all div elements is set to "inline",
  6636. // which causes a problem only in Android 8 Chrome 86.
  6637. // Ensuring the div is display: block
  6638. // gets around this issue.
  6639. trChild.style.display = "block";
  6640.  
  6641. documentElement
  6642. .appendChild( table )
  6643. .appendChild( tr )
  6644. .appendChild( trChild );
  6645.  
  6646. trStyle = window.getComputedStyle( tr );
  6647. reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
  6648. parseInt( trStyle.borderTopWidth, 10 ) +
  6649. parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
  6650.  
  6651. documentElement.removeChild( table );
  6652. }
  6653. return reliableTrDimensionsVal;
  6654. }
  6655. } );
  6656. } )();
  6657.  
  6658.  
  6659. function curCSS( elem, name, computed ) {
  6660. var width, minWidth, maxWidth, ret,
  6661. isCustomProp = rcustomProp.test( name ),
  6662.  
  6663. // Support: Firefox 51+
  6664. // Retrieving style before computed somehow
  6665. // fixes an issue with getting wrong values
  6666. // on detached elements
  6667. style = elem.style;
  6668.  
  6669. computed = computed || getStyles( elem );
  6670.  
  6671. // getPropertyValue is needed for:
  6672. // .css('filter') (IE 9 only, trac-12537)
  6673. // .css('--customProperty) (gh-3144)
  6674. if ( computed ) {
  6675.  
  6676. // Support: IE <=9 - 11+
  6677. // IE only supports `"float"` in `getPropertyValue`; in computed styles
  6678. // it's only available as `"cssFloat"`. We no longer modify properties
  6679. // sent to `.css()` apart from camelCasing, so we need to check both.
  6680. // Normally, this would create difference in behavior: if
  6681. // `getPropertyValue` returns an empty string, the value returned
  6682. // by `.css()` would be `undefined`. This is usually the case for
  6683. // disconnected elements. However, in IE even disconnected elements
  6684. // with no styles return `"none"` for `getPropertyValue( "float" )`
  6685. ret = computed.getPropertyValue( name ) || computed[ name ];
  6686.  
  6687. if ( isCustomProp && ret ) {
  6688.  
  6689. // Support: Firefox 105+, Chrome <=105+
  6690. // Spec requires trimming whitespace for custom properties (gh-4926).
  6691. // Firefox only trims leading whitespace. Chrome just collapses
  6692. // both leading & trailing whitespace to a single space.
  6693. //
  6694. // Fall back to `undefined` if empty string returned.
  6695. // This collapses a missing definition with property defined
  6696. // and set to an empty string but there's no standard API
  6697. // allowing us to differentiate them without a performance penalty
  6698. // and returning `undefined` aligns with older jQuery.
  6699. //
  6700. // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
  6701. // as whitespace while CSS does not, but this is not a problem
  6702. // because CSS preprocessing replaces them with U+000A LINE FEED
  6703. // (which *is* CSS whitespace)
  6704. // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
  6705. ret = ret.replace( rtrimCSS, "$1" ) || undefined;
  6706. }
  6707.  
  6708. if ( ret === "" && !isAttached( elem ) ) {
  6709. ret = jQuery.style( elem, name );
  6710. }
  6711.  
  6712. // A tribute to the "awesome hack by Dean Edwards"
  6713. // Android Browser returns percentage for some values,
  6714. // but width seems to be reliably pixels.
  6715. // This is against the CSSOM draft spec:
  6716. // https://drafts.csswg.org/cssom/#resolved-values
  6717. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  6718.  
  6719. // Remember the original values
  6720. width = style.width;
  6721. minWidth = style.minWidth;
  6722. maxWidth = style.maxWidth;
  6723.  
  6724. // Put in the new values to get a computed value out
  6725. style.minWidth = style.maxWidth = style.width = ret;
  6726. ret = computed.width;
  6727.  
  6728. // Revert the changed values
  6729. style.width = width;
  6730. style.minWidth = minWidth;
  6731. style.maxWidth = maxWidth;
  6732. }
  6733. }
  6734.  
  6735. return ret !== undefined ?
  6736.  
  6737. // Support: IE <=9 - 11 only
  6738. // IE returns zIndex value as an integer.
  6739. ret + "" :
  6740. ret;
  6741. }
  6742.  
  6743.  
  6744. function addGetHookIf( conditionFn, hookFn ) {
  6745.  
  6746. // Define the hook, we'll check on the first run if it's really needed.
  6747. return {
  6748. get: function() {
  6749. if ( conditionFn() ) {
  6750.  
  6751. // Hook not needed (or it's not possible to use it due
  6752. // to missing dependency), remove it.
  6753. delete this.get;
  6754. return;
  6755. }
  6756.  
  6757. // Hook needed; redefine it so that the support test is not executed again.
  6758. return ( this.get = hookFn ).apply( this, arguments );
  6759. }
  6760. };
  6761. }
  6762.  
  6763.  
  6764. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  6765. emptyStyle = document.createElement( "div" ).style,
  6766. vendorProps = {};
  6767.  
  6768. // Return a vendor-prefixed property or undefined
  6769. function vendorPropName( name ) {
  6770.  
  6771. // Check for vendor prefixed names
  6772. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  6773. i = cssPrefixes.length;
  6774.  
  6775. while ( i-- ) {
  6776. name = cssPrefixes[ i ] + capName;
  6777. if ( name in emptyStyle ) {
  6778. return name;
  6779. }
  6780. }
  6781. }
  6782.  
  6783. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  6784. function finalPropName( name ) {
  6785. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  6786.  
  6787. if ( final ) {
  6788. return final;
  6789. }
  6790. if ( name in emptyStyle ) {
  6791. return name;
  6792. }
  6793. return vendorProps[ name ] = vendorPropName( name ) || name;
  6794. }
  6795.  
  6796.  
  6797. var
  6798.  
  6799. // Swappable if display is none or starts with table
  6800. // except "table", "table-cell", or "table-caption"
  6801. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  6802. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  6803. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  6804. cssNormalTransform = {
  6805. letterSpacing: "0",
  6806. fontWeight: "400"
  6807. };
  6808.  
  6809. function setPositiveNumber( _elem, value, subtract ) {
  6810.  
  6811. // Any relative (+/-) values have already been
  6812. // normalized at this point
  6813. var matches = rcssNum.exec( value );
  6814. return matches ?
  6815.  
  6816. // Guard against undefined "subtract", e.g., when used as in cssHooks
  6817. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  6818. value;
  6819. }
  6820.  
  6821. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  6822. var i = dimension === "width" ? 1 : 0,
  6823. extra = 0,
  6824. delta = 0;
  6825.  
  6826. // Adjustment may not be necessary
  6827. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  6828. return 0;
  6829. }
  6830.  
  6831. for ( ; i < 4; i += 2 ) {
  6832.  
  6833. // Both box models exclude margin
  6834. if ( box === "margin" ) {
  6835. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  6836. }
  6837.  
  6838. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  6839. if ( !isBorderBox ) {
  6840.  
  6841. // Add padding
  6842. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6843.  
  6844. // For "border" or "margin", add border
  6845. if ( box !== "padding" ) {
  6846. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6847.  
  6848. // But still keep track of it otherwise
  6849. } else {
  6850. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6851. }
  6852.  
  6853. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  6854. // "padding" or "margin"
  6855. } else {
  6856.  
  6857. // For "content", subtract padding
  6858. if ( box === "content" ) {
  6859. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6860. }
  6861.  
  6862. // For "content" or "padding", subtract border
  6863. if ( box !== "margin" ) {
  6864. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6865. }
  6866. }
  6867. }
  6868.  
  6869. // Account for positive content-box scroll gutter when requested by providing computedVal
  6870. if ( !isBorderBox && computedVal >= 0 ) {
  6871.  
  6872. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  6873. // Assuming integer scroll gutter, subtract the rest and round down
  6874. delta += Math.max( 0, Math.ceil(
  6875. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  6876. computedVal -
  6877. delta -
  6878. extra -
  6879. 0.5
  6880.  
  6881. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  6882. // Use an explicit zero to avoid NaN (gh-3964)
  6883. ) ) || 0;
  6884. }
  6885.  
  6886. return delta;
  6887. }
  6888.  
  6889. function getWidthOrHeight( elem, dimension, extra ) {
  6890.  
  6891. // Start with computed style
  6892. var styles = getStyles( elem ),
  6893.  
  6894. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  6895. // Fake content-box until we know it's needed to know the true value.
  6896. boxSizingNeeded = !support.boxSizingReliable() || extra,
  6897. isBorderBox = boxSizingNeeded &&
  6898. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  6899. valueIsBorderBox = isBorderBox,
  6900.  
  6901. val = curCSS( elem, dimension, styles ),
  6902. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  6903.  
  6904. // Support: Firefox <=54
  6905. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  6906. if ( rnumnonpx.test( val ) ) {
  6907. if ( !extra ) {
  6908. return val;
  6909. }
  6910. val = "auto";
  6911. }
  6912.  
  6913.  
  6914. // Support: IE 9 - 11 only
  6915. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  6916. // In those cases, the computed value can be trusted to be border-box.
  6917. if ( ( !support.boxSizingReliable() && isBorderBox ||
  6918.  
  6919. // Support: IE 10 - 11+, Edge 15 - 18+
  6920. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  6921. // set in CSS while `offset*` properties report correct values.
  6922. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  6923. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  6924.  
  6925. // Fall back to offsetWidth/offsetHeight when value is "auto"
  6926. // This happens for inline elements with no explicit setting (gh-3571)
  6927. val === "auto" ||
  6928.  
  6929. // Support: Android <=4.1 - 4.3 only
  6930. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  6931. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  6932.  
  6933. // Make sure the element is visible & connected
  6934. elem.getClientRects().length ) {
  6935.  
  6936. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  6937.  
  6938. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  6939. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  6940. // retrieved value as a content box dimension.
  6941. valueIsBorderBox = offsetProp in elem;
  6942. if ( valueIsBorderBox ) {
  6943. val = elem[ offsetProp ];
  6944. }
  6945. }
  6946.  
  6947. // Normalize "" and auto
  6948. val = parseFloat( val ) || 0;
  6949.  
  6950. // Adjust for the element's box model
  6951. return ( val +
  6952. boxModelAdjustment(
  6953. elem,
  6954. dimension,
  6955. extra || ( isBorderBox ? "border" : "content" ),
  6956. valueIsBorderBox,
  6957. styles,
  6958.  
  6959. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  6960. val
  6961. )
  6962. ) + "px";
  6963. }
  6964.  
  6965. jQuery.extend( {
  6966.  
  6967. // Add in style property hooks for overriding the default
  6968. // behavior of getting and setting a style property
  6969. cssHooks: {
  6970. opacity: {
  6971. get: function( elem, computed ) {
  6972. if ( computed ) {
  6973.  
  6974. // We should always get a number back from opacity
  6975. var ret = curCSS( elem, "opacity" );
  6976. return ret === "" ? "1" : ret;
  6977. }
  6978. }
  6979. }
  6980. },
  6981.  
  6982. // Don't automatically add "px" to these possibly-unitless properties
  6983. cssNumber: {
  6984. "animationIterationCount": true,
  6985. "columnCount": true,
  6986. "fillOpacity": true,
  6987. "flexGrow": true,
  6988. "flexShrink": true,
  6989. "fontWeight": true,
  6990. "gridArea": true,
  6991. "gridColumn": true,
  6992. "gridColumnEnd": true,
  6993. "gridColumnStart": true,
  6994. "gridRow": true,
  6995. "gridRowEnd": true,
  6996. "gridRowStart": true,
  6997. "lineHeight": true,
  6998. "opacity": true,
  6999. "order": true,
  7000. "orphans": true,
  7001. "widows": true,
  7002. "zIndex": true,
  7003. "zoom": true
  7004. },
  7005.  
  7006. // Add in properties whose names you wish to fix before
  7007. // setting or getting the value
  7008. cssProps: {},
  7009.  
  7010. // Get and set the style property on a DOM Node
  7011. style: function( elem, name, value, extra ) {
  7012.  
  7013. // Don't set styles on text and comment nodes
  7014. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  7015. return;
  7016. }
  7017.  
  7018. // Make sure that we're working with the right name
  7019. var ret, type, hooks,
  7020. origName = camelCase( name ),
  7021. isCustomProp = rcustomProp.test( name ),
  7022. style = elem.style;
  7023.  
  7024. // Make sure that we're working with the right name. We don't
  7025. // want to query the value if it is a CSS custom property
  7026. // since they are user-defined.
  7027. if ( !isCustomProp ) {
  7028. name = finalPropName( origName );
  7029. }
  7030.  
  7031. // Gets hook for the prefixed version, then unprefixed version
  7032. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  7033.  
  7034. // Check if we're setting a value
  7035. if ( value !== undefined ) {
  7036. type = typeof value;
  7037.  
  7038. // Convert "+=" or "-=" to relative numbers (trac-7345)
  7039. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  7040. value = adjustCSS( elem, name, ret );
  7041.  
  7042. // Fixes bug trac-9237
  7043. type = "number";
  7044. }
  7045.  
  7046. // Make sure that null and NaN values aren't set (trac-7116)
  7047. if ( value == null || value !== value ) {
  7048. return;
  7049. }
  7050.  
  7051. // If a number was passed in, add the unit (except for certain CSS properties)
  7052. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  7053. // "px" to a few hardcoded values.
  7054. if ( type === "number" && !isCustomProp ) {
  7055. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  7056. }
  7057.  
  7058. // background-* props affect original clone's values
  7059. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  7060. style[ name ] = "inherit";
  7061. }
  7062.  
  7063. // If a hook was provided, use that value, otherwise just set the specified value
  7064. if ( !hooks || !( "set" in hooks ) ||
  7065. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  7066.  
  7067. if ( isCustomProp ) {
  7068. style.setProperty( name, value );
  7069. } else {
  7070. style[ name ] = value;
  7071. }
  7072. }
  7073.  
  7074. } else {
  7075.  
  7076. // If a hook was provided get the non-computed value from there
  7077. if ( hooks && "get" in hooks &&
  7078. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  7079.  
  7080. return ret;
  7081. }
  7082.  
  7083. // Otherwise just get the value from the style object
  7084. return style[ name ];
  7085. }
  7086. },
  7087.  
  7088. css: function( elem, name, extra, styles ) {
  7089. var val, num, hooks,
  7090. origName = camelCase( name ),
  7091. isCustomProp = rcustomProp.test( name );
  7092.  
  7093. // Make sure that we're working with the right name. We don't
  7094. // want to modify the value if it is a CSS custom property
  7095. // since they are user-defined.
  7096. if ( !isCustomProp ) {
  7097. name = finalPropName( origName );
  7098. }
  7099.  
  7100. // Try prefixed name followed by the unprefixed name
  7101. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  7102.  
  7103. // If a hook was provided get the computed value from there
  7104. if ( hooks && "get" in hooks ) {
  7105. val = hooks.get( elem, true, extra );
  7106. }
  7107.  
  7108. // Otherwise, if a way to get the computed value exists, use that
  7109. if ( val === undefined ) {
  7110. val = curCSS( elem, name, styles );
  7111. }
  7112.  
  7113. // Convert "normal" to computed value
  7114. if ( val === "normal" && name in cssNormalTransform ) {
  7115. val = cssNormalTransform[ name ];
  7116. }
  7117.  
  7118. // Make numeric if forced or a qualifier was provided and val looks numeric
  7119. if ( extra === "" || extra ) {
  7120. num = parseFloat( val );
  7121. return extra === true || isFinite( num ) ? num || 0 : val;
  7122. }
  7123.  
  7124. return val;
  7125. }
  7126. } );
  7127.  
  7128. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  7129. jQuery.cssHooks[ dimension ] = {
  7130. get: function( elem, computed, extra ) {
  7131. if ( computed ) {
  7132.  
  7133. // Certain elements can have dimension info if we invisibly show them
  7134. // but it must have a current display style that would benefit
  7135. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  7136.  
  7137. // Support: Safari 8+
  7138. // Table columns in Safari have non-zero offsetWidth & zero
  7139. // getBoundingClientRect().width unless display is changed.
  7140. // Support: IE <=11 only
  7141. // Running getBoundingClientRect on a disconnected node
  7142. // in IE throws an error.
  7143. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  7144. swap( elem, cssShow, function() {
  7145. return getWidthOrHeight( elem, dimension, extra );
  7146. } ) :
  7147. getWidthOrHeight( elem, dimension, extra );
  7148. }
  7149. },
  7150.  
  7151. set: function( elem, value, extra ) {
  7152. var matches,
  7153. styles = getStyles( elem ),
  7154.  
  7155. // Only read styles.position if the test has a chance to fail
  7156. // to avoid forcing a reflow.
  7157. scrollboxSizeBuggy = !support.scrollboxSize() &&
  7158. styles.position === "absolute",
  7159.  
  7160. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  7161. boxSizingNeeded = scrollboxSizeBuggy || extra,
  7162. isBorderBox = boxSizingNeeded &&
  7163. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  7164. subtract = extra ?
  7165. boxModelAdjustment(
  7166. elem,
  7167. dimension,
  7168. extra,
  7169. isBorderBox,
  7170. styles
  7171. ) :
  7172. 0;
  7173.  
  7174. // Account for unreliable border-box dimensions by comparing offset* to computed and
  7175. // faking a content-box to get border and padding (gh-3699)
  7176. if ( isBorderBox && scrollboxSizeBuggy ) {
  7177. subtract -= Math.ceil(
  7178. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  7179. parseFloat( styles[ dimension ] ) -
  7180. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  7181. 0.5
  7182. );
  7183. }
  7184.  
  7185. // Convert to pixels if value adjustment is needed
  7186. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  7187. ( matches[ 3 ] || "px" ) !== "px" ) {
  7188.  
  7189. elem.style[ dimension ] = value;
  7190. value = jQuery.css( elem, dimension );
  7191. }
  7192.  
  7193. return setPositiveNumber( elem, value, subtract );
  7194. }
  7195. };
  7196. } );
  7197.  
  7198. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  7199. function( elem, computed ) {
  7200. if ( computed ) {
  7201. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  7202. elem.getBoundingClientRect().left -
  7203. swap( elem, { marginLeft: 0 }, function() {
  7204. return elem.getBoundingClientRect().left;
  7205. } )
  7206. ) + "px";
  7207. }
  7208. }
  7209. );
  7210.  
  7211. // These hooks are used by animate to expand properties
  7212. jQuery.each( {
  7213. margin: "",
  7214. padding: "",
  7215. border: "Width"
  7216. }, function( prefix, suffix ) {
  7217. jQuery.cssHooks[ prefix + suffix ] = {
  7218. expand: function( value ) {
  7219. var i = 0,
  7220. expanded = {},
  7221.  
  7222. // Assumes a single number if not a string
  7223. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  7224.  
  7225. for ( ; i < 4; i++ ) {
  7226. expanded[ prefix + cssExpand[ i ] + suffix ] =
  7227. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  7228. }
  7229.  
  7230. return expanded;
  7231. }
  7232. };
  7233.  
  7234. if ( prefix !== "margin" ) {
  7235. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  7236. }
  7237. } );
  7238.  
  7239. jQuery.fn.extend( {
  7240. css: function( name, value ) {
  7241. return access( this, function( elem, name, value ) {
  7242. var styles, len,
  7243. map = {},
  7244. i = 0;
  7245.  
  7246. if ( Array.isArray( name ) ) {
  7247. styles = getStyles( elem );
  7248. len = name.length;
  7249.  
  7250. for ( ; i < len; i++ ) {
  7251. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  7252. }
  7253.  
  7254. return map;
  7255. }
  7256.  
  7257. return value !== undefined ?
  7258. jQuery.style( elem, name, value ) :
  7259. jQuery.css( elem, name );
  7260. }, name, value, arguments.length > 1 );
  7261. }
  7262. } );
  7263.  
  7264.  
  7265. // Based off of the plugin by Clint Helfers, with permission.
  7266. jQuery.fn.delay = function( time, type ) {
  7267. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  7268. type = type || "fx";
  7269.  
  7270. return this.queue( type, function( next, hooks ) {
  7271. var timeout = window.setTimeout( next, time );
  7272. hooks.stop = function() {
  7273. window.clearTimeout( timeout );
  7274. };
  7275. } );
  7276. };
  7277.  
  7278.  
  7279. ( function() {
  7280. var input = document.createElement( "input" ),
  7281. select = document.createElement( "select" ),
  7282. opt = select.appendChild( document.createElement( "option" ) );
  7283.  
  7284. input.type = "checkbox";
  7285.  
  7286. // Support: Android <=4.3 only
  7287. // Default value for a checkbox should be "on"
  7288. support.checkOn = input.value !== "";
  7289.  
  7290. // Support: IE <=11 only
  7291. // Must access selectedIndex to make default options select
  7292. support.optSelected = opt.selected;
  7293.  
  7294. // Support: IE <=11 only
  7295. // An input loses its value after becoming a radio
  7296. input = document.createElement( "input" );
  7297. input.value = "t";
  7298. input.type = "radio";
  7299. support.radioValue = input.value === "t";
  7300. } )();
  7301.  
  7302.  
  7303. var boolHook,
  7304. attrHandle = jQuery.expr.attrHandle;
  7305.  
  7306. jQuery.fn.extend( {
  7307. attr: function( name, value ) {
  7308. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  7309. },
  7310.  
  7311. removeAttr: function( name ) {
  7312. return this.each( function() {
  7313. jQuery.removeAttr( this, name );
  7314. } );
  7315. }
  7316. } );
  7317.  
  7318. jQuery.extend( {
  7319. attr: function( elem, name, value ) {
  7320. var ret, hooks,
  7321. nType = elem.nodeType;
  7322.  
  7323. // Don't get/set attributes on text, comment and attribute nodes
  7324. if ( nType === 3 || nType === 8 || nType === 2 ) {
  7325. return;
  7326. }
  7327.  
  7328. // Fallback to prop when attributes are not supported
  7329. if ( typeof elem.getAttribute === "undefined" ) {
  7330. return jQuery.prop( elem, name, value );
  7331. }
  7332.  
  7333. // Attribute hooks are determined by the lowercase version
  7334. // Grab necessary hook if one is defined
  7335. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  7336. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  7337. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  7338. }
  7339.  
  7340. if ( value !== undefined ) {
  7341. if ( value === null ) {
  7342. jQuery.removeAttr( elem, name );
  7343. return;
  7344. }
  7345.  
  7346. if ( hooks && "set" in hooks &&
  7347. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  7348. return ret;
  7349. }
  7350.  
  7351. elem.setAttribute( name, value + "" );
  7352. return value;
  7353. }
  7354.  
  7355. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  7356. return ret;
  7357. }
  7358.  
  7359. ret = jQuery.find.attr( elem, name );
  7360.  
  7361. // Non-existent attributes return null, we normalize to undefined
  7362. return ret == null ? undefined : ret;
  7363. },
  7364.  
  7365. attrHooks: {
  7366. type: {
  7367. set: function( elem, value ) {
  7368. if ( !support.radioValue && value === "radio" &&
  7369. nodeName( elem, "input" ) ) {
  7370. var val = elem.value;
  7371. elem.setAttribute( "type", value );
  7372. if ( val ) {
  7373. elem.value = val;
  7374. }
  7375. return value;
  7376. }
  7377. }
  7378. }
  7379. },
  7380.  
  7381. removeAttr: function( elem, value ) {
  7382. var name,
  7383. i = 0,
  7384.  
  7385. // Attribute names can contain non-HTML whitespace characters
  7386. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  7387. attrNames = value && value.match( rnothtmlwhite );
  7388.  
  7389. if ( attrNames && elem.nodeType === 1 ) {
  7390. while ( ( name = attrNames[ i++ ] ) ) {
  7391. elem.removeAttribute( name );
  7392. }
  7393. }
  7394. }
  7395. } );
  7396.  
  7397. // Hooks for boolean attributes
  7398. boolHook = {
  7399. set: function( elem, value, name ) {
  7400. if ( value === false ) {
  7401.  
  7402. // Remove boolean attributes when set to false
  7403. jQuery.removeAttr( elem, name );
  7404. } else {
  7405. elem.setAttribute( name, name );
  7406. }
  7407. return name;
  7408. }
  7409. };
  7410.  
  7411. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  7412. var getter = attrHandle[ name ] || jQuery.find.attr;
  7413.  
  7414. attrHandle[ name ] = function( elem, name, isXML ) {
  7415. var ret, handle,
  7416. lowercaseName = name.toLowerCase();
  7417.  
  7418. if ( !isXML ) {
  7419.  
  7420. // Avoid an infinite loop by temporarily removing this function from the getter
  7421. handle = attrHandle[ lowercaseName ];
  7422. attrHandle[ lowercaseName ] = ret;
  7423. ret = getter( elem, name, isXML ) != null ?
  7424. lowercaseName :
  7425. null;
  7426. attrHandle[ lowercaseName ] = handle;
  7427. }
  7428. return ret;
  7429. };
  7430. } );
  7431.  
  7432.  
  7433.  
  7434.  
  7435. var rfocusable = /^(?:input|select|textarea|button)$/i,
  7436. rclickable = /^(?:a|area)$/i;
  7437.  
  7438. jQuery.fn.extend( {
  7439. prop: function( name, value ) {
  7440. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  7441. },
  7442.  
  7443. removeProp: function( name ) {
  7444. return this.each( function() {
  7445. delete this[ jQuery.propFix[ name ] || name ];
  7446. } );
  7447. }
  7448. } );
  7449.  
  7450. jQuery.extend( {
  7451. prop: function( elem, name, value ) {
  7452. var ret, hooks,
  7453. nType = elem.nodeType;
  7454.  
  7455. // Don't get/set properties on text, comment and attribute nodes
  7456. if ( nType === 3 || nType === 8 || nType === 2 ) {
  7457. return;
  7458. }
  7459.  
  7460. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  7461.  
  7462. // Fix name and attach hooks
  7463. name = jQuery.propFix[ name ] || name;
  7464. hooks = jQuery.propHooks[ name ];
  7465. }
  7466.  
  7467. if ( value !== undefined ) {
  7468. if ( hooks && "set" in hooks &&
  7469. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  7470. return ret;
  7471. }
  7472.  
  7473. return ( elem[ name ] = value );
  7474. }
  7475.  
  7476. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  7477. return ret;
  7478. }
  7479.  
  7480. return elem[ name ];
  7481. },
  7482.  
  7483. propHooks: {
  7484. tabIndex: {
  7485. get: function( elem ) {
  7486.  
  7487. // Support: IE <=9 - 11 only
  7488. // elem.tabIndex doesn't always return the
  7489. // correct value when it hasn't been explicitly set
  7490. // Use proper attribute retrieval (trac-12072)
  7491. var tabindex = jQuery.find.attr( elem, "tabindex" );
  7492.  
  7493. if ( tabindex ) {
  7494. return parseInt( tabindex, 10 );
  7495. }
  7496.  
  7497. if (
  7498. rfocusable.test( elem.nodeName ) ||
  7499. rclickable.test( elem.nodeName ) &&
  7500. elem.href
  7501. ) {
  7502. return 0;
  7503. }
  7504.  
  7505. return -1;
  7506. }
  7507. }
  7508. },
  7509.  
  7510. propFix: {
  7511. "for": "htmlFor",
  7512. "class": "className"
  7513. }
  7514. } );
  7515.  
  7516. // Support: IE <=11 only
  7517. // Accessing the selectedIndex property
  7518. // forces the browser to respect setting selected
  7519. // on the option
  7520. // The getter ensures a default option is selected
  7521. // when in an optgroup
  7522. // eslint rule "no-unused-expressions" is disabled for this code
  7523. // since it considers such accessions noop
  7524. if ( !support.optSelected ) {
  7525. jQuery.propHooks.selected = {
  7526. get: function( elem ) {
  7527.  
  7528. /* eslint no-unused-expressions: "off" */
  7529.  
  7530. var parent = elem.parentNode;
  7531. if ( parent && parent.parentNode ) {
  7532. parent.parentNode.selectedIndex;
  7533. }
  7534. return null;
  7535. },
  7536. set: function( elem ) {
  7537.  
  7538. /* eslint no-unused-expressions: "off" */
  7539.  
  7540. var parent = elem.parentNode;
  7541. if ( parent ) {
  7542. parent.selectedIndex;
  7543.  
  7544. if ( parent.parentNode ) {
  7545. parent.parentNode.selectedIndex;
  7546. }
  7547. }
  7548. }
  7549. };
  7550. }
  7551.  
  7552. jQuery.each( [
  7553. "tabIndex",
  7554. "readOnly",
  7555. "maxLength",
  7556. "cellSpacing",
  7557. "cellPadding",
  7558. "rowSpan",
  7559. "colSpan",
  7560. "useMap",
  7561. "frameBorder",
  7562. "contentEditable"
  7563. ], function() {
  7564. jQuery.propFix[ this.toLowerCase() ] = this;
  7565. } );
  7566.  
  7567.  
  7568.  
  7569.  
  7570. // Strip and collapse whitespace according to HTML spec
  7571. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  7572. function stripAndCollapse( value ) {
  7573. var tokens = value.match( rnothtmlwhite ) || [];
  7574. return tokens.join( " " );
  7575. }
  7576.  
  7577.  
  7578. function getClass( elem ) {
  7579. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  7580. }
  7581.  
  7582. function classesToArray( value ) {
  7583. if ( Array.isArray( value ) ) {
  7584. return value;
  7585. }
  7586. if ( typeof value === "string" ) {
  7587. return value.match( rnothtmlwhite ) || [];
  7588. }
  7589. return [];
  7590. }
  7591.  
  7592. jQuery.fn.extend( {
  7593. addClass: function( value ) {
  7594. var classNames, cur, curValue, className, i, finalValue;
  7595.  
  7596. if ( isFunction( value ) ) {
  7597. return this.each( function( j ) {
  7598. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  7599. } );
  7600. }
  7601.  
  7602. classNames = classesToArray( value );
  7603.  
  7604. if ( classNames.length ) {
  7605. return this.each( function() {
  7606. curValue = getClass( this );
  7607. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  7608.  
  7609. if ( cur ) {
  7610. for ( i = 0; i < classNames.length; i++ ) {
  7611. className = classNames[ i ];
  7612. if ( cur.indexOf( " " + className + " " ) < 0 ) {
  7613. cur += className + " ";
  7614. }
  7615. }
  7616.  
  7617. // Only assign if different to avoid unneeded rendering.
  7618. finalValue = stripAndCollapse( cur );
  7619. if ( curValue !== finalValue ) {
  7620. this.setAttribute( "class", finalValue );
  7621. }
  7622. }
  7623. } );
  7624. }
  7625.  
  7626. return this;
  7627. },
  7628.  
  7629. removeClass: function( value ) {
  7630. var classNames, cur, curValue, className, i, finalValue;
  7631.  
  7632. if ( isFunction( value ) ) {
  7633. return this.each( function( j ) {
  7634. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  7635. } );
  7636. }
  7637.  
  7638. if ( !arguments.length ) {
  7639. return this.attr( "class", "" );
  7640. }
  7641.  
  7642. classNames = classesToArray( value );
  7643.  
  7644. if ( classNames.length ) {
  7645. return this.each( function() {
  7646. curValue = getClass( this );
  7647.  
  7648. // This expression is here for better compressibility (see addClass)
  7649. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  7650.  
  7651. if ( cur ) {
  7652. for ( i = 0; i < classNames.length; i++ ) {
  7653. className = classNames[ i ];
  7654.  
  7655. // Remove *all* instances
  7656. while ( cur.indexOf( " " + className + " " ) > -1 ) {
  7657. cur = cur.replace( " " + className + " ", " " );
  7658. }
  7659. }
  7660.  
  7661. // Only assign if different to avoid unneeded rendering.
  7662. finalValue = stripAndCollapse( cur );
  7663. if ( curValue !== finalValue ) {
  7664. this.setAttribute( "class", finalValue );
  7665. }
  7666. }
  7667. } );
  7668. }
  7669.  
  7670. return this;
  7671. },
  7672.  
  7673. toggleClass: function( value, stateVal ) {
  7674. var classNames, className, i, self,
  7675. type = typeof value,
  7676. isValidValue = type === "string" || Array.isArray( value );
  7677.  
  7678. if ( isFunction( value ) ) {
  7679. return this.each( function( i ) {
  7680. jQuery( this ).toggleClass(
  7681. value.call( this, i, getClass( this ), stateVal ),
  7682. stateVal
  7683. );
  7684. } );
  7685. }
  7686.  
  7687. if ( typeof stateVal === "boolean" && isValidValue ) {
  7688. return stateVal ? this.addClass( value ) : this.removeClass( value );
  7689. }
  7690.  
  7691. classNames = classesToArray( value );
  7692.  
  7693. return this.each( function() {
  7694. if ( isValidValue ) {
  7695.  
  7696. // Toggle individual class names
  7697. self = jQuery( this );
  7698.  
  7699. for ( i = 0; i < classNames.length; i++ ) {
  7700. className = classNames[ i ];
  7701.  
  7702. // Check each className given, space separated list
  7703. if ( self.hasClass( className ) ) {
  7704. self.removeClass( className );
  7705. } else {
  7706. self.addClass( className );
  7707. }
  7708. }
  7709.  
  7710. // Toggle whole class name
  7711. } else if ( value === undefined || type === "boolean" ) {
  7712. className = getClass( this );
  7713. if ( className ) {
  7714.  
  7715. // Store className if set
  7716. dataPriv.set( this, "__className__", className );
  7717. }
  7718.  
  7719. // If the element has a class name or if we're passed `false`,
  7720. // then remove the whole classname (if there was one, the above saved it).
  7721. // Otherwise bring back whatever was previously saved (if anything),
  7722. // falling back to the empty string if nothing was stored.
  7723. if ( this.setAttribute ) {
  7724. this.setAttribute( "class",
  7725. className || value === false ?
  7726. "" :
  7727. dataPriv.get( this, "__className__" ) || ""
  7728. );
  7729. }
  7730. }
  7731. } );
  7732. },
  7733.  
  7734. hasClass: function( selector ) {
  7735. var className, elem,
  7736. i = 0;
  7737.  
  7738. className = " " + selector + " ";
  7739. while ( ( elem = this[ i++ ] ) ) {
  7740. if ( elem.nodeType === 1 &&
  7741. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  7742. return true;
  7743. }
  7744. }
  7745.  
  7746. return false;
  7747. }
  7748. } );
  7749.  
  7750.  
  7751.  
  7752.  
  7753. var rreturn = /\r/g;
  7754.  
  7755. jQuery.fn.extend( {
  7756. val: function( value ) {
  7757. var hooks, ret, valueIsFunction,
  7758. elem = this[ 0 ];
  7759.  
  7760. if ( !arguments.length ) {
  7761. if ( elem ) {
  7762. hooks = jQuery.valHooks[ elem.type ] ||
  7763. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  7764.  
  7765. if ( hooks &&
  7766. "get" in hooks &&
  7767. ( ret = hooks.get( elem, "value" ) ) !== undefined
  7768. ) {
  7769. return ret;
  7770. }
  7771.  
  7772. ret = elem.value;
  7773.  
  7774. // Handle most common string cases
  7775. if ( typeof ret === "string" ) {
  7776. return ret.replace( rreturn, "" );
  7777. }
  7778.  
  7779. // Handle cases where value is null/undef or number
  7780. return ret == null ? "" : ret;
  7781. }
  7782.  
  7783. return;
  7784. }
  7785.  
  7786. valueIsFunction = isFunction( value );
  7787.  
  7788. return this.each( function( i ) {
  7789. var val;
  7790.  
  7791. if ( this.nodeType !== 1 ) {
  7792. return;
  7793. }
  7794.  
  7795. if ( valueIsFunction ) {
  7796. val = value.call( this, i, jQuery( this ).val() );
  7797. } else {
  7798. val = value;
  7799. }
  7800.  
  7801. // Treat null/undefined as ""; convert numbers to string
  7802. if ( val == null ) {
  7803. val = "";
  7804.  
  7805. } else if ( typeof val === "number" ) {
  7806. val += "";
  7807.  
  7808. } else if ( Array.isArray( val ) ) {
  7809. val = jQuery.map( val, function( value ) {
  7810. return value == null ? "" : value + "";
  7811. } );
  7812. }
  7813.  
  7814. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  7815.  
  7816. // If set returns undefined, fall back to normal setting
  7817. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  7818. this.value = val;
  7819. }
  7820. } );
  7821. }
  7822. } );
  7823.  
  7824. jQuery.extend( {
  7825. valHooks: {
  7826. option: {
  7827. get: function( elem ) {
  7828.  
  7829. var val = jQuery.find.attr( elem, "value" );
  7830. return val != null ?
  7831. val :
  7832.  
  7833. // Support: IE <=10 - 11 only
  7834. // option.text throws exceptions (trac-14686, trac-14858)
  7835. // Strip and collapse whitespace
  7836. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  7837. stripAndCollapse( jQuery.text( elem ) );
  7838. }
  7839. },
  7840. select: {
  7841. get: function( elem ) {
  7842. var value, option, i,
  7843. options = elem.options,
  7844. index = elem.selectedIndex,
  7845. one = elem.type === "select-one",
  7846. values = one ? null : [],
  7847. max = one ? index + 1 : options.length;
  7848.  
  7849. if ( index < 0 ) {
  7850. i = max;
  7851.  
  7852. } else {
  7853. i = one ? index : 0;
  7854. }
  7855.  
  7856. // Loop through all the selected options
  7857. for ( ; i < max; i++ ) {
  7858. option = options[ i ];
  7859.  
  7860. // Support: IE <=9 only
  7861. // IE8-9 doesn't update selected after form reset (trac-2551)
  7862. if ( ( option.selected || i === index ) &&
  7863.  
  7864. // Don't return options that are disabled or in a disabled optgroup
  7865. !option.disabled &&
  7866. ( !option.parentNode.disabled ||
  7867. !nodeName( option.parentNode, "optgroup" ) ) ) {
  7868.  
  7869. // Get the specific value for the option
  7870. value = jQuery( option ).val();
  7871.  
  7872. // We don't need an array for one selects
  7873. if ( one ) {
  7874. return value;
  7875. }
  7876.  
  7877. // Multi-Selects return an array
  7878. values.push( value );
  7879. }
  7880. }
  7881.  
  7882. return values;
  7883. },
  7884.  
  7885. set: function( elem, value ) {
  7886. var optionSet, option,
  7887. options = elem.options,
  7888. values = jQuery.makeArray( value ),
  7889. i = options.length;
  7890.  
  7891. while ( i-- ) {
  7892. option = options[ i ];
  7893.  
  7894. /* eslint-disable no-cond-assign */
  7895.  
  7896. if ( option.selected =
  7897. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  7898. ) {
  7899. optionSet = true;
  7900. }
  7901.  
  7902. /* eslint-enable no-cond-assign */
  7903. }
  7904.  
  7905. // Force browsers to behave consistently when non-matching value is set
  7906. if ( !optionSet ) {
  7907. elem.selectedIndex = -1;
  7908. }
  7909. return values;
  7910. }
  7911. }
  7912. }
  7913. } );
  7914.  
  7915. // Radios and checkboxes getter/setter
  7916. jQuery.each( [ "radio", "checkbox" ], function() {
  7917. jQuery.valHooks[ this ] = {
  7918. set: function( elem, value ) {
  7919. if ( Array.isArray( value ) ) {
  7920. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  7921. }
  7922. }
  7923. };
  7924. if ( !support.checkOn ) {
  7925. jQuery.valHooks[ this ].get = function( elem ) {
  7926. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  7927. };
  7928. }
  7929. } );
  7930.  
  7931.  
  7932.  
  7933.  
  7934. // Return jQuery for attributes-only inclusion
  7935.  
  7936.  
  7937. support.focusin = "onfocusin" in window;
  7938.  
  7939.  
  7940. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7941. stopPropagationCallback = function( e ) {
  7942. e.stopPropagation();
  7943. };
  7944.  
  7945. jQuery.extend( jQuery.event, {
  7946.  
  7947. trigger: function( event, data, elem, onlyHandlers ) {
  7948.  
  7949. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7950. eventPath = [ elem || document ],
  7951. type = hasOwn.call( event, "type" ) ? event.type : event,
  7952. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7953.  
  7954. cur = lastElement = tmp = elem = elem || document;
  7955.  
  7956. // Don't do events on text and comment nodes
  7957. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7958. return;
  7959. }
  7960.  
  7961. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7962. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7963. return;
  7964. }
  7965.  
  7966. if ( type.indexOf( "." ) > -1 ) {
  7967.  
  7968. // Namespaced trigger; create a regexp to match event type in handle()
  7969. namespaces = type.split( "." );
  7970. type = namespaces.shift();
  7971. namespaces.sort();
  7972. }
  7973. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7974.  
  7975. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7976. event = event[ jQuery.expando ] ?
  7977. event :
  7978. new jQuery.Event( type, typeof event === "object" && event );
  7979.  
  7980. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7981. event.isTrigger = onlyHandlers ? 2 : 3;
  7982. event.namespace = namespaces.join( "." );
  7983. event.rnamespace = event.namespace ?
  7984. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7985. null;
  7986.  
  7987. // Clean up the event in case it is being reused
  7988. event.result = undefined;
  7989. if ( !event.target ) {
  7990. event.target = elem;
  7991. }
  7992.  
  7993. // Clone any incoming data and prepend the event, creating the handler arg list
  7994. data = data == null ?
  7995. [ event ] :
  7996. jQuery.makeArray( data, [ event ] );
  7997.  
  7998. // Allow special events to draw outside the lines
  7999. special = jQuery.event.special[ type ] || {};
  8000. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  8001. return;
  8002. }
  8003.  
  8004. // Determine event propagation path in advance, per W3C events spec (trac-9951)
  8005. // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
  8006. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  8007.  
  8008. bubbleType = special.delegateType || type;
  8009. if ( !rfocusMorph.test( bubbleType + type ) ) {
  8010. cur = cur.parentNode;
  8011. }
  8012. for ( ; cur; cur = cur.parentNode ) {
  8013. eventPath.push( cur );
  8014. tmp = cur;
  8015. }
  8016.  
  8017. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  8018. if ( tmp === ( elem.ownerDocument || document ) ) {
  8019. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  8020. }
  8021. }
  8022.  
  8023. // Fire handlers on the event path
  8024. i = 0;
  8025. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  8026. lastElement = cur;
  8027. event.type = i > 1 ?
  8028. bubbleType :
  8029. special.bindType || type;
  8030.  
  8031. // jQuery handler
  8032. handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
  8033. dataPriv.get( cur, "handle" );
  8034. if ( handle ) {
  8035. handle.apply( cur, data );
  8036. }
  8037.  
  8038. // Native handler
  8039. handle = ontype && cur[ ontype ];
  8040. if ( handle && handle.apply && acceptData( cur ) ) {
  8041. event.result = handle.apply( cur, data );
  8042. if ( event.result === false ) {
  8043. event.preventDefault();
  8044. }
  8045. }
  8046. }
  8047. event.type = type;
  8048.  
  8049. // If nobody prevented the default action, do it now
  8050. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  8051.  
  8052. if ( ( !special._default ||
  8053. special._default.apply( eventPath.pop(), data ) === false ) &&
  8054. acceptData( elem ) ) {
  8055.  
  8056. // Call a native DOM method on the target with the same name as the event.
  8057. // Don't do default actions on window, that's where global variables be (trac-6170)
  8058. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  8059.  
  8060. // Don't re-trigger an onFOO event when we call its FOO() method
  8061. tmp = elem[ ontype ];
  8062.  
  8063. if ( tmp ) {
  8064. elem[ ontype ] = null;
  8065. }
  8066.  
  8067. // Prevent re-triggering of the same event, since we already bubbled it above
  8068. jQuery.event.triggered = type;
  8069.  
  8070. if ( event.isPropagationStopped() ) {
  8071. lastElement.addEventListener( type, stopPropagationCallback );
  8072. }
  8073.  
  8074. elem[ type ]();
  8075.  
  8076. if ( event.isPropagationStopped() ) {
  8077. lastElement.removeEventListener( type, stopPropagationCallback );
  8078. }
  8079.  
  8080. jQuery.event.triggered = undefined;
  8081.  
  8082. if ( tmp ) {
  8083. elem[ ontype ] = tmp;
  8084. }
  8085. }
  8086. }
  8087. }
  8088.  
  8089. return event.result;
  8090. },
  8091.  
  8092. // Piggyback on a donor event to simulate a different one
  8093. // Used only for `focus(in | out)` events
  8094. simulate: function( type, elem, event ) {
  8095. var e = jQuery.extend(
  8096. new jQuery.Event(),
  8097. event,
  8098. {
  8099. type: type,
  8100. isSimulated: true
  8101. }
  8102. );
  8103.  
  8104. jQuery.event.trigger( e, null, elem );
  8105. }
  8106.  
  8107. } );
  8108.  
  8109. jQuery.fn.extend( {
  8110.  
  8111. trigger: function( type, data ) {
  8112. return this.each( function() {
  8113. jQuery.event.trigger( type, data, this );
  8114. } );
  8115. },
  8116. triggerHandler: function( type, data ) {
  8117. var elem = this[ 0 ];
  8118. if ( elem ) {
  8119. return jQuery.event.trigger( type, data, elem, true );
  8120. }
  8121. }
  8122. } );
  8123.  
  8124.  
  8125. // Support: Firefox <=44
  8126. // Firefox doesn't have focus(in | out) events
  8127. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  8128. //
  8129. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  8130. // focus(in | out) events fire after focus & blur events,
  8131. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  8132. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  8133. if ( !support.focusin ) {
  8134. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  8135.  
  8136. // Attach a single capturing handler on the document while someone wants focusin/focusout
  8137. var handler = function( event ) {
  8138. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  8139. };
  8140.  
  8141. jQuery.event.special[ fix ] = {
  8142. setup: function() {
  8143.  
  8144. // Handle: regular nodes (via `this.ownerDocument`), window
  8145. // (via `this.document`) & document (via `this`).
  8146. var doc = this.ownerDocument || this.document || this,
  8147. attaches = dataPriv.access( doc, fix );
  8148.  
  8149. if ( !attaches ) {
  8150. doc.addEventListener( orig, handler, true );
  8151. }
  8152. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  8153. },
  8154. teardown: function() {
  8155. var doc = this.ownerDocument || this.document || this,
  8156. attaches = dataPriv.access( doc, fix ) - 1;
  8157.  
  8158. if ( !attaches ) {
  8159. doc.removeEventListener( orig, handler, true );
  8160. dataPriv.remove( doc, fix );
  8161.  
  8162. } else {
  8163. dataPriv.access( doc, fix, attaches );
  8164. }
  8165. }
  8166. };
  8167. } );
  8168. }
  8169.  
  8170.  
  8171. // Cross-browser xml parsing
  8172. jQuery.parseXML = function( data ) {
  8173. var xml, parserErrorElem;
  8174. if ( !data || typeof data !== "string" ) {
  8175. return null;
  8176. }
  8177.  
  8178. // Support: IE 9 - 11 only
  8179. // IE throws on parseFromString with invalid input.
  8180. try {
  8181. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  8182. } catch ( e ) {}
  8183.  
  8184. parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
  8185. if ( !xml || parserErrorElem ) {
  8186. jQuery.error( "Invalid XML: " + (
  8187. parserErrorElem ?
  8188. jQuery.map( parserErrorElem.childNodes, function( el ) {
  8189. return el.textContent;
  8190. } ).join( "\n" ) :
  8191. data
  8192. ) );
  8193. }
  8194. return xml;
  8195. };
  8196.  
  8197.  
  8198. var
  8199. rbracket = /\[\]$/,
  8200. rCRLF = /\r?\n/g,
  8201. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  8202. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  8203.  
  8204. function buildParams( prefix, obj, traditional, add ) {
  8205. var name;
  8206.  
  8207. if ( Array.isArray( obj ) ) {
  8208.  
  8209. // Serialize array item.
  8210. jQuery.each( obj, function( i, v ) {
  8211. if ( traditional || rbracket.test( prefix ) ) {
  8212.  
  8213. // Treat each array item as a scalar.
  8214. add( prefix, v );
  8215.  
  8216. } else {
  8217.  
  8218. // Item is non-scalar (array or object), encode its numeric index.
  8219. buildParams(
  8220. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  8221. v,
  8222. traditional,
  8223. add
  8224. );
  8225. }
  8226. } );
  8227.  
  8228. } else if ( !traditional && toType( obj ) === "object" ) {
  8229.  
  8230. // Serialize object item.
  8231. for ( name in obj ) {
  8232. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  8233. }
  8234.  
  8235. } else {
  8236.  
  8237. // Serialize scalar item.
  8238. add( prefix, obj );
  8239. }
  8240. }
  8241.  
  8242. // Serialize an array of form elements or a set of
  8243. // key/values into a query string
  8244. jQuery.param = function( a, traditional ) {
  8245. var prefix,
  8246. s = [],
  8247. add = function( key, valueOrFunction ) {
  8248.  
  8249. // If value is a function, invoke it and use its return value
  8250. var value = isFunction( valueOrFunction ) ?
  8251. valueOrFunction() :
  8252. valueOrFunction;
  8253.  
  8254. s[ s.length ] = encodeURIComponent( key ) + "=" +
  8255. encodeURIComponent( value == null ? "" : value );
  8256. };
  8257.  
  8258. if ( a == null ) {
  8259. return "";
  8260. }
  8261.  
  8262. // If an array was passed in, assume that it is an array of form elements.
  8263. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  8264.  
  8265. // Serialize the form elements
  8266. jQuery.each( a, function() {
  8267. add( this.name, this.value );
  8268. } );
  8269.  
  8270. } else {
  8271.  
  8272. // If traditional, encode the "old" way (the way 1.3.2 or older
  8273. // did it), otherwise encode params recursively.
  8274. for ( prefix in a ) {
  8275. buildParams( prefix, a[ prefix ], traditional, add );
  8276. }
  8277. }
  8278.  
  8279. // Return the resulting serialization
  8280. return s.join( "&" );
  8281. };
  8282.  
  8283. jQuery.fn.extend( {
  8284. serialize: function() {
  8285. return jQuery.param( this.serializeArray() );
  8286. },
  8287. serializeArray: function() {
  8288. return this.map( function() {
  8289.  
  8290. // Can add propHook for "elements" to filter or add form elements
  8291. var elements = jQuery.prop( this, "elements" );
  8292. return elements ? jQuery.makeArray( elements ) : this;
  8293. } ).filter( function() {
  8294. var type = this.type;
  8295.  
  8296. // Use .is( ":disabled" ) so that fieldset[disabled] works
  8297. return this.name && !jQuery( this ).is( ":disabled" ) &&
  8298. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  8299. ( this.checked || !rcheckableType.test( type ) );
  8300. } ).map( function( _i, elem ) {
  8301. var val = jQuery( this ).val();
  8302.  
  8303. if ( val == null ) {
  8304. return null;
  8305. }
  8306.  
  8307. if ( Array.isArray( val ) ) {
  8308. return jQuery.map( val, function( val ) {
  8309. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  8310. } );
  8311. }
  8312.  
  8313. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  8314. } ).get();
  8315. }
  8316. } );
  8317.  
  8318.  
  8319. jQuery.fn.extend( {
  8320. wrapAll: function( html ) {
  8321. var wrap;
  8322.  
  8323. if ( this[ 0 ] ) {
  8324. if ( isFunction( html ) ) {
  8325. html = html.call( this[ 0 ] );
  8326. }
  8327.  
  8328. // The elements to wrap the target around
  8329. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  8330.  
  8331. if ( this[ 0 ].parentNode ) {
  8332. wrap.insertBefore( this[ 0 ] );
  8333. }
  8334.  
  8335. wrap.map( function() {
  8336. var elem = this;
  8337.  
  8338. while ( elem.firstElementChild ) {
  8339. elem = elem.firstElementChild;
  8340. }
  8341.  
  8342. return elem;
  8343. } ).append( this );
  8344. }
  8345.  
  8346. return this;
  8347. },
  8348.  
  8349. wrapInner: function( html ) {
  8350. if ( isFunction( html ) ) {
  8351. return this.each( function( i ) {
  8352. jQuery( this ).wrapInner( html.call( this, i ) );
  8353. } );
  8354. }
  8355.  
  8356. return this.each( function() {
  8357. var self = jQuery( this ),
  8358. contents = self.contents();
  8359.  
  8360. if ( contents.length ) {
  8361. contents.wrapAll( html );
  8362.  
  8363. } else {
  8364. self.append( html );
  8365. }
  8366. } );
  8367. },
  8368.  
  8369. wrap: function( html ) {
  8370. var htmlIsFunction = isFunction( html );
  8371.  
  8372. return this.each( function( i ) {
  8373. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8374. } );
  8375. },
  8376.  
  8377. unwrap: function( selector ) {
  8378. this.parent( selector ).not( "body" ).each( function() {
  8379. jQuery( this ).replaceWith( this.childNodes );
  8380. } );
  8381. return this;
  8382. }
  8383. } );
  8384.  
  8385.  
  8386. jQuery.expr.pseudos.hidden = function( elem ) {
  8387. return !jQuery.expr.pseudos.visible( elem );
  8388. };
  8389. jQuery.expr.pseudos.visible = function( elem ) {
  8390. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8391. };
  8392.  
  8393.  
  8394.  
  8395.  
  8396. // Support: Safari 8 only
  8397. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8398. // collapse sibling forms: the second one becomes a child of the first one.
  8399. // Because of that, this security measure has to be disabled in Safari 8.
  8400. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8401. support.createHTMLDocument = ( function() {
  8402. var body = document.implementation.createHTMLDocument( "" ).body;
  8403. body.innerHTML = "<form></form><form></form>";
  8404. return body.childNodes.length === 2;
  8405. } )();
  8406.  
  8407.  
  8408. // Argument "data" should be string of html
  8409. // context (optional): If specified, the fragment will be created in this context,
  8410. // defaults to document
  8411. // keepScripts (optional): If true, will include scripts passed in the html string
  8412. jQuery.parseHTML = function( data, context, keepScripts ) {
  8413. if ( typeof data !== "string" ) {
  8414. return [];
  8415. }
  8416. if ( typeof context === "boolean" ) {
  8417. keepScripts = context;
  8418. context = false;
  8419. }
  8420.  
  8421. var base, parsed, scripts;
  8422.  
  8423. if ( !context ) {
  8424.  
  8425. // Stop scripts or inline event handlers from being executed immediately
  8426. // by using document.implementation
  8427. if ( support.createHTMLDocument ) {
  8428. context = document.implementation.createHTMLDocument( "" );
  8429.  
  8430. // Set the base href for the created document
  8431. // so any parsed elements with URLs
  8432. // are based on the document's URL (gh-2965)
  8433. base = context.createElement( "base" );
  8434. base.href = document.location.href;
  8435. context.head.appendChild( base );
  8436. } else {
  8437. context = document;
  8438. }
  8439. }
  8440.  
  8441. parsed = rsingleTag.exec( data );
  8442. scripts = !keepScripts && [];
  8443.  
  8444. // Single tag
  8445. if ( parsed ) {
  8446. return [ context.createElement( parsed[ 1 ] ) ];
  8447. }
  8448.  
  8449. parsed = buildFragment( [ data ], context, scripts );
  8450.  
  8451. if ( scripts && scripts.length ) {
  8452. jQuery( scripts ).remove();
  8453. }
  8454.  
  8455. return jQuery.merge( [], parsed.childNodes );
  8456. };
  8457.  
  8458.  
  8459. jQuery.offset = {
  8460. setOffset: function( elem, options, i ) {
  8461. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8462. position = jQuery.css( elem, "position" ),
  8463. curElem = jQuery( elem ),
  8464. props = {};
  8465.  
  8466. // Set position first, in-case top/left are set even on static elem
  8467. if ( position === "static" ) {
  8468. elem.style.position = "relative";
  8469. }
  8470.  
  8471. curOffset = curElem.offset();
  8472. curCSSTop = jQuery.css( elem, "top" );
  8473. curCSSLeft = jQuery.css( elem, "left" );
  8474. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8475. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8476.  
  8477. // Need to be able to calculate position if either
  8478. // top or left is auto and position is either absolute or fixed
  8479. if ( calculatePosition ) {
  8480. curPosition = curElem.position();
  8481. curTop = curPosition.top;
  8482. curLeft = curPosition.left;
  8483.  
  8484. } else {
  8485. curTop = parseFloat( curCSSTop ) || 0;
  8486. curLeft = parseFloat( curCSSLeft ) || 0;
  8487. }
  8488.  
  8489. if ( isFunction( options ) ) {
  8490.  
  8491. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8492. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8493. }
  8494.  
  8495. if ( options.top != null ) {
  8496. props.top = ( options.top - curOffset.top ) + curTop;
  8497. }
  8498. if ( options.left != null ) {
  8499. props.left = ( options.left - curOffset.left ) + curLeft;
  8500. }
  8501.  
  8502. if ( "using" in options ) {
  8503. options.using.call( elem, props );
  8504.  
  8505. } else {
  8506. curElem.css( props );
  8507. }
  8508. }
  8509. };
  8510.  
  8511. jQuery.fn.extend( {
  8512.  
  8513. // offset() relates an element's border box to the document origin
  8514. offset: function( options ) {
  8515.  
  8516. // Preserve chaining for setter
  8517. if ( arguments.length ) {
  8518. return options === undefined ?
  8519. this :
  8520. this.each( function( i ) {
  8521. jQuery.offset.setOffset( this, options, i );
  8522. } );
  8523. }
  8524.  
  8525. var rect, win,
  8526. elem = this[ 0 ];
  8527.  
  8528. if ( !elem ) {
  8529. return;
  8530. }
  8531.  
  8532. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8533. // Support: IE <=11 only
  8534. // Running getBoundingClientRect on a
  8535. // disconnected node in IE throws an error
  8536. if ( !elem.getClientRects().length ) {
  8537. return { top: 0, left: 0 };
  8538. }
  8539.  
  8540. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8541. rect = elem.getBoundingClientRect();
  8542. win = elem.ownerDocument.defaultView;
  8543. return {
  8544. top: rect.top + win.pageYOffset,
  8545. left: rect.left + win.pageXOffset
  8546. };
  8547. },
  8548.  
  8549. // position() relates an element's margin box to its offset parent's padding box
  8550. // This corresponds to the behavior of CSS absolute positioning
  8551. position: function() {
  8552. if ( !this[ 0 ] ) {
  8553. return;
  8554. }
  8555.  
  8556. var offsetParent, offset, doc,
  8557. elem = this[ 0 ],
  8558. parentOffset = { top: 0, left: 0 };
  8559.  
  8560. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8561. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8562.  
  8563. // Assume position:fixed implies availability of getBoundingClientRect
  8564. offset = elem.getBoundingClientRect();
  8565.  
  8566. } else {
  8567. offset = this.offset();
  8568.  
  8569. // Account for the *real* offset parent, which can be the document or its root element
  8570. // when a statically positioned element is identified
  8571. doc = elem.ownerDocument;
  8572. offsetParent = elem.offsetParent || doc.documentElement;
  8573. while ( offsetParent &&
  8574. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8575. jQuery.css( offsetParent, "position" ) === "static" ) {
  8576.  
  8577. offsetParent = offsetParent.parentNode;
  8578. }
  8579. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8580.  
  8581. // Incorporate borders into its offset, since they are outside its content origin
  8582. parentOffset = jQuery( offsetParent ).offset();
  8583. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8584. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8585. }
  8586. }
  8587.  
  8588. // Subtract parent offsets and element margins
  8589. return {
  8590. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8591. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8592. };
  8593. },
  8594.  
  8595. // This method will return documentElement in the following cases:
  8596. // 1) For the element inside the iframe without offsetParent, this method will return
  8597. // documentElement of the parent window
  8598. // 2) For the hidden or detached element
  8599. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8600. //
  8601. // but those exceptions were never presented as a real life use-cases
  8602. // and might be considered as more preferable results.
  8603. //
  8604. // This logic, however, is not guaranteed and can change at any point in the future
  8605. offsetParent: function() {
  8606. return this.map( function() {
  8607. var offsetParent = this.offsetParent;
  8608.  
  8609. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8610. offsetParent = offsetParent.offsetParent;
  8611. }
  8612.  
  8613. return offsetParent || documentElement;
  8614. } );
  8615. }
  8616. } );
  8617.  
  8618. // Create scrollLeft and scrollTop methods
  8619. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8620. var top = "pageYOffset" === prop;
  8621.  
  8622. jQuery.fn[ method ] = function( val ) {
  8623. return access( this, function( elem, method, val ) {
  8624.  
  8625. // Coalesce documents and windows
  8626. var win;
  8627. if ( isWindow( elem ) ) {
  8628. win = elem;
  8629. } else if ( elem.nodeType === 9 ) {
  8630. win = elem.defaultView;
  8631. }
  8632.  
  8633. if ( val === undefined ) {
  8634. return win ? win[ prop ] : elem[ method ];
  8635. }
  8636.  
  8637. if ( win ) {
  8638. win.scrollTo(
  8639. !top ? val : win.pageXOffset,
  8640. top ? val : win.pageYOffset
  8641. );
  8642.  
  8643. } else {
  8644. elem[ method ] = val;
  8645. }
  8646. }, method, val, arguments.length );
  8647. };
  8648. } );
  8649.  
  8650. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8651. // Add the top/left cssHooks using jQuery.fn.position
  8652. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8653. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8654. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8655. // rather than make the css module depend on the offset module, just check for it here
  8656. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8657. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8658. function( elem, computed ) {
  8659. if ( computed ) {
  8660. computed = curCSS( elem, prop );
  8661.  
  8662. // If curCSS returns percentage, fallback to offset
  8663. return rnumnonpx.test( computed ) ?
  8664. jQuery( elem ).position()[ prop ] + "px" :
  8665. computed;
  8666. }
  8667. }
  8668. );
  8669. } );
  8670.  
  8671.  
  8672. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8673. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8674. jQuery.each( {
  8675. padding: "inner" + name,
  8676. content: type,
  8677. "": "outer" + name
  8678. }, function( defaultExtra, funcName ) {
  8679.  
  8680. // Margin is only for outerHeight, outerWidth
  8681. jQuery.fn[ funcName ] = function( margin, value ) {
  8682. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8683. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8684.  
  8685. return access( this, function( elem, type, value ) {
  8686. var doc;
  8687.  
  8688. if ( isWindow( elem ) ) {
  8689.  
  8690. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8691. return funcName.indexOf( "outer" ) === 0 ?
  8692. elem[ "inner" + name ] :
  8693. elem.document.documentElement[ "client" + name ];
  8694. }
  8695.  
  8696. // Get document width or height
  8697. if ( elem.nodeType === 9 ) {
  8698. doc = elem.documentElement;
  8699.  
  8700. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8701. // whichever is greatest
  8702. return Math.max(
  8703. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8704. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8705. doc[ "client" + name ]
  8706. );
  8707. }
  8708.  
  8709. return value === undefined ?
  8710.  
  8711. // Get width or height on the element, requesting but not forcing parseFloat
  8712. jQuery.css( elem, type, extra ) :
  8713.  
  8714. // Set width or height on the element
  8715. jQuery.style( elem, type, value, extra );
  8716. }, type, chainable ? margin : undefined, chainable );
  8717. };
  8718. } );
  8719. } );
  8720.  
  8721.  
  8722. jQuery.fn.extend( {
  8723.  
  8724. bind: function( types, data, fn ) {
  8725. return this.on( types, null, data, fn );
  8726. },
  8727. unbind: function( types, fn ) {
  8728. return this.off( types, null, fn );
  8729. },
  8730.  
  8731. delegate: function( selector, types, data, fn ) {
  8732. return this.on( types, selector, data, fn );
  8733. },
  8734. undelegate: function( selector, types, fn ) {
  8735.  
  8736. // ( namespace ) or ( selector, types [, fn] )
  8737. return arguments.length === 1 ?
  8738. this.off( selector, "**" ) :
  8739. this.off( types, selector || "**", fn );
  8740. },
  8741.  
  8742. hover: function( fnOver, fnOut ) {
  8743. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8744. }
  8745. } );
  8746.  
  8747. jQuery.each(
  8748. ( "blur focus focusin focusout resize scroll click dblclick " +
  8749. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8750. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8751. function( _i, name ) {
  8752.  
  8753. // Handle event binding
  8754. jQuery.fn[ name ] = function( data, fn ) {
  8755. return arguments.length > 0 ?
  8756. this.on( name, null, data, fn ) :
  8757. this.trigger( name );
  8758. };
  8759. }
  8760. );
  8761.  
  8762.  
  8763.  
  8764.  
  8765. // Support: Android <=4.0 only
  8766. // Make sure we trim BOM and NBSP
  8767. // Require that the "whitespace run" starts from a non-whitespace
  8768. // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
  8769. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  8770.  
  8771. // Bind a function to a context, optionally partially applying any
  8772. // arguments.
  8773. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8774. // However, it is not slated for removal any time soon
  8775. jQuery.proxy = function( fn, context ) {
  8776. var tmp, args, proxy;
  8777.  
  8778. if ( typeof context === "string" ) {
  8779. tmp = fn[ context ];
  8780. context = fn;
  8781. fn = tmp;
  8782. }
  8783.  
  8784. // Quick check to determine if target is callable, in the spec
  8785. // this throws a TypeError, but we will just return undefined.
  8786. if ( !isFunction( fn ) ) {
  8787. return undefined;
  8788. }
  8789.  
  8790. // Simulated bind
  8791. args = slice.call( arguments, 2 );
  8792. proxy = function() {
  8793. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8794. };
  8795.  
  8796. // Set the guid of unique handler to the same of original handler, so it can be removed
  8797. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8798.  
  8799. return proxy;
  8800. };
  8801.  
  8802. jQuery.holdReady = function( hold ) {
  8803. if ( hold ) {
  8804. jQuery.readyWait++;
  8805. } else {
  8806. jQuery.ready( true );
  8807. }
  8808. };
  8809. jQuery.isArray = Array.isArray;
  8810. jQuery.parseJSON = JSON.parse;
  8811. jQuery.nodeName = nodeName;
  8812. jQuery.isFunction = isFunction;
  8813. jQuery.isWindow = isWindow;
  8814. jQuery.camelCase = camelCase;
  8815. jQuery.type = toType;
  8816.  
  8817. jQuery.now = Date.now;
  8818.  
  8819. jQuery.isNumeric = function( obj ) {
  8820.  
  8821. // As of jQuery 3.0, isNumeric is limited to
  8822. // strings and numbers (primitives or objects)
  8823. // that can be coerced to finite numbers (gh-2662)
  8824. var type = jQuery.type( obj );
  8825. return ( type === "number" || type === "string" ) &&
  8826.  
  8827. // parseFloat NaNs numeric-cast false positives ("")
  8828. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8829. // subtraction forces infinities to NaN
  8830. !isNaN( obj - parseFloat( obj ) );
  8831. };
  8832.  
  8833. jQuery.trim = function( text ) {
  8834. return text == null ?
  8835. "" :
  8836. ( text + "" ).replace( rtrim, "$1" );
  8837. };
  8838.  
  8839.  
  8840.  
  8841. // Register as a named AMD module, since jQuery can be concatenated with other
  8842. // files that may use define, but not via a proper concatenation script that
  8843. // understands anonymous AMD modules. A named AMD is safest and most robust
  8844. // way to register. Lowercase jquery is used because AMD module names are
  8845. // derived from file names, and jQuery is normally delivered in a lowercase
  8846. // file name. Do this after creating the global so that if an AMD module wants
  8847. // to call noConflict to hide this version of jQuery, it will work.
  8848.  
  8849. // Note that for maximum portability, libraries that are not jQuery should
  8850. // declare themselves as anonymous modules, and avoid setting a global if an
  8851. // AMD loader is present. jQuery is a special case. For more information, see
  8852. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8853.  
  8854. if ( typeof define === "function" && define.amd ) {
  8855. define( "jquery", [], function() {
  8856. return jQuery;
  8857. } );
  8858. }
  8859.  
  8860.  
  8861.  
  8862.  
  8863. var
  8864.  
  8865. // Map over jQuery in case of overwrite
  8866. _jQuery = window.jQuery,
  8867.  
  8868. // Map over the $ in case of overwrite
  8869. _$ = window.$;
  8870.  
  8871. jQuery.noConflict = function( deep ) {
  8872. if ( window.$ === jQuery ) {
  8873. window.$ = _$;
  8874. }
  8875.  
  8876. if ( deep && window.jQuery === jQuery ) {
  8877. window.jQuery = _jQuery;
  8878. }
  8879.  
  8880. return jQuery;
  8881. };
  8882.  
  8883. // Expose jQuery and $ identifiers, even in AMD
  8884. // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8885. // and CommonJS for browser emulators (trac-13566)
  8886. if ( typeof noGlobal === "undefined" ) {
  8887. window.jQuery = window.$ = jQuery;
  8888. }
  8889.  
  8890.  
  8891.  
  8892.  
  8893. return jQuery;
  8894. } );