jquery-extras

Contains jQuery with a bunch of useful extras

As of 2015-08-30. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/12083/71248/jquery-extras.js

  1. // ==UserScript==
  2. // @name jquery-extras
  3. // @version 0.1.0
  4. // @description Contains jQuery with a bunch of useful extras
  5. // ==/UserScript==
  6.  
  7.  
  8. (function webpackUniversalModuleDefinition(root, factory) {
  9. if(typeof exports === 'object' && typeof module === 'object')
  10. module.exports = factory();
  11. else if(typeof define === 'function' && define.amd)
  12. define([], factory);
  13. else if(typeof exports === 'object')
  14. exports["$"] = factory();
  15. else
  16. root["$"] = factory();
  17. })(this, function() {
  18. return /******/ (function(modules) { // webpackBootstrap
  19. /******/ // The module cache
  20. /******/ var installedModules = {};
  21. /******/
  22. /******/ // The require function
  23. /******/ function __webpack_require__(moduleId) {
  24. /******/
  25. /******/ // Check if module is in cache
  26. /******/ if(installedModules[moduleId])
  27. /******/ return installedModules[moduleId].exports;
  28. /******/
  29. /******/ // Create a new module (and put it into the cache)
  30. /******/ var module = installedModules[moduleId] = {
  31. /******/ exports: {},
  32. /******/ id: moduleId,
  33. /******/ loaded: false
  34. /******/ };
  35. /******/
  36. /******/ // Execute the module function
  37. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  38. /******/
  39. /******/ // Flag the module as loaded
  40. /******/ module.loaded = true;
  41. /******/
  42. /******/ // Return the exports of the module
  43. /******/ return module.exports;
  44. /******/ }
  45. /******/
  46. /******/
  47. /******/ // expose the modules object (__webpack_modules__)
  48. /******/ __webpack_require__.m = modules;
  49. /******/
  50. /******/ // expose the module cache
  51. /******/ __webpack_require__.c = installedModules;
  52. /******/
  53. /******/ // __webpack_public_path__
  54. /******/ __webpack_require__.p = "http://localhost:9000/";
  55. /******/
  56. /******/ // Load entry module and return exports
  57. /******/ return __webpack_require__(0);
  58. /******/ })
  59. /************************************************************************/
  60. /******/ ([
  61. /* 0 */
  62. /*!***************************!*\
  63. !*** multi jquery-extras ***!
  64. \***************************/
  65. /***/ function(module, exports, __webpack_require__) {
  66.  
  67. module.exports = __webpack_require__(/*! ./entries/jquery */1);
  68.  
  69.  
  70. /***/ },
  71. /* 1 */
  72. /*!*********************************!*\
  73. !*** ./entries/jquery/index.js ***!
  74. \*********************************/
  75. /***/ function(module, exports, __webpack_require__) {
  76.  
  77. /* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';
  78. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 3)['default'];
  79. Object.defineProperty(exports, '__esModule', {
  80. value: true
  81. });
  82. var _jquery = __webpack_require__(/*! jquery */ 2);
  83. var _jquery2 = _interopRequireDefault(_jquery);
  84. __webpack_require__(/*! jquery-extras */ 4);
  85. var _webSelectorObserver = __webpack_require__(/*! web/selector-observer */ 6);
  86. var _webSelectorObserver2 = _interopRequireDefault(_webSelectorObserver);
  87. // ----------------------------------------------------------------------------
  88. HTMLDocument.prototype.observe = function (selector, onAdded, onRemoved) {
  89. return new _webSelectorObserver2['default']({
  90. selector: selector,
  91. onAdded: onAdded,
  92. onRemoved: onRemoved
  93. });
  94. };
  95. HTMLElement.prototype.observe = function (selector, onAdded, onRemoved) {
  96. return new _webSelectorObserver2['default']({
  97. selector: selector,
  98. onAdded: onAdded,
  99. onRemoved: onRemoved,
  100. targets: [this]
  101. });
  102. };
  103. jQuery.fn.observe = function (selector, onAdded, onRemoved) {
  104. this.data('observer', new _webSelectorObserver2['default']({
  105. selector: selector,
  106. onAdded: onAdded,
  107. onRemoved: onRemoved,
  108. targets: this.get(),
  109. debug: true
  110. }));
  111. return this;
  112. };
  113. // ----------------------------------------------------------------------------
  114.  
  115. exports['default'] = _jquery2['default'];
  116. module.exports = exports['default'];
  117. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! jquery */ 2)))
  118.  
  119. /***/ },
  120. /* 2 */
  121. /*!*********************************!*\
  122. !*** ./~/jquery/dist/jquery.js ***!
  123. \*********************************/
  124. /***/ function(module, exports, __webpack_require__) {
  125.  
  126. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  127. * jQuery JavaScript Library v2.1.4
  128. * http://jquery.com/
  129. *
  130. * Includes Sizzle.js
  131. * http://sizzlejs.com/
  132. *
  133. * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
  134. * Released under the MIT license
  135. * http://jquery.org/license
  136. *
  137. * Date: 2015-04-28T16:01Z
  138. */
  139. (function( global, factory ) {
  140. if ( typeof module === "object" && typeof module.exports === "object" ) {
  141. // For CommonJS and CommonJS-like environments where a proper `window`
  142. // is present, execute the factory and get jQuery.
  143. // For environments that do not have a `window` with a `document`
  144. // (such as Node.js), expose a factory as module.exports.
  145. // This accentuates the need for the creation of a real `window`.
  146. // e.g. var jQuery = require("jquery")(window);
  147. // See ticket #14549 for more info.
  148. module.exports = global.document ?
  149. factory( global, true ) :
  150. function( w ) {
  151. if ( !w.document ) {
  152. throw new Error( "jQuery requires a window with a document" );
  153. }
  154. return factory( w );
  155. };
  156. } else {
  157. factory( global );
  158. }
  159. // Pass this if window is not defined yet
  160. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  161. // Support: Firefox 18+
  162. // Can't be in strict mode, several libs including ASP.NET trace
  163. // the stack via arguments.caller.callee and Firefox dies if
  164. // you try to trace through "use strict" call chains. (#13335)
  165. //
  166. var arr = [];
  167. var slice = arr.slice;
  168. var concat = arr.concat;
  169. var push = arr.push;
  170. var indexOf = arr.indexOf;
  171. var class2type = {};
  172. var toString = class2type.toString;
  173. var hasOwn = class2type.hasOwnProperty;
  174. var support = {};
  175. var
  176. // Use the correct document accordingly with window argument (sandbox)
  177. document = window.document,
  178. version = "2.1.4",
  179. // Define a local copy of jQuery
  180. jQuery = function( selector, context ) {
  181. // The jQuery object is actually just the init constructor 'enhanced'
  182. // Need init if jQuery is called (just allow error to be thrown if not included)
  183. return new jQuery.fn.init( selector, context );
  184. },
  185. // Support: Android<4.1
  186. // Make sure we trim BOM and NBSP
  187. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  188. // Matches dashed string for camelizing
  189. rmsPrefix = /^-ms-/,
  190. rdashAlpha = /-([\da-z])/gi,
  191. // Used by jQuery.camelCase as callback to replace()
  192. fcamelCase = function( all, letter ) {
  193. return letter.toUpperCase();
  194. };
  195. jQuery.fn = jQuery.prototype = {
  196. // The current version of jQuery being used
  197. jquery: version,
  198. constructor: jQuery,
  199. // Start with an empty selector
  200. selector: "",
  201. // The default length of a jQuery object is 0
  202. length: 0,
  203. toArray: function() {
  204. return slice.call( this );
  205. },
  206. // Get the Nth element in the matched element set OR
  207. // Get the whole matched element set as a clean array
  208. get: function( num ) {
  209. return num != null ?
  210. // Return just the one element from the set
  211. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  212. // Return all the elements in a clean array
  213. slice.call( this );
  214. },
  215. // Take an array of elements and push it onto the stack
  216. // (returning the new matched element set)
  217. pushStack: function( elems ) {
  218. // Build a new jQuery matched element set
  219. var ret = jQuery.merge( this.constructor(), elems );
  220. // Add the old object onto the stack (as a reference)
  221. ret.prevObject = this;
  222. ret.context = this.context;
  223. // Return the newly-formed element set
  224. return ret;
  225. },
  226. // Execute a callback for every element in the matched set.
  227. // (You can seed the arguments with an array of args, but this is
  228. // only used internally.)
  229. each: function( callback, args ) {
  230. return jQuery.each( this, callback, args );
  231. },
  232. map: function( callback ) {
  233. return this.pushStack( jQuery.map(this, function( elem, i ) {
  234. return callback.call( elem, i, elem );
  235. }));
  236. },
  237. slice: function() {
  238. return this.pushStack( slice.apply( this, arguments ) );
  239. },
  240. first: function() {
  241. return this.eq( 0 );
  242. },
  243. last: function() {
  244. return this.eq( -1 );
  245. },
  246. eq: function( i ) {
  247. var len = this.length,
  248. j = +i + ( i < 0 ? len : 0 );
  249. return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
  250. },
  251. end: function() {
  252. return this.prevObject || this.constructor(null);
  253. },
  254. // For internal use only.
  255. // Behaves like an Array's method, not like a jQuery method.
  256. push: push,
  257. sort: arr.sort,
  258. splice: arr.splice
  259. };
  260. jQuery.extend = jQuery.fn.extend = function() {
  261. var options, name, src, copy, copyIsArray, clone,
  262. target = arguments[0] || {},
  263. i = 1,
  264. length = arguments.length,
  265. deep = false;
  266. // Handle a deep copy situation
  267. if ( typeof target === "boolean" ) {
  268. deep = target;
  269. // Skip the boolean and the target
  270. target = arguments[ i ] || {};
  271. i++;
  272. }
  273. // Handle case when target is a string or something (possible in deep copy)
  274. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  275. target = {};
  276. }
  277. // Extend jQuery itself if only one argument is passed
  278. if ( i === length ) {
  279. target = this;
  280. i--;
  281. }
  282. for ( ; i < length; i++ ) {
  283. // Only deal with non-null/undefined values
  284. if ( (options = arguments[ i ]) != null ) {
  285. // Extend the base object
  286. for ( name in options ) {
  287. src = target[ name ];
  288. copy = options[ name ];
  289. // Prevent never-ending loop
  290. if ( target === copy ) {
  291. continue;
  292. }
  293. // Recurse if we're merging plain objects or arrays
  294. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  295. if ( copyIsArray ) {
  296. copyIsArray = false;
  297. clone = src && jQuery.isArray(src) ? src : [];
  298. } else {
  299. clone = src && jQuery.isPlainObject(src) ? src : {};
  300. }
  301. // Never move original objects, clone them
  302. target[ name ] = jQuery.extend( deep, clone, copy );
  303. // Don't bring in undefined values
  304. } else if ( copy !== undefined ) {
  305. target[ name ] = copy;
  306. }
  307. }
  308. }
  309. }
  310. // Return the modified object
  311. return target;
  312. };
  313. jQuery.extend({
  314. // Unique for each copy of jQuery on the page
  315. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  316. // Assume jQuery is ready without the ready module
  317. isReady: true,
  318. error: function( msg ) {
  319. throw new Error( msg );
  320. },
  321. noop: function() {},
  322. isFunction: function( obj ) {
  323. return jQuery.type(obj) === "function";
  324. },
  325. isArray: Array.isArray,
  326. isWindow: function( obj ) {
  327. return obj != null && obj === obj.window;
  328. },
  329. isNumeric: function( obj ) {
  330. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  331. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  332. // subtraction forces infinities to NaN
  333. // adding 1 corrects loss of precision from parseFloat (#15100)
  334. return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
  335. },
  336. isPlainObject: function( obj ) {
  337. // Not plain objects:
  338. // - Any object or value whose internal [[Class]] property is not "[object Object]"
  339. // - DOM nodes
  340. // - window
  341. if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  342. return false;
  343. }
  344. if ( obj.constructor &&
  345. !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  346. return false;
  347. }
  348. // If the function hasn't returned already, we're confident that
  349. // |obj| is a plain object, created by {} or constructed with new Object
  350. return true;
  351. },
  352. isEmptyObject: function( obj ) {
  353. var name;
  354. for ( name in obj ) {
  355. return false;
  356. }
  357. return true;
  358. },
  359. type: function( obj ) {
  360. if ( obj == null ) {
  361. return obj + "";
  362. }
  363. // Support: Android<4.0, iOS<6 (functionish RegExp)
  364. return typeof obj === "object" || typeof obj === "function" ?
  365. class2type[ toString.call(obj) ] || "object" :
  366. typeof obj;
  367. },
  368. // Evaluates a script in a global context
  369. globalEval: function( code ) {
  370. var script,
  371. indirect = eval;
  372. code = jQuery.trim( code );
  373. if ( code ) {
  374. // If the code includes a valid, prologue position
  375. // strict mode pragma, execute code by injecting a
  376. // script tag into the document.
  377. if ( code.indexOf("use strict") === 1 ) {
  378. script = document.createElement("script");
  379. script.text = code;
  380. document.head.appendChild( script ).parentNode.removeChild( script );
  381. } else {
  382. // Otherwise, avoid the DOM node creation, insertion
  383. // and removal by using an indirect global eval
  384. indirect( code );
  385. }
  386. }
  387. },
  388. // Convert dashed to camelCase; used by the css and data modules
  389. // Support: IE9-11+
  390. // Microsoft forgot to hump their vendor prefix (#9572)
  391. camelCase: function( string ) {
  392. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  393. },
  394. nodeName: function( elem, name ) {
  395. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  396. },
  397. // args is for internal usage only
  398. each: function( obj, callback, args ) {
  399. var value,
  400. i = 0,
  401. length = obj.length,
  402. isArray = isArraylike( obj );
  403. if ( args ) {
  404. if ( isArray ) {
  405. for ( ; i < length; i++ ) {
  406. value = callback.apply( obj[ i ], args );
  407. if ( value === false ) {
  408. break;
  409. }
  410. }
  411. } else {
  412. for ( i in obj ) {
  413. value = callback.apply( obj[ i ], args );
  414. if ( value === false ) {
  415. break;
  416. }
  417. }
  418. }
  419. // A special, fast, case for the most common use of each
  420. } else {
  421. if ( isArray ) {
  422. for ( ; i < length; i++ ) {
  423. value = callback.call( obj[ i ], i, obj[ i ] );
  424. if ( value === false ) {
  425. break;
  426. }
  427. }
  428. } else {
  429. for ( i in obj ) {
  430. value = callback.call( obj[ i ], i, obj[ i ] );
  431. if ( value === false ) {
  432. break;
  433. }
  434. }
  435. }
  436. }
  437. return obj;
  438. },
  439. // Support: Android<4.1
  440. trim: function( text ) {
  441. return text == null ?
  442. "" :
  443. ( text + "" ).replace( rtrim, "" );
  444. },
  445. // results is for internal usage only
  446. makeArray: function( arr, results ) {
  447. var ret = results || [];
  448. if ( arr != null ) {
  449. if ( isArraylike( Object(arr) ) ) {
  450. jQuery.merge( ret,
  451. typeof arr === "string" ?
  452. [ arr ] : arr
  453. );
  454. } else {
  455. push.call( ret, arr );
  456. }
  457. }
  458. return ret;
  459. },
  460. inArray: function( elem, arr, i ) {
  461. return arr == null ? -1 : indexOf.call( arr, elem, i );
  462. },
  463. merge: function( first, second ) {
  464. var len = +second.length,
  465. j = 0,
  466. i = first.length;
  467. for ( ; j < len; j++ ) {
  468. first[ i++ ] = second[ j ];
  469. }
  470. first.length = i;
  471. return first;
  472. },
  473. grep: function( elems, callback, invert ) {
  474. var callbackInverse,
  475. matches = [],
  476. i = 0,
  477. length = elems.length,
  478. callbackExpect = !invert;
  479. // Go through the array, only saving the items
  480. // that pass the validator function
  481. for ( ; i < length; i++ ) {
  482. callbackInverse = !callback( elems[ i ], i );
  483. if ( callbackInverse !== callbackExpect ) {
  484. matches.push( elems[ i ] );
  485. }
  486. }
  487. return matches;
  488. },
  489. // arg is for internal usage only
  490. map: function( elems, callback, arg ) {
  491. var value,
  492. i = 0,
  493. length = elems.length,
  494. isArray = isArraylike( elems ),
  495. ret = [];
  496. // Go through the array, translating each of the items to their new values
  497. if ( isArray ) {
  498. for ( ; i < length; i++ ) {
  499. value = callback( elems[ i ], i, arg );
  500. if ( value != null ) {
  501. ret.push( value );
  502. }
  503. }
  504. // Go through every key on the object,
  505. } else {
  506. for ( i in elems ) {
  507. value = callback( elems[ i ], i, arg );
  508. if ( value != null ) {
  509. ret.push( value );
  510. }
  511. }
  512. }
  513. // Flatten any nested arrays
  514. return concat.apply( [], ret );
  515. },
  516. // A global GUID counter for objects
  517. guid: 1,
  518. // Bind a function to a context, optionally partially applying any
  519. // arguments.
  520. proxy: function( fn, context ) {
  521. var tmp, args, proxy;
  522. if ( typeof context === "string" ) {
  523. tmp = fn[ context ];
  524. context = fn;
  525. fn = tmp;
  526. }
  527. // Quick check to determine if target is callable, in the spec
  528. // this throws a TypeError, but we will just return undefined.
  529. if ( !jQuery.isFunction( fn ) ) {
  530. return undefined;
  531. }
  532. // Simulated bind
  533. args = slice.call( arguments, 2 );
  534. proxy = function() {
  535. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  536. };
  537. // Set the guid of unique handler to the same of original handler, so it can be removed
  538. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  539. return proxy;
  540. },
  541. now: Date.now,
  542. // jQuery.support is not used in Core but other projects attach their
  543. // properties to it so it needs to exist.
  544. support: support
  545. });
  546. // Populate the class2type map
  547. jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
  548. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  549. });
  550. function isArraylike( obj ) {
  551. // Support: iOS 8.2 (not reproducible in simulator)
  552. // `in` check used to prevent JIT error (gh-2145)
  553. // hasOwn isn't used here due to false negatives
  554. // regarding Nodelist length in IE
  555. var length = "length" in obj && obj.length,
  556. type = jQuery.type( obj );
  557. if ( type === "function" || jQuery.isWindow( obj ) ) {
  558. return false;
  559. }
  560. if ( obj.nodeType === 1 && length ) {
  561. return true;
  562. }
  563. return type === "array" || length === 0 ||
  564. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  565. }
  566. var Sizzle =
  567. /*!
  568. * Sizzle CSS Selector Engine v2.2.0-pre
  569. * http://sizzlejs.com/
  570. *
  571. * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
  572. * Released under the MIT license
  573. * http://jquery.org/license
  574. *
  575. * Date: 2014-12-16
  576. */
  577. (function( window ) {
  578. var i,
  579. support,
  580. Expr,
  581. getText,
  582. isXML,
  583. tokenize,
  584. compile,
  585. select,
  586. outermostContext,
  587. sortInput,
  588. hasDuplicate,
  589. // Local document vars
  590. setDocument,
  591. document,
  592. docElem,
  593. documentIsHTML,
  594. rbuggyQSA,
  595. rbuggyMatches,
  596. matches,
  597. contains,
  598. // Instance-specific data
  599. expando = "sizzle" + 1 * new Date(),
  600. preferredDoc = window.document,
  601. dirruns = 0,
  602. done = 0,
  603. classCache = createCache(),
  604. tokenCache = createCache(),
  605. compilerCache = createCache(),
  606. sortOrder = function( a, b ) {
  607. if ( a === b ) {
  608. hasDuplicate = true;
  609. }
  610. return 0;
  611. },
  612. // General-purpose constants
  613. MAX_NEGATIVE = 1 << 31,
  614. // Instance methods
  615. hasOwn = ({}).hasOwnProperty,
  616. arr = [],
  617. pop = arr.pop,
  618. push_native = arr.push,
  619. push = arr.push,
  620. slice = arr.slice,
  621. // Use a stripped-down indexOf as it's faster than native
  622. // http://jsperf.com/thor-indexof-vs-for/5
  623. indexOf = function( list, elem ) {
  624. var i = 0,
  625. len = list.length;
  626. for ( ; i < len; i++ ) {
  627. if ( list[i] === elem ) {
  628. return i;
  629. }
  630. }
  631. return -1;
  632. },
  633. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  634. // Regular expressions
  635. // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
  636. whitespace = "[\\x20\\t\\r\\n\\f]",
  637. // http://www.w3.org/TR/css3-syntax/#characters
  638. characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  639. // Loosely modeled on CSS identifier characters
  640. // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
  641. // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  642. identifier = characterEncoding.replace( "w", "w#" ),
  643. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  644. attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
  645. // Operator (capture 2)
  646. "*([*^$|!~]?=)" + whitespace +
  647. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  648. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  649. "*\\]",
  650. pseudos = ":(" + characterEncoding + ")(?:\\((" +
  651. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  652. // 1. quoted (capture 3; capture 4 or capture 5)
  653. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  654. // 2. simple (capture 6)
  655. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  656. // 3. anything else (capture 2)
  657. ".*" +
  658. ")\\)|)",
  659. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  660. rwhitespace = new RegExp( whitespace + "+", "g" ),
  661. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  662. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  663. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  664. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  665. rpseudo = new RegExp( pseudos ),
  666. ridentifier = new RegExp( "^" + identifier + "$" ),
  667. matchExpr = {
  668. "ID": new RegExp( "^#(" + characterEncoding + ")" ),
  669. "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
  670. "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
  671. "ATTR": new RegExp( "^" + attributes ),
  672. "PSEUDO": new RegExp( "^" + pseudos ),
  673. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  674. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  675. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  676. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  677. // For use in libraries implementing .is()
  678. // We use this for POS matching in `select`
  679. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  680. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  681. },
  682. rinputs = /^(?:input|select|textarea|button)$/i,
  683. rheader = /^h\d$/i,
  684. rnative = /^[^{]+\{\s*\[native \w/,
  685. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  686. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  687. rsibling = /[+~]/,
  688. rescape = /'|\\/g,
  689. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  690. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  691. funescape = function( _, escaped, escapedWhitespace ) {
  692. var high = "0x" + escaped - 0x10000;
  693. // NaN means non-codepoint
  694. // Support: Firefox<24
  695. // Workaround erroneous numeric interpretation of +"0x"
  696. return high !== high || escapedWhitespace ?
  697. escaped :
  698. high < 0 ?
  699. // BMP codepoint
  700. String.fromCharCode( high + 0x10000 ) :
  701. // Supplemental Plane codepoint (surrogate pair)
  702. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  703. },
  704. // Used for iframes
  705. // See setDocument()
  706. // Removing the function wrapper causes a "Permission Denied"
  707. // error in IE
  708. unloadHandler = function() {
  709. setDocument();
  710. };
  711. // Optimize for push.apply( _, NodeList )
  712. try {
  713. push.apply(
  714. (arr = slice.call( preferredDoc.childNodes )),
  715. preferredDoc.childNodes
  716. );
  717. // Support: Android<4.0
  718. // Detect silently failing push.apply
  719. arr[ preferredDoc.childNodes.length ].nodeType;
  720. } catch ( e ) {
  721. push = { apply: arr.length ?
  722. // Leverage slice if possible
  723. function( target, els ) {
  724. push_native.apply( target, slice.call(els) );
  725. } :
  726. // Support: IE<9
  727. // Otherwise append directly
  728. function( target, els ) {
  729. var j = target.length,
  730. i = 0;
  731. // Can't trust NodeList.length
  732. while ( (target[j++] = els[i++]) ) {}
  733. target.length = j - 1;
  734. }
  735. };
  736. }
  737. function Sizzle( selector, context, results, seed ) {
  738. var match, elem, m, nodeType,
  739. // QSA vars
  740. i, groups, old, nid, newContext, newSelector;
  741. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  742. setDocument( context );
  743. }
  744. context = context || document;
  745. results = results || [];
  746. nodeType = context.nodeType;
  747. if ( typeof selector !== "string" || !selector ||
  748. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  749. return results;
  750. }
  751. if ( !seed && documentIsHTML ) {
  752. // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
  753. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  754. // Speed-up: Sizzle("#ID")
  755. if ( (m = match[1]) ) {
  756. if ( nodeType === 9 ) {
  757. elem = context.getElementById( m );
  758. // Check parentNode to catch when Blackberry 4.6 returns
  759. // nodes that are no longer in the document (jQuery #6963)
  760. if ( elem && elem.parentNode ) {
  761. // Handle the case where IE, Opera, and Webkit return items
  762. // by name instead of ID
  763. if ( elem.id === m ) {
  764. results.push( elem );
  765. return results;
  766. }
  767. } else {
  768. return results;
  769. }
  770. } else {
  771. // Context is not a document
  772. if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
  773. contains( context, elem ) && elem.id === m ) {
  774. results.push( elem );
  775. return results;
  776. }
  777. }
  778. // Speed-up: Sizzle("TAG")
  779. } else if ( match[2] ) {
  780. push.apply( results, context.getElementsByTagName( selector ) );
  781. return results;
  782. // Speed-up: Sizzle(".CLASS")
  783. } else if ( (m = match[3]) && support.getElementsByClassName ) {
  784. push.apply( results, context.getElementsByClassName( m ) );
  785. return results;
  786. }
  787. }
  788. // QSA path
  789. if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  790. nid = old = expando;
  791. newContext = context;
  792. newSelector = nodeType !== 1 && selector;
  793. // qSA works strangely on Element-rooted queries
  794. // We can work around this by specifying an extra ID on the root
  795. // and working up from there (Thanks to Andrew Dupont for the technique)
  796. // IE 8 doesn't work on object elements
  797. if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  798. groups = tokenize( selector );
  799. if ( (old = context.getAttribute("id")) ) {
  800. nid = old.replace( rescape, "\\$&" );
  801. } else {
  802. context.setAttribute( "id", nid );
  803. }
  804. nid = "[id='" + nid + "'] ";
  805. i = groups.length;
  806. while ( i-- ) {
  807. groups[i] = nid + toSelector( groups[i] );
  808. }
  809. newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
  810. newSelector = groups.join(",");
  811. }
  812. if ( newSelector ) {
  813. try {
  814. push.apply( results,
  815. newContext.querySelectorAll( newSelector )
  816. );
  817. return results;
  818. } catch(qsaError) {
  819. } finally {
  820. if ( !old ) {
  821. context.removeAttribute("id");
  822. }
  823. }
  824. }
  825. }
  826. }
  827. // All others
  828. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  829. }
  830. /**
  831. * Create key-value caches of limited size
  832. * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
  833. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  834. * deleting the oldest entry
  835. */
  836. function createCache() {
  837. var keys = [];
  838. function cache( key, value ) {
  839. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  840. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  841. // Only keep the most recent entries
  842. delete cache[ keys.shift() ];
  843. }
  844. return (cache[ key + " " ] = value);
  845. }
  846. return cache;
  847. }
  848. /**
  849. * Mark a function for special use by Sizzle
  850. * @param {Function} fn The function to mark
  851. */
  852. function markFunction( fn ) {
  853. fn[ expando ] = true;
  854. return fn;
  855. }
  856. /**
  857. * Support testing using an element
  858. * @param {Function} fn Passed the created div and expects a boolean result
  859. */
  860. function assert( fn ) {
  861. var div = document.createElement("div");
  862. try {
  863. return !!fn( div );
  864. } catch (e) {
  865. return false;
  866. } finally {
  867. // Remove from its parent by default
  868. if ( div.parentNode ) {
  869. div.parentNode.removeChild( div );
  870. }
  871. // release memory in IE
  872. div = null;
  873. }
  874. }
  875. /**
  876. * Adds the same handler for all of the specified attrs
  877. * @param {String} attrs Pipe-separated list of attributes
  878. * @param {Function} handler The method that will be applied
  879. */
  880. function addHandle( attrs, handler ) {
  881. var arr = attrs.split("|"),
  882. i = attrs.length;
  883. while ( i-- ) {
  884. Expr.attrHandle[ arr[i] ] = handler;
  885. }
  886. }
  887. /**
  888. * Checks document order of two siblings
  889. * @param {Element} a
  890. * @param {Element} b
  891. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  892. */
  893. function siblingCheck( a, b ) {
  894. var cur = b && a,
  895. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  896. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  897. ( ~a.sourceIndex || MAX_NEGATIVE );
  898. // Use IE sourceIndex if available on both nodes
  899. if ( diff ) {
  900. return diff;
  901. }
  902. // Check if b follows a
  903. if ( cur ) {
  904. while ( (cur = cur.nextSibling) ) {
  905. if ( cur === b ) {
  906. return -1;
  907. }
  908. }
  909. }
  910. return a ? 1 : -1;
  911. }
  912. /**
  913. * Returns a function to use in pseudos for input types
  914. * @param {String} type
  915. */
  916. function createInputPseudo( type ) {
  917. return function( elem ) {
  918. var name = elem.nodeName.toLowerCase();
  919. return name === "input" && elem.type === type;
  920. };
  921. }
  922. /**
  923. * Returns a function to use in pseudos for buttons
  924. * @param {String} type
  925. */
  926. function createButtonPseudo( type ) {
  927. return function( elem ) {
  928. var name = elem.nodeName.toLowerCase();
  929. return (name === "input" || name === "button") && elem.type === type;
  930. };
  931. }
  932. /**
  933. * Returns a function to use in pseudos for positionals
  934. * @param {Function} fn
  935. */
  936. function createPositionalPseudo( fn ) {
  937. return markFunction(function( argument ) {
  938. argument = +argument;
  939. return markFunction(function( seed, matches ) {
  940. var j,
  941. matchIndexes = fn( [], seed.length, argument ),
  942. i = matchIndexes.length;
  943. // Match elements found at the specified indexes
  944. while ( i-- ) {
  945. if ( seed[ (j = matchIndexes[i]) ] ) {
  946. seed[j] = !(matches[j] = seed[j]);
  947. }
  948. }
  949. });
  950. });
  951. }
  952. /**
  953. * Checks a node for validity as a Sizzle context
  954. * @param {Element|Object=} context
  955. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  956. */
  957. function testContext( context ) {
  958. return context && typeof context.getElementsByTagName !== "undefined" && context;
  959. }
  960. // Expose support vars for convenience
  961. support = Sizzle.support = {};
  962. /**
  963. * Detects XML nodes
  964. * @param {Element|Object} elem An element or a document
  965. * @returns {Boolean} True iff elem is a non-HTML XML node
  966. */
  967. isXML = Sizzle.isXML = function( elem ) {
  968. // documentElement is verified for cases where it doesn't yet exist
  969. // (such as loading iframes in IE - #4833)
  970. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  971. return documentElement ? documentElement.nodeName !== "HTML" : false;
  972. };
  973. /**
  974. * Sets document-related variables once based on the current document
  975. * @param {Element|Object} [doc] An element or document object to use to set the document
  976. * @returns {Object} Returns the current document
  977. */
  978. setDocument = Sizzle.setDocument = function( node ) {
  979. var hasCompare, parent,
  980. doc = node ? node.ownerDocument || node : preferredDoc;
  981. // If no document and documentElement is available, return
  982. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  983. return document;
  984. }
  985. // Set our document
  986. document = doc;
  987. docElem = doc.documentElement;
  988. parent = doc.defaultView;
  989. // Support: IE>8
  990. // If iframe document is assigned to "document" variable and if iframe has been reloaded,
  991. // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
  992. // IE6-8 do not support the defaultView property so parent will be undefined
  993. if ( parent && parent !== parent.top ) {
  994. // IE11 does not have attachEvent, so all must suffer
  995. if ( parent.addEventListener ) {
  996. parent.addEventListener( "unload", unloadHandler, false );
  997. } else if ( parent.attachEvent ) {
  998. parent.attachEvent( "onunload", unloadHandler );
  999. }
  1000. }
  1001. /* Support tests
  1002. ---------------------------------------------------------------------- */
  1003. documentIsHTML = !isXML( doc );
  1004. /* Attributes
  1005. ---------------------------------------------------------------------- */
  1006. // Support: IE<8
  1007. // Verify that getAttribute really returns attributes and not properties
  1008. // (excepting IE8 booleans)
  1009. support.attributes = assert(function( div ) {
  1010. div.className = "i";
  1011. return !div.getAttribute("className");
  1012. });
  1013. /* getElement(s)By*
  1014. ---------------------------------------------------------------------- */
  1015. // Check if getElementsByTagName("*") returns only elements
  1016. support.getElementsByTagName = assert(function( div ) {
  1017. div.appendChild( doc.createComment("") );
  1018. return !div.getElementsByTagName("*").length;
  1019. });
  1020. // Support: IE<9
  1021. support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
  1022. // Support: IE<10
  1023. // Check if getElementById returns elements by name
  1024. // The broken getElementById methods don't pick up programatically-set names,
  1025. // so use a roundabout getElementsByName test
  1026. support.getById = assert(function( div ) {
  1027. docElem.appendChild( div ).id = expando;
  1028. return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
  1029. });
  1030. // ID find and filter
  1031. if ( support.getById ) {
  1032. Expr.find["ID"] = function( id, context ) {
  1033. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1034. var m = context.getElementById( id );
  1035. // Check parentNode to catch when Blackberry 4.6 returns
  1036. // nodes that are no longer in the document #6963
  1037. return m && m.parentNode ? [ m ] : [];
  1038. }
  1039. };
  1040. Expr.filter["ID"] = function( id ) {
  1041. var attrId = id.replace( runescape, funescape );
  1042. return function( elem ) {
  1043. return elem.getAttribute("id") === attrId;
  1044. };
  1045. };
  1046. } else {
  1047. // Support: IE6/7
  1048. // getElementById is not reliable as a find shortcut
  1049. delete Expr.find["ID"];
  1050. Expr.filter["ID"] = function( id ) {
  1051. var attrId = id.replace( runescape, funescape );
  1052. return function( elem ) {
  1053. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  1054. return node && node.value === attrId;
  1055. };
  1056. };
  1057. }
  1058. // Tag
  1059. Expr.find["TAG"] = support.getElementsByTagName ?
  1060. function( tag, context ) {
  1061. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1062. return context.getElementsByTagName( tag );
  1063. // DocumentFragment nodes don't have gEBTN
  1064. } else if ( support.qsa ) {
  1065. return context.querySelectorAll( tag );
  1066. }
  1067. } :
  1068. function( tag, context ) {
  1069. var elem,
  1070. tmp = [],
  1071. i = 0,
  1072. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1073. results = context.getElementsByTagName( tag );
  1074. // Filter out possible comments
  1075. if ( tag === "*" ) {
  1076. while ( (elem = results[i++]) ) {
  1077. if ( elem.nodeType === 1 ) {
  1078. tmp.push( elem );
  1079. }
  1080. }
  1081. return tmp;
  1082. }
  1083. return results;
  1084. };
  1085. // Class
  1086. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  1087. if ( documentIsHTML ) {
  1088. return context.getElementsByClassName( className );
  1089. }
  1090. };
  1091. /* QSA/matchesSelector
  1092. ---------------------------------------------------------------------- */
  1093. // QSA and matchesSelector support
  1094. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1095. rbuggyMatches = [];
  1096. // qSa(:focus) reports false when true (Chrome 21)
  1097. // We allow this because of a bug in IE8/9 that throws an error
  1098. // whenever `document.activeElement` is accessed on an iframe
  1099. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1100. // See http://bugs.jquery.com/ticket/13378
  1101. rbuggyQSA = [];
  1102. if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
  1103. // Build QSA regex
  1104. // Regex strategy adopted from Diego Perini
  1105. assert(function( div ) {
  1106. // Select is set to empty string on purpose
  1107. // This is to test IE's treatment of not explicitly
  1108. // setting a boolean content attribute,
  1109. // since its presence should be enough
  1110. // http://bugs.jquery.com/ticket/12359
  1111. docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
  1112. "<select id='" + expando + "-\f]' msallowcapture=''>" +
  1113. "<option selected=''></option></select>";
  1114. // Support: IE8, Opera 11-12.16
  1115. // Nothing should be selected when empty strings follow ^= or $= or *=
  1116. // The test attribute must be unknown in Opera but "safe" for WinRT
  1117. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1118. if ( div.querySelectorAll("[msallowcapture^='']").length ) {
  1119. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1120. }
  1121. // Support: IE8
  1122. // Boolean attributes and "value" are not treated correctly
  1123. if ( !div.querySelectorAll("[selected]").length ) {
  1124. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1125. }
  1126. // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
  1127. if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1128. rbuggyQSA.push("~=");
  1129. }
  1130. // Webkit/Opera - :checked should return selected option elements
  1131. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1132. // IE8 throws error here and will not see later tests
  1133. if ( !div.querySelectorAll(":checked").length ) {
  1134. rbuggyQSA.push(":checked");
  1135. }
  1136. // Support: Safari 8+, iOS 8+
  1137. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1138. // In-page `selector#id sibing-combinator selector` fails
  1139. if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1140. rbuggyQSA.push(".#.+[+~]");
  1141. }
  1142. });
  1143. assert(function( div ) {
  1144. // Support: Windows 8 Native Apps
  1145. // The type and name attributes are restricted during .innerHTML assignment
  1146. var input = doc.createElement("input");
  1147. input.setAttribute( "type", "hidden" );
  1148. div.appendChild( input ).setAttribute( "name", "D" );
  1149. // Support: IE8
  1150. // Enforce case-sensitivity of name attribute
  1151. if ( div.querySelectorAll("[name=d]").length ) {
  1152. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1153. }
  1154. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1155. // IE8 throws error here and will not see later tests
  1156. if ( !div.querySelectorAll(":enabled").length ) {
  1157. rbuggyQSA.push( ":enabled", ":disabled" );
  1158. }
  1159. // Opera 10-11 does not throw on post-comma invalid pseudos
  1160. div.querySelectorAll("*,:x");
  1161. rbuggyQSA.push(",.*:");
  1162. });
  1163. }
  1164. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1165. docElem.webkitMatchesSelector ||
  1166. docElem.mozMatchesSelector ||
  1167. docElem.oMatchesSelector ||
  1168. docElem.msMatchesSelector) )) ) {
  1169. assert(function( div ) {
  1170. // Check to see if it's possible to do matchesSelector
  1171. // on a disconnected node (IE 9)
  1172. support.disconnectedMatch = matches.call( div, "div" );
  1173. // This should fail with an exception
  1174. // Gecko does not error, returns false instead
  1175. matches.call( div, "[s!='']:x" );
  1176. rbuggyMatches.push( "!=", pseudos );
  1177. });
  1178. }
  1179. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1180. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1181. /* Contains
  1182. ---------------------------------------------------------------------- */
  1183. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1184. // Element contains another
  1185. // Purposefully does not implement inclusive descendent
  1186. // As in, an element does not contain itself
  1187. contains = hasCompare || rnative.test( docElem.contains ) ?
  1188. function( a, b ) {
  1189. var adown = a.nodeType === 9 ? a.documentElement : a,
  1190. bup = b && b.parentNode;
  1191. return a === bup || !!( bup && bup.nodeType === 1 && (
  1192. adown.contains ?
  1193. adown.contains( bup ) :
  1194. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1195. ));
  1196. } :
  1197. function( a, b ) {
  1198. if ( b ) {
  1199. while ( (b = b.parentNode) ) {
  1200. if ( b === a ) {
  1201. return true;
  1202. }
  1203. }
  1204. }
  1205. return false;
  1206. };
  1207. /* Sorting
  1208. ---------------------------------------------------------------------- */
  1209. // Document order sorting
  1210. sortOrder = hasCompare ?
  1211. function( a, b ) {
  1212. // Flag for duplicate removal
  1213. if ( a === b ) {
  1214. hasDuplicate = true;
  1215. return 0;
  1216. }
  1217. // Sort on method existence if only one input has compareDocumentPosition
  1218. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1219. if ( compare ) {
  1220. return compare;
  1221. }
  1222. // Calculate position if both inputs belong to the same document
  1223. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1224. a.compareDocumentPosition( b ) :
  1225. // Otherwise we know they are disconnected
  1226. 1;
  1227. // Disconnected nodes
  1228. if ( compare & 1 ||
  1229. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1230. // Choose the first element that is related to our preferred document
  1231. if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1232. return -1;
  1233. }
  1234. if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1235. return 1;
  1236. }
  1237. // Maintain original order
  1238. return sortInput ?
  1239. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1240. 0;
  1241. }
  1242. return compare & 4 ? -1 : 1;
  1243. } :
  1244. function( a, b ) {
  1245. // Exit early if the nodes are identical
  1246. if ( a === b ) {
  1247. hasDuplicate = true;
  1248. return 0;
  1249. }
  1250. var cur,
  1251. i = 0,
  1252. aup = a.parentNode,
  1253. bup = b.parentNode,
  1254. ap = [ a ],
  1255. bp = [ b ];
  1256. // Parentless nodes are either documents or disconnected
  1257. if ( !aup || !bup ) {
  1258. return a === doc ? -1 :
  1259. b === doc ? 1 :
  1260. aup ? -1 :
  1261. bup ? 1 :
  1262. sortInput ?
  1263. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1264. 0;
  1265. // If the nodes are siblings, we can do a quick check
  1266. } else if ( aup === bup ) {
  1267. return siblingCheck( a, b );
  1268. }
  1269. // Otherwise we need full lists of their ancestors for comparison
  1270. cur = a;
  1271. while ( (cur = cur.parentNode) ) {
  1272. ap.unshift( cur );
  1273. }
  1274. cur = b;
  1275. while ( (cur = cur.parentNode) ) {
  1276. bp.unshift( cur );
  1277. }
  1278. // Walk down the tree looking for a discrepancy
  1279. while ( ap[i] === bp[i] ) {
  1280. i++;
  1281. }
  1282. return i ?
  1283. // Do a sibling check if the nodes have a common ancestor
  1284. siblingCheck( ap[i], bp[i] ) :
  1285. // Otherwise nodes in our document sort first
  1286. ap[i] === preferredDoc ? -1 :
  1287. bp[i] === preferredDoc ? 1 :
  1288. 0;
  1289. };
  1290. return doc;
  1291. };
  1292. Sizzle.matches = function( expr, elements ) {
  1293. return Sizzle( expr, null, null, elements );
  1294. };
  1295. Sizzle.matchesSelector = function( elem, expr ) {
  1296. // Set document vars if needed
  1297. if ( ( elem.ownerDocument || elem ) !== document ) {
  1298. setDocument( elem );
  1299. }
  1300. // Make sure that attribute selectors are quoted
  1301. expr = expr.replace( rattributeQuotes, "='$1']" );
  1302. if ( support.matchesSelector && documentIsHTML &&
  1303. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1304. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1305. try {
  1306. var ret = matches.call( elem, expr );
  1307. // IE 9's matchesSelector returns false on disconnected nodes
  1308. if ( ret || support.disconnectedMatch ||
  1309. // As well, disconnected nodes are said to be in a document
  1310. // fragment in IE 9
  1311. elem.document && elem.document.nodeType !== 11 ) {
  1312. return ret;
  1313. }
  1314. } catch (e) {}
  1315. }
  1316. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1317. };
  1318. Sizzle.contains = function( context, elem ) {
  1319. // Set document vars if needed
  1320. if ( ( context.ownerDocument || context ) !== document ) {
  1321. setDocument( context );
  1322. }
  1323. return contains( context, elem );
  1324. };
  1325. Sizzle.attr = function( elem, name ) {
  1326. // Set document vars if needed
  1327. if ( ( elem.ownerDocument || elem ) !== document ) {
  1328. setDocument( elem );
  1329. }
  1330. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1331. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1332. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1333. fn( elem, name, !documentIsHTML ) :
  1334. undefined;
  1335. return val !== undefined ?
  1336. val :
  1337. support.attributes || !documentIsHTML ?
  1338. elem.getAttribute( name ) :
  1339. (val = elem.getAttributeNode(name)) && val.specified ?
  1340. val.value :
  1341. null;
  1342. };
  1343. Sizzle.error = function( msg ) {
  1344. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1345. };
  1346. /**
  1347. * Document sorting and removing duplicates
  1348. * @param {ArrayLike} results
  1349. */
  1350. Sizzle.uniqueSort = function( results ) {
  1351. var elem,
  1352. duplicates = [],
  1353. j = 0,
  1354. i = 0;
  1355. // Unless we *know* we can detect duplicates, assume their presence
  1356. hasDuplicate = !support.detectDuplicates;
  1357. sortInput = !support.sortStable && results.slice( 0 );
  1358. results.sort( sortOrder );
  1359. if ( hasDuplicate ) {
  1360. while ( (elem = results[i++]) ) {
  1361. if ( elem === results[ i ] ) {
  1362. j = duplicates.push( i );
  1363. }
  1364. }
  1365. while ( j-- ) {
  1366. results.splice( duplicates[ j ], 1 );
  1367. }
  1368. }
  1369. // Clear input after sorting to release objects
  1370. // See https://github.com/jquery/sizzle/pull/225
  1371. sortInput = null;
  1372. return results;
  1373. };
  1374. /**
  1375. * Utility function for retrieving the text value of an array of DOM nodes
  1376. * @param {Array|Element} elem
  1377. */
  1378. getText = Sizzle.getText = function( elem ) {
  1379. var node,
  1380. ret = "",
  1381. i = 0,
  1382. nodeType = elem.nodeType;
  1383. if ( !nodeType ) {
  1384. // If no nodeType, this is expected to be an array
  1385. while ( (node = elem[i++]) ) {
  1386. // Do not traverse comment nodes
  1387. ret += getText( node );
  1388. }
  1389. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1390. // Use textContent for elements
  1391. // innerText usage removed for consistency of new lines (jQuery #11153)
  1392. if ( typeof elem.textContent === "string" ) {
  1393. return elem.textContent;
  1394. } else {
  1395. // Traverse its children
  1396. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1397. ret += getText( elem );
  1398. }
  1399. }
  1400. } else if ( nodeType === 3 || nodeType === 4 ) {
  1401. return elem.nodeValue;
  1402. }
  1403. // Do not include comment or processing instruction nodes
  1404. return ret;
  1405. };
  1406. Expr = Sizzle.selectors = {
  1407. // Can be adjusted by the user
  1408. cacheLength: 50,
  1409. createPseudo: markFunction,
  1410. match: matchExpr,
  1411. attrHandle: {},
  1412. find: {},
  1413. relative: {
  1414. ">": { dir: "parentNode", first: true },
  1415. " ": { dir: "parentNode" },
  1416. "+": { dir: "previousSibling", first: true },
  1417. "~": { dir: "previousSibling" }
  1418. },
  1419. preFilter: {
  1420. "ATTR": function( match ) {
  1421. match[1] = match[1].replace( runescape, funescape );
  1422. // Move the given value to match[3] whether quoted or unquoted
  1423. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1424. if ( match[2] === "~=" ) {
  1425. match[3] = " " + match[3] + " ";
  1426. }
  1427. return match.slice( 0, 4 );
  1428. },
  1429. "CHILD": function( match ) {
  1430. /* matches from matchExpr["CHILD"]
  1431. 1 type (only|nth|...)
  1432. 2 what (child|of-type)
  1433. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1434. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1435. 5 sign of xn-component
  1436. 6 x of xn-component
  1437. 7 sign of y-component
  1438. 8 y of y-component
  1439. */
  1440. match[1] = match[1].toLowerCase();
  1441. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1442. // nth-* requires argument
  1443. if ( !match[3] ) {
  1444. Sizzle.error( match[0] );
  1445. }
  1446. // numeric x and y parameters for Expr.filter.CHILD
  1447. // remember that false/true cast respectively to 0/1
  1448. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1449. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1450. // other types prohibit arguments
  1451. } else if ( match[3] ) {
  1452. Sizzle.error( match[0] );
  1453. }
  1454. return match;
  1455. },
  1456. "PSEUDO": function( match ) {
  1457. var excess,
  1458. unquoted = !match[6] && match[2];
  1459. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1460. return null;
  1461. }
  1462. // Accept quoted arguments as-is
  1463. if ( match[3] ) {
  1464. match[2] = match[4] || match[5] || "";
  1465. // Strip excess characters from unquoted arguments
  1466. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1467. // Get excess from tokenize (recursively)
  1468. (excess = tokenize( unquoted, true )) &&
  1469. // advance to the next closing parenthesis
  1470. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1471. // excess is a negative index
  1472. match[0] = match[0].slice( 0, excess );
  1473. match[2] = unquoted.slice( 0, excess );
  1474. }
  1475. // Return only captures needed by the pseudo filter method (type and argument)
  1476. return match.slice( 0, 3 );
  1477. }
  1478. },
  1479. filter: {
  1480. "TAG": function( nodeNameSelector ) {
  1481. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1482. return nodeNameSelector === "*" ?
  1483. function() { return true; } :
  1484. function( elem ) {
  1485. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1486. };
  1487. },
  1488. "CLASS": function( className ) {
  1489. var pattern = classCache[ className + " " ];
  1490. return pattern ||
  1491. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1492. classCache( className, function( elem ) {
  1493. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  1494. });
  1495. },
  1496. "ATTR": function( name, operator, check ) {
  1497. return function( elem ) {
  1498. var result = Sizzle.attr( elem, name );
  1499. if ( result == null ) {
  1500. return operator === "!=";
  1501. }
  1502. if ( !operator ) {
  1503. return true;
  1504. }
  1505. result += "";
  1506. return operator === "=" ? result === check :
  1507. operator === "!=" ? result !== check :
  1508. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1509. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1510. operator === "$=" ? check && result.slice( -check.length ) === check :
  1511. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1512. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1513. false;
  1514. };
  1515. },
  1516. "CHILD": function( type, what, argument, first, last ) {
  1517. var simple = type.slice( 0, 3 ) !== "nth",
  1518. forward = type.slice( -4 ) !== "last",
  1519. ofType = what === "of-type";
  1520. return first === 1 && last === 0 ?
  1521. // Shortcut for :nth-*(n)
  1522. function( elem ) {
  1523. return !!elem.parentNode;
  1524. } :
  1525. function( elem, context, xml ) {
  1526. var cache, outerCache, node, diff, nodeIndex, start,
  1527. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1528. parent = elem.parentNode,
  1529. name = ofType && elem.nodeName.toLowerCase(),
  1530. useCache = !xml && !ofType;
  1531. if ( parent ) {
  1532. // :(first|last|only)-(child|of-type)
  1533. if ( simple ) {
  1534. while ( dir ) {
  1535. node = elem;
  1536. while ( (node = node[ dir ]) ) {
  1537. if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
  1538. return false;
  1539. }
  1540. }
  1541. // Reverse direction for :only-* (if we haven't yet done so)
  1542. start = dir = type === "only" && !start && "nextSibling";
  1543. }
  1544. return true;
  1545. }
  1546. start = [ forward ? parent.firstChild : parent.lastChild ];
  1547. // non-xml :nth-child(...) stores cache data on `parent`
  1548. if ( forward && useCache ) {
  1549. // Seek `elem` from a previously-cached index
  1550. outerCache = parent[ expando ] || (parent[ expando ] = {});
  1551. cache = outerCache[ type ] || [];
  1552. nodeIndex = cache[0] === dirruns && cache[1];
  1553. diff = cache[0] === dirruns && cache[2];
  1554. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1555. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1556. // Fallback to seeking `elem` from the start
  1557. (diff = nodeIndex = 0) || start.pop()) ) {
  1558. // When found, cache indexes on `parent` and break
  1559. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1560. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1561. break;
  1562. }
  1563. }
  1564. // Use previously-cached element index if available
  1565. } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
  1566. diff = cache[1];
  1567. // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1568. } else {
  1569. // Use the same loop as above to seek `elem` from the start
  1570. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1571. (diff = nodeIndex = 0) || start.pop()) ) {
  1572. if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
  1573. // Cache the index of each encountered element
  1574. if ( useCache ) {
  1575. (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
  1576. }
  1577. if ( node === elem ) {
  1578. break;
  1579. }
  1580. }
  1581. }
  1582. }
  1583. // Incorporate the offset, then check against cycle size
  1584. diff -= last;
  1585. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1586. }
  1587. };
  1588. },
  1589. "PSEUDO": function( pseudo, argument ) {
  1590. // pseudo-class names are case-insensitive
  1591. // http://www.w3.org/TR/selectors/#pseudo-classes
  1592. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1593. // Remember that setFilters inherits from pseudos
  1594. var args,
  1595. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1596. Sizzle.error( "unsupported pseudo: " + pseudo );
  1597. // The user may use createPseudo to indicate that
  1598. // arguments are needed to create the filter function
  1599. // just as Sizzle does
  1600. if ( fn[ expando ] ) {
  1601. return fn( argument );
  1602. }
  1603. // But maintain support for old signatures
  1604. if ( fn.length > 1 ) {
  1605. args = [ pseudo, pseudo, "", argument ];
  1606. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1607. markFunction(function( seed, matches ) {
  1608. var idx,
  1609. matched = fn( seed, argument ),
  1610. i = matched.length;
  1611. while ( i-- ) {
  1612. idx = indexOf( seed, matched[i] );
  1613. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1614. }
  1615. }) :
  1616. function( elem ) {
  1617. return fn( elem, 0, args );
  1618. };
  1619. }
  1620. return fn;
  1621. }
  1622. },
  1623. pseudos: {
  1624. // Potentially complex pseudos
  1625. "not": markFunction(function( selector ) {
  1626. // Trim the selector passed to compile
  1627. // to avoid treating leading and trailing
  1628. // spaces as combinators
  1629. var input = [],
  1630. results = [],
  1631. matcher = compile( selector.replace( rtrim, "$1" ) );
  1632. return matcher[ expando ] ?
  1633. markFunction(function( seed, matches, context, xml ) {
  1634. var elem,
  1635. unmatched = matcher( seed, null, xml, [] ),
  1636. i = seed.length;
  1637. // Match elements unmatched by `matcher`
  1638. while ( i-- ) {
  1639. if ( (elem = unmatched[i]) ) {
  1640. seed[i] = !(matches[i] = elem);
  1641. }
  1642. }
  1643. }) :
  1644. function( elem, context, xml ) {
  1645. input[0] = elem;
  1646. matcher( input, null, xml, results );
  1647. // Don't keep the element (issue #299)
  1648. input[0] = null;
  1649. return !results.pop();
  1650. };
  1651. }),
  1652. "has": markFunction(function( selector ) {
  1653. return function( elem ) {
  1654. return Sizzle( selector, elem ).length > 0;
  1655. };
  1656. }),
  1657. "contains": markFunction(function( text ) {
  1658. text = text.replace( runescape, funescape );
  1659. return function( elem ) {
  1660. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1661. };
  1662. }),
  1663. // "Whether an element is represented by a :lang() selector
  1664. // is based solely on the element's language value
  1665. // being equal to the identifier C,
  1666. // or beginning with the identifier C immediately followed by "-".
  1667. // The matching of C against the element's language value is performed case-insensitively.
  1668. // The identifier C does not have to be a valid language name."
  1669. // http://www.w3.org/TR/selectors/#lang-pseudo
  1670. "lang": markFunction( function( lang ) {
  1671. // lang value must be a valid identifier
  1672. if ( !ridentifier.test(lang || "") ) {
  1673. Sizzle.error( "unsupported lang: " + lang );
  1674. }
  1675. lang = lang.replace( runescape, funescape ).toLowerCase();
  1676. return function( elem ) {
  1677. var elemLang;
  1678. do {
  1679. if ( (elemLang = documentIsHTML ?
  1680. elem.lang :
  1681. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1682. elemLang = elemLang.toLowerCase();
  1683. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1684. }
  1685. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1686. return false;
  1687. };
  1688. }),
  1689. // Miscellaneous
  1690. "target": function( elem ) {
  1691. var hash = window.location && window.location.hash;
  1692. return hash && hash.slice( 1 ) === elem.id;
  1693. },
  1694. "root": function( elem ) {
  1695. return elem === docElem;
  1696. },
  1697. "focus": function( elem ) {
  1698. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1699. },
  1700. // Boolean properties
  1701. "enabled": function( elem ) {
  1702. return elem.disabled === false;
  1703. },
  1704. "disabled": function( elem ) {
  1705. return elem.disabled === true;
  1706. },
  1707. "checked": function( elem ) {
  1708. // In CSS3, :checked should return both checked and selected elements
  1709. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1710. var nodeName = elem.nodeName.toLowerCase();
  1711. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1712. },
  1713. "selected": function( elem ) {
  1714. // Accessing this property makes selected-by-default
  1715. // options in Safari work properly
  1716. if ( elem.parentNode ) {
  1717. elem.parentNode.selectedIndex;
  1718. }
  1719. return elem.selected === true;
  1720. },
  1721. // Contents
  1722. "empty": function( elem ) {
  1723. // http://www.w3.org/TR/selectors/#empty-pseudo
  1724. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1725. // but not by others (comment: 8; processing instruction: 7; etc.)
  1726. // nodeType < 6 works because attributes (2) do not appear as children
  1727. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1728. if ( elem.nodeType < 6 ) {
  1729. return false;
  1730. }
  1731. }
  1732. return true;
  1733. },
  1734. "parent": function( elem ) {
  1735. return !Expr.pseudos["empty"]( elem );
  1736. },
  1737. // Element/input types
  1738. "header": function( elem ) {
  1739. return rheader.test( elem.nodeName );
  1740. },
  1741. "input": function( elem ) {
  1742. return rinputs.test( elem.nodeName );
  1743. },
  1744. "button": function( elem ) {
  1745. var name = elem.nodeName.toLowerCase();
  1746. return name === "input" && elem.type === "button" || name === "button";
  1747. },
  1748. "text": function( elem ) {
  1749. var attr;
  1750. return elem.nodeName.toLowerCase() === "input" &&
  1751. elem.type === "text" &&
  1752. // Support: IE<8
  1753. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1754. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1755. },
  1756. // Position-in-collection
  1757. "first": createPositionalPseudo(function() {
  1758. return [ 0 ];
  1759. }),
  1760. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1761. return [ length - 1 ];
  1762. }),
  1763. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1764. return [ argument < 0 ? argument + length : argument ];
  1765. }),
  1766. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1767. var i = 0;
  1768. for ( ; i < length; i += 2 ) {
  1769. matchIndexes.push( i );
  1770. }
  1771. return matchIndexes;
  1772. }),
  1773. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1774. var i = 1;
  1775. for ( ; i < length; i += 2 ) {
  1776. matchIndexes.push( i );
  1777. }
  1778. return matchIndexes;
  1779. }),
  1780. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1781. var i = argument < 0 ? argument + length : argument;
  1782. for ( ; --i >= 0; ) {
  1783. matchIndexes.push( i );
  1784. }
  1785. return matchIndexes;
  1786. }),
  1787. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1788. var i = argument < 0 ? argument + length : argument;
  1789. for ( ; ++i < length; ) {
  1790. matchIndexes.push( i );
  1791. }
  1792. return matchIndexes;
  1793. })
  1794. }
  1795. };
  1796. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1797. // Add button/input type pseudos
  1798. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1799. Expr.pseudos[ i ] = createInputPseudo( i );
  1800. }
  1801. for ( i in { submit: true, reset: true } ) {
  1802. Expr.pseudos[ i ] = createButtonPseudo( i );
  1803. }
  1804. // Easy API for creating new setFilters
  1805. function setFilters() {}
  1806. setFilters.prototype = Expr.filters = Expr.pseudos;
  1807. Expr.setFilters = new setFilters();
  1808. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1809. var matched, match, tokens, type,
  1810. soFar, groups, preFilters,
  1811. cached = tokenCache[ selector + " " ];
  1812. if ( cached ) {
  1813. return parseOnly ? 0 : cached.slice( 0 );
  1814. }
  1815. soFar = selector;
  1816. groups = [];
  1817. preFilters = Expr.preFilter;
  1818. while ( soFar ) {
  1819. // Comma and first run
  1820. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1821. if ( match ) {
  1822. // Don't consume trailing commas as valid
  1823. soFar = soFar.slice( match[0].length ) || soFar;
  1824. }
  1825. groups.push( (tokens = []) );
  1826. }
  1827. matched = false;
  1828. // Combinators
  1829. if ( (match = rcombinators.exec( soFar )) ) {
  1830. matched = match.shift();
  1831. tokens.push({
  1832. value: matched,
  1833. // Cast descendant combinators to space
  1834. type: match[0].replace( rtrim, " " )
  1835. });
  1836. soFar = soFar.slice( matched.length );
  1837. }
  1838. // Filters
  1839. for ( type in Expr.filter ) {
  1840. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1841. (match = preFilters[ type ]( match ))) ) {
  1842. matched = match.shift();
  1843. tokens.push({
  1844. value: matched,
  1845. type: type,
  1846. matches: match
  1847. });
  1848. soFar = soFar.slice( matched.length );
  1849. }
  1850. }
  1851. if ( !matched ) {
  1852. break;
  1853. }
  1854. }
  1855. // Return the length of the invalid excess
  1856. // if we're just parsing
  1857. // Otherwise, throw an error or return tokens
  1858. return parseOnly ?
  1859. soFar.length :
  1860. soFar ?
  1861. Sizzle.error( selector ) :
  1862. // Cache the tokens
  1863. tokenCache( selector, groups ).slice( 0 );
  1864. };
  1865. function toSelector( tokens ) {
  1866. var i = 0,
  1867. len = tokens.length,
  1868. selector = "";
  1869. for ( ; i < len; i++ ) {
  1870. selector += tokens[i].value;
  1871. }
  1872. return selector;
  1873. }
  1874. function addCombinator( matcher, combinator, base ) {
  1875. var dir = combinator.dir,
  1876. checkNonElements = base && dir === "parentNode",
  1877. doneName = done++;
  1878. return combinator.first ?
  1879. // Check against closest ancestor/preceding element
  1880. function( elem, context, xml ) {
  1881. while ( (elem = elem[ dir ]) ) {
  1882. if ( elem.nodeType === 1 || checkNonElements ) {
  1883. return matcher( elem, context, xml );
  1884. }
  1885. }
  1886. } :
  1887. // Check against all ancestor/preceding elements
  1888. function( elem, context, xml ) {
  1889. var oldCache, outerCache,
  1890. newCache = [ dirruns, doneName ];
  1891. // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
  1892. if ( xml ) {
  1893. while ( (elem = elem[ dir ]) ) {
  1894. if ( elem.nodeType === 1 || checkNonElements ) {
  1895. if ( matcher( elem, context, xml ) ) {
  1896. return true;
  1897. }
  1898. }
  1899. }
  1900. } else {
  1901. while ( (elem = elem[ dir ]) ) {
  1902. if ( elem.nodeType === 1 || checkNonElements ) {
  1903. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1904. if ( (oldCache = outerCache[ dir ]) &&
  1905. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1906. // Assign to newCache so results back-propagate to previous elements
  1907. return (newCache[ 2 ] = oldCache[ 2 ]);
  1908. } else {
  1909. // Reuse newcache so results back-propagate to previous elements
  1910. outerCache[ dir ] = newCache;
  1911. // A match means we're done; a fail means we have to keep checking
  1912. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  1913. return true;
  1914. }
  1915. }
  1916. }
  1917. }
  1918. }
  1919. };
  1920. }
  1921. function elementMatcher( matchers ) {
  1922. return matchers.length > 1 ?
  1923. function( elem, context, xml ) {
  1924. var i = matchers.length;
  1925. while ( i-- ) {
  1926. if ( !matchers[i]( elem, context, xml ) ) {
  1927. return false;
  1928. }
  1929. }
  1930. return true;
  1931. } :
  1932. matchers[0];
  1933. }
  1934. function multipleContexts( selector, contexts, results ) {
  1935. var i = 0,
  1936. len = contexts.length;
  1937. for ( ; i < len; i++ ) {
  1938. Sizzle( selector, contexts[i], results );
  1939. }
  1940. return results;
  1941. }
  1942. function condense( unmatched, map, filter, context, xml ) {
  1943. var elem,
  1944. newUnmatched = [],
  1945. i = 0,
  1946. len = unmatched.length,
  1947. mapped = map != null;
  1948. for ( ; i < len; i++ ) {
  1949. if ( (elem = unmatched[i]) ) {
  1950. if ( !filter || filter( elem, context, xml ) ) {
  1951. newUnmatched.push( elem );
  1952. if ( mapped ) {
  1953. map.push( i );
  1954. }
  1955. }
  1956. }
  1957. }
  1958. return newUnmatched;
  1959. }
  1960. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1961. if ( postFilter && !postFilter[ expando ] ) {
  1962. postFilter = setMatcher( postFilter );
  1963. }
  1964. if ( postFinder && !postFinder[ expando ] ) {
  1965. postFinder = setMatcher( postFinder, postSelector );
  1966. }
  1967. return markFunction(function( seed, results, context, xml ) {
  1968. var temp, i, elem,
  1969. preMap = [],
  1970. postMap = [],
  1971. preexisting = results.length,
  1972. // Get initial elements from seed or context
  1973. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  1974. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1975. matcherIn = preFilter && ( seed || !selector ) ?
  1976. condense( elems, preMap, preFilter, context, xml ) :
  1977. elems,
  1978. matcherOut = matcher ?
  1979. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  1980. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1981. // ...intermediate processing is necessary
  1982. [] :
  1983. // ...otherwise use results directly
  1984. results :
  1985. matcherIn;
  1986. // Find primary matches
  1987. if ( matcher ) {
  1988. matcher( matcherIn, matcherOut, context, xml );
  1989. }
  1990. // Apply postFilter
  1991. if ( postFilter ) {
  1992. temp = condense( matcherOut, postMap );
  1993. postFilter( temp, [], context, xml );
  1994. // Un-match failing elements by moving them back to matcherIn
  1995. i = temp.length;
  1996. while ( i-- ) {
  1997. if ( (elem = temp[i]) ) {
  1998. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  1999. }
  2000. }
  2001. }
  2002. if ( seed ) {
  2003. if ( postFinder || preFilter ) {
  2004. if ( postFinder ) {
  2005. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2006. temp = [];
  2007. i = matcherOut.length;
  2008. while ( i-- ) {
  2009. if ( (elem = matcherOut[i]) ) {
  2010. // Restore matcherIn since elem is not yet a final match
  2011. temp.push( (matcherIn[i] = elem) );
  2012. }
  2013. }
  2014. postFinder( null, (matcherOut = []), temp, xml );
  2015. }
  2016. // Move matched elements from seed to results to keep them synchronized
  2017. i = matcherOut.length;
  2018. while ( i-- ) {
  2019. if ( (elem = matcherOut[i]) &&
  2020. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  2021. seed[temp] = !(results[temp] = elem);
  2022. }
  2023. }
  2024. }
  2025. // Add elements to results, through postFinder if defined
  2026. } else {
  2027. matcherOut = condense(
  2028. matcherOut === results ?
  2029. matcherOut.splice( preexisting, matcherOut.length ) :
  2030. matcherOut
  2031. );
  2032. if ( postFinder ) {
  2033. postFinder( null, results, matcherOut, xml );
  2034. } else {
  2035. push.apply( results, matcherOut );
  2036. }
  2037. }
  2038. });
  2039. }
  2040. function matcherFromTokens( tokens ) {
  2041. var checkContext, matcher, j,
  2042. len = tokens.length,
  2043. leadingRelative = Expr.relative[ tokens[0].type ],
  2044. implicitRelative = leadingRelative || Expr.relative[" "],
  2045. i = leadingRelative ? 1 : 0,
  2046. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2047. matchContext = addCombinator( function( elem ) {
  2048. return elem === checkContext;
  2049. }, implicitRelative, true ),
  2050. matchAnyContext = addCombinator( function( elem ) {
  2051. return indexOf( checkContext, elem ) > -1;
  2052. }, implicitRelative, true ),
  2053. matchers = [ function( elem, context, xml ) {
  2054. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2055. (checkContext = context).nodeType ?
  2056. matchContext( elem, context, xml ) :
  2057. matchAnyContext( elem, context, xml ) );
  2058. // Avoid hanging onto element (issue #299)
  2059. checkContext = null;
  2060. return ret;
  2061. } ];
  2062. for ( ; i < len; i++ ) {
  2063. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  2064. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  2065. } else {
  2066. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  2067. // Return special upon seeing a positional matcher
  2068. if ( matcher[ expando ] ) {
  2069. // Find the next relative operator (if any) for proper handling
  2070. j = ++i;
  2071. for ( ; j < len; j++ ) {
  2072. if ( Expr.relative[ tokens[j].type ] ) {
  2073. break;
  2074. }
  2075. }
  2076. return setMatcher(
  2077. i > 1 && elementMatcher( matchers ),
  2078. i > 1 && toSelector(
  2079. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2080. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  2081. ).replace( rtrim, "$1" ),
  2082. matcher,
  2083. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2084. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  2085. j < len && toSelector( tokens )
  2086. );
  2087. }
  2088. matchers.push( matcher );
  2089. }
  2090. }
  2091. return elementMatcher( matchers );
  2092. }
  2093. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2094. var bySet = setMatchers.length > 0,
  2095. byElement = elementMatchers.length > 0,
  2096. superMatcher = function( seed, context, xml, results, outermost ) {
  2097. var elem, j, matcher,
  2098. matchedCount = 0,
  2099. i = "0",
  2100. unmatched = seed && [],
  2101. setMatched = [],
  2102. contextBackup = outermostContext,
  2103. // We must always have either seed elements or outermost context
  2104. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  2105. // Use integer dirruns iff this is the outermost matcher
  2106. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  2107. len = elems.length;
  2108. if ( outermost ) {
  2109. outermostContext = context !== document && context;
  2110. }
  2111. // Add elements passing elementMatchers directly to results
  2112. // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
  2113. // Support: IE<9, Safari
  2114. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2115. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  2116. if ( byElement && elem ) {
  2117. j = 0;
  2118. while ( (matcher = elementMatchers[j++]) ) {
  2119. if ( matcher( elem, context, xml ) ) {
  2120. results.push( elem );
  2121. break;
  2122. }
  2123. }
  2124. if ( outermost ) {
  2125. dirruns = dirrunsUnique;
  2126. }
  2127. }
  2128. // Track unmatched elements for set filters
  2129. if ( bySet ) {
  2130. // They will have gone through all possible matchers
  2131. if ( (elem = !matcher && elem) ) {
  2132. matchedCount--;
  2133. }
  2134. // Lengthen the array for every element, matched or not
  2135. if ( seed ) {
  2136. unmatched.push( elem );
  2137. }
  2138. }
  2139. }
  2140. // Apply set filters to unmatched elements
  2141. matchedCount += i;
  2142. if ( bySet && i !== matchedCount ) {
  2143. j = 0;
  2144. while ( (matcher = setMatchers[j++]) ) {
  2145. matcher( unmatched, setMatched, context, xml );
  2146. }
  2147. if ( seed ) {
  2148. // Reintegrate element matches to eliminate the need for sorting
  2149. if ( matchedCount > 0 ) {
  2150. while ( i-- ) {
  2151. if ( !(unmatched[i] || setMatched[i]) ) {
  2152. setMatched[i] = pop.call( results );
  2153. }
  2154. }
  2155. }
  2156. // Discard index placeholder values to get only actual matches
  2157. setMatched = condense( setMatched );
  2158. }
  2159. // Add matches to results
  2160. push.apply( results, setMatched );
  2161. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2162. if ( outermost && !seed && setMatched.length > 0 &&
  2163. ( matchedCount + setMatchers.length ) > 1 ) {
  2164. Sizzle.uniqueSort( results );
  2165. }
  2166. }
  2167. // Override manipulation of globals by nested matchers
  2168. if ( outermost ) {
  2169. dirruns = dirrunsUnique;
  2170. outermostContext = contextBackup;
  2171. }
  2172. return unmatched;
  2173. };
  2174. return bySet ?
  2175. markFunction( superMatcher ) :
  2176. superMatcher;
  2177. }
  2178. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2179. var i,
  2180. setMatchers = [],
  2181. elementMatchers = [],
  2182. cached = compilerCache[ selector + " " ];
  2183. if ( !cached ) {
  2184. // Generate a function of recursive functions that can be used to check each element
  2185. if ( !match ) {
  2186. match = tokenize( selector );
  2187. }
  2188. i = match.length;
  2189. while ( i-- ) {
  2190. cached = matcherFromTokens( match[i] );
  2191. if ( cached[ expando ] ) {
  2192. setMatchers.push( cached );
  2193. } else {
  2194. elementMatchers.push( cached );
  2195. }
  2196. }
  2197. // Cache the compiled function
  2198. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2199. // Save selector and tokenization
  2200. cached.selector = selector;
  2201. }
  2202. return cached;
  2203. };
  2204. /**
  2205. * A low-level selection function that works with Sizzle's compiled
  2206. * selector functions
  2207. * @param {String|Function} selector A selector or a pre-compiled
  2208. * selector function built with Sizzle.compile
  2209. * @param {Element} context
  2210. * @param {Array} [results]
  2211. * @param {Array} [seed] A set of elements to match against
  2212. */
  2213. select = Sizzle.select = function( selector, context, results, seed ) {
  2214. var i, tokens, token, type, find,
  2215. compiled = typeof selector === "function" && selector,
  2216. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2217. results = results || [];
  2218. // Try to minimize operations if there is no seed and only one group
  2219. if ( match.length === 1 ) {
  2220. // Take a shortcut and set the context if the root selector is an ID
  2221. tokens = match[0] = match[0].slice( 0 );
  2222. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2223. support.getById && context.nodeType === 9 && documentIsHTML &&
  2224. Expr.relative[ tokens[1].type ] ) {
  2225. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2226. if ( !context ) {
  2227. return results;
  2228. // Precompiled matchers will still verify ancestry, so step up a level
  2229. } else if ( compiled ) {
  2230. context = context.parentNode;
  2231. }
  2232. selector = selector.slice( tokens.shift().value.length );
  2233. }
  2234. // Fetch a seed set for right-to-left matching
  2235. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2236. while ( i-- ) {
  2237. token = tokens[i];
  2238. // Abort if we hit a combinator
  2239. if ( Expr.relative[ (type = token.type) ] ) {
  2240. break;
  2241. }
  2242. if ( (find = Expr.find[ type ]) ) {
  2243. // Search, expanding context for leading sibling combinators
  2244. if ( (seed = find(
  2245. token.matches[0].replace( runescape, funescape ),
  2246. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2247. )) ) {
  2248. // If seed is empty or no tokens remain, we can return early
  2249. tokens.splice( i, 1 );
  2250. selector = seed.length && toSelector( tokens );
  2251. if ( !selector ) {
  2252. push.apply( results, seed );
  2253. return results;
  2254. }
  2255. break;
  2256. }
  2257. }
  2258. }
  2259. }
  2260. // Compile and execute a filtering function if one is not provided
  2261. // Provide `match` to avoid retokenization if we modified the selector above
  2262. ( compiled || compile( selector, match ) )(
  2263. seed,
  2264. context,
  2265. !documentIsHTML,
  2266. results,
  2267. rsibling.test( selector ) && testContext( context.parentNode ) || context
  2268. );
  2269. return results;
  2270. };
  2271. // One-time assignments
  2272. // Sort stability
  2273. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2274. // Support: Chrome 14-35+
  2275. // Always assume duplicates if they aren't passed to the comparison function
  2276. support.detectDuplicates = !!hasDuplicate;
  2277. // Initialize against the default document
  2278. setDocument();
  2279. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2280. // Detached nodes confoundingly follow *each other*
  2281. support.sortDetached = assert(function( div1 ) {
  2282. // Should return 1, but returns 4 (following)
  2283. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  2284. });
  2285. // Support: IE<8
  2286. // Prevent attribute/property "interpolation"
  2287. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2288. if ( !assert(function( div ) {
  2289. div.innerHTML = "<a href='#'></a>";
  2290. return div.firstChild.getAttribute("href") === "#" ;
  2291. }) ) {
  2292. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2293. if ( !isXML ) {
  2294. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2295. }
  2296. });
  2297. }
  2298. // Support: IE<9
  2299. // Use defaultValue in place of getAttribute("value")
  2300. if ( !support.attributes || !assert(function( div ) {
  2301. div.innerHTML = "<input/>";
  2302. div.firstChild.setAttribute( "value", "" );
  2303. return div.firstChild.getAttribute( "value" ) === "";
  2304. }) ) {
  2305. addHandle( "value", function( elem, name, isXML ) {
  2306. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2307. return elem.defaultValue;
  2308. }
  2309. });
  2310. }
  2311. // Support: IE<9
  2312. // Use getAttributeNode to fetch booleans when getAttribute lies
  2313. if ( !assert(function( div ) {
  2314. return div.getAttribute("disabled") == null;
  2315. }) ) {
  2316. addHandle( booleans, function( elem, name, isXML ) {
  2317. var val;
  2318. if ( !isXML ) {
  2319. return elem[ name ] === true ? name.toLowerCase() :
  2320. (val = elem.getAttributeNode( name )) && val.specified ?
  2321. val.value :
  2322. null;
  2323. }
  2324. });
  2325. }
  2326. return Sizzle;
  2327. })( window );
  2328. jQuery.find = Sizzle;
  2329. jQuery.expr = Sizzle.selectors;
  2330. jQuery.expr[":"] = jQuery.expr.pseudos;
  2331. jQuery.unique = Sizzle.uniqueSort;
  2332. jQuery.text = Sizzle.getText;
  2333. jQuery.isXMLDoc = Sizzle.isXML;
  2334. jQuery.contains = Sizzle.contains;
  2335. var rneedsContext = jQuery.expr.match.needsContext;
  2336. var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
  2337. var risSimple = /^.[^:#\[\.,]*$/;
  2338. // Implement the identical functionality for filter and not
  2339. function winnow( elements, qualifier, not ) {
  2340. if ( jQuery.isFunction( qualifier ) ) {
  2341. return jQuery.grep( elements, function( elem, i ) {
  2342. /* jshint -W018 */
  2343. return !!qualifier.call( elem, i, elem ) !== not;
  2344. });
  2345. }
  2346. if ( qualifier.nodeType ) {
  2347. return jQuery.grep( elements, function( elem ) {
  2348. return ( elem === qualifier ) !== not;
  2349. });
  2350. }
  2351. if ( typeof qualifier === "string" ) {
  2352. if ( risSimple.test( qualifier ) ) {
  2353. return jQuery.filter( qualifier, elements, not );
  2354. }
  2355. qualifier = jQuery.filter( qualifier, elements );
  2356. }
  2357. return jQuery.grep( elements, function( elem ) {
  2358. return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
  2359. });
  2360. }
  2361. jQuery.filter = function( expr, elems, not ) {
  2362. var elem = elems[ 0 ];
  2363. if ( not ) {
  2364. expr = ":not(" + expr + ")";
  2365. }
  2366. return elems.length === 1 && elem.nodeType === 1 ?
  2367. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  2368. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2369. return elem.nodeType === 1;
  2370. }));
  2371. };
  2372. jQuery.fn.extend({
  2373. find: function( selector ) {
  2374. var i,
  2375. len = this.length,
  2376. ret = [],
  2377. self = this;
  2378. if ( typeof selector !== "string" ) {
  2379. return this.pushStack( jQuery( selector ).filter(function() {
  2380. for ( i = 0; i < len; i++ ) {
  2381. if ( jQuery.contains( self[ i ], this ) ) {
  2382. return true;
  2383. }
  2384. }
  2385. }) );
  2386. }
  2387. for ( i = 0; i < len; i++ ) {
  2388. jQuery.find( selector, self[ i ], ret );
  2389. }
  2390. // Needed because $( selector, context ) becomes $( context ).find( selector )
  2391. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  2392. ret.selector = this.selector ? this.selector + " " + selector : selector;
  2393. return ret;
  2394. },
  2395. filter: function( selector ) {
  2396. return this.pushStack( winnow(this, selector || [], false) );
  2397. },
  2398. not: function( selector ) {
  2399. return this.pushStack( winnow(this, selector || [], true) );
  2400. },
  2401. is: function( selector ) {
  2402. return !!winnow(
  2403. this,
  2404. // If this is a positional/relative selector, check membership in the returned set
  2405. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2406. typeof selector === "string" && rneedsContext.test( selector ) ?
  2407. jQuery( selector ) :
  2408. selector || [],
  2409. false
  2410. ).length;
  2411. }
  2412. });
  2413. // Initialize a jQuery object
  2414. // A central reference to the root jQuery(document)
  2415. var rootjQuery,
  2416. // A simple way to check for HTML strings
  2417. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2418. // Strict HTML recognition (#11290: must start with <)
  2419. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  2420. init = jQuery.fn.init = function( selector, context ) {
  2421. var match, elem;
  2422. // HANDLE: $(""), $(null), $(undefined), $(false)
  2423. if ( !selector ) {
  2424. return this;
  2425. }
  2426. // Handle HTML strings
  2427. if ( typeof selector === "string" ) {
  2428. if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
  2429. // Assume that strings that start and end with <> are HTML and skip the regex check
  2430. match = [ null, selector, null ];
  2431. } else {
  2432. match = rquickExpr.exec( selector );
  2433. }
  2434. // Match html or make sure no context is specified for #id
  2435. if ( match && (match[1] || !context) ) {
  2436. // HANDLE: $(html) -> $(array)
  2437. if ( match[1] ) {
  2438. context = context instanceof jQuery ? context[0] : context;
  2439. // Option to run scripts is true for back-compat
  2440. // Intentionally let the error be thrown if parseHTML is not present
  2441. jQuery.merge( this, jQuery.parseHTML(
  2442. match[1],
  2443. context && context.nodeType ? context.ownerDocument || context : document,
  2444. true
  2445. ) );
  2446. // HANDLE: $(html, props)
  2447. if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
  2448. for ( match in context ) {
  2449. // Properties of context are called as methods if possible
  2450. if ( jQuery.isFunction( this[ match ] ) ) {
  2451. this[ match ]( context[ match ] );
  2452. // ...and otherwise set as attributes
  2453. } else {
  2454. this.attr( match, context[ match ] );
  2455. }
  2456. }
  2457. }
  2458. return this;
  2459. // HANDLE: $(#id)
  2460. } else {
  2461. elem = document.getElementById( match[2] );
  2462. // Support: Blackberry 4.6
  2463. // gEBID returns nodes no longer in the document (#6963)
  2464. if ( elem && elem.parentNode ) {
  2465. // Inject the element directly into the jQuery object
  2466. this.length = 1;
  2467. this[0] = elem;
  2468. }
  2469. this.context = document;
  2470. this.selector = selector;
  2471. return this;
  2472. }
  2473. // HANDLE: $(expr, $(...))
  2474. } else if ( !context || context.jquery ) {
  2475. return ( context || rootjQuery ).find( selector );
  2476. // HANDLE: $(expr, context)
  2477. // (which is just equivalent to: $(context).find(expr)
  2478. } else {
  2479. return this.constructor( context ).find( selector );
  2480. }
  2481. // HANDLE: $(DOMElement)
  2482. } else if ( selector.nodeType ) {
  2483. this.context = this[0] = selector;
  2484. this.length = 1;
  2485. return this;
  2486. // HANDLE: $(function)
  2487. // Shortcut for document ready
  2488. } else if ( jQuery.isFunction( selector ) ) {
  2489. return typeof rootjQuery.ready !== "undefined" ?
  2490. rootjQuery.ready( selector ) :
  2491. // Execute immediately if ready is not present
  2492. selector( jQuery );
  2493. }
  2494. if ( selector.selector !== undefined ) {
  2495. this.selector = selector.selector;
  2496. this.context = selector.context;
  2497. }
  2498. return jQuery.makeArray( selector, this );
  2499. };
  2500. // Give the init function the jQuery prototype for later instantiation
  2501. init.prototype = jQuery.fn;
  2502. // Initialize central reference
  2503. rootjQuery = jQuery( document );
  2504. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2505. // Methods guaranteed to produce a unique set when starting from a unique set
  2506. guaranteedUnique = {
  2507. children: true,
  2508. contents: true,
  2509. next: true,
  2510. prev: true
  2511. };
  2512. jQuery.extend({
  2513. dir: function( elem, dir, until ) {
  2514. var matched = [],
  2515. truncate = until !== undefined;
  2516. while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
  2517. if ( elem.nodeType === 1 ) {
  2518. if ( truncate && jQuery( elem ).is( until ) ) {
  2519. break;
  2520. }
  2521. matched.push( elem );
  2522. }
  2523. }
  2524. return matched;
  2525. },
  2526. sibling: function( n, elem ) {
  2527. var matched = [];
  2528. for ( ; n; n = n.nextSibling ) {
  2529. if ( n.nodeType === 1 && n !== elem ) {
  2530. matched.push( n );
  2531. }
  2532. }
  2533. return matched;
  2534. }
  2535. });
  2536. jQuery.fn.extend({
  2537. has: function( target ) {
  2538. var targets = jQuery( target, this ),
  2539. l = targets.length;
  2540. return this.filter(function() {
  2541. var i = 0;
  2542. for ( ; i < l; i++ ) {
  2543. if ( jQuery.contains( this, targets[i] ) ) {
  2544. return true;
  2545. }
  2546. }
  2547. });
  2548. },
  2549. closest: function( selectors, context ) {
  2550. var cur,
  2551. i = 0,
  2552. l = this.length,
  2553. matched = [],
  2554. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  2555. jQuery( selectors, context || this.context ) :
  2556. 0;
  2557. for ( ; i < l; i++ ) {
  2558. for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
  2559. // Always skip document fragments
  2560. if ( cur.nodeType < 11 && (pos ?
  2561. pos.index(cur) > -1 :
  2562. // Don't pass non-elements to Sizzle
  2563. cur.nodeType === 1 &&
  2564. jQuery.find.matchesSelector(cur, selectors)) ) {
  2565. matched.push( cur );
  2566. break;
  2567. }
  2568. }
  2569. }
  2570. return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
  2571. },
  2572. // Determine the position of an element within the set
  2573. index: function( elem ) {
  2574. // No argument, return index in parent
  2575. if ( !elem ) {
  2576. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2577. }
  2578. // Index in selector
  2579. if ( typeof elem === "string" ) {
  2580. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2581. }
  2582. // Locate the position of the desired element
  2583. return indexOf.call( this,
  2584. // If it receives a jQuery object, the first element is used
  2585. elem.jquery ? elem[ 0 ] : elem
  2586. );
  2587. },
  2588. add: function( selector, context ) {
  2589. return this.pushStack(
  2590. jQuery.unique(
  2591. jQuery.merge( this.get(), jQuery( selector, context ) )
  2592. )
  2593. );
  2594. },
  2595. addBack: function( selector ) {
  2596. return this.add( selector == null ?
  2597. this.prevObject : this.prevObject.filter(selector)
  2598. );
  2599. }
  2600. });
  2601. function sibling( cur, dir ) {
  2602. while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
  2603. return cur;
  2604. }
  2605. jQuery.each({
  2606. parent: function( elem ) {
  2607. var parent = elem.parentNode;
  2608. return parent && parent.nodeType !== 11 ? parent : null;
  2609. },
  2610. parents: function( elem ) {
  2611. return jQuery.dir( elem, "parentNode" );
  2612. },
  2613. parentsUntil: function( elem, i, until ) {
  2614. return jQuery.dir( elem, "parentNode", until );
  2615. },
  2616. next: function( elem ) {
  2617. return sibling( elem, "nextSibling" );
  2618. },
  2619. prev: function( elem ) {
  2620. return sibling( elem, "previousSibling" );
  2621. },
  2622. nextAll: function( elem ) {
  2623. return jQuery.dir( elem, "nextSibling" );
  2624. },
  2625. prevAll: function( elem ) {
  2626. return jQuery.dir( elem, "previousSibling" );
  2627. },
  2628. nextUntil: function( elem, i, until ) {
  2629. return jQuery.dir( elem, "nextSibling", until );
  2630. },
  2631. prevUntil: function( elem, i, until ) {
  2632. return jQuery.dir( elem, "previousSibling", until );
  2633. },
  2634. siblings: function( elem ) {
  2635. return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
  2636. },
  2637. children: function( elem ) {
  2638. return jQuery.sibling( elem.firstChild );
  2639. },
  2640. contents: function( elem ) {
  2641. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  2642. }
  2643. }, function( name, fn ) {
  2644. jQuery.fn[ name ] = function( until, selector ) {
  2645. var matched = jQuery.map( this, fn, until );
  2646. if ( name.slice( -5 ) !== "Until" ) {
  2647. selector = until;
  2648. }
  2649. if ( selector && typeof selector === "string" ) {
  2650. matched = jQuery.filter( selector, matched );
  2651. }
  2652. if ( this.length > 1 ) {
  2653. // Remove duplicates
  2654. if ( !guaranteedUnique[ name ] ) {
  2655. jQuery.unique( matched );
  2656. }
  2657. // Reverse order for parents* and prev-derivatives
  2658. if ( rparentsprev.test( name ) ) {
  2659. matched.reverse();
  2660. }
  2661. }
  2662. return this.pushStack( matched );
  2663. };
  2664. });
  2665. var rnotwhite = (/\S+/g);
  2666. // String to Object options format cache
  2667. var optionsCache = {};
  2668. // Convert String-formatted options into Object-formatted ones and store in cache
  2669. function createOptions( options ) {
  2670. var object = optionsCache[ options ] = {};
  2671. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  2672. object[ flag ] = true;
  2673. });
  2674. return object;
  2675. }
  2676. /*
  2677. * Create a callback list using the following parameters:
  2678. *
  2679. * options: an optional list of space-separated options that will change how
  2680. * the callback list behaves or a more traditional option object
  2681. *
  2682. * By default a callback list will act like an event callback list and can be
  2683. * "fired" multiple times.
  2684. *
  2685. * Possible options:
  2686. *
  2687. * once: will ensure the callback list can only be fired once (like a Deferred)
  2688. *
  2689. * memory: will keep track of previous values and will call any callback added
  2690. * after the list has been fired right away with the latest "memorized"
  2691. * values (like a Deferred)
  2692. *
  2693. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2694. *
  2695. * stopOnFalse: interrupt callings when a callback returns false
  2696. *
  2697. */
  2698. jQuery.Callbacks = function( options ) {
  2699. // Convert options from String-formatted to Object-formatted if needed
  2700. // (we check in cache first)
  2701. options = typeof options === "string" ?
  2702. ( optionsCache[ options ] || createOptions( options ) ) :
  2703. jQuery.extend( {}, options );
  2704. var // Last fire value (for non-forgettable lists)
  2705. memory,
  2706. // Flag to know if list was already fired
  2707. fired,
  2708. // Flag to know if list is currently firing
  2709. firing,
  2710. // First callback to fire (used internally by add and fireWith)
  2711. firingStart,
  2712. // End of the loop when firing
  2713. firingLength,
  2714. // Index of currently firing callback (modified by remove if needed)
  2715. firingIndex,
  2716. // Actual callback list
  2717. list = [],
  2718. // Stack of fire calls for repeatable lists
  2719. stack = !options.once && [],
  2720. // Fire callbacks
  2721. fire = function( data ) {
  2722. memory = options.memory && data;
  2723. fired = true;
  2724. firingIndex = firingStart || 0;
  2725. firingStart = 0;
  2726. firingLength = list.length;
  2727. firing = true;
  2728. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  2729. if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
  2730. memory = false; // To prevent further calls using add
  2731. break;
  2732. }
  2733. }
  2734. firing = false;
  2735. if ( list ) {
  2736. if ( stack ) {
  2737. if ( stack.length ) {
  2738. fire( stack.shift() );
  2739. }
  2740. } else if ( memory ) {
  2741. list = [];
  2742. } else {
  2743. self.disable();
  2744. }
  2745. }
  2746. },
  2747. // Actual Callbacks object
  2748. self = {
  2749. // Add a callback or a collection of callbacks to the list
  2750. add: function() {
  2751. if ( list ) {
  2752. // First, we save the current length
  2753. var start = list.length;
  2754. (function add( args ) {
  2755. jQuery.each( args, function( _, arg ) {
  2756. var type = jQuery.type( arg );
  2757. if ( type === "function" ) {
  2758. if ( !options.unique || !self.has( arg ) ) {
  2759. list.push( arg );
  2760. }
  2761. } else if ( arg && arg.length && type !== "string" ) {
  2762. // Inspect recursively
  2763. add( arg );
  2764. }
  2765. });
  2766. })( arguments );
  2767. // Do we need to add the callbacks to the
  2768. // current firing batch?
  2769. if ( firing ) {
  2770. firingLength = list.length;
  2771. // With memory, if we're not firing then
  2772. // we should call right away
  2773. } else if ( memory ) {
  2774. firingStart = start;
  2775. fire( memory );
  2776. }
  2777. }
  2778. return this;
  2779. },
  2780. // Remove a callback from the list
  2781. remove: function() {
  2782. if ( list ) {
  2783. jQuery.each( arguments, function( _, arg ) {
  2784. var index;
  2785. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2786. list.splice( index, 1 );
  2787. // Handle firing indexes
  2788. if ( firing ) {
  2789. if ( index <= firingLength ) {
  2790. firingLength--;
  2791. }
  2792. if ( index <= firingIndex ) {
  2793. firingIndex--;
  2794. }
  2795. }
  2796. }
  2797. });
  2798. }
  2799. return this;
  2800. },
  2801. // Check if a given callback is in the list.
  2802. // If no argument is given, return whether or not list has callbacks attached.
  2803. has: function( fn ) {
  2804. return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
  2805. },
  2806. // Remove all callbacks from the list
  2807. empty: function() {
  2808. list = [];
  2809. firingLength = 0;
  2810. return this;
  2811. },
  2812. // Have the list do nothing anymore
  2813. disable: function() {
  2814. list = stack = memory = undefined;
  2815. return this;
  2816. },
  2817. // Is it disabled?
  2818. disabled: function() {
  2819. return !list;
  2820. },
  2821. // Lock the list in its current state
  2822. lock: function() {
  2823. stack = undefined;
  2824. if ( !memory ) {
  2825. self.disable();
  2826. }
  2827. return this;
  2828. },
  2829. // Is it locked?
  2830. locked: function() {
  2831. return !stack;
  2832. },
  2833. // Call all callbacks with the given context and arguments
  2834. fireWith: function( context, args ) {
  2835. if ( list && ( !fired || stack ) ) {
  2836. args = args || [];
  2837. args = [ context, args.slice ? args.slice() : args ];
  2838. if ( firing ) {
  2839. stack.push( args );
  2840. } else {
  2841. fire( args );
  2842. }
  2843. }
  2844. return this;
  2845. },
  2846. // Call all the callbacks with the given arguments
  2847. fire: function() {
  2848. self.fireWith( this, arguments );
  2849. return this;
  2850. },
  2851. // To know if the callbacks have already been called at least once
  2852. fired: function() {
  2853. return !!fired;
  2854. }
  2855. };
  2856. return self;
  2857. };
  2858. jQuery.extend({
  2859. Deferred: function( func ) {
  2860. var tuples = [
  2861. // action, add listener, listener list, final state
  2862. [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
  2863. [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
  2864. [ "notify", "progress", jQuery.Callbacks("memory") ]
  2865. ],
  2866. state = "pending",
  2867. promise = {
  2868. state: function() {
  2869. return state;
  2870. },
  2871. always: function() {
  2872. deferred.done( arguments ).fail( arguments );
  2873. return this;
  2874. },
  2875. then: function( /* fnDone, fnFail, fnProgress */ ) {
  2876. var fns = arguments;
  2877. return jQuery.Deferred(function( newDefer ) {
  2878. jQuery.each( tuples, function( i, tuple ) {
  2879. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  2880. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  2881. deferred[ tuple[1] ](function() {
  2882. var returned = fn && fn.apply( this, arguments );
  2883. if ( returned && jQuery.isFunction( returned.promise ) ) {
  2884. returned.promise()
  2885. .done( newDefer.resolve )
  2886. .fail( newDefer.reject )
  2887. .progress( newDefer.notify );
  2888. } else {
  2889. newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
  2890. }
  2891. });
  2892. });
  2893. fns = null;
  2894. }).promise();
  2895. },
  2896. // Get a promise for this deferred
  2897. // If obj is provided, the promise aspect is added to the object
  2898. promise: function( obj ) {
  2899. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2900. }
  2901. },
  2902. deferred = {};
  2903. // Keep pipe for back-compat
  2904. promise.pipe = promise.then;
  2905. // Add list-specific methods
  2906. jQuery.each( tuples, function( i, tuple ) {
  2907. var list = tuple[ 2 ],
  2908. stateString = tuple[ 3 ];
  2909. // promise[ done | fail | progress ] = list.add
  2910. promise[ tuple[1] ] = list.add;
  2911. // Handle state
  2912. if ( stateString ) {
  2913. list.add(function() {
  2914. // state = [ resolved | rejected ]
  2915. state = stateString;
  2916. // [ reject_list | resolve_list ].disable; progress_list.lock
  2917. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  2918. }
  2919. // deferred[ resolve | reject | notify ]
  2920. deferred[ tuple[0] ] = function() {
  2921. deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
  2922. return this;
  2923. };
  2924. deferred[ tuple[0] + "With" ] = list.fireWith;
  2925. });
  2926. // Make the deferred a promise
  2927. promise.promise( deferred );
  2928. // Call given func if any
  2929. if ( func ) {
  2930. func.call( deferred, deferred );
  2931. }
  2932. // All done!
  2933. return deferred;
  2934. },
  2935. // Deferred helper
  2936. when: function( subordinate /* , ..., subordinateN */ ) {
  2937. var i = 0,
  2938. resolveValues = slice.call( arguments ),
  2939. length = resolveValues.length,
  2940. // the count of uncompleted subordinates
  2941. remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2942. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2943. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2944. // Update function for both resolve and progress values
  2945. updateFunc = function( i, contexts, values ) {
  2946. return function( value ) {
  2947. contexts[ i ] = this;
  2948. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  2949. if ( values === progressValues ) {
  2950. deferred.notifyWith( contexts, values );
  2951. } else if ( !( --remaining ) ) {
  2952. deferred.resolveWith( contexts, values );
  2953. }
  2954. };
  2955. },
  2956. progressValues, progressContexts, resolveContexts;
  2957. // Add listeners to Deferred subordinates; treat others as resolved
  2958. if ( length > 1 ) {
  2959. progressValues = new Array( length );
  2960. progressContexts = new Array( length );
  2961. resolveContexts = new Array( length );
  2962. for ( ; i < length; i++ ) {
  2963. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2964. resolveValues[ i ].promise()
  2965. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2966. .fail( deferred.reject )
  2967. .progress( updateFunc( i, progressContexts, progressValues ) );
  2968. } else {
  2969. --remaining;
  2970. }
  2971. }
  2972. }
  2973. // If we're not waiting on anything, resolve the master
  2974. if ( !remaining ) {
  2975. deferred.resolveWith( resolveContexts, resolveValues );
  2976. }
  2977. return deferred.promise();
  2978. }
  2979. });
  2980. // The deferred used on DOM ready
  2981. var readyList;
  2982. jQuery.fn.ready = function( fn ) {
  2983. // Add the callback
  2984. jQuery.ready.promise().done( fn );
  2985. return this;
  2986. };
  2987. jQuery.extend({
  2988. // Is the DOM ready to be used? Set to true once it occurs.
  2989. isReady: false,
  2990. // A counter to track how many items to wait for before
  2991. // the ready event fires. See #6781
  2992. readyWait: 1,
  2993. // Hold (or release) the ready event
  2994. holdReady: function( hold ) {
  2995. if ( hold ) {
  2996. jQuery.readyWait++;
  2997. } else {
  2998. jQuery.ready( true );
  2999. }
  3000. },
  3001. // Handle when the DOM is ready
  3002. ready: function( wait ) {
  3003. // Abort if there are pending holds or we're already ready
  3004. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3005. return;
  3006. }
  3007. // Remember that the DOM is ready
  3008. jQuery.isReady = true;
  3009. // If a normal DOM Ready event fired, decrement, and wait if need be
  3010. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3011. return;
  3012. }
  3013. // If there are functions bound, to execute
  3014. readyList.resolveWith( document, [ jQuery ] );
  3015. // Trigger any bound ready events
  3016. if ( jQuery.fn.triggerHandler ) {
  3017. jQuery( document ).triggerHandler( "ready" );
  3018. jQuery( document ).off( "ready" );
  3019. }
  3020. }
  3021. });
  3022. /**
  3023. * The ready event handler and self cleanup method
  3024. */
  3025. function completed() {
  3026. document.removeEventListener( "DOMContentLoaded", completed, false );
  3027. window.removeEventListener( "load", completed, false );
  3028. jQuery.ready();
  3029. }
  3030. jQuery.ready.promise = function( obj ) {
  3031. if ( !readyList ) {
  3032. readyList = jQuery.Deferred();
  3033. // Catch cases where $(document).ready() is called after the browser event has already occurred.
  3034. // We once tried to use readyState "interactive" here, but it caused issues like the one
  3035. // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
  3036. if ( document.readyState === "complete" ) {
  3037. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3038. setTimeout( jQuery.ready );
  3039. } else {
  3040. // Use the handy event callback
  3041. document.addEventListener( "DOMContentLoaded", completed, false );
  3042. // A fallback to window.onload, that will always work
  3043. window.addEventListener( "load", completed, false );
  3044. }
  3045. }
  3046. return readyList.promise( obj );
  3047. };
  3048. // Kick off the DOM ready check even if the user does not
  3049. jQuery.ready.promise();
  3050. // Multifunctional method to get and set values of a collection
  3051. // The value/s can optionally be executed if it's a function
  3052. var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3053. var i = 0,
  3054. len = elems.length,
  3055. bulk = key == null;
  3056. // Sets many values
  3057. if ( jQuery.type( key ) === "object" ) {
  3058. chainable = true;
  3059. for ( i in key ) {
  3060. jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
  3061. }
  3062. // Sets one value
  3063. } else if ( value !== undefined ) {
  3064. chainable = true;
  3065. if ( !jQuery.isFunction( value ) ) {
  3066. raw = true;
  3067. }
  3068. if ( bulk ) {
  3069. // Bulk operations run against the entire set
  3070. if ( raw ) {
  3071. fn.call( elems, value );
  3072. fn = null;
  3073. // ...except when executing function values
  3074. } else {
  3075. bulk = fn;
  3076. fn = function( elem, key, value ) {
  3077. return bulk.call( jQuery( elem ), value );
  3078. };
  3079. }
  3080. }
  3081. if ( fn ) {
  3082. for ( ; i < len; i++ ) {
  3083. fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
  3084. }
  3085. }
  3086. }
  3087. return chainable ?
  3088. elems :
  3089. // Gets
  3090. bulk ?
  3091. fn.call( elems ) :
  3092. len ? fn( elems[0], key ) : emptyGet;
  3093. };
  3094. /**
  3095. * Determines whether an object can have data
  3096. */
  3097. jQuery.acceptData = function( owner ) {
  3098. // Accepts only:
  3099. // - Node
  3100. // - Node.ELEMENT_NODE
  3101. // - Node.DOCUMENT_NODE
  3102. // - Object
  3103. // - Any
  3104. /* jshint -W018 */
  3105. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3106. };
  3107. function Data() {
  3108. // Support: Android<4,
  3109. // Old WebKit does not have Object.preventExtensions/freeze method,
  3110. // return new empty object instead with no [[set]] accessor
  3111. Object.defineProperty( this.cache = {}, 0, {
  3112. get: function() {
  3113. return {};
  3114. }
  3115. });
  3116. this.expando = jQuery.expando + Data.uid++;
  3117. }
  3118. Data.uid = 1;
  3119. Data.accepts = jQuery.acceptData;
  3120. Data.prototype = {
  3121. key: function( owner ) {
  3122. // We can accept data for non-element nodes in modern browsers,
  3123. // but we should not, see #8335.
  3124. // Always return the key for a frozen object.
  3125. if ( !Data.accepts( owner ) ) {
  3126. return 0;
  3127. }
  3128. var descriptor = {},
  3129. // Check if the owner object already has a cache key
  3130. unlock = owner[ this.expando ];
  3131. // If not, create one
  3132. if ( !unlock ) {
  3133. unlock = Data.uid++;
  3134. // Secure it in a non-enumerable, non-writable property
  3135. try {
  3136. descriptor[ this.expando ] = { value: unlock };
  3137. Object.defineProperties( owner, descriptor );
  3138. // Support: Android<4
  3139. // Fallback to a less secure definition
  3140. } catch ( e ) {
  3141. descriptor[ this.expando ] = unlock;
  3142. jQuery.extend( owner, descriptor );
  3143. }
  3144. }
  3145. // Ensure the cache object
  3146. if ( !this.cache[ unlock ] ) {
  3147. this.cache[ unlock ] = {};
  3148. }
  3149. return unlock;
  3150. },
  3151. set: function( owner, data, value ) {
  3152. var prop,
  3153. // There may be an unlock assigned to this node,
  3154. // if there is no entry for this "owner", create one inline
  3155. // and set the unlock as though an owner entry had always existed
  3156. unlock = this.key( owner ),
  3157. cache = this.cache[ unlock ];
  3158. // Handle: [ owner, key, value ] args
  3159. if ( typeof data === "string" ) {
  3160. cache[ data ] = value;
  3161. // Handle: [ owner, { properties } ] args
  3162. } else {
  3163. // Fresh assignments by object are shallow copied
  3164. if ( jQuery.isEmptyObject( cache ) ) {
  3165. jQuery.extend( this.cache[ unlock ], data );
  3166. // Otherwise, copy the properties one-by-one to the cache object
  3167. } else {
  3168. for ( prop in data ) {
  3169. cache[ prop ] = data[ prop ];
  3170. }
  3171. }
  3172. }
  3173. return cache;
  3174. },
  3175. get: function( owner, key ) {
  3176. // Either a valid cache is found, or will be created.
  3177. // New caches will be created and the unlock returned,
  3178. // allowing direct access to the newly created
  3179. // empty data object. A valid owner object must be provided.
  3180. var cache = this.cache[ this.key( owner ) ];
  3181. return key === undefined ?
  3182. cache : cache[ key ];
  3183. },
  3184. access: function( owner, key, value ) {
  3185. var stored;
  3186. // In cases where either:
  3187. //
  3188. // 1. No key was specified
  3189. // 2. A string key was specified, but no value provided
  3190. //
  3191. // Take the "read" path and allow the get method to determine
  3192. // which value to return, respectively either:
  3193. //
  3194. // 1. The entire cache object
  3195. // 2. The data stored at the key
  3196. //
  3197. if ( key === undefined ||
  3198. ((key && typeof key === "string") && value === undefined) ) {
  3199. stored = this.get( owner, key );
  3200. return stored !== undefined ?
  3201. stored : this.get( owner, jQuery.camelCase(key) );
  3202. }
  3203. // [*]When the key is not a string, or both a key and value
  3204. // are specified, set or extend (existing objects) with either:
  3205. //
  3206. // 1. An object of properties
  3207. // 2. A key and value
  3208. //
  3209. this.set( owner, key, value );
  3210. // Since the "set" path can have two possible entry points
  3211. // return the expected data based on which path was taken[*]
  3212. return value !== undefined ? value : key;
  3213. },
  3214. remove: function( owner, key ) {
  3215. var i, name, camel,
  3216. unlock = this.key( owner ),
  3217. cache = this.cache[ unlock ];
  3218. if ( key === undefined ) {
  3219. this.cache[ unlock ] = {};
  3220. } else {
  3221. // Support array or space separated string of keys
  3222. if ( jQuery.isArray( key ) ) {
  3223. // If "name" is an array of keys...
  3224. // When data is initially created, via ("key", "val") signature,
  3225. // keys will be converted to camelCase.
  3226. // Since there is no way to tell _how_ a key was added, remove
  3227. // both plain key and camelCase key. #12786
  3228. // This will only penalize the array argument path.
  3229. name = key.concat( key.map( jQuery.camelCase ) );
  3230. } else {
  3231. camel = jQuery.camelCase( key );
  3232. // Try the string as a key before any manipulation
  3233. if ( key in cache ) {
  3234. name = [ key, camel ];
  3235. } else {
  3236. // If a key with the spaces exists, use it.
  3237. // Otherwise, create an array by matching non-whitespace
  3238. name = camel;
  3239. name = name in cache ?
  3240. [ name ] : ( name.match( rnotwhite ) || [] );
  3241. }
  3242. }
  3243. i = name.length;
  3244. while ( i-- ) {
  3245. delete cache[ name[ i ] ];
  3246. }
  3247. }
  3248. },
  3249. hasData: function( owner ) {
  3250. return !jQuery.isEmptyObject(
  3251. this.cache[ owner[ this.expando ] ] || {}
  3252. );
  3253. },
  3254. discard: function( owner ) {
  3255. if ( owner[ this.expando ] ) {
  3256. delete this.cache[ owner[ this.expando ] ];
  3257. }
  3258. }
  3259. };
  3260. var data_priv = new Data();
  3261. var data_user = new Data();
  3262. // Implementation Summary
  3263. //
  3264. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3265. // 2. Improve the module's maintainability by reducing the storage
  3266. // paths to a single mechanism.
  3267. // 3. Use the same single mechanism to support "private" and "user" data.
  3268. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3269. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3270. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3271. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3272. rmultiDash = /([A-Z])/g;
  3273. function dataAttr( elem, key, data ) {
  3274. var name;
  3275. // If nothing was found internally, try to fetch any
  3276. // data from the HTML5 data-* attribute
  3277. if ( data === undefined && elem.nodeType === 1 ) {
  3278. name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  3279. data = elem.getAttribute( name );
  3280. if ( typeof data === "string" ) {
  3281. try {
  3282. data = data === "true" ? true :
  3283. data === "false" ? false :
  3284. data === "null" ? null :
  3285. // Only convert to a number if it doesn't change the string
  3286. +data + "" === data ? +data :
  3287. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  3288. data;
  3289. } catch( e ) {}
  3290. // Make sure we set the data so it isn't changed later
  3291. data_user.set( elem, key, data );
  3292. } else {
  3293. data = undefined;
  3294. }
  3295. }
  3296. return data;
  3297. }
  3298. jQuery.extend({
  3299. hasData: function( elem ) {
  3300. return data_user.hasData( elem ) || data_priv.hasData( elem );
  3301. },
  3302. data: function( elem, name, data ) {
  3303. return data_user.access( elem, name, data );
  3304. },
  3305. removeData: function( elem, name ) {
  3306. data_user.remove( elem, name );
  3307. },
  3308. // TODO: Now that all calls to _data and _removeData have been replaced
  3309. // with direct calls to data_priv methods, these can be deprecated.
  3310. _data: function( elem, name, data ) {
  3311. return data_priv.access( elem, name, data );
  3312. },
  3313. _removeData: function( elem, name ) {
  3314. data_priv.remove( elem, name );
  3315. }
  3316. });
  3317. jQuery.fn.extend({
  3318. data: function( key, value ) {
  3319. var i, name, data,
  3320. elem = this[ 0 ],
  3321. attrs = elem && elem.attributes;
  3322. // Gets all values
  3323. if ( key === undefined ) {
  3324. if ( this.length ) {
  3325. data = data_user.get( elem );
  3326. if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
  3327. i = attrs.length;
  3328. while ( i-- ) {
  3329. // Support: IE11+
  3330. // The attrs elements can be null (#14894)
  3331. if ( attrs[ i ] ) {
  3332. name = attrs[ i ].name;
  3333. if ( name.indexOf( "data-" ) === 0 ) {
  3334. name = jQuery.camelCase( name.slice(5) );
  3335. dataAttr( elem, name, data[ name ] );
  3336. }
  3337. }
  3338. }
  3339. data_priv.set( elem, "hasDataAttrs", true );
  3340. }
  3341. }
  3342. return data;
  3343. }
  3344. // Sets multiple values
  3345. if ( typeof key === "object" ) {
  3346. return this.each(function() {
  3347. data_user.set( this, key );
  3348. });
  3349. }
  3350. return access( this, function( value ) {
  3351. var data,
  3352. camelKey = jQuery.camelCase( key );
  3353. // The calling jQuery object (element matches) is not empty
  3354. // (and therefore has an element appears at this[ 0 ]) and the
  3355. // `value` parameter was not undefined. An empty jQuery object
  3356. // will result in `undefined` for elem = this[ 0 ] which will
  3357. // throw an exception if an attempt to read a data cache is made.
  3358. if ( elem && value === undefined ) {
  3359. // Attempt to get data from the cache
  3360. // with the key as-is
  3361. data = data_user.get( elem, key );
  3362. if ( data !== undefined ) {
  3363. return data;
  3364. }
  3365. // Attempt to get data from the cache
  3366. // with the key camelized
  3367. data = data_user.get( elem, camelKey );
  3368. if ( data !== undefined ) {
  3369. return data;
  3370. }
  3371. // Attempt to "discover" the data in
  3372. // HTML5 custom data-* attrs
  3373. data = dataAttr( elem, camelKey, undefined );
  3374. if ( data !== undefined ) {
  3375. return data;
  3376. }
  3377. // We tried really hard, but the data doesn't exist.
  3378. return;
  3379. }
  3380. // Set the data...
  3381. this.each(function() {
  3382. // First, attempt to store a copy or reference of any
  3383. // data that might've been store with a camelCased key.
  3384. var data = data_user.get( this, camelKey );
  3385. // For HTML5 data-* attribute interop, we have to
  3386. // store property names with dashes in a camelCase form.
  3387. // This might not apply to all properties...*
  3388. data_user.set( this, camelKey, value );
  3389. // *... In the case of properties that might _actually_
  3390. // have dashes, we need to also store a copy of that
  3391. // unchanged property.
  3392. if ( key.indexOf("-") !== -1 && data !== undefined ) {
  3393. data_user.set( this, key, value );
  3394. }
  3395. });
  3396. }, null, value, arguments.length > 1, null, true );
  3397. },
  3398. removeData: function( key ) {
  3399. return this.each(function() {
  3400. data_user.remove( this, key );
  3401. });
  3402. }
  3403. });
  3404. jQuery.extend({
  3405. queue: function( elem, type, data ) {
  3406. var queue;
  3407. if ( elem ) {
  3408. type = ( type || "fx" ) + "queue";
  3409. queue = data_priv.get( elem, type );
  3410. // Speed up dequeue by getting out quickly if this is just a lookup
  3411. if ( data ) {
  3412. if ( !queue || jQuery.isArray( data ) ) {
  3413. queue = data_priv.access( elem, type, jQuery.makeArray(data) );
  3414. } else {
  3415. queue.push( data );
  3416. }
  3417. }
  3418. return queue || [];
  3419. }
  3420. },
  3421. dequeue: function( elem, type ) {
  3422. type = type || "fx";
  3423. var queue = jQuery.queue( elem, type ),
  3424. startLength = queue.length,
  3425. fn = queue.shift(),
  3426. hooks = jQuery._queueHooks( elem, type ),
  3427. next = function() {
  3428. jQuery.dequeue( elem, type );
  3429. };
  3430. // If the fx queue is dequeued, always remove the progress sentinel
  3431. if ( fn === "inprogress" ) {
  3432. fn = queue.shift();
  3433. startLength--;
  3434. }
  3435. if ( fn ) {
  3436. // Add a progress sentinel to prevent the fx queue from being
  3437. // automatically dequeued
  3438. if ( type === "fx" ) {
  3439. queue.unshift( "inprogress" );
  3440. }
  3441. // Clear up the last queue stop function
  3442. delete hooks.stop;
  3443. fn.call( elem, next, hooks );
  3444. }
  3445. if ( !startLength && hooks ) {
  3446. hooks.empty.fire();
  3447. }
  3448. },
  3449. // Not public - generate a queueHooks object, or return the current one
  3450. _queueHooks: function( elem, type ) {
  3451. var key = type + "queueHooks";
  3452. return data_priv.get( elem, key ) || data_priv.access( elem, key, {
  3453. empty: jQuery.Callbacks("once memory").add(function() {
  3454. data_priv.remove( elem, [ type + "queue", key ] );
  3455. })
  3456. });
  3457. }
  3458. });
  3459. jQuery.fn.extend({
  3460. queue: function( type, data ) {
  3461. var setter = 2;
  3462. if ( typeof type !== "string" ) {
  3463. data = type;
  3464. type = "fx";
  3465. setter--;
  3466. }
  3467. if ( arguments.length < setter ) {
  3468. return jQuery.queue( this[0], type );
  3469. }
  3470. return data === undefined ?
  3471. this :
  3472. this.each(function() {
  3473. var queue = jQuery.queue( this, type, data );
  3474. // Ensure a hooks for this queue
  3475. jQuery._queueHooks( this, type );
  3476. if ( type === "fx" && queue[0] !== "inprogress" ) {
  3477. jQuery.dequeue( this, type );
  3478. }
  3479. });
  3480. },
  3481. dequeue: function( type ) {
  3482. return this.each(function() {
  3483. jQuery.dequeue( this, type );
  3484. });
  3485. },
  3486. clearQueue: function( type ) {
  3487. return this.queue( type || "fx", [] );
  3488. },
  3489. // Get a promise resolved when queues of a certain type
  3490. // are emptied (fx is the type by default)
  3491. promise: function( type, obj ) {
  3492. var tmp,
  3493. count = 1,
  3494. defer = jQuery.Deferred(),
  3495. elements = this,
  3496. i = this.length,
  3497. resolve = function() {
  3498. if ( !( --count ) ) {
  3499. defer.resolveWith( elements, [ elements ] );
  3500. }
  3501. };
  3502. if ( typeof type !== "string" ) {
  3503. obj = type;
  3504. type = undefined;
  3505. }
  3506. type = type || "fx";
  3507. while ( i-- ) {
  3508. tmp = data_priv.get( elements[ i ], type + "queueHooks" );
  3509. if ( tmp && tmp.empty ) {
  3510. count++;
  3511. tmp.empty.add( resolve );
  3512. }
  3513. }
  3514. resolve();
  3515. return defer.promise( obj );
  3516. }
  3517. });
  3518. var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
  3519. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3520. var isHidden = function( elem, el ) {
  3521. // isHidden might be called from jQuery#filter function;
  3522. // in that case, element will be second argument
  3523. elem = el || elem;
  3524. return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
  3525. };
  3526. var rcheckableType = (/^(?:checkbox|radio)$/i);
  3527. (function() {
  3528. var fragment = document.createDocumentFragment(),
  3529. div = fragment.appendChild( document.createElement( "div" ) ),
  3530. input = document.createElement( "input" );
  3531. // Support: Safari<=5.1
  3532. // Check state lost if the name is set (#11217)
  3533. // Support: Windows Web Apps (WWA)
  3534. // `name` and `type` must use .setAttribute for WWA (#14901)
  3535. input.setAttribute( "type", "radio" );
  3536. input.setAttribute( "checked", "checked" );
  3537. input.setAttribute( "name", "t" );
  3538. div.appendChild( input );
  3539. // Support: Safari<=5.1, Android<4.2
  3540. // Older WebKit doesn't clone checked state correctly in fragments
  3541. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3542. // Support: IE<=11+
  3543. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3544. div.innerHTML = "<textarea>x</textarea>";
  3545. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3546. })();
  3547. var strundefined = typeof undefined;
  3548. support.focusinBubbles = "onfocusin" in window;
  3549. var
  3550. rkeyEvent = /^key/,
  3551. rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
  3552. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  3553. rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
  3554. function returnTrue() {
  3555. return true;
  3556. }
  3557. function returnFalse() {
  3558. return false;
  3559. }
  3560. function safeActiveElement() {
  3561. try {
  3562. return document.activeElement;
  3563. } catch ( err ) { }
  3564. }
  3565. /*
  3566. * Helper functions for managing events -- not part of the public interface.
  3567. * Props to Dean Edwards' addEvent library for many of the ideas.
  3568. */
  3569. jQuery.event = {
  3570. global: {},
  3571. add: function( elem, types, handler, data, selector ) {
  3572. var handleObjIn, eventHandle, tmp,
  3573. events, t, handleObj,
  3574. special, handlers, type, namespaces, origType,
  3575. elemData = data_priv.get( elem );
  3576. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  3577. if ( !elemData ) {
  3578. return;
  3579. }
  3580. // Caller can pass in an object of custom data in lieu of the handler
  3581. if ( handler.handler ) {
  3582. handleObjIn = handler;
  3583. handler = handleObjIn.handler;
  3584. selector = handleObjIn.selector;
  3585. }
  3586. // Make sure that the handler has a unique ID, used to find/remove it later
  3587. if ( !handler.guid ) {
  3588. handler.guid = jQuery.guid++;
  3589. }
  3590. // Init the element's event structure and main handler, if this is the first
  3591. if ( !(events = elemData.events) ) {
  3592. events = elemData.events = {};
  3593. }
  3594. if ( !(eventHandle = elemData.handle) ) {
  3595. eventHandle = elemData.handle = function( e ) {
  3596. // Discard the second event of a jQuery.event.trigger() and
  3597. // when an event is called after a page has unloaded
  3598. return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
  3599. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  3600. };
  3601. }
  3602. // Handle multiple events separated by a space
  3603. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3604. t = types.length;
  3605. while ( t-- ) {
  3606. tmp = rtypenamespace.exec( types[t] ) || [];
  3607. type = origType = tmp[1];
  3608. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3609. // There *must* be a type, no attaching namespace-only handlers
  3610. if ( !type ) {
  3611. continue;
  3612. }
  3613. // If event changes its type, use the special event handlers for the changed type
  3614. special = jQuery.event.special[ type ] || {};
  3615. // If selector defined, determine special event api type, otherwise given type
  3616. type = ( selector ? special.delegateType : special.bindType ) || type;
  3617. // Update special based on newly reset type
  3618. special = jQuery.event.special[ type ] || {};
  3619. // handleObj is passed to all event handlers
  3620. handleObj = jQuery.extend({
  3621. type: type,
  3622. origType: origType,
  3623. data: data,
  3624. handler: handler,
  3625. guid: handler.guid,
  3626. selector: selector,
  3627. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  3628. namespace: namespaces.join(".")
  3629. }, handleObjIn );
  3630. // Init the event handler queue if we're the first
  3631. if ( !(handlers = events[ type ]) ) {
  3632. handlers = events[ type ] = [];
  3633. handlers.delegateCount = 0;
  3634. // Only use addEventListener if the special events handler returns false
  3635. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  3636. if ( elem.addEventListener ) {
  3637. elem.addEventListener( type, eventHandle, false );
  3638. }
  3639. }
  3640. }
  3641. if ( special.add ) {
  3642. special.add.call( elem, handleObj );
  3643. if ( !handleObj.handler.guid ) {
  3644. handleObj.handler.guid = handler.guid;
  3645. }
  3646. }
  3647. // Add to the element's handler list, delegates in front
  3648. if ( selector ) {
  3649. handlers.splice( handlers.delegateCount++, 0, handleObj );
  3650. } else {
  3651. handlers.push( handleObj );
  3652. }
  3653. // Keep track of which events have ever been used, for event optimization
  3654. jQuery.event.global[ type ] = true;
  3655. }
  3656. },
  3657. // Detach an event or set of events from an element
  3658. remove: function( elem, types, handler, selector, mappedTypes ) {
  3659. var j, origCount, tmp,
  3660. events, t, handleObj,
  3661. special, handlers, type, namespaces, origType,
  3662. elemData = data_priv.hasData( elem ) && data_priv.get( elem );
  3663. if ( !elemData || !(events = elemData.events) ) {
  3664. return;
  3665. }
  3666. // Once for each type.namespace in types; type may be omitted
  3667. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3668. t = types.length;
  3669. while ( t-- ) {
  3670. tmp = rtypenamespace.exec( types[t] ) || [];
  3671. type = origType = tmp[1];
  3672. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3673. // Unbind all events (on this namespace, if provided) for the element
  3674. if ( !type ) {
  3675. for ( type in events ) {
  3676. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  3677. }
  3678. continue;
  3679. }
  3680. special = jQuery.event.special[ type ] || {};
  3681. type = ( selector ? special.delegateType : special.bindType ) || type;
  3682. handlers = events[ type ] || [];
  3683. tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
  3684. // Remove matching events
  3685. origCount = j = handlers.length;
  3686. while ( j-- ) {
  3687. handleObj = handlers[ j ];
  3688. if ( ( mappedTypes || origType === handleObj.origType ) &&
  3689. ( !handler || handler.guid === handleObj.guid ) &&
  3690. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  3691. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  3692. handlers.splice( j, 1 );
  3693. if ( handleObj.selector ) {
  3694. handlers.delegateCount--;
  3695. }
  3696. if ( special.remove ) {
  3697. special.remove.call( elem, handleObj );
  3698. }
  3699. }
  3700. }
  3701. // Remove generic event handler if we removed something and no more handlers exist
  3702. // (avoids potential for endless recursion during removal of special event handlers)
  3703. if ( origCount && !handlers.length ) {
  3704. if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  3705. jQuery.removeEvent( elem, type, elemData.handle );
  3706. }
  3707. delete events[ type ];
  3708. }
  3709. }
  3710. // Remove the expando if it's no longer used
  3711. if ( jQuery.isEmptyObject( events ) ) {
  3712. delete elemData.handle;
  3713. data_priv.remove( elem, "events" );
  3714. }
  3715. },
  3716. trigger: function( event, data, elem, onlyHandlers ) {
  3717. var i, cur, tmp, bubbleType, ontype, handle, special,
  3718. eventPath = [ elem || document ],
  3719. type = hasOwn.call( event, "type" ) ? event.type : event,
  3720. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
  3721. cur = tmp = elem = elem || document;
  3722. // Don't do events on text and comment nodes
  3723. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  3724. return;
  3725. }
  3726. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  3727. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  3728. return;
  3729. }
  3730. if ( type.indexOf(".") >= 0 ) {
  3731. // Namespaced trigger; create a regexp to match event type in handle()
  3732. namespaces = type.split(".");
  3733. type = namespaces.shift();
  3734. namespaces.sort();
  3735. }
  3736. ontype = type.indexOf(":") < 0 && "on" + type;
  3737. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  3738. event = event[ jQuery.expando ] ?
  3739. event :
  3740. new jQuery.Event( type, typeof event === "object" && event );
  3741. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  3742. event.isTrigger = onlyHandlers ? 2 : 3;
  3743. event.namespace = namespaces.join(".");
  3744. event.namespace_re = event.namespace ?
  3745. new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
  3746. null;
  3747. // Clean up the event in case it is being reused
  3748. event.result = undefined;
  3749. if ( !event.target ) {
  3750. event.target = elem;
  3751. }
  3752. // Clone any incoming data and prepend the event, creating the handler arg list
  3753. data = data == null ?
  3754. [ event ] :
  3755. jQuery.makeArray( data, [ event ] );
  3756. // Allow special events to draw outside the lines
  3757. special = jQuery.event.special[ type ] || {};
  3758. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  3759. return;
  3760. }
  3761. // Determine event propagation path in advance, per W3C events spec (#9951)
  3762. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  3763. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  3764. bubbleType = special.delegateType || type;
  3765. if ( !rfocusMorph.test( bubbleType + type ) ) {
  3766. cur = cur.parentNode;
  3767. }
  3768. for ( ; cur; cur = cur.parentNode ) {
  3769. eventPath.push( cur );
  3770. tmp = cur;
  3771. }
  3772. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  3773. if ( tmp === (elem.ownerDocument || document) ) {
  3774. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  3775. }
  3776. }
  3777. // Fire handlers on the event path
  3778. i = 0;
  3779. while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
  3780. event.type = i > 1 ?
  3781. bubbleType :
  3782. special.bindType || type;
  3783. // jQuery handler
  3784. handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
  3785. if ( handle ) {
  3786. handle.apply( cur, data );
  3787. }
  3788. // Native handler
  3789. handle = ontype && cur[ ontype ];
  3790. if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
  3791. event.result = handle.apply( cur, data );
  3792. if ( event.result === false ) {
  3793. event.preventDefault();
  3794. }
  3795. }
  3796. }
  3797. event.type = type;
  3798. // If nobody prevented the default action, do it now
  3799. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  3800. if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
  3801. jQuery.acceptData( elem ) ) {
  3802. // Call a native DOM method on the target with the same name name as the event.
  3803. // Don't do default actions on window, that's where global variables be (#6170)
  3804. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  3805. // Don't re-trigger an onFOO event when we call its FOO() method
  3806. tmp = elem[ ontype ];
  3807. if ( tmp ) {
  3808. elem[ ontype ] = null;
  3809. }
  3810. // Prevent re-triggering of the same event, since we already bubbled it above
  3811. jQuery.event.triggered = type;
  3812. elem[ type ]();
  3813. jQuery.event.triggered = undefined;
  3814. if ( tmp ) {
  3815. elem[ ontype ] = tmp;
  3816. }
  3817. }
  3818. }
  3819. }
  3820. return event.result;
  3821. },
  3822. dispatch: function( event ) {
  3823. // Make a writable jQuery.Event from the native event object
  3824. event = jQuery.event.fix( event );
  3825. var i, j, ret, matched, handleObj,
  3826. handlerQueue = [],
  3827. args = slice.call( arguments ),
  3828. handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
  3829. special = jQuery.event.special[ event.type ] || {};
  3830. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  3831. args[0] = event;
  3832. event.delegateTarget = this;
  3833. // Call the preDispatch hook for the mapped type, and let it bail if desired
  3834. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  3835. return;
  3836. }
  3837. // Determine handlers
  3838. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  3839. // Run delegates first; they may want to stop propagation beneath us
  3840. i = 0;
  3841. while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
  3842. event.currentTarget = matched.elem;
  3843. j = 0;
  3844. while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
  3845. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  3846. // a subset or equal to those in the bound event (both can have no namespace).
  3847. if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
  3848. event.handleObj = handleObj;
  3849. event.data = handleObj.data;
  3850. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  3851. .apply( matched.elem, args );
  3852. if ( ret !== undefined ) {
  3853. if ( (event.result = ret) === false ) {
  3854. event.preventDefault();
  3855. event.stopPropagation();
  3856. }
  3857. }
  3858. }
  3859. }
  3860. }
  3861. // Call the postDispatch hook for the mapped type
  3862. if ( special.postDispatch ) {
  3863. special.postDispatch.call( this, event );
  3864. }
  3865. return event.result;
  3866. },
  3867. handlers: function( event, handlers ) {
  3868. var i, matches, sel, handleObj,
  3869. handlerQueue = [],
  3870. delegateCount = handlers.delegateCount,
  3871. cur = event.target;
  3872. // Find delegate handlers
  3873. // Black-hole SVG <use> instance trees (#13180)
  3874. // Avoid non-left-click bubbling in Firefox (#3861)
  3875. if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
  3876. for ( ; cur !== this; cur = cur.parentNode || this ) {
  3877. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  3878. if ( cur.disabled !== true || event.type !== "click" ) {
  3879. matches = [];
  3880. for ( i = 0; i < delegateCount; i++ ) {
  3881. handleObj = handlers[ i ];
  3882. // Don't conflict with Object.prototype properties (#13203)
  3883. sel = handleObj.selector + " ";
  3884. if ( matches[ sel ] === undefined ) {
  3885. matches[ sel ] = handleObj.needsContext ?
  3886. jQuery( sel, this ).index( cur ) >= 0 :
  3887. jQuery.find( sel, this, null, [ cur ] ).length;
  3888. }
  3889. if ( matches[ sel ] ) {
  3890. matches.push( handleObj );
  3891. }
  3892. }
  3893. if ( matches.length ) {
  3894. handlerQueue.push({ elem: cur, handlers: matches });
  3895. }
  3896. }
  3897. }
  3898. }
  3899. // Add the remaining (directly-bound) handlers
  3900. if ( delegateCount < handlers.length ) {
  3901. handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
  3902. }
  3903. return handlerQueue;
  3904. },
  3905. // Includes some event props shared by KeyEvent and MouseEvent
  3906. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  3907. fixHooks: {},
  3908. keyHooks: {
  3909. props: "char charCode key keyCode".split(" "),
  3910. filter: function( event, original ) {
  3911. // Add which for key events
  3912. if ( event.which == null ) {
  3913. event.which = original.charCode != null ? original.charCode : original.keyCode;
  3914. }
  3915. return event;
  3916. }
  3917. },
  3918. mouseHooks: {
  3919. props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  3920. filter: function( event, original ) {
  3921. var eventDoc, doc, body,
  3922. button = original.button;
  3923. // Calculate pageX/Y if missing and clientX/Y available
  3924. if ( event.pageX == null && original.clientX != null ) {
  3925. eventDoc = event.target.ownerDocument || document;
  3926. doc = eventDoc.documentElement;
  3927. body = eventDoc.body;
  3928. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  3929. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  3930. }
  3931. // Add which for click: 1 === left; 2 === middle; 3 === right
  3932. // Note: button is not normalized, so don't use it
  3933. if ( !event.which && button !== undefined ) {
  3934. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  3935. }
  3936. return event;
  3937. }
  3938. },
  3939. fix: function( event ) {
  3940. if ( event[ jQuery.expando ] ) {
  3941. return event;
  3942. }
  3943. // Create a writable copy of the event object and normalize some properties
  3944. var i, prop, copy,
  3945. type = event.type,
  3946. originalEvent = event,
  3947. fixHook = this.fixHooks[ type ];
  3948. if ( !fixHook ) {
  3949. this.fixHooks[ type ] = fixHook =
  3950. rmouseEvent.test( type ) ? this.mouseHooks :
  3951. rkeyEvent.test( type ) ? this.keyHooks :
  3952. {};
  3953. }
  3954. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  3955. event = new jQuery.Event( originalEvent );
  3956. i = copy.length;
  3957. while ( i-- ) {
  3958. prop = copy[ i ];
  3959. event[ prop ] = originalEvent[ prop ];
  3960. }
  3961. // Support: Cordova 2.5 (WebKit) (#13255)
  3962. // All events should have a target; Cordova deviceready doesn't
  3963. if ( !event.target ) {
  3964. event.target = document;
  3965. }
  3966. // Support: Safari 6.0+, Chrome<28
  3967. // Target should not be a text node (#504, #13143)
  3968. if ( event.target.nodeType === 3 ) {
  3969. event.target = event.target.parentNode;
  3970. }
  3971. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  3972. },
  3973. special: {
  3974. load: {
  3975. // Prevent triggered image.load events from bubbling to window.load
  3976. noBubble: true
  3977. },
  3978. focus: {
  3979. // Fire native event if possible so blur/focus sequence is correct
  3980. trigger: function() {
  3981. if ( this !== safeActiveElement() && this.focus ) {
  3982. this.focus();
  3983. return false;
  3984. }
  3985. },
  3986. delegateType: "focusin"
  3987. },
  3988. blur: {
  3989. trigger: function() {
  3990. if ( this === safeActiveElement() && this.blur ) {
  3991. this.blur();
  3992. return false;
  3993. }
  3994. },
  3995. delegateType: "focusout"
  3996. },
  3997. click: {
  3998. // For checkbox, fire native event so checked state will be right
  3999. trigger: function() {
  4000. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  4001. this.click();
  4002. return false;
  4003. }
  4004. },
  4005. // For cross-browser consistency, don't fire native .click() on links
  4006. _default: function( event ) {
  4007. return jQuery.nodeName( event.target, "a" );
  4008. }
  4009. },
  4010. beforeunload: {
  4011. postDispatch: function( event ) {
  4012. // Support: Firefox 20+
  4013. // Firefox doesn't alert if the returnValue field is not set.
  4014. if ( event.result !== undefined && event.originalEvent ) {
  4015. event.originalEvent.returnValue = event.result;
  4016. }
  4017. }
  4018. }
  4019. },
  4020. simulate: function( type, elem, event, bubble ) {
  4021. // Piggyback on a donor event to simulate a different one.
  4022. // Fake originalEvent to avoid donor's stopPropagation, but if the
  4023. // simulated event prevents default then we do the same on the donor.
  4024. var e = jQuery.extend(
  4025. new jQuery.Event(),
  4026. event,
  4027. {
  4028. type: type,
  4029. isSimulated: true,
  4030. originalEvent: {}
  4031. }
  4032. );
  4033. if ( bubble ) {
  4034. jQuery.event.trigger( e, null, elem );
  4035. } else {
  4036. jQuery.event.dispatch.call( elem, e );
  4037. }
  4038. if ( e.isDefaultPrevented() ) {
  4039. event.preventDefault();
  4040. }
  4041. }
  4042. };
  4043. jQuery.removeEvent = function( elem, type, handle ) {
  4044. if ( elem.removeEventListener ) {
  4045. elem.removeEventListener( type, handle, false );
  4046. }
  4047. };
  4048. jQuery.Event = function( src, props ) {
  4049. // Allow instantiation without the 'new' keyword
  4050. if ( !(this instanceof jQuery.Event) ) {
  4051. return new jQuery.Event( src, props );
  4052. }
  4053. // Event object
  4054. if ( src && src.type ) {
  4055. this.originalEvent = src;
  4056. this.type = src.type;
  4057. // Events bubbling up the document may have been marked as prevented
  4058. // by a handler lower down the tree; reflect the correct value.
  4059. this.isDefaultPrevented = src.defaultPrevented ||
  4060. src.defaultPrevented === undefined &&
  4061. // Support: Android<4.0
  4062. src.returnValue === false ?
  4063. returnTrue :
  4064. returnFalse;
  4065. // Event type
  4066. } else {
  4067. this.type = src;
  4068. }
  4069. // Put explicitly provided properties onto the event object
  4070. if ( props ) {
  4071. jQuery.extend( this, props );
  4072. }
  4073. // Create a timestamp if incoming event doesn't have one
  4074. this.timeStamp = src && src.timeStamp || jQuery.now();
  4075. // Mark it as fixed
  4076. this[ jQuery.expando ] = true;
  4077. };
  4078. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4079. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4080. jQuery.Event.prototype = {
  4081. isDefaultPrevented: returnFalse,
  4082. isPropagationStopped: returnFalse,
  4083. isImmediatePropagationStopped: returnFalse,
  4084. preventDefault: function() {
  4085. var e = this.originalEvent;
  4086. this.isDefaultPrevented = returnTrue;
  4087. if ( e && e.preventDefault ) {
  4088. e.preventDefault();
  4089. }
  4090. },
  4091. stopPropagation: function() {
  4092. var e = this.originalEvent;
  4093. this.isPropagationStopped = returnTrue;
  4094. if ( e && e.stopPropagation ) {
  4095. e.stopPropagation();
  4096. }
  4097. },
  4098. stopImmediatePropagation: function() {
  4099. var e = this.originalEvent;
  4100. this.isImmediatePropagationStopped = returnTrue;
  4101. if ( e && e.stopImmediatePropagation ) {
  4102. e.stopImmediatePropagation();
  4103. }
  4104. this.stopPropagation();
  4105. }
  4106. };
  4107. // Create mouseenter/leave events using mouseover/out and event-time checks
  4108. // Support: Chrome 15+
  4109. jQuery.each({
  4110. mouseenter: "mouseover",
  4111. mouseleave: "mouseout",
  4112. pointerenter: "pointerover",
  4113. pointerleave: "pointerout"
  4114. }, function( orig, fix ) {
  4115. jQuery.event.special[ orig ] = {
  4116. delegateType: fix,
  4117. bindType: fix,
  4118. handle: function( event ) {
  4119. var ret,
  4120. target = this,
  4121. related = event.relatedTarget,
  4122. handleObj = event.handleObj;
  4123. // For mousenter/leave call the handler if related is outside the target.
  4124. // NB: No relatedTarget if the mouse left/entered the browser window
  4125. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  4126. event.type = handleObj.origType;
  4127. ret = handleObj.handler.apply( this, arguments );
  4128. event.type = fix;
  4129. }
  4130. return ret;
  4131. }
  4132. };
  4133. });
  4134. // Support: Firefox, Chrome, Safari
  4135. // Create "bubbling" focus and blur events
  4136. if ( !support.focusinBubbles ) {
  4137. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  4138. // Attach a single capturing handler on the document while someone wants focusin/focusout
  4139. var handler = function( event ) {
  4140. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  4141. };
  4142. jQuery.event.special[ fix ] = {
  4143. setup: function() {
  4144. var doc = this.ownerDocument || this,
  4145. attaches = data_priv.access( doc, fix );
  4146. if ( !attaches ) {
  4147. doc.addEventListener( orig, handler, true );
  4148. }
  4149. data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
  4150. },
  4151. teardown: function() {
  4152. var doc = this.ownerDocument || this,
  4153. attaches = data_priv.access( doc, fix ) - 1;
  4154. if ( !attaches ) {
  4155. doc.removeEventListener( orig, handler, true );
  4156. data_priv.remove( doc, fix );
  4157. } else {
  4158. data_priv.access( doc, fix, attaches );
  4159. }
  4160. }
  4161. };
  4162. });
  4163. }
  4164. jQuery.fn.extend({
  4165. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  4166. var origFn, type;
  4167. // Types can be a map of types/handlers
  4168. if ( typeof types === "object" ) {
  4169. // ( types-Object, selector, data )
  4170. if ( typeof selector !== "string" ) {
  4171. // ( types-Object, data )
  4172. data = data || selector;
  4173. selector = undefined;
  4174. }
  4175. for ( type in types ) {
  4176. this.on( type, selector, data, types[ type ], one );
  4177. }
  4178. return this;
  4179. }
  4180. if ( data == null && fn == null ) {
  4181. // ( types, fn )
  4182. fn = selector;
  4183. data = selector = undefined;
  4184. } else if ( fn == null ) {
  4185. if ( typeof selector === "string" ) {
  4186. // ( types, selector, fn )
  4187. fn = data;
  4188. data = undefined;
  4189. } else {
  4190. // ( types, data, fn )
  4191. fn = data;
  4192. data = selector;
  4193. selector = undefined;
  4194. }
  4195. }
  4196. if ( fn === false ) {
  4197. fn = returnFalse;
  4198. } else if ( !fn ) {
  4199. return this;
  4200. }
  4201. if ( one === 1 ) {
  4202. origFn = fn;
  4203. fn = function( event ) {
  4204. // Can use an empty set, since event contains the info
  4205. jQuery().off( event );
  4206. return origFn.apply( this, arguments );
  4207. };
  4208. // Use same guid so caller can remove using origFn
  4209. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4210. }
  4211. return this.each( function() {
  4212. jQuery.event.add( this, types, fn, data, selector );
  4213. });
  4214. },
  4215. one: function( types, selector, data, fn ) {
  4216. return this.on( types, selector, data, fn, 1 );
  4217. },
  4218. off: function( types, selector, fn ) {
  4219. var handleObj, type;
  4220. if ( types && types.preventDefault && types.handleObj ) {
  4221. // ( event ) dispatched jQuery.Event
  4222. handleObj = types.handleObj;
  4223. jQuery( types.delegateTarget ).off(
  4224. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4225. handleObj.selector,
  4226. handleObj.handler
  4227. );
  4228. return this;
  4229. }
  4230. if ( typeof types === "object" ) {
  4231. // ( types-object [, selector] )
  4232. for ( type in types ) {
  4233. this.off( type, selector, types[ type ] );
  4234. }
  4235. return this;
  4236. }
  4237. if ( selector === false || typeof selector === "function" ) {
  4238. // ( types [, fn] )
  4239. fn = selector;
  4240. selector = undefined;
  4241. }
  4242. if ( fn === false ) {
  4243. fn = returnFalse;
  4244. }
  4245. return this.each(function() {
  4246. jQuery.event.remove( this, types, fn, selector );
  4247. });
  4248. },
  4249. trigger: function( type, data ) {
  4250. return this.each(function() {
  4251. jQuery.event.trigger( type, data, this );
  4252. });
  4253. },
  4254. triggerHandler: function( type, data ) {
  4255. var elem = this[0];
  4256. if ( elem ) {
  4257. return jQuery.event.trigger( type, data, elem, true );
  4258. }
  4259. }
  4260. });
  4261. var
  4262. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  4263. rtagName = /<([\w:]+)/,
  4264. rhtml = /<|&#?\w+;/,
  4265. rnoInnerhtml = /<(?:script|style|link)/i,
  4266. // checked="checked" or checked
  4267. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4268. rscriptType = /^$|\/(?:java|ecma)script/i,
  4269. rscriptTypeMasked = /^true\/(.*)/,
  4270. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  4271. // We have to close these tags to support XHTML (#13200)
  4272. wrapMap = {
  4273. // Support: IE9
  4274. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4275. thead: [ 1, "<table>", "</table>" ],
  4276. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4277. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4278. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4279. _default: [ 0, "", "" ]
  4280. };
  4281. // Support: IE9
  4282. wrapMap.optgroup = wrapMap.option;
  4283. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4284. wrapMap.th = wrapMap.td;
  4285. // Support: 1.x compatibility
  4286. // Manipulating tables requires a tbody
  4287. function manipulationTarget( elem, content ) {
  4288. return jQuery.nodeName( elem, "table" ) &&
  4289. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  4290. elem.getElementsByTagName("tbody")[0] ||
  4291. elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
  4292. elem;
  4293. }
  4294. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4295. function disableScript( elem ) {
  4296. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  4297. return elem;
  4298. }
  4299. function restoreScript( elem ) {
  4300. var match = rscriptTypeMasked.exec( elem.type );
  4301. if ( match ) {
  4302. elem.type = match[ 1 ];
  4303. } else {
  4304. elem.removeAttribute("type");
  4305. }
  4306. return elem;
  4307. }
  4308. // Mark scripts as having already been evaluated
  4309. function setGlobalEval( elems, refElements ) {
  4310. var i = 0,
  4311. l = elems.length;
  4312. for ( ; i < l; i++ ) {
  4313. data_priv.set(
  4314. elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
  4315. );
  4316. }
  4317. }
  4318. function cloneCopyEvent( src, dest ) {
  4319. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  4320. if ( dest.nodeType !== 1 ) {
  4321. return;
  4322. }
  4323. // 1. Copy private data: events, handlers, etc.
  4324. if ( data_priv.hasData( src ) ) {
  4325. pdataOld = data_priv.access( src );
  4326. pdataCur = data_priv.set( dest, pdataOld );
  4327. events = pdataOld.events;
  4328. if ( events ) {
  4329. delete pdataCur.handle;
  4330. pdataCur.events = {};
  4331. for ( type in events ) {
  4332. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4333. jQuery.event.add( dest, type, events[ type ][ i ] );
  4334. }
  4335. }
  4336. }
  4337. }
  4338. // 2. Copy user data
  4339. if ( data_user.hasData( src ) ) {
  4340. udataOld = data_user.access( src );
  4341. udataCur = jQuery.extend( {}, udataOld );
  4342. data_user.set( dest, udataCur );
  4343. }
  4344. }
  4345. function getAll( context, tag ) {
  4346. var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
  4347. context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
  4348. [];
  4349. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  4350. jQuery.merge( [ context ], ret ) :
  4351. ret;
  4352. }
  4353. // Fix IE bugs, see support tests
  4354. function fixInput( src, dest ) {
  4355. var nodeName = dest.nodeName.toLowerCase();
  4356. // Fails to persist the checked state of a cloned checkbox or radio button.
  4357. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4358. dest.checked = src.checked;
  4359. // Fails to return the selected option to the default selected state when cloning options
  4360. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4361. dest.defaultValue = src.defaultValue;
  4362. }
  4363. }
  4364. jQuery.extend({
  4365. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4366. var i, l, srcElements, destElements,
  4367. clone = elem.cloneNode( true ),
  4368. inPage = jQuery.contains( elem.ownerDocument, elem );
  4369. // Fix IE cloning issues
  4370. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4371. !jQuery.isXMLDoc( elem ) ) {
  4372. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  4373. destElements = getAll( clone );
  4374. srcElements = getAll( elem );
  4375. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4376. fixInput( srcElements[ i ], destElements[ i ] );
  4377. }
  4378. }
  4379. // Copy the events from the original to the clone
  4380. if ( dataAndEvents ) {
  4381. if ( deepDataAndEvents ) {
  4382. srcElements = srcElements || getAll( elem );
  4383. destElements = destElements || getAll( clone );
  4384. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4385. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4386. }
  4387. } else {
  4388. cloneCopyEvent( elem, clone );
  4389. }
  4390. }
  4391. // Preserve script evaluation history
  4392. destElements = getAll( clone, "script" );
  4393. if ( destElements.length > 0 ) {
  4394. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4395. }
  4396. // Return the cloned set
  4397. return clone;
  4398. },
  4399. buildFragment: function( elems, context, scripts, selection ) {
  4400. var elem, tmp, tag, wrap, contains, j,
  4401. fragment = context.createDocumentFragment(),
  4402. nodes = [],
  4403. i = 0,
  4404. l = elems.length;
  4405. for ( ; i < l; i++ ) {
  4406. elem = elems[ i ];
  4407. if ( elem || elem === 0 ) {
  4408. // Add nodes directly
  4409. if ( jQuery.type( elem ) === "object" ) {
  4410. // Support: QtWebKit, PhantomJS
  4411. // push.apply(_, arraylike) throws on ancient WebKit
  4412. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4413. // Convert non-html into a text node
  4414. } else if ( !rhtml.test( elem ) ) {
  4415. nodes.push( context.createTextNode( elem ) );
  4416. // Convert html into DOM nodes
  4417. } else {
  4418. tmp = tmp || fragment.appendChild( context.createElement("div") );
  4419. // Deserialize a standard representation
  4420. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4421. wrap = wrapMap[ tag ] || wrapMap._default;
  4422. tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
  4423. // Descend through wrappers to the right content
  4424. j = wrap[ 0 ];
  4425. while ( j-- ) {
  4426. tmp = tmp.lastChild;
  4427. }
  4428. // Support: QtWebKit, PhantomJS
  4429. // push.apply(_, arraylike) throws on ancient WebKit
  4430. jQuery.merge( nodes, tmp.childNodes );
  4431. // Remember the top-level container
  4432. tmp = fragment.firstChild;
  4433. // Ensure the created nodes are orphaned (#12392)
  4434. tmp.textContent = "";
  4435. }
  4436. }
  4437. }
  4438. // Remove wrapper from fragment
  4439. fragment.textContent = "";
  4440. i = 0;
  4441. while ( (elem = nodes[ i++ ]) ) {
  4442. // #4087 - If origin and destination elements are the same, and this is
  4443. // that element, do not do anything
  4444. if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
  4445. continue;
  4446. }
  4447. contains = jQuery.contains( elem.ownerDocument, elem );
  4448. // Append to fragment
  4449. tmp = getAll( fragment.appendChild( elem ), "script" );
  4450. // Preserve script evaluation history
  4451. if ( contains ) {
  4452. setGlobalEval( tmp );
  4453. }
  4454. // Capture executables
  4455. if ( scripts ) {
  4456. j = 0;
  4457. while ( (elem = tmp[ j++ ]) ) {
  4458. if ( rscriptType.test( elem.type || "" ) ) {
  4459. scripts.push( elem );
  4460. }
  4461. }
  4462. }
  4463. }
  4464. return fragment;
  4465. },
  4466. cleanData: function( elems ) {
  4467. var data, elem, type, key,
  4468. special = jQuery.event.special,
  4469. i = 0;
  4470. for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
  4471. if ( jQuery.acceptData( elem ) ) {
  4472. key = elem[ data_priv.expando ];
  4473. if ( key && (data = data_priv.cache[ key ]) ) {
  4474. if ( data.events ) {
  4475. for ( type in data.events ) {
  4476. if ( special[ type ] ) {
  4477. jQuery.event.remove( elem, type );
  4478. // This is a shortcut to avoid jQuery.event.remove's overhead
  4479. } else {
  4480. jQuery.removeEvent( elem, type, data.handle );
  4481. }
  4482. }
  4483. }
  4484. if ( data_priv.cache[ key ] ) {
  4485. // Discard any remaining `private` data
  4486. delete data_priv.cache[ key ];
  4487. }
  4488. }
  4489. }
  4490. // Discard any remaining `user` data
  4491. delete data_user.cache[ elem[ data_user.expando ] ];
  4492. }
  4493. }
  4494. });
  4495. jQuery.fn.extend({
  4496. text: function( value ) {
  4497. return access( this, function( value ) {
  4498. return value === undefined ?
  4499. jQuery.text( this ) :
  4500. this.empty().each(function() {
  4501. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4502. this.textContent = value;
  4503. }
  4504. });
  4505. }, null, value, arguments.length );
  4506. },
  4507. append: function() {
  4508. return this.domManip( arguments, function( elem ) {
  4509. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4510. var target = manipulationTarget( this, elem );
  4511. target.appendChild( elem );
  4512. }
  4513. });
  4514. },
  4515. prepend: function() {
  4516. return this.domManip( arguments, function( elem ) {
  4517. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4518. var target = manipulationTarget( this, elem );
  4519. target.insertBefore( elem, target.firstChild );
  4520. }
  4521. });
  4522. },
  4523. before: function() {
  4524. return this.domManip( arguments, function( elem ) {
  4525. if ( this.parentNode ) {
  4526. this.parentNode.insertBefore( elem, this );
  4527. }
  4528. });
  4529. },
  4530. after: function() {
  4531. return this.domManip( arguments, function( elem ) {
  4532. if ( this.parentNode ) {
  4533. this.parentNode.insertBefore( elem, this.nextSibling );
  4534. }
  4535. });
  4536. },
  4537. remove: function( selector, keepData /* Internal Use Only */ ) {
  4538. var elem,
  4539. elems = selector ? jQuery.filter( selector, this ) : this,
  4540. i = 0;
  4541. for ( ; (elem = elems[i]) != null; i++ ) {
  4542. if ( !keepData && elem.nodeType === 1 ) {
  4543. jQuery.cleanData( getAll( elem ) );
  4544. }
  4545. if ( elem.parentNode ) {
  4546. if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
  4547. setGlobalEval( getAll( elem, "script" ) );
  4548. }
  4549. elem.parentNode.removeChild( elem );
  4550. }
  4551. }
  4552. return this;
  4553. },
  4554. empty: function() {
  4555. var elem,
  4556. i = 0;
  4557. for ( ; (elem = this[i]) != null; i++ ) {
  4558. if ( elem.nodeType === 1 ) {
  4559. // Prevent memory leaks
  4560. jQuery.cleanData( getAll( elem, false ) );
  4561. // Remove any remaining nodes
  4562. elem.textContent = "";
  4563. }
  4564. }
  4565. return this;
  4566. },
  4567. clone: function( dataAndEvents, deepDataAndEvents ) {
  4568. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4569. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4570. return this.map(function() {
  4571. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4572. });
  4573. },
  4574. html: function( value ) {
  4575. return access( this, function( value ) {
  4576. var elem = this[ 0 ] || {},
  4577. i = 0,
  4578. l = this.length;
  4579. if ( value === undefined && elem.nodeType === 1 ) {
  4580. return elem.innerHTML;
  4581. }
  4582. // See if we can take a shortcut and just use innerHTML
  4583. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4584. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  4585. value = value.replace( rxhtmlTag, "<$1></$2>" );
  4586. try {
  4587. for ( ; i < l; i++ ) {
  4588. elem = this[ i ] || {};
  4589. // Remove element nodes and prevent memory leaks
  4590. if ( elem.nodeType === 1 ) {
  4591. jQuery.cleanData( getAll( elem, false ) );
  4592. elem.innerHTML = value;
  4593. }
  4594. }
  4595. elem = 0;
  4596. // If using innerHTML throws an exception, use the fallback method
  4597. } catch( e ) {}
  4598. }
  4599. if ( elem ) {
  4600. this.empty().append( value );
  4601. }
  4602. }, null, value, arguments.length );
  4603. },
  4604. replaceWith: function() {
  4605. var arg = arguments[ 0 ];
  4606. // Make the changes, replacing each context element with the new content
  4607. this.domManip( arguments, function( elem ) {
  4608. arg = this.parentNode;
  4609. jQuery.cleanData( getAll( this ) );
  4610. if ( arg ) {
  4611. arg.replaceChild( elem, this );
  4612. }
  4613. });
  4614. // Force removal if there was no new content (e.g., from empty arguments)
  4615. return arg && (arg.length || arg.nodeType) ? this : this.remove();
  4616. },
  4617. detach: function( selector ) {
  4618. return this.remove( selector, true );
  4619. },
  4620. domManip: function( args, callback ) {
  4621. // Flatten any nested arrays
  4622. args = concat.apply( [], args );
  4623. var fragment, first, scripts, hasScripts, node, doc,
  4624. i = 0,
  4625. l = this.length,
  4626. set = this,
  4627. iNoClone = l - 1,
  4628. value = args[ 0 ],
  4629. isFunction = jQuery.isFunction( value );
  4630. // We can't cloneNode fragments that contain checked, in WebKit
  4631. if ( isFunction ||
  4632. ( l > 1 && typeof value === "string" &&
  4633. !support.checkClone && rchecked.test( value ) ) ) {
  4634. return this.each(function( index ) {
  4635. var self = set.eq( index );
  4636. if ( isFunction ) {
  4637. args[ 0 ] = value.call( this, index, self.html() );
  4638. }
  4639. self.domManip( args, callback );
  4640. });
  4641. }
  4642. if ( l ) {
  4643. fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
  4644. first = fragment.firstChild;
  4645. if ( fragment.childNodes.length === 1 ) {
  4646. fragment = first;
  4647. }
  4648. if ( first ) {
  4649. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4650. hasScripts = scripts.length;
  4651. // Use the original fragment for the last item instead of the first because it can end up
  4652. // being emptied incorrectly in certain situations (#8070).
  4653. for ( ; i < l; i++ ) {
  4654. node = fragment;
  4655. if ( i !== iNoClone ) {
  4656. node = jQuery.clone( node, true, true );
  4657. // Keep references to cloned scripts for later restoration
  4658. if ( hasScripts ) {
  4659. // Support: QtWebKit
  4660. // jQuery.merge because push.apply(_, arraylike) throws
  4661. jQuery.merge( scripts, getAll( node, "script" ) );
  4662. }
  4663. }
  4664. callback.call( this[ i ], node, i );
  4665. }
  4666. if ( hasScripts ) {
  4667. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4668. // Reenable scripts
  4669. jQuery.map( scripts, restoreScript );
  4670. // Evaluate executable scripts on first document insertion
  4671. for ( i = 0; i < hasScripts; i++ ) {
  4672. node = scripts[ i ];
  4673. if ( rscriptType.test( node.type || "" ) &&
  4674. !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
  4675. if ( node.src ) {
  4676. // Optional AJAX dependency, but won't run scripts if not present
  4677. if ( jQuery._evalUrl ) {
  4678. jQuery._evalUrl( node.src );
  4679. }
  4680. } else {
  4681. jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
  4682. }
  4683. }
  4684. }
  4685. }
  4686. }
  4687. }
  4688. return this;
  4689. }
  4690. });
  4691. jQuery.each({
  4692. appendTo: "append",
  4693. prependTo: "prepend",
  4694. insertBefore: "before",
  4695. insertAfter: "after",
  4696. replaceAll: "replaceWith"
  4697. }, function( name, original ) {
  4698. jQuery.fn[ name ] = function( selector ) {
  4699. var elems,
  4700. ret = [],
  4701. insert = jQuery( selector ),
  4702. last = insert.length - 1,
  4703. i = 0;
  4704. for ( ; i <= last; i++ ) {
  4705. elems = i === last ? this : this.clone( true );
  4706. jQuery( insert[ i ] )[ original ]( elems );
  4707. // Support: QtWebKit
  4708. // .get() because push.apply(_, arraylike) throws
  4709. push.apply( ret, elems.get() );
  4710. }
  4711. return this.pushStack( ret );
  4712. };
  4713. });
  4714. var iframe,
  4715. elemdisplay = {};
  4716. /**
  4717. * Retrieve the actual display of a element
  4718. * @param {String} name nodeName of the element
  4719. * @param {Object} doc Document object
  4720. */
  4721. // Called only from within defaultDisplay
  4722. function actualDisplay( name, doc ) {
  4723. var style,
  4724. elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  4725. // getDefaultComputedStyle might be reliably used only on attached element
  4726. display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
  4727. // Use of this method is a temporary fix (more like optimization) until something better comes along,
  4728. // since it was removed from specification and supported only in FF
  4729. style.display : jQuery.css( elem[ 0 ], "display" );
  4730. // We don't have any data stored on the element,
  4731. // so use "detach" method as fast way to get rid of the element
  4732. elem.detach();
  4733. return display;
  4734. }
  4735. /**
  4736. * Try to determine the default display value of an element
  4737. * @param {String} nodeName
  4738. */
  4739. function defaultDisplay( nodeName ) {
  4740. var doc = document,
  4741. display = elemdisplay[ nodeName ];
  4742. if ( !display ) {
  4743. display = actualDisplay( nodeName, doc );
  4744. // If the simple way fails, read from inside an iframe
  4745. if ( display === "none" || !display ) {
  4746. // Use the already-created iframe if possible
  4747. iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
  4748. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  4749. doc = iframe[ 0 ].contentDocument;
  4750. // Support: IE
  4751. doc.write();
  4752. doc.close();
  4753. display = actualDisplay( nodeName, doc );
  4754. iframe.detach();
  4755. }
  4756. // Store the correct default display
  4757. elemdisplay[ nodeName ] = display;
  4758. }
  4759. return display;
  4760. }
  4761. var rmargin = (/^margin/);
  4762. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  4763. var getStyles = function( elem ) {
  4764. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  4765. // IE throws on elements created in popups
  4766. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  4767. if ( elem.ownerDocument.defaultView.opener ) {
  4768. return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
  4769. }
  4770. return window.getComputedStyle( elem, null );
  4771. };
  4772. function curCSS( elem, name, computed ) {
  4773. var width, minWidth, maxWidth, ret,
  4774. style = elem.style;
  4775. computed = computed || getStyles( elem );
  4776. // Support: IE9
  4777. // getPropertyValue is only needed for .css('filter') (#12537)
  4778. if ( computed ) {
  4779. ret = computed.getPropertyValue( name ) || computed[ name ];
  4780. }
  4781. if ( computed ) {
  4782. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  4783. ret = jQuery.style( elem, name );
  4784. }
  4785. // Support: iOS < 6
  4786. // A tribute to the "awesome hack by Dean Edwards"
  4787. // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
  4788. // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
  4789. if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  4790. // Remember the original values
  4791. width = style.width;
  4792. minWidth = style.minWidth;
  4793. maxWidth = style.maxWidth;
  4794. // Put in the new values to get a computed value out
  4795. style.minWidth = style.maxWidth = style.width = ret;
  4796. ret = computed.width;
  4797. // Revert the changed values
  4798. style.width = width;
  4799. style.minWidth = minWidth;
  4800. style.maxWidth = maxWidth;
  4801. }
  4802. }
  4803. return ret !== undefined ?
  4804. // Support: IE
  4805. // IE returns zIndex value as an integer.
  4806. ret + "" :
  4807. ret;
  4808. }
  4809. function addGetHookIf( conditionFn, hookFn ) {
  4810. // Define the hook, we'll check on the first run if it's really needed.
  4811. return {
  4812. get: function() {
  4813. if ( conditionFn() ) {
  4814. // Hook not needed (or it's not possible to use it due
  4815. // to missing dependency), remove it.
  4816. delete this.get;
  4817. return;
  4818. }
  4819. // Hook needed; redefine it so that the support test is not executed again.
  4820. return (this.get = hookFn).apply( this, arguments );
  4821. }
  4822. };
  4823. }
  4824. (function() {
  4825. var pixelPositionVal, boxSizingReliableVal,
  4826. docElem = document.documentElement,
  4827. container = document.createElement( "div" ),
  4828. div = document.createElement( "div" );
  4829. if ( !div.style ) {
  4830. return;
  4831. }
  4832. // Support: IE9-11+
  4833. // Style of cloned element affects source element cloned (#8908)
  4834. div.style.backgroundClip = "content-box";
  4835. div.cloneNode( true ).style.backgroundClip = "";
  4836. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  4837. container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
  4838. "position:absolute";
  4839. container.appendChild( div );
  4840. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  4841. // so they're executed at the same time to save the second computation.
  4842. function computePixelPositionAndBoxSizingReliable() {
  4843. div.style.cssText =
  4844. // Support: Firefox<29, Android 2.3
  4845. // Vendor-prefix box-sizing
  4846. "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
  4847. "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
  4848. "border:1px;padding:1px;width:4px;position:absolute";
  4849. div.innerHTML = "";
  4850. docElem.appendChild( container );
  4851. var divStyle = window.getComputedStyle( div, null );
  4852. pixelPositionVal = divStyle.top !== "1%";
  4853. boxSizingReliableVal = divStyle.width === "4px";
  4854. docElem.removeChild( container );
  4855. }
  4856. // Support: node.js jsdom
  4857. // Don't assume that getComputedStyle is a property of the global object
  4858. if ( window.getComputedStyle ) {
  4859. jQuery.extend( support, {
  4860. pixelPosition: function() {
  4861. // This test is executed only once but we still do memoizing
  4862. // since we can use the boxSizingReliable pre-computing.
  4863. // No need to check if the test was already performed, though.
  4864. computePixelPositionAndBoxSizingReliable();
  4865. return pixelPositionVal;
  4866. },
  4867. boxSizingReliable: function() {
  4868. if ( boxSizingReliableVal == null ) {
  4869. computePixelPositionAndBoxSizingReliable();
  4870. }
  4871. return boxSizingReliableVal;
  4872. },
  4873. reliableMarginRight: function() {
  4874. // Support: Android 2.3
  4875. // Check if div with explicit width and no margin-right incorrectly
  4876. // gets computed margin-right based on width of container. (#3333)
  4877. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  4878. // This support function is only executed once so no memoizing is needed.
  4879. var ret,
  4880. marginDiv = div.appendChild( document.createElement( "div" ) );
  4881. // Reset CSS: box-sizing; display; margin; border; padding
  4882. marginDiv.style.cssText = div.style.cssText =
  4883. // Support: Firefox<29, Android 2.3
  4884. // Vendor-prefix box-sizing
  4885. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  4886. "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
  4887. marginDiv.style.marginRight = marginDiv.style.width = "0";
  4888. div.style.width = "1px";
  4889. docElem.appendChild( container );
  4890. ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
  4891. docElem.removeChild( container );
  4892. div.removeChild( marginDiv );
  4893. return ret;
  4894. }
  4895. });
  4896. }
  4897. })();
  4898. // A method for quickly swapping in/out CSS properties to get correct calculations.
  4899. jQuery.swap = function( elem, options, callback, args ) {
  4900. var ret, name,
  4901. old = {};
  4902. // Remember the old values, and insert the new ones
  4903. for ( name in options ) {
  4904. old[ name ] = elem.style[ name ];
  4905. elem.style[ name ] = options[ name ];
  4906. }
  4907. ret = callback.apply( elem, args || [] );
  4908. // Revert the old values
  4909. for ( name in options ) {
  4910. elem.style[ name ] = old[ name ];
  4911. }
  4912. return ret;
  4913. };
  4914. var
  4915. // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
  4916. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  4917. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  4918. rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
  4919. rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
  4920. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  4921. cssNormalTransform = {
  4922. letterSpacing: "0",
  4923. fontWeight: "400"
  4924. },
  4925. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
  4926. // Return a css property mapped to a potentially vendor prefixed property
  4927. function vendorPropName( style, name ) {
  4928. // Shortcut for names that are not vendor prefixed
  4929. if ( name in style ) {
  4930. return name;
  4931. }
  4932. // Check for vendor prefixed names
  4933. var capName = name[0].toUpperCase() + name.slice(1),
  4934. origName = name,
  4935. i = cssPrefixes.length;
  4936. while ( i-- ) {
  4937. name = cssPrefixes[ i ] + capName;
  4938. if ( name in style ) {
  4939. return name;
  4940. }
  4941. }
  4942. return origName;
  4943. }
  4944. function setPositiveNumber( elem, value, subtract ) {
  4945. var matches = rnumsplit.exec( value );
  4946. return matches ?
  4947. // Guard against undefined "subtract", e.g., when used as in cssHooks
  4948. Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
  4949. value;
  4950. }
  4951. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  4952. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  4953. // If we already have the right measurement, avoid augmentation
  4954. 4 :
  4955. // Otherwise initialize for horizontal or vertical properties
  4956. name === "width" ? 1 : 0,
  4957. val = 0;
  4958. for ( ; i < 4; i += 2 ) {
  4959. // Both box models exclude margin, so add it if we want it
  4960. if ( extra === "margin" ) {
  4961. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  4962. }
  4963. if ( isBorderBox ) {
  4964. // border-box includes padding, so remove it if we want content
  4965. if ( extra === "content" ) {
  4966. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4967. }
  4968. // At this point, extra isn't border nor margin, so remove border
  4969. if ( extra !== "margin" ) {
  4970. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4971. }
  4972. } else {
  4973. // At this point, extra isn't content, so add padding
  4974. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4975. // At this point, extra isn't content nor padding, so add border
  4976. if ( extra !== "padding" ) {
  4977. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4978. }
  4979. }
  4980. }
  4981. return val;
  4982. }
  4983. function getWidthOrHeight( elem, name, extra ) {
  4984. // Start with offset property, which is equivalent to the border-box value
  4985. var valueIsBorderBox = true,
  4986. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  4987. styles = getStyles( elem ),
  4988. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  4989. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  4990. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  4991. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  4992. if ( val <= 0 || val == null ) {
  4993. // Fall back to computed then uncomputed css if necessary
  4994. val = curCSS( elem, name, styles );
  4995. if ( val < 0 || val == null ) {
  4996. val = elem.style[ name ];
  4997. }
  4998. // Computed unit is not pixels. Stop here and return.
  4999. if ( rnumnonpx.test(val) ) {
  5000. return val;
  5001. }
  5002. // Check for style in case a browser which returns unreliable values
  5003. // for getComputedStyle silently falls back to the reliable elem.style
  5004. valueIsBorderBox = isBorderBox &&
  5005. ( support.boxSizingReliable() || val === elem.style[ name ] );
  5006. // Normalize "", auto, and prepare for extra
  5007. val = parseFloat( val ) || 0;
  5008. }
  5009. // Use the active box-sizing model to add/subtract irrelevant styles
  5010. return ( val +
  5011. augmentWidthOrHeight(
  5012. elem,
  5013. name,
  5014. extra || ( isBorderBox ? "border" : "content" ),
  5015. valueIsBorderBox,
  5016. styles
  5017. )
  5018. ) + "px";
  5019. }
  5020. function showHide( elements, show ) {
  5021. var display, elem, hidden,
  5022. values = [],
  5023. index = 0,
  5024. length = elements.length;
  5025. for ( ; index < length; index++ ) {
  5026. elem = elements[ index ];
  5027. if ( !elem.style ) {
  5028. continue;
  5029. }
  5030. values[ index ] = data_priv.get( elem, "olddisplay" );
  5031. display = elem.style.display;
  5032. if ( show ) {
  5033. // Reset the inline display of this element to learn if it is
  5034. // being hidden by cascaded rules or not
  5035. if ( !values[ index ] && display === "none" ) {
  5036. elem.style.display = "";
  5037. }
  5038. // Set elements which have been overridden with display: none
  5039. // in a stylesheet to whatever the default browser style is
  5040. // for such an element
  5041. if ( elem.style.display === "" && isHidden( elem ) ) {
  5042. values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  5043. }
  5044. } else {
  5045. hidden = isHidden( elem );
  5046. if ( display !== "none" || !hidden ) {
  5047. data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
  5048. }
  5049. }
  5050. }
  5051. // Set the display of most of the elements in a second loop
  5052. // to avoid the constant reflow
  5053. for ( index = 0; index < length; index++ ) {
  5054. elem = elements[ index ];
  5055. if ( !elem.style ) {
  5056. continue;
  5057. }
  5058. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  5059. elem.style.display = show ? values[ index ] || "" : "none";
  5060. }
  5061. }
  5062. return elements;
  5063. }
  5064. jQuery.extend({
  5065. // Add in style property hooks for overriding the default
  5066. // behavior of getting and setting a style property
  5067. cssHooks: {
  5068. opacity: {
  5069. get: function( elem, computed ) {
  5070. if ( computed ) {
  5071. // We should always get a number back from opacity
  5072. var ret = curCSS( elem, "opacity" );
  5073. return ret === "" ? "1" : ret;
  5074. }
  5075. }
  5076. }
  5077. },
  5078. // Don't automatically add "px" to these possibly-unitless properties
  5079. cssNumber: {
  5080. "columnCount": true,
  5081. "fillOpacity": true,
  5082. "flexGrow": true,
  5083. "flexShrink": true,
  5084. "fontWeight": true,
  5085. "lineHeight": true,
  5086. "opacity": true,
  5087. "order": true,
  5088. "orphans": true,
  5089. "widows": true,
  5090. "zIndex": true,
  5091. "zoom": true
  5092. },
  5093. // Add in properties whose names you wish to fix before
  5094. // setting or getting the value
  5095. cssProps: {
  5096. "float": "cssFloat"
  5097. },
  5098. // Get and set the style property on a DOM Node
  5099. style: function( elem, name, value, extra ) {
  5100. // Don't set styles on text and comment nodes
  5101. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5102. return;
  5103. }
  5104. // Make sure that we're working with the right name
  5105. var ret, type, hooks,
  5106. origName = jQuery.camelCase( name ),
  5107. style = elem.style;
  5108. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
  5109. // Gets hook for the prefixed version, then unprefixed version
  5110. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5111. // Check if we're setting a value
  5112. if ( value !== undefined ) {
  5113. type = typeof value;
  5114. // Convert "+=" or "-=" to relative numbers (#7345)
  5115. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  5116. value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
  5117. // Fixes bug #9237
  5118. type = "number";
  5119. }
  5120. // Make sure that null and NaN values aren't set (#7116)
  5121. if ( value == null || value !== value ) {
  5122. return;
  5123. }
  5124. // If a number, add 'px' to the (except for certain CSS properties)
  5125. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  5126. value += "px";
  5127. }
  5128. // Support: IE9-11+
  5129. // background-* props affect original clone's values
  5130. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5131. style[ name ] = "inherit";
  5132. }
  5133. // If a hook was provided, use that value, otherwise just set the specified value
  5134. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
  5135. style[ name ] = value;
  5136. }
  5137. } else {
  5138. // If a hook was provided get the non-computed value from there
  5139. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  5140. return ret;
  5141. }
  5142. // Otherwise just get the value from the style object
  5143. return style[ name ];
  5144. }
  5145. },
  5146. css: function( elem, name, extra, styles ) {
  5147. var val, num, hooks,
  5148. origName = jQuery.camelCase( name );
  5149. // Make sure that we're working with the right name
  5150. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
  5151. // Try prefixed name followed by the unprefixed name
  5152. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5153. // If a hook was provided get the computed value from there
  5154. if ( hooks && "get" in hooks ) {
  5155. val = hooks.get( elem, true, extra );
  5156. }
  5157. // Otherwise, if a way to get the computed value exists, use that
  5158. if ( val === undefined ) {
  5159. val = curCSS( elem, name, styles );
  5160. }
  5161. // Convert "normal" to computed value
  5162. if ( val === "normal" && name in cssNormalTransform ) {
  5163. val = cssNormalTransform[ name ];
  5164. }
  5165. // Make numeric if forced or a qualifier was provided and val looks numeric
  5166. if ( extra === "" || extra ) {
  5167. num = parseFloat( val );
  5168. return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
  5169. }
  5170. return val;
  5171. }
  5172. });
  5173. jQuery.each([ "height", "width" ], function( i, name ) {
  5174. jQuery.cssHooks[ name ] = {
  5175. get: function( elem, computed, extra ) {
  5176. if ( computed ) {
  5177. // Certain elements can have dimension info if we invisibly show them
  5178. // but it must have a current display style that would benefit
  5179. return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
  5180. jQuery.swap( elem, cssShow, function() {
  5181. return getWidthOrHeight( elem, name, extra );
  5182. }) :
  5183. getWidthOrHeight( elem, name, extra );
  5184. }
  5185. },
  5186. set: function( elem, value, extra ) {
  5187. var styles = extra && getStyles( elem );
  5188. return setPositiveNumber( elem, value, extra ?
  5189. augmentWidthOrHeight(
  5190. elem,
  5191. name,
  5192. extra,
  5193. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5194. styles
  5195. ) : 0
  5196. );
  5197. }
  5198. };
  5199. });
  5200. // Support: Android 2.3
  5201. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  5202. function( elem, computed ) {
  5203. if ( computed ) {
  5204. return jQuery.swap( elem, { "display": "inline-block" },
  5205. curCSS, [ elem, "marginRight" ] );
  5206. }
  5207. }
  5208. );
  5209. // These hooks are used by animate to expand properties
  5210. jQuery.each({
  5211. margin: "",
  5212. padding: "",
  5213. border: "Width"
  5214. }, function( prefix, suffix ) {
  5215. jQuery.cssHooks[ prefix + suffix ] = {
  5216. expand: function( value ) {
  5217. var i = 0,
  5218. expanded = {},
  5219. // Assumes a single number if not a string
  5220. parts = typeof value === "string" ? value.split(" ") : [ value ];
  5221. for ( ; i < 4; i++ ) {
  5222. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5223. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5224. }
  5225. return expanded;
  5226. }
  5227. };
  5228. if ( !rmargin.test( prefix ) ) {
  5229. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5230. }
  5231. });
  5232. jQuery.fn.extend({
  5233. css: function( name, value ) {
  5234. return access( this, function( elem, name, value ) {
  5235. var styles, len,
  5236. map = {},
  5237. i = 0;
  5238. if ( jQuery.isArray( name ) ) {
  5239. styles = getStyles( elem );
  5240. len = name.length;
  5241. for ( ; i < len; i++ ) {
  5242. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5243. }
  5244. return map;
  5245. }
  5246. return value !== undefined ?
  5247. jQuery.style( elem, name, value ) :
  5248. jQuery.css( elem, name );
  5249. }, name, value, arguments.length > 1 );
  5250. },
  5251. show: function() {
  5252. return showHide( this, true );
  5253. },
  5254. hide: function() {
  5255. return showHide( this );
  5256. },
  5257. toggle: function( state ) {
  5258. if ( typeof state === "boolean" ) {
  5259. return state ? this.show() : this.hide();
  5260. }
  5261. return this.each(function() {
  5262. if ( isHidden( this ) ) {
  5263. jQuery( this ).show();
  5264. } else {
  5265. jQuery( this ).hide();
  5266. }
  5267. });
  5268. }
  5269. });
  5270. function Tween( elem, options, prop, end, easing ) {
  5271. return new Tween.prototype.init( elem, options, prop, end, easing );
  5272. }
  5273. jQuery.Tween = Tween;
  5274. Tween.prototype = {
  5275. constructor: Tween,
  5276. init: function( elem, options, prop, end, easing, unit ) {
  5277. this.elem = elem;
  5278. this.prop = prop;
  5279. this.easing = easing || "swing";
  5280. this.options = options;
  5281. this.start = this.now = this.cur();
  5282. this.end = end;
  5283. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5284. },
  5285. cur: function() {
  5286. var hooks = Tween.propHooks[ this.prop ];
  5287. return hooks && hooks.get ?
  5288. hooks.get( this ) :
  5289. Tween.propHooks._default.get( this );
  5290. },
  5291. run: function( percent ) {
  5292. var eased,
  5293. hooks = Tween.propHooks[ this.prop ];
  5294. if ( this.options.duration ) {
  5295. this.pos = eased = jQuery.easing[ this.easing ](
  5296. percent, this.options.duration * percent, 0, 1, this.options.duration
  5297. );
  5298. } else {
  5299. this.pos = eased = percent;
  5300. }
  5301. this.now = ( this.end - this.start ) * eased + this.start;
  5302. if ( this.options.step ) {
  5303. this.options.step.call( this.elem, this.now, this );
  5304. }
  5305. if ( hooks && hooks.set ) {
  5306. hooks.set( this );
  5307. } else {
  5308. Tween.propHooks._default.set( this );
  5309. }
  5310. return this;
  5311. }
  5312. };
  5313. Tween.prototype.init.prototype = Tween.prototype;
  5314. Tween.propHooks = {
  5315. _default: {
  5316. get: function( tween ) {
  5317. var result;
  5318. if ( tween.elem[ tween.prop ] != null &&
  5319. (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
  5320. return tween.elem[ tween.prop ];
  5321. }
  5322. // Passing an empty string as a 3rd parameter to .css will automatically
  5323. // attempt a parseFloat and fallback to a string if the parse fails.
  5324. // Simple values such as "10px" are parsed to Float;
  5325. // complex values such as "rotate(1rad)" are returned as-is.
  5326. result = jQuery.css( tween.elem, tween.prop, "" );
  5327. // Empty strings, null, undefined and "auto" are converted to 0.
  5328. return !result || result === "auto" ? 0 : result;
  5329. },
  5330. set: function( tween ) {
  5331. // Use step hook for back compat.
  5332. // Use cssHook if its there.
  5333. // Use .style if available and use plain properties where available.
  5334. if ( jQuery.fx.step[ tween.prop ] ) {
  5335. jQuery.fx.step[ tween.prop ]( tween );
  5336. } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
  5337. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5338. } else {
  5339. tween.elem[ tween.prop ] = tween.now;
  5340. }
  5341. }
  5342. }
  5343. };
  5344. // Support: IE9
  5345. // Panic based approach to setting things on disconnected nodes
  5346. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5347. set: function( tween ) {
  5348. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5349. tween.elem[ tween.prop ] = tween.now;
  5350. }
  5351. }
  5352. };
  5353. jQuery.easing = {
  5354. linear: function( p ) {
  5355. return p;
  5356. },
  5357. swing: function( p ) {
  5358. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5359. }
  5360. };
  5361. jQuery.fx = Tween.prototype.init;
  5362. // Back Compat <1.8 extension point
  5363. jQuery.fx.step = {};
  5364. var
  5365. fxNow, timerId,
  5366. rfxtypes = /^(?:toggle|show|hide)$/,
  5367. rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
  5368. rrun = /queueHooks$/,
  5369. animationPrefilters = [ defaultPrefilter ],
  5370. tweeners = {
  5371. "*": [ function( prop, value ) {
  5372. var tween = this.createTween( prop, value ),
  5373. target = tween.cur(),
  5374. parts = rfxnum.exec( value ),
  5375. unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  5376. // Starting value computation is required for potential unit mismatches
  5377. start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
  5378. rfxnum.exec( jQuery.css( tween.elem, prop ) ),
  5379. scale = 1,
  5380. maxIterations = 20;
  5381. if ( start && start[ 3 ] !== unit ) {
  5382. // Trust units reported by jQuery.css
  5383. unit = unit || start[ 3 ];
  5384. // Make sure we update the tween properties later on
  5385. parts = parts || [];
  5386. // Iteratively approximate from a nonzero starting point
  5387. start = +target || 1;
  5388. do {
  5389. // If previous iteration zeroed out, double until we get *something*.
  5390. // Use string for doubling so we don't accidentally see scale as unchanged below
  5391. scale = scale || ".5";
  5392. // Adjust and apply
  5393. start = start / scale;
  5394. jQuery.style( tween.elem, prop, start + unit );
  5395. // Update scale, tolerating zero or NaN from tween.cur(),
  5396. // break the loop if scale is unchanged or perfect, or if we've just had enough
  5397. } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
  5398. }
  5399. // Update tween properties
  5400. if ( parts ) {
  5401. start = tween.start = +start || +target || 0;
  5402. tween.unit = unit;
  5403. // If a +=/-= token was provided, we're doing a relative animation
  5404. tween.end = parts[ 1 ] ?
  5405. start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
  5406. +parts[ 2 ];
  5407. }
  5408. return tween;
  5409. } ]
  5410. };
  5411. // Animations created synchronously will run synchronously
  5412. function createFxNow() {
  5413. setTimeout(function() {
  5414. fxNow = undefined;
  5415. });
  5416. return ( fxNow = jQuery.now() );
  5417. }
  5418. // Generate parameters to create a standard animation
  5419. function genFx( type, includeWidth ) {
  5420. var which,
  5421. i = 0,
  5422. attrs = { height: type };
  5423. // If we include width, step value is 1 to do all cssExpand values,
  5424. // otherwise step value is 2 to skip over Left and Right
  5425. includeWidth = includeWidth ? 1 : 0;
  5426. for ( ; i < 4 ; i += 2 - includeWidth ) {
  5427. which = cssExpand[ i ];
  5428. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5429. }
  5430. if ( includeWidth ) {
  5431. attrs.opacity = attrs.width = type;
  5432. }
  5433. return attrs;
  5434. }
  5435. function createTween( value, prop, animation ) {
  5436. var tween,
  5437. collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
  5438. index = 0,
  5439. length = collection.length;
  5440. for ( ; index < length; index++ ) {
  5441. if ( (tween = collection[ index ].call( animation, prop, value )) ) {
  5442. // We're done with this property
  5443. return tween;
  5444. }
  5445. }
  5446. }
  5447. function defaultPrefilter( elem, props, opts ) {
  5448. /* jshint validthis: true */
  5449. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  5450. anim = this,
  5451. orig = {},
  5452. style = elem.style,
  5453. hidden = elem.nodeType && isHidden( elem ),
  5454. dataShow = data_priv.get( elem, "fxshow" );
  5455. // Handle queue: false promises
  5456. if ( !opts.queue ) {
  5457. hooks = jQuery._queueHooks( elem, "fx" );
  5458. if ( hooks.unqueued == null ) {
  5459. hooks.unqueued = 0;
  5460. oldfire = hooks.empty.fire;
  5461. hooks.empty.fire = function() {
  5462. if ( !hooks.unqueued ) {
  5463. oldfire();
  5464. }
  5465. };
  5466. }
  5467. hooks.unqueued++;
  5468. anim.always(function() {
  5469. // Ensure the complete handler is called before this completes
  5470. anim.always(function() {
  5471. hooks.unqueued--;
  5472. if ( !jQuery.queue( elem, "fx" ).length ) {
  5473. hooks.empty.fire();
  5474. }
  5475. });
  5476. });
  5477. }
  5478. // Height/width overflow pass
  5479. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  5480. // Make sure that nothing sneaks out
  5481. // Record all 3 overflow attributes because IE9-10 do not
  5482. // change the overflow attribute when overflowX and
  5483. // overflowY are set to the same value
  5484. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5485. // Set display property to inline-block for height/width
  5486. // animations on inline elements that are having width/height animated
  5487. display = jQuery.css( elem, "display" );
  5488. // Test default display if display is currently "none"
  5489. checkDisplay = display === "none" ?
  5490. data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  5491. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  5492. style.display = "inline-block";
  5493. }
  5494. }
  5495. if ( opts.overflow ) {
  5496. style.overflow = "hidden";
  5497. anim.always(function() {
  5498. style.overflow = opts.overflow[ 0 ];
  5499. style.overflowX = opts.overflow[ 1 ];
  5500. style.overflowY = opts.overflow[ 2 ];
  5501. });
  5502. }
  5503. // show/hide pass
  5504. for ( prop in props ) {
  5505. value = props[ prop ];
  5506. if ( rfxtypes.exec( value ) ) {
  5507. delete props[ prop ];
  5508. toggle = toggle || value === "toggle";
  5509. if ( value === ( hidden ? "hide" : "show" ) ) {
  5510. // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
  5511. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5512. hidden = true;
  5513. } else {
  5514. continue;
  5515. }
  5516. }
  5517. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5518. // Any non-fx value stops us from restoring the original display value
  5519. } else {
  5520. display = undefined;
  5521. }
  5522. }
  5523. if ( !jQuery.isEmptyObject( orig ) ) {
  5524. if ( dataShow ) {
  5525. if ( "hidden" in dataShow ) {
  5526. hidden = dataShow.hidden;
  5527. }
  5528. } else {
  5529. dataShow = data_priv.access( elem, "fxshow", {} );
  5530. }
  5531. // Store state if its toggle - enables .stop().toggle() to "reverse"
  5532. if ( toggle ) {
  5533. dataShow.hidden = !hidden;
  5534. }
  5535. if ( hidden ) {
  5536. jQuery( elem ).show();
  5537. } else {
  5538. anim.done(function() {
  5539. jQuery( elem ).hide();
  5540. });
  5541. }
  5542. anim.done(function() {
  5543. var prop;
  5544. data_priv.remove( elem, "fxshow" );
  5545. for ( prop in orig ) {
  5546. jQuery.style( elem, prop, orig[ prop ] );
  5547. }
  5548. });
  5549. for ( prop in orig ) {
  5550. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5551. if ( !( prop in dataShow ) ) {
  5552. dataShow[ prop ] = tween.start;
  5553. if ( hidden ) {
  5554. tween.end = tween.start;
  5555. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  5556. }
  5557. }
  5558. }
  5559. // If this is a noop like .hide().hide(), restore an overwritten display value
  5560. } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
  5561. style.display = display;
  5562. }
  5563. }
  5564. function propFilter( props, specialEasing ) {
  5565. var index, name, easing, value, hooks;
  5566. // camelCase, specialEasing and expand cssHook pass
  5567. for ( index in props ) {
  5568. name = jQuery.camelCase( index );
  5569. easing = specialEasing[ name ];
  5570. value = props[ index ];
  5571. if ( jQuery.isArray( value ) ) {
  5572. easing = value[ 1 ];
  5573. value = props[ index ] = value[ 0 ];
  5574. }
  5575. if ( index !== name ) {
  5576. props[ name ] = value;
  5577. delete props[ index ];
  5578. }
  5579. hooks = jQuery.cssHooks[ name ];
  5580. if ( hooks && "expand" in hooks ) {
  5581. value = hooks.expand( value );
  5582. delete props[ name ];
  5583. // Not quite $.extend, this won't overwrite existing keys.
  5584. // Reusing 'index' because we have the correct "name"
  5585. for ( index in value ) {
  5586. if ( !( index in props ) ) {
  5587. props[ index ] = value[ index ];
  5588. specialEasing[ index ] = easing;
  5589. }
  5590. }
  5591. } else {
  5592. specialEasing[ name ] = easing;
  5593. }
  5594. }
  5595. }
  5596. function Animation( elem, properties, options ) {
  5597. var result,
  5598. stopped,
  5599. index = 0,
  5600. length = animationPrefilters.length,
  5601. deferred = jQuery.Deferred().always( function() {
  5602. // Don't match elem in the :animated selector
  5603. delete tick.elem;
  5604. }),
  5605. tick = function() {
  5606. if ( stopped ) {
  5607. return false;
  5608. }
  5609. var currentTime = fxNow || createFxNow(),
  5610. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  5611. // Support: Android 2.3
  5612. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  5613. temp = remaining / animation.duration || 0,
  5614. percent = 1 - temp,
  5615. index = 0,
  5616. length = animation.tweens.length;
  5617. for ( ; index < length ; index++ ) {
  5618. animation.tweens[ index ].run( percent );
  5619. }
  5620. deferred.notifyWith( elem, [ animation, percent, remaining ]);
  5621. if ( percent < 1 && length ) {
  5622. return remaining;
  5623. } else {
  5624. deferred.resolveWith( elem, [ animation ] );
  5625. return false;
  5626. }
  5627. },
  5628. animation = deferred.promise({
  5629. elem: elem,
  5630. props: jQuery.extend( {}, properties ),
  5631. opts: jQuery.extend( true, { specialEasing: {} }, options ),
  5632. originalProperties: properties,
  5633. originalOptions: options,
  5634. startTime: fxNow || createFxNow(),
  5635. duration: options.duration,
  5636. tweens: [],
  5637. createTween: function( prop, end ) {
  5638. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  5639. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  5640. animation.tweens.push( tween );
  5641. return tween;
  5642. },
  5643. stop: function( gotoEnd ) {
  5644. var index = 0,
  5645. // If we are going to the end, we want to run all the tweens
  5646. // otherwise we skip this part
  5647. length = gotoEnd ? animation.tweens.length : 0;
  5648. if ( stopped ) {
  5649. return this;
  5650. }
  5651. stopped = true;
  5652. for ( ; index < length ; index++ ) {
  5653. animation.tweens[ index ].run( 1 );
  5654. }
  5655. // Resolve when we played the last frame; otherwise, reject
  5656. if ( gotoEnd ) {
  5657. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  5658. } else {
  5659. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  5660. }
  5661. return this;
  5662. }
  5663. }),
  5664. props = animation.props;
  5665. propFilter( props, animation.opts.specialEasing );
  5666. for ( ; index < length ; index++ ) {
  5667. result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
  5668. if ( result ) {
  5669. return result;
  5670. }
  5671. }
  5672. jQuery.map( props, createTween, animation );
  5673. if ( jQuery.isFunction( animation.opts.start ) ) {
  5674. animation.opts.start.call( elem, animation );
  5675. }
  5676. jQuery.fx.timer(
  5677. jQuery.extend( tick, {
  5678. elem: elem,
  5679. anim: animation,
  5680. queue: animation.opts.queue
  5681. })
  5682. );
  5683. // attach callbacks from options
  5684. return animation.progress( animation.opts.progress )
  5685. .done( animation.opts.done, animation.opts.complete )
  5686. .fail( animation.opts.fail )
  5687. .always( animation.opts.always );
  5688. }
  5689. jQuery.Animation = jQuery.extend( Animation, {
  5690. tweener: function( props, callback ) {
  5691. if ( jQuery.isFunction( props ) ) {
  5692. callback = props;
  5693. props = [ "*" ];
  5694. } else {
  5695. props = props.split(" ");
  5696. }
  5697. var prop,
  5698. index = 0,
  5699. length = props.length;
  5700. for ( ; index < length ; index++ ) {
  5701. prop = props[ index ];
  5702. tweeners[ prop ] = tweeners[ prop ] || [];
  5703. tweeners[ prop ].unshift( callback );
  5704. }
  5705. },
  5706. prefilter: function( callback, prepend ) {
  5707. if ( prepend ) {
  5708. animationPrefilters.unshift( callback );
  5709. } else {
  5710. animationPrefilters.push( callback );
  5711. }
  5712. }
  5713. });
  5714. jQuery.speed = function( speed, easing, fn ) {
  5715. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  5716. complete: fn || !fn && easing ||
  5717. jQuery.isFunction( speed ) && speed,
  5718. duration: speed,
  5719. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  5720. };
  5721. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  5722. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  5723. // Normalize opt.queue - true/undefined/null -> "fx"
  5724. if ( opt.queue == null || opt.queue === true ) {
  5725. opt.queue = "fx";
  5726. }
  5727. // Queueing
  5728. opt.old = opt.complete;
  5729. opt.complete = function() {
  5730. if ( jQuery.isFunction( opt.old ) ) {
  5731. opt.old.call( this );
  5732. }
  5733. if ( opt.queue ) {
  5734. jQuery.dequeue( this, opt.queue );
  5735. }
  5736. };
  5737. return opt;
  5738. };
  5739. jQuery.fn.extend({
  5740. fadeTo: function( speed, to, easing, callback ) {
  5741. // Show any hidden elements after setting opacity to 0
  5742. return this.filter( isHidden ).css( "opacity", 0 ).show()
  5743. // Animate to the value specified
  5744. .end().animate({ opacity: to }, speed, easing, callback );
  5745. },
  5746. animate: function( prop, speed, easing, callback ) {
  5747. var empty = jQuery.isEmptyObject( prop ),
  5748. optall = jQuery.speed( speed, easing, callback ),
  5749. doAnimation = function() {
  5750. // Operate on a copy of prop so per-property easing won't be lost
  5751. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  5752. // Empty animations, or finishing resolves immediately
  5753. if ( empty || data_priv.get( this, "finish" ) ) {
  5754. anim.stop( true );
  5755. }
  5756. };
  5757. doAnimation.finish = doAnimation;
  5758. return empty || optall.queue === false ?
  5759. this.each( doAnimation ) :
  5760. this.queue( optall.queue, doAnimation );
  5761. },
  5762. stop: function( type, clearQueue, gotoEnd ) {
  5763. var stopQueue = function( hooks ) {
  5764. var stop = hooks.stop;
  5765. delete hooks.stop;
  5766. stop( gotoEnd );
  5767. };
  5768. if ( typeof type !== "string" ) {
  5769. gotoEnd = clearQueue;
  5770. clearQueue = type;
  5771. type = undefined;
  5772. }
  5773. if ( clearQueue && type !== false ) {
  5774. this.queue( type || "fx", [] );
  5775. }
  5776. return this.each(function() {
  5777. var dequeue = true,
  5778. index = type != null && type + "queueHooks",
  5779. timers = jQuery.timers,
  5780. data = data_priv.get( this );
  5781. if ( index ) {
  5782. if ( data[ index ] && data[ index ].stop ) {
  5783. stopQueue( data[ index ] );
  5784. }
  5785. } else {
  5786. for ( index in data ) {
  5787. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  5788. stopQueue( data[ index ] );
  5789. }
  5790. }
  5791. }
  5792. for ( index = timers.length; index--; ) {
  5793. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  5794. timers[ index ].anim.stop( gotoEnd );
  5795. dequeue = false;
  5796. timers.splice( index, 1 );
  5797. }
  5798. }
  5799. // Start the next in the queue if the last step wasn't forced.
  5800. // Timers currently will call their complete callbacks, which
  5801. // will dequeue but only if they were gotoEnd.
  5802. if ( dequeue || !gotoEnd ) {
  5803. jQuery.dequeue( this, type );
  5804. }
  5805. });
  5806. },
  5807. finish: function( type ) {
  5808. if ( type !== false ) {
  5809. type = type || "fx";
  5810. }
  5811. return this.each(function() {
  5812. var index,
  5813. data = data_priv.get( this ),
  5814. queue = data[ type + "queue" ],
  5815. hooks = data[ type + "queueHooks" ],
  5816. timers = jQuery.timers,
  5817. length = queue ? queue.length : 0;
  5818. // Enable finishing flag on private data
  5819. data.finish = true;
  5820. // Empty the queue first
  5821. jQuery.queue( this, type, [] );
  5822. if ( hooks && hooks.stop ) {
  5823. hooks.stop.call( this, true );
  5824. }
  5825. // Look for any active animations, and finish them
  5826. for ( index = timers.length; index--; ) {
  5827. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  5828. timers[ index ].anim.stop( true );
  5829. timers.splice( index, 1 );
  5830. }
  5831. }
  5832. // Look for any animations in the old queue and finish them
  5833. for ( index = 0; index < length; index++ ) {
  5834. if ( queue[ index ] && queue[ index ].finish ) {
  5835. queue[ index ].finish.call( this );
  5836. }
  5837. }
  5838. // Turn off finishing flag
  5839. delete data.finish;
  5840. });
  5841. }
  5842. });
  5843. jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
  5844. var cssFn = jQuery.fn[ name ];
  5845. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5846. return speed == null || typeof speed === "boolean" ?
  5847. cssFn.apply( this, arguments ) :
  5848. this.animate( genFx( name, true ), speed, easing, callback );
  5849. };
  5850. });
  5851. // Generate shortcuts for custom animations
  5852. jQuery.each({
  5853. slideDown: genFx("show"),
  5854. slideUp: genFx("hide"),
  5855. slideToggle: genFx("toggle"),
  5856. fadeIn: { opacity: "show" },
  5857. fadeOut: { opacity: "hide" },
  5858. fadeToggle: { opacity: "toggle" }
  5859. }, function( name, props ) {
  5860. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5861. return this.animate( props, speed, easing, callback );
  5862. };
  5863. });
  5864. jQuery.timers = [];
  5865. jQuery.fx.tick = function() {
  5866. var timer,
  5867. i = 0,
  5868. timers = jQuery.timers;
  5869. fxNow = jQuery.now();
  5870. for ( ; i < timers.length; i++ ) {
  5871. timer = timers[ i ];
  5872. // Checks the timer has not already been removed
  5873. if ( !timer() && timers[ i ] === timer ) {
  5874. timers.splice( i--, 1 );
  5875. }
  5876. }
  5877. if ( !timers.length ) {
  5878. jQuery.fx.stop();
  5879. }
  5880. fxNow = undefined;
  5881. };
  5882. jQuery.fx.timer = function( timer ) {
  5883. jQuery.timers.push( timer );
  5884. if ( timer() ) {
  5885. jQuery.fx.start();
  5886. } else {
  5887. jQuery.timers.pop();
  5888. }
  5889. };
  5890. jQuery.fx.interval = 13;
  5891. jQuery.fx.start = function() {
  5892. if ( !timerId ) {
  5893. timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
  5894. }
  5895. };
  5896. jQuery.fx.stop = function() {
  5897. clearInterval( timerId );
  5898. timerId = null;
  5899. };
  5900. jQuery.fx.speeds = {
  5901. slow: 600,
  5902. fast: 200,
  5903. // Default speed
  5904. _default: 400
  5905. };
  5906. // Based off of the plugin by Clint Helfers, with permission.
  5907. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  5908. jQuery.fn.delay = function( time, type ) {
  5909. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  5910. type = type || "fx";
  5911. return this.queue( type, function( next, hooks ) {
  5912. var timeout = setTimeout( next, time );
  5913. hooks.stop = function() {
  5914. clearTimeout( timeout );
  5915. };
  5916. });
  5917. };
  5918. (function() {
  5919. var input = document.createElement( "input" ),
  5920. select = document.createElement( "select" ),
  5921. opt = select.appendChild( document.createElement( "option" ) );
  5922. input.type = "checkbox";
  5923. // Support: iOS<=5.1, Android<=4.2+
  5924. // Default value for a checkbox should be "on"
  5925. support.checkOn = input.value !== "";
  5926. // Support: IE<=11+
  5927. // Must access selectedIndex to make default options select
  5928. support.optSelected = opt.selected;
  5929. // Support: Android<=2.3
  5930. // Options inside disabled selects are incorrectly marked as disabled
  5931. select.disabled = true;
  5932. support.optDisabled = !opt.disabled;
  5933. // Support: IE<=11+
  5934. // An input loses its value after becoming a radio
  5935. input = document.createElement( "input" );
  5936. input.value = "t";
  5937. input.type = "radio";
  5938. support.radioValue = input.value === "t";
  5939. })();
  5940. var nodeHook, boolHook,
  5941. attrHandle = jQuery.expr.attrHandle;
  5942. jQuery.fn.extend({
  5943. attr: function( name, value ) {
  5944. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  5945. },
  5946. removeAttr: function( name ) {
  5947. return this.each(function() {
  5948. jQuery.removeAttr( this, name );
  5949. });
  5950. }
  5951. });
  5952. jQuery.extend({
  5953. attr: function( elem, name, value ) {
  5954. var hooks, ret,
  5955. nType = elem.nodeType;
  5956. // don't get/set attributes on text, comment and attribute nodes
  5957. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  5958. return;
  5959. }
  5960. // Fallback to prop when attributes are not supported
  5961. if ( typeof elem.getAttribute === strundefined ) {
  5962. return jQuery.prop( elem, name, value );
  5963. }
  5964. // All attributes are lowercase
  5965. // Grab necessary hook if one is defined
  5966. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  5967. name = name.toLowerCase();
  5968. hooks = jQuery.attrHooks[ name ] ||
  5969. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  5970. }
  5971. if ( value !== undefined ) {
  5972. if ( value === null ) {
  5973. jQuery.removeAttr( elem, name );
  5974. } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  5975. return ret;
  5976. } else {
  5977. elem.setAttribute( name, value + "" );
  5978. return value;
  5979. }
  5980. } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  5981. return ret;
  5982. } else {
  5983. ret = jQuery.find.attr( elem, name );
  5984. // Non-existent attributes return null, we normalize to undefined
  5985. return ret == null ?
  5986. undefined :
  5987. ret;
  5988. }
  5989. },
  5990. removeAttr: function( elem, value ) {
  5991. var name, propName,
  5992. i = 0,
  5993. attrNames = value && value.match( rnotwhite );
  5994. if ( attrNames && elem.nodeType === 1 ) {
  5995. while ( (name = attrNames[i++]) ) {
  5996. propName = jQuery.propFix[ name ] || name;
  5997. // Boolean attributes get special treatment (#10870)
  5998. if ( jQuery.expr.match.bool.test( name ) ) {
  5999. // Set corresponding property to false
  6000. elem[ propName ] = false;
  6001. }
  6002. elem.removeAttribute( name );
  6003. }
  6004. }
  6005. },
  6006. attrHooks: {
  6007. type: {
  6008. set: function( elem, value ) {
  6009. if ( !support.radioValue && value === "radio" &&
  6010. jQuery.nodeName( elem, "input" ) ) {
  6011. var val = elem.value;
  6012. elem.setAttribute( "type", value );
  6013. if ( val ) {
  6014. elem.value = val;
  6015. }
  6016. return value;
  6017. }
  6018. }
  6019. }
  6020. }
  6021. });
  6022. // Hooks for boolean attributes
  6023. boolHook = {
  6024. set: function( elem, value, name ) {
  6025. if ( value === false ) {
  6026. // Remove boolean attributes when set to false
  6027. jQuery.removeAttr( elem, name );
  6028. } else {
  6029. elem.setAttribute( name, name );
  6030. }
  6031. return name;
  6032. }
  6033. };
  6034. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  6035. var getter = attrHandle[ name ] || jQuery.find.attr;
  6036. attrHandle[ name ] = function( elem, name, isXML ) {
  6037. var ret, handle;
  6038. if ( !isXML ) {
  6039. // Avoid an infinite loop by temporarily removing this function from the getter
  6040. handle = attrHandle[ name ];
  6041. attrHandle[ name ] = ret;
  6042. ret = getter( elem, name, isXML ) != null ?
  6043. name.toLowerCase() :
  6044. null;
  6045. attrHandle[ name ] = handle;
  6046. }
  6047. return ret;
  6048. };
  6049. });
  6050. var rfocusable = /^(?:input|select|textarea|button)$/i;
  6051. jQuery.fn.extend({
  6052. prop: function( name, value ) {
  6053. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6054. },
  6055. removeProp: function( name ) {
  6056. return this.each(function() {
  6057. delete this[ jQuery.propFix[ name ] || name ];
  6058. });
  6059. }
  6060. });
  6061. jQuery.extend({
  6062. propFix: {
  6063. "for": "htmlFor",
  6064. "class": "className"
  6065. },
  6066. prop: function( elem, name, value ) {
  6067. var ret, hooks, notxml,
  6068. nType = elem.nodeType;
  6069. // Don't get/set properties on text, comment and attribute nodes
  6070. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  6071. return;
  6072. }
  6073. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  6074. if ( notxml ) {
  6075. // Fix name and attach hooks
  6076. name = jQuery.propFix[ name ] || name;
  6077. hooks = jQuery.propHooks[ name ];
  6078. }
  6079. if ( value !== undefined ) {
  6080. return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
  6081. ret :
  6082. ( elem[ name ] = value );
  6083. } else {
  6084. return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
  6085. ret :
  6086. elem[ name ];
  6087. }
  6088. },
  6089. propHooks: {
  6090. tabIndex: {
  6091. get: function( elem ) {
  6092. return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
  6093. elem.tabIndex :
  6094. -1;
  6095. }
  6096. }
  6097. }
  6098. });
  6099. if ( !support.optSelected ) {
  6100. jQuery.propHooks.selected = {
  6101. get: function( elem ) {
  6102. var parent = elem.parentNode;
  6103. if ( parent && parent.parentNode ) {
  6104. parent.parentNode.selectedIndex;
  6105. }
  6106. return null;
  6107. }
  6108. };
  6109. }
  6110. jQuery.each([
  6111. "tabIndex",
  6112. "readOnly",
  6113. "maxLength",
  6114. "cellSpacing",
  6115. "cellPadding",
  6116. "rowSpan",
  6117. "colSpan",
  6118. "useMap",
  6119. "frameBorder",
  6120. "contentEditable"
  6121. ], function() {
  6122. jQuery.propFix[ this.toLowerCase() ] = this;
  6123. });
  6124. var rclass = /[\t\r\n\f]/g;
  6125. jQuery.fn.extend({
  6126. addClass: function( value ) {
  6127. var classes, elem, cur, clazz, j, finalValue,
  6128. proceed = typeof value === "string" && value,
  6129. i = 0,
  6130. len = this.length;
  6131. if ( jQuery.isFunction( value ) ) {
  6132. return this.each(function( j ) {
  6133. jQuery( this ).addClass( value.call( this, j, this.className ) );
  6134. });
  6135. }
  6136. if ( proceed ) {
  6137. // The disjunction here is for better compressibility (see removeClass)
  6138. classes = ( value || "" ).match( rnotwhite ) || [];
  6139. for ( ; i < len; i++ ) {
  6140. elem = this[ i ];
  6141. cur = elem.nodeType === 1 && ( elem.className ?
  6142. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6143. " "
  6144. );
  6145. if ( cur ) {
  6146. j = 0;
  6147. while ( (clazz = classes[j++]) ) {
  6148. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6149. cur += clazz + " ";
  6150. }
  6151. }
  6152. // only assign if different to avoid unneeded rendering.
  6153. finalValue = jQuery.trim( cur );
  6154. if ( elem.className !== finalValue ) {
  6155. elem.className = finalValue;
  6156. }
  6157. }
  6158. }
  6159. }
  6160. return this;
  6161. },
  6162. removeClass: function( value ) {
  6163. var classes, elem, cur, clazz, j, finalValue,
  6164. proceed = arguments.length === 0 || typeof value === "string" && value,
  6165. i = 0,
  6166. len = this.length;
  6167. if ( jQuery.isFunction( value ) ) {
  6168. return this.each(function( j ) {
  6169. jQuery( this ).removeClass( value.call( this, j, this.className ) );
  6170. });
  6171. }
  6172. if ( proceed ) {
  6173. classes = ( value || "" ).match( rnotwhite ) || [];
  6174. for ( ; i < len; i++ ) {
  6175. elem = this[ i ];
  6176. // This expression is here for better compressibility (see addClass)
  6177. cur = elem.nodeType === 1 && ( elem.className ?
  6178. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6179. ""
  6180. );
  6181. if ( cur ) {
  6182. j = 0;
  6183. while ( (clazz = classes[j++]) ) {
  6184. // Remove *all* instances
  6185. while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
  6186. cur = cur.replace( " " + clazz + " ", " " );
  6187. }
  6188. }
  6189. // Only assign if different to avoid unneeded rendering.
  6190. finalValue = value ? jQuery.trim( cur ) : "";
  6191. if ( elem.className !== finalValue ) {
  6192. elem.className = finalValue;
  6193. }
  6194. }
  6195. }
  6196. }
  6197. return this;
  6198. },
  6199. toggleClass: function( value, stateVal ) {
  6200. var type = typeof value;
  6201. if ( typeof stateVal === "boolean" && type === "string" ) {
  6202. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6203. }
  6204. if ( jQuery.isFunction( value ) ) {
  6205. return this.each(function( i ) {
  6206. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  6207. });
  6208. }
  6209. return this.each(function() {
  6210. if ( type === "string" ) {
  6211. // Toggle individual class names
  6212. var className,
  6213. i = 0,
  6214. self = jQuery( this ),
  6215. classNames = value.match( rnotwhite ) || [];
  6216. while ( (className = classNames[ i++ ]) ) {
  6217. // Check each className given, space separated list
  6218. if ( self.hasClass( className ) ) {
  6219. self.removeClass( className );
  6220. } else {
  6221. self.addClass( className );
  6222. }
  6223. }
  6224. // Toggle whole class name
  6225. } else if ( type === strundefined || type === "boolean" ) {
  6226. if ( this.className ) {
  6227. // store className if set
  6228. data_priv.set( this, "__className__", this.className );
  6229. }
  6230. // If the element has a class name or if we're passed `false`,
  6231. // then remove the whole classname (if there was one, the above saved it).
  6232. // Otherwise bring back whatever was previously saved (if anything),
  6233. // falling back to the empty string if nothing was stored.
  6234. this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
  6235. }
  6236. });
  6237. },
  6238. hasClass: function( selector ) {
  6239. var className = " " + selector + " ",
  6240. i = 0,
  6241. l = this.length;
  6242. for ( ; i < l; i++ ) {
  6243. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
  6244. return true;
  6245. }
  6246. }
  6247. return false;
  6248. }
  6249. });
  6250. var rreturn = /\r/g;
  6251. jQuery.fn.extend({
  6252. val: function( value ) {
  6253. var hooks, ret, isFunction,
  6254. elem = this[0];
  6255. if ( !arguments.length ) {
  6256. if ( elem ) {
  6257. hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6258. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  6259. return ret;
  6260. }
  6261. ret = elem.value;
  6262. return typeof ret === "string" ?
  6263. // Handle most common string cases
  6264. ret.replace(rreturn, "") :
  6265. // Handle cases where value is null/undef or number
  6266. ret == null ? "" : ret;
  6267. }
  6268. return;
  6269. }
  6270. isFunction = jQuery.isFunction( value );
  6271. return this.each(function( i ) {
  6272. var val;
  6273. if ( this.nodeType !== 1 ) {
  6274. return;
  6275. }
  6276. if ( isFunction ) {
  6277. val = value.call( this, i, jQuery( this ).val() );
  6278. } else {
  6279. val = value;
  6280. }
  6281. // Treat null/undefined as ""; convert numbers to string
  6282. if ( val == null ) {
  6283. val = "";
  6284. } else if ( typeof val === "number" ) {
  6285. val += "";
  6286. } else if ( jQuery.isArray( val ) ) {
  6287. val = jQuery.map( val, function( value ) {
  6288. return value == null ? "" : value + "";
  6289. });
  6290. }
  6291. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6292. // If set returns undefined, fall back to normal setting
  6293. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  6294. this.value = val;
  6295. }
  6296. });
  6297. }
  6298. });
  6299. jQuery.extend({
  6300. valHooks: {
  6301. option: {
  6302. get: function( elem ) {
  6303. var val = jQuery.find.attr( elem, "value" );
  6304. return val != null ?
  6305. val :
  6306. // Support: IE10-11+
  6307. // option.text throws exceptions (#14686, #14858)
  6308. jQuery.trim( jQuery.text( elem ) );
  6309. }
  6310. },
  6311. select: {
  6312. get: function( elem ) {
  6313. var value, option,
  6314. options = elem.options,
  6315. index = elem.selectedIndex,
  6316. one = elem.type === "select-one" || index < 0,
  6317. values = one ? null : [],
  6318. max = one ? index + 1 : options.length,
  6319. i = index < 0 ?
  6320. max :
  6321. one ? index : 0;
  6322. // Loop through all the selected options
  6323. for ( ; i < max; i++ ) {
  6324. option = options[ i ];
  6325. // IE6-9 doesn't update selected after form reset (#2551)
  6326. if ( ( option.selected || i === index ) &&
  6327. // Don't return options that are disabled or in a disabled optgroup
  6328. ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
  6329. ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6330. // Get the specific value for the option
  6331. value = jQuery( option ).val();
  6332. // We don't need an array for one selects
  6333. if ( one ) {
  6334. return value;
  6335. }
  6336. // Multi-Selects return an array
  6337. values.push( value );
  6338. }
  6339. }
  6340. return values;
  6341. },
  6342. set: function( elem, value ) {
  6343. var optionSet, option,
  6344. options = elem.options,
  6345. values = jQuery.makeArray( value ),
  6346. i = options.length;
  6347. while ( i-- ) {
  6348. option = options[ i ];
  6349. if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
  6350. optionSet = true;
  6351. }
  6352. }
  6353. // Force browsers to behave consistently when non-matching value is set
  6354. if ( !optionSet ) {
  6355. elem.selectedIndex = -1;
  6356. }
  6357. return values;
  6358. }
  6359. }
  6360. }
  6361. });
  6362. // Radios and checkboxes getter/setter
  6363. jQuery.each([ "radio", "checkbox" ], function() {
  6364. jQuery.valHooks[ this ] = {
  6365. set: function( elem, value ) {
  6366. if ( jQuery.isArray( value ) ) {
  6367. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  6368. }
  6369. }
  6370. };
  6371. if ( !support.checkOn ) {
  6372. jQuery.valHooks[ this ].get = function( elem ) {
  6373. return elem.getAttribute("value") === null ? "on" : elem.value;
  6374. };
  6375. }
  6376. });
  6377. // Return jQuery for attributes-only inclusion
  6378. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  6379. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  6380. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  6381. // Handle event binding
  6382. jQuery.fn[ name ] = function( data, fn ) {
  6383. return arguments.length > 0 ?
  6384. this.on( name, null, data, fn ) :
  6385. this.trigger( name );
  6386. };
  6387. });
  6388. jQuery.fn.extend({
  6389. hover: function( fnOver, fnOut ) {
  6390. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  6391. },
  6392. bind: function( types, data, fn ) {
  6393. return this.on( types, null, data, fn );
  6394. },
  6395. unbind: function( types, fn ) {
  6396. return this.off( types, null, fn );
  6397. },
  6398. delegate: function( selector, types, data, fn ) {
  6399. return this.on( types, selector, data, fn );
  6400. },
  6401. undelegate: function( selector, types, fn ) {
  6402. // ( namespace ) or ( selector, types [, fn] )
  6403. return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
  6404. }
  6405. });
  6406. var nonce = jQuery.now();
  6407. var rquery = (/\?/);
  6408. // Support: Android 2.3
  6409. // Workaround failure to string-cast null input
  6410. jQuery.parseJSON = function( data ) {
  6411. return JSON.parse( data + "" );
  6412. };
  6413. // Cross-browser xml parsing
  6414. jQuery.parseXML = function( data ) {
  6415. var xml, tmp;
  6416. if ( !data || typeof data !== "string" ) {
  6417. return null;
  6418. }
  6419. // Support: IE9
  6420. try {
  6421. tmp = new DOMParser();
  6422. xml = tmp.parseFromString( data, "text/xml" );
  6423. } catch ( e ) {
  6424. xml = undefined;
  6425. }
  6426. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  6427. jQuery.error( "Invalid XML: " + data );
  6428. }
  6429. return xml;
  6430. };
  6431. var
  6432. rhash = /#.*$/,
  6433. rts = /([?&])_=[^&]*/,
  6434. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  6435. // #7653, #8125, #8152: local protocol detection
  6436. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  6437. rnoContent = /^(?:GET|HEAD)$/,
  6438. rprotocol = /^\/\//,
  6439. rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  6440. /* Prefilters
  6441. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  6442. * 2) These are called:
  6443. * - BEFORE asking for a transport
  6444. * - AFTER param serialization (s.data is a string if s.processData is true)
  6445. * 3) key is the dataType
  6446. * 4) the catchall symbol "*" can be used
  6447. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  6448. */
  6449. prefilters = {},
  6450. /* Transports bindings
  6451. * 1) key is the dataType
  6452. * 2) the catchall symbol "*" can be used
  6453. * 3) selection will start with transport dataType and THEN go to "*" if needed
  6454. */
  6455. transports = {},
  6456. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  6457. allTypes = "*/".concat( "*" ),
  6458. // Document location
  6459. ajaxLocation = window.location.href,
  6460. // Segment location into parts
  6461. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  6462. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  6463. function addToPrefiltersOrTransports( structure ) {
  6464. // dataTypeExpression is optional and defaults to "*"
  6465. return function( dataTypeExpression, func ) {
  6466. if ( typeof dataTypeExpression !== "string" ) {
  6467. func = dataTypeExpression;
  6468. dataTypeExpression = "*";
  6469. }
  6470. var dataType,
  6471. i = 0,
  6472. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  6473. if ( jQuery.isFunction( func ) ) {
  6474. // For each dataType in the dataTypeExpression
  6475. while ( (dataType = dataTypes[i++]) ) {
  6476. // Prepend if requested
  6477. if ( dataType[0] === "+" ) {
  6478. dataType = dataType.slice( 1 ) || "*";
  6479. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  6480. // Otherwise append
  6481. } else {
  6482. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  6483. }
  6484. }
  6485. }
  6486. };
  6487. }
  6488. // Base inspection function for prefilters and transports
  6489. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  6490. var inspected = {},
  6491. seekingTransport = ( structure === transports );
  6492. function inspect( dataType ) {
  6493. var selected;
  6494. inspected[ dataType ] = true;
  6495. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  6496. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  6497. if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  6498. options.dataTypes.unshift( dataTypeOrTransport );
  6499. inspect( dataTypeOrTransport );
  6500. return false;
  6501. } else if ( seekingTransport ) {
  6502. return !( selected = dataTypeOrTransport );
  6503. }
  6504. });
  6505. return selected;
  6506. }
  6507. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  6508. }
  6509. // A special extend for ajax options
  6510. // that takes "flat" options (not to be deep extended)
  6511. // Fixes #9887
  6512. function ajaxExtend( target, src ) {
  6513. var key, deep,
  6514. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  6515. for ( key in src ) {
  6516. if ( src[ key ] !== undefined ) {
  6517. ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
  6518. }
  6519. }
  6520. if ( deep ) {
  6521. jQuery.extend( true, target, deep );
  6522. }
  6523. return target;
  6524. }
  6525. /* Handles responses to an ajax request:
  6526. * - finds the right dataType (mediates between content-type and expected dataType)
  6527. * - returns the corresponding response
  6528. */
  6529. function ajaxHandleResponses( s, jqXHR, responses ) {
  6530. var ct, type, finalDataType, firstDataType,
  6531. contents = s.contents,
  6532. dataTypes = s.dataTypes;
  6533. // Remove auto dataType and get content-type in the process
  6534. while ( dataTypes[ 0 ] === "*" ) {
  6535. dataTypes.shift();
  6536. if ( ct === undefined ) {
  6537. ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  6538. }
  6539. }
  6540. // Check if we're dealing with a known content-type
  6541. if ( ct ) {
  6542. for ( type in contents ) {
  6543. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6544. dataTypes.unshift( type );
  6545. break;
  6546. }
  6547. }
  6548. }
  6549. // Check to see if we have a response for the expected dataType
  6550. if ( dataTypes[ 0 ] in responses ) {
  6551. finalDataType = dataTypes[ 0 ];
  6552. } else {
  6553. // Try convertible dataTypes
  6554. for ( type in responses ) {
  6555. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  6556. finalDataType = type;
  6557. break;
  6558. }
  6559. if ( !firstDataType ) {
  6560. firstDataType = type;
  6561. }
  6562. }
  6563. // Or just use first one
  6564. finalDataType = finalDataType || firstDataType;
  6565. }
  6566. // If we found a dataType
  6567. // We add the dataType to the list if needed
  6568. // and return the corresponding response
  6569. if ( finalDataType ) {
  6570. if ( finalDataType !== dataTypes[ 0 ] ) {
  6571. dataTypes.unshift( finalDataType );
  6572. }
  6573. return responses[ finalDataType ];
  6574. }
  6575. }
  6576. /* Chain conversions given the request and the original response
  6577. * Also sets the responseXXX fields on the jqXHR instance
  6578. */
  6579. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  6580. var conv2, current, conv, tmp, prev,
  6581. converters = {},
  6582. // Work with a copy of dataTypes in case we need to modify it for conversion
  6583. dataTypes = s.dataTypes.slice();
  6584. // Create converters map with lowercased keys
  6585. if ( dataTypes[ 1 ] ) {
  6586. for ( conv in s.converters ) {
  6587. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  6588. }
  6589. }
  6590. current = dataTypes.shift();
  6591. // Convert to each sequential dataType
  6592. while ( current ) {
  6593. if ( s.responseFields[ current ] ) {
  6594. jqXHR[ s.responseFields[ current ] ] = response;
  6595. }
  6596. // Apply the dataFilter if provided
  6597. if ( !prev && isSuccess && s.dataFilter ) {
  6598. response = s.dataFilter( response, s.dataType );
  6599. }
  6600. prev = current;
  6601. current = dataTypes.shift();
  6602. if ( current ) {
  6603. // There's only work to do if current dataType is non-auto
  6604. if ( current === "*" ) {
  6605. current = prev;
  6606. // Convert response if prev dataType is non-auto and differs from current
  6607. } else if ( prev !== "*" && prev !== current ) {
  6608. // Seek a direct converter
  6609. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  6610. // If none found, seek a pair
  6611. if ( !conv ) {
  6612. for ( conv2 in converters ) {
  6613. // If conv2 outputs current
  6614. tmp = conv2.split( " " );
  6615. if ( tmp[ 1 ] === current ) {
  6616. // If prev can be converted to accepted input
  6617. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  6618. converters[ "* " + tmp[ 0 ] ];
  6619. if ( conv ) {
  6620. // Condense equivalence converters
  6621. if ( conv === true ) {
  6622. conv = converters[ conv2 ];
  6623. // Otherwise, insert the intermediate dataType
  6624. } else if ( converters[ conv2 ] !== true ) {
  6625. current = tmp[ 0 ];
  6626. dataTypes.unshift( tmp[ 1 ] );
  6627. }
  6628. break;
  6629. }
  6630. }
  6631. }
  6632. }
  6633. // Apply converter (if not an equivalence)
  6634. if ( conv !== true ) {
  6635. // Unless errors are allowed to bubble, catch and return them
  6636. if ( conv && s[ "throws" ] ) {
  6637. response = conv( response );
  6638. } else {
  6639. try {
  6640. response = conv( response );
  6641. } catch ( e ) {
  6642. return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
  6643. }
  6644. }
  6645. }
  6646. }
  6647. }
  6648. }
  6649. return { state: "success", data: response };
  6650. }
  6651. jQuery.extend({
  6652. // Counter for holding the number of active queries
  6653. active: 0,
  6654. // Last-Modified header cache for next request
  6655. lastModified: {},
  6656. etag: {},
  6657. ajaxSettings: {
  6658. url: ajaxLocation,
  6659. type: "GET",
  6660. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  6661. global: true,
  6662. processData: true,
  6663. async: true,
  6664. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  6665. /*
  6666. timeout: 0,
  6667. data: null,
  6668. dataType: null,
  6669. username: null,
  6670. password: null,
  6671. cache: null,
  6672. throws: false,
  6673. traditional: false,
  6674. headers: {},
  6675. */
  6676. accepts: {
  6677. "*": allTypes,
  6678. text: "text/plain",
  6679. html: "text/html",
  6680. xml: "application/xml, text/xml",
  6681. json: "application/json, text/javascript"
  6682. },
  6683. contents: {
  6684. xml: /xml/,
  6685. html: /html/,
  6686. json: /json/
  6687. },
  6688. responseFields: {
  6689. xml: "responseXML",
  6690. text: "responseText",
  6691. json: "responseJSON"
  6692. },
  6693. // Data converters
  6694. // Keys separate source (or catchall "*") and destination types with a single space
  6695. converters: {
  6696. // Convert anything to text
  6697. "* text": String,
  6698. // Text to html (true = no transformation)
  6699. "text html": true,
  6700. // Evaluate text as a json expression
  6701. "text json": jQuery.parseJSON,
  6702. // Parse text as xml
  6703. "text xml": jQuery.parseXML
  6704. },
  6705. // For options that shouldn't be deep extended:
  6706. // you can add your own custom options here if
  6707. // and when you create one that shouldn't be
  6708. // deep extended (see ajaxExtend)
  6709. flatOptions: {
  6710. url: true,
  6711. context: true
  6712. }
  6713. },
  6714. // Creates a full fledged settings object into target
  6715. // with both ajaxSettings and settings fields.
  6716. // If target is omitted, writes into ajaxSettings.
  6717. ajaxSetup: function( target, settings ) {
  6718. return settings ?
  6719. // Building a settings object
  6720. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  6721. // Extending ajaxSettings
  6722. ajaxExtend( jQuery.ajaxSettings, target );
  6723. },
  6724. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  6725. ajaxTransport: addToPrefiltersOrTransports( transports ),
  6726. // Main method
  6727. ajax: function( url, options ) {
  6728. // If url is an object, simulate pre-1.5 signature
  6729. if ( typeof url === "object" ) {
  6730. options = url;
  6731. url = undefined;
  6732. }
  6733. // Force options to be an object
  6734. options = options || {};
  6735. var transport,
  6736. // URL without anti-cache param
  6737. cacheURL,
  6738. // Response headers
  6739. responseHeadersString,
  6740. responseHeaders,
  6741. // timeout handle
  6742. timeoutTimer,
  6743. // Cross-domain detection vars
  6744. parts,
  6745. // To know if global events are to be dispatched
  6746. fireGlobals,
  6747. // Loop variable
  6748. i,
  6749. // Create the final options object
  6750. s = jQuery.ajaxSetup( {}, options ),
  6751. // Callbacks context
  6752. callbackContext = s.context || s,
  6753. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  6754. globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
  6755. jQuery( callbackContext ) :
  6756. jQuery.event,
  6757. // Deferreds
  6758. deferred = jQuery.Deferred(),
  6759. completeDeferred = jQuery.Callbacks("once memory"),
  6760. // Status-dependent callbacks
  6761. statusCode = s.statusCode || {},
  6762. // Headers (they are sent all at once)
  6763. requestHeaders = {},
  6764. requestHeadersNames = {},
  6765. // The jqXHR state
  6766. state = 0,
  6767. // Default abort message
  6768. strAbort = "canceled",
  6769. // Fake xhr
  6770. jqXHR = {
  6771. readyState: 0,
  6772. // Builds headers hashtable if needed
  6773. getResponseHeader: function( key ) {
  6774. var match;
  6775. if ( state === 2 ) {
  6776. if ( !responseHeaders ) {
  6777. responseHeaders = {};
  6778. while ( (match = rheaders.exec( responseHeadersString )) ) {
  6779. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6780. }
  6781. }
  6782. match = responseHeaders[ key.toLowerCase() ];
  6783. }
  6784. return match == null ? null : match;
  6785. },
  6786. // Raw string
  6787. getAllResponseHeaders: function() {
  6788. return state === 2 ? responseHeadersString : null;
  6789. },
  6790. // Caches the header
  6791. setRequestHeader: function( name, value ) {
  6792. var lname = name.toLowerCase();
  6793. if ( !state ) {
  6794. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6795. requestHeaders[ name ] = value;
  6796. }
  6797. return this;
  6798. },
  6799. // Overrides response content-type header
  6800. overrideMimeType: function( type ) {
  6801. if ( !state ) {
  6802. s.mimeType = type;
  6803. }
  6804. return this;
  6805. },
  6806. // Status-dependent callbacks
  6807. statusCode: function( map ) {
  6808. var code;
  6809. if ( map ) {
  6810. if ( state < 2 ) {
  6811. for ( code in map ) {
  6812. // Lazy-add the new callback in a way that preserves old ones
  6813. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  6814. }
  6815. } else {
  6816. // Execute the appropriate callbacks
  6817. jqXHR.always( map[ jqXHR.status ] );
  6818. }
  6819. }
  6820. return this;
  6821. },
  6822. // Cancel the request
  6823. abort: function( statusText ) {
  6824. var finalText = statusText || strAbort;
  6825. if ( transport ) {
  6826. transport.abort( finalText );
  6827. }
  6828. done( 0, finalText );
  6829. return this;
  6830. }
  6831. };
  6832. // Attach deferreds
  6833. deferred.promise( jqXHR ).complete = completeDeferred.add;
  6834. jqXHR.success = jqXHR.done;
  6835. jqXHR.error = jqXHR.fail;
  6836. // Remove hash character (#7531: and string promotion)
  6837. // Add protocol if not provided (prefilters might expect it)
  6838. // Handle falsy url in the settings object (#10093: consistency with old signature)
  6839. // We also use the url parameter if available
  6840. s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
  6841. .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  6842. // Alias method option to type as per ticket #12004
  6843. s.type = options.method || options.type || s.method || s.type;
  6844. // Extract dataTypes list
  6845. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  6846. // A cross-domain request is in order when we have a protocol:host:port mismatch
  6847. if ( s.crossDomain == null ) {
  6848. parts = rurl.exec( s.url.toLowerCase() );
  6849. s.crossDomain = !!( parts &&
  6850. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  6851. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  6852. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  6853. );
  6854. }
  6855. // Convert data if not already a string
  6856. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6857. s.data = jQuery.param( s.data, s.traditional );
  6858. }
  6859. // Apply prefilters
  6860. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6861. // If request was aborted inside a prefilter, stop there
  6862. if ( state === 2 ) {
  6863. return jqXHR;
  6864. }
  6865. // We can fire global events as of now if asked to
  6866. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  6867. fireGlobals = jQuery.event && s.global;
  6868. // Watch for a new set of requests
  6869. if ( fireGlobals && jQuery.active++ === 0 ) {
  6870. jQuery.event.trigger("ajaxStart");
  6871. }
  6872. // Uppercase the type
  6873. s.type = s.type.toUpperCase();
  6874. // Determine if request has content
  6875. s.hasContent = !rnoContent.test( s.type );
  6876. // Save the URL in case we're toying with the If-Modified-Since
  6877. // and/or If-None-Match header later on
  6878. cacheURL = s.url;
  6879. // More options handling for requests with no content
  6880. if ( !s.hasContent ) {
  6881. // If data is available, append data to url
  6882. if ( s.data ) {
  6883. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  6884. // #9682: remove data so that it's not used in an eventual retry
  6885. delete s.data;
  6886. }
  6887. // Add anti-cache in url if needed
  6888. if ( s.cache === false ) {
  6889. s.url = rts.test( cacheURL ) ?
  6890. // If there is already a '_' parameter, set its value
  6891. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  6892. // Otherwise add one to the end
  6893. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  6894. }
  6895. }
  6896. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6897. if ( s.ifModified ) {
  6898. if ( jQuery.lastModified[ cacheURL ] ) {
  6899. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  6900. }
  6901. if ( jQuery.etag[ cacheURL ] ) {
  6902. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  6903. }
  6904. }
  6905. // Set the correct header, if data is being sent
  6906. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  6907. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  6908. }
  6909. // Set the Accepts header for the server, depending on the dataType
  6910. jqXHR.setRequestHeader(
  6911. "Accept",
  6912. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  6913. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  6914. s.accepts[ "*" ]
  6915. );
  6916. // Check for headers option
  6917. for ( i in s.headers ) {
  6918. jqXHR.setRequestHeader( i, s.headers[ i ] );
  6919. }
  6920. // Allow custom headers/mimetypes and early abort
  6921. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  6922. // Abort if not done already and return
  6923. return jqXHR.abort();
  6924. }
  6925. // Aborting is no longer a cancellation
  6926. strAbort = "abort";
  6927. // Install callbacks on deferreds
  6928. for ( i in { success: 1, error: 1, complete: 1 } ) {
  6929. jqXHR[ i ]( s[ i ] );
  6930. }
  6931. // Get transport
  6932. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  6933. // If no transport, we auto-abort
  6934. if ( !transport ) {
  6935. done( -1, "No Transport" );
  6936. } else {
  6937. jqXHR.readyState = 1;
  6938. // Send global event
  6939. if ( fireGlobals ) {
  6940. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  6941. }
  6942. // Timeout
  6943. if ( s.async && s.timeout > 0 ) {
  6944. timeoutTimer = setTimeout(function() {
  6945. jqXHR.abort("timeout");
  6946. }, s.timeout );
  6947. }
  6948. try {
  6949. state = 1;
  6950. transport.send( requestHeaders, done );
  6951. } catch ( e ) {
  6952. // Propagate exception as error if not done
  6953. if ( state < 2 ) {
  6954. done( -1, e );
  6955. // Simply rethrow otherwise
  6956. } else {
  6957. throw e;
  6958. }
  6959. }
  6960. }
  6961. // Callback for when everything is done
  6962. function done( status, nativeStatusText, responses, headers ) {
  6963. var isSuccess, success, error, response, modified,
  6964. statusText = nativeStatusText;
  6965. // Called once
  6966. if ( state === 2 ) {
  6967. return;
  6968. }
  6969. // State is "done" now
  6970. state = 2;
  6971. // Clear timeout if it exists
  6972. if ( timeoutTimer ) {
  6973. clearTimeout( timeoutTimer );
  6974. }
  6975. // Dereference transport for early garbage collection
  6976. // (no matter how long the jqXHR object will be used)
  6977. transport = undefined;
  6978. // Cache response headers
  6979. responseHeadersString = headers || "";
  6980. // Set readyState
  6981. jqXHR.readyState = status > 0 ? 4 : 0;
  6982. // Determine if successful
  6983. isSuccess = status >= 200 && status < 300 || status === 304;
  6984. // Get response data
  6985. if ( responses ) {
  6986. response = ajaxHandleResponses( s, jqXHR, responses );
  6987. }
  6988. // Convert no matter what (that way responseXXX fields are always set)
  6989. response = ajaxConvert( s, response, jqXHR, isSuccess );
  6990. // If successful, handle type chaining
  6991. if ( isSuccess ) {
  6992. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6993. if ( s.ifModified ) {
  6994. modified = jqXHR.getResponseHeader("Last-Modified");
  6995. if ( modified ) {
  6996. jQuery.lastModified[ cacheURL ] = modified;
  6997. }
  6998. modified = jqXHR.getResponseHeader("etag");
  6999. if ( modified ) {
  7000. jQuery.etag[ cacheURL ] = modified;
  7001. }
  7002. }
  7003. // if no content
  7004. if ( status === 204 || s.type === "HEAD" ) {
  7005. statusText = "nocontent";
  7006. // if not modified
  7007. } else if ( status === 304 ) {
  7008. statusText = "notmodified";
  7009. // If we have data, let's convert it
  7010. } else {
  7011. statusText = response.state;
  7012. success = response.data;
  7013. error = response.error;
  7014. isSuccess = !error;
  7015. }
  7016. } else {
  7017. // Extract error from statusText and normalize for non-aborts
  7018. error = statusText;
  7019. if ( status || !statusText ) {
  7020. statusText = "error";
  7021. if ( status < 0 ) {
  7022. status = 0;
  7023. }
  7024. }
  7025. }
  7026. // Set data for the fake xhr object
  7027. jqXHR.status = status;
  7028. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7029. // Success/Error
  7030. if ( isSuccess ) {
  7031. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7032. } else {
  7033. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7034. }
  7035. // Status-dependent callbacks
  7036. jqXHR.statusCode( statusCode );
  7037. statusCode = undefined;
  7038. if ( fireGlobals ) {
  7039. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7040. [ jqXHR, s, isSuccess ? success : error ] );
  7041. }
  7042. // Complete
  7043. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7044. if ( fireGlobals ) {
  7045. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7046. // Handle the global AJAX counter
  7047. if ( !( --jQuery.active ) ) {
  7048. jQuery.event.trigger("ajaxStop");
  7049. }
  7050. }
  7051. }
  7052. return jqXHR;
  7053. },
  7054. getJSON: function( url, data, callback ) {
  7055. return jQuery.get( url, data, callback, "json" );
  7056. },
  7057. getScript: function( url, callback ) {
  7058. return jQuery.get( url, undefined, callback, "script" );
  7059. }
  7060. });
  7061. jQuery.each( [ "get", "post" ], function( i, method ) {
  7062. jQuery[ method ] = function( url, data, callback, type ) {
  7063. // Shift arguments if data argument was omitted
  7064. if ( jQuery.isFunction( data ) ) {
  7065. type = type || callback;
  7066. callback = data;
  7067. data = undefined;
  7068. }
  7069. return jQuery.ajax({
  7070. url: url,
  7071. type: method,
  7072. dataType: type,
  7073. data: data,
  7074. success: callback
  7075. });
  7076. };
  7077. });
  7078. jQuery._evalUrl = function( url ) {
  7079. return jQuery.ajax({
  7080. url: url,
  7081. type: "GET",
  7082. dataType: "script",
  7083. async: false,
  7084. global: false,
  7085. "throws": true
  7086. });
  7087. };
  7088. jQuery.fn.extend({
  7089. wrapAll: function( html ) {
  7090. var wrap;
  7091. if ( jQuery.isFunction( html ) ) {
  7092. return this.each(function( i ) {
  7093. jQuery( this ).wrapAll( html.call(this, i) );
  7094. });
  7095. }
  7096. if ( this[ 0 ] ) {
  7097. // The elements to wrap the target around
  7098. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7099. if ( this[ 0 ].parentNode ) {
  7100. wrap.insertBefore( this[ 0 ] );
  7101. }
  7102. wrap.map(function() {
  7103. var elem = this;
  7104. while ( elem.firstElementChild ) {
  7105. elem = elem.firstElementChild;
  7106. }
  7107. return elem;
  7108. }).append( this );
  7109. }
  7110. return this;
  7111. },
  7112. wrapInner: function( html ) {
  7113. if ( jQuery.isFunction( html ) ) {
  7114. return this.each(function( i ) {
  7115. jQuery( this ).wrapInner( html.call(this, i) );
  7116. });
  7117. }
  7118. return this.each(function() {
  7119. var self = jQuery( this ),
  7120. contents = self.contents();
  7121. if ( contents.length ) {
  7122. contents.wrapAll( html );
  7123. } else {
  7124. self.append( html );
  7125. }
  7126. });
  7127. },
  7128. wrap: function( html ) {
  7129. var isFunction = jQuery.isFunction( html );
  7130. return this.each(function( i ) {
  7131. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  7132. });
  7133. },
  7134. unwrap: function() {
  7135. return this.parent().each(function() {
  7136. if ( !jQuery.nodeName( this, "body" ) ) {
  7137. jQuery( this ).replaceWith( this.childNodes );
  7138. }
  7139. }).end();
  7140. }
  7141. });
  7142. jQuery.expr.filters.hidden = function( elem ) {
  7143. // Support: Opera <= 12.12
  7144. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  7145. return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
  7146. };
  7147. jQuery.expr.filters.visible = function( elem ) {
  7148. return !jQuery.expr.filters.hidden( elem );
  7149. };
  7150. var r20 = /%20/g,
  7151. rbracket = /\[\]$/,
  7152. rCRLF = /\r?\n/g,
  7153. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7154. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7155. function buildParams( prefix, obj, traditional, add ) {
  7156. var name;
  7157. if ( jQuery.isArray( obj ) ) {
  7158. // Serialize array item.
  7159. jQuery.each( obj, function( i, v ) {
  7160. if ( traditional || rbracket.test( prefix ) ) {
  7161. // Treat each array item as a scalar.
  7162. add( prefix, v );
  7163. } else {
  7164. // Item is non-scalar (array or object), encode its numeric index.
  7165. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
  7166. }
  7167. });
  7168. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  7169. // Serialize object item.
  7170. for ( name in obj ) {
  7171. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7172. }
  7173. } else {
  7174. // Serialize scalar item.
  7175. add( prefix, obj );
  7176. }
  7177. }
  7178. // Serialize an array of form elements or a set of
  7179. // key/values into a query string
  7180. jQuery.param = function( a, traditional ) {
  7181. var prefix,
  7182. s = [],
  7183. add = function( key, value ) {
  7184. // If value is a function, invoke it and return its value
  7185. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  7186. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7187. };
  7188. // Set traditional to true for jQuery <= 1.3.2 behavior.
  7189. if ( traditional === undefined ) {
  7190. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  7191. }
  7192. // If an array was passed in, assume that it is an array of form elements.
  7193. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7194. // Serialize the form elements
  7195. jQuery.each( a, function() {
  7196. add( this.name, this.value );
  7197. });
  7198. } else {
  7199. // If traditional, encode the "old" way (the way 1.3.2 or older
  7200. // did it), otherwise encode params recursively.
  7201. for ( prefix in a ) {
  7202. buildParams( prefix, a[ prefix ], traditional, add );
  7203. }
  7204. }
  7205. // Return the resulting serialization
  7206. return s.join( "&" ).replace( r20, "+" );
  7207. };
  7208. jQuery.fn.extend({
  7209. serialize: function() {
  7210. return jQuery.param( this.serializeArray() );
  7211. },
  7212. serializeArray: function() {
  7213. return this.map(function() {
  7214. // Can add propHook for "elements" to filter or add form elements
  7215. var elements = jQuery.prop( this, "elements" );
  7216. return elements ? jQuery.makeArray( elements ) : this;
  7217. })
  7218. .filter(function() {
  7219. var type = this.type;
  7220. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7221. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7222. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7223. ( this.checked || !rcheckableType.test( type ) );
  7224. })
  7225. .map(function( i, elem ) {
  7226. var val = jQuery( this ).val();
  7227. return val == null ?
  7228. null :
  7229. jQuery.isArray( val ) ?
  7230. jQuery.map( val, function( val ) {
  7231. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7232. }) :
  7233. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7234. }).get();
  7235. }
  7236. });
  7237. jQuery.ajaxSettings.xhr = function() {
  7238. try {
  7239. return new XMLHttpRequest();
  7240. } catch( e ) {}
  7241. };
  7242. var xhrId = 0,
  7243. xhrCallbacks = {},
  7244. xhrSuccessStatus = {
  7245. // file protocol always yields status code 0, assume 200
  7246. 0: 200,
  7247. // Support: IE9
  7248. // #1450: sometimes IE returns 1223 when it should be 204
  7249. 1223: 204
  7250. },
  7251. xhrSupported = jQuery.ajaxSettings.xhr();
  7252. // Support: IE9
  7253. // Open requests must be manually aborted on unload (#5280)
  7254. // See https://support.microsoft.com/kb/2856746 for more info
  7255. if ( window.attachEvent ) {
  7256. window.attachEvent( "onunload", function() {
  7257. for ( var key in xhrCallbacks ) {
  7258. xhrCallbacks[ key ]();
  7259. }
  7260. });
  7261. }
  7262. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7263. support.ajax = xhrSupported = !!xhrSupported;
  7264. jQuery.ajaxTransport(function( options ) {
  7265. var callback;
  7266. // Cross domain only allowed if supported through XMLHttpRequest
  7267. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7268. return {
  7269. send: function( headers, complete ) {
  7270. var i,
  7271. xhr = options.xhr(),
  7272. id = ++xhrId;
  7273. xhr.open( options.type, options.url, options.async, options.username, options.password );
  7274. // Apply custom fields if provided
  7275. if ( options.xhrFields ) {
  7276. for ( i in options.xhrFields ) {
  7277. xhr[ i ] = options.xhrFields[ i ];
  7278. }
  7279. }
  7280. // Override mime type if needed
  7281. if ( options.mimeType && xhr.overrideMimeType ) {
  7282. xhr.overrideMimeType( options.mimeType );
  7283. }
  7284. // X-Requested-With header
  7285. // For cross-domain requests, seeing as conditions for a preflight are
  7286. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7287. // (it can always be set on a per-request basis or even using ajaxSetup)
  7288. // For same-domain requests, won't change header if already provided.
  7289. if ( !options.crossDomain && !headers["X-Requested-With"] ) {
  7290. headers["X-Requested-With"] = "XMLHttpRequest";
  7291. }
  7292. // Set headers
  7293. for ( i in headers ) {
  7294. xhr.setRequestHeader( i, headers[ i ] );
  7295. }
  7296. // Callback
  7297. callback = function( type ) {
  7298. return function() {
  7299. if ( callback ) {
  7300. delete xhrCallbacks[ id ];
  7301. callback = xhr.onload = xhr.onerror = null;
  7302. if ( type === "abort" ) {
  7303. xhr.abort();
  7304. } else if ( type === "error" ) {
  7305. complete(
  7306. // file: protocol always yields status 0; see #8605, #14207
  7307. xhr.status,
  7308. xhr.statusText
  7309. );
  7310. } else {
  7311. complete(
  7312. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7313. xhr.statusText,
  7314. // Support: IE9
  7315. // Accessing binary-data responseText throws an exception
  7316. // (#11426)
  7317. typeof xhr.responseText === "string" ? {
  7318. text: xhr.responseText
  7319. } : undefined,
  7320. xhr.getAllResponseHeaders()
  7321. );
  7322. }
  7323. }
  7324. };
  7325. };
  7326. // Listen to events
  7327. xhr.onload = callback();
  7328. xhr.onerror = callback("error");
  7329. // Create the abort callback
  7330. callback = xhrCallbacks[ id ] = callback("abort");
  7331. try {
  7332. // Do send the request (this may raise an exception)
  7333. xhr.send( options.hasContent && options.data || null );
  7334. } catch ( e ) {
  7335. // #14683: Only rethrow if this hasn't been notified as an error yet
  7336. if ( callback ) {
  7337. throw e;
  7338. }
  7339. }
  7340. },
  7341. abort: function() {
  7342. if ( callback ) {
  7343. callback();
  7344. }
  7345. }
  7346. };
  7347. }
  7348. });
  7349. // Install script dataType
  7350. jQuery.ajaxSetup({
  7351. accepts: {
  7352. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  7353. },
  7354. contents: {
  7355. script: /(?:java|ecma)script/
  7356. },
  7357. converters: {
  7358. "text script": function( text ) {
  7359. jQuery.globalEval( text );
  7360. return text;
  7361. }
  7362. }
  7363. });
  7364. // Handle cache's special case and crossDomain
  7365. jQuery.ajaxPrefilter( "script", function( s ) {
  7366. if ( s.cache === undefined ) {
  7367. s.cache = false;
  7368. }
  7369. if ( s.crossDomain ) {
  7370. s.type = "GET";
  7371. }
  7372. });
  7373. // Bind script tag hack transport
  7374. jQuery.ajaxTransport( "script", function( s ) {
  7375. // This transport only deals with cross domain requests
  7376. if ( s.crossDomain ) {
  7377. var script, callback;
  7378. return {
  7379. send: function( _, complete ) {
  7380. script = jQuery("<script>").prop({
  7381. async: true,
  7382. charset: s.scriptCharset,
  7383. src: s.url
  7384. }).on(
  7385. "load error",
  7386. callback = function( evt ) {
  7387. script.remove();
  7388. callback = null;
  7389. if ( evt ) {
  7390. complete( evt.type === "error" ? 404 : 200, evt.type );
  7391. }
  7392. }
  7393. );
  7394. document.head.appendChild( script[ 0 ] );
  7395. },
  7396. abort: function() {
  7397. if ( callback ) {
  7398. callback();
  7399. }
  7400. }
  7401. };
  7402. }
  7403. });
  7404. var oldCallbacks = [],
  7405. rjsonp = /(=)\?(?=&|$)|\?\?/;
  7406. // Default jsonp settings
  7407. jQuery.ajaxSetup({
  7408. jsonp: "callback",
  7409. jsonpCallback: function() {
  7410. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  7411. this[ callback ] = true;
  7412. return callback;
  7413. }
  7414. });
  7415. // Detect, normalize options and install callbacks for jsonp requests
  7416. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7417. var callbackName, overwritten, responseContainer,
  7418. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  7419. "url" :
  7420. typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
  7421. );
  7422. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  7423. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  7424. // Get callback name, remembering preexisting value associated with it
  7425. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  7426. s.jsonpCallback() :
  7427. s.jsonpCallback;
  7428. // Insert callback into url or form data
  7429. if ( jsonProp ) {
  7430. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  7431. } else if ( s.jsonp !== false ) {
  7432. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  7433. }
  7434. // Use data converter to retrieve json after script execution
  7435. s.converters["script json"] = function() {
  7436. if ( !responseContainer ) {
  7437. jQuery.error( callbackName + " was not called" );
  7438. }
  7439. return responseContainer[ 0 ];
  7440. };
  7441. // force json dataType
  7442. s.dataTypes[ 0 ] = "json";
  7443. // Install callback
  7444. overwritten = window[ callbackName ];
  7445. window[ callbackName ] = function() {
  7446. responseContainer = arguments;
  7447. };
  7448. // Clean-up function (fires after converters)
  7449. jqXHR.always(function() {
  7450. // Restore preexisting value
  7451. window[ callbackName ] = overwritten;
  7452. // Save back as free
  7453. if ( s[ callbackName ] ) {
  7454. // make sure that re-using the options doesn't screw things around
  7455. s.jsonpCallback = originalSettings.jsonpCallback;
  7456. // save the callback name for future use
  7457. oldCallbacks.push( callbackName );
  7458. }
  7459. // Call if it was a function and we have a response
  7460. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  7461. overwritten( responseContainer[ 0 ] );
  7462. }
  7463. responseContainer = overwritten = undefined;
  7464. });
  7465. // Delegate to script
  7466. return "script";
  7467. }
  7468. });
  7469. // data: string of html
  7470. // context (optional): If specified, the fragment will be created in this context, defaults to document
  7471. // keepScripts (optional): If true, will include scripts passed in the html string
  7472. jQuery.parseHTML = function( data, context, keepScripts ) {
  7473. if ( !data || typeof data !== "string" ) {
  7474. return null;
  7475. }
  7476. if ( typeof context === "boolean" ) {
  7477. keepScripts = context;
  7478. context = false;
  7479. }
  7480. context = context || document;
  7481. var parsed = rsingleTag.exec( data ),
  7482. scripts = !keepScripts && [];
  7483. // Single tag
  7484. if ( parsed ) {
  7485. return [ context.createElement( parsed[1] ) ];
  7486. }
  7487. parsed = jQuery.buildFragment( [ data ], context, scripts );
  7488. if ( scripts && scripts.length ) {
  7489. jQuery( scripts ).remove();
  7490. }
  7491. return jQuery.merge( [], parsed.childNodes );
  7492. };
  7493. // Keep a copy of the old load method
  7494. var _load = jQuery.fn.load;
  7495. /**
  7496. * Load a url into a page
  7497. */
  7498. jQuery.fn.load = function( url, params, callback ) {
  7499. if ( typeof url !== "string" && _load ) {
  7500. return _load.apply( this, arguments );
  7501. }
  7502. var selector, type, response,
  7503. self = this,
  7504. off = url.indexOf(" ");
  7505. if ( off >= 0 ) {
  7506. selector = jQuery.trim( url.slice( off ) );
  7507. url = url.slice( 0, off );
  7508. }
  7509. // If it's a function
  7510. if ( jQuery.isFunction( params ) ) {
  7511. // We assume that it's the callback
  7512. callback = params;
  7513. params = undefined;
  7514. // Otherwise, build a param string
  7515. } else if ( params && typeof params === "object" ) {
  7516. type = "POST";
  7517. }
  7518. // If we have elements to modify, make the request
  7519. if ( self.length > 0 ) {
  7520. jQuery.ajax({
  7521. url: url,
  7522. // if "type" variable is undefined, then "GET" method will be used
  7523. type: type,
  7524. dataType: "html",
  7525. data: params
  7526. }).done(function( responseText ) {
  7527. // Save response for use in complete callback
  7528. response = arguments;
  7529. self.html( selector ?
  7530. // If a selector was specified, locate the right elements in a dummy div
  7531. // Exclude scripts to avoid IE 'Permission Denied' errors
  7532. jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
  7533. // Otherwise use the full result
  7534. responseText );
  7535. }).complete( callback && function( jqXHR, status ) {
  7536. self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
  7537. });
  7538. }
  7539. return this;
  7540. };
  7541. // Attach a bunch of functions for handling common AJAX events
  7542. jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
  7543. jQuery.fn[ type ] = function( fn ) {
  7544. return this.on( type, fn );
  7545. };
  7546. });
  7547. jQuery.expr.filters.animated = function( elem ) {
  7548. return jQuery.grep(jQuery.timers, function( fn ) {
  7549. return elem === fn.elem;
  7550. }).length;
  7551. };
  7552. var docElem = window.document.documentElement;
  7553. /**
  7554. * Gets a window from an element
  7555. */
  7556. function getWindow( elem ) {
  7557. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  7558. }
  7559. jQuery.offset = {
  7560. setOffset: function( elem, options, i ) {
  7561. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  7562. position = jQuery.css( elem, "position" ),
  7563. curElem = jQuery( elem ),
  7564. props = {};
  7565. // Set position first, in-case top/left are set even on static elem
  7566. if ( position === "static" ) {
  7567. elem.style.position = "relative";
  7568. }
  7569. curOffset = curElem.offset();
  7570. curCSSTop = jQuery.css( elem, "top" );
  7571. curCSSLeft = jQuery.css( elem, "left" );
  7572. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  7573. ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
  7574. // Need to be able to calculate position if either
  7575. // top or left is auto and position is either absolute or fixed
  7576. if ( calculatePosition ) {
  7577. curPosition = curElem.position();
  7578. curTop = curPosition.top;
  7579. curLeft = curPosition.left;
  7580. } else {
  7581. curTop = parseFloat( curCSSTop ) || 0;
  7582. curLeft = parseFloat( curCSSLeft ) || 0;
  7583. }
  7584. if ( jQuery.isFunction( options ) ) {
  7585. options = options.call( elem, i, curOffset );
  7586. }
  7587. if ( options.top != null ) {
  7588. props.top = ( options.top - curOffset.top ) + curTop;
  7589. }
  7590. if ( options.left != null ) {
  7591. props.left = ( options.left - curOffset.left ) + curLeft;
  7592. }
  7593. if ( "using" in options ) {
  7594. options.using.call( elem, props );
  7595. } else {
  7596. curElem.css( props );
  7597. }
  7598. }
  7599. };
  7600. jQuery.fn.extend({
  7601. offset: function( options ) {
  7602. if ( arguments.length ) {
  7603. return options === undefined ?
  7604. this :
  7605. this.each(function( i ) {
  7606. jQuery.offset.setOffset( this, options, i );
  7607. });
  7608. }
  7609. var docElem, win,
  7610. elem = this[ 0 ],
  7611. box = { top: 0, left: 0 },
  7612. doc = elem && elem.ownerDocument;
  7613. if ( !doc ) {
  7614. return;
  7615. }
  7616. docElem = doc.documentElement;
  7617. // Make sure it's not a disconnected DOM node
  7618. if ( !jQuery.contains( docElem, elem ) ) {
  7619. return box;
  7620. }
  7621. // Support: BlackBerry 5, iOS 3 (original iPhone)
  7622. // If we don't have gBCR, just use 0,0 rather than error
  7623. if ( typeof elem.getBoundingClientRect !== strundefined ) {
  7624. box = elem.getBoundingClientRect();
  7625. }
  7626. win = getWindow( doc );
  7627. return {
  7628. top: box.top + win.pageYOffset - docElem.clientTop,
  7629. left: box.left + win.pageXOffset - docElem.clientLeft
  7630. };
  7631. },
  7632. position: function() {
  7633. if ( !this[ 0 ] ) {
  7634. return;
  7635. }
  7636. var offsetParent, offset,
  7637. elem = this[ 0 ],
  7638. parentOffset = { top: 0, left: 0 };
  7639. // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
  7640. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  7641. // Assume getBoundingClientRect is there when computed position is fixed
  7642. offset = elem.getBoundingClientRect();
  7643. } else {
  7644. // Get *real* offsetParent
  7645. offsetParent = this.offsetParent();
  7646. // Get correct offsets
  7647. offset = this.offset();
  7648. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  7649. parentOffset = offsetParent.offset();
  7650. }
  7651. // Add offsetParent borders
  7652. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  7653. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  7654. }
  7655. // Subtract parent offsets and element margins
  7656. return {
  7657. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  7658. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  7659. };
  7660. },
  7661. offsetParent: function() {
  7662. return this.map(function() {
  7663. var offsetParent = this.offsetParent || docElem;
  7664. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
  7665. offsetParent = offsetParent.offsetParent;
  7666. }
  7667. return offsetParent || docElem;
  7668. });
  7669. }
  7670. });
  7671. // Create scrollLeft and scrollTop methods
  7672. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  7673. var top = "pageYOffset" === prop;
  7674. jQuery.fn[ method ] = function( val ) {
  7675. return access( this, function( elem, method, val ) {
  7676. var win = getWindow( elem );
  7677. if ( val === undefined ) {
  7678. return win ? win[ prop ] : elem[ method ];
  7679. }
  7680. if ( win ) {
  7681. win.scrollTo(
  7682. !top ? val : window.pageXOffset,
  7683. top ? val : window.pageYOffset
  7684. );
  7685. } else {
  7686. elem[ method ] = val;
  7687. }
  7688. }, method, val, arguments.length, null );
  7689. };
  7690. });
  7691. // Support: Safari<7+, Chrome<37+
  7692. // Add the top/left cssHooks using jQuery.fn.position
  7693. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  7694. // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
  7695. // getComputedStyle returns percent when specified for top/left/bottom/right;
  7696. // rather than make the css module depend on the offset module, just check for it here
  7697. jQuery.each( [ "top", "left" ], function( i, prop ) {
  7698. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  7699. function( elem, computed ) {
  7700. if ( computed ) {
  7701. computed = curCSS( elem, prop );
  7702. // If curCSS returns percentage, fallback to offset
  7703. return rnumnonpx.test( computed ) ?
  7704. jQuery( elem ).position()[ prop ] + "px" :
  7705. computed;
  7706. }
  7707. }
  7708. );
  7709. });
  7710. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  7711. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  7712. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
  7713. // Margin is only for outerHeight, outerWidth
  7714. jQuery.fn[ funcName ] = function( margin, value ) {
  7715. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  7716. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  7717. return access( this, function( elem, type, value ) {
  7718. var doc;
  7719. if ( jQuery.isWindow( elem ) ) {
  7720. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  7721. // isn't a whole lot we can do. See pull request at this URL for discussion:
  7722. // https://github.com/jquery/jquery/pull/764
  7723. return elem.document.documentElement[ "client" + name ];
  7724. }
  7725. // Get document width or height
  7726. if ( elem.nodeType === 9 ) {
  7727. doc = elem.documentElement;
  7728. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  7729. // whichever is greatest
  7730. return Math.max(
  7731. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  7732. elem.body[ "offset" + name ], doc[ "offset" + name ],
  7733. doc[ "client" + name ]
  7734. );
  7735. }
  7736. return value === undefined ?
  7737. // Get width or height on the element, requesting but not forcing parseFloat
  7738. jQuery.css( elem, type, extra ) :
  7739. // Set width or height on the element
  7740. jQuery.style( elem, type, value, extra );
  7741. }, type, chainable ? margin : undefined, chainable, null );
  7742. };
  7743. });
  7744. });
  7745. // The number of elements contained in the matched element set
  7746. jQuery.fn.size = function() {
  7747. return this.length;
  7748. };
  7749. jQuery.fn.andSelf = jQuery.fn.addBack;
  7750. // Register as a named AMD module, since jQuery can be concatenated with other
  7751. // files that may use define, but not via a proper concatenation script that
  7752. // understands anonymous AMD modules. A named AMD is safest and most robust
  7753. // way to register. Lowercase jquery is used because AMD module names are
  7754. // derived from file names, and jQuery is normally delivered in a lowercase
  7755. // file name. Do this after creating the global so that if an AMD module wants
  7756. // to call noConflict to hide this version of jQuery, it will work.
  7757. // Note that for maximum portability, libraries that are not jQuery should
  7758. // declare themselves as anonymous modules, and avoid setting a global if an
  7759. // AMD loader is present. jQuery is a special case. For more information, see
  7760. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  7761. if ( true ) {
  7762. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  7763. return jQuery;
  7764. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  7765. }
  7766. var
  7767. // Map over jQuery in case of overwrite
  7768. _jQuery = window.jQuery,
  7769. // Map over the $ in case of overwrite
  7770. _$ = window.$;
  7771. jQuery.noConflict = function( deep ) {
  7772. if ( window.$ === jQuery ) {
  7773. window.$ = _$;
  7774. }
  7775. if ( deep && window.jQuery === jQuery ) {
  7776. window.jQuery = _jQuery;
  7777. }
  7778. return jQuery;
  7779. };
  7780. // Expose jQuery and $ identifiers, even in AMD
  7781. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  7782. // and CommonJS for browser emulators (#13566)
  7783. if ( typeof noGlobal === strundefined ) {
  7784. window.jQuery = window.$ = jQuery;
  7785. }
  7786. return jQuery;
  7787. }));
  7788.  
  7789.  
  7790. /***/ },
  7791. /* 3 */
  7792. /*!************************************************************!*\
  7793. !*** ./~/babel-runtime/helpers/interop-require-default.js ***!
  7794. \************************************************************/
  7795. /***/ function(module, exports) {
  7796.  
  7797. "use strict";
  7798. exports["default"] = function (obj) {
  7799. return obj && obj.__esModule ? obj : {
  7800. "default": obj
  7801. };
  7802. };
  7803. exports.__esModule = true;
  7804.  
  7805. /***/ },
  7806. /* 4 */
  7807. /*!********************************************!*\
  7808. !*** ./src/scripts/jquery-extras/index.js ***!
  7809. \********************************************/
  7810. /***/ function(module, exports, __webpack_require__) {
  7811.  
  7812. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  7813. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 3)['default'];
  7814. var _jquery = __webpack_require__(/*! jquery */ 2);
  7815. var _jquery2 = _interopRequireDefault(_jquery);
  7816. // import './plugins'
  7817. // ----------------------------------------------------------------------------
  7818. _jquery2['default'].extras = {
  7819. _build_environment: process.env.NODE_ENV || 'development'
  7820. };
  7821. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! (webpack)/~/node-libs-browser/~/process/browser.js */ 5)))
  7822.  
  7823. /***/ },
  7824. /* 5 */
  7825. /*!**********************************************************!*\
  7826. !*** (webpack)/~/node-libs-browser/~/process/browser.js ***!
  7827. \**********************************************************/
  7828. /***/ function(module, exports) {
  7829.  
  7830. // shim for using process in browser
  7831. var process = module.exports = {};
  7832. var queue = [];
  7833. var draining = false;
  7834. var currentQueue;
  7835. var queueIndex = -1;
  7836. function cleanUpNextTick() {
  7837. draining = false;
  7838. if (currentQueue.length) {
  7839. queue = currentQueue.concat(queue);
  7840. } else {
  7841. queueIndex = -1;
  7842. }
  7843. if (queue.length) {
  7844. drainQueue();
  7845. }
  7846. }
  7847. function drainQueue() {
  7848. if (draining) {
  7849. return;
  7850. }
  7851. var timeout = setTimeout(cleanUpNextTick);
  7852. draining = true;
  7853. var len = queue.length;
  7854. while(len) {
  7855. currentQueue = queue;
  7856. queue = [];
  7857. while (++queueIndex < len) {
  7858. currentQueue[queueIndex].run();
  7859. }
  7860. queueIndex = -1;
  7861. len = queue.length;
  7862. }
  7863. currentQueue = null;
  7864. draining = false;
  7865. clearTimeout(timeout);
  7866. }
  7867. process.nextTick = function (fun) {
  7868. var args = new Array(arguments.length - 1);
  7869. if (arguments.length > 1) {
  7870. for (var i = 1; i < arguments.length; i++) {
  7871. args[i - 1] = arguments[i];
  7872. }
  7873. }
  7874. queue.push(new Item(fun, args));
  7875. if (queue.length === 1 && !draining) {
  7876. setTimeout(drainQueue, 0);
  7877. }
  7878. };
  7879. // v8 likes predictible objects
  7880. function Item(fun, array) {
  7881. this.fun = fun;
  7882. this.array = array;
  7883. }
  7884. Item.prototype.run = function () {
  7885. this.fun.apply(null, this.array);
  7886. };
  7887. process.title = 'browser';
  7888. process.browser = true;
  7889. process.env = {};
  7890. process.argv = [];
  7891. process.version = ''; // empty string to avoid regexp issues
  7892. process.versions = {};
  7893. function noop() {}
  7894. process.on = noop;
  7895. process.addListener = noop;
  7896. process.once = noop;
  7897. process.off = noop;
  7898. process.removeListener = noop;
  7899. process.removeAllListeners = noop;
  7900. process.emit = noop;
  7901. process.binding = function (name) {
  7902. throw new Error('process.binding is not supported');
  7903. };
  7904. // TODO(shtylman)
  7905. process.cwd = function () { return '/' };
  7906. process.chdir = function (dir) {
  7907. throw new Error('process.chdir is not supported');
  7908. };
  7909. process.umask = function() { return 0; };
  7910.  
  7911.  
  7912. /***/ },
  7913. /* 6 */
  7914. /*!**********************************************!*\
  7915. !*** ./src/scripts/web/selector-observer.js ***!
  7916. \**********************************************/
  7917. /***/ function(module, exports, __webpack_require__) {
  7918.  
  7919. /* jshint asi: true, esnext: true */
  7920. 'use strict';
  7921. var _createClass = __webpack_require__(/*! babel-runtime/helpers/create-class */ 7)['default'];
  7922. var _classCallCheck = __webpack_require__(/*! babel-runtime/helpers/class-call-check */ 11)['default'];
  7923. var _toConsumableArray = __webpack_require__(/*! babel-runtime/helpers/to-consumable-array */ 12)['default'];
  7924. var _Object$assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ 50)['default'];
  7925. var _Array$from = __webpack_require__(/*! babel-runtime/core-js/array/from */ 13)['default'];
  7926. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 3)['default'];
  7927. Object.defineProperty(exports, '__esModule', {
  7928. value: true
  7929. });
  7930. var _nodeSet = __webpack_require__(/*! ./node-set */ 56);
  7931. var _nodeSet2 = _interopRequireDefault(_nodeSet);
  7932. var _funcDebounce = __webpack_require__(/*! ../func/debounce */ 74);
  7933. var _funcDebounce2 = _interopRequireDefault(_funcDebounce);
  7934. // ----------------------------------------------------------------------------
  7935. var SelectorObserver = (function () {
  7936. function SelectorObserver(selector, onAdded, onRemoved) {
  7937. var _this = this;
  7938. _classCallCheck(this, SelectorObserver);
  7939. _Object$assign(this, {
  7940. targets: [document.body],
  7941. selector: '*',
  7942. filterMovedElements: true,
  7943. applyToExisting: true,
  7944. childrenOnly: false,
  7945. singleCallback: false,
  7946. debug: false
  7947. }, typeof selector === 'object' ? selector : { selector: selector, onAdded: onAdded, onRemoved: onRemoved });
  7948. if (this.debug) {
  7949. console.info('SelectorObserver(selector: "' + this.selector + '", targets: ' + this.targets.join(',') + ',\nfilterMovedElements: ' + this.filterMovedElements + ', applyToExisting: ' + this.applyToExisting + ',\nchildrenOnly: ' + this.childrenOnly + ', singleCallback: ' + this.singleCallback + ')');
  7950. }
  7951. if (this.targets instanceof NodeList) {
  7952. this.targets = _Array$from(this.targets);
  7953. } else if (typeof this.targets === 'string') {
  7954. this.targets = [this.targets];
  7955. }
  7956. if (this.selector.match(/^>\s*/)) {
  7957. this.childrenOnly = true;
  7958. this.selector = this.selector.replace(/^>\s*/, '');
  7959. }
  7960. this.addedNodes = new _nodeSet2['default']();
  7961. this.removedNodes = new _nodeSet2['default']();
  7962. this.observer = new MutationObserver(function (mutations) {
  7963. mutations.forEach(function (mutation) {
  7964. // console.info('mutation.addedNodes:', mutation.addedNodes)
  7965. // console.info('mutation.removedNodes:', mutation.addedNodes)
  7966. _this.addedNodes.add(_Array$from(mutation.addedNodes));
  7967. _this.removedNodes.add(_Array$from(mutation.removedNodes));
  7968. });
  7969. _this.handle();
  7970. });
  7971. if (this.applyToExisting && this.onAdded) {
  7972. this._apply(this._getMatchingNodes(), this.onAdded);
  7973. }
  7974. this.observe();
  7975. }
  7976. _createClass(SelectorObserver, [{
  7977. key: 'observe',
  7978. value: function observe() {
  7979. var _this2 = this;
  7980. this.targets.forEach(function (target) {
  7981. _this2.observer.observe(target, {
  7982. childList: true,
  7983. subtree: true
  7984. });
  7985. });
  7986. }
  7987. }, {
  7988. key: 'disconnect',
  7989. value: function disconnect() {
  7990. this.observer.disconnect();
  7991. }
  7992. }, {
  7993. key: 'handle',
  7994. value: function handle() {
  7995. var matchedElements = this._getMatchingNodes();
  7996. if (this.debug) {
  7997. console.info('matchedElements:', [].concat(_toConsumableArray(matchedElements._set)));
  7998. console.info('addedNodes:', [].concat(_toConsumableArray(this.addedNodes._set)));
  7999. console.info('removedNodes:', [].concat(_toConsumableArray(this.removedNodes._set)));
  8000. }
  8001. if (this.filterMovedElements) {
  8002. var moved = this.addedNodes.intersection(this.removedNodes);
  8003. if (moved.length) {
  8004. this.addedNodes.remove(moved);
  8005. this.removedNodes.remove(moved);
  8006. this._apply(matchedElements.intersection(moved), this.onMoved);
  8007. }
  8008. }
  8009. this._apply(matchedElements.intersection(this.addedNodes), this.onAdded);
  8010. this._apply(matchedElements.intersection(this.removedNodes), this.onRemoved);
  8011. this.addedNodes.take();
  8012. this.removedNodes.take();
  8013. }
  8014. }, {
  8015. key: '_apply',
  8016. value: function _apply(nodes, func) {
  8017. if (typeof func !== 'function') {
  8018. return;
  8019. }
  8020. if (this.singleCallback) {
  8021. func(nodes);
  8022. } else {
  8023. nodes.forEach(function (node) {
  8024. func.call(node, node);
  8025. });
  8026. }
  8027. }
  8028. }, {
  8029. key: '_getTargetNodes',
  8030. value: function _getTargetNodes() {
  8031. var res = new _nodeSet2['default']();
  8032. this.targets.forEach(function (target) {
  8033. if (typeof target === 'string') {
  8034. res.add(_Array$from(document.querySelectorAll(target)));
  8035. } else {
  8036. res.add(target);
  8037. }
  8038. });
  8039. return res;
  8040. }
  8041. }, {
  8042. key: '_getMatchingNodes',
  8043. value: function _getMatchingNodes() {
  8044. var _this3 = this;
  8045. var targets = this._getTargetNodes(),
  8046. nodes = new _nodeSet2['default']();
  8047. this.targets.forEach(function (target) {
  8048. if (_this3.childrenOnly) {
  8049. nodes.add(_Array$from(target.children).filter(function (n) {
  8050. return n.matches(_this3.selector);
  8051. }));
  8052. } else {
  8053. nodes.add(_Array$from(target.querySelectorAll(_this3.selector)));
  8054. }
  8055. });
  8056. return nodes;
  8057. }
  8058. }]);
  8059. return SelectorObserver;
  8060. })();
  8061. exports['default'] = SelectorObserver;
  8062. SelectorObserver.prototype.handle = (0, _funcDebounce2['default'])(SelectorObserver.prototype.handle, 250);
  8063. module.exports = exports['default'];
  8064.  
  8065. /***/ },
  8066. /* 7 */
  8067. /*!*************************************************!*\
  8068. !*** ./~/babel-runtime/helpers/create-class.js ***!
  8069. \*************************************************/
  8070. /***/ function(module, exports, __webpack_require__) {
  8071.  
  8072. "use strict";
  8073. var _Object$defineProperty = __webpack_require__(/*! babel-runtime/core-js/object/define-property */ 8)["default"];
  8074. exports["default"] = (function () {
  8075. function defineProperties(target, props) {
  8076. for (var i = 0; i < props.length; i++) {
  8077. var descriptor = props[i];
  8078. descriptor.enumerable = descriptor.enumerable || false;
  8079. descriptor.configurable = true;
  8080. if ("value" in descriptor) descriptor.writable = true;
  8081. _Object$defineProperty(target, descriptor.key, descriptor);
  8082. }
  8083. }
  8084. return function (Constructor, protoProps, staticProps) {
  8085. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  8086. if (staticProps) defineProperties(Constructor, staticProps);
  8087. return Constructor;
  8088. };
  8089. })();
  8090. exports.__esModule = true;
  8091.  
  8092. /***/ },
  8093. /* 8 */
  8094. /*!***********************************************************!*\
  8095. !*** ./~/babel-runtime/core-js/object/define-property.js ***!
  8096. \***********************************************************/
  8097. /***/ function(module, exports, __webpack_require__) {
  8098.  
  8099. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/define-property */ 9), __esModule: true };
  8100.  
  8101. /***/ },
  8102. /* 9 */
  8103. /*!************************************************************************!*\
  8104. !*** ./~/babel-runtime/~/core-js/library/fn/object/define-property.js ***!
  8105. \************************************************************************/
  8106. /***/ function(module, exports, __webpack_require__) {
  8107.  
  8108. var $ = __webpack_require__(/*! ../../modules/$ */ 10);
  8109. module.exports = function defineProperty(it, key, desc){
  8110. return $.setDesc(it, key, desc);
  8111. };
  8112.  
  8113. /***/ },
  8114. /* 10 */
  8115. /*!********************************************************!*\
  8116. !*** ./~/babel-runtime/~/core-js/library/modules/$.js ***!
  8117. \********************************************************/
  8118. /***/ function(module, exports) {
  8119.  
  8120. var $Object = Object;
  8121. module.exports = {
  8122. create: $Object.create,
  8123. getProto: $Object.getPrototypeOf,
  8124. isEnum: {}.propertyIsEnumerable,
  8125. getDesc: $Object.getOwnPropertyDescriptor,
  8126. setDesc: $Object.defineProperty,
  8127. setDescs: $Object.defineProperties,
  8128. getKeys: $Object.keys,
  8129. getNames: $Object.getOwnPropertyNames,
  8130. getSymbols: $Object.getOwnPropertySymbols,
  8131. each: [].forEach
  8132. };
  8133.  
  8134. /***/ },
  8135. /* 11 */
  8136. /*!*****************************************************!*\
  8137. !*** ./~/babel-runtime/helpers/class-call-check.js ***!
  8138. \*****************************************************/
  8139. /***/ function(module, exports) {
  8140.  
  8141. "use strict";
  8142. exports["default"] = function (instance, Constructor) {
  8143. if (!(instance instanceof Constructor)) {
  8144. throw new TypeError("Cannot call a class as a function");
  8145. }
  8146. };
  8147. exports.__esModule = true;
  8148.  
  8149. /***/ },
  8150. /* 12 */
  8151. /*!********************************************************!*\
  8152. !*** ./~/babel-runtime/helpers/to-consumable-array.js ***!
  8153. \********************************************************/
  8154. /***/ function(module, exports, __webpack_require__) {
  8155.  
  8156. "use strict";
  8157. var _Array$from = __webpack_require__(/*! babel-runtime/core-js/array/from */ 13)["default"];
  8158. exports["default"] = function (arr) {
  8159. if (Array.isArray(arr)) {
  8160. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  8161. return arr2;
  8162. } else {
  8163. return _Array$from(arr);
  8164. }
  8165. };
  8166. exports.__esModule = true;
  8167.  
  8168. /***/ },
  8169. /* 13 */
  8170. /*!***********************************************!*\
  8171. !*** ./~/babel-runtime/core-js/array/from.js ***!
  8172. \***********************************************/
  8173. /***/ function(module, exports, __webpack_require__) {
  8174.  
  8175. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/array/from */ 14), __esModule: true };
  8176.  
  8177. /***/ },
  8178. /* 14 */
  8179. /*!************************************************************!*\
  8180. !*** ./~/babel-runtime/~/core-js/library/fn/array/from.js ***!
  8181. \************************************************************/
  8182. /***/ function(module, exports, __webpack_require__) {
  8183.  
  8184. __webpack_require__(/*! ../../modules/es6.string.iterator */ 15);
  8185. __webpack_require__(/*! ../../modules/es6.array.from */ 37);
  8186. module.exports = __webpack_require__(/*! ../../modules/$.core */ 23).Array.from;
  8187.  
  8188. /***/ },
  8189. /* 15 */
  8190. /*!**************************************************************************!*\
  8191. !*** ./~/babel-runtime/~/core-js/library/modules/es6.string.iterator.js ***!
  8192. \**************************************************************************/
  8193. /***/ function(module, exports, __webpack_require__) {
  8194.  
  8195. 'use strict';
  8196. var $at = __webpack_require__(/*! ./$.string-at */ 16)(true);
  8197. // 21.1.3.27 String.prototype[@@iterator]()
  8198. __webpack_require__(/*! ./$.iter-define */ 19)(String, 'String', function(iterated){
  8199. this._t = String(iterated); // target
  8200. this._i = 0; // next index
  8201. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  8202. }, function(){
  8203. var O = this._t
  8204. , index = this._i
  8205. , point;
  8206. if(index >= O.length)return {value: undefined, done: true};
  8207. point = $at(O, index);
  8208. this._i += point.length;
  8209. return {value: point, done: false};
  8210. });
  8211.  
  8212. /***/ },
  8213. /* 16 */
  8214. /*!******************************************************************!*\
  8215. !*** ./~/babel-runtime/~/core-js/library/modules/$.string-at.js ***!
  8216. \******************************************************************/
  8217. /***/ function(module, exports, __webpack_require__) {
  8218.  
  8219. // true -> String#at
  8220. // false -> String#codePointAt
  8221. var toInteger = __webpack_require__(/*! ./$.to-integer */ 17)
  8222. , defined = __webpack_require__(/*! ./$.defined */ 18);
  8223. module.exports = function(TO_STRING){
  8224. return function(that, pos){
  8225. var s = String(defined(that))
  8226. , i = toInteger(pos)
  8227. , l = s.length
  8228. , a, b;
  8229. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  8230. a = s.charCodeAt(i);
  8231. return a < 0xd800 || a > 0xdbff || i + 1 === l
  8232. || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  8233. ? TO_STRING ? s.charAt(i) : a
  8234. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  8235. };
  8236. };
  8237.  
  8238. /***/ },
  8239. /* 17 */
  8240. /*!*******************************************************************!*\
  8241. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-integer.js ***!
  8242. \*******************************************************************/
  8243. /***/ function(module, exports) {
  8244.  
  8245. // 7.1.4 ToInteger
  8246. var ceil = Math.ceil
  8247. , floor = Math.floor;
  8248. module.exports = function(it){
  8249. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  8250. };
  8251.  
  8252. /***/ },
  8253. /* 18 */
  8254. /*!****************************************************************!*\
  8255. !*** ./~/babel-runtime/~/core-js/library/modules/$.defined.js ***!
  8256. \****************************************************************/
  8257. /***/ function(module, exports) {
  8258.  
  8259. // 7.2.1 RequireObjectCoercible(argument)
  8260. module.exports = function(it){
  8261. if(it == undefined)throw TypeError("Can't call method on " + it);
  8262. return it;
  8263. };
  8264.  
  8265. /***/ },
  8266. /* 19 */
  8267. /*!********************************************************************!*\
  8268. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-define.js ***!
  8269. \********************************************************************/
  8270. /***/ function(module, exports, __webpack_require__) {
  8271.  
  8272. 'use strict';
  8273. var LIBRARY = __webpack_require__(/*! ./$.library */ 20)
  8274. , $def = __webpack_require__(/*! ./$.def */ 21)
  8275. , $redef = __webpack_require__(/*! ./$.redef */ 24)
  8276. , hide = __webpack_require__(/*! ./$.hide */ 25)
  8277. , has = __webpack_require__(/*! ./$.has */ 29)
  8278. , SYMBOL_ITERATOR = __webpack_require__(/*! ./$.wks */ 30)('iterator')
  8279. , Iterators = __webpack_require__(/*! ./$.iterators */ 33)
  8280. , FF_ITERATOR = '@@iterator'
  8281. , KEYS = 'keys'
  8282. , VALUES = 'values';
  8283. var returnThis = function(){ return this; };
  8284. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){
  8285. __webpack_require__(/*! ./$.iter-create */ 34)(Constructor, NAME, next);
  8286. var createMethod = function(kind){
  8287. switch(kind){
  8288. case KEYS: return function keys(){ return new Constructor(this, kind); };
  8289. case VALUES: return function values(){ return new Constructor(this, kind); };
  8290. } return function entries(){ return new Constructor(this, kind); };
  8291. };
  8292. var TAG = NAME + ' Iterator'
  8293. , proto = Base.prototype
  8294. , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  8295. , _default = _native || createMethod(DEFAULT)
  8296. , methods, key;
  8297. // Fix native
  8298. if(_native){
  8299. var IteratorPrototype = __webpack_require__(/*! ./$ */ 10).getProto(_default.call(new Base));
  8300. // Set @@toStringTag to native iterators
  8301. __webpack_require__(/*! ./$.tag */ 35)(IteratorPrototype, TAG, true);
  8302. // FF fix
  8303. if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, SYMBOL_ITERATOR, returnThis);
  8304. }
  8305. // Define iterator
  8306. if(!LIBRARY || FORCE)hide(proto, SYMBOL_ITERATOR, _default);
  8307. // Plug for library
  8308. Iterators[NAME] = _default;
  8309. Iterators[TAG] = returnThis;
  8310. if(DEFAULT){
  8311. methods = {
  8312. keys: IS_SET ? _default : createMethod(KEYS),
  8313. values: DEFAULT == VALUES ? _default : createMethod(VALUES),
  8314. entries: DEFAULT != VALUES ? _default : createMethod('entries')
  8315. };
  8316. if(FORCE)for(key in methods){
  8317. if(!(key in proto))$redef(proto, key, methods[key]);
  8318. } else $def($def.P + $def.F * __webpack_require__(/*! ./$.iter-buggy */ 36), NAME, methods);
  8319. }
  8320. };
  8321.  
  8322. /***/ },
  8323. /* 20 */
  8324. /*!****************************************************************!*\
  8325. !*** ./~/babel-runtime/~/core-js/library/modules/$.library.js ***!
  8326. \****************************************************************/
  8327. /***/ function(module, exports) {
  8328.  
  8329. module.exports = true;
  8330.  
  8331. /***/ },
  8332. /* 21 */
  8333. /*!************************************************************!*\
  8334. !*** ./~/babel-runtime/~/core-js/library/modules/$.def.js ***!
  8335. \************************************************************/
  8336. /***/ function(module, exports, __webpack_require__) {
  8337.  
  8338. var global = __webpack_require__(/*! ./$.global */ 22)
  8339. , core = __webpack_require__(/*! ./$.core */ 23)
  8340. , PROTOTYPE = 'prototype';
  8341. var ctx = function(fn, that){
  8342. return function(){
  8343. return fn.apply(that, arguments);
  8344. };
  8345. };
  8346. var $def = function(type, name, source){
  8347. var key, own, out, exp
  8348. , isGlobal = type & $def.G
  8349. , isProto = type & $def.P
  8350. , target = isGlobal ? global : type & $def.S
  8351. ? global[name] : (global[name] || {})[PROTOTYPE]
  8352. , exports = isGlobal ? core : core[name] || (core[name] = {});
  8353. if(isGlobal)source = name;
  8354. for(key in source){
  8355. // contains in native
  8356. own = !(type & $def.F) && target && key in target;
  8357. if(own && key in exports)continue;
  8358. // export native or passed
  8359. out = own ? target[key] : source[key];
  8360. // prevent global pollution for namespaces
  8361. if(isGlobal && typeof target[key] != 'function')exp = source[key];
  8362. // bind timers to global for call from export context
  8363. else if(type & $def.B && own)exp = ctx(out, global);
  8364. // wrap global constructors for prevent change them in library
  8365. else if(type & $def.W && target[key] == out)!function(C){
  8366. exp = function(param){
  8367. return this instanceof C ? new C(param) : C(param);
  8368. };
  8369. exp[PROTOTYPE] = C[PROTOTYPE];
  8370. }(out);
  8371. else exp = isProto && typeof out == 'function' ? ctx(Function.call, out) : out;
  8372. // export
  8373. exports[key] = exp;
  8374. if(isProto)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
  8375. }
  8376. };
  8377. // type bitmap
  8378. $def.F = 1; // forced
  8379. $def.G = 2; // global
  8380. $def.S = 4; // static
  8381. $def.P = 8; // proto
  8382. $def.B = 16; // bind
  8383. $def.W = 32; // wrap
  8384. module.exports = $def;
  8385.  
  8386. /***/ },
  8387. /* 22 */
  8388. /*!***************************************************************!*\
  8389. !*** ./~/babel-runtime/~/core-js/library/modules/$.global.js ***!
  8390. \***************************************************************/
  8391. /***/ function(module, exports) {
  8392.  
  8393. var global = typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  8394. module.exports = global;
  8395. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  8396.  
  8397. /***/ },
  8398. /* 23 */
  8399. /*!*************************************************************!*\
  8400. !*** ./~/babel-runtime/~/core-js/library/modules/$.core.js ***!
  8401. \*************************************************************/
  8402. /***/ function(module, exports) {
  8403.  
  8404. var core = module.exports = {};
  8405. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  8406.  
  8407. /***/ },
  8408. /* 24 */
  8409. /*!**************************************************************!*\
  8410. !*** ./~/babel-runtime/~/core-js/library/modules/$.redef.js ***!
  8411. \**************************************************************/
  8412. /***/ function(module, exports, __webpack_require__) {
  8413.  
  8414. module.exports = __webpack_require__(/*! ./$.hide */ 25);
  8415.  
  8416. /***/ },
  8417. /* 25 */
  8418. /*!*************************************************************!*\
  8419. !*** ./~/babel-runtime/~/core-js/library/modules/$.hide.js ***!
  8420. \*************************************************************/
  8421. /***/ function(module, exports, __webpack_require__) {
  8422.  
  8423. var $ = __webpack_require__(/*! ./$ */ 10)
  8424. , createDesc = __webpack_require__(/*! ./$.property-desc */ 26);
  8425. module.exports = __webpack_require__(/*! ./$.support-desc */ 27) ? function(object, key, value){
  8426. return $.setDesc(object, key, createDesc(1, value));
  8427. } : function(object, key, value){
  8428. object[key] = value;
  8429. return object;
  8430. };
  8431.  
  8432. /***/ },
  8433. /* 26 */
  8434. /*!**********************************************************************!*\
  8435. !*** ./~/babel-runtime/~/core-js/library/modules/$.property-desc.js ***!
  8436. \**********************************************************************/
  8437. /***/ function(module, exports) {
  8438.  
  8439. module.exports = function(bitmap, value){
  8440. return {
  8441. enumerable : !(bitmap & 1),
  8442. configurable: !(bitmap & 2),
  8443. writable : !(bitmap & 4),
  8444. value : value
  8445. };
  8446. };
  8447.  
  8448. /***/ },
  8449. /* 27 */
  8450. /*!*********************************************************************!*\
  8451. !*** ./~/babel-runtime/~/core-js/library/modules/$.support-desc.js ***!
  8452. \*********************************************************************/
  8453. /***/ function(module, exports, __webpack_require__) {
  8454.  
  8455. // Thank's IE8 for his funny defineProperty
  8456. module.exports = !__webpack_require__(/*! ./$.fails */ 28)(function(){
  8457. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  8458. });
  8459.  
  8460. /***/ },
  8461. /* 28 */
  8462. /*!**************************************************************!*\
  8463. !*** ./~/babel-runtime/~/core-js/library/modules/$.fails.js ***!
  8464. \**************************************************************/
  8465. /***/ function(module, exports) {
  8466.  
  8467. module.exports = function(exec){
  8468. try {
  8469. return !!exec();
  8470. } catch(e){
  8471. return true;
  8472. }
  8473. };
  8474.  
  8475. /***/ },
  8476. /* 29 */
  8477. /*!************************************************************!*\
  8478. !*** ./~/babel-runtime/~/core-js/library/modules/$.has.js ***!
  8479. \************************************************************/
  8480. /***/ function(module, exports) {
  8481.  
  8482. var hasOwnProperty = {}.hasOwnProperty;
  8483. module.exports = function(it, key){
  8484. return hasOwnProperty.call(it, key);
  8485. };
  8486.  
  8487. /***/ },
  8488. /* 30 */
  8489. /*!************************************************************!*\
  8490. !*** ./~/babel-runtime/~/core-js/library/modules/$.wks.js ***!
  8491. \************************************************************/
  8492. /***/ function(module, exports, __webpack_require__) {
  8493.  
  8494. var store = __webpack_require__(/*! ./$.shared */ 31)('wks')
  8495. , Symbol = __webpack_require__(/*! ./$.global */ 22).Symbol;
  8496. module.exports = function(name){
  8497. return store[name] || (store[name] =
  8498. Symbol && Symbol[name] || (Symbol || __webpack_require__(/*! ./$.uid */ 32))('Symbol.' + name));
  8499. };
  8500.  
  8501. /***/ },
  8502. /* 31 */
  8503. /*!***************************************************************!*\
  8504. !*** ./~/babel-runtime/~/core-js/library/modules/$.shared.js ***!
  8505. \***************************************************************/
  8506. /***/ function(module, exports, __webpack_require__) {
  8507.  
  8508. var global = __webpack_require__(/*! ./$.global */ 22)
  8509. , SHARED = '__core-js_shared__'
  8510. , store = global[SHARED] || (global[SHARED] = {});
  8511. module.exports = function(key){
  8512. return store[key] || (store[key] = {});
  8513. };
  8514.  
  8515. /***/ },
  8516. /* 32 */
  8517. /*!************************************************************!*\
  8518. !*** ./~/babel-runtime/~/core-js/library/modules/$.uid.js ***!
  8519. \************************************************************/
  8520. /***/ function(module, exports) {
  8521.  
  8522. var id = 0
  8523. , px = Math.random();
  8524. module.exports = function(key){
  8525. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  8526. };
  8527.  
  8528. /***/ },
  8529. /* 33 */
  8530. /*!******************************************************************!*\
  8531. !*** ./~/babel-runtime/~/core-js/library/modules/$.iterators.js ***!
  8532. \******************************************************************/
  8533. /***/ function(module, exports) {
  8534.  
  8535. module.exports = {};
  8536.  
  8537. /***/ },
  8538. /* 34 */
  8539. /*!********************************************************************!*\
  8540. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-create.js ***!
  8541. \********************************************************************/
  8542. /***/ function(module, exports, __webpack_require__) {
  8543.  
  8544. 'use strict';
  8545. var $ = __webpack_require__(/*! ./$ */ 10)
  8546. , IteratorPrototype = {};
  8547. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  8548. __webpack_require__(/*! ./$.hide */ 25)(IteratorPrototype, __webpack_require__(/*! ./$.wks */ 30)('iterator'), function(){ return this; });
  8549. module.exports = function(Constructor, NAME, next){
  8550. Constructor.prototype = $.create(IteratorPrototype, {next: __webpack_require__(/*! ./$.property-desc */ 26)(1,next)});
  8551. __webpack_require__(/*! ./$.tag */ 35)(Constructor, NAME + ' Iterator');
  8552. };
  8553.  
  8554. /***/ },
  8555. /* 35 */
  8556. /*!************************************************************!*\
  8557. !*** ./~/babel-runtime/~/core-js/library/modules/$.tag.js ***!
  8558. \************************************************************/
  8559. /***/ function(module, exports, __webpack_require__) {
  8560.  
  8561. var has = __webpack_require__(/*! ./$.has */ 29)
  8562. , hide = __webpack_require__(/*! ./$.hide */ 25)
  8563. , TAG = __webpack_require__(/*! ./$.wks */ 30)('toStringTag');
  8564. module.exports = function(it, tag, stat){
  8565. if(it && !has(it = stat ? it : it.prototype, TAG))hide(it, TAG, tag);
  8566. };
  8567.  
  8568. /***/ },
  8569. /* 36 */
  8570. /*!*******************************************************************!*\
  8571. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-buggy.js ***!
  8572. \*******************************************************************/
  8573. /***/ function(module, exports) {
  8574.  
  8575. // Safari has buggy iterators w/o `next`
  8576. module.exports = 'keys' in [] && !('next' in [].keys());
  8577.  
  8578. /***/ },
  8579. /* 37 */
  8580. /*!*********************************************************************!*\
  8581. !*** ./~/babel-runtime/~/core-js/library/modules/es6.array.from.js ***!
  8582. \*********************************************************************/
  8583. /***/ function(module, exports, __webpack_require__) {
  8584.  
  8585. 'use strict';
  8586. var ctx = __webpack_require__(/*! ./$.ctx */ 38)
  8587. , $def = __webpack_require__(/*! ./$.def */ 21)
  8588. , toObject = __webpack_require__(/*! ./$.to-object */ 40)
  8589. , call = __webpack_require__(/*! ./$.iter-call */ 41)
  8590. , isArrayIter = __webpack_require__(/*! ./$.is-array-iter */ 44)
  8591. , toLength = __webpack_require__(/*! ./$.to-length */ 45)
  8592. , getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 46);
  8593. $def($def.S + $def.F * !__webpack_require__(/*! ./$.iter-detect */ 49)(function(iter){ Array.from(iter); }), 'Array', {
  8594. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  8595. from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
  8596. var O = toObject(arrayLike)
  8597. , C = typeof this == 'function' ? this : Array
  8598. , mapfn = arguments[1]
  8599. , mapping = mapfn !== undefined
  8600. , index = 0
  8601. , iterFn = getIterFn(O)
  8602. , length, result, step, iterator;
  8603. if(mapping)mapfn = ctx(mapfn, arguments[2], 2);
  8604. // if object isn't iterable or it's array with default iterator - use simple case
  8605. if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
  8606. for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
  8607. result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value;
  8608. }
  8609. } else {
  8610. for(result = new C(length = toLength(O.length)); length > index; index++){
  8611. result[index] = mapping ? mapfn(O[index], index) : O[index];
  8612. }
  8613. }
  8614. result.length = index;
  8615. return result;
  8616. }
  8617. });
  8618.  
  8619. /***/ },
  8620. /* 38 */
  8621. /*!************************************************************!*\
  8622. !*** ./~/babel-runtime/~/core-js/library/modules/$.ctx.js ***!
  8623. \************************************************************/
  8624. /***/ function(module, exports, __webpack_require__) {
  8625.  
  8626. // optional / simple context binding
  8627. var aFunction = __webpack_require__(/*! ./$.a-function */ 39);
  8628. module.exports = function(fn, that, length){
  8629. aFunction(fn);
  8630. if(that === undefined)return fn;
  8631. switch(length){
  8632. case 1: return function(a){
  8633. return fn.call(that, a);
  8634. };
  8635. case 2: return function(a, b){
  8636. return fn.call(that, a, b);
  8637. };
  8638. case 3: return function(a, b, c){
  8639. return fn.call(that, a, b, c);
  8640. };
  8641. } return function(/* ...args */){
  8642. return fn.apply(that, arguments);
  8643. };
  8644. };
  8645.  
  8646. /***/ },
  8647. /* 39 */
  8648. /*!*******************************************************************!*\
  8649. !*** ./~/babel-runtime/~/core-js/library/modules/$.a-function.js ***!
  8650. \*******************************************************************/
  8651. /***/ function(module, exports) {
  8652.  
  8653. module.exports = function(it){
  8654. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  8655. return it;
  8656. };
  8657.  
  8658. /***/ },
  8659. /* 40 */
  8660. /*!******************************************************************!*\
  8661. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-object.js ***!
  8662. \******************************************************************/
  8663. /***/ function(module, exports, __webpack_require__) {
  8664.  
  8665. // 7.1.13 ToObject(argument)
  8666. var defined = __webpack_require__(/*! ./$.defined */ 18);
  8667. module.exports = function(it){
  8668. return Object(defined(it));
  8669. };
  8670.  
  8671. /***/ },
  8672. /* 41 */
  8673. /*!******************************************************************!*\
  8674. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-call.js ***!
  8675. \******************************************************************/
  8676. /***/ function(module, exports, __webpack_require__) {
  8677.  
  8678. // call something on iterator step with safe closing on error
  8679. var anObject = __webpack_require__(/*! ./$.an-object */ 42);
  8680. module.exports = function(iterator, fn, value, entries){
  8681. try {
  8682. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  8683. // 7.4.6 IteratorClose(iterator, completion)
  8684. } catch(e){
  8685. var ret = iterator['return'];
  8686. if(ret !== undefined)anObject(ret.call(iterator));
  8687. throw e;
  8688. }
  8689. };
  8690.  
  8691. /***/ },
  8692. /* 42 */
  8693. /*!******************************************************************!*\
  8694. !*** ./~/babel-runtime/~/core-js/library/modules/$.an-object.js ***!
  8695. \******************************************************************/
  8696. /***/ function(module, exports, __webpack_require__) {
  8697.  
  8698. var isObject = __webpack_require__(/*! ./$.is-object */ 43);
  8699. module.exports = function(it){
  8700. if(!isObject(it))throw TypeError(it + ' is not an object!');
  8701. return it;
  8702. };
  8703.  
  8704. /***/ },
  8705. /* 43 */
  8706. /*!******************************************************************!*\
  8707. !*** ./~/babel-runtime/~/core-js/library/modules/$.is-object.js ***!
  8708. \******************************************************************/
  8709. /***/ function(module, exports) {
  8710.  
  8711. // http://jsperf.com/core-js-isobject
  8712. module.exports = function(it){
  8713. return it !== null && (typeof it == 'object' || typeof it == 'function');
  8714. };
  8715.  
  8716. /***/ },
  8717. /* 44 */
  8718. /*!**********************************************************************!*\
  8719. !*** ./~/babel-runtime/~/core-js/library/modules/$.is-array-iter.js ***!
  8720. \**********************************************************************/
  8721. /***/ function(module, exports, __webpack_require__) {
  8722.  
  8723. // check on default Array iterator
  8724. var Iterators = __webpack_require__(/*! ./$.iterators */ 33)
  8725. , ITERATOR = __webpack_require__(/*! ./$.wks */ 30)('iterator');
  8726. module.exports = function(it){
  8727. return (Iterators.Array || Array.prototype[ITERATOR]) === it;
  8728. };
  8729.  
  8730. /***/ },
  8731. /* 45 */
  8732. /*!******************************************************************!*\
  8733. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-length.js ***!
  8734. \******************************************************************/
  8735. /***/ function(module, exports, __webpack_require__) {
  8736.  
  8737. // 7.1.15 ToLength
  8738. var toInteger = __webpack_require__(/*! ./$.to-integer */ 17)
  8739. , min = Math.min;
  8740. module.exports = function(it){
  8741. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  8742. };
  8743.  
  8744. /***/ },
  8745. /* 46 */
  8746. /*!*******************************************************************************!*\
  8747. !*** ./~/babel-runtime/~/core-js/library/modules/core.get-iterator-method.js ***!
  8748. \*******************************************************************************/
  8749. /***/ function(module, exports, __webpack_require__) {
  8750.  
  8751. var classof = __webpack_require__(/*! ./$.classof */ 47)
  8752. , ITERATOR = __webpack_require__(/*! ./$.wks */ 30)('iterator')
  8753. , Iterators = __webpack_require__(/*! ./$.iterators */ 33);
  8754. module.exports = __webpack_require__(/*! ./$.core */ 23).getIteratorMethod = function(it){
  8755. if(it != undefined)return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];
  8756. };
  8757.  
  8758. /***/ },
  8759. /* 47 */
  8760. /*!****************************************************************!*\
  8761. !*** ./~/babel-runtime/~/core-js/library/modules/$.classof.js ***!
  8762. \****************************************************************/
  8763. /***/ function(module, exports, __webpack_require__) {
  8764.  
  8765. // getting tag from 19.1.3.6 Object.prototype.toString()
  8766. var cof = __webpack_require__(/*! ./$.cof */ 48)
  8767. , TAG = __webpack_require__(/*! ./$.wks */ 30)('toStringTag')
  8768. // ES3 wrong here
  8769. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  8770. module.exports = function(it){
  8771. var O, T, B;
  8772. return it === undefined ? 'Undefined' : it === null ? 'Null'
  8773. // @@toStringTag case
  8774. : typeof (T = (O = Object(it))[TAG]) == 'string' ? T
  8775. // builtinTag case
  8776. : ARG ? cof(O)
  8777. // ES3 arguments fallback
  8778. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  8779. };
  8780.  
  8781. /***/ },
  8782. /* 48 */
  8783. /*!************************************************************!*\
  8784. !*** ./~/babel-runtime/~/core-js/library/modules/$.cof.js ***!
  8785. \************************************************************/
  8786. /***/ function(module, exports) {
  8787.  
  8788. var toString = {}.toString;
  8789. module.exports = function(it){
  8790. return toString.call(it).slice(8, -1);
  8791. };
  8792.  
  8793. /***/ },
  8794. /* 49 */
  8795. /*!********************************************************************!*\
  8796. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-detect.js ***!
  8797. \********************************************************************/
  8798. /***/ function(module, exports, __webpack_require__) {
  8799.  
  8800. var SYMBOL_ITERATOR = __webpack_require__(/*! ./$.wks */ 30)('iterator')
  8801. , SAFE_CLOSING = false;
  8802. try {
  8803. var riter = [7][SYMBOL_ITERATOR]();
  8804. riter['return'] = function(){ SAFE_CLOSING = true; };
  8805. Array.from(riter, function(){ throw 2; });
  8806. } catch(e){ /* empty */ }
  8807. module.exports = function(exec){
  8808. if(!SAFE_CLOSING)return false;
  8809. var safe = false;
  8810. try {
  8811. var arr = [7]
  8812. , iter = arr[SYMBOL_ITERATOR]();
  8813. iter.next = function(){ safe = true; };
  8814. arr[SYMBOL_ITERATOR] = function(){ return iter; };
  8815. exec(arr);
  8816. } catch(e){ /* empty */ }
  8817. return safe;
  8818. };
  8819.  
  8820. /***/ },
  8821. /* 50 */
  8822. /*!**************************************************!*\
  8823. !*** ./~/babel-runtime/core-js/object/assign.js ***!
  8824. \**************************************************/
  8825. /***/ function(module, exports, __webpack_require__) {
  8826.  
  8827. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/assign */ 51), __esModule: true };
  8828.  
  8829. /***/ },
  8830. /* 51 */
  8831. /*!***************************************************************!*\
  8832. !*** ./~/babel-runtime/~/core-js/library/fn/object/assign.js ***!
  8833. \***************************************************************/
  8834. /***/ function(module, exports, __webpack_require__) {
  8835.  
  8836. __webpack_require__(/*! ../../modules/es6.object.assign */ 52);
  8837. module.exports = __webpack_require__(/*! ../../modules/$.core */ 23).Object.assign;
  8838.  
  8839. /***/ },
  8840. /* 52 */
  8841. /*!************************************************************************!*\
  8842. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.assign.js ***!
  8843. \************************************************************************/
  8844. /***/ function(module, exports, __webpack_require__) {
  8845.  
  8846. // 19.1.3.1 Object.assign(target, source)
  8847. var $def = __webpack_require__(/*! ./$.def */ 21);
  8848. $def($def.S, 'Object', {assign: __webpack_require__(/*! ./$.assign */ 53)});
  8849.  
  8850. /***/ },
  8851. /* 53 */
  8852. /*!***************************************************************!*\
  8853. !*** ./~/babel-runtime/~/core-js/library/modules/$.assign.js ***!
  8854. \***************************************************************/
  8855. /***/ function(module, exports, __webpack_require__) {
  8856.  
  8857. // 19.1.2.1 Object.assign(target, source, ...)
  8858. var toObject = __webpack_require__(/*! ./$.to-object */ 40)
  8859. , IObject = __webpack_require__(/*! ./$.iobject */ 54)
  8860. , enumKeys = __webpack_require__(/*! ./$.enum-keys */ 55);
  8861. /* eslint-disable no-unused-vars */
  8862. module.exports = Object.assign || function assign(target, source){
  8863. /* eslint-enable no-unused-vars */
  8864. var T = toObject(target)
  8865. , l = arguments.length
  8866. , i = 1;
  8867. while(l > i){
  8868. var S = IObject(arguments[i++])
  8869. , keys = enumKeys(S)
  8870. , length = keys.length
  8871. , j = 0
  8872. , key;
  8873. while(length > j)T[key = keys[j++]] = S[key];
  8874. }
  8875. return T;
  8876. };
  8877.  
  8878. /***/ },
  8879. /* 54 */
  8880. /*!****************************************************************!*\
  8881. !*** ./~/babel-runtime/~/core-js/library/modules/$.iobject.js ***!
  8882. \****************************************************************/
  8883. /***/ function(module, exports, __webpack_require__) {
  8884.  
  8885. // indexed object, fallback for non-array-like ES3 strings
  8886. var cof = __webpack_require__(/*! ./$.cof */ 48);
  8887. module.exports = 0 in Object('z') ? Object : function(it){
  8888. return cof(it) == 'String' ? it.split('') : Object(it);
  8889. };
  8890.  
  8891. /***/ },
  8892. /* 55 */
  8893. /*!******************************************************************!*\
  8894. !*** ./~/babel-runtime/~/core-js/library/modules/$.enum-keys.js ***!
  8895. \******************************************************************/
  8896. /***/ function(module, exports, __webpack_require__) {
  8897.  
  8898. // all enumerable object keys, includes symbols
  8899. var $ = __webpack_require__(/*! ./$ */ 10);
  8900. module.exports = function(it){
  8901. var keys = $.getKeys(it)
  8902. , getSymbols = $.getSymbols;
  8903. if(getSymbols){
  8904. var symbols = getSymbols(it)
  8905. , isEnum = $.isEnum
  8906. , i = 0
  8907. , key;
  8908. while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key);
  8909. }
  8910. return keys;
  8911. };
  8912.  
  8913. /***/ },
  8914. /* 56 */
  8915. /*!*************************************!*\
  8916. !*** ./src/scripts/web/node-set.js ***!
  8917. \*************************************/
  8918. /***/ function(module, exports, __webpack_require__) {
  8919.  
  8920. // ----------------------------------------------------------------------------
  8921. "use strict";
  8922. var _createClass = __webpack_require__(/*! babel-runtime/helpers/create-class */ 7)["default"];
  8923. var _classCallCheck = __webpack_require__(/*! babel-runtime/helpers/class-call-check */ 11)["default"];
  8924. var _toConsumableArray = __webpack_require__(/*! babel-runtime/helpers/to-consumable-array */ 12)["default"];
  8925. var _Set = __webpack_require__(/*! babel-runtime/core-js/set */ 57)["default"];
  8926. Object.defineProperty(exports, "__esModule", {
  8927. value: true
  8928. });
  8929. var NodeSet = (function () {
  8930. function NodeSet() {
  8931. _classCallCheck(this, NodeSet);
  8932. this._set = new _Set();
  8933. this.add.apply(this, arguments);
  8934. }
  8935. _createClass(NodeSet, [{
  8936. key: "add",
  8937. value: function add() {
  8938. var _this = this;
  8939. for (var _len = arguments.length, items = Array(_len), _key = 0; _key < _len; _key++) {
  8940. items[_key] = arguments[_key];
  8941. }
  8942. items.forEach(function (item) {
  8943. if (Array.isArray(item)) {
  8944. _this.add.apply(_this, _toConsumableArray(item));
  8945. } else if (item instanceof NodeSet) {
  8946. _this.add.apply(_this, _toConsumableArray(item._set));
  8947. } else {
  8948. _this._set.add(item);
  8949. }
  8950. });
  8951. return this;
  8952. }
  8953. }, {
  8954. key: "remove",
  8955. value: function remove() {
  8956. var _this2 = this;
  8957. for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  8958. items[_key2] = arguments[_key2];
  8959. }
  8960. items.forEach(function (item) {
  8961. if (Array.isArray(item)) {
  8962. _this2.remove.apply(_this2, _toConsumableArray(item));
  8963. } else if (item instanceof NodeSet) {
  8964. _this2.remove.apply(_this2, _toConsumableArray(item._set));
  8965. } else {
  8966. _this2._set["delete"](item);
  8967. }
  8968. });
  8969. return this;
  8970. }
  8971. }, {
  8972. key: "intersection",
  8973. value: function intersection(other) {
  8974. return new NodeSet([].concat(_toConsumableArray(this._set)).filter(function (v) {
  8975. return other._set.has(v);
  8976. }));
  8977. }
  8978. }, {
  8979. key: "forEach",
  8980. value: function forEach(func) {
  8981. var items = [].concat(_toConsumableArray(this._set));
  8982. this._set.clear();
  8983. items.forEach(func);
  8984. return this;
  8985. }
  8986. }, {
  8987. key: "take",
  8988. value: function take() {
  8989. var items = [].concat(_toConsumableArray(this._set));
  8990. this._set.clear();
  8991. return items;
  8992. }
  8993. }, {
  8994. key: "length",
  8995. get: function get() {
  8996. return this._set.size;
  8997. }
  8998. }]);
  8999. return NodeSet;
  9000. })();
  9001. exports["default"] = NodeSet;
  9002. module.exports = exports["default"];
  9003.  
  9004. /***/ },
  9005. /* 57 */
  9006. /*!****************************************!*\
  9007. !*** ./~/babel-runtime/core-js/set.js ***!
  9008. \****************************************/
  9009. /***/ function(module, exports, __webpack_require__) {
  9010.  
  9011. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/set */ 58), __esModule: true };
  9012.  
  9013. /***/ },
  9014. /* 58 */
  9015. /*!*****************************************************!*\
  9016. !*** ./~/babel-runtime/~/core-js/library/fn/set.js ***!
  9017. \*****************************************************/
  9018. /***/ function(module, exports, __webpack_require__) {
  9019.  
  9020. __webpack_require__(/*! ../modules/es6.object.to-string */ 59);
  9021. __webpack_require__(/*! ../modules/es6.string.iterator */ 15);
  9022. __webpack_require__(/*! ../modules/web.dom.iterable */ 60);
  9023. __webpack_require__(/*! ../modules/es6.set */ 65);
  9024. __webpack_require__(/*! ../modules/es7.set.to-json */ 72);
  9025. module.exports = __webpack_require__(/*! ../modules/$.core */ 23).Set;
  9026.  
  9027. /***/ },
  9028. /* 59 */
  9029. /*!***************************************************************************!*\
  9030. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.to-string.js ***!
  9031. \***************************************************************************/
  9032. /***/ function(module, exports) {
  9033.  
  9034.  
  9035.  
  9036. /***/ },
  9037. /* 60 */
  9038. /*!***********************************************************************!*\
  9039. !*** ./~/babel-runtime/~/core-js/library/modules/web.dom.iterable.js ***!
  9040. \***********************************************************************/
  9041. /***/ function(module, exports, __webpack_require__) {
  9042.  
  9043. __webpack_require__(/*! ./es6.array.iterator */ 61);
  9044. var Iterators = __webpack_require__(/*! ./$.iterators */ 33);
  9045. Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array;
  9046.  
  9047. /***/ },
  9048. /* 61 */
  9049. /*!*************************************************************************!*\
  9050. !*** ./~/babel-runtime/~/core-js/library/modules/es6.array.iterator.js ***!
  9051. \*************************************************************************/
  9052. /***/ function(module, exports, __webpack_require__) {
  9053.  
  9054. 'use strict';
  9055. var setUnscope = __webpack_require__(/*! ./$.unscope */ 62)
  9056. , step = __webpack_require__(/*! ./$.iter-step */ 63)
  9057. , Iterators = __webpack_require__(/*! ./$.iterators */ 33)
  9058. , toIObject = __webpack_require__(/*! ./$.to-iobject */ 64);
  9059. // 22.1.3.4 Array.prototype.entries()
  9060. // 22.1.3.13 Array.prototype.keys()
  9061. // 22.1.3.29 Array.prototype.values()
  9062. // 22.1.3.30 Array.prototype[@@iterator]()
  9063. __webpack_require__(/*! ./$.iter-define */ 19)(Array, 'Array', function(iterated, kind){
  9064. this._t = toIObject(iterated); // target
  9065. this._i = 0; // next index
  9066. this._k = kind; // kind
  9067. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  9068. }, function(){
  9069. var O = this._t
  9070. , kind = this._k
  9071. , index = this._i++;
  9072. if(!O || index >= O.length){
  9073. this._t = undefined;
  9074. return step(1);
  9075. }
  9076. if(kind == 'keys' )return step(0, index);
  9077. if(kind == 'values')return step(0, O[index]);
  9078. return step(0, [index, O[index]]);
  9079. }, 'values');
  9080. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  9081. Iterators.Arguments = Iterators.Array;
  9082. setUnscope('keys');
  9083. setUnscope('values');
  9084. setUnscope('entries');
  9085.  
  9086. /***/ },
  9087. /* 62 */
  9088. /*!****************************************************************!*\
  9089. !*** ./~/babel-runtime/~/core-js/library/modules/$.unscope.js ***!
  9090. \****************************************************************/
  9091. /***/ function(module, exports) {
  9092.  
  9093. module.exports = function(){ /* empty */ };
  9094.  
  9095. /***/ },
  9096. /* 63 */
  9097. /*!******************************************************************!*\
  9098. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-step.js ***!
  9099. \******************************************************************/
  9100. /***/ function(module, exports) {
  9101.  
  9102. module.exports = function(done, value){
  9103. return {value: value, done: !!done};
  9104. };
  9105.  
  9106. /***/ },
  9107. /* 64 */
  9108. /*!*******************************************************************!*\
  9109. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-iobject.js ***!
  9110. \*******************************************************************/
  9111. /***/ function(module, exports, __webpack_require__) {
  9112.  
  9113. // to indexed object, toObject with fallback for non-array-like ES3 strings
  9114. var IObject = __webpack_require__(/*! ./$.iobject */ 54)
  9115. , defined = __webpack_require__(/*! ./$.defined */ 18);
  9116. module.exports = function(it){
  9117. return IObject(defined(it));
  9118. };
  9119.  
  9120. /***/ },
  9121. /* 65 */
  9122. /*!**************************************************************!*\
  9123. !*** ./~/babel-runtime/~/core-js/library/modules/es6.set.js ***!
  9124. \**************************************************************/
  9125. /***/ function(module, exports, __webpack_require__) {
  9126.  
  9127. 'use strict';
  9128. var strong = __webpack_require__(/*! ./$.collection-strong */ 66);
  9129. // 23.2 Set Objects
  9130. __webpack_require__(/*! ./$.collection */ 71)('Set', function(get){
  9131. return function Set(){ return get(this, arguments[0]); };
  9132. }, {
  9133. // 23.2.3.1 Set.prototype.add(value)
  9134. add: function add(value){
  9135. return strong.def(this, value = value === 0 ? 0 : value, value);
  9136. }
  9137. }, strong);
  9138.  
  9139. /***/ },
  9140. /* 66 */
  9141. /*!**************************************************************************!*\
  9142. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection-strong.js ***!
  9143. \**************************************************************************/
  9144. /***/ function(module, exports, __webpack_require__) {
  9145.  
  9146. 'use strict';
  9147. var $ = __webpack_require__(/*! ./$ */ 10)
  9148. , hide = __webpack_require__(/*! ./$.hide */ 25)
  9149. , ctx = __webpack_require__(/*! ./$.ctx */ 38)
  9150. , species = __webpack_require__(/*! ./$.species */ 67)
  9151. , strictNew = __webpack_require__(/*! ./$.strict-new */ 68)
  9152. , defined = __webpack_require__(/*! ./$.defined */ 18)
  9153. , forOf = __webpack_require__(/*! ./$.for-of */ 69)
  9154. , step = __webpack_require__(/*! ./$.iter-step */ 63)
  9155. , ID = __webpack_require__(/*! ./$.uid */ 32)('id')
  9156. , $has = __webpack_require__(/*! ./$.has */ 29)
  9157. , isObject = __webpack_require__(/*! ./$.is-object */ 43)
  9158. , isExtensible = Object.isExtensible || isObject
  9159. , SUPPORT_DESC = __webpack_require__(/*! ./$.support-desc */ 27)
  9160. , SIZE = SUPPORT_DESC ? '_s' : 'size'
  9161. , id = 0;
  9162. var fastKey = function(it, create){
  9163. // return primitive with prefix
  9164. if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  9165. if(!$has(it, ID)){
  9166. // can't set id to frozen object
  9167. if(!isExtensible(it))return 'F';
  9168. // not necessary to add id
  9169. if(!create)return 'E';
  9170. // add missing object id
  9171. hide(it, ID, ++id);
  9172. // return object id with prefix
  9173. } return 'O' + it[ID];
  9174. };
  9175. var getEntry = function(that, key){
  9176. // fast case
  9177. var index = fastKey(key), entry;
  9178. if(index !== 'F')return that._i[index];
  9179. // frozen object case
  9180. for(entry = that._f; entry; entry = entry.n){
  9181. if(entry.k == key)return entry;
  9182. }
  9183. };
  9184. module.exports = {
  9185. getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
  9186. var C = wrapper(function(that, iterable){
  9187. strictNew(that, C, NAME);
  9188. that._i = $.create(null); // index
  9189. that._f = undefined; // first entry
  9190. that._l = undefined; // last entry
  9191. that[SIZE] = 0; // size
  9192. if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
  9193. });
  9194. __webpack_require__(/*! ./$.mix */ 70)(C.prototype, {
  9195. // 23.1.3.1 Map.prototype.clear()
  9196. // 23.2.3.2 Set.prototype.clear()
  9197. clear: function clear(){
  9198. for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
  9199. entry.r = true;
  9200. if(entry.p)entry.p = entry.p.n = undefined;
  9201. delete data[entry.i];
  9202. }
  9203. that._f = that._l = undefined;
  9204. that[SIZE] = 0;
  9205. },
  9206. // 23.1.3.3 Map.prototype.delete(key)
  9207. // 23.2.3.4 Set.prototype.delete(value)
  9208. 'delete': function(key){
  9209. var that = this
  9210. , entry = getEntry(that, key);
  9211. if(entry){
  9212. var next = entry.n
  9213. , prev = entry.p;
  9214. delete that._i[entry.i];
  9215. entry.r = true;
  9216. if(prev)prev.n = next;
  9217. if(next)next.p = prev;
  9218. if(that._f == entry)that._f = next;
  9219. if(that._l == entry)that._l = prev;
  9220. that[SIZE]--;
  9221. } return !!entry;
  9222. },
  9223. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  9224. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  9225. forEach: function forEach(callbackfn /*, that = undefined */){
  9226. var f = ctx(callbackfn, arguments[1], 3)
  9227. , entry;
  9228. while(entry = entry ? entry.n : this._f){
  9229. f(entry.v, entry.k, this);
  9230. // revert to the last existing entry
  9231. while(entry && entry.r)entry = entry.p;
  9232. }
  9233. },
  9234. // 23.1.3.7 Map.prototype.has(key)
  9235. // 23.2.3.7 Set.prototype.has(value)
  9236. has: function has(key){
  9237. return !!getEntry(this, key);
  9238. }
  9239. });
  9240. if(SUPPORT_DESC)$.setDesc(C.prototype, 'size', {
  9241. get: function(){
  9242. return defined(this[SIZE]);
  9243. }
  9244. });
  9245. return C;
  9246. },
  9247. def: function(that, key, value){
  9248. var entry = getEntry(that, key)
  9249. , prev, index;
  9250. // change existing entry
  9251. if(entry){
  9252. entry.v = value;
  9253. // create new entry
  9254. } else {
  9255. that._l = entry = {
  9256. i: index = fastKey(key, true), // <- index
  9257. k: key, // <- key
  9258. v: value, // <- value
  9259. p: prev = that._l, // <- previous entry
  9260. n: undefined, // <- next entry
  9261. r: false // <- removed
  9262. };
  9263. if(!that._f)that._f = entry;
  9264. if(prev)prev.n = entry;
  9265. that[SIZE]++;
  9266. // add to index
  9267. if(index !== 'F')that._i[index] = entry;
  9268. } return that;
  9269. },
  9270. getEntry: getEntry,
  9271. setStrong: function(C, NAME, IS_MAP){
  9272. // add .keys, .values, .entries, [@@iterator]
  9273. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  9274. __webpack_require__(/*! ./$.iter-define */ 19)(C, NAME, function(iterated, kind){
  9275. this._t = iterated; // target
  9276. this._k = kind; // kind
  9277. this._l = undefined; // previous
  9278. }, function(){
  9279. var that = this
  9280. , kind = that._k
  9281. , entry = that._l;
  9282. // revert to the last existing entry
  9283. while(entry && entry.r)entry = entry.p;
  9284. // get next entry
  9285. if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
  9286. // or finish the iteration
  9287. that._t = undefined;
  9288. return step(1);
  9289. }
  9290. // return step by kind
  9291. if(kind == 'keys' )return step(0, entry.k);
  9292. if(kind == 'values')return step(0, entry.v);
  9293. return step(0, [entry.k, entry.v]);
  9294. }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
  9295. // add [@@species], 23.1.2.2, 23.2.2.2
  9296. species(C);
  9297. species(__webpack_require__(/*! ./$.core */ 23)[NAME]); // for wrapper
  9298. }
  9299. };
  9300.  
  9301. /***/ },
  9302. /* 67 */
  9303. /*!****************************************************************!*\
  9304. !*** ./~/babel-runtime/~/core-js/library/modules/$.species.js ***!
  9305. \****************************************************************/
  9306. /***/ function(module, exports, __webpack_require__) {
  9307.  
  9308. 'use strict';
  9309. var $ = __webpack_require__(/*! ./$ */ 10)
  9310. , SPECIES = __webpack_require__(/*! ./$.wks */ 30)('species');
  9311. module.exports = function(C){
  9312. if(__webpack_require__(/*! ./$.support-desc */ 27) && !(SPECIES in C))$.setDesc(C, SPECIES, {
  9313. configurable: true,
  9314. get: function(){ return this; }
  9315. });
  9316. };
  9317.  
  9318. /***/ },
  9319. /* 68 */
  9320. /*!*******************************************************************!*\
  9321. !*** ./~/babel-runtime/~/core-js/library/modules/$.strict-new.js ***!
  9322. \*******************************************************************/
  9323. /***/ function(module, exports) {
  9324.  
  9325. module.exports = function(it, Constructor, name){
  9326. if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!");
  9327. return it;
  9328. };
  9329.  
  9330. /***/ },
  9331. /* 69 */
  9332. /*!***************************************************************!*\
  9333. !*** ./~/babel-runtime/~/core-js/library/modules/$.for-of.js ***!
  9334. \***************************************************************/
  9335. /***/ function(module, exports, __webpack_require__) {
  9336.  
  9337. var ctx = __webpack_require__(/*! ./$.ctx */ 38)
  9338. , call = __webpack_require__(/*! ./$.iter-call */ 41)
  9339. , isArrayIter = __webpack_require__(/*! ./$.is-array-iter */ 44)
  9340. , anObject = __webpack_require__(/*! ./$.an-object */ 42)
  9341. , toLength = __webpack_require__(/*! ./$.to-length */ 45)
  9342. , getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 46);
  9343. module.exports = function(iterable, entries, fn, that){
  9344. var iterFn = getIterFn(iterable)
  9345. , f = ctx(fn, that, entries ? 2 : 1)
  9346. , index = 0
  9347. , length, step, iterator;
  9348. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  9349. // fast case for arrays with default iterator
  9350. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  9351. entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  9352. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  9353. call(iterator, f, step.value, entries);
  9354. }
  9355. };
  9356.  
  9357. /***/ },
  9358. /* 70 */
  9359. /*!************************************************************!*\
  9360. !*** ./~/babel-runtime/~/core-js/library/modules/$.mix.js ***!
  9361. \************************************************************/
  9362. /***/ function(module, exports, __webpack_require__) {
  9363.  
  9364. var $redef = __webpack_require__(/*! ./$.redef */ 24);
  9365. module.exports = function(target, src){
  9366. for(var key in src)$redef(target, key, src[key]);
  9367. return target;
  9368. };
  9369.  
  9370. /***/ },
  9371. /* 71 */
  9372. /*!*******************************************************************!*\
  9373. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection.js ***!
  9374. \*******************************************************************/
  9375. /***/ function(module, exports, __webpack_require__) {
  9376.  
  9377. 'use strict';
  9378. var $ = __webpack_require__(/*! ./$ */ 10)
  9379. , $def = __webpack_require__(/*! ./$.def */ 21)
  9380. , hide = __webpack_require__(/*! ./$.hide */ 25)
  9381. , BUGGY = __webpack_require__(/*! ./$.iter-buggy */ 36)
  9382. , forOf = __webpack_require__(/*! ./$.for-of */ 69)
  9383. , strictNew = __webpack_require__(/*! ./$.strict-new */ 68);
  9384. module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
  9385. var Base = __webpack_require__(/*! ./$.global */ 22)[NAME]
  9386. , C = Base
  9387. , ADDER = IS_MAP ? 'set' : 'add'
  9388. , proto = C && C.prototype
  9389. , O = {};
  9390. if(!__webpack_require__(/*! ./$.support-desc */ 27) || typeof C != 'function'
  9391. || !(IS_WEAK || !BUGGY && proto.forEach && proto.entries)){
  9392. // create collection constructor
  9393. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  9394. __webpack_require__(/*! ./$.mix */ 70)(C.prototype, methods);
  9395. } else {
  9396. C = wrapper(function(target, iterable){
  9397. strictNew(target, C, NAME);
  9398. target._c = new Base;
  9399. if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target);
  9400. });
  9401. $.each.call('add,clear,delete,forEach,get,has,set,keys,values,entries'.split(','),function(KEY){
  9402. var chain = KEY == 'add' || KEY == 'set';
  9403. if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){
  9404. var result = this._c[KEY](a === 0 ? 0 : a, b);
  9405. return chain ? this : result;
  9406. });
  9407. });
  9408. if('size' in proto)$.setDesc(C.prototype, 'size', {
  9409. get: function(){
  9410. return this._c.size;
  9411. }
  9412. });
  9413. }
  9414. __webpack_require__(/*! ./$.tag */ 35)(C, NAME);
  9415. O[NAME] = C;
  9416. $def($def.G + $def.W + $def.F, O);
  9417. if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
  9418. return C;
  9419. };
  9420.  
  9421. /***/ },
  9422. /* 72 */
  9423. /*!**********************************************************************!*\
  9424. !*** ./~/babel-runtime/~/core-js/library/modules/es7.set.to-json.js ***!
  9425. \**********************************************************************/
  9426. /***/ function(module, exports, __webpack_require__) {
  9427.  
  9428. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  9429. var $def = __webpack_require__(/*! ./$.def */ 21);
  9430. $def($def.P, 'Set', {toJSON: __webpack_require__(/*! ./$.collection-to-json */ 73)('Set')});
  9431.  
  9432. /***/ },
  9433. /* 73 */
  9434. /*!***************************************************************************!*\
  9435. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection-to-json.js ***!
  9436. \***************************************************************************/
  9437. /***/ function(module, exports, __webpack_require__) {
  9438.  
  9439. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  9440. var forOf = __webpack_require__(/*! ./$.for-of */ 69)
  9441. , classof = __webpack_require__(/*! ./$.classof */ 47);
  9442. module.exports = function(NAME){
  9443. return function toJSON(){
  9444. if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
  9445. var arr = [];
  9446. forOf(this, false, arr.push, arr);
  9447. return arr;
  9448. };
  9449. };
  9450.  
  9451. /***/ },
  9452. /* 74 */
  9453. /*!**************************************!*\
  9454. !*** ./src/scripts/func/debounce.js ***!
  9455. \**************************************/
  9456. /***/ function(module, exports) {
  9457.  
  9458. // ----------------------------------------------------------------------------
  9459. /**
  9460. * Wait until threshold ms has elapsed between function calls to
  9461. * call the function i.e. delay until after calls have stopped.
  9462. *
  9463. * If immediate, instead call the function on the first call, then
  9464. * ignore further calls until delay ms after further calls have
  9465. * stopped.
  9466. */
  9467. 'use strict';
  9468. Object.defineProperty(exports, '__esModule', {
  9469. value: true
  9470. });
  9471. exports['default'] = debounce;
  9472. function debounce(func, threshold, immediate) {
  9473. threshold = typeof threshold === 'number' ? threshold : 100;
  9474. var timeout = null;
  9475. return function debounced() {
  9476. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9477. args[_key] = arguments[_key];
  9478. }
  9479. var fn = func.bind(this);
  9480. function afterthreshold() {
  9481. if (!immediate) {
  9482. fn.apply(undefined, args);
  9483. }
  9484. timeout = null;
  9485. }
  9486. var callNow = immediate && !timeout;
  9487. clearTimeout(timeout);
  9488. timeout = setTimeout(afterthreshold, threshold);
  9489. if (callNow) {
  9490. fn.apply(undefined, args);
  9491. }
  9492. };
  9493. }
  9494. module.exports = exports['default'];
  9495.  
  9496. /***/ }
  9497. /******/ ])
  9498. });
  9499. ;
  9500. //# sourceMappingURL=jquery-extras.js.map