vendor: 5,443 bytes, lines 1-194
1// импоÑÑиÑÑем jQuery 2/*! 3 * jQuery JavaScript Library v3.4.1 4 * https://jquery.com/ 5 * 6 * Includes Sizzle.js 7 * https://sizzlejs.com/ 8 * 9 * Copyright JS Foundation and other contributors 10 * Released under the MIT license 11 * https://jquery.org/license 12 * 13 * Date: 2019-05-01T21:04Z 14 */ 15( function( global, factory ) { 16 17 "use strict"; 18 19 if ( typeof module === "object" && typeof module.exports === "object" ) { 20 21 // For CommonJS and CommonJS-like environments where a proper `window` 22 // is present, execute the factory and get jQuery. 23 // For environments that do not have a `window` with a `document` 24 // (such as Node.js), expose a factory as module.exports. 25 // This accentuates the need for the creation of a real `window`. 26 // e.g. var jQuery = require("jquery")(window); 27 // See ticket #14549 for more info. 28 module.exports = global.document ? 29 factory( global, true ) : 30 function( w ) { 31 if ( !w.document ) { 32 throw new Error( "jQuery requires a window with a document" ); 33 } 34 return factory( w ); 35 }; 36 } else { 37 factory( global ); 38 } 39 40// Pass this if window is not defined yet 41} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 42 43// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 44// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 45// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 46// enough that all such attempts are guarded in a try block. 47"use strict"; 48 49var arr = []; 50 51var document = window.document; 52 53var getProto = Object.getPrototypeOf; 54 55var slice = arr.slice; 56 57var concat = arr.concat; 58 59var push = arr.push; 60 61var indexOf = arr.indexOf; 62 63var class2type = {}; 64 65var toString = class2type.toString; 66 67var hasOwn = class2type.hasOwnProperty; 68 69var fnToString = hasOwn.toString; 70 71var ObjectFunctionString = fnToString.call( Object ); 72 73var support = {}; 74 75var isFunction = function isFunction( obj ) { 76 77 // Support: Chrome <=57, Firefox <=52 78 // In some browsers, typeof returns "function" for HTML <object> elements 79 // (i.e., `typeof document.createElement( "object" ) === "function"`). 80 // We don't want to classify *any* DOM node as a function. 81 return typeof obj === "function" && typeof obj.nodeType !== "number"; 82 }; 83 84 85var isWindow = function isWindow( obj ) { 86 return obj != null && obj === obj.window; 87 }; 88 89 90 91 92 var preservedScriptAttributes = { 93 type: true, 94 src: true, 95 nonce: true, 96 noModule: true 97 }; 98 99 function DOMEval( code, node, doc ) { 100 doc = doc || document; 101 102 var i, val, 103 script = doc.createElement( "script" ); 104 105 script.text = code; 106 if ( node ) { 107 for ( i in preservedScriptAttributes ) { 108 109 // Support: Firefox 64+, Edge 18+ 110 // Some browsers don't support the "nonce" property on scripts. 111 // On the other hand, just using `getAttribute` is not enough as 112 // the `nonce` attribute is reset to an empty string whenever it 113 // becomes browsing-context connected. 114 // See https://github.com/whatwg/html/issues/2369 115 // See https://html.spec.whatwg.org/#nonce-attributes 116 // The `node.getAttribute` check was added for the sake of 117 // `jQuery.globalEval` so that it can fake a nonce-containing node 118 // via an object. 119 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 120 if ( val ) { 121 script.setAttribute( i, val ); 122 } 123 } 124 } 125 doc.head.appendChild( script ).parentNode.removeChild( script ); 126 } 127 128 129function toType( obj ) { 130 if ( obj == null ) { 131 return obj + ""; 132 } 133 134 // Support: Android <=2.3 only (functionish RegExp) 135 return typeof obj === "object" || typeof obj === "function" ? 136 class2type[ toString.call( obj ) ] || "object" : 137 typeof obj; 138} 139/* global Symbol */ 140// Defining this global in .eslintrc.json would create a danger of using the global 141// unguarded in another place, it seems safer to define global only for this module 142 143 144 145var 146 version = "3.4.1", 147 148 // Define a local copy of jQuery 149 jQuery = function( selector, context ) { 150 151 // The jQuery object is actually just the init constructor 'enhanced' 152 // Need init if jQuery is called (just allow error to be thrown if not included) 153 return new jQuery.fn.init( selector, context ); 154 }, 155 156 // Support: Android <=4.0 only 157 // Make sure we trim BOM and NBSP 158 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 159 160jQuery.fn = jQuery.prototype = { 161 162 // The current version of jQuery being used 163 jquery: version, 164 165 constructor: jQuery, 166 167 // The default length of a jQuery object is 0 168 length: 0, 169 170 toArray: function() { 171 return slice.call( this ); 172 }, 173 174 // Get the Nth element in the matched element set OR 175 // Get the whole matched element set as a clean array 176 get: function( num ) { 177 178 // Return all the elements in a clean array 179 if ( num == null ) { 180 return slice.call( this ); 181 } 182 183 // Return just the one element from the set 184 return num < 0 ? this[ num + this.length ] : this[ num ]; 185 }, 186 187 // Take an array of elements and push it onto the stack 188 // (returning the new matched element set) 189 pushStack: function( elems ) { 190 191 // Build a new jQuery matched element set 192 var ret = jQuery.merge( this.constructor(), elems ); 193 194 // Add the old object onto the stack (as a reference)
vendor: 4,367 bytes, lines 195-380
195 ret.prevObject = this; 196 197 // Return the newly-formed element set 198 return ret; 199 }, 200 201 // Execute a callback for every element in the matched set. 202 each: function( callback ) { 203 return jQuery.each( this, callback ); 204 }, 205 206 map: function( callback ) { 207 return this.pushStack( jQuery.map( this, function( elem, i ) { 208 return callback.call( elem, i, elem ); 209 } ) ); 210 }, 211 212 slice: function() { 213 return this.pushStack( slice.apply( this, arguments ) ); 214 }, 215 216 first: function() { 217 return this.eq( 0 ); 218 }, 219 220 last: function() { 221 return this.eq( -1 ); 222 }, 223 224 eq: function( i ) { 225 var len = this.length, 226 j = +i + ( i < 0 ? len : 0 ); 227 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 228 }, 229 230 end: function() { 231 return this.prevObject || this.constructor(); 232 }, 233 234 // For internal use only. 235 // Behaves like an Array's method, not like a jQuery method. 236 push: push, 237 sort: arr.sort, 238 splice: arr.splice 239}; 240 241jQuery.extend = jQuery.fn.extend = function() { 242 var options, name, src, copy, copyIsArray, clone, 243 target = arguments[ 0 ] || {}, 244 i = 1, 245 length = arguments.length, 246 deep = false; 247 248 // Handle a deep copy situation 249 if ( typeof target === "boolean" ) { 250 deep = target; 251 252 // Skip the boolean and the target 253 target = arguments[ i ] || {}; 254 i++; 255 } 256 257 // Handle case when target is a string or something (possible in deep copy) 258 if ( typeof target !== "object" && !isFunction( target ) ) { 259 target = {}; 260 } 261 262 // Extend jQuery itself if only one argument is passed 263 if ( i === length ) { 264 target = this; 265 i--; 266 } 267 268 for ( ; i < length; i++ ) { 269 270 // Only deal with non-null/undefined values 271 if ( ( options = arguments[ i ] ) != null ) { 272 273 // Extend the base object 274 for ( name in options ) { 275 copy = options[ name ]; 276 277 // Prevent Object.prototype pollution 278 // Prevent never-ending loop 279 if ( name === "__proto__" || target === copy ) { 280 continue; 281 } 282 283 // Recurse if we're merging plain objects or arrays 284 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 285 ( copyIsArray = Array.isArray( copy ) ) ) ) { 286 src = target[ name ]; 287 288 // Ensure proper type for the source value 289 if ( copyIsArray && !Array.isArray( src ) ) { 290 clone = []; 291 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 292 clone = {}; 293 } else { 294 clone = src; 295 } 296 copyIsArray = false; 297 298 // Never move original objects, clone them 299 target[ name ] = jQuery.extend( deep, clone, copy ); 300 301 // Don't bring in undefined values 302 } else if ( copy !== undefined ) { 303 target[ name ] = copy; 304 } 305 } 306 } 307 } 308 309 // Return the modified object 310 return target; 311}; 312 313jQuery.extend( { 314 315 // Unique for each copy of jQuery on the page 316 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 317 318 // Assume jQuery is ready without the ready module 319 isReady: true, 320 321 error: function( msg ) { 322 throw new Error( msg ); 323 }, 324 325 noop: function() {}, 326 327 isPlainObject: function( obj ) { 328 var proto, Ctor; 329 330 // Detect obvious negatives 331 // Use toString instead of jQuery.type to catch host objects 332 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 333 return false; 334 } 335 336 proto = getProto( obj ); 337 338 // Objects with no prototype (e.g., `Object.create( null )`) are plain 339 if ( !proto ) { 340 return true; 341 } 342 343 // Objects with prototype are plain iff they were constructed by a global Object function 344 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 345 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 346 }, 347 348 isEmptyObject: function( obj ) { 349 var name; 350 351 for ( name in obj ) { 352 return false; 353 } 354 return true; 355 }, 356 357 // Evaluates a script in a global context 358 globalEval: function( code, options ) { 359 DOMEval( code, { nonce: options && options.nonce } ); 360 }, 361 362 each: function( obj, callback ) { 363 var length, i = 0; 364 365 if ( isArrayLike( obj ) ) { 366 length = obj.length; 367 for ( ; i < length; i++ ) { 368 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 369 break; 370 } 371 } 372 } else { 373 for ( i in obj ) { 374 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 375 break; 376 } 377 } 378 } 379 380 return obj;
vendor: 5,385 bytes, lines 381-604
381 }, 382 383 // Support: Android <=4.0 only 384 trim: function( text ) { 385 return text == null ? 386 "" : 387 ( text + "" ).replace( rtrim, "" ); 388 }, 389 390 // results is for internal usage only 391 makeArray: function( arr, results ) { 392 var ret = results || []; 393 394 if ( arr != null ) { 395 if ( isArrayLike( Object( arr ) ) ) { 396 jQuery.merge( ret, 397 typeof arr === "string" ? 398 [ arr ] : arr 399 ); 400 } else { 401 push.call( ret, arr ); 402 } 403 } 404 405 return ret; 406 }, 407 408 inArray: function( elem, arr, i ) { 409 return arr == null ? -1 : indexOf.call( arr, elem, i ); 410 }, 411 412 // Support: Android <=4.0 only, PhantomJS 1 only 413 // push.apply(_, arraylike) throws on ancient WebKit 414 merge: function( first, second ) { 415 var len = +second.length, 416 j = 0, 417 i = first.length; 418 419 for ( ; j < len; j++ ) { 420 first[ i++ ] = second[ j ]; 421 } 422 423 first.length = i; 424 425 return first; 426 }, 427 428 grep: function( elems, callback, invert ) { 429 var callbackInverse, 430 matches = [], 431 i = 0, 432 length = elems.length, 433 callbackExpect = !invert; 434 435 // Go through the array, only saving the items 436 // that pass the validator function 437 for ( ; i < length; i++ ) { 438 callbackInverse = !callback( elems[ i ], i ); 439 if ( callbackInverse !== callbackExpect ) { 440 matches.push( elems[ i ] ); 441 } 442 } 443 444 return matches; 445 }, 446 447 // arg is for internal usage only 448 map: function( elems, callback, arg ) { 449 var length, value, 450 i = 0, 451 ret = []; 452 453 // Go through the array, translating each of the items to their new values 454 if ( isArrayLike( elems ) ) { 455 length = elems.length; 456 for ( ; i < length; i++ ) { 457 value = callback( elems[ i ], i, arg ); 458 459 if ( value != null ) { 460 ret.push( value ); 461 } 462 } 463 464 // Go through every key on the object, 465 } else { 466 for ( i in elems ) { 467 value = callback( elems[ i ], i, arg ); 468 469 if ( value != null ) { 470 ret.push( value ); 471 } 472 } 473 } 474 475 // Flatten any nested arrays 476 return concat.apply( [], ret ); 477 }, 478 479 // A global GUID counter for objects 480 guid: 1, 481 482 // jQuery.support is not used in Core but other projects attach their 483 // properties to it so it needs to exist. 484 support: support 485} ); 486 487if ( typeof Symbol === "function" ) { 488 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 489} 490 491// Populate the class2type map 492jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 493function( i, name ) { 494 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 495} ); 496 497function isArrayLike( obj ) { 498 499 // Support: real iOS 8.2 only (not reproducible in simulator) 500 // `in` check used to prevent JIT error (gh-2145) 501 // hasOwn isn't used here due to false negatives 502 // regarding Nodelist length in IE 503 var length = !!obj && "length" in obj && obj.length, 504 type = toType( obj ); 505 506 if ( isFunction( obj ) || isWindow( obj ) ) { 507 return false; 508 } 509 510 return type === "array" || length === 0 || 511 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 512} 513var Sizzle = 514/*! 515 * Sizzle CSS Selector Engine v2.3.4 516 * https://sizzlejs.com/ 517 * 518 * Copyright JS Foundation and other contributors 519 * Released under the MIT license 520 * https://js.foundation/ 521 * 522 * Date: 2019-04-08 523 */ 524(function( window ) { 525 526var i, 527 support, 528 Expr, 529 getText, 530 isXML, 531 tokenize, 532 compile, 533 select, 534 outermostContext, 535 sortInput, 536 hasDuplicate, 537 538 // Local document vars 539 setDocument, 540 document, 541 docElem, 542 documentIsHTML, 543 rbuggyQSA, 544 rbuggyMatches, 545 matches, 546 contains, 547 548 // Instance-specific data 549 expando = "sizzle" + 1 * new Date(), 550 preferredDoc = window.document, 551 dirruns = 0, 552 done = 0, 553 classCache = createCache(), 554 tokenCache = createCache(), 555 compilerCache = createCache(), 556 nonnativeSelectorCache = createCache(), 557 sortOrder = function( a, b ) { 558 if ( a === b ) { 559 hasDuplicate = true; 560 } 561 return 0; 562 }, 563 564 // Instance methods 565 hasOwn = ({}).hasOwnProperty, 566 arr = [], 567 pop = arr.pop, 568 push_native = arr.push, 569 push = arr.push, 570 slice = arr.slice, 571 // Use a stripped-down indexOf as it's faster than native 572 // https://jsperf.com/thor-indexof-vs-for/5 573 indexOf = function( list, elem ) { 574 var i = 0, 575 len = list.length; 576 for ( ; i < len; i++ ) { 577 if ( list[i] === elem ) { 578 return i; 579 } 580 } 581 return -1; 582 }, 583 584 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 585 586 // Regular expressions 587 588 // http://www.w3.org/TR/css3-selectors/#whitespace 589 whitespace = "[\\x20\\t\\r\\n\\f]", 590 591 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 592 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", 593 594 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 595 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 596 // Operator (capture 2) 597 "*([*^$|!~]?=)" + whitespace + 598 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 599 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 600 "*\\]", 601 602 pseudos = ":(" + identifier + ")(?:\\((" + 603 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 604 // 1. quoted (capture 3; capture 4 or capture 5)
vendor: 4,530 bytes, lines 605-738
605 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 606 // 2. simple (capture 6) 607 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 608 // 3. anything else (capture 2) 609 ".*" + 610 ")\\)|)", 611 612 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 613 rwhitespace = new RegExp( whitespace + "+", "g" ), 614 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 615 616 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 617 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 618 rdescend = new RegExp( whitespace + "|>" ), 619 620 rpseudo = new RegExp( pseudos ), 621 ridentifier = new RegExp( "^" + identifier + "$" ), 622 623 matchExpr = { 624 "ID": new RegExp( "^#(" + identifier + ")" ), 625 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 626 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 627 "ATTR": new RegExp( "^" + attributes ), 628 "PSEUDO": new RegExp( "^" + pseudos ), 629 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 630 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 631 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 632 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 633 // For use in libraries implementing .is() 634 // We use this for POS matching in `select` 635 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 636 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 637 }, 638 639 rhtml = /HTML$/i, 640 rinputs = /^(?:input|select|textarea|button)$/i, 641 rheader = /^h\d$/i, 642 643 rnative = /^[^{]+\{\s*\[native \w/, 644 645 // Easily-parseable/retrievable ID or TAG or CLASS selectors 646 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 647 648 rsibling = /[+~]/, 649 650 // CSS escapes 651 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 652 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 653 funescape = function( _, escaped, escapedWhitespace ) { 654 var high = "0x" + escaped - 0x10000; 655 // NaN means non-codepoint 656 // Support: Firefox<24 657 // Workaround erroneous numeric interpretation of +"0x" 658 return high !== high || escapedWhitespace ? 659 escaped : 660 high < 0 ? 661 // BMP codepoint 662 String.fromCharCode( high + 0x10000 ) : 663 // Supplemental Plane codepoint (surrogate pair) 664 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 665 }, 666 667 // CSS string/identifier serialization 668 // https://drafts.csswg.org/cssom/#common-serializing-idioms 669 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 670 fcssescape = function( ch, asCodePoint ) { 671 if ( asCodePoint ) { 672 673 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 674 if ( ch === "\0" ) { 675 return "\uFFFD"; 676 } 677 678 // Control characters and (dependent upon position) numbers get escaped as code points 679 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 680 } 681 682 // Other potentially-special ASCII characters get backslash-escaped 683 return "\\" + ch; 684 }, 685 686 // Used for iframes 687 // See setDocument() 688 // Removing the function wrapper causes a "Permission Denied" 689 // error in IE 690 unloadHandler = function() { 691 setDocument(); 692 }, 693 694 inDisabledFieldset = addCombinator( 695 function( elem ) { 696 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 697 }, 698 { dir: "parentNode", next: "legend" } 699 ); 700 701// Optimize for push.apply( _, NodeList ) 702try { 703 push.apply( 704 (arr = slice.call( preferredDoc.childNodes )), 705 preferredDoc.childNodes 706 ); 707 // Support: Android<4.0 708 // Detect silently failing push.apply 709 arr[ preferredDoc.childNodes.length ].nodeType; 710} catch ( e ) { 711 push = { apply: arr.length ? 712 713 // Leverage slice if possible 714 function( target, els ) { 715 push_native.apply( target, slice.call(els) ); 716 } : 717 718 // Support: IE<9 719 // Otherwise append directly 720 function( target, els ) { 721 var j = target.length, 722 i = 0; 723 // Can't trust NodeList.length 724 while ( (target[j++] = els[i++]) ) {} 725 target.length = j - 1; 726 } 727 }; 728} 729 730function Sizzle( selector, context, results, seed ) { 731 var m, i, elem, nid, match, groups, newSelector, 732 newContext = context && context.ownerDocument, 733 734 // nodeType defaults to 9, since context defaults to document 735 nodeType = context ? context.nodeType : 9; 736 737 results = results || []; 738
vendor: 7,829 bytes, lines 739-1011
739 // Return early from calls with invalid selector or context 740 if ( typeof selector !== "string" || !selector || 741 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 742 743 return results; 744 } 745 746 // Try to shortcut find operations (as opposed to filters) in HTML documents 747 if ( !seed ) { 748 749 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 750 setDocument( context ); 751 } 752 context = context || document; 753 754 if ( documentIsHTML ) { 755 756 // If the selector is sufficiently simple, try using a "get*By*" DOM method 757 // (excepting DocumentFragment context, where the methods don't exist) 758 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 759 760 // ID selector 761 if ( (m = match[1]) ) { 762 763 // Document context 764 if ( nodeType === 9 ) { 765 if ( (elem = context.getElementById( m )) ) { 766 767 // Support: IE, Opera, Webkit 768 // TODO: identify versions 769 // getElementById can match elements by name instead of ID 770 if ( elem.id === m ) { 771 results.push( elem ); 772 return results; 773 } 774 } else { 775 return results; 776 } 777 778 // Element context 779 } else { 780 781 // Support: IE, Opera, Webkit 782 // TODO: identify versions 783 // getElementById can match elements by name instead of ID 784 if ( newContext && (elem = newContext.getElementById( m )) && 785 contains( context, elem ) && 786 elem.id === m ) { 787 788 results.push( elem ); 789 return results; 790 } 791 } 792 793 // Type selector 794 } else if ( match[2] ) { 795 push.apply( results, context.getElementsByTagName( selector ) ); 796 return results; 797 798 // Class selector 799 } else if ( (m = match[3]) && support.getElementsByClassName && 800 context.getElementsByClassName ) { 801 802 push.apply( results, context.getElementsByClassName( m ) ); 803 return results; 804 } 805 } 806 807 // Take advantage of querySelectorAll 808 if ( support.qsa && 809 !nonnativeSelectorCache[ selector + " " ] && 810 (!rbuggyQSA || !rbuggyQSA.test( selector )) && 811 812 // Support: IE 8 only 813 // Exclude object elements 814 (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) { 815 816 newSelector = selector; 817 newContext = context; 818 819 // qSA considers elements outside a scoping root when evaluating child or 820 // descendant combinators, which is not what we want. 821 // In such cases, we work around the behavior by prefixing every selector in the 822 // list with an ID selector referencing the scope context. 823 // Thanks to Andrew Dupont for this technique. 824 if ( nodeType === 1 && rdescend.test( selector ) ) { 825 826 // Capture the context ID, setting it first if necessary 827 if ( (nid = context.getAttribute( "id" )) ) { 828 nid = nid.replace( rcssescape, fcssescape ); 829 } else { 830 context.setAttribute( "id", (nid = expando) ); 831 } 832 833 // Prefix every selector in the list 834 groups = tokenize( selector ); 835 i = groups.length; 836 while ( i-- ) { 837 groups[i] = "#" + nid + " " + toSelector( groups[i] ); 838 } 839 newSelector = groups.join( "," ); 840 841 // Expand context for sibling selectors 842 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 843 context; 844 } 845 846 try { 847 push.apply( results, 848 newContext.querySelectorAll( newSelector ) 849 ); 850 return results; 851 } catch ( qsaError ) { 852 nonnativeSelectorCache( selector, true ); 853 } finally { 854 if ( nid === expando ) { 855 context.removeAttribute( "id" ); 856 } 857 } 858 } 859 } 860 } 861 862 // All others 863 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 864} 865 866/** 867 * Create key-value caches of limited size 868 * @returns {function(string, object)} Returns the Object data after storing it on itself with 869 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 870 * deleting the oldest entry 871 */ 872function createCache() { 873 var keys = []; 874 875 function cache( key, value ) { 876 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 877 if ( keys.push( key + " " ) > Expr.cacheLength ) { 878 // Only keep the most recent entries 879 delete cache[ keys.shift() ]; 880 } 881 return (cache[ key + " " ] = value); 882 } 883 return cache; 884} 885 886/** 887 * Mark a function for special use by Sizzle 888 * @param {Function} fn The function to mark 889 */ 890function markFunction( fn ) { 891 fn[ expando ] = true; 892 return fn; 893} 894 895/** 896 * Support testing using an element 897 * @param {Function} fn Passed the created element and returns a boolean result 898 */ 899function assert( fn ) { 900 var el = document.createElement("fieldset"); 901 902 try { 903 return !!fn( el ); 904 } catch (e) { 905 return false; 906 } finally { 907 // Remove from its parent by default 908 if ( el.parentNode ) { 909 el.parentNode.removeChild( el ); 910 } 911 // release memory in IE 912 el = null; 913 } 914} 915 916/** 917 * Adds the same handler for all of the specified attrs 918 * @param {String} attrs Pipe-separated list of attributes 919 * @param {Function} handler The method that will be applied 920 */ 921function addHandle( attrs, handler ) { 922 var arr = attrs.split("|"), 923 i = arr.length; 924 925 while ( i-- ) { 926 Expr.attrHandle[ arr[i] ] = handler; 927 } 928} 929 930/** 931 * Checks document order of two siblings 932 * @param {Element} a 933 * @param {Element} b 934 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 935 */ 936function siblingCheck( a, b ) { 937 var cur = b && a, 938 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 939 a.sourceIndex - b.sourceIndex; 940 941 // Use IE sourceIndex if available on both nodes 942 if ( diff ) { 943 return diff; 944 } 945 946 // Check if b follows a 947 if ( cur ) { 948 while ( (cur = cur.nextSibling) ) { 949 if ( cur === b ) { 950 return -1; 951 } 952 } 953 } 954 955 return a ? 1 : -1; 956} 957 958/** 959 * Returns a function to use in pseudos for input types 960 * @param {String} type 961 */ 962function createInputPseudo( type ) { 963 return function( elem ) { 964 var name = elem.nodeName.toLowerCase(); 965 return name === "input" && elem.type === type; 966 }; 967} 968 969/** 970 * Returns a function to use in pseudos for buttons 971 * @param {String} type 972 */ 973function createButtonPseudo( type ) { 974 return function( elem ) { 975 var name = elem.nodeName.toLowerCase(); 976 return (name === "input" || name === "button") && elem.type === type; 977 }; 978} 979 980/** 981 * Returns a function to use in pseudos for :enabled/:disabled 982 * @param {Boolean} disabled true for :disabled; false for :enabled 983 */ 984function createDisabledPseudo( disabled ) { 985 986 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 987 return function( elem ) { 988 989 // Only certain elements can match :enabled or :disabled 990 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 991 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 992 if ( "form" in elem ) { 993 994 // Check for inherited disabledness on relevant non-disabled elements: 995 // * listed form-associated elements in a disabled fieldset 996 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 997 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 998 // * option elements in a disabled optgroup 999 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 1000 // All such elements have a "form" property. 1001 if ( elem.parentNode && elem.disabled === false ) { 1002 1003 // Option elements defer to a parent optgroup if present 1004 if ( "label" in elem ) { 1005 if ( "label" in elem.parentNode ) { 1006 return elem.parentNode.disabled === disabled; 1007 } else { 1008 return elem.disabled === disabled; 1009 } 1010 } 1011
vendor: 5,284 bytes, lines 1012-1174
1012 // Support: IE 6 - 11 1013 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 1014 return elem.isDisabled === disabled || 1015 1016 // Where there is no isDisabled, check manually 1017 /* jshint -W018 */ 1018 elem.isDisabled !== !disabled && 1019 inDisabledFieldset( elem ) === disabled; 1020 } 1021 1022 return elem.disabled === disabled; 1023 1024 // Try to winnow out elements that can't be disabled before trusting the disabled property. 1025 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 1026 // even exist on them, let alone have a boolean value. 1027 } else if ( "label" in elem ) { 1028 return elem.disabled === disabled; 1029 } 1030 1031 // Remaining elements are neither :enabled nor :disabled 1032 return false; 1033 }; 1034} 1035 1036/** 1037 * Returns a function to use in pseudos for positionals 1038 * @param {Function} fn 1039 */ 1040function createPositionalPseudo( fn ) { 1041 return markFunction(function( argument ) { 1042 argument = +argument; 1043 return markFunction(function( seed, matches ) { 1044 var j, 1045 matchIndexes = fn( [], seed.length, argument ), 1046 i = matchIndexes.length; 1047 1048 // Match elements found at the specified indexes 1049 while ( i-- ) { 1050 if ( seed[ (j = matchIndexes[i]) ] ) { 1051 seed[j] = !(matches[j] = seed[j]); 1052 } 1053 } 1054 }); 1055 }); 1056} 1057 1058/** 1059 * Checks a node for validity as a Sizzle context 1060 * @param {Element|Object=} context 1061 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1062 */ 1063function testContext( context ) { 1064 return context && typeof context.getElementsByTagName !== "undefined" && context; 1065} 1066 1067// Expose support vars for convenience 1068support = Sizzle.support = {}; 1069 1070/** 1071 * Detects XML nodes 1072 * @param {Element|Object} elem An element or a document 1073 * @returns {Boolean} True iff elem is a non-HTML XML node 1074 */ 1075isXML = Sizzle.isXML = function( elem ) { 1076 var namespace = elem.namespaceURI, 1077 docElem = (elem.ownerDocument || elem).documentElement; 1078 1079 // Support: IE <=8 1080 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 1081 // https://bugs.jquery.com/ticket/4833 1082 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 1083}; 1084 1085/** 1086 * Sets document-related variables once based on the current document 1087 * @param {Element|Object} [doc] An element or document object to use to set the document 1088 * @returns {Object} Returns the current document 1089 */ 1090setDocument = Sizzle.setDocument = function( node ) { 1091 var hasCompare, subWindow, 1092 doc = node ? node.ownerDocument || node : preferredDoc; 1093 1094 // Return early if doc is invalid or already selected 1095 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1096 return document; 1097 } 1098 1099 // Update global variables 1100 document = doc; 1101 docElem = document.documentElement; 1102 documentIsHTML = !isXML( document ); 1103 1104 // Support: IE 9-11, Edge 1105 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1106 if ( preferredDoc !== document && 1107 (subWindow = document.defaultView) && subWindow.top !== subWindow ) { 1108 1109 // Support: IE 11, Edge 1110 if ( subWindow.addEventListener ) { 1111 subWindow.addEventListener( "unload", unloadHandler, false ); 1112 1113 // Support: IE 9 - 10 only 1114 } else if ( subWindow.attachEvent ) { 1115 subWindow.attachEvent( "onunload", unloadHandler ); 1116 } 1117 } 1118 1119 /* Attributes 1120 ---------------------------------------------------------------------- */ 1121 1122 // Support: IE<8 1123 // Verify that getAttribute really returns attributes and not properties 1124 // (excepting IE8 booleans) 1125 support.attributes = assert(function( el ) { 1126 el.className = "i"; 1127 return !el.getAttribute("className"); 1128 }); 1129 1130 /* getElement(s)By* 1131 ---------------------------------------------------------------------- */ 1132 1133 // Check if getElementsByTagName("*") returns only elements 1134 support.getElementsByTagName = assert(function( el ) { 1135 el.appendChild( document.createComment("") ); 1136 return !el.getElementsByTagName("*").length; 1137 }); 1138 1139 // Support: IE<9 1140 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1141 1142 // Support: IE<10 1143 // Check if getElementById returns elements by name 1144 // The broken getElementById methods don't pick up programmatically-set names, 1145 // so use a roundabout getElementsByName test 1146 support.getById = assert(function( el ) { 1147 docElem.appendChild( el ).id = expando; 1148 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1149 }); 1150 1151 // ID filter and find 1152 if ( support.getById ) { 1153 Expr.filter["ID"] = function( id ) { 1154 var attrId = id.replace( runescape, funescape ); 1155 return function( elem ) { 1156 return elem.getAttribute("id") === attrId; 1157 }; 1158 }; 1159 Expr.find["ID"] = function( id, context ) { 1160 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1161 var elem = context.getElementById( id ); 1162 return elem ? [ elem ] : []; 1163 } 1164 }; 1165 } else { 1166 Expr.filter["ID"] = function( id ) { 1167 var attrId = id.replace( runescape, funescape ); 1168 return function( elem ) { 1169 var node = typeof elem.getAttributeNode !== "undefined" && 1170 elem.getAttributeNode("id"); 1171 return node && node.value === attrId; 1172 }; 1173 }; 1174
vendor: 4,454 bytes, lines 1175-1310
1175 // Support: IE 6 - 7 only 1176 // getElementById is not reliable as a find shortcut 1177 Expr.find["ID"] = function( id, context ) { 1178 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1179 var node, i, elems, 1180 elem = context.getElementById( id ); 1181 1182 if ( elem ) { 1183 1184 // Verify the id attribute 1185 node = elem.getAttributeNode("id"); 1186 if ( node && node.value === id ) { 1187 return [ elem ]; 1188 } 1189 1190 // Fall back on getElementsByName 1191 elems = context.getElementsByName( id ); 1192 i = 0; 1193 while ( (elem = elems[i++]) ) { 1194 node = elem.getAttributeNode("id"); 1195 if ( node && node.value === id ) { 1196 return [ elem ]; 1197 } 1198 } 1199 } 1200 1201 return []; 1202 } 1203 }; 1204 } 1205 1206 // Tag 1207 Expr.find["TAG"] = support.getElementsByTagName ? 1208 function( tag, context ) { 1209 if ( typeof context.getElementsByTagName !== "undefined" ) { 1210 return context.getElementsByTagName( tag ); 1211 1212 // DocumentFragment nodes don't have gEBTN 1213 } else if ( support.qsa ) { 1214 return context.querySelectorAll( tag ); 1215 } 1216 } : 1217 1218 function( tag, context ) { 1219 var elem, 1220 tmp = [], 1221 i = 0, 1222 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1223 results = context.getElementsByTagName( tag ); 1224 1225 // Filter out possible comments 1226 if ( tag === "*" ) { 1227 while ( (elem = results[i++]) ) { 1228 if ( elem.nodeType === 1 ) { 1229 tmp.push( elem ); 1230 } 1231 } 1232 1233 return tmp; 1234 } 1235 return results; 1236 }; 1237 1238 // Class 1239 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1240 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1241 return context.getElementsByClassName( className ); 1242 } 1243 }; 1244 1245 /* QSA/matchesSelector 1246 ---------------------------------------------------------------------- */ 1247 1248 // QSA and matchesSelector support 1249 1250 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1251 rbuggyMatches = []; 1252 1253 // qSa(:focus) reports false when true (Chrome 21) 1254 // We allow this because of a bug in IE8/9 that throws an error 1255 // whenever `document.activeElement` is accessed on an iframe 1256 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1257 // See https://bugs.jquery.com/ticket/13378 1258 rbuggyQSA = []; 1259 1260 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 1261 // Build QSA regex 1262 // Regex strategy adopted from Diego Perini 1263 assert(function( el ) { 1264 // Select is set to empty string on purpose 1265 // This is to test IE's treatment of not explicitly 1266 // setting a boolean content attribute, 1267 // since its presence should be enough 1268 // https://bugs.jquery.com/ticket/12359 1269 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 1270 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1271 "<option selected=''></option></select>"; 1272 1273 // Support: IE8, Opera 11-12.16 1274 // Nothing should be selected when empty strings follow ^= or $= or *= 1275 // The test attribute must be unknown in Opera but "safe" for WinRT 1276 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1277 if ( el.querySelectorAll("[msallowcapture^='']").length ) { 1278 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1279 } 1280 1281 // Support: IE8 1282 // Boolean attributes and "value" are not treated correctly 1283 if ( !el.querySelectorAll("[selected]").length ) { 1284 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1285 } 1286 1287 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1288 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1289 rbuggyQSA.push("~="); 1290 } 1291 1292 // Webkit/Opera - :checked should return selected option elements 1293 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1294 // IE8 throws error here and will not see later tests 1295 if ( !el.querySelectorAll(":checked").length ) { 1296 rbuggyQSA.push(":checked"); 1297 } 1298 1299 // Support: Safari 8+, iOS 8+ 1300 // https://bugs.webkit.org/show_bug.cgi?id=136851 1301 // In-page `selector#id sibling-combinator selector` fails 1302 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 1303 rbuggyQSA.push(".#.+[+~]"); 1304 } 1305 }); 1306 1307 assert(function( el ) { 1308 el.innerHTML = "<a href='' disabled='disabled'></a>" + 1309 "<select disabled='disabled'><option/></select>"; 1310
vendor: 19,284 bytes, lines 1311-1973
1311 // Support: Windows 8 Native Apps 1312 // The type and name attributes are restricted during .innerHTML assignment 1313 var input = document.createElement("input"); 1314 input.setAttribute( "type", "hidden" ); 1315 el.appendChild( input ).setAttribute( "name", "D" ); 1316 1317 // Support: IE8 1318 // Enforce case-sensitivity of name attribute 1319 if ( el.querySelectorAll("[name=d]").length ) { 1320 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1321 } 1322 1323 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1324 // IE8 throws error here and will not see later tests 1325 if ( el.querySelectorAll(":enabled").length !== 2 ) { 1326 rbuggyQSA.push( ":enabled", ":disabled" ); 1327 } 1328 1329 // Support: IE9-11+ 1330 // IE's :disabled selector does not pick up the children of disabled fieldsets 1331 docElem.appendChild( el ).disabled = true; 1332 if ( el.querySelectorAll(":disabled").length !== 2 ) { 1333 rbuggyQSA.push( ":enabled", ":disabled" ); 1334 } 1335 1336 // Opera 10-11 does not throw on post-comma invalid pseudos 1337 el.querySelectorAll("*,:x"); 1338 rbuggyQSA.push(",.*:"); 1339 }); 1340 } 1341 1342 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1343 docElem.webkitMatchesSelector || 1344 docElem.mozMatchesSelector || 1345 docElem.oMatchesSelector || 1346 docElem.msMatchesSelector) )) ) { 1347 1348 assert(function( el ) { 1349 // Check to see if it's possible to do matchesSelector 1350 // on a disconnected node (IE 9) 1351 support.disconnectedMatch = matches.call( el, "*" ); 1352 1353 // This should fail with an exception 1354 // Gecko does not error, returns false instead 1355 matches.call( el, "[s!='']:x" ); 1356 rbuggyMatches.push( "!=", pseudos ); 1357 }); 1358 } 1359 1360 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1361 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1362 1363 /* Contains 1364 ---------------------------------------------------------------------- */ 1365 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1366 1367 // Element contains another 1368 // Purposefully self-exclusive 1369 // As in, an element does not contain itself 1370 contains = hasCompare || rnative.test( docElem.contains ) ? 1371 function( a, b ) { 1372 var adown = a.nodeType === 9 ? a.documentElement : a, 1373 bup = b && b.parentNode; 1374 return a === bup || !!( bup && bup.nodeType === 1 && ( 1375 adown.contains ? 1376 adown.contains( bup ) : 1377 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1378 )); 1379 } : 1380 function( a, b ) { 1381 if ( b ) { 1382 while ( (b = b.parentNode) ) { 1383 if ( b === a ) { 1384 return true; 1385 } 1386 } 1387 } 1388 return false; 1389 }; 1390 1391 /* Sorting 1392 ---------------------------------------------------------------------- */ 1393 1394 // Document order sorting 1395 sortOrder = hasCompare ? 1396 function( a, b ) { 1397 1398 // Flag for duplicate removal 1399 if ( a === b ) { 1400 hasDuplicate = true; 1401 return 0; 1402 } 1403 1404 // Sort on method existence if only one input has compareDocumentPosition 1405 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1406 if ( compare ) { 1407 return compare; 1408 } 1409 1410 // Calculate position if both inputs belong to the same document 1411 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1412 a.compareDocumentPosition( b ) : 1413 1414 // Otherwise we know they are disconnected 1415 1; 1416 1417 // Disconnected nodes 1418 if ( compare & 1 || 1419 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1420 1421 // Choose the first element that is related to our preferred document 1422 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1423 return -1; 1424 } 1425 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1426 return 1; 1427 } 1428 1429 // Maintain original order 1430 return sortInput ? 1431 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1432 0; 1433 } 1434 1435 return compare & 4 ? -1 : 1; 1436 } : 1437 function( a, b ) { 1438 // Exit early if the nodes are identical 1439 if ( a === b ) { 1440 hasDuplicate = true; 1441 return 0; 1442 } 1443 1444 var cur, 1445 i = 0, 1446 aup = a.parentNode, 1447 bup = b.parentNode, 1448 ap = [ a ], 1449 bp = [ b ]; 1450 1451 // Parentless nodes are either documents or disconnected 1452 if ( !aup || !bup ) { 1453 return a === document ? -1 : 1454 b === document ? 1 : 1455 aup ? -1 : 1456 bup ? 1 : 1457 sortInput ? 1458 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1459 0; 1460 1461 // If the nodes are siblings, we can do a quick check 1462 } else if ( aup === bup ) { 1463 return siblingCheck( a, b ); 1464 } 1465 1466 // Otherwise we need full lists of their ancestors for comparison 1467 cur = a; 1468 while ( (cur = cur.parentNode) ) { 1469 ap.unshift( cur ); 1470 } 1471 cur = b; 1472 while ( (cur = cur.parentNode) ) { 1473 bp.unshift( cur ); 1474 } 1475 1476 // Walk down the tree looking for a discrepancy 1477 while ( ap[i] === bp[i] ) { 1478 i++; 1479 } 1480 1481 return i ? 1482 // Do a sibling check if the nodes have a common ancestor 1483 siblingCheck( ap[i], bp[i] ) : 1484 1485 // Otherwise nodes in our document sort first 1486 ap[i] === preferredDoc ? -1 : 1487 bp[i] === preferredDoc ? 1 : 1488 0; 1489 }; 1490 1491 return document; 1492}; 1493 1494Sizzle.matches = function( expr, elements ) { 1495 return Sizzle( expr, null, null, elements ); 1496}; 1497 1498Sizzle.matchesSelector = function( elem, expr ) { 1499 // Set document vars if needed 1500 if ( ( elem.ownerDocument || elem ) !== document ) { 1501 setDocument( elem ); 1502 } 1503 1504 if ( support.matchesSelector && documentIsHTML && 1505 !nonnativeSelectorCache[ expr + " " ] && 1506 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1507 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1508 1509 try { 1510 var ret = matches.call( elem, expr ); 1511 1512 // IE 9's matchesSelector returns false on disconnected nodes 1513 if ( ret || support.disconnectedMatch || 1514 // As well, disconnected nodes are said to be in a document 1515 // fragment in IE 9 1516 elem.document && elem.document.nodeType !== 11 ) { 1517 return ret; 1518 } 1519 } catch (e) { 1520 nonnativeSelectorCache( expr, true ); 1521 } 1522 } 1523 1524 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1525}; 1526 1527Sizzle.contains = function( context, elem ) { 1528 // Set document vars if needed 1529 if ( ( context.ownerDocument || context ) !== document ) { 1530 setDocument( context ); 1531 } 1532 return contains( context, elem ); 1533}; 1534 1535Sizzle.attr = function( elem, name ) { 1536 // Set document vars if needed 1537 if ( ( elem.ownerDocument || elem ) !== document ) { 1538 setDocument( elem ); 1539 } 1540 1541 var fn = Expr.attrHandle[ name.toLowerCase() ], 1542 // Don't get fooled by Object.prototype properties (jQuery #13807) 1543 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1544 fn( elem, name, !documentIsHTML ) : 1545 undefined; 1546 1547 return val !== undefined ? 1548 val : 1549 support.attributes || !documentIsHTML ? 1550 elem.getAttribute( name ) : 1551 (val = elem.getAttributeNode(name)) && val.specified ? 1552 val.value : 1553 null; 1554}; 1555 1556Sizzle.escape = function( sel ) { 1557 return (sel + "").replace( rcssescape, fcssescape ); 1558}; 1559 1560Sizzle.error = function( msg ) { 1561 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1562}; 1563 1564/** 1565 * Document sorting and removing duplicates 1566 * @param {ArrayLike} results 1567 */ 1568Sizzle.uniqueSort = function( results ) { 1569 var elem, 1570 duplicates = [], 1571 j = 0, 1572 i = 0; 1573 1574 // Unless we *know* we can detect duplicates, assume their presence 1575 hasDuplicate = !support.detectDuplicates; 1576 sortInput = !support.sortStable && results.slice( 0 ); 1577 results.sort( sortOrder ); 1578 1579 if ( hasDuplicate ) { 1580 while ( (elem = results[i++]) ) { 1581 if ( elem === results[ i ] ) { 1582 j = duplicates.push( i ); 1583 } 1584 } 1585 while ( j-- ) { 1586 results.splice( duplicates[ j ], 1 ); 1587 } 1588 } 1589 1590 // Clear input after sorting to release objects 1591 // See https://github.com/jquery/sizzle/pull/225 1592 sortInput = null; 1593 1594 return results; 1595}; 1596 1597/** 1598 * Utility function for retrieving the text value of an array of DOM nodes 1599 * @param {Array|Element} elem 1600 */ 1601getText = Sizzle.getText = function( elem ) { 1602 var node, 1603 ret = "", 1604 i = 0, 1605 nodeType = elem.nodeType; 1606 1607 if ( !nodeType ) { 1608 // If no nodeType, this is expected to be an array 1609 while ( (node = elem[i++]) ) { 1610 // Do not traverse comment nodes 1611 ret += getText( node ); 1612 } 1613 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1614 // Use textContent for elements 1615 // innerText usage removed for consistency of new lines (jQuery #11153) 1616 if ( typeof elem.textContent === "string" ) { 1617 return elem.textContent; 1618 } else { 1619 // Traverse its children 1620 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1621 ret += getText( elem ); 1622 } 1623 } 1624 } else if ( nodeType === 3 || nodeType === 4 ) { 1625 return elem.nodeValue; 1626 } 1627 // Do not include comment or processing instruction nodes 1628 1629 return ret; 1630}; 1631 1632Expr = Sizzle.selectors = { 1633 1634 // Can be adjusted by the user 1635 cacheLength: 50, 1636 1637 createPseudo: markFunction, 1638 1639 match: matchExpr, 1640 1641 attrHandle: {}, 1642 1643 find: {}, 1644 1645 relative: { 1646 ">": { dir: "parentNode", first: true }, 1647 " ": { dir: "parentNode" }, 1648 "+": { dir: "previousSibling", first: true }, 1649 "~": { dir: "previousSibling" } 1650 }, 1651 1652 preFilter: { 1653 "ATTR": function( match ) { 1654 match[1] = match[1].replace( runescape, funescape ); 1655 1656 // Move the given value to match[3] whether quoted or unquoted 1657 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1658 1659 if ( match[2] === "~=" ) { 1660 match[3] = " " + match[3] + " "; 1661 } 1662 1663 return match.slice( 0, 4 ); 1664 }, 1665 1666 "CHILD": function( match ) { 1667 /* matches from matchExpr["CHILD"] 1668 1 type (only|nth|...) 1669 2 what (child|of-type) 1670 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1671 4 xn-component of xn+y argument ([+-]?\d*n|) 1672 5 sign of xn-component 1673 6 x of xn-component 1674 7 sign of y-component 1675 8 y of y-component 1676 */ 1677 match[1] = match[1].toLowerCase(); 1678 1679 if ( match[1].slice( 0, 3 ) === "nth" ) { 1680 // nth-* requires argument 1681 if ( !match[3] ) { 1682 Sizzle.error( match[0] ); 1683 } 1684 1685 // numeric x and y parameters for Expr.filter.CHILD 1686 // remember that false/true cast respectively to 0/1 1687 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1688 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1689 1690 // other types prohibit arguments 1691 } else if ( match[3] ) { 1692 Sizzle.error( match[0] ); 1693 } 1694 1695 return match; 1696 }, 1697 1698 "PSEUDO": function( match ) { 1699 var excess, 1700 unquoted = !match[6] && match[2]; 1701 1702 if ( matchExpr["CHILD"].test( match[0] ) ) { 1703 return null; 1704 } 1705 1706 // Accept quoted arguments as-is 1707 if ( match[3] ) { 1708 match[2] = match[4] || match[5] || ""; 1709 1710 // Strip excess characters from unquoted arguments 1711 } else if ( unquoted && rpseudo.test( unquoted ) && 1712 // Get excess from tokenize (recursively) 1713 (excess = tokenize( unquoted, true )) && 1714 // advance to the next closing parenthesis 1715 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1716 1717 // excess is a negative index 1718 match[0] = match[0].slice( 0, excess ); 1719 match[2] = unquoted.slice( 0, excess ); 1720 } 1721 1722 // Return only captures needed by the pseudo filter method (type and argument) 1723 return match.slice( 0, 3 ); 1724 } 1725 }, 1726 1727 filter: { 1728 1729 "TAG": function( nodeNameSelector ) { 1730 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1731 return nodeNameSelector === "*" ? 1732 function() { return true; } : 1733 function( elem ) { 1734 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1735 }; 1736 }, 1737 1738 "CLASS": function( className ) { 1739 var pattern = classCache[ className + " " ]; 1740 1741 return pattern || 1742 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1743 classCache( className, function( elem ) { 1744 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1745 }); 1746 }, 1747 1748 "ATTR": function( name, operator, check ) { 1749 return function( elem ) { 1750 var result = Sizzle.attr( elem, name ); 1751 1752 if ( result == null ) { 1753 return operator === "!="; 1754 } 1755 if ( !operator ) { 1756 return true; 1757 } 1758 1759 result += ""; 1760 1761 return operator === "=" ? result === check : 1762 operator === "!=" ? result !== check : 1763 operator === "^=" ? check && result.indexOf( check ) === 0 : 1764 operator === "*=" ? check && result.indexOf( check ) > -1 : 1765 operator === "$=" ? check && result.slice( -check.length ) === check : 1766 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1767 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1768 false; 1769 }; 1770 }, 1771 1772 "CHILD": function( type, what, argument, first, last ) { 1773 var simple = type.slice( 0, 3 ) !== "nth", 1774 forward = type.slice( -4 ) !== "last", 1775 ofType = what === "of-type"; 1776 1777 return first === 1 && last === 0 ? 1778 1779 // Shortcut for :nth-*(n) 1780 function( elem ) { 1781 return !!elem.parentNode; 1782 } : 1783 1784 function( elem, context, xml ) { 1785 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1786 dir = simple !== forward ? "nextSibling" : "previousSibling", 1787 parent = elem.parentNode, 1788 name = ofType && elem.nodeName.toLowerCase(), 1789 useCache = !xml && !ofType, 1790 diff = false; 1791 1792 if ( parent ) { 1793 1794 // :(first|last|only)-(child|of-type) 1795 if ( simple ) { 1796 while ( dir ) { 1797 node = elem; 1798 while ( (node = node[ dir ]) ) { 1799 if ( ofType ? 1800 node.nodeName.toLowerCase() === name : 1801 node.nodeType === 1 ) { 1802 1803 return false; 1804 } 1805 } 1806 // Reverse direction for :only-* (if we haven't yet done so) 1807 start = dir = type === "only" && !start && "nextSibling"; 1808 } 1809 return true; 1810 } 1811 1812 start = [ forward ? parent.firstChild : parent.lastChild ]; 1813 1814 // non-xml :nth-child(...) stores cache data on `parent` 1815 if ( forward && useCache ) { 1816 1817 // Seek `elem` from a previously-cached index 1818 1819 // ...in a gzip-friendly way 1820 node = parent; 1821 outerCache = node[ expando ] || (node[ expando ] = {}); 1822 1823 // Support: IE <9 only 1824 // Defend against cloned attroperties (jQuery gh-1709) 1825 uniqueCache = outerCache[ node.uniqueID ] || 1826 (outerCache[ node.uniqueID ] = {}); 1827 1828 cache = uniqueCache[ type ] || []; 1829 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1830 diff = nodeIndex && cache[ 2 ]; 1831 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1832 1833 while ( (node = ++nodeIndex && node && node[ dir ] || 1834 1835 // Fallback to seeking `elem` from the start 1836 (diff = nodeIndex = 0) || start.pop()) ) { 1837 1838 // When found, cache indexes on `parent` and break 1839 if ( node.nodeType === 1 && ++diff && node === elem ) { 1840 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1841 break; 1842 } 1843 } 1844 1845 } else { 1846 // Use previously-cached element index if available 1847 if ( useCache ) { 1848 // ...in a gzip-friendly way 1849 node = elem; 1850 outerCache = node[ expando ] || (node[ expando ] = {}); 1851 1852 // Support: IE <9 only 1853 // Defend against cloned attroperties (jQuery gh-1709) 1854 uniqueCache = outerCache[ node.uniqueID ] || 1855 (outerCache[ node.uniqueID ] = {}); 1856 1857 cache = uniqueCache[ type ] || []; 1858 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1859 diff = nodeIndex; 1860 } 1861 1862 // xml :nth-child(...) 1863 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1864 if ( diff === false ) { 1865 // Use the same loop as above to seek `elem` from the start 1866 while ( (node = ++nodeIndex && node && node[ dir ] || 1867 (diff = nodeIndex = 0) || start.pop()) ) { 1868 1869 if ( ( ofType ? 1870 node.nodeName.toLowerCase() === name : 1871 node.nodeType === 1 ) && 1872 ++diff ) { 1873 1874 // Cache the index of each encountered element 1875 if ( useCache ) { 1876 outerCache = node[ expando ] || (node[ expando ] = {}); 1877 1878 // Support: IE <9 only 1879 // Defend against cloned attroperties (jQuery gh-1709) 1880 uniqueCache = outerCache[ node.uniqueID ] || 1881 (outerCache[ node.uniqueID ] = {}); 1882 1883 uniqueCache[ type ] = [ dirruns, diff ]; 1884 } 1885 1886 if ( node === elem ) { 1887 break; 1888 } 1889 } 1890 } 1891 } 1892 } 1893 1894 // Incorporate the offset, then check against cycle size 1895 diff -= last; 1896 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1897 } 1898 }; 1899 }, 1900 1901 "PSEUDO": function( pseudo, argument ) { 1902 // pseudo-class names are case-insensitive 1903 // http://www.w3.org/TR/selectors/#pseudo-classes 1904 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1905 // Remember that setFilters inherits from pseudos 1906 var args, 1907 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1908 Sizzle.error( "unsupported pseudo: " + pseudo ); 1909 1910 // The user may use createPseudo to indicate that 1911 // arguments are needed to create the filter function 1912 // just as Sizzle does 1913 if ( fn[ expando ] ) { 1914 return fn( argument ); 1915 } 1916 1917 // But maintain support for old signatures 1918 if ( fn.length > 1 ) { 1919 args = [ pseudo, pseudo, "", argument ]; 1920 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1921 markFunction(function( seed, matches ) { 1922 var idx, 1923 matched = fn( seed, argument ), 1924 i = matched.length; 1925 while ( i-- ) { 1926 idx = indexOf( seed, matched[i] ); 1927 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1928 } 1929 }) : 1930 function( elem ) { 1931 return fn( elem, 0, args ); 1932 }; 1933 } 1934 1935 return fn; 1936 } 1937 }, 1938 1939 pseudos: { 1940 // Potentially complex pseudos 1941 "not": markFunction(function( selector ) { 1942 // Trim the selector passed to compile 1943 // to avoid treating leading and trailing 1944 // spaces as combinators 1945 var input = [], 1946 results = [], 1947 matcher = compile( selector.replace( rtrim, "$1" ) ); 1948 1949 return matcher[ expando ] ? 1950 markFunction(function( seed, matches, context, xml ) { 1951 var elem, 1952 unmatched = matcher( seed, null, xml, [] ), 1953 i = seed.length; 1954 1955 // Match elements unmatched by `matcher` 1956 while ( i-- ) { 1957 if ( (elem = unmatched[i]) ) { 1958 seed[i] = !(matches[i] = elem); 1959 } 1960 } 1961 }) : 1962 function( elem, context, xml ) { 1963 input[0] = elem; 1964 matcher( input, null, xml, results ); 1965 // Don't keep the element (issue #299) 1966 input[0] = null; 1967 return !results.pop(); 1968 }; 1969 }), 1970 1971 "has": markFunction(function( selector ) { 1972 return function( elem ) { 1973 return Sizzle( selector, elem ).length > 0;
vendor: 6,973 bytes, lines 1974-2220
1974 }; 1975 }), 1976 1977 "contains": markFunction(function( text ) { 1978 text = text.replace( runescape, funescape ); 1979 return function( elem ) { 1980 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 1981 }; 1982 }), 1983 1984 // "Whether an element is represented by a :lang() selector 1985 // is based solely on the element's language value 1986 // being equal to the identifier C, 1987 // or beginning with the identifier C immediately followed by "-". 1988 // The matching of C against the element's language value is performed case-insensitively. 1989 // The identifier C does not have to be a valid language name." 1990 // http://www.w3.org/TR/selectors/#lang-pseudo 1991 "lang": markFunction( function( lang ) { 1992 // lang value must be a valid identifier 1993 if ( !ridentifier.test(lang || "") ) { 1994 Sizzle.error( "unsupported lang: " + lang ); 1995 } 1996 lang = lang.replace( runescape, funescape ).toLowerCase(); 1997 return function( elem ) { 1998 var elemLang; 1999 do { 2000 if ( (elemLang = documentIsHTML ? 2001 elem.lang : 2002 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 2003 2004 elemLang = elemLang.toLowerCase(); 2005 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 2006 } 2007 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 2008 return false; 2009 }; 2010 }), 2011 2012 // Miscellaneous 2013 "target": function( elem ) { 2014 var hash = window.location && window.location.hash; 2015 return hash && hash.slice( 1 ) === elem.id; 2016 }, 2017 2018 "root": function( elem ) { 2019 return elem === docElem; 2020 }, 2021 2022 "focus": function( elem ) { 2023 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 2024 }, 2025 2026 // Boolean properties 2027 "enabled": createDisabledPseudo( false ), 2028 "disabled": createDisabledPseudo( true ), 2029 2030 "checked": function( elem ) { 2031 // In CSS3, :checked should return both checked and selected elements 2032 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 2033 var nodeName = elem.nodeName.toLowerCase(); 2034 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 2035 }, 2036 2037 "selected": function( elem ) { 2038 // Accessing this property makes selected-by-default 2039 // options in Safari work properly 2040 if ( elem.parentNode ) { 2041 elem.parentNode.selectedIndex; 2042 } 2043 2044 return elem.selected === true; 2045 }, 2046 2047 // Contents 2048 "empty": function( elem ) { 2049 // http://www.w3.org/TR/selectors/#empty-pseudo 2050 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 2051 // but not by others (comment: 8; processing instruction: 7; etc.) 2052 // nodeType < 6 works because attributes (2) do not appear as children 2053 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2054 if ( elem.nodeType < 6 ) { 2055 return false; 2056 } 2057 } 2058 return true; 2059 }, 2060 2061 "parent": function( elem ) { 2062 return !Expr.pseudos["empty"]( elem ); 2063 }, 2064 2065 // Element/input types 2066 "header": function( elem ) { 2067 return rheader.test( elem.nodeName ); 2068 }, 2069 2070 "input": function( elem ) { 2071 return rinputs.test( elem.nodeName ); 2072 }, 2073 2074 "button": function( elem ) { 2075 var name = elem.nodeName.toLowerCase(); 2076 return name === "input" && elem.type === "button" || name === "button"; 2077 }, 2078 2079 "text": function( elem ) { 2080 var attr; 2081 return elem.nodeName.toLowerCase() === "input" && 2082 elem.type === "text" && 2083 2084 // Support: IE<8 2085 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 2086 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 2087 }, 2088 2089 // Position-in-collection 2090 "first": createPositionalPseudo(function() { 2091 return [ 0 ]; 2092 }), 2093 2094 "last": createPositionalPseudo(function( matchIndexes, length ) { 2095 return [ length - 1 ]; 2096 }), 2097 2098 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 2099 return [ argument < 0 ? argument + length : argument ]; 2100 }), 2101 2102 "even": createPositionalPseudo(function( matchIndexes, length ) { 2103 var i = 0; 2104 for ( ; i < length; i += 2 ) { 2105 matchIndexes.push( i ); 2106 } 2107 return matchIndexes; 2108 }), 2109 2110 "odd": createPositionalPseudo(function( matchIndexes, length ) { 2111 var i = 1; 2112 for ( ; i < length; i += 2 ) { 2113 matchIndexes.push( i ); 2114 } 2115 return matchIndexes; 2116 }), 2117 2118 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2119 var i = argument < 0 ? 2120 argument + length : 2121 argument > length ? 2122 length : 2123 argument; 2124 for ( ; --i >= 0; ) { 2125 matchIndexes.push( i ); 2126 } 2127 return matchIndexes; 2128 }), 2129 2130 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2131 var i = argument < 0 ? argument + length : argument; 2132 for ( ; ++i < length; ) { 2133 matchIndexes.push( i ); 2134 } 2135 return matchIndexes; 2136 }) 2137 } 2138}; 2139 2140Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2141 2142// Add button/input type pseudos 2143for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2144 Expr.pseudos[ i ] = createInputPseudo( i ); 2145} 2146for ( i in { submit: true, reset: true } ) { 2147 Expr.pseudos[ i ] = createButtonPseudo( i ); 2148} 2149 2150// Easy API for creating new setFilters 2151function setFilters() {} 2152setFilters.prototype = Expr.filters = Expr.pseudos; 2153Expr.setFilters = new setFilters(); 2154 2155tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2156 var matched, match, tokens, type, 2157 soFar, groups, preFilters, 2158 cached = tokenCache[ selector + " " ]; 2159 2160 if ( cached ) { 2161 return parseOnly ? 0 : cached.slice( 0 ); 2162 } 2163 2164 soFar = selector; 2165 groups = []; 2166 preFilters = Expr.preFilter; 2167 2168 while ( soFar ) { 2169 2170 // Comma and first run 2171 if ( !matched || (match = rcomma.exec( soFar )) ) { 2172 if ( match ) { 2173 // Don't consume trailing commas as valid 2174 soFar = soFar.slice( match[0].length ) || soFar; 2175 } 2176 groups.push( (tokens = []) ); 2177 } 2178 2179 matched = false; 2180 2181 // Combinators 2182 if ( (match = rcombinators.exec( soFar )) ) { 2183 matched = match.shift(); 2184 tokens.push({ 2185 value: matched, 2186 // Cast descendant combinators to space 2187 type: match[0].replace( rtrim, " " ) 2188 }); 2189 soFar = soFar.slice( matched.length ); 2190 } 2191 2192 // Filters 2193 for ( type in Expr.filter ) { 2194 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2195 (match = preFilters[ type ]( match ))) ) { 2196 matched = match.shift(); 2197 tokens.push({ 2198 value: matched, 2199 type: type, 2200 matches: match 2201 }); 2202 soFar = soFar.slice( matched.length ); 2203 } 2204 } 2205 2206 if ( !matched ) { 2207 break; 2208 } 2209 } 2210 2211 // Return the length of the invalid excess 2212 // if we're just parsing 2213 // Otherwise, throw an error or return tokens 2214 return parseOnly ? 2215 soFar.length : 2216 soFar ? 2217 Sizzle.error( selector ) : 2218 // Cache the tokens 2219 tokenCache( selector, groups ).slice( 0 ); 2220};
vendor: 5,995 bytes, lines 2221-2436
2221 2222function toSelector( tokens ) { 2223 var i = 0, 2224 len = tokens.length, 2225 selector = ""; 2226 for ( ; i < len; i++ ) { 2227 selector += tokens[i].value; 2228 } 2229 return selector; 2230} 2231 2232function addCombinator( matcher, combinator, base ) { 2233 var dir = combinator.dir, 2234 skip = combinator.next, 2235 key = skip || dir, 2236 checkNonElements = base && key === "parentNode", 2237 doneName = done++; 2238 2239 return combinator.first ? 2240 // Check against closest ancestor/preceding element 2241 function( elem, context, xml ) { 2242 while ( (elem = elem[ dir ]) ) { 2243 if ( elem.nodeType === 1 || checkNonElements ) { 2244 return matcher( elem, context, xml ); 2245 } 2246 } 2247 return false; 2248 } : 2249 2250 // Check against all ancestor/preceding elements 2251 function( elem, context, xml ) { 2252 var oldCache, uniqueCache, outerCache, 2253 newCache = [ dirruns, doneName ]; 2254 2255 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2256 if ( xml ) { 2257 while ( (elem = elem[ dir ]) ) { 2258 if ( elem.nodeType === 1 || checkNonElements ) { 2259 if ( matcher( elem, context, xml ) ) { 2260 return true; 2261 } 2262 } 2263 } 2264 } else { 2265 while ( (elem = elem[ dir ]) ) { 2266 if ( elem.nodeType === 1 || checkNonElements ) { 2267 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2268 2269 // Support: IE <9 only 2270 // Defend against cloned attroperties (jQuery gh-1709) 2271 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 2272 2273 if ( skip && skip === elem.nodeName.toLowerCase() ) { 2274 elem = elem[ dir ] || elem; 2275 } else if ( (oldCache = uniqueCache[ key ]) && 2276 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2277 2278 // Assign to newCache so results back-propagate to previous elements 2279 return (newCache[ 2 ] = oldCache[ 2 ]); 2280 } else { 2281 // Reuse newcache so results back-propagate to previous elements 2282 uniqueCache[ key ] = newCache; 2283 2284 // A match means we're done; a fail means we have to keep checking 2285 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2286 return true; 2287 } 2288 } 2289 } 2290 } 2291 } 2292 return false; 2293 }; 2294} 2295 2296function elementMatcher( matchers ) { 2297 return matchers.length > 1 ? 2298 function( elem, context, xml ) { 2299 var i = matchers.length; 2300 while ( i-- ) { 2301 if ( !matchers[i]( elem, context, xml ) ) { 2302 return false; 2303 } 2304 } 2305 return true; 2306 } : 2307 matchers[0]; 2308} 2309 2310function multipleContexts( selector, contexts, results ) { 2311 var i = 0, 2312 len = contexts.length; 2313 for ( ; i < len; i++ ) { 2314 Sizzle( selector, contexts[i], results ); 2315 } 2316 return results; 2317} 2318 2319function condense( unmatched, map, filter, context, xml ) { 2320 var elem, 2321 newUnmatched = [], 2322 i = 0, 2323 len = unmatched.length, 2324 mapped = map != null; 2325 2326 for ( ; i < len; i++ ) { 2327 if ( (elem = unmatched[i]) ) { 2328 if ( !filter || filter( elem, context, xml ) ) { 2329 newUnmatched.push( elem ); 2330 if ( mapped ) { 2331 map.push( i ); 2332 } 2333 } 2334 } 2335 } 2336 2337 return newUnmatched; 2338} 2339 2340function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2341 if ( postFilter && !postFilter[ expando ] ) { 2342 postFilter = setMatcher( postFilter ); 2343 } 2344 if ( postFinder && !postFinder[ expando ] ) { 2345 postFinder = setMatcher( postFinder, postSelector ); 2346 } 2347 return markFunction(function( seed, results, context, xml ) { 2348 var temp, i, elem, 2349 preMap = [], 2350 postMap = [], 2351 preexisting = results.length, 2352 2353 // Get initial elements from seed or context 2354 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2355 2356 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2357 matcherIn = preFilter && ( seed || !selector ) ? 2358 condense( elems, preMap, preFilter, context, xml ) : 2359 elems, 2360 2361 matcherOut = matcher ? 2362 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2363 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2364 2365 // ...intermediate processing is necessary 2366 [] : 2367 2368 // ...otherwise use results directly 2369 results : 2370 matcherIn; 2371 2372 // Find primary matches 2373 if ( matcher ) { 2374 matcher( matcherIn, matcherOut, context, xml ); 2375 } 2376 2377 // Apply postFilter 2378 if ( postFilter ) { 2379 temp = condense( matcherOut, postMap ); 2380 postFilter( temp, [], context, xml ); 2381 2382 // Un-match failing elements by moving them back to matcherIn 2383 i = temp.length; 2384 while ( i-- ) { 2385 if ( (elem = temp[i]) ) { 2386 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2387 } 2388 } 2389 } 2390 2391 if ( seed ) { 2392 if ( postFinder || preFilter ) { 2393 if ( postFinder ) { 2394 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2395 temp = []; 2396 i = matcherOut.length; 2397 while ( i-- ) { 2398 if ( (elem = matcherOut[i]) ) { 2399 // Restore matcherIn since elem is not yet a final match 2400 temp.push( (matcherIn[i] = elem) ); 2401 } 2402 } 2403 postFinder( null, (matcherOut = []), temp, xml ); 2404 } 2405 2406 // Move matched elements from seed to results to keep them synchronized 2407 i = matcherOut.length; 2408 while ( i-- ) { 2409 if ( (elem = matcherOut[i]) && 2410 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2411 2412 seed[temp] = !(results[temp] = elem); 2413 } 2414 } 2415 } 2416 2417 // Add elements to results, through postFinder if defined 2418 } else { 2419 matcherOut = condense( 2420 matcherOut === results ? 2421 matcherOut.splice( preexisting, matcherOut.length ) : 2422 matcherOut 2423 ); 2424 if ( postFinder ) { 2425 postFinder( null, results, matcherOut, xml ); 2426 } else { 2427 push.apply( results, matcherOut ); 2428 } 2429 } 2430 }); 2431} 2432 2433function matcherFromTokens( tokens ) { 2434 var checkContext, matcher, j, 2435 len = tokens.length, 2436 leadingRelative = Expr.relative[ tokens[0].type ],
vendor: 6,246 bytes, lines 2437-2630
2437 implicitRelative = leadingRelative || Expr.relative[" "], 2438 i = leadingRelative ? 1 : 0, 2439 2440 // The foundational matcher ensures that elements are reachable from top-level context(s) 2441 matchContext = addCombinator( function( elem ) { 2442 return elem === checkContext; 2443 }, implicitRelative, true ), 2444 matchAnyContext = addCombinator( function( elem ) { 2445 return indexOf( checkContext, elem ) > -1; 2446 }, implicitRelative, true ), 2447 matchers = [ function( elem, context, xml ) { 2448 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2449 (checkContext = context).nodeType ? 2450 matchContext( elem, context, xml ) : 2451 matchAnyContext( elem, context, xml ) ); 2452 // Avoid hanging onto element (issue #299) 2453 checkContext = null; 2454 return ret; 2455 } ]; 2456 2457 for ( ; i < len; i++ ) { 2458 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2459 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2460 } else { 2461 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2462 2463 // Return special upon seeing a positional matcher 2464 if ( matcher[ expando ] ) { 2465 // Find the next relative operator (if any) for proper handling 2466 j = ++i; 2467 for ( ; j < len; j++ ) { 2468 if ( Expr.relative[ tokens[j].type ] ) { 2469 break; 2470 } 2471 } 2472 return setMatcher( 2473 i > 1 && elementMatcher( matchers ), 2474 i > 1 && toSelector( 2475 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2476 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2477 ).replace( rtrim, "$1" ), 2478 matcher, 2479 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2480 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2481 j < len && toSelector( tokens ) 2482 ); 2483 } 2484 matchers.push( matcher ); 2485 } 2486 } 2487 2488 return elementMatcher( matchers ); 2489} 2490 2491function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2492 var bySet = setMatchers.length > 0, 2493 byElement = elementMatchers.length > 0, 2494 superMatcher = function( seed, context, xml, results, outermost ) { 2495 var elem, j, matcher, 2496 matchedCount = 0, 2497 i = "0", 2498 unmatched = seed && [], 2499 setMatched = [], 2500 contextBackup = outermostContext, 2501 // We must always have either seed elements or outermost context 2502 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2503 // Use integer dirruns iff this is the outermost matcher 2504 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2505 len = elems.length; 2506 2507 if ( outermost ) { 2508 outermostContext = context === document || context || outermost; 2509 } 2510 2511 // Add elements passing elementMatchers directly to results 2512 // Support: IE<9, Safari 2513 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2514 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2515 if ( byElement && elem ) { 2516 j = 0; 2517 if ( !context && elem.ownerDocument !== document ) { 2518 setDocument( elem ); 2519 xml = !documentIsHTML; 2520 } 2521 while ( (matcher = elementMatchers[j++]) ) { 2522 if ( matcher( elem, context || document, xml) ) { 2523 results.push( elem ); 2524 break; 2525 } 2526 } 2527 if ( outermost ) { 2528 dirruns = dirrunsUnique; 2529 } 2530 } 2531 2532 // Track unmatched elements for set filters 2533 if ( bySet ) { 2534 // They will have gone through all possible matchers 2535 if ( (elem = !matcher && elem) ) { 2536 matchedCount--; 2537 } 2538 2539 // Lengthen the array for every element, matched or not 2540 if ( seed ) { 2541 unmatched.push( elem ); 2542 } 2543 } 2544 } 2545 2546 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2547 // makes the latter nonnegative. 2548 matchedCount += i; 2549 2550 // Apply set filters to unmatched elements 2551 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2552 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2553 // no element matchers and no seed. 2554 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2555 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2556 // numerically zero. 2557 if ( bySet && i !== matchedCount ) { 2558 j = 0; 2559 while ( (matcher = setMatchers[j++]) ) { 2560 matcher( unmatched, setMatched, context, xml ); 2561 } 2562 2563 if ( seed ) { 2564 // Reintegrate element matches to eliminate the need for sorting 2565 if ( matchedCount > 0 ) { 2566 while ( i-- ) { 2567 if ( !(unmatched[i] || setMatched[i]) ) { 2568 setMatched[i] = pop.call( results ); 2569 } 2570 } 2571 } 2572 2573 // Discard index placeholder values to get only actual matches 2574 setMatched = condense( setMatched ); 2575 } 2576 2577 // Add matches to results 2578 push.apply( results, setMatched ); 2579 2580 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2581 if ( outermost && !seed && setMatched.length > 0 && 2582 ( matchedCount + setMatchers.length ) > 1 ) { 2583 2584 Sizzle.uniqueSort( results ); 2585 } 2586 } 2587 2588 // Override manipulation of globals by nested matchers 2589 if ( outermost ) { 2590 dirruns = dirrunsUnique; 2591 outermostContext = contextBackup; 2592 } 2593 2594 return unmatched; 2595 }; 2596 2597 return bySet ? 2598 markFunction( superMatcher ) : 2599 superMatcher; 2600} 2601 2602compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2603 var i, 2604 setMatchers = [], 2605 elementMatchers = [], 2606 cached = compilerCache[ selector + " " ]; 2607 2608 if ( !cached ) { 2609 // Generate a function of recursive functions that can be used to check each element 2610 if ( !match ) { 2611 match = tokenize( selector ); 2612 } 2613 i = match.length; 2614 while ( i-- ) { 2615 cached = matcherFromTokens( match[i] ); 2616 if ( cached[ expando ] ) { 2617 setMatchers.push( cached ); 2618 } else { 2619 elementMatchers.push( cached ); 2620 } 2621 } 2622 2623 // Cache the compiled function 2624 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2625 2626 // Save selector and tokenization 2627 cached.selector = selector; 2628 } 2629 return cached; 2630};
vendor: 8,571 bytes, lines 2631-2943
2631 2632/** 2633 * A low-level selection function that works with Sizzle's compiled 2634 * selector functions 2635 * @param {String|Function} selector A selector or a pre-compiled 2636 * selector function built with Sizzle.compile 2637 * @param {Element} context 2638 * @param {Array} [results] 2639 * @param {Array} [seed] A set of elements to match against 2640 */ 2641select = Sizzle.select = function( selector, context, results, seed ) { 2642 var i, tokens, token, type, find, 2643 compiled = typeof selector === "function" && selector, 2644 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2645 2646 results = results || []; 2647 2648 // Try to minimize operations if there is only one selector in the list and no seed 2649 // (the latter of which guarantees us context) 2650 if ( match.length === 1 ) { 2651 2652 // Reduce context if the leading compound selector is an ID 2653 tokens = match[0] = match[0].slice( 0 ); 2654 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2655 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { 2656 2657 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2658 if ( !context ) { 2659 return results; 2660 2661 // Precompiled matchers will still verify ancestry, so step up a level 2662 } else if ( compiled ) { 2663 context = context.parentNode; 2664 } 2665 2666 selector = selector.slice( tokens.shift().value.length ); 2667 } 2668 2669 // Fetch a seed set for right-to-left matching 2670 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2671 while ( i-- ) { 2672 token = tokens[i]; 2673 2674 // Abort if we hit a combinator 2675 if ( Expr.relative[ (type = token.type) ] ) { 2676 break; 2677 } 2678 if ( (find = Expr.find[ type ]) ) { 2679 // Search, expanding context for leading sibling combinators 2680 if ( (seed = find( 2681 token.matches[0].replace( runescape, funescape ), 2682 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2683 )) ) { 2684 2685 // If seed is empty or no tokens remain, we can return early 2686 tokens.splice( i, 1 ); 2687 selector = seed.length && toSelector( tokens ); 2688 if ( !selector ) { 2689 push.apply( results, seed ); 2690 return results; 2691 } 2692 2693 break; 2694 } 2695 } 2696 } 2697 } 2698 2699 // Compile and execute a filtering function if one is not provided 2700 // Provide `match` to avoid retokenization if we modified the selector above 2701 ( compiled || compile( selector, match ) )( 2702 seed, 2703 context, 2704 !documentIsHTML, 2705 results, 2706 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2707 ); 2708 return results; 2709}; 2710 2711// One-time assignments 2712 2713// Sort stability 2714support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2715 2716// Support: Chrome 14-35+ 2717// Always assume duplicates if they aren't passed to the comparison function 2718support.detectDuplicates = !!hasDuplicate; 2719 2720// Initialize against the default document 2721setDocument(); 2722 2723// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2724// Detached nodes confoundingly follow *each other* 2725support.sortDetached = assert(function( el ) { 2726 // Should return 1, but returns 4 (following) 2727 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; 2728}); 2729 2730// Support: IE<8 2731// Prevent attribute/property "interpolation" 2732// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2733if ( !assert(function( el ) { 2734 el.innerHTML = "<a href='#'></a>"; 2735 return el.firstChild.getAttribute("href") === "#" ; 2736}) ) { 2737 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2738 if ( !isXML ) { 2739 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2740 } 2741 }); 2742} 2743 2744// Support: IE<9 2745// Use defaultValue in place of getAttribute("value") 2746if ( !support.attributes || !assert(function( el ) { 2747 el.innerHTML = "<input/>"; 2748 el.firstChild.setAttribute( "value", "" ); 2749 return el.firstChild.getAttribute( "value" ) === ""; 2750}) ) { 2751 addHandle( "value", function( elem, name, isXML ) { 2752 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2753 return elem.defaultValue; 2754 } 2755 }); 2756} 2757 2758// Support: IE<9 2759// Use getAttributeNode to fetch booleans when getAttribute lies 2760if ( !assert(function( el ) { 2761 return el.getAttribute("disabled") == null; 2762}) ) { 2763 addHandle( booleans, function( elem, name, isXML ) { 2764 var val; 2765 if ( !isXML ) { 2766 return elem[ name ] === true ? name.toLowerCase() : 2767 (val = elem.getAttributeNode( name )) && val.specified ? 2768 val.value : 2769 null; 2770 } 2771 }); 2772} 2773 2774return Sizzle; 2775 2776})( window ); 2777 2778 2779 2780jQuery.find = Sizzle; 2781jQuery.expr = Sizzle.selectors; 2782 2783// Deprecated 2784jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2785jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2786jQuery.text = Sizzle.getText; 2787jQuery.isXMLDoc = Sizzle.isXML; 2788jQuery.contains = Sizzle.contains; 2789jQuery.escapeSelector = Sizzle.escape; 2790 2791 2792 2793 2794var dir = function( elem, dir, until ) { 2795 var matched = [], 2796 truncate = until !== undefined; 2797 2798 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2799 if ( elem.nodeType === 1 ) { 2800 if ( truncate && jQuery( elem ).is( until ) ) { 2801 break; 2802 } 2803 matched.push( elem ); 2804 } 2805 } 2806 return matched; 2807}; 2808 2809 2810var siblings = function( n, elem ) { 2811 var matched = []; 2812 2813 for ( ; n; n = n.nextSibling ) { 2814 if ( n.nodeType === 1 && n !== elem ) { 2815 matched.push( n ); 2816 } 2817 } 2818 2819 return matched; 2820}; 2821 2822 2823var rneedsContext = jQuery.expr.match.needsContext; 2824 2825 2826 2827function nodeName( elem, name ) { 2828 2829 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 2830 2831}; 2832var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 2833 2834 2835 2836// Implement the identical functionality for filter and not 2837function winnow( elements, qualifier, not ) { 2838 if ( isFunction( qualifier ) ) { 2839 return jQuery.grep( elements, function( elem, i ) { 2840 return !!qualifier.call( elem, i, elem ) !== not; 2841 } ); 2842 } 2843 2844 // Single element 2845 if ( qualifier.nodeType ) { 2846 return jQuery.grep( elements, function( elem ) { 2847 return ( elem === qualifier ) !== not; 2848 } ); 2849 } 2850 2851 // Arraylike of elements (jQuery, arguments, Array) 2852 if ( typeof qualifier !== "string" ) { 2853 return jQuery.grep( elements, function( elem ) { 2854 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 2855 } ); 2856 } 2857 2858 // Filtered directly for both simple and complex selectors 2859 return jQuery.filter( qualifier, elements, not ); 2860} 2861 2862jQuery.filter = function( expr, elems, not ) { 2863 var elem = elems[ 0 ]; 2864 2865 if ( not ) { 2866 expr = ":not(" + expr + ")"; 2867 } 2868 2869 if ( elems.length === 1 && elem.nodeType === 1 ) { 2870 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 2871 } 2872 2873 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2874 return elem.nodeType === 1; 2875 } ) ); 2876}; 2877 2878jQuery.fn.extend( { 2879 find: function( selector ) { 2880 var i, ret, 2881 len = this.length, 2882 self = this; 2883 2884 if ( typeof selector !== "string" ) { 2885 return this.pushStack( jQuery( selector ).filter( function() { 2886 for ( i = 0; i < len; i++ ) { 2887 if ( jQuery.contains( self[ i ], this ) ) { 2888 return true; 2889 } 2890 } 2891 } ) ); 2892 } 2893 2894 ret = this.pushStack( [] ); 2895 2896 for ( i = 0; i < len; i++ ) { 2897 jQuery.find( selector, self[ i ], ret ); 2898 } 2899 2900 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 2901 }, 2902 filter: function( selector ) { 2903 return this.pushStack( winnow( this, selector || [], false ) ); 2904 }, 2905 not: function( selector ) { 2906 return this.pushStack( winnow( this, selector || [], true ) ); 2907 }, 2908 is: function( selector ) { 2909 return !!winnow( 2910 this, 2911 2912 // If this is a positional/relative selector, check membership in the returned set 2913 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2914 typeof selector === "string" && rneedsContext.test( selector ) ? 2915 jQuery( selector ) : 2916 selector || [], 2917 false 2918 ).length; 2919 } 2920} ); 2921 2922 2923// Initialize a jQuery object 2924 2925 2926// A central reference to the root jQuery(document) 2927var rootjQuery, 2928 2929 // A simple way to check for HTML strings 2930 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2931 // Strict HTML recognition (#11290: must start with <) 2932 // Shortcut simple #id case for speed 2933 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 2934 2935 init = jQuery.fn.init = function( selector, context, root ) { 2936 var match, elem; 2937 2938 // HANDLE: $(""), $(null), $(undefined), $(false) 2939 if ( !selector ) { 2940 return this; 2941 } 2942 2943 // Method init() accepts an alternate rootjQuery
vendor: 31,929 bytes, lines 2944-4159
2944 // so migrate can support jQuery.sub (gh-2101) 2945 root = root || rootjQuery; 2946 2947 // Handle HTML strings 2948 if ( typeof selector === "string" ) { 2949 if ( selector[ 0 ] === "<" && 2950 selector[ selector.length - 1 ] === ">" && 2951 selector.length >= 3 ) { 2952 2953 // Assume that strings that start and end with <> are HTML and skip the regex check 2954 match = [ null, selector, null ]; 2955 2956 } else { 2957 match = rquickExpr.exec( selector ); 2958 } 2959 2960 // Match html or make sure no context is specified for #id 2961 if ( match && ( match[ 1 ] || !context ) ) { 2962 2963 // HANDLE: $(html) -> $(array) 2964 if ( match[ 1 ] ) { 2965 context = context instanceof jQuery ? context[ 0 ] : context; 2966 2967 // Option to run scripts is true for back-compat 2968 // Intentionally let the error be thrown if parseHTML is not present 2969 jQuery.merge( this, jQuery.parseHTML( 2970 match[ 1 ], 2971 context && context.nodeType ? context.ownerDocument || context : document, 2972 true 2973 ) ); 2974 2975 // HANDLE: $(html, props) 2976 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2977 for ( match in context ) { 2978 2979 // Properties of context are called as methods if possible 2980 if ( isFunction( this[ match ] ) ) { 2981 this[ match ]( context[ match ] ); 2982 2983 // ...and otherwise set as attributes 2984 } else { 2985 this.attr( match, context[ match ] ); 2986 } 2987 } 2988 } 2989 2990 return this; 2991 2992 // HANDLE: $(#id) 2993 } else { 2994 elem = document.getElementById( match[ 2 ] ); 2995 2996 if ( elem ) { 2997 2998 // Inject the element directly into the jQuery object 2999 this[ 0 ] = elem; 3000 this.length = 1; 3001 } 3002 return this; 3003 } 3004 3005 // HANDLE: $(expr, $(...)) 3006 } else if ( !context || context.jquery ) { 3007 return ( context || root ).find( selector ); 3008 3009 // HANDLE: $(expr, context) 3010 // (which is just equivalent to: $(context).find(expr) 3011 } else { 3012 return this.constructor( context ).find( selector ); 3013 } 3014 3015 // HANDLE: $(DOMElement) 3016 } else if ( selector.nodeType ) { 3017 this[ 0 ] = selector; 3018 this.length = 1; 3019 return this; 3020 3021 // HANDLE: $(function) 3022 // Shortcut for document ready 3023 } else if ( isFunction( selector ) ) { 3024 return root.ready !== undefined ? 3025 root.ready( selector ) : 3026 3027 // Execute immediately if ready is not present 3028 selector( jQuery ); 3029 } 3030 3031 return jQuery.makeArray( selector, this ); 3032 }; 3033 3034// Give the init function the jQuery prototype for later instantiation 3035init.prototype = jQuery.fn; 3036 3037// Initialize central reference 3038rootjQuery = jQuery( document ); 3039 3040 3041var rparentsprev = /^(?:parents|prev(?:Until|All))/, 3042 3043 // Methods guaranteed to produce a unique set when starting from a unique set 3044 guaranteedUnique = { 3045 children: true, 3046 contents: true, 3047 next: true, 3048 prev: true 3049 }; 3050 3051jQuery.fn.extend( { 3052 has: function( target ) { 3053 var targets = jQuery( target, this ), 3054 l = targets.length; 3055 3056 return this.filter( function() { 3057 var i = 0; 3058 for ( ; i < l; i++ ) { 3059 if ( jQuery.contains( this, targets[ i ] ) ) { 3060 return true; 3061 } 3062 } 3063 } ); 3064 }, 3065 3066 closest: function( selectors, context ) { 3067 var cur, 3068 i = 0, 3069 l = this.length, 3070 matched = [], 3071 targets = typeof selectors !== "string" && jQuery( selectors ); 3072 3073 // Positional selectors never match, since there's no _selection_ context 3074 if ( !rneedsContext.test( selectors ) ) { 3075 for ( ; i < l; i++ ) { 3076 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 3077 3078 // Always skip document fragments 3079 if ( cur.nodeType < 11 && ( targets ? 3080 targets.index( cur ) > -1 : 3081 3082 // Don't pass non-elements to Sizzle 3083 cur.nodeType === 1 && 3084 jQuery.find.matchesSelector( cur, selectors ) ) ) { 3085 3086 matched.push( cur ); 3087 break; 3088 } 3089 } 3090 } 3091 } 3092 3093 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3094 }, 3095 3096 // Determine the position of an element within the set 3097 index: function( elem ) { 3098 3099 // No argument, return index in parent 3100 if ( !elem ) { 3101 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3102 } 3103 3104 // Index in selector 3105 if ( typeof elem === "string" ) { 3106 return indexOf.call( jQuery( elem ), this[ 0 ] ); 3107 } 3108 3109 // Locate the position of the desired element 3110 return indexOf.call( this, 3111 3112 // If it receives a jQuery object, the first element is used 3113 elem.jquery ? elem[ 0 ] : elem 3114 ); 3115 }, 3116 3117 add: function( selector, context ) { 3118 return this.pushStack( 3119 jQuery.uniqueSort( 3120 jQuery.merge( this.get(), jQuery( selector, context ) ) 3121 ) 3122 ); 3123 }, 3124 3125 addBack: function( selector ) { 3126 return this.add( selector == null ? 3127 this.prevObject : this.prevObject.filter( selector ) 3128 ); 3129 } 3130} ); 3131 3132function sibling( cur, dir ) { 3133 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 3134 return cur; 3135} 3136 3137jQuery.each( { 3138 parent: function( elem ) { 3139 var parent = elem.parentNode; 3140 return parent && parent.nodeType !== 11 ? parent : null; 3141 }, 3142 parents: function( elem ) { 3143 return dir( elem, "parentNode" ); 3144 }, 3145 parentsUntil: function( elem, i, until ) { 3146 return dir( elem, "parentNode", until ); 3147 }, 3148 next: function( elem ) { 3149 return sibling( elem, "nextSibling" ); 3150 }, 3151 prev: function( elem ) { 3152 return sibling( elem, "previousSibling" ); 3153 }, 3154 nextAll: function( elem ) { 3155 return dir( elem, "nextSibling" ); 3156 }, 3157 prevAll: function( elem ) { 3158 return dir( elem, "previousSibling" ); 3159 }, 3160 nextUntil: function( elem, i, until ) { 3161 return dir( elem, "nextSibling", until ); 3162 }, 3163 prevUntil: function( elem, i, until ) { 3164 return dir( elem, "previousSibling", until ); 3165 }, 3166 siblings: function( elem ) { 3167 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3168 }, 3169 children: function( elem ) { 3170 return siblings( elem.firstChild ); 3171 }, 3172 contents: function( elem ) { 3173 if ( typeof elem.contentDocument !== "undefined" ) { 3174 return elem.contentDocument; 3175 } 3176 3177 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 3178 // Treat the template element as a regular one in browsers that 3179 // don't support it. 3180 if ( nodeName( elem, "template" ) ) { 3181 elem = elem.content || elem; 3182 } 3183 3184 return jQuery.merge( [], elem.childNodes ); 3185 } 3186}, function( name, fn ) { 3187 jQuery.fn[ name ] = function( until, selector ) { 3188 var matched = jQuery.map( this, fn, until ); 3189 3190 if ( name.slice( -5 ) !== "Until" ) { 3191 selector = until; 3192 } 3193 3194 if ( selector && typeof selector === "string" ) { 3195 matched = jQuery.filter( selector, matched ); 3196 } 3197 3198 if ( this.length > 1 ) { 3199 3200 // Remove duplicates 3201 if ( !guaranteedUnique[ name ] ) { 3202 jQuery.uniqueSort( matched ); 3203 } 3204 3205 // Reverse order for parents* and prev-derivatives 3206 if ( rparentsprev.test( name ) ) { 3207 matched.reverse(); 3208 } 3209 } 3210 3211 return this.pushStack( matched ); 3212 }; 3213} ); 3214var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 3215 3216 3217 3218// Convert String-formatted options into Object-formatted ones 3219function createOptions( options ) { 3220 var object = {}; 3221 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 3222 object[ flag ] = true; 3223 } ); 3224 return object; 3225} 3226 3227/* 3228 * Create a callback list using the following parameters: 3229 * 3230 * options: an optional list of space-separated options that will change how 3231 * the callback list behaves or a more traditional option object 3232 * 3233 * By default a callback list will act like an event callback list and can be 3234 * "fired" multiple times. 3235 * 3236 * Possible options: 3237 * 3238 * once: will ensure the callback list can only be fired once (like a Deferred) 3239 * 3240 * memory: will keep track of previous values and will call any callback added 3241 * after the list has been fired right away with the latest "memorized" 3242 * values (like a Deferred) 3243 * 3244 * unique: will ensure a callback can only be added once (no duplicate in the list) 3245 * 3246 * stopOnFalse: interrupt callings when a callback returns false 3247 * 3248 */ 3249jQuery.Callbacks = function( options ) { 3250 3251 // Convert options from String-formatted to Object-formatted if needed 3252 // (we check in cache first) 3253 options = typeof options === "string" ? 3254 createOptions( options ) : 3255 jQuery.extend( {}, options ); 3256 3257 var // Flag to know if list is currently firing 3258 firing, 3259 3260 // Last fire value for non-forgettable lists 3261 memory, 3262 3263 // Flag to know if list was already fired 3264 fired, 3265 3266 // Flag to prevent firing 3267 locked, 3268 3269 // Actual callback list 3270 list = [], 3271 3272 // Queue of execution data for repeatable lists 3273 queue = [], 3274 3275 // Index of currently firing callback (modified by add/remove as needed) 3276 firingIndex = -1, 3277 3278 // Fire callbacks 3279 fire = function() { 3280 3281 // Enforce single-firing 3282 locked = locked || options.once; 3283 3284 // Execute callbacks for all pending executions, 3285 // respecting firingIndex overrides and runtime changes 3286 fired = firing = true; 3287 for ( ; queue.length; firingIndex = -1 ) { 3288 memory = queue.shift(); 3289 while ( ++firingIndex < list.length ) { 3290 3291 // Run callback and check for early termination 3292 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3293 options.stopOnFalse ) { 3294 3295 // Jump to end and forget the data so .add doesn't re-fire 3296 firingIndex = list.length; 3297 memory = false; 3298 } 3299 } 3300 } 3301 3302 // Forget the data if we're done with it 3303 if ( !options.memory ) { 3304 memory = false; 3305 } 3306 3307 firing = false; 3308 3309 // Clean up if we're done firing for good 3310 if ( locked ) { 3311 3312 // Keep an empty list if we have data for future add calls 3313 if ( memory ) { 3314 list = []; 3315 3316 // Otherwise, this object is spent 3317 } else { 3318 list = ""; 3319 } 3320 } 3321 }, 3322 3323 // Actual Callbacks object 3324 self = { 3325 3326 // Add a callback or a collection of callbacks to the list 3327 add: function() { 3328 if ( list ) { 3329 3330 // If we have memory from a past run, we should fire after adding 3331 if ( memory && !firing ) { 3332 firingIndex = list.length - 1; 3333 queue.push( memory ); 3334 } 3335 3336 ( function add( args ) { 3337 jQuery.each( args, function( _, arg ) { 3338 if ( isFunction( arg ) ) { 3339 if ( !options.unique || !self.has( arg ) ) { 3340 list.push( arg ); 3341 } 3342 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 3343 3344 // Inspect recursively 3345 add( arg ); 3346 } 3347 } ); 3348 } )( arguments ); 3349 3350 if ( memory && !firing ) { 3351 fire(); 3352 } 3353 } 3354 return this; 3355 }, 3356 3357 // Remove a callback from the list 3358 remove: function() { 3359 jQuery.each( arguments, function( _, arg ) { 3360 var index; 3361 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3362 list.splice( index, 1 ); 3363 3364 // Handle firing indexes 3365 if ( index <= firingIndex ) { 3366 firingIndex--; 3367 } 3368 } 3369 } ); 3370 return this; 3371 }, 3372 3373 // Check if a given callback is in the list. 3374 // If no argument is given, return whether or not list has callbacks attached. 3375 has: function( fn ) { 3376 return fn ? 3377 jQuery.inArray( fn, list ) > -1 : 3378 list.length > 0; 3379 }, 3380 3381 // Remove all callbacks from the list 3382 empty: function() { 3383 if ( list ) { 3384 list = []; 3385 } 3386 return this; 3387 }, 3388 3389 // Disable .fire and .add 3390 // Abort any current/pending executions 3391 // Clear all callbacks and values 3392 disable: function() { 3393 locked = queue = []; 3394 list = memory = ""; 3395 return this; 3396 }, 3397 disabled: function() { 3398 return !list; 3399 }, 3400 3401 // Disable .fire 3402 // Also disable .add unless we have memory (since it would have no effect) 3403 // Abort any pending executions 3404 lock: function() { 3405 locked = queue = []; 3406 if ( !memory && !firing ) { 3407 list = memory = ""; 3408 } 3409 return this; 3410 }, 3411 locked: function() { 3412 return !!locked; 3413 }, 3414 3415 // Call all callbacks with the given context and arguments 3416 fireWith: function( context, args ) { 3417 if ( !locked ) { 3418 args = args || []; 3419 args = [ context, args.slice ? args.slice() : args ]; 3420 queue.push( args ); 3421 if ( !firing ) { 3422 fire(); 3423 } 3424 } 3425 return this; 3426 }, 3427 3428 // Call all the callbacks with the given arguments 3429 fire: function() { 3430 self.fireWith( this, arguments ); 3431 return this; 3432 }, 3433 3434 // To know if the callbacks have already been called at least once 3435 fired: function() { 3436 return !!fired; 3437 } 3438 }; 3439 3440 return self; 3441}; 3442 3443 3444function Identity( v ) { 3445 return v; 3446} 3447function Thrower( ex ) { 3448 throw ex; 3449} 3450 3451function adoptValue( value, resolve, reject, noValue ) { 3452 var method; 3453 3454 try { 3455 3456 // Check for promise aspect first to privilege synchronous behavior 3457 if ( value && isFunction( ( method = value.promise ) ) ) { 3458 method.call( value ).done( resolve ).fail( reject ); 3459 3460 // Other thenables 3461 } else if ( value && isFunction( ( method = value.then ) ) ) { 3462 method.call( value, resolve, reject ); 3463 3464 // Other non-thenables 3465 } else { 3466 3467 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 3468 // * false: [ value ].slice( 0 ) => resolve( value ) 3469 // * true: [ value ].slice( 1 ) => resolve() 3470 resolve.apply( undefined, [ value ].slice( noValue ) ); 3471 } 3472 3473 // For Promises/A+, convert exceptions into rejections 3474 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 3475 // Deferred#then to conditionally suppress rejection. 3476 } catch ( value ) { 3477 3478 // Support: Android 4.0 only 3479 // Strict mode functions invoked without .call/.apply get global-object context 3480 reject.apply( undefined, [ value ] ); 3481 } 3482} 3483 3484jQuery.extend( { 3485 3486 Deferred: function( func ) { 3487 var tuples = [ 3488 3489 // action, add listener, callbacks, 3490 // ... .then handlers, argument index, [final state] 3491 [ "notify", "progress", jQuery.Callbacks( "memory" ), 3492 jQuery.Callbacks( "memory" ), 2 ], 3493 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 3494 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 3495 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 3496 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 3497 ], 3498 state = "pending", 3499 promise = { 3500 state: function() { 3501 return state; 3502 }, 3503 always: function() { 3504 deferred.done( arguments ).fail( arguments ); 3505 return this; 3506 }, 3507 "catch": function( fn ) { 3508 return promise.then( null, fn ); 3509 }, 3510 3511 // Keep pipe for back-compat 3512 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 3513 var fns = arguments; 3514 3515 return jQuery.Deferred( function( newDefer ) { 3516 jQuery.each( tuples, function( i, tuple ) { 3517 3518 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 3519 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 3520 3521 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 3522 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 3523 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 3524 deferred[ tuple[ 1 ] ]( function() { 3525 var returned = fn && fn.apply( this, arguments ); 3526 if ( returned && isFunction( returned.promise ) ) { 3527 returned.promise() 3528 .progress( newDefer.notify ) 3529 .done( newDefer.resolve ) 3530 .fail( newDefer.reject ); 3531 } else { 3532 newDefer[ tuple[ 0 ] + "With" ]( 3533 this, 3534 fn ? [ returned ] : arguments 3535 ); 3536 } 3537 } ); 3538 } ); 3539 fns = null; 3540 } ).promise(); 3541 }, 3542 then: function( onFulfilled, onRejected, onProgress ) { 3543 var maxDepth = 0; 3544 function resolve( depth, deferred, handler, special ) { 3545 return function() { 3546 var that = this, 3547 args = arguments, 3548 mightThrow = function() { 3549 var returned, then; 3550 3551 // Support: Promises/A+ section 2.3.3.3.3 3552 // https://promisesaplus.com/#point-59 3553 // Ignore double-resolution attempts 3554 if ( depth < maxDepth ) { 3555 return; 3556 } 3557 3558 returned = handler.apply( that, args ); 3559 3560 // Support: Promises/A+ section 2.3.1 3561 // https://promisesaplus.com/#point-48 3562 if ( returned === deferred.promise() ) { 3563 throw new TypeError( "Thenable self-resolution" ); 3564 } 3565 3566 // Support: Promises/A+ sections 2.3.3.1, 3.5 3567 // https://promisesaplus.com/#point-54 3568 // https://promisesaplus.com/#point-75 3569 // Retrieve `then` only once 3570 then = returned && 3571 3572 // Support: Promises/A+ section 2.3.4 3573 // https://promisesaplus.com/#point-64 3574 // Only check objects and functions for thenability 3575 ( typeof returned === "object" || 3576 typeof returned === "function" ) && 3577 returned.then; 3578 3579 // Handle a returned thenable 3580 if ( isFunction( then ) ) { 3581 3582 // Special processors (notify) just wait for resolution 3583 if ( special ) { 3584 then.call( 3585 returned, 3586 resolve( maxDepth, deferred, Identity, special ), 3587 resolve( maxDepth, deferred, Thrower, special ) 3588 ); 3589 3590 // Normal processors (resolve) also hook into progress 3591 } else { 3592 3593 // ...and disregard older resolution values 3594 maxDepth++; 3595 3596 then.call( 3597 returned, 3598 resolve( maxDepth, deferred, Identity, special ), 3599 resolve( maxDepth, deferred, Thrower, special ), 3600 resolve( maxDepth, deferred, Identity, 3601 deferred.notifyWith ) 3602 ); 3603 } 3604 3605 // Handle all other returned values 3606 } else { 3607 3608 // Only substitute handlers pass on context 3609 // and multiple values (non-spec behavior) 3610 if ( handler !== Identity ) { 3611 that = undefined; 3612 args = [ returned ]; 3613 } 3614 3615 // Process the value(s) 3616 // Default process is resolve 3617 ( special || deferred.resolveWith )( that, args ); 3618 } 3619 }, 3620 3621 // Only normal processors (resolve) catch and reject exceptions 3622 process = special ? 3623 mightThrow : 3624 function() { 3625 try { 3626 mightThrow(); 3627 } catch ( e ) { 3628 3629 if ( jQuery.Deferred.exceptionHook ) { 3630 jQuery.Deferred.exceptionHook( e, 3631 process.stackTrace ); 3632 } 3633 3634 // Support: Promises/A+ section 2.3.3.3.4.1 3635 // https://promisesaplus.com/#point-61 3636 // Ignore post-resolution exceptions 3637 if ( depth + 1 >= maxDepth ) { 3638 3639 // Only substitute handlers pass on context 3640 // and multiple values (non-spec behavior) 3641 if ( handler !== Thrower ) { 3642 that = undefined; 3643 args = [ e ]; 3644 } 3645 3646 deferred.rejectWith( that, args ); 3647 } 3648 } 3649 }; 3650 3651 // Support: Promises/A+ section 2.3.3.3.1 3652 // https://promisesaplus.com/#point-57 3653 // Re-resolve promises immediately to dodge false rejection from 3654 // subsequent errors 3655 if ( depth ) { 3656 process(); 3657 } else { 3658 3659 // Call an optional hook to record the stack, in case of exception 3660 // since it's otherwise lost when execution goes async 3661 if ( jQuery.Deferred.getStackHook ) { 3662 process.stackTrace = jQuery.Deferred.getStackHook(); 3663 } 3664 window.setTimeout( process ); 3665 } 3666 }; 3667 } 3668 3669 return jQuery.Deferred( function( newDefer ) { 3670 3671 // progress_handlers.add( ... ) 3672 tuples[ 0 ][ 3 ].add( 3673 resolve( 3674 0, 3675 newDefer, 3676 isFunction( onProgress ) ? 3677 onProgress : 3678 Identity, 3679 newDefer.notifyWith 3680 ) 3681 ); 3682 3683 // fulfilled_handlers.add( ... ) 3684 tuples[ 1 ][ 3 ].add( 3685 resolve( 3686 0, 3687 newDefer, 3688 isFunction( onFulfilled ) ? 3689 onFulfilled : 3690 Identity 3691 ) 3692 ); 3693 3694 // rejected_handlers.add( ... ) 3695 tuples[ 2 ][ 3 ].add( 3696 resolve( 3697 0, 3698 newDefer, 3699 isFunction( onRejected ) ? 3700 onRejected : 3701 Thrower 3702 ) 3703 ); 3704 } ).promise(); 3705 }, 3706 3707 // Get a promise for this deferred 3708 // If obj is provided, the promise aspect is added to the object 3709 promise: function( obj ) { 3710 return obj != null ? jQuery.extend( obj, promise ) : promise; 3711 } 3712 }, 3713 deferred = {}; 3714 3715 // Add list-specific methods 3716 jQuery.each( tuples, function( i, tuple ) { 3717 var list = tuple[ 2 ], 3718 stateString = tuple[ 5 ]; 3719 3720 // promise.progress = list.add 3721 // promise.done = list.add 3722 // promise.fail = list.add 3723 promise[ tuple[ 1 ] ] = list.add; 3724 3725 // Handle state 3726 if ( stateString ) { 3727 list.add( 3728 function() { 3729 3730 // state = "resolved" (i.e., fulfilled) 3731 // state = "rejected" 3732 state = stateString; 3733 }, 3734 3735 // rejected_callbacks.disable 3736 // fulfilled_callbacks.disable 3737 tuples[ 3 - i ][ 2 ].disable, 3738 3739 // rejected_handlers.disable 3740 // fulfilled_handlers.disable 3741 tuples[ 3 - i ][ 3 ].disable, 3742 3743 // progress_callbacks.lock 3744 tuples[ 0 ][ 2 ].lock, 3745 3746 // progress_handlers.lock 3747 tuples[ 0 ][ 3 ].lock 3748 ); 3749 } 3750 3751 // progress_handlers.fire 3752 // fulfilled_handlers.fire 3753 // rejected_handlers.fire 3754 list.add( tuple[ 3 ].fire ); 3755 3756 // deferred.notify = function() { deferred.notifyWith(...) } 3757 // deferred.resolve = function() { deferred.resolveWith(...) } 3758 // deferred.reject = function() { deferred.rejectWith(...) } 3759 deferred[ tuple[ 0 ] ] = function() { 3760 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 3761 return this; 3762 }; 3763 3764 // deferred.notifyWith = list.fireWith 3765 // deferred.resolveWith = list.fireWith 3766 // deferred.rejectWith = list.fireWith 3767 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3768 } ); 3769 3770 // Make the deferred a promise 3771 promise.promise( deferred ); 3772 3773 // Call given func if any 3774 if ( func ) { 3775 func.call( deferred, deferred ); 3776 } 3777 3778 // All done! 3779 return deferred; 3780 }, 3781 3782 // Deferred helper 3783 when: function( singleValue ) { 3784 var 3785 3786 // count of uncompleted subordinates 3787 remaining = arguments.length, 3788 3789 // count of unprocessed arguments 3790 i = remaining, 3791 3792 // subordinate fulfillment data 3793 resolveContexts = Array( i ), 3794 resolveValues = slice.call( arguments ), 3795 3796 // the master Deferred 3797 master = jQuery.Deferred(), 3798 3799 // subordinate callback factory 3800 updateFunc = function( i ) { 3801 return function( value ) { 3802 resolveContexts[ i ] = this; 3803 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3804 if ( !( --remaining ) ) { 3805 master.resolveWith( resolveContexts, resolveValues ); 3806 } 3807 }; 3808 }; 3809 3810 // Single- and empty arguments are adopted like Promise.resolve 3811 if ( remaining <= 1 ) { 3812 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 3813 !remaining ); 3814 3815 // Use .then() to unwrap secondary thenables (cf. gh-3000) 3816 if ( master.state() === "pending" || 3817 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 3818 3819 return master.then(); 3820 } 3821 } 3822 3823 // Multiple arguments are aggregated like Promise.all array elements 3824 while ( i-- ) { 3825 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 3826 } 3827 3828 return master.promise(); 3829 } 3830} ); 3831 3832 3833// These usually indicate a programmer mistake during development, 3834// warn about them ASAP rather than swallowing them by default. 3835var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 3836 3837jQuery.Deferred.exceptionHook = function( error, stack ) { 3838 3839 // Support: IE 8 - 9 only 3840 // Console exists when dev tools are open, which can happen at any time 3841 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 3842 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 3843 } 3844}; 3845 3846 3847 3848 3849jQuery.readyException = function( error ) { 3850 window.setTimeout( function() { 3851 throw error; 3852 } ); 3853}; 3854 3855 3856 3857 3858// The deferred used on DOM ready 3859var readyList = jQuery.Deferred(); 3860 3861jQuery.fn.ready = function( fn ) { 3862 3863 readyList 3864 .then( fn ) 3865 3866 // Wrap jQuery.readyException in a function so that the lookup 3867 // happens at the time of error handling instead of callback 3868 // registration. 3869 .catch( function( error ) { 3870 jQuery.readyException( error ); 3871 } ); 3872 3873 return this; 3874}; 3875 3876jQuery.extend( { 3877 3878 // Is the DOM ready to be used? Set to true once it occurs. 3879 isReady: false, 3880 3881 // A counter to track how many items to wait for before 3882 // the ready event fires. See #6781 3883 readyWait: 1, 3884 3885 // Handle when the DOM is ready 3886 ready: function( wait ) { 3887 3888 // Abort if there are pending holds or we're already ready 3889 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3890 return; 3891 } 3892 3893 // Remember that the DOM is ready 3894 jQuery.isReady = true; 3895 3896 // If a normal DOM Ready event fired, decrement, and wait if need be 3897 if ( wait !== true && --jQuery.readyWait > 0 ) { 3898 return; 3899 } 3900 3901 // If there are functions bound, to execute 3902 readyList.resolveWith( document, [ jQuery ] ); 3903 } 3904} ); 3905 3906jQuery.ready.then = readyList.then; 3907 3908// The ready event handler and self cleanup method 3909function completed() { 3910 document.removeEventListener( "DOMContentLoaded", completed ); 3911 window.removeEventListener( "load", completed ); 3912 jQuery.ready(); 3913} 3914 3915// Catch cases where $(document).ready() is called 3916// after the browser event has already occurred. 3917// Support: IE <=9 - 10 only 3918// Older IE sometimes signals "interactive" too soon 3919if ( document.readyState === "complete" || 3920 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3921 3922 // Handle it asynchronously to allow scripts the opportunity to delay ready 3923 window.setTimeout( jQuery.ready ); 3924 3925} else { 3926 3927 // Use the handy event callback 3928 document.addEventListener( "DOMContentLoaded", completed ); 3929 3930 // A fallback to window.onload, that will always work 3931 window.addEventListener( "load", completed ); 3932} 3933 3934 3935 3936 3937// Multifunctional method to get and set values of a collection 3938// The value/s can optionally be executed if it's a function 3939var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 3940 var i = 0, 3941 len = elems.length, 3942 bulk = key == null; 3943 3944 // Sets many values 3945 if ( toType( key ) === "object" ) { 3946 chainable = true; 3947 for ( i in key ) { 3948 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 3949 } 3950 3951 // Sets one value 3952 } else if ( value !== undefined ) { 3953 chainable = true; 3954 3955 if ( !isFunction( value ) ) { 3956 raw = true; 3957 } 3958 3959 if ( bulk ) { 3960 3961 // Bulk operations run against the entire set 3962 if ( raw ) { 3963 fn.call( elems, value ); 3964 fn = null; 3965 3966 // ...except when executing function values 3967 } else { 3968 bulk = fn; 3969 fn = function( elem, key, value ) { 3970 return bulk.call( jQuery( elem ), value ); 3971 }; 3972 } 3973 } 3974 3975 if ( fn ) { 3976 for ( ; i < len; i++ ) { 3977 fn( 3978 elems[ i ], key, raw ? 3979 value : 3980 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 3981 ); 3982 } 3983 } 3984 } 3985 3986 if ( chainable ) { 3987 return elems; 3988 } 3989 3990 // Gets 3991 if ( bulk ) { 3992 return fn.call( elems ); 3993 } 3994 3995 return len ? fn( elems[ 0 ], key ) : emptyGet; 3996}; 3997 3998 3999// Matches dashed string for camelizing 4000var rmsPrefix = /^-ms-/, 4001 rdashAlpha = /-([a-z])/g; 4002 4003// Used by camelCase as callback to replace() 4004function fcamelCase( all, letter ) { 4005 return letter.toUpperCase(); 4006} 4007 4008// Convert dashed to camelCase; used by the css and data modules 4009// Support: IE <=9 - 11, Edge 12 - 15 4010// Microsoft forgot to hump their vendor prefix (#9572) 4011function camelCase( string ) { 4012 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 4013} 4014var acceptData = function( owner ) { 4015 4016 // Accepts only: 4017 // - Node 4018 // - Node.ELEMENT_NODE 4019 // - Node.DOCUMENT_NODE 4020 // - Object 4021 // - Any 4022 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 4023}; 4024 4025 4026 4027 4028function Data() { 4029 this.expando = jQuery.expando + Data.uid++; 4030} 4031 4032Data.uid = 1; 4033 4034Data.prototype = { 4035 4036 cache: function( owner ) { 4037 4038 // Check if the owner object already has a cache 4039 var value = owner[ this.expando ]; 4040 4041 // If not, create one 4042 if ( !value ) { 4043 value = {}; 4044 4045 // We can accept data for non-element nodes in modern browsers, 4046 // but we should not, see #8335. 4047 // Always return an empty object. 4048 if ( acceptData( owner ) ) { 4049 4050 // If it is a node unlikely to be stringify-ed or looped over 4051 // use plain assignment 4052 if ( owner.nodeType ) { 4053 owner[ this.expando ] = value; 4054 4055 // Otherwise secure it in a non-enumerable property 4056 // configurable must be true to allow the property to be 4057 // deleted when data is removed 4058 } else { 4059 Object.defineProperty( owner, this.expando, { 4060 value: value, 4061 configurable: true 4062 } ); 4063 } 4064 } 4065 } 4066 4067 return value; 4068 }, 4069 set: function( owner, data, value ) { 4070 var prop, 4071 cache = this.cache( owner ); 4072 4073 // Handle: [ owner, key, value ] args 4074 // Always use camelCase key (gh-2257) 4075 if ( typeof data === "string" ) { 4076 cache[ camelCase( data ) ] = value; 4077 4078 // Handle: [ owner, { properties } ] args 4079 } else { 4080 4081 // Copy the properties one-by-one to the cache object 4082 for ( prop in data ) { 4083 cache[ camelCase( prop ) ] = data[ prop ]; 4084 } 4085 } 4086 return cache; 4087 }, 4088 get: function( owner, key ) { 4089 return key === undefined ? 4090 this.cache( owner ) : 4091 4092 // Always use camelCase key (gh-2257) 4093 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 4094 }, 4095 access: function( owner, key, value ) { 4096 4097 // In cases where either: 4098 // 4099 // 1. No key was specified 4100 // 2. A string key was specified, but no value provided 4101 // 4102 // Take the "read" path and allow the get method to determine 4103 // which value to return, respectively either: 4104 // 4105 // 1. The entire cache object 4106 // 2. The data stored at the key 4107 // 4108 if ( key === undefined || 4109 ( ( key && typeof key === "string" ) && value === undefined ) ) { 4110 4111 return this.get( owner, key ); 4112 } 4113 4114 // When the key is not a string, or both a key and value 4115 // are specified, set or extend (existing objects) with either: 4116 // 4117 // 1. An object of properties 4118 // 2. A key and value 4119 // 4120 this.set( owner, key, value ); 4121 4122 // Since the "set" path can have two possible entry points 4123 // return the expected data based on which path was taken[*] 4124 return value !== undefined ? value : key; 4125 }, 4126 remove: function( owner, key ) { 4127 var i, 4128 cache = owner[ this.expando ]; 4129 4130 if ( cache === undefined ) { 4131 return; 4132 } 4133 4134 if ( key !== undefined ) { 4135 4136 // Support array or space separated string of keys 4137 if ( Array.isArray( key ) ) { 4138 4139 // If key is an array of keys... 4140 // We always set camelCase keys, so remove that. 4141 key = key.map( camelCase ); 4142 } else { 4143 key = camelCase( key ); 4144 4145 // If a key with the spaces exists, use it. 4146 // Otherwise, create an array by matching non-whitespace 4147 key = key in cache ? 4148 [ key ] : 4149 ( key.match( rnothtmlwhite ) || [] ); 4150 } 4151 4152 i = key.length; 4153 4154 while ( i-- ) { 4155 delete cache[ key[ i ] ]; 4156 } 4157 } 4158 4159 // Remove the expando if there's no more data
vendor: 4,195 bytes, lines 4160-4318
4160 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 4161 4162 // Support: Chrome <=35 - 45 4163 // Webkit & Blink performance suffers when deleting properties 4164 // from DOM nodes, so set to undefined instead 4165 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 4166 if ( owner.nodeType ) { 4167 owner[ this.expando ] = undefined; 4168 } else { 4169 delete owner[ this.expando ]; 4170 } 4171 } 4172 }, 4173 hasData: function( owner ) { 4174 var cache = owner[ this.expando ]; 4175 return cache !== undefined && !jQuery.isEmptyObject( cache ); 4176 } 4177}; 4178var dataPriv = new Data(); 4179 4180var dataUser = new Data(); 4181 4182 4183 4184// Implementation Summary 4185// 4186// 1. Enforce API surface and semantic compatibility with 1.9.x branch 4187// 2. Improve the module's maintainability by reducing the storage 4188// paths to a single mechanism. 4189// 3. Use the same single mechanism to support "private" and "user" data. 4190// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 4191// 5. Avoid exposing implementation details on user objects (eg. expando properties) 4192// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 4193 4194var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 4195 rmultiDash = /[A-Z]/g; 4196 4197function getData( data ) { 4198 if ( data === "true" ) { 4199 return true; 4200 } 4201 4202 if ( data === "false" ) { 4203 return false; 4204 } 4205 4206 if ( data === "null" ) { 4207 return null; 4208 } 4209 4210 // Only convert to a number if it doesn't change the string 4211 if ( data === +data + "" ) { 4212 return +data; 4213 } 4214 4215 if ( rbrace.test( data ) ) { 4216 return JSON.parse( data ); 4217 } 4218 4219 return data; 4220} 4221 4222function dataAttr( elem, key, data ) { 4223 var name; 4224 4225 // If nothing was found internally, try to fetch any 4226 // data from the HTML5 data-* attribute 4227 if ( data === undefined && elem.nodeType === 1 ) { 4228 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 4229 data = elem.getAttribute( name ); 4230 4231 if ( typeof data === "string" ) { 4232 try { 4233 data = getData( data ); 4234 } catch ( e ) {} 4235 4236 // Make sure we set the data so it isn't changed later 4237 dataUser.set( elem, key, data ); 4238 } else { 4239 data = undefined; 4240 } 4241 } 4242 return data; 4243} 4244 4245jQuery.extend( { 4246 hasData: function( elem ) { 4247 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 4248 }, 4249 4250 data: function( elem, name, data ) { 4251 return dataUser.access( elem, name, data ); 4252 }, 4253 4254 removeData: function( elem, name ) { 4255 dataUser.remove( elem, name ); 4256 }, 4257 4258 // TODO: Now that all calls to _data and _removeData have been replaced 4259 // with direct calls to dataPriv methods, these can be deprecated. 4260 _data: function( elem, name, data ) { 4261 return dataPriv.access( elem, name, data ); 4262 }, 4263 4264 _removeData: function( elem, name ) { 4265 dataPriv.remove( elem, name ); 4266 } 4267} ); 4268 4269jQuery.fn.extend( { 4270 data: function( key, value ) { 4271 var i, name, data, 4272 elem = this[ 0 ], 4273 attrs = elem && elem.attributes; 4274 4275 // Gets all values 4276 if ( key === undefined ) { 4277 if ( this.length ) { 4278 data = dataUser.get( elem ); 4279 4280 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 4281 i = attrs.length; 4282 while ( i-- ) { 4283 4284 // Support: IE 11 only 4285 // The attrs elements can be null (#14894) 4286 if ( attrs[ i ] ) { 4287 name = attrs[ i ].name; 4288 if ( name.indexOf( "data-" ) === 0 ) { 4289 name = camelCase( name.slice( 5 ) ); 4290 dataAttr( elem, name, data[ name ] ); 4291 } 4292 } 4293 } 4294 dataPriv.set( elem, "hasDataAttrs", true ); 4295 } 4296 } 4297 4298 return data; 4299 } 4300 4301 // Sets multiple values 4302 if ( typeof key === "object" ) { 4303 return this.each( function() { 4304 dataUser.set( this, key ); 4305 } ); 4306 } 4307 4308 return access( this, function( value ) { 4309 var data; 4310 4311 // The calling jQuery object (element matches) is not empty 4312 // (and therefore has an element appears at this[ 0 ]) and the 4313 // `value` parameter was not undefined. An empty jQuery object 4314 // will result in `undefined` for elem = this[ 0 ] which will 4315 // throw an exception if an attempt to read a data cache is made. 4316 if ( elem && value === undefined ) { 4317 4318 // Attempt to get data from the cache
vendor: 7,861 bytes, lines 4319-4629
4319 // The key will always be camelCased in Data 4320 data = dataUser.get( elem, key ); 4321 if ( data !== undefined ) { 4322 return data; 4323 } 4324 4325 // Attempt to "discover" the data in 4326 // HTML5 custom data-* attrs 4327 data = dataAttr( elem, key ); 4328 if ( data !== undefined ) { 4329 return data; 4330 } 4331 4332 // We tried really hard, but the data doesn't exist. 4333 return; 4334 } 4335 4336 // Set the data... 4337 this.each( function() { 4338 4339 // We always store the camelCased key 4340 dataUser.set( this, key, value ); 4341 } ); 4342 }, null, value, arguments.length > 1, null, true ); 4343 }, 4344 4345 removeData: function( key ) { 4346 return this.each( function() { 4347 dataUser.remove( this, key ); 4348 } ); 4349 } 4350} ); 4351 4352 4353jQuery.extend( { 4354 queue: function( elem, type, data ) { 4355 var queue; 4356 4357 if ( elem ) { 4358 type = ( type || "fx" ) + "queue"; 4359 queue = dataPriv.get( elem, type ); 4360 4361 // Speed up dequeue by getting out quickly if this is just a lookup 4362 if ( data ) { 4363 if ( !queue || Array.isArray( data ) ) { 4364 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 4365 } else { 4366 queue.push( data ); 4367 } 4368 } 4369 return queue || []; 4370 } 4371 }, 4372 4373 dequeue: function( elem, type ) { 4374 type = type || "fx"; 4375 4376 var queue = jQuery.queue( elem, type ), 4377 startLength = queue.length, 4378 fn = queue.shift(), 4379 hooks = jQuery._queueHooks( elem, type ), 4380 next = function() { 4381 jQuery.dequeue( elem, type ); 4382 }; 4383 4384 // If the fx queue is dequeued, always remove the progress sentinel 4385 if ( fn === "inprogress" ) { 4386 fn = queue.shift(); 4387 startLength--; 4388 } 4389 4390 if ( fn ) { 4391 4392 // Add a progress sentinel to prevent the fx queue from being 4393 // automatically dequeued 4394 if ( type === "fx" ) { 4395 queue.unshift( "inprogress" ); 4396 } 4397 4398 // Clear up the last queue stop function 4399 delete hooks.stop; 4400 fn.call( elem, next, hooks ); 4401 } 4402 4403 if ( !startLength && hooks ) { 4404 hooks.empty.fire(); 4405 } 4406 }, 4407 4408 // Not public - generate a queueHooks object, or return the current one 4409 _queueHooks: function( elem, type ) { 4410 var key = type + "queueHooks"; 4411 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 4412 empty: jQuery.Callbacks( "once memory" ).add( function() { 4413 dataPriv.remove( elem, [ type + "queue", key ] ); 4414 } ) 4415 } ); 4416 } 4417} ); 4418 4419jQuery.fn.extend( { 4420 queue: function( type, data ) { 4421 var setter = 2; 4422 4423 if ( typeof type !== "string" ) { 4424 data = type; 4425 type = "fx"; 4426 setter--; 4427 } 4428 4429 if ( arguments.length < setter ) { 4430 return jQuery.queue( this[ 0 ], type ); 4431 } 4432 4433 return data === undefined ? 4434 this : 4435 this.each( function() { 4436 var queue = jQuery.queue( this, type, data ); 4437 4438 // Ensure a hooks for this queue 4439 jQuery._queueHooks( this, type ); 4440 4441 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4442 jQuery.dequeue( this, type ); 4443 } 4444 } ); 4445 }, 4446 dequeue: function( type ) { 4447 return this.each( function() { 4448 jQuery.dequeue( this, type ); 4449 } ); 4450 }, 4451 clearQueue: function( type ) { 4452 return this.queue( type || "fx", [] ); 4453 }, 4454 4455 // Get a promise resolved when queues of a certain type 4456 // are emptied (fx is the type by default) 4457 promise: function( type, obj ) { 4458 var tmp, 4459 count = 1, 4460 defer = jQuery.Deferred(), 4461 elements = this, 4462 i = this.length, 4463 resolve = function() { 4464 if ( !( --count ) ) { 4465 defer.resolveWith( elements, [ elements ] ); 4466 } 4467 }; 4468 4469 if ( typeof type !== "string" ) { 4470 obj = type; 4471 type = undefined; 4472 } 4473 type = type || "fx"; 4474 4475 while ( i-- ) { 4476 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 4477 if ( tmp && tmp.empty ) { 4478 count++; 4479 tmp.empty.add( resolve ); 4480 } 4481 } 4482 resolve(); 4483 return defer.promise( obj ); 4484 } 4485} ); 4486var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4487 4488var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4489 4490 4491var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4492 4493var documentElement = document.documentElement; 4494 4495 4496 4497 var isAttached = function( elem ) { 4498 return jQuery.contains( elem.ownerDocument, elem ); 4499 }, 4500 composed = { composed: true }; 4501 4502 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 4503 // Check attachment across shadow DOM boundaries when possible (gh-3504) 4504 // Support: iOS 10.0-10.2 only 4505 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 4506 // leading to errors. We need to check for `getRootNode`. 4507 if ( documentElement.getRootNode ) { 4508 isAttached = function( elem ) { 4509 return jQuery.contains( elem.ownerDocument, elem ) || 4510 elem.getRootNode( composed ) === elem.ownerDocument; 4511 }; 4512 } 4513var isHiddenWithinTree = function( elem, el ) { 4514 4515 // isHiddenWithinTree might be called from jQuery#filter function; 4516 // in that case, element will be second argument 4517 elem = el || elem; 4518 4519 // Inline style trumps all 4520 return elem.style.display === "none" || 4521 elem.style.display === "" && 4522 4523 // Otherwise, check computed style 4524 // Support: Firefox <=43 - 45 4525 // Disconnected elements can have computed display: none, so first confirm that elem is 4526 // in the document. 4527 isAttached( elem ) && 4528 4529 jQuery.css( elem, "display" ) === "none"; 4530 }; 4531 4532var swap = function( elem, options, callback, args ) { 4533 var ret, name, 4534 old = {}; 4535 4536 // Remember the old values, and insert the new ones 4537 for ( name in options ) { 4538 old[ name ] = elem.style[ name ]; 4539 elem.style[ name ] = options[ name ]; 4540 } 4541 4542 ret = callback.apply( elem, args || [] ); 4543 4544 // Revert the old values 4545 for ( name in options ) { 4546 elem.style[ name ] = old[ name ]; 4547 } 4548 4549 return ret; 4550}; 4551 4552 4553 4554 4555function adjustCSS( elem, prop, valueParts, tween ) { 4556 var adjusted, scale, 4557 maxIterations = 20, 4558 currentValue = tween ? 4559 function() { 4560 return tween.cur(); 4561 } : 4562 function() { 4563 return jQuery.css( elem, prop, "" ); 4564 }, 4565 initial = currentValue(), 4566 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4567 4568 // Starting value computation is required for potential unit mismatches 4569 initialInUnit = elem.nodeType && 4570 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4571 rcssNum.exec( jQuery.css( elem, prop ) ); 4572 4573 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4574 4575 // Support: Firefox <=54 4576 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 4577 initial = initial / 2; 4578 4579 // Trust units reported by jQuery.css 4580 unit = unit || initialInUnit[ 3 ]; 4581 4582 // Iteratively approximate from a nonzero starting point 4583 initialInUnit = +initial || 1; 4584 4585 while ( maxIterations-- ) { 4586 4587 // Evaluate and update our best guess (doubling guesses that zero out). 4588 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 4589 jQuery.style( elem, prop, initialInUnit + unit ); 4590 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 4591 maxIterations = 0; 4592 } 4593 initialInUnit = initialInUnit / scale; 4594 4595 } 4596 4597 initialInUnit = initialInUnit * 2; 4598 jQuery.style( elem, prop, initialInUnit + unit ); 4599 4600 // Make sure we update the tween properties later on 4601 valueParts = valueParts || []; 4602 } 4603 4604 if ( valueParts ) { 4605 initialInUnit = +initialInUnit || +initial || 0; 4606 4607 // Apply relative offset (+=/-=) if specified 4608 adjusted = valueParts[ 1 ] ? 4609 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4610 +valueParts[ 2 ]; 4611 if ( tween ) { 4612 tween.unit = unit; 4613 tween.start = initialInUnit; 4614 tween.end = adjusted; 4615 } 4616 } 4617 return adjusted; 4618} 4619 4620 4621var defaultDisplayMap = {}; 4622 4623function getDefaultDisplay( elem ) { 4624 var temp, 4625 doc = elem.ownerDocument, 4626 nodeName = elem.nodeName, 4627 display = defaultDisplayMap[ nodeName ]; 4628 4629 if ( display ) {
vendor: 4,208 bytes, lines 4630-4802
4630 return display; 4631 } 4632 4633 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 4634 display = jQuery.css( temp, "display" ); 4635 4636 temp.parentNode.removeChild( temp ); 4637 4638 if ( display === "none" ) { 4639 display = "block"; 4640 } 4641 defaultDisplayMap[ nodeName ] = display; 4642 4643 return display; 4644} 4645 4646function showHide( elements, show ) { 4647 var display, elem, 4648 values = [], 4649 index = 0, 4650 length = elements.length; 4651 4652 // Determine new display value for elements that need to change 4653 for ( ; index < length; index++ ) { 4654 elem = elements[ index ]; 4655 if ( !elem.style ) { 4656 continue; 4657 } 4658 4659 display = elem.style.display; 4660 if ( show ) { 4661 4662 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 4663 // check is required in this first loop unless we have a nonempty display value (either 4664 // inline or about-to-be-restored) 4665 if ( display === "none" ) { 4666 values[ index ] = dataPriv.get( elem, "display" ) || null; 4667 if ( !values[ index ] ) { 4668 elem.style.display = ""; 4669 } 4670 } 4671 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 4672 values[ index ] = getDefaultDisplay( elem ); 4673 } 4674 } else { 4675 if ( display !== "none" ) { 4676 values[ index ] = "none"; 4677 4678 // Remember what we're overwriting 4679 dataPriv.set( elem, "display", display ); 4680 } 4681 } 4682 } 4683 4684 // Set the display of the elements in a second loop to avoid constant reflow 4685 for ( index = 0; index < length; index++ ) { 4686 if ( values[ index ] != null ) { 4687 elements[ index ].style.display = values[ index ]; 4688 } 4689 } 4690 4691 return elements; 4692} 4693 4694jQuery.fn.extend( { 4695 show: function() { 4696 return showHide( this, true ); 4697 }, 4698 hide: function() { 4699 return showHide( this ); 4700 }, 4701 toggle: function( state ) { 4702 if ( typeof state === "boolean" ) { 4703 return state ? this.show() : this.hide(); 4704 } 4705 4706 return this.each( function() { 4707 if ( isHiddenWithinTree( this ) ) { 4708 jQuery( this ).show(); 4709 } else { 4710 jQuery( this ).hide(); 4711 } 4712 } ); 4713 } 4714} ); 4715var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4716 4717var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 4718 4719var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 4720 4721 4722 4723// We have to close these tags to support XHTML (#13200) 4724var wrapMap = { 4725 4726 // Support: IE <=9 only 4727 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4728 4729 // XHTML parsers do not magically insert elements in the 4730 // same way that tag soup parsers do. So we cannot shorten 4731 // this by omitting <tbody> or other required elements. 4732 thead: [ 1, "<table>", "</table>" ], 4733 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4734 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4735 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4736 4737 _default: [ 0, "", "" ] 4738}; 4739 4740// Support: IE <=9 only 4741wrapMap.optgroup = wrapMap.option; 4742 4743wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4744wrapMap.th = wrapMap.td; 4745 4746 4747function getAll( context, tag ) { 4748 4749 // Support: IE <=9 - 11 only 4750 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 4751 var ret; 4752 4753 if ( typeof context.getElementsByTagName !== "undefined" ) { 4754 ret = context.getElementsByTagName( tag || "*" ); 4755 4756 } else if ( typeof context.querySelectorAll !== "undefined" ) { 4757 ret = context.querySelectorAll( tag || "*" ); 4758 4759 } else { 4760 ret = []; 4761 } 4762 4763 if ( tag === undefined || tag && nodeName( context, tag ) ) { 4764 return jQuery.merge( [ context ], ret ); 4765 } 4766 4767 return ret; 4768} 4769 4770 4771// Mark scripts as having already been evaluated 4772function setGlobalEval( elems, refElements ) { 4773 var i = 0, 4774 l = elems.length; 4775 4776 for ( ; i < l; i++ ) { 4777 dataPriv.set( 4778 elems[ i ], 4779 "globalEval", 4780 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 4781 ); 4782 } 4783} 4784 4785 4786var rhtml = /<|&#?\w+;/; 4787 4788function buildFragment( elems, context, scripts, selection, ignored ) { 4789 var elem, tmp, tag, wrap, attached, j, 4790 fragment = context.createDocumentFragment(), 4791 nodes = [], 4792 i = 0, 4793 l = elems.length; 4794 4795 for ( ; i < l; i++ ) { 4796 elem = elems[ i ]; 4797 4798 if ( elem || elem === 0 ) { 4799 4800 // Add nodes directly 4801 if ( toType( elem ) === "object" ) { 4802
vendor: 2,455 bytes, lines 4803-4893
4803 // Support: Android <=4.0 only, PhantomJS 1 only 4804 // push.apply(_, arraylike) throws on ancient WebKit 4805 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4806 4807 // Convert non-html into a text node 4808 } else if ( !rhtml.test( elem ) ) { 4809 nodes.push( context.createTextNode( elem ) ); 4810 4811 // Convert html into DOM nodes 4812 } else { 4813 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 4814 4815 // Deserialize a standard representation 4816 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4817 wrap = wrapMap[ tag ] || wrapMap._default; 4818 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4819 4820 // Descend through wrappers to the right content 4821 j = wrap[ 0 ]; 4822 while ( j-- ) { 4823 tmp = tmp.lastChild; 4824 } 4825 4826 // Support: Android <=4.0 only, PhantomJS 1 only 4827 // push.apply(_, arraylike) throws on ancient WebKit 4828 jQuery.merge( nodes, tmp.childNodes ); 4829 4830 // Remember the top-level container 4831 tmp = fragment.firstChild; 4832 4833 // Ensure the created nodes are orphaned (#12392) 4834 tmp.textContent = ""; 4835 } 4836 } 4837 } 4838 4839 // Remove wrapper from fragment 4840 fragment.textContent = ""; 4841 4842 i = 0; 4843 while ( ( elem = nodes[ i++ ] ) ) { 4844 4845 // Skip elements already in the context collection (trac-4087) 4846 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4847 if ( ignored ) { 4848 ignored.push( elem ); 4849 } 4850 continue; 4851 } 4852 4853 attached = isAttached( elem ); 4854 4855 // Append to fragment 4856 tmp = getAll( fragment.appendChild( elem ), "script" ); 4857 4858 // Preserve script evaluation history 4859 if ( attached ) { 4860 setGlobalEval( tmp ); 4861 } 4862 4863 // Capture executables 4864 if ( scripts ) { 4865 j = 0; 4866 while ( ( elem = tmp[ j++ ] ) ) { 4867 if ( rscriptType.test( elem.type || "" ) ) { 4868 scripts.push( elem ); 4869 } 4870 } 4871 } 4872 } 4873 4874 return fragment; 4875} 4876 4877 4878( function() { 4879 var fragment = document.createDocumentFragment(), 4880 div = fragment.appendChild( document.createElement( "div" ) ), 4881 input = document.createElement( "input" ); 4882 4883 // Support: Android 4.0 - 4.3 only 4884 // Check state lost if the name is set (#11217) 4885 // Support: Windows Web Apps (WWA) 4886 // `name` and `type` must use .setAttribute for WWA (#14901) 4887 input.setAttribute( "type", "radio" ); 4888 input.setAttribute( "checked", "checked" ); 4889 input.setAttribute( "name", "t" ); 4890 4891 div.appendChild( input ); 4892 4893 // Support: Android <=4.1 only
vendor: 6,798 bytes, lines 4894-5130
4894 // Older WebKit doesn't clone checked state correctly in fragments 4895 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4896 4897 // Support: IE <=11 only 4898 // Make sure textarea (and checkbox) defaultValue is properly cloned 4899 div.innerHTML = "<textarea>x</textarea>"; 4900 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4901} )(); 4902 4903 4904var 4905 rkeyEvent = /^key/, 4906 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4907 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4908 4909function returnTrue() { 4910 return true; 4911} 4912 4913function returnFalse() { 4914 return false; 4915} 4916 4917// Support: IE <=9 - 11+ 4918// focus() and blur() are asynchronous, except when they are no-op. 4919// So expect focus to be synchronous when the element is already active, 4920// and blur to be synchronous when the element is not already active. 4921// (focus and blur are always synchronous in other supported browsers, 4922// this just defines when we can count on it). 4923function expectSync( elem, type ) { 4924 return ( elem === safeActiveElement() ) === ( type === "focus" ); 4925} 4926 4927// Support: IE <=9 only 4928// Accessing document.activeElement can throw unexpectedly 4929// https://bugs.jquery.com/ticket/13393 4930function safeActiveElement() { 4931 try { 4932 return document.activeElement; 4933 } catch ( err ) { } 4934} 4935 4936function on( elem, types, selector, data, fn, one ) { 4937 var origFn, type; 4938 4939 // Types can be a map of types/handlers 4940 if ( typeof types === "object" ) { 4941 4942 // ( types-Object, selector, data ) 4943 if ( typeof selector !== "string" ) { 4944 4945 // ( types-Object, data ) 4946 data = data || selector; 4947 selector = undefined; 4948 } 4949 for ( type in types ) { 4950 on( elem, type, selector, data, types[ type ], one ); 4951 } 4952 return elem; 4953 } 4954 4955 if ( data == null && fn == null ) { 4956 4957 // ( types, fn ) 4958 fn = selector; 4959 data = selector = undefined; 4960 } else if ( fn == null ) { 4961 if ( typeof selector === "string" ) { 4962 4963 // ( types, selector, fn ) 4964 fn = data; 4965 data = undefined; 4966 } else { 4967 4968 // ( types, data, fn ) 4969 fn = data; 4970 data = selector; 4971 selector = undefined; 4972 } 4973 } 4974 if ( fn === false ) { 4975 fn = returnFalse; 4976 } else if ( !fn ) { 4977 return elem; 4978 } 4979 4980 if ( one === 1 ) { 4981 origFn = fn; 4982 fn = function( event ) { 4983 4984 // Can use an empty set, since event contains the info 4985 jQuery().off( event ); 4986 return origFn.apply( this, arguments ); 4987 }; 4988 4989 // Use same guid so caller can remove using origFn 4990 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4991 } 4992 return elem.each( function() { 4993 jQuery.event.add( this, types, fn, data, selector ); 4994 } ); 4995} 4996 4997/* 4998 * Helper functions for managing events -- not part of the public interface. 4999 * Props to Dean Edwards' addEvent library for many of the ideas. 5000 */ 5001jQuery.event = { 5002 5003 global: {}, 5004 5005 add: function( elem, types, handler, data, selector ) { 5006 5007 var handleObjIn, eventHandle, tmp, 5008 events, t, handleObj, 5009 special, handlers, type, namespaces, origType, 5010 elemData = dataPriv.get( elem ); 5011 5012 // Don't attach events to noData or text/comment nodes (but allow plain objects) 5013 if ( !elemData ) { 5014 return; 5015 } 5016 5017 // Caller can pass in an object of custom data in lieu of the handler 5018 if ( handler.handler ) { 5019 handleObjIn = handler; 5020 handler = handleObjIn.handler; 5021 selector = handleObjIn.selector; 5022 } 5023 5024 // Ensure that invalid selectors throw exceptions at attach time 5025 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 5026 if ( selector ) { 5027 jQuery.find.matchesSelector( documentElement, selector ); 5028 } 5029 5030 // Make sure that the handler has a unique ID, used to find/remove it later 5031 if ( !handler.guid ) { 5032 handler.guid = jQuery.guid++; 5033 } 5034 5035 // Init the element's event structure and main handler, if this is the first 5036 if ( !( events = elemData.events ) ) { 5037 events = elemData.events = {}; 5038 } 5039 if ( !( eventHandle = elemData.handle ) ) { 5040 eventHandle = elemData.handle = function( e ) { 5041 5042 // Discard the second event of a jQuery.event.trigger() and 5043 // when an event is called after a page has unloaded 5044 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 5045 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 5046 }; 5047 } 5048 5049 // Handle multiple events separated by a space 5050 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 5051 t = types.length; 5052 while ( t-- ) { 5053 tmp = rtypenamespace.exec( types[ t ] ) || []; 5054 type = origType = tmp[ 1 ]; 5055 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 5056 5057 // There *must* be a type, no attaching namespace-only handlers 5058 if ( !type ) { 5059 continue; 5060 } 5061 5062 // If event changes its type, use the special event handlers for the changed type 5063 special = jQuery.event.special[ type ] || {}; 5064 5065 // If selector defined, determine special event api type, otherwise given type 5066 type = ( selector ? special.delegateType : special.bindType ) || type; 5067 5068 // Update special based on newly reset type 5069 special = jQuery.event.special[ type ] || {}; 5070 5071 // handleObj is passed to all event handlers 5072 handleObj = jQuery.extend( { 5073 type: type, 5074 origType: origType, 5075 data: data, 5076 handler: handler, 5077 guid: handler.guid, 5078 selector: selector, 5079 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 5080 namespace: namespaces.join( "." ) 5081 }, handleObjIn ); 5082 5083 // Init the event handler queue if we're the first 5084 if ( !( handlers = events[ type ] ) ) { 5085 handlers = events[ type ] = []; 5086 handlers.delegateCount = 0; 5087 5088 // Only use addEventListener if the special events handler returns false 5089 if ( !special.setup || 5090 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 5091 5092 if ( elem.addEventListener ) { 5093 elem.addEventListener( type, eventHandle ); 5094 } 5095 } 5096 } 5097 5098 if ( special.add ) { 5099 special.add.call( elem, handleObj ); 5100 5101 if ( !handleObj.handler.guid ) { 5102 handleObj.handler.guid = handler.guid; 5103 } 5104 } 5105 5106 // Add to the element's handler list, delegates in front 5107 if ( selector ) { 5108 handlers.splice( handlers.delegateCount++, 0, handleObj ); 5109 } else { 5110 handlers.push( handleObj ); 5111 } 5112 5113 // Keep track of which events have ever been used, for event optimization 5114 jQuery.event.global[ type ] = true; 5115 } 5116 5117 }, 5118 5119 // Detach an event or set of events from an element 5120 remove: function( elem, types, handler, selector, mappedTypes ) { 5121 5122 var j, origCount, tmp, 5123 events, t, handleObj, 5124 special, handlers, type, namespaces, origType, 5125 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 5126 5127 if ( !elemData || !( events = elemData.events ) ) { 5128 return; 5129 } 5130
vendor: 4,308 bytes, lines 5131-5266
5131 // Once for each type.namespace in types; type may be omitted 5132 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 5133 t = types.length; 5134 while ( t-- ) { 5135 tmp = rtypenamespace.exec( types[ t ] ) || []; 5136 type = origType = tmp[ 1 ]; 5137 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 5138 5139 // Unbind all events (on this namespace, if provided) for the element 5140 if ( !type ) { 5141 for ( type in events ) { 5142 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 5143 } 5144 continue; 5145 } 5146 5147 special = jQuery.event.special[ type ] || {}; 5148 type = ( selector ? special.delegateType : special.bindType ) || type; 5149 handlers = events[ type ] || []; 5150 tmp = tmp[ 2 ] && 5151 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 5152 5153 // Remove matching events 5154 origCount = j = handlers.length; 5155 while ( j-- ) { 5156 handleObj = handlers[ j ]; 5157 5158 if ( ( mappedTypes || origType === handleObj.origType ) && 5159 ( !handler || handler.guid === handleObj.guid ) && 5160 ( !tmp || tmp.test( handleObj.namespace ) ) && 5161 ( !selector || selector === handleObj.selector || 5162 selector === "**" && handleObj.selector ) ) { 5163 handlers.splice( j, 1 ); 5164 5165 if ( handleObj.selector ) { 5166 handlers.delegateCount--; 5167 } 5168 if ( special.remove ) { 5169 special.remove.call( elem, handleObj ); 5170 } 5171 } 5172 } 5173 5174 // Remove generic event handler if we removed something and no more handlers exist 5175 // (avoids potential for endless recursion during removal of special event handlers) 5176 if ( origCount && !handlers.length ) { 5177 if ( !special.teardown || 5178 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5179 5180 jQuery.removeEvent( elem, type, elemData.handle ); 5181 } 5182 5183 delete events[ type ]; 5184 } 5185 } 5186 5187 // Remove data and the expando if it's no longer used 5188 if ( jQuery.isEmptyObject( events ) ) { 5189 dataPriv.remove( elem, "handle events" ); 5190 } 5191 }, 5192 5193 dispatch: function( nativeEvent ) { 5194 5195 // Make a writable jQuery.Event from the native event object 5196 var event = jQuery.event.fix( nativeEvent ); 5197 5198 var i, j, ret, matched, handleObj, handlerQueue, 5199 args = new Array( arguments.length ), 5200 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], 5201 special = jQuery.event.special[ event.type ] || {}; 5202 5203 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5204 args[ 0 ] = event; 5205 5206 for ( i = 1; i < arguments.length; i++ ) { 5207 args[ i ] = arguments[ i ]; 5208 } 5209 5210 event.delegateTarget = this; 5211 5212 // Call the preDispatch hook for the mapped type, and let it bail if desired 5213 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 5214 return; 5215 } 5216 5217 // Determine handlers 5218 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 5219 5220 // Run delegates first; they may want to stop propagation beneath us 5221 i = 0; 5222 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 5223 event.currentTarget = matched.elem; 5224 5225 j = 0; 5226 while ( ( handleObj = matched.handlers[ j++ ] ) && 5227 !event.isImmediatePropagationStopped() ) { 5228 5229 // If the event is namespaced, then each handler is only invoked if it is 5230 // specially universal or its namespaces are a superset of the event's. 5231 if ( !event.rnamespace || handleObj.namespace === false || 5232 event.rnamespace.test( handleObj.namespace ) ) { 5233 5234 event.handleObj = handleObj; 5235 event.data = handleObj.data; 5236 5237 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 5238 handleObj.handler ).apply( matched.elem, args ); 5239 5240 if ( ret !== undefined ) { 5241 if ( ( event.result = ret ) === false ) { 5242 event.preventDefault(); 5243 event.stopPropagation(); 5244 } 5245 } 5246 } 5247 } 5248 } 5249 5250 // Call the postDispatch hook for the mapped type 5251 if ( special.postDispatch ) { 5252 special.postDispatch.call( this, event ); 5253 } 5254 5255 return event.result; 5256 }, 5257 5258 handlers: function( event, handlers ) { 5259 var i, handleObj, sel, matchedHandlers, matchedSelectors, 5260 handlerQueue = [], 5261 delegateCount = handlers.delegateCount, 5262 cur = event.target; 5263 5264 // Find delegate handlers 5265 if ( delegateCount && 5266
vendor: 8,294 bytes, lines 5267-5528
5267 // Support: IE <=9 5268 // Black-hole SVG <use> instance trees (trac-13180) 5269 cur.nodeType && 5270 5271 // Support: Firefox <=42 5272 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 5273 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 5274 // Support: IE 11 only 5275 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 5276 !( event.type === "click" && event.button >= 1 ) ) { 5277 5278 for ( ; cur !== this; cur = cur.parentNode || this ) { 5279 5280 // Don't check non-elements (#13208) 5281 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 5282 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 5283 matchedHandlers = []; 5284 matchedSelectors = {}; 5285 for ( i = 0; i < delegateCount; i++ ) { 5286 handleObj = handlers[ i ]; 5287 5288 // Don't conflict with Object.prototype properties (#13203) 5289 sel = handleObj.selector + " "; 5290 5291 if ( matchedSelectors[ sel ] === undefined ) { 5292 matchedSelectors[ sel ] = handleObj.needsContext ? 5293 jQuery( sel, this ).index( cur ) > -1 : 5294 jQuery.find( sel, this, null, [ cur ] ).length; 5295 } 5296 if ( matchedSelectors[ sel ] ) { 5297 matchedHandlers.push( handleObj ); 5298 } 5299 } 5300 if ( matchedHandlers.length ) { 5301 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 5302 } 5303 } 5304 } 5305 } 5306 5307 // Add the remaining (directly-bound) handlers 5308 cur = this; 5309 if ( delegateCount < handlers.length ) { 5310 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 5311 } 5312 5313 return handlerQueue; 5314 }, 5315 5316 addProp: function( name, hook ) { 5317 Object.defineProperty( jQuery.Event.prototype, name, { 5318 enumerable: true, 5319 configurable: true, 5320 5321 get: isFunction( hook ) ? 5322 function() { 5323 if ( this.originalEvent ) { 5324 return hook( this.originalEvent ); 5325 } 5326 } : 5327 function() { 5328 if ( this.originalEvent ) { 5329 return this.originalEvent[ name ]; 5330 } 5331 }, 5332 5333 set: function( value ) { 5334 Object.defineProperty( this, name, { 5335 enumerable: true, 5336 configurable: true, 5337 writable: true, 5338 value: value 5339 } ); 5340 } 5341 } ); 5342 }, 5343 5344 fix: function( originalEvent ) { 5345 return originalEvent[ jQuery.expando ] ? 5346 originalEvent : 5347 new jQuery.Event( originalEvent ); 5348 }, 5349 5350 special: { 5351 load: { 5352 5353 // Prevent triggered image.load events from bubbling to window.load 5354 noBubble: true 5355 }, 5356 click: { 5357 5358 // Utilize native event to ensure correct state for checkable inputs 5359 setup: function( data ) { 5360 5361 // For mutual compressibility with _default, replace `this` access with a local var. 5362 // `|| data` is dead code meant only to preserve the variable through minification. 5363 var el = this || data; 5364 5365 // Claim the first handler 5366 if ( rcheckableType.test( el.type ) && 5367 el.click && nodeName( el, "input" ) ) { 5368 5369 // dataPriv.set( el, "click", ... ) 5370 leverageNative( el, "click", returnTrue ); 5371 } 5372 5373 // Return false to allow normal processing in the caller 5374 return false; 5375 }, 5376 trigger: function( data ) { 5377 5378 // For mutual compressibility with _default, replace `this` access with a local var. 5379 // `|| data` is dead code meant only to preserve the variable through minification. 5380 var el = this || data; 5381 5382 // Force setup before triggering a click 5383 if ( rcheckableType.test( el.type ) && 5384 el.click && nodeName( el, "input" ) ) { 5385 5386 leverageNative( el, "click" ); 5387 } 5388 5389 // Return non-false to allow normal event-path propagation 5390 return true; 5391 }, 5392 5393 // For cross-browser consistency, suppress native .click() on links 5394 // Also prevent it if we're currently inside a leveraged native-event stack 5395 _default: function( event ) { 5396 var target = event.target; 5397 return rcheckableType.test( target.type ) && 5398 target.click && nodeName( target, "input" ) && 5399 dataPriv.get( target, "click" ) || 5400 nodeName( target, "a" ); 5401 } 5402 }, 5403 5404 beforeunload: { 5405 postDispatch: function( event ) { 5406 5407 // Support: Firefox 20+ 5408 // Firefox doesn't alert if the returnValue field is not set. 5409 if ( event.result !== undefined && event.originalEvent ) { 5410 event.originalEvent.returnValue = event.result; 5411 } 5412 } 5413 } 5414 } 5415}; 5416 5417// Ensure the presence of an event listener that handles manually-triggered 5418// synthetic events by interrupting progress until reinvoked in response to 5419// *native* events that it fires directly, ensuring that state changes have 5420// already occurred before other listeners are invoked. 5421function leverageNative( el, type, expectSync ) { 5422 5423 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 5424 if ( !expectSync ) { 5425 if ( dataPriv.get( el, type ) === undefined ) { 5426 jQuery.event.add( el, type, returnTrue ); 5427 } 5428 return; 5429 } 5430 5431 // Register the controller as a special universal handler for all event namespaces 5432 dataPriv.set( el, type, false ); 5433 jQuery.event.add( el, type, { 5434 namespace: false, 5435 handler: function( event ) { 5436 var notAsync, result, 5437 saved = dataPriv.get( this, type ); 5438 5439 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 5440 5441 // Interrupt processing of the outer synthetic .trigger()ed event 5442 // Saved data should be false in such cases, but might be a leftover capture object 5443 // from an async native handler (gh-4350) 5444 if ( !saved.length ) { 5445 5446 // Store arguments for use when handling the inner native event 5447 // There will always be at least one argument (an event object), so this array 5448 // will not be confused with a leftover capture object. 5449 saved = slice.call( arguments ); 5450 dataPriv.set( this, type, saved ); 5451 5452 // Trigger the native event and capture its result 5453 // Support: IE <=9 - 11+ 5454 // focus() and blur() are asynchronous 5455 notAsync = expectSync( this, type ); 5456 this[ type ](); 5457 result = dataPriv.get( this, type ); 5458 if ( saved !== result || notAsync ) { 5459 dataPriv.set( this, type, false ); 5460 } else { 5461 result = {}; 5462 } 5463 if ( saved !== result ) { 5464 5465 // Cancel the outer synthetic event 5466 event.stopImmediatePropagation(); 5467 event.preventDefault(); 5468 return result.value; 5469 } 5470 5471 // If this is an inner synthetic event for an event with a bubbling surrogate 5472 // (focus or blur), assume that the surrogate already propagated from triggering the 5473 // native event and prevent that from happening again here. 5474 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 5475 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 5476 // less bad than duplication. 5477 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 5478 event.stopPropagation(); 5479 } 5480 5481 // If this is a native event triggered above, everything is now in order 5482 // Fire an inner synthetic event with the original arguments 5483 } else if ( saved.length ) { 5484 5485 // ...and capture the result 5486 dataPriv.set( this, type, { 5487 value: jQuery.event.trigger( 5488 5489 // Support: IE <=9 - 11+ 5490 // Extend with the prototype to reset the above stopImmediatePropagation() 5491 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 5492 saved.slice( 1 ), 5493 this 5494 ) 5495 } ); 5496 5497 // Abort handling of the native event 5498 event.stopImmediatePropagation(); 5499 } 5500 } 5501 } ); 5502} 5503 5504jQuery.removeEvent = function( elem, type, handle ) { 5505 5506 // This "if" is needed for plain objects 5507 if ( elem.removeEventListener ) { 5508 elem.removeEventListener( type, handle ); 5509 } 5510}; 5511 5512jQuery.Event = function( src, props ) { 5513 5514 // Allow instantiation without the 'new' keyword 5515 if ( !( this instanceof jQuery.Event ) ) { 5516 return new jQuery.Event( src, props ); 5517 } 5518 5519 // Event object 5520 if ( src && src.type ) { 5521 this.originalEvent = src; 5522 this.type = src.type; 5523 5524 // Events bubbling up the document may have been marked as prevented 5525 // by a handler lower down the tree; reflect the correct value. 5526 this.isDefaultPrevented = src.defaultPrevented || 5527 src.defaultPrevented === undefined && 5528
vendor: 13,738 bytes, lines 5529-6044
5529 // Support: Android <=2.3 only 5530 src.returnValue === false ? 5531 returnTrue : 5532 returnFalse; 5533 5534 // Create target properties 5535 // Support: Safari <=6 - 7 only 5536 // Target should not be a text node (#504, #13143) 5537 this.target = ( src.target && src.target.nodeType === 3 ) ? 5538 src.target.parentNode : 5539 src.target; 5540 5541 this.currentTarget = src.currentTarget; 5542 this.relatedTarget = src.relatedTarget; 5543 5544 // Event type 5545 } else { 5546 this.type = src; 5547 } 5548 5549 // Put explicitly provided properties onto the event object 5550 if ( props ) { 5551 jQuery.extend( this, props ); 5552 } 5553 5554 // Create a timestamp if incoming event doesn't have one 5555 this.timeStamp = src && src.timeStamp || Date.now(); 5556 5557 // Mark it as fixed 5558 this[ jQuery.expando ] = true; 5559}; 5560 5561// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5562// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5563jQuery.Event.prototype = { 5564 constructor: jQuery.Event, 5565 isDefaultPrevented: returnFalse, 5566 isPropagationStopped: returnFalse, 5567 isImmediatePropagationStopped: returnFalse, 5568 isSimulated: false, 5569 5570 preventDefault: function() { 5571 var e = this.originalEvent; 5572 5573 this.isDefaultPrevented = returnTrue; 5574 5575 if ( e && !this.isSimulated ) { 5576 e.preventDefault(); 5577 } 5578 }, 5579 stopPropagation: function() { 5580 var e = this.originalEvent; 5581 5582 this.isPropagationStopped = returnTrue; 5583 5584 if ( e && !this.isSimulated ) { 5585 e.stopPropagation(); 5586 } 5587 }, 5588 stopImmediatePropagation: function() { 5589 var e = this.originalEvent; 5590 5591 this.isImmediatePropagationStopped = returnTrue; 5592 5593 if ( e && !this.isSimulated ) { 5594 e.stopImmediatePropagation(); 5595 } 5596 5597 this.stopPropagation(); 5598 } 5599}; 5600 5601// Includes all common event props including KeyEvent and MouseEvent specific props 5602jQuery.each( { 5603 altKey: true, 5604 bubbles: true, 5605 cancelable: true, 5606 changedTouches: true, 5607 ctrlKey: true, 5608 detail: true, 5609 eventPhase: true, 5610 metaKey: true, 5611 pageX: true, 5612 pageY: true, 5613 shiftKey: true, 5614 view: true, 5615 "char": true, 5616 code: true, 5617 charCode: true, 5618 key: true, 5619 keyCode: true, 5620 button: true, 5621 buttons: true, 5622 clientX: true, 5623 clientY: true, 5624 offsetX: true, 5625 offsetY: true, 5626 pointerId: true, 5627 pointerType: true, 5628 screenX: true, 5629 screenY: true, 5630 targetTouches: true, 5631 toElement: true, 5632 touches: true, 5633 5634 which: function( event ) { 5635 var button = event.button; 5636 5637 // Add which for key events 5638 if ( event.which == null && rkeyEvent.test( event.type ) ) { 5639 return event.charCode != null ? event.charCode : event.keyCode; 5640 } 5641 5642 // Add which for click: 1 === left; 2 === middle; 3 === right 5643 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 5644 if ( button & 1 ) { 5645 return 1; 5646 } 5647 5648 if ( button & 2 ) { 5649 return 3; 5650 } 5651 5652 if ( button & 4 ) { 5653 return 2; 5654 } 5655 5656 return 0; 5657 } 5658 5659 return event.which; 5660 } 5661}, jQuery.event.addProp ); 5662 5663jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 5664 jQuery.event.special[ type ] = { 5665 5666 // Utilize native event if possible so blur/focus sequence is correct 5667 setup: function() { 5668 5669 // Claim the first handler 5670 // dataPriv.set( this, "focus", ... ) 5671 // dataPriv.set( this, "blur", ... ) 5672 leverageNative( this, type, expectSync ); 5673 5674 // Return false to allow normal processing in the caller 5675 return false; 5676 }, 5677 trigger: function() { 5678 5679 // Force setup before trigger 5680 leverageNative( this, type ); 5681 5682 // Return non-false to allow normal event-path propagation 5683 return true; 5684 }, 5685 5686 delegateType: delegateType 5687 }; 5688} ); 5689 5690// Create mouseenter/leave events using mouseover/out and event-time checks 5691// so that event delegation works in jQuery. 5692// Do the same for pointerenter/pointerleave and pointerover/pointerout 5693// 5694// Support: Safari 7 only 5695// Safari sends mouseenter too often; see: 5696// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 5697// for the description of the bug (it existed in older Chrome versions as well). 5698jQuery.each( { 5699 mouseenter: "mouseover", 5700 mouseleave: "mouseout", 5701 pointerenter: "pointerover", 5702 pointerleave: "pointerout" 5703}, function( orig, fix ) { 5704 jQuery.event.special[ orig ] = { 5705 delegateType: fix, 5706 bindType: fix, 5707 5708 handle: function( event ) { 5709 var ret, 5710 target = this, 5711 related = event.relatedTarget, 5712 handleObj = event.handleObj; 5713 5714 // For mouseenter/leave call the handler if related is outside the target. 5715 // NB: No relatedTarget if the mouse left/entered the browser window 5716 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5717 event.type = handleObj.origType; 5718 ret = handleObj.handler.apply( this, arguments ); 5719 event.type = fix; 5720 } 5721 return ret; 5722 } 5723 }; 5724} ); 5725 5726jQuery.fn.extend( { 5727 5728 on: function( types, selector, data, fn ) { 5729 return on( this, types, selector, data, fn ); 5730 }, 5731 one: function( types, selector, data, fn ) { 5732 return on( this, types, selector, data, fn, 1 ); 5733 }, 5734 off: function( types, selector, fn ) { 5735 var handleObj, type; 5736 if ( types && types.preventDefault && types.handleObj ) { 5737 5738 // ( event ) dispatched jQuery.Event 5739 handleObj = types.handleObj; 5740 jQuery( types.delegateTarget ).off( 5741 handleObj.namespace ? 5742 handleObj.origType + "." + handleObj.namespace : 5743 handleObj.origType, 5744 handleObj.selector, 5745 handleObj.handler 5746 ); 5747 return this; 5748 } 5749 if ( typeof types === "object" ) { 5750 5751 // ( types-object [, selector] ) 5752 for ( type in types ) { 5753 this.off( type, selector, types[ type ] ); 5754 } 5755 return this; 5756 } 5757 if ( selector === false || typeof selector === "function" ) { 5758 5759 // ( types [, fn] ) 5760 fn = selector; 5761 selector = undefined; 5762 } 5763 if ( fn === false ) { 5764 fn = returnFalse; 5765 } 5766 return this.each( function() { 5767 jQuery.event.remove( this, types, fn, selector ); 5768 } ); 5769 } 5770} ); 5771 5772 5773var 5774 5775 /* eslint-disable max-len */ 5776 5777 // See https://github.com/eslint/eslint/issues/3229 5778 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, 5779 5780 /* eslint-enable */ 5781 5782 // Support: IE <=10 - 11, Edge 12 - 13 only 5783 // In IE/Edge using regex groups here causes severe slowdowns. 5784 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5785 rnoInnerhtml = /<script|<style|<link/i, 5786 5787 // checked="checked" or checked 5788 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5789 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 5790 5791// Prefer a tbody over its parent table for containing new rows 5792function manipulationTarget( elem, content ) { 5793 if ( nodeName( elem, "table" ) && 5794 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 5795 5796 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 5797 } 5798 5799 return elem; 5800} 5801 5802// Replace/restore the type attribute of script elements for safe DOM manipulation 5803function disableScript( elem ) { 5804 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 5805 return elem; 5806} 5807function restoreScript( elem ) { 5808 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 5809 elem.type = elem.type.slice( 5 ); 5810 } else { 5811 elem.removeAttribute( "type" ); 5812 } 5813 5814 return elem; 5815} 5816 5817function cloneCopyEvent( src, dest ) { 5818 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 5819 5820 if ( dest.nodeType !== 1 ) { 5821 return; 5822 } 5823 5824 // 1. Copy private data: events, handlers, etc. 5825 if ( dataPriv.hasData( src ) ) { 5826 pdataOld = dataPriv.access( src ); 5827 pdataCur = dataPriv.set( dest, pdataOld ); 5828 events = pdataOld.events; 5829 5830 if ( events ) { 5831 delete pdataCur.handle; 5832 pdataCur.events = {}; 5833 5834 for ( type in events ) { 5835 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5836 jQuery.event.add( dest, type, events[ type ][ i ] ); 5837 } 5838 } 5839 } 5840 } 5841 5842 // 2. Copy user data 5843 if ( dataUser.hasData( src ) ) { 5844 udataOld = dataUser.access( src ); 5845 udataCur = jQuery.extend( {}, udataOld ); 5846 5847 dataUser.set( dest, udataCur ); 5848 } 5849} 5850 5851// Fix IE bugs, see support tests 5852function fixInput( src, dest ) { 5853 var nodeName = dest.nodeName.toLowerCase(); 5854 5855 // Fails to persist the checked state of a cloned checkbox or radio button. 5856 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5857 dest.checked = src.checked; 5858 5859 // Fails to return the selected option to the default selected state when cloning options 5860 } else if ( nodeName === "input" || nodeName === "textarea" ) { 5861 dest.defaultValue = src.defaultValue; 5862 } 5863} 5864 5865function domManip( collection, args, callback, ignored ) { 5866 5867 // Flatten any nested arrays 5868 args = concat.apply( [], args ); 5869 5870 var fragment, first, scripts, hasScripts, node, doc, 5871 i = 0, 5872 l = collection.length, 5873 iNoClone = l - 1, 5874 value = args[ 0 ], 5875 valueIsFunction = isFunction( value ); 5876 5877 // We can't cloneNode fragments that contain checked, in WebKit 5878 if ( valueIsFunction || 5879 ( l > 1 && typeof value === "string" && 5880 !support.checkClone && rchecked.test( value ) ) ) { 5881 return collection.each( function( index ) { 5882 var self = collection.eq( index ); 5883 if ( valueIsFunction ) { 5884 args[ 0 ] = value.call( this, index, self.html() ); 5885 } 5886 domManip( self, args, callback, ignored ); 5887 } ); 5888 } 5889 5890 if ( l ) { 5891 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 5892 first = fragment.firstChild; 5893 5894 if ( fragment.childNodes.length === 1 ) { 5895 fragment = first; 5896 } 5897 5898 // Require either new content or an interest in ignored elements to invoke the callback 5899 if ( first || ignored ) { 5900 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 5901 hasScripts = scripts.length; 5902 5903 // Use the original fragment for the last item 5904 // instead of the first because it can end up 5905 // being emptied incorrectly in certain situations (#8070). 5906 for ( ; i < l; i++ ) { 5907 node = fragment; 5908 5909 if ( i !== iNoClone ) { 5910 node = jQuery.clone( node, true, true ); 5911 5912 // Keep references to cloned scripts for later restoration 5913 if ( hasScripts ) { 5914 5915 // Support: Android <=4.0 only, PhantomJS 1 only 5916 // push.apply(_, arraylike) throws on ancient WebKit 5917 jQuery.merge( scripts, getAll( node, "script" ) ); 5918 } 5919 } 5920 5921 callback.call( collection[ i ], node, i ); 5922 } 5923 5924 if ( hasScripts ) { 5925 doc = scripts[ scripts.length - 1 ].ownerDocument; 5926 5927 // Reenable scripts 5928 jQuery.map( scripts, restoreScript ); 5929 5930 // Evaluate executable scripts on first document insertion 5931 for ( i = 0; i < hasScripts; i++ ) { 5932 node = scripts[ i ]; 5933 if ( rscriptType.test( node.type || "" ) && 5934 !dataPriv.access( node, "globalEval" ) && 5935 jQuery.contains( doc, node ) ) { 5936 5937 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 5938 5939 // Optional AJAX dependency, but won't run scripts if not present 5940 if ( jQuery._evalUrl && !node.noModule ) { 5941 jQuery._evalUrl( node.src, { 5942 nonce: node.nonce || node.getAttribute( "nonce" ) 5943 } ); 5944 } 5945 } else { 5946 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 5947 } 5948 } 5949 } 5950 } 5951 } 5952 } 5953 5954 return collection; 5955} 5956 5957function remove( elem, selector, keepData ) { 5958 var node, 5959 nodes = selector ? jQuery.filter( selector, elem ) : elem, 5960 i = 0; 5961 5962 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 5963 if ( !keepData && node.nodeType === 1 ) { 5964 jQuery.cleanData( getAll( node ) ); 5965 } 5966 5967 if ( node.parentNode ) { 5968 if ( keepData && isAttached( node ) ) { 5969 setGlobalEval( getAll( node, "script" ) ); 5970 } 5971 node.parentNode.removeChild( node ); 5972 } 5973 } 5974 5975 return elem; 5976} 5977 5978jQuery.extend( { 5979 htmlPrefilter: function( html ) { 5980 return html.replace( rxhtmlTag, "<$1></$2>" ); 5981 }, 5982 5983 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 5984 var i, l, srcElements, destElements, 5985 clone = elem.cloneNode( true ), 5986 inPage = isAttached( elem ); 5987 5988 // Fix IE cloning issues 5989 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 5990 !jQuery.isXMLDoc( elem ) ) { 5991 5992 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 5993 destElements = getAll( clone ); 5994 srcElements = getAll( elem ); 5995 5996 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5997 fixInput( srcElements[ i ], destElements[ i ] ); 5998 } 5999 } 6000 6001 // Copy the events from the original to the clone 6002 if ( dataAndEvents ) { 6003 if ( deepDataAndEvents ) { 6004 srcElements = srcElements || getAll( elem ); 6005 destElements = destElements || getAll( clone ); 6006 6007 for ( i = 0, l = srcElements.length; i < l; i++ ) { 6008 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 6009 } 6010 } else { 6011 cloneCopyEvent( elem, clone ); 6012 } 6013 } 6014 6015 // Preserve script evaluation history 6016 destElements = getAll( clone, "script" ); 6017 if ( destElements.length > 0 ) { 6018 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 6019 } 6020 6021 // Return the cloned set 6022 return clone; 6023 }, 6024 6025 cleanData: function( elems ) { 6026 var data, elem, type, 6027 special = jQuery.event.special, 6028 i = 0; 6029 6030 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 6031 if ( acceptData( elem ) ) { 6032 if ( ( data = elem[ dataPriv.expando ] ) ) { 6033 if ( data.events ) { 6034 for ( type in data.events ) { 6035 if ( special[ type ] ) { 6036 jQuery.event.remove( elem, type ); 6037 6038 // This is a shortcut to avoid jQuery.event.remove's overhead 6039 } else { 6040 jQuery.removeEvent( elem, type, data.handle ); 6041 } 6042 } 6043 } 6044
vendor: 4,139 bytes, lines 6045-6209
6045 // Support: Chrome <=35 - 45+ 6046 // Assign undefined instead of using delete, see Data#remove 6047 elem[ dataPriv.expando ] = undefined; 6048 } 6049 if ( elem[ dataUser.expando ] ) { 6050 6051 // Support: Chrome <=35 - 45+ 6052 // Assign undefined instead of using delete, see Data#remove 6053 elem[ dataUser.expando ] = undefined; 6054 } 6055 } 6056 } 6057 } 6058} ); 6059 6060jQuery.fn.extend( { 6061 detach: function( selector ) { 6062 return remove( this, selector, true ); 6063 }, 6064 6065 remove: function( selector ) { 6066 return remove( this, selector ); 6067 }, 6068 6069 text: function( value ) { 6070 return access( this, function( value ) { 6071 return value === undefined ? 6072 jQuery.text( this ) : 6073 this.empty().each( function() { 6074 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6075 this.textContent = value; 6076 } 6077 } ); 6078 }, null, value, arguments.length ); 6079 }, 6080 6081 append: function() { 6082 return domManip( this, arguments, function( elem ) { 6083 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6084 var target = manipulationTarget( this, elem ); 6085 target.appendChild( elem ); 6086 } 6087 } ); 6088 }, 6089 6090 prepend: function() { 6091 return domManip( this, arguments, function( elem ) { 6092 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6093 var target = manipulationTarget( this, elem ); 6094 target.insertBefore( elem, target.firstChild ); 6095 } 6096 } ); 6097 }, 6098 6099 before: function() { 6100 return domManip( this, arguments, function( elem ) { 6101 if ( this.parentNode ) { 6102 this.parentNode.insertBefore( elem, this ); 6103 } 6104 } ); 6105 }, 6106 6107 after: function() { 6108 return domManip( this, arguments, function( elem ) { 6109 if ( this.parentNode ) { 6110 this.parentNode.insertBefore( elem, this.nextSibling ); 6111 } 6112 } ); 6113 }, 6114 6115 empty: function() { 6116 var elem, 6117 i = 0; 6118 6119 for ( ; ( elem = this[ i ] ) != null; i++ ) { 6120 if ( elem.nodeType === 1 ) { 6121 6122 // Prevent memory leaks 6123 jQuery.cleanData( getAll( elem, false ) ); 6124 6125 // Remove any remaining nodes 6126 elem.textContent = ""; 6127 } 6128 } 6129 6130 return this; 6131 }, 6132 6133 clone: function( dataAndEvents, deepDataAndEvents ) { 6134 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6135 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6136 6137 return this.map( function() { 6138 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 6139 } ); 6140 }, 6141 6142 html: function( value ) { 6143 return access( this, function( value ) { 6144 var elem = this[ 0 ] || {}, 6145 i = 0, 6146 l = this.length; 6147 6148 if ( value === undefined && elem.nodeType === 1 ) { 6149 return elem.innerHTML; 6150 } 6151 6152 // See if we can take a shortcut and just use innerHTML 6153 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 6154 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 6155 6156 value = jQuery.htmlPrefilter( value ); 6157 6158 try { 6159 for ( ; i < l; i++ ) { 6160 elem = this[ i ] || {}; 6161 6162 // Remove element nodes and prevent memory leaks 6163 if ( elem.nodeType === 1 ) { 6164 jQuery.cleanData( getAll( elem, false ) ); 6165 elem.innerHTML = value; 6166 } 6167 } 6168 6169 elem = 0; 6170 6171 // If using innerHTML throws an exception, use the fallback method 6172 } catch ( e ) {} 6173 } 6174 6175 if ( elem ) { 6176 this.empty().append( value ); 6177 } 6178 }, null, value, arguments.length ); 6179 }, 6180 6181 replaceWith: function() { 6182 var ignored = []; 6183 6184 // Make the changes, replacing each non-ignored context element with the new content 6185 return domManip( this, arguments, function( elem ) { 6186 var parent = this.parentNode; 6187 6188 if ( jQuery.inArray( this, ignored ) < 0 ) { 6189 jQuery.cleanData( getAll( this ) ); 6190 if ( parent ) { 6191 parent.replaceChild( elem, this ); 6192 } 6193 } 6194 6195 // Force callback invocation 6196 }, ignored ); 6197 } 6198} ); 6199 6200jQuery.each( { 6201 appendTo: "append", 6202 prependTo: "prepend", 6203 insertBefore: "before", 6204 insertAfter: "after", 6205 replaceAll: "replaceWith" 6206}, function( name, original ) { 6207 jQuery.fn[ name ] = function( selector ) { 6208 var elems, 6209 ret = [],
vendor: 10,935 bytes, lines 6210-6572
6210 insert = jQuery( selector ), 6211 last = insert.length - 1, 6212 i = 0; 6213 6214 for ( ; i <= last; i++ ) { 6215 elems = i === last ? this : this.clone( true ); 6216 jQuery( insert[ i ] )[ original ]( elems ); 6217 6218 // Support: Android <=4.0 only, PhantomJS 1 only 6219 // .get() because push.apply(_, arraylike) throws on ancient WebKit 6220 push.apply( ret, elems.get() ); 6221 } 6222 6223 return this.pushStack( ret ); 6224 }; 6225} ); 6226var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 6227 6228var getStyles = function( elem ) { 6229 6230 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 6231 // IE throws on elements created in popups 6232 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6233 var view = elem.ownerDocument.defaultView; 6234 6235 if ( !view || !view.opener ) { 6236 view = window; 6237 } 6238 6239 return view.getComputedStyle( elem ); 6240 }; 6241 6242var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 6243 6244 6245 6246( function() { 6247 6248 // Executing both pixelPosition & boxSizingReliable tests require only one layout 6249 // so they're executed at the same time to save the second computation. 6250 function computeStyleTests() { 6251 6252 // This is a singleton, we need to execute it only once 6253 if ( !div ) { 6254 return; 6255 } 6256 6257 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 6258 "margin-top:1px;padding:0;border:0"; 6259 div.style.cssText = 6260 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 6261 "margin:auto;border:1px;padding:1px;" + 6262 "width:60%;top:1%"; 6263 documentElement.appendChild( container ).appendChild( div ); 6264 6265 var divStyle = window.getComputedStyle( div ); 6266 pixelPositionVal = divStyle.top !== "1%"; 6267 6268 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 6269 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 6270 6271 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 6272 // Some styles come back with percentage values, even though they shouldn't 6273 div.style.right = "60%"; 6274 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 6275 6276 // Support: IE 9 - 11 only 6277 // Detect misreporting of content dimensions for box-sizing:border-box elements 6278 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 6279 6280 // Support: IE 9 only 6281 // Detect overflow:scroll screwiness (gh-3699) 6282 // Support: Chrome <=64 6283 // Don't get tricked when zoom affects offsetWidth (gh-4029) 6284 div.style.position = "absolute"; 6285 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 6286 6287 documentElement.removeChild( container ); 6288 6289 // Nullify the div so it wouldn't be stored in the memory and 6290 // it will also be a sign that checks already performed 6291 div = null; 6292 } 6293 6294 function roundPixelMeasures( measure ) { 6295 return Math.round( parseFloat( measure ) ); 6296 } 6297 6298 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 6299 reliableMarginLeftVal, 6300 container = document.createElement( "div" ), 6301 div = document.createElement( "div" ); 6302 6303 // Finish early in limited (non-browser) environments 6304 if ( !div.style ) { 6305 return; 6306 } 6307 6308 // Support: IE <=9 - 11 only 6309 // Style of cloned element affects source element cloned (#8908) 6310 div.style.backgroundClip = "content-box"; 6311 div.cloneNode( true ).style.backgroundClip = ""; 6312 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6313 6314 jQuery.extend( support, { 6315 boxSizingReliable: function() { 6316 computeStyleTests(); 6317 return boxSizingReliableVal; 6318 }, 6319 pixelBoxStyles: function() { 6320 computeStyleTests(); 6321 return pixelBoxStylesVal; 6322 }, 6323 pixelPosition: function() { 6324 computeStyleTests(); 6325 return pixelPositionVal; 6326 }, 6327 reliableMarginLeft: function() { 6328 computeStyleTests(); 6329 return reliableMarginLeftVal; 6330 }, 6331 scrollboxSize: function() { 6332 computeStyleTests(); 6333 return scrollboxSizeVal; 6334 } 6335 } ); 6336} )(); 6337 6338 6339function curCSS( elem, name, computed ) { 6340 var width, minWidth, maxWidth, ret, 6341 6342 // Support: Firefox 51+ 6343 // Retrieving style before computed somehow 6344 // fixes an issue with getting wrong values 6345 // on detached elements 6346 style = elem.style; 6347 6348 computed = computed || getStyles( elem ); 6349 6350 // getPropertyValue is needed for: 6351 // .css('filter') (IE 9 only, #12537) 6352 // .css('--customProperty) (#3144) 6353 if ( computed ) { 6354 ret = computed.getPropertyValue( name ) || computed[ name ]; 6355 6356 if ( ret === "" && !isAttached( elem ) ) { 6357 ret = jQuery.style( elem, name ); 6358 } 6359 6360 // A tribute to the "awesome hack by Dean Edwards" 6361 // Android Browser returns percentage for some values, 6362 // but width seems to be reliably pixels. 6363 // This is against the CSSOM draft spec: 6364 // https://drafts.csswg.org/cssom/#resolved-values 6365 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 6366 6367 // Remember the original values 6368 width = style.width; 6369 minWidth = style.minWidth; 6370 maxWidth = style.maxWidth; 6371 6372 // Put in the new values to get a computed value out 6373 style.minWidth = style.maxWidth = style.width = ret; 6374 ret = computed.width; 6375 6376 // Revert the changed values 6377 style.width = width; 6378 style.minWidth = minWidth; 6379 style.maxWidth = maxWidth; 6380 } 6381 } 6382 6383 return ret !== undefined ? 6384 6385 // Support: IE <=9 - 11 only 6386 // IE returns zIndex value as an integer. 6387 ret + "" : 6388 ret; 6389} 6390 6391 6392function addGetHookIf( conditionFn, hookFn ) { 6393 6394 // Define the hook, we'll check on the first run if it's really needed. 6395 return { 6396 get: function() { 6397 if ( conditionFn() ) { 6398 6399 // Hook not needed (or it's not possible to use it due 6400 // to missing dependency), remove it. 6401 delete this.get; 6402 return; 6403 } 6404 6405 // Hook needed; redefine it so that the support test is not executed again. 6406 return ( this.get = hookFn ).apply( this, arguments ); 6407 } 6408 }; 6409} 6410 6411 6412var cssPrefixes = [ "Webkit", "Moz", "ms" ], 6413 emptyStyle = document.createElement( "div" ).style, 6414 vendorProps = {}; 6415 6416// Return a vendor-prefixed property or undefined 6417function vendorPropName( name ) { 6418 6419 // Check for vendor prefixed names 6420 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 6421 i = cssPrefixes.length; 6422 6423 while ( i-- ) { 6424 name = cssPrefixes[ i ] + capName; 6425 if ( name in emptyStyle ) { 6426 return name; 6427 } 6428 } 6429} 6430 6431// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 6432function finalPropName( name ) { 6433 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 6434 6435 if ( final ) { 6436 return final; 6437 } 6438 if ( name in emptyStyle ) { 6439 return name; 6440 } 6441 return vendorProps[ name ] = vendorPropName( name ) || name; 6442} 6443 6444 6445var 6446 6447 // Swappable if display is none or starts with table 6448 // except "table", "table-cell", or "table-caption" 6449 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 6450 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6451 rcustomProp = /^--/, 6452 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6453 cssNormalTransform = { 6454 letterSpacing: "0", 6455 fontWeight: "400" 6456 }; 6457 6458function setPositiveNumber( elem, value, subtract ) { 6459 6460 // Any relative (+/-) values have already been 6461 // normalized at this point 6462 var matches = rcssNum.exec( value ); 6463 return matches ? 6464 6465 // Guard against undefined "subtract", e.g., when used as in cssHooks 6466 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 6467 value; 6468} 6469 6470function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 6471 var i = dimension === "width" ? 1 : 0, 6472 extra = 0, 6473 delta = 0; 6474 6475 // Adjustment may not be necessary 6476 if ( box === ( isBorderBox ? "border" : "content" ) ) { 6477 return 0; 6478 } 6479 6480 for ( ; i < 4; i += 2 ) { 6481 6482 // Both box models exclude margin 6483 if ( box === "margin" ) { 6484 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 6485 } 6486 6487 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 6488 if ( !isBorderBox ) { 6489 6490 // Add padding 6491 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6492 6493 // For "border" or "margin", add border 6494 if ( box !== "padding" ) { 6495 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6496 6497 // But still keep track of it otherwise 6498 } else { 6499 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6500 } 6501 6502 // If we get here with a border-box (content + padding + border), we're seeking "content" or 6503 // "padding" or "margin" 6504 } else { 6505 6506 // For "content", subtract padding 6507 if ( box === "content" ) { 6508 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6509 } 6510 6511 // For "content" or "padding", subtract border 6512 if ( box !== "margin" ) { 6513 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6514 } 6515 } 6516 } 6517 6518 // Account for positive content-box scroll gutter when requested by providing computedVal 6519 if ( !isBorderBox && computedVal >= 0 ) { 6520 6521 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 6522 // Assuming integer scroll gutter, subtract the rest and round down 6523 delta += Math.max( 0, Math.ceil( 6524 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 6525 computedVal - 6526 delta - 6527 extra - 6528 0.5 6529 6530 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 6531 // Use an explicit zero to avoid NaN (gh-3964) 6532 ) ) || 0; 6533 } 6534 6535 return delta; 6536} 6537 6538function getWidthOrHeight( elem, dimension, extra ) { 6539 6540 // Start with computed style 6541 var styles = getStyles( elem ), 6542 6543 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 6544 // Fake content-box until we know it's needed to know the true value. 6545 boxSizingNeeded = !support.boxSizingReliable() || extra, 6546 isBorderBox = boxSizingNeeded && 6547 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6548 valueIsBorderBox = isBorderBox, 6549 6550 val = curCSS( elem, dimension, styles ), 6551 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 6552 6553 // Support: Firefox <=54 6554 // Return a confounding non-pixel value or feign ignorance, as appropriate. 6555 if ( rnumnonpx.test( val ) ) { 6556 if ( !extra ) { 6557 return val; 6558 } 6559 val = "auto"; 6560 } 6561 6562 6563 // Fall back to offsetWidth/offsetHeight when value is "auto" 6564 // This happens for inline elements with no explicit setting (gh-3571) 6565 // Support: Android <=4.1 - 4.3 only 6566 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 6567 // Support: IE 9-11 only 6568 // Also use offsetWidth/offsetHeight for when box sizing is unreliable 6569 // We use getClientRects() to check for hidden/disconnected. 6570 // In those cases, the computed value can be trusted to be border-box 6571 if ( ( !support.boxSizingReliable() && isBorderBox || 6572 val === "auto" ||
vendor: 3,829 bytes, lines 6573-6703
6573 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 6574 elem.getClientRects().length ) { 6575 6576 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 6577 6578 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 6579 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 6580 // retrieved value as a content box dimension. 6581 valueIsBorderBox = offsetProp in elem; 6582 if ( valueIsBorderBox ) { 6583 val = elem[ offsetProp ]; 6584 } 6585 } 6586 6587 // Normalize "" and auto 6588 val = parseFloat( val ) || 0; 6589 6590 // Adjust for the element's box model 6591 return ( val + 6592 boxModelAdjustment( 6593 elem, 6594 dimension, 6595 extra || ( isBorderBox ? "border" : "content" ), 6596 valueIsBorderBox, 6597 styles, 6598 6599 // Provide the current computed size to request scroll gutter calculation (gh-3589) 6600 val 6601 ) 6602 ) + "px"; 6603} 6604 6605jQuery.extend( { 6606 6607 // Add in style property hooks for overriding the default 6608 // behavior of getting and setting a style property 6609 cssHooks: { 6610 opacity: { 6611 get: function( elem, computed ) { 6612 if ( computed ) { 6613 6614 // We should always get a number back from opacity 6615 var ret = curCSS( elem, "opacity" ); 6616 return ret === "" ? "1" : ret; 6617 } 6618 } 6619 } 6620 }, 6621 6622 // Don't automatically add "px" to these possibly-unitless properties 6623 cssNumber: { 6624 "animationIterationCount": true, 6625 "columnCount": true, 6626 "fillOpacity": true, 6627 "flexGrow": true, 6628 "flexShrink": true, 6629 "fontWeight": true, 6630 "gridArea": true, 6631 "gridColumn": true, 6632 "gridColumnEnd": true, 6633 "gridColumnStart": true, 6634 "gridRow": true, 6635 "gridRowEnd": true, 6636 "gridRowStart": true, 6637 "lineHeight": true, 6638 "opacity": true, 6639 "order": true, 6640 "orphans": true, 6641 "widows": true, 6642 "zIndex": true, 6643 "zoom": true 6644 }, 6645 6646 // Add in properties whose names you wish to fix before 6647 // setting or getting the value 6648 cssProps: {}, 6649 6650 // Get and set the style property on a DOM Node 6651 style: function( elem, name, value, extra ) { 6652 6653 // Don't set styles on text and comment nodes 6654 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6655 return; 6656 } 6657 6658 // Make sure that we're working with the right name 6659 var ret, type, hooks, 6660 origName = camelCase( name ), 6661 isCustomProp = rcustomProp.test( name ), 6662 style = elem.style; 6663 6664 // Make sure that we're working with the right name. We don't 6665 // want to query the value if it is a CSS custom property 6666 // since they are user-defined. 6667 if ( !isCustomProp ) { 6668 name = finalPropName( origName ); 6669 } 6670 6671 // Gets hook for the prefixed version, then unprefixed version 6672 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6673 6674 // Check if we're setting a value 6675 if ( value !== undefined ) { 6676 type = typeof value; 6677 6678 // Convert "+=" or "-=" to relative numbers (#7345) 6679 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 6680 value = adjustCSS( elem, name, ret ); 6681 6682 // Fixes bug #9237 6683 type = "number"; 6684 } 6685 6686 // Make sure that null and NaN values aren't set (#7116) 6687 if ( value == null || value !== value ) { 6688 return; 6689 } 6690 6691 // If a number was passed in, add the unit (except for certain CSS properties) 6692 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 6693 // "px" to a few hardcoded values. 6694 if ( type === "number" && !isCustomProp ) { 6695 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 6696 } 6697 6698 // background-* props affect original clone's values 6699 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 6700 style[ name ] = "inherit"; 6701 } 6702 6703 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 12,281 bytes, lines 6704-7148
6704 if ( !hooks || !( "set" in hooks ) || 6705 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 6706 6707 if ( isCustomProp ) { 6708 style.setProperty( name, value ); 6709 } else { 6710 style[ name ] = value; 6711 } 6712 } 6713 6714 } else { 6715 6716 // If a hook was provided get the non-computed value from there 6717 if ( hooks && "get" in hooks && 6718 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 6719 6720 return ret; 6721 } 6722 6723 // Otherwise just get the value from the style object 6724 return style[ name ]; 6725 } 6726 }, 6727 6728 css: function( elem, name, extra, styles ) { 6729 var val, num, hooks, 6730 origName = camelCase( name ), 6731 isCustomProp = rcustomProp.test( name ); 6732 6733 // Make sure that we're working with the right name. We don't 6734 // want to modify the value if it is a CSS custom property 6735 // since they are user-defined. 6736 if ( !isCustomProp ) { 6737 name = finalPropName( origName ); 6738 } 6739 6740 // Try prefixed name followed by the unprefixed name 6741 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6742 6743 // If a hook was provided get the computed value from there 6744 if ( hooks && "get" in hooks ) { 6745 val = hooks.get( elem, true, extra ); 6746 } 6747 6748 // Otherwise, if a way to get the computed value exists, use that 6749 if ( val === undefined ) { 6750 val = curCSS( elem, name, styles ); 6751 } 6752 6753 // Convert "normal" to computed value 6754 if ( val === "normal" && name in cssNormalTransform ) { 6755 val = cssNormalTransform[ name ]; 6756 } 6757 6758 // Make numeric if forced or a qualifier was provided and val looks numeric 6759 if ( extra === "" || extra ) { 6760 num = parseFloat( val ); 6761 return extra === true || isFinite( num ) ? num || 0 : val; 6762 } 6763 6764 return val; 6765 } 6766} ); 6767 6768jQuery.each( [ "height", "width" ], function( i, dimension ) { 6769 jQuery.cssHooks[ dimension ] = { 6770 get: function( elem, computed, extra ) { 6771 if ( computed ) { 6772 6773 // Certain elements can have dimension info if we invisibly show them 6774 // but it must have a current display style that would benefit 6775 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 6776 6777 // Support: Safari 8+ 6778 // Table columns in Safari have non-zero offsetWidth & zero 6779 // getBoundingClientRect().width unless display is changed. 6780 // Support: IE <=11 only 6781 // Running getBoundingClientRect on a disconnected node 6782 // in IE throws an error. 6783 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 6784 swap( elem, cssShow, function() { 6785 return getWidthOrHeight( elem, dimension, extra ); 6786 } ) : 6787 getWidthOrHeight( elem, dimension, extra ); 6788 } 6789 }, 6790 6791 set: function( elem, value, extra ) { 6792 var matches, 6793 styles = getStyles( elem ), 6794 6795 // Only read styles.position if the test has a chance to fail 6796 // to avoid forcing a reflow. 6797 scrollboxSizeBuggy = !support.scrollboxSize() && 6798 styles.position === "absolute", 6799 6800 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 6801 boxSizingNeeded = scrollboxSizeBuggy || extra, 6802 isBorderBox = boxSizingNeeded && 6803 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6804 subtract = extra ? 6805 boxModelAdjustment( 6806 elem, 6807 dimension, 6808 extra, 6809 isBorderBox, 6810 styles 6811 ) : 6812 0; 6813 6814 // Account for unreliable border-box dimensions by comparing offset* to computed and 6815 // faking a content-box to get border and padding (gh-3699) 6816 if ( isBorderBox && scrollboxSizeBuggy ) { 6817 subtract -= Math.ceil( 6818 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 6819 parseFloat( styles[ dimension ] ) - 6820 boxModelAdjustment( elem, dimension, "border", false, styles ) - 6821 0.5 6822 ); 6823 } 6824 6825 // Convert to pixels if value adjustment is needed 6826 if ( subtract && ( matches = rcssNum.exec( value ) ) && 6827 ( matches[ 3 ] || "px" ) !== "px" ) { 6828 6829 elem.style[ dimension ] = value; 6830 value = jQuery.css( elem, dimension ); 6831 } 6832 6833 return setPositiveNumber( elem, value, subtract ); 6834 } 6835 }; 6836} ); 6837 6838jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 6839 function( elem, computed ) { 6840 if ( computed ) { 6841 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 6842 elem.getBoundingClientRect().left - 6843 swap( elem, { marginLeft: 0 }, function() { 6844 return elem.getBoundingClientRect().left; 6845 } ) 6846 ) + "px"; 6847 } 6848 } 6849); 6850 6851// These hooks are used by animate to expand properties 6852jQuery.each( { 6853 margin: "", 6854 padding: "", 6855 border: "Width" 6856}, function( prefix, suffix ) { 6857 jQuery.cssHooks[ prefix + suffix ] = { 6858 expand: function( value ) { 6859 var i = 0, 6860 expanded = {}, 6861 6862 // Assumes a single number if not a string 6863 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 6864 6865 for ( ; i < 4; i++ ) { 6866 expanded[ prefix + cssExpand[ i ] + suffix ] = 6867 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6868 } 6869 6870 return expanded; 6871 } 6872 }; 6873 6874 if ( prefix !== "margin" ) { 6875 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 6876 } 6877} ); 6878 6879jQuery.fn.extend( { 6880 css: function( name, value ) { 6881 return access( this, function( elem, name, value ) { 6882 var styles, len, 6883 map = {}, 6884 i = 0; 6885 6886 if ( Array.isArray( name ) ) { 6887 styles = getStyles( elem ); 6888 len = name.length; 6889 6890 for ( ; i < len; i++ ) { 6891 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 6892 } 6893 6894 return map; 6895 } 6896 6897 return value !== undefined ? 6898 jQuery.style( elem, name, value ) : 6899 jQuery.css( elem, name ); 6900 }, name, value, arguments.length > 1 ); 6901 } 6902} ); 6903 6904 6905function Tween( elem, options, prop, end, easing ) { 6906 return new Tween.prototype.init( elem, options, prop, end, easing ); 6907} 6908jQuery.Tween = Tween; 6909 6910Tween.prototype = { 6911 constructor: Tween, 6912 init: function( elem, options, prop, end, easing, unit ) { 6913 this.elem = elem; 6914 this.prop = prop; 6915 this.easing = easing || jQuery.easing._default; 6916 this.options = options; 6917 this.start = this.now = this.cur(); 6918 this.end = end; 6919 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 6920 }, 6921 cur: function() { 6922 var hooks = Tween.propHooks[ this.prop ]; 6923 6924 return hooks && hooks.get ? 6925 hooks.get( this ) : 6926 Tween.propHooks._default.get( this ); 6927 }, 6928 run: function( percent ) { 6929 var eased, 6930 hooks = Tween.propHooks[ this.prop ]; 6931 6932 if ( this.options.duration ) { 6933 this.pos = eased = jQuery.easing[ this.easing ]( 6934 percent, this.options.duration * percent, 0, 1, this.options.duration 6935 ); 6936 } else { 6937 this.pos = eased = percent; 6938 } 6939 this.now = ( this.end - this.start ) * eased + this.start; 6940 6941 if ( this.options.step ) { 6942 this.options.step.call( this.elem, this.now, this ); 6943 } 6944 6945 if ( hooks && hooks.set ) { 6946 hooks.set( this ); 6947 } else { 6948 Tween.propHooks._default.set( this ); 6949 } 6950 return this; 6951 } 6952}; 6953 6954Tween.prototype.init.prototype = Tween.prototype; 6955 6956Tween.propHooks = { 6957 _default: { 6958 get: function( tween ) { 6959 var result; 6960 6961 // Use a property on the element directly when it is not a DOM element, 6962 // or when there is no matching style property that exists. 6963 if ( tween.elem.nodeType !== 1 || 6964 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 6965 return tween.elem[ tween.prop ]; 6966 } 6967 6968 // Passing an empty string as a 3rd parameter to .css will automatically 6969 // attempt a parseFloat and fallback to a string if the parse fails. 6970 // Simple values such as "10px" are parsed to Float; 6971 // complex values such as "rotate(1rad)" are returned as-is. 6972 result = jQuery.css( tween.elem, tween.prop, "" ); 6973 6974 // Empty strings, null, undefined and "auto" are converted to 0. 6975 return !result || result === "auto" ? 0 : result; 6976 }, 6977 set: function( tween ) { 6978 6979 // Use step hook for back compat. 6980 // Use cssHook if its there. 6981 // Use .style if available and use plain properties where available. 6982 if ( jQuery.fx.step[ tween.prop ] ) { 6983 jQuery.fx.step[ tween.prop ]( tween ); 6984 } else if ( tween.elem.nodeType === 1 && ( 6985 jQuery.cssHooks[ tween.prop ] || 6986 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 6987 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 6988 } else { 6989 tween.elem[ tween.prop ] = tween.now; 6990 } 6991 } 6992 } 6993}; 6994 6995// Support: IE <=9 only 6996// Panic based approach to setting things on disconnected nodes 6997Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 6998 set: function( tween ) { 6999 if ( tween.elem.nodeType && tween.elem.parentNode ) { 7000 tween.elem[ tween.prop ] = tween.now; 7001 } 7002 } 7003}; 7004 7005jQuery.easing = { 7006 linear: function( p ) { 7007 return p; 7008 }, 7009 swing: function( p ) { 7010 return 0.5 - Math.cos( p * Math.PI ) / 2; 7011 }, 7012 _default: "swing" 7013}; 7014 7015jQuery.fx = Tween.prototype.init; 7016 7017// Back compat <1.8 extension point 7018jQuery.fx.step = {}; 7019 7020 7021 7022 7023var 7024 fxNow, inProgress, 7025 rfxtypes = /^(?:toggle|show|hide)$/, 7026 rrun = /queueHooks$/; 7027 7028function schedule() { 7029 if ( inProgress ) { 7030 if ( document.hidden === false && window.requestAnimationFrame ) { 7031 window.requestAnimationFrame( schedule ); 7032 } else { 7033 window.setTimeout( schedule, jQuery.fx.interval ); 7034 } 7035 7036 jQuery.fx.tick(); 7037 } 7038} 7039 7040// Animations created synchronously will run synchronously 7041function createFxNow() { 7042 window.setTimeout( function() { 7043 fxNow = undefined; 7044 } ); 7045 return ( fxNow = Date.now() ); 7046} 7047 7048// Generate parameters to create a standard animation 7049function genFx( type, includeWidth ) { 7050 var which, 7051 i = 0, 7052 attrs = { height: type }; 7053 7054 // If we include width, step value is 1 to do all cssExpand values, 7055 // otherwise step value is 2 to skip over Left and Right 7056 includeWidth = includeWidth ? 1 : 0; 7057 for ( ; i < 4; i += 2 - includeWidth ) { 7058 which = cssExpand[ i ]; 7059 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 7060 } 7061 7062 if ( includeWidth ) { 7063 attrs.opacity = attrs.width = type; 7064 } 7065 7066 return attrs; 7067} 7068 7069function createTween( value, prop, animation ) { 7070 var tween, 7071 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 7072 index = 0, 7073 length = collection.length; 7074 for ( ; index < length; index++ ) { 7075 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 7076 7077 // We're done with this property 7078 return tween; 7079 } 7080 } 7081} 7082 7083function defaultPrefilter( elem, props, opts ) { 7084 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 7085 isBox = "width" in props || "height" in props, 7086 anim = this, 7087 orig = {}, 7088 style = elem.style, 7089 hidden = elem.nodeType && isHiddenWithinTree( elem ), 7090 dataShow = dataPriv.get( elem, "fxshow" ); 7091 7092 // Queue-skipping animations hijack the fx hooks 7093 if ( !opts.queue ) { 7094 hooks = jQuery._queueHooks( elem, "fx" ); 7095 if ( hooks.unqueued == null ) { 7096 hooks.unqueued = 0; 7097 oldfire = hooks.empty.fire; 7098 hooks.empty.fire = function() { 7099 if ( !hooks.unqueued ) { 7100 oldfire(); 7101 } 7102 }; 7103 } 7104 hooks.unqueued++; 7105 7106 anim.always( function() { 7107 7108 // Ensure the complete handler is called before this completes 7109 anim.always( function() { 7110 hooks.unqueued--; 7111 if ( !jQuery.queue( elem, "fx" ).length ) { 7112 hooks.empty.fire(); 7113 } 7114 } ); 7115 } ); 7116 } 7117 7118 // Detect show/hide animations 7119 for ( prop in props ) { 7120 value = props[ prop ]; 7121 if ( rfxtypes.test( value ) ) { 7122 delete props[ prop ]; 7123 toggle = toggle || value === "toggle"; 7124 if ( value === ( hidden ? "hide" : "show" ) ) { 7125 7126 // Pretend to be hidden if this is a "show" and 7127 // there is still data from a stopped show/hide 7128 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 7129 hidden = true; 7130 7131 // Ignore all other no-op show/hide data 7132 } else { 7133 continue; 7134 } 7135 } 7136 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 7137 } 7138 } 7139 7140 // Bail out if this is a no-op like .hide().hide() 7141 propTween = !jQuery.isEmptyObject( props ); 7142 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 7143 return; 7144 } 7145 7146 // Restrict "overflow" and "display" styles during box animations 7147 if ( isBox && elem.nodeType === 1 ) { 7148
vendor: 4,380 bytes, lines 7149-7308
7149 // Support: IE <=9 - 11, Edge 12 - 15 7150 // Record all 3 overflow attributes because IE does not infer the shorthand 7151 // from identically-valued overflowX and overflowY and Edge just mirrors 7152 // the overflowX value there. 7153 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 7154 7155 // Identify a display type, preferring old show/hide data over the CSS cascade 7156 restoreDisplay = dataShow && dataShow.display; 7157 if ( restoreDisplay == null ) { 7158 restoreDisplay = dataPriv.get( elem, "display" ); 7159 } 7160 display = jQuery.css( elem, "display" ); 7161 if ( display === "none" ) { 7162 if ( restoreDisplay ) { 7163 display = restoreDisplay; 7164 } else { 7165 7166 // Get nonempty value(s) by temporarily forcing visibility 7167 showHide( [ elem ], true ); 7168 restoreDisplay = elem.style.display || restoreDisplay; 7169 display = jQuery.css( elem, "display" ); 7170 showHide( [ elem ] ); 7171 } 7172 } 7173 7174 // Animate inline elements as inline-block 7175 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 7176 if ( jQuery.css( elem, "float" ) === "none" ) { 7177 7178 // Restore the original display value at the end of pure show/hide animations 7179 if ( !propTween ) { 7180 anim.done( function() { 7181 style.display = restoreDisplay; 7182 } ); 7183 if ( restoreDisplay == null ) { 7184 display = style.display; 7185 restoreDisplay = display === "none" ? "" : display; 7186 } 7187 } 7188 style.display = "inline-block"; 7189 } 7190 } 7191 } 7192 7193 if ( opts.overflow ) { 7194 style.overflow = "hidden"; 7195 anim.always( function() { 7196 style.overflow = opts.overflow[ 0 ]; 7197 style.overflowX = opts.overflow[ 1 ]; 7198 style.overflowY = opts.overflow[ 2 ]; 7199 } ); 7200 } 7201 7202 // Implement show/hide animations 7203 propTween = false; 7204 for ( prop in orig ) { 7205 7206 // General show/hide setup for this element animation 7207 if ( !propTween ) { 7208 if ( dataShow ) { 7209 if ( "hidden" in dataShow ) { 7210 hidden = dataShow.hidden; 7211 } 7212 } else { 7213 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 7214 } 7215 7216 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 7217 if ( toggle ) { 7218 dataShow.hidden = !hidden; 7219 } 7220 7221 // Show elements before animating them 7222 if ( hidden ) { 7223 showHide( [ elem ], true ); 7224 } 7225 7226 /* eslint-disable no-loop-func */ 7227 7228 anim.done( function() { 7229 7230 /* eslint-enable no-loop-func */ 7231 7232 // The final step of a "hide" animation is actually hiding the element 7233 if ( !hidden ) { 7234 showHide( [ elem ] ); 7235 } 7236 dataPriv.remove( elem, "fxshow" ); 7237 for ( prop in orig ) { 7238 jQuery.style( elem, prop, orig[ prop ] ); 7239 } 7240 } ); 7241 } 7242 7243 // Per-property setup 7244 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 7245 if ( !( prop in dataShow ) ) { 7246 dataShow[ prop ] = propTween.start; 7247 if ( hidden ) { 7248 propTween.end = propTween.start; 7249 propTween.start = 0; 7250 } 7251 } 7252 } 7253} 7254 7255function propFilter( props, specialEasing ) { 7256 var index, name, easing, value, hooks; 7257 7258 // camelCase, specialEasing and expand cssHook pass 7259 for ( index in props ) { 7260 name = camelCase( index ); 7261 easing = specialEasing[ name ]; 7262 value = props[ index ]; 7263 if ( Array.isArray( value ) ) { 7264 easing = value[ 1 ]; 7265 value = props[ index ] = value[ 0 ]; 7266 } 7267 7268 if ( index !== name ) { 7269 props[ name ] = value; 7270 delete props[ index ]; 7271 } 7272 7273 hooks = jQuery.cssHooks[ name ]; 7274 if ( hooks && "expand" in hooks ) { 7275 value = hooks.expand( value ); 7276 delete props[ name ]; 7277 7278 // Not quite $.extend, this won't overwrite existing keys. 7279 // Reusing 'index' because we have the correct "name" 7280 for ( index in value ) { 7281 if ( !( index in props ) ) { 7282 props[ index ] = value[ index ]; 7283 specialEasing[ index ] = easing; 7284 } 7285 } 7286 } else { 7287 specialEasing[ name ] = easing; 7288 } 7289 } 7290} 7291 7292function Animation( elem, properties, options ) { 7293 var result, 7294 stopped, 7295 index = 0, 7296 length = Animation.prefilters.length, 7297 deferred = jQuery.Deferred().always( function() { 7298 7299 // Don't match elem in the :animated selector 7300 delete tick.elem; 7301 } ), 7302 tick = function() { 7303 if ( stopped ) { 7304 return false; 7305 } 7306 var currentTime = fxNow || createFxNow(), 7307 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 7308
vendor: 9,495 bytes, lines 7309-7668
7309 // Support: Android 2.3 only 7310 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 7311 temp = remaining / animation.duration || 0, 7312 percent = 1 - temp, 7313 index = 0, 7314 length = animation.tweens.length; 7315 7316 for ( ; index < length; index++ ) { 7317 animation.tweens[ index ].run( percent ); 7318 } 7319 7320 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 7321 7322 // If there's more to do, yield 7323 if ( percent < 1 && length ) { 7324 return remaining; 7325 } 7326 7327 // If this was an empty animation, synthesize a final progress notification 7328 if ( !length ) { 7329 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7330 } 7331 7332 // Resolve the animation and report its conclusion 7333 deferred.resolveWith( elem, [ animation ] ); 7334 return false; 7335 }, 7336 animation = deferred.promise( { 7337 elem: elem, 7338 props: jQuery.extend( {}, properties ), 7339 opts: jQuery.extend( true, { 7340 specialEasing: {}, 7341 easing: jQuery.easing._default 7342 }, options ), 7343 originalProperties: properties, 7344 originalOptions: options, 7345 startTime: fxNow || createFxNow(), 7346 duration: options.duration, 7347 tweens: [], 7348 createTween: function( prop, end ) { 7349 var tween = jQuery.Tween( elem, animation.opts, prop, end, 7350 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 7351 animation.tweens.push( tween ); 7352 return tween; 7353 }, 7354 stop: function( gotoEnd ) { 7355 var index = 0, 7356 7357 // If we are going to the end, we want to run all the tweens 7358 // otherwise we skip this part 7359 length = gotoEnd ? animation.tweens.length : 0; 7360 if ( stopped ) { 7361 return this; 7362 } 7363 stopped = true; 7364 for ( ; index < length; index++ ) { 7365 animation.tweens[ index ].run( 1 ); 7366 } 7367 7368 // Resolve when we played the last frame; otherwise, reject 7369 if ( gotoEnd ) { 7370 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7371 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 7372 } else { 7373 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 7374 } 7375 return this; 7376 } 7377 } ), 7378 props = animation.props; 7379 7380 propFilter( props, animation.opts.specialEasing ); 7381 7382 for ( ; index < length; index++ ) { 7383 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 7384 if ( result ) { 7385 if ( isFunction( result.stop ) ) { 7386 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 7387 result.stop.bind( result ); 7388 } 7389 return result; 7390 } 7391 } 7392 7393 jQuery.map( props, createTween, animation ); 7394 7395 if ( isFunction( animation.opts.start ) ) { 7396 animation.opts.start.call( elem, animation ); 7397 } 7398 7399 // Attach callbacks from options 7400 animation 7401 .progress( animation.opts.progress ) 7402 .done( animation.opts.done, animation.opts.complete ) 7403 .fail( animation.opts.fail ) 7404 .always( animation.opts.always ); 7405 7406 jQuery.fx.timer( 7407 jQuery.extend( tick, { 7408 elem: elem, 7409 anim: animation, 7410 queue: animation.opts.queue 7411 } ) 7412 ); 7413 7414 return animation; 7415} 7416 7417jQuery.Animation = jQuery.extend( Animation, { 7418 7419 tweeners: { 7420 "*": [ function( prop, value ) { 7421 var tween = this.createTween( prop, value ); 7422 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 7423 return tween; 7424 } ] 7425 }, 7426 7427 tweener: function( props, callback ) { 7428 if ( isFunction( props ) ) { 7429 callback = props; 7430 props = [ "*" ]; 7431 } else { 7432 props = props.match( rnothtmlwhite ); 7433 } 7434 7435 var prop, 7436 index = 0, 7437 length = props.length; 7438 7439 for ( ; index < length; index++ ) { 7440 prop = props[ index ]; 7441 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 7442 Animation.tweeners[ prop ].unshift( callback ); 7443 } 7444 }, 7445 7446 prefilters: [ defaultPrefilter ], 7447 7448 prefilter: function( callback, prepend ) { 7449 if ( prepend ) { 7450 Animation.prefilters.unshift( callback ); 7451 } else { 7452 Animation.prefilters.push( callback ); 7453 } 7454 } 7455} ); 7456 7457jQuery.speed = function( speed, easing, fn ) { 7458 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 7459 complete: fn || !fn && easing || 7460 isFunction( speed ) && speed, 7461 duration: speed, 7462 easing: fn && easing || easing && !isFunction( easing ) && easing 7463 }; 7464 7465 // Go to the end state if fx are off 7466 if ( jQuery.fx.off ) { 7467 opt.duration = 0; 7468 7469 } else { 7470 if ( typeof opt.duration !== "number" ) { 7471 if ( opt.duration in jQuery.fx.speeds ) { 7472 opt.duration = jQuery.fx.speeds[ opt.duration ]; 7473 7474 } else { 7475 opt.duration = jQuery.fx.speeds._default; 7476 } 7477 } 7478 } 7479 7480 // Normalize opt.queue - true/undefined/null -> "fx" 7481 if ( opt.queue == null || opt.queue === true ) { 7482 opt.queue = "fx"; 7483 } 7484 7485 // Queueing 7486 opt.old = opt.complete; 7487 7488 opt.complete = function() { 7489 if ( isFunction( opt.old ) ) { 7490 opt.old.call( this ); 7491 } 7492 7493 if ( opt.queue ) { 7494 jQuery.dequeue( this, opt.queue ); 7495 } 7496 }; 7497 7498 return opt; 7499}; 7500 7501jQuery.fn.extend( { 7502 fadeTo: function( speed, to, easing, callback ) { 7503 7504 // Show any hidden elements after setting opacity to 0 7505 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 7506 7507 // Animate to the value specified 7508 .end().animate( { opacity: to }, speed, easing, callback ); 7509 }, 7510 animate: function( prop, speed, easing, callback ) { 7511 var empty = jQuery.isEmptyObject( prop ), 7512 optall = jQuery.speed( speed, easing, callback ), 7513 doAnimation = function() { 7514 7515 // Operate on a copy of prop so per-property easing won't be lost 7516 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 7517 7518 // Empty animations, or finishing resolves immediately 7519 if ( empty || dataPriv.get( this, "finish" ) ) { 7520 anim.stop( true ); 7521 } 7522 }; 7523 doAnimation.finish = doAnimation; 7524 7525 return empty || optall.queue === false ? 7526 this.each( doAnimation ) : 7527 this.queue( optall.queue, doAnimation ); 7528 }, 7529 stop: function( type, clearQueue, gotoEnd ) { 7530 var stopQueue = function( hooks ) { 7531 var stop = hooks.stop; 7532 delete hooks.stop; 7533 stop( gotoEnd ); 7534 }; 7535 7536 if ( typeof type !== "string" ) { 7537 gotoEnd = clearQueue; 7538 clearQueue = type; 7539 type = undefined; 7540 } 7541 if ( clearQueue && type !== false ) { 7542 this.queue( type || "fx", [] ); 7543 } 7544 7545 return this.each( function() { 7546 var dequeue = true, 7547 index = type != null && type + "queueHooks", 7548 timers = jQuery.timers, 7549 data = dataPriv.get( this ); 7550 7551 if ( index ) { 7552 if ( data[ index ] && data[ index ].stop ) { 7553 stopQueue( data[ index ] ); 7554 } 7555 } else { 7556 for ( index in data ) { 7557 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 7558 stopQueue( data[ index ] ); 7559 } 7560 } 7561 } 7562 7563 for ( index = timers.length; index--; ) { 7564 if ( timers[ index ].elem === this && 7565 ( type == null || timers[ index ].queue === type ) ) { 7566 7567 timers[ index ].anim.stop( gotoEnd ); 7568 dequeue = false; 7569 timers.splice( index, 1 ); 7570 } 7571 } 7572 7573 // Start the next in the queue if the last step wasn't forced. 7574 // Timers currently will call their complete callbacks, which 7575 // will dequeue but only if they were gotoEnd. 7576 if ( dequeue || !gotoEnd ) { 7577 jQuery.dequeue( this, type ); 7578 } 7579 } ); 7580 }, 7581 finish: function( type ) { 7582 if ( type !== false ) { 7583 type = type || "fx"; 7584 } 7585 return this.each( function() { 7586 var index, 7587 data = dataPriv.get( this ), 7588 queue = data[ type + "queue" ], 7589 hooks = data[ type + "queueHooks" ], 7590 timers = jQuery.timers, 7591 length = queue ? queue.length : 0; 7592 7593 // Enable finishing flag on private data 7594 data.finish = true; 7595 7596 // Empty the queue first 7597 jQuery.queue( this, type, [] ); 7598 7599 if ( hooks && hooks.stop ) { 7600 hooks.stop.call( this, true ); 7601 } 7602 7603 // Look for any active animations, and finish them 7604 for ( index = timers.length; index--; ) { 7605 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 7606 timers[ index ].anim.stop( true ); 7607 timers.splice( index, 1 ); 7608 } 7609 } 7610 7611 // Look for any animations in the old queue and finish them 7612 for ( index = 0; index < length; index++ ) { 7613 if ( queue[ index ] && queue[ index ].finish ) { 7614 queue[ index ].finish.call( this ); 7615 } 7616 } 7617 7618 // Turn off finishing flag 7619 delete data.finish; 7620 } ); 7621 } 7622} ); 7623 7624jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 7625 var cssFn = jQuery.fn[ name ]; 7626 jQuery.fn[ name ] = function( speed, easing, callback ) { 7627 return speed == null || typeof speed === "boolean" ? 7628 cssFn.apply( this, arguments ) : 7629 this.animate( genFx( name, true ), speed, easing, callback ); 7630 }; 7631} ); 7632 7633// Generate shortcuts for custom animations 7634jQuery.each( { 7635 slideDown: genFx( "show" ), 7636 slideUp: genFx( "hide" ), 7637 slideToggle: genFx( "toggle" ), 7638 fadeIn: { opacity: "show" }, 7639 fadeOut: { opacity: "hide" }, 7640 fadeToggle: { opacity: "toggle" } 7641}, function( name, props ) { 7642 jQuery.fn[ name ] = function( speed, easing, callback ) { 7643 return this.animate( props, speed, easing, callback ); 7644 }; 7645} ); 7646 7647jQuery.timers = []; 7648jQuery.fx.tick = function() { 7649 var timer, 7650 i = 0, 7651 timers = jQuery.timers; 7652 7653 fxNow = Date.now(); 7654 7655 for ( ; i < timers.length; i++ ) { 7656 timer = timers[ i ]; 7657 7658 // Run the timer and safely remove it when done (allowing for external removal) 7659 if ( !timer() && timers[ i ] === timer ) { 7660 timers.splice( i--, 1 ); 7661 } 7662 } 7663 7664 if ( !timers.length ) { 7665 jQuery.fx.stop(); 7666 } 7667 fxNow = undefined; 7668};
vendor: 7,836 bytes, lines 7669-8005
7669 7670jQuery.fx.timer = function( timer ) { 7671 jQuery.timers.push( timer ); 7672 jQuery.fx.start(); 7673}; 7674 7675jQuery.fx.interval = 13; 7676jQuery.fx.start = function() { 7677 if ( inProgress ) { 7678 return; 7679 } 7680 7681 inProgress = true; 7682 schedule(); 7683}; 7684 7685jQuery.fx.stop = function() { 7686 inProgress = null; 7687}; 7688 7689jQuery.fx.speeds = { 7690 slow: 600, 7691 fast: 200, 7692 7693 // Default speed 7694 _default: 400 7695}; 7696 7697 7698// Based off of the plugin by Clint Helfers, with permission. 7699// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 7700jQuery.fn.delay = function( time, type ) { 7701 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 7702 type = type || "fx"; 7703 7704 return this.queue( type, function( next, hooks ) { 7705 var timeout = window.setTimeout( next, time ); 7706 hooks.stop = function() { 7707 window.clearTimeout( timeout ); 7708 }; 7709 } ); 7710}; 7711 7712 7713( function() { 7714 var input = document.createElement( "input" ), 7715 select = document.createElement( "select" ), 7716 opt = select.appendChild( document.createElement( "option" ) ); 7717 7718 input.type = "checkbox"; 7719 7720 // Support: Android <=4.3 only 7721 // Default value for a checkbox should be "on" 7722 support.checkOn = input.value !== ""; 7723 7724 // Support: IE <=11 only 7725 // Must access selectedIndex to make default options select 7726 support.optSelected = opt.selected; 7727 7728 // Support: IE <=11 only 7729 // An input loses its value after becoming a radio 7730 input = document.createElement( "input" ); 7731 input.value = "t"; 7732 input.type = "radio"; 7733 support.radioValue = input.value === "t"; 7734} )(); 7735 7736 7737var boolHook, 7738 attrHandle = jQuery.expr.attrHandle; 7739 7740jQuery.fn.extend( { 7741 attr: function( name, value ) { 7742 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 7743 }, 7744 7745 removeAttr: function( name ) { 7746 return this.each( function() { 7747 jQuery.removeAttr( this, name ); 7748 } ); 7749 } 7750} ); 7751 7752jQuery.extend( { 7753 attr: function( elem, name, value ) { 7754 var ret, hooks, 7755 nType = elem.nodeType; 7756 7757 // Don't get/set attributes on text, comment and attribute nodes 7758 if ( nType === 3 || nType === 8 || nType === 2 ) { 7759 return; 7760 } 7761 7762 // Fallback to prop when attributes are not supported 7763 if ( typeof elem.getAttribute === "undefined" ) { 7764 return jQuery.prop( elem, name, value ); 7765 } 7766 7767 // Attribute hooks are determined by the lowercase version 7768 // Grab necessary hook if one is defined 7769 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7770 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 7771 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 7772 } 7773 7774 if ( value !== undefined ) { 7775 if ( value === null ) { 7776 jQuery.removeAttr( elem, name ); 7777 return; 7778 } 7779 7780 if ( hooks && "set" in hooks && 7781 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7782 return ret; 7783 } 7784 7785 elem.setAttribute( name, value + "" ); 7786 return value; 7787 } 7788 7789 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7790 return ret; 7791 } 7792 7793 ret = jQuery.find.attr( elem, name ); 7794 7795 // Non-existent attributes return null, we normalize to undefined 7796 return ret == null ? undefined : ret; 7797 }, 7798 7799 attrHooks: { 7800 type: { 7801 set: function( elem, value ) { 7802 if ( !support.radioValue && value === "radio" && 7803 nodeName( elem, "input" ) ) { 7804 var val = elem.value; 7805 elem.setAttribute( "type", value ); 7806 if ( val ) { 7807 elem.value = val; 7808 } 7809 return value; 7810 } 7811 } 7812 } 7813 }, 7814 7815 removeAttr: function( elem, value ) { 7816 var name, 7817 i = 0, 7818 7819 // Attribute names can contain non-HTML whitespace characters 7820 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 7821 attrNames = value && value.match( rnothtmlwhite ); 7822 7823 if ( attrNames && elem.nodeType === 1 ) { 7824 while ( ( name = attrNames[ i++ ] ) ) { 7825 elem.removeAttribute( name ); 7826 } 7827 } 7828 } 7829} ); 7830 7831// Hooks for boolean attributes 7832boolHook = { 7833 set: function( elem, value, name ) { 7834 if ( value === false ) { 7835 7836 // Remove boolean attributes when set to false 7837 jQuery.removeAttr( elem, name ); 7838 } else { 7839 elem.setAttribute( name, name ); 7840 } 7841 return name; 7842 } 7843}; 7844 7845jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 7846 var getter = attrHandle[ name ] || jQuery.find.attr; 7847 7848 attrHandle[ name ] = function( elem, name, isXML ) { 7849 var ret, handle, 7850 lowercaseName = name.toLowerCase(); 7851 7852 if ( !isXML ) { 7853 7854 // Avoid an infinite loop by temporarily removing this function from the getter 7855 handle = attrHandle[ lowercaseName ]; 7856 attrHandle[ lowercaseName ] = ret; 7857 ret = getter( elem, name, isXML ) != null ? 7858 lowercaseName : 7859 null; 7860 attrHandle[ lowercaseName ] = handle; 7861 } 7862 return ret; 7863 }; 7864} ); 7865 7866 7867 7868 7869var rfocusable = /^(?:input|select|textarea|button)$/i, 7870 rclickable = /^(?:a|area)$/i; 7871 7872jQuery.fn.extend( { 7873 prop: function( name, value ) { 7874 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 7875 }, 7876 7877 removeProp: function( name ) { 7878 return this.each( function() { 7879 delete this[ jQuery.propFix[ name ] || name ]; 7880 } ); 7881 } 7882} ); 7883 7884jQuery.extend( { 7885 prop: function( elem, name, value ) { 7886 var ret, hooks, 7887 nType = elem.nodeType; 7888 7889 // Don't get/set properties on text, comment and attribute nodes 7890 if ( nType === 3 || nType === 8 || nType === 2 ) { 7891 return; 7892 } 7893 7894 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7895 7896 // Fix name and attach hooks 7897 name = jQuery.propFix[ name ] || name; 7898 hooks = jQuery.propHooks[ name ]; 7899 } 7900 7901 if ( value !== undefined ) { 7902 if ( hooks && "set" in hooks && 7903 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7904 return ret; 7905 } 7906 7907 return ( elem[ name ] = value ); 7908 } 7909 7910 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7911 return ret; 7912 } 7913 7914 return elem[ name ]; 7915 }, 7916 7917 propHooks: { 7918 tabIndex: { 7919 get: function( elem ) { 7920 7921 // Support: IE <=9 - 11 only 7922 // elem.tabIndex doesn't always return the 7923 // correct value when it hasn't been explicitly set 7924 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 7925 // Use proper attribute retrieval(#12072) 7926 var tabindex = jQuery.find.attr( elem, "tabindex" ); 7927 7928 if ( tabindex ) { 7929 return parseInt( tabindex, 10 ); 7930 } 7931 7932 if ( 7933 rfocusable.test( elem.nodeName ) || 7934 rclickable.test( elem.nodeName ) && 7935 elem.href 7936 ) { 7937 return 0; 7938 } 7939 7940 return -1; 7941 } 7942 } 7943 }, 7944 7945 propFix: { 7946 "for": "htmlFor", 7947 "class": "className" 7948 } 7949} ); 7950 7951// Support: IE <=11 only 7952// Accessing the selectedIndex property 7953// forces the browser to respect setting selected 7954// on the option 7955// The getter ensures a default option is selected 7956// when in an optgroup 7957// eslint rule "no-unused-expressions" is disabled for this code 7958// since it considers such accessions noop 7959if ( !support.optSelected ) { 7960 jQuery.propHooks.selected = { 7961 get: function( elem ) { 7962 7963 /* eslint no-unused-expressions: "off" */ 7964 7965 var parent = elem.parentNode; 7966 if ( parent && parent.parentNode ) { 7967 parent.parentNode.selectedIndex; 7968 } 7969 return null; 7970 }, 7971 set: function( elem ) { 7972 7973 /* eslint no-unused-expressions: "off" */ 7974 7975 var parent = elem.parentNode; 7976 if ( parent ) { 7977 parent.selectedIndex; 7978 7979 if ( parent.parentNode ) { 7980 parent.parentNode.selectedIndex; 7981 } 7982 } 7983 } 7984 }; 7985} 7986 7987jQuery.each( [ 7988 "tabIndex", 7989 "readOnly", 7990 "maxLength", 7991 "cellSpacing", 7992 "cellPadding", 7993 "rowSpan", 7994 "colSpan", 7995 "useMap", 7996 "frameBorder", 7997 "contentEditable" 7998], function() { 7999 jQuery.propFix[ this.toLowerCase() ] = this; 8000} ); 8001 8002 8003 8004 8005 // Strip and collapse whitespace according to HTML spec
vendor: 18,645 bytes, lines 8006-8731
8006 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 8007 function stripAndCollapse( value ) { 8008 var tokens = value.match( rnothtmlwhite ) || []; 8009 return tokens.join( " " ); 8010 } 8011 8012 8013function getClass( elem ) { 8014 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 8015} 8016 8017function classesToArray( value ) { 8018 if ( Array.isArray( value ) ) { 8019 return value; 8020 } 8021 if ( typeof value === "string" ) { 8022 return value.match( rnothtmlwhite ) || []; 8023 } 8024 return []; 8025} 8026 8027jQuery.fn.extend( { 8028 addClass: function( value ) { 8029 var classes, elem, cur, curValue, clazz, j, finalValue, 8030 i = 0; 8031 8032 if ( isFunction( value ) ) { 8033 return this.each( function( j ) { 8034 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 8035 } ); 8036 } 8037 8038 classes = classesToArray( value ); 8039 8040 if ( classes.length ) { 8041 while ( ( elem = this[ i++ ] ) ) { 8042 curValue = getClass( elem ); 8043 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8044 8045 if ( cur ) { 8046 j = 0; 8047 while ( ( clazz = classes[ j++ ] ) ) { 8048 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 8049 cur += clazz + " "; 8050 } 8051 } 8052 8053 // Only assign if different to avoid unneeded rendering. 8054 finalValue = stripAndCollapse( cur ); 8055 if ( curValue !== finalValue ) { 8056 elem.setAttribute( "class", finalValue ); 8057 } 8058 } 8059 } 8060 } 8061 8062 return this; 8063 }, 8064 8065 removeClass: function( value ) { 8066 var classes, elem, cur, curValue, clazz, j, finalValue, 8067 i = 0; 8068 8069 if ( isFunction( value ) ) { 8070 return this.each( function( j ) { 8071 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 8072 } ); 8073 } 8074 8075 if ( !arguments.length ) { 8076 return this.attr( "class", "" ); 8077 } 8078 8079 classes = classesToArray( value ); 8080 8081 if ( classes.length ) { 8082 while ( ( elem = this[ i++ ] ) ) { 8083 curValue = getClass( elem ); 8084 8085 // This expression is here for better compressibility (see addClass) 8086 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8087 8088 if ( cur ) { 8089 j = 0; 8090 while ( ( clazz = classes[ j++ ] ) ) { 8091 8092 // Remove *all* instances 8093 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 8094 cur = cur.replace( " " + clazz + " ", " " ); 8095 } 8096 } 8097 8098 // Only assign if different to avoid unneeded rendering. 8099 finalValue = stripAndCollapse( cur ); 8100 if ( curValue !== finalValue ) { 8101 elem.setAttribute( "class", finalValue ); 8102 } 8103 } 8104 } 8105 } 8106 8107 return this; 8108 }, 8109 8110 toggleClass: function( value, stateVal ) { 8111 var type = typeof value, 8112 isValidValue = type === "string" || Array.isArray( value ); 8113 8114 if ( typeof stateVal === "boolean" && isValidValue ) { 8115 return stateVal ? this.addClass( value ) : this.removeClass( value ); 8116 } 8117 8118 if ( isFunction( value ) ) { 8119 return this.each( function( i ) { 8120 jQuery( this ).toggleClass( 8121 value.call( this, i, getClass( this ), stateVal ), 8122 stateVal 8123 ); 8124 } ); 8125 } 8126 8127 return this.each( function() { 8128 var className, i, self, classNames; 8129 8130 if ( isValidValue ) { 8131 8132 // Toggle individual class names 8133 i = 0; 8134 self = jQuery( this ); 8135 classNames = classesToArray( value ); 8136 8137 while ( ( className = classNames[ i++ ] ) ) { 8138 8139 // Check each className given, space separated list 8140 if ( self.hasClass( className ) ) { 8141 self.removeClass( className ); 8142 } else { 8143 self.addClass( className ); 8144 } 8145 } 8146 8147 // Toggle whole class name 8148 } else if ( value === undefined || type === "boolean" ) { 8149 className = getClass( this ); 8150 if ( className ) { 8151 8152 // Store className if set 8153 dataPriv.set( this, "__className__", className ); 8154 } 8155 8156 // If the element has a class name or if we're passed `false`, 8157 // then remove the whole classname (if there was one, the above saved it). 8158 // Otherwise bring back whatever was previously saved (if anything), 8159 // falling back to the empty string if nothing was stored. 8160 if ( this.setAttribute ) { 8161 this.setAttribute( "class", 8162 className || value === false ? 8163 "" : 8164 dataPriv.get( this, "__className__" ) || "" 8165 ); 8166 } 8167 } 8168 } ); 8169 }, 8170 8171 hasClass: function( selector ) { 8172 var className, elem, 8173 i = 0; 8174 8175 className = " " + selector + " "; 8176 while ( ( elem = this[ i++ ] ) ) { 8177 if ( elem.nodeType === 1 && 8178 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 8179 return true; 8180 } 8181 } 8182 8183 return false; 8184 } 8185} ); 8186 8187 8188 8189 8190var rreturn = /\r/g; 8191 8192jQuery.fn.extend( { 8193 val: function( value ) { 8194 var hooks, ret, valueIsFunction, 8195 elem = this[ 0 ]; 8196 8197 if ( !arguments.length ) { 8198 if ( elem ) { 8199 hooks = jQuery.valHooks[ elem.type ] || 8200 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 8201 8202 if ( hooks && 8203 "get" in hooks && 8204 ( ret = hooks.get( elem, "value" ) ) !== undefined 8205 ) { 8206 return ret; 8207 } 8208 8209 ret = elem.value; 8210 8211 // Handle most common string cases 8212 if ( typeof ret === "string" ) { 8213 return ret.replace( rreturn, "" ); 8214 } 8215 8216 // Handle cases where value is null/undef or number 8217 return ret == null ? "" : ret; 8218 } 8219 8220 return; 8221 } 8222 8223 valueIsFunction = isFunction( value ); 8224 8225 return this.each( function( i ) { 8226 var val; 8227 8228 if ( this.nodeType !== 1 ) { 8229 return; 8230 } 8231 8232 if ( valueIsFunction ) { 8233 val = value.call( this, i, jQuery( this ).val() ); 8234 } else { 8235 val = value; 8236 } 8237 8238 // Treat null/undefined as ""; convert numbers to string 8239 if ( val == null ) { 8240 val = ""; 8241 8242 } else if ( typeof val === "number" ) { 8243 val += ""; 8244 8245 } else if ( Array.isArray( val ) ) { 8246 val = jQuery.map( val, function( value ) { 8247 return value == null ? "" : value + ""; 8248 } ); 8249 } 8250 8251 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 8252 8253 // If set returns undefined, fall back to normal setting 8254 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 8255 this.value = val; 8256 } 8257 } ); 8258 } 8259} ); 8260 8261jQuery.extend( { 8262 valHooks: { 8263 option: { 8264 get: function( elem ) { 8265 8266 var val = jQuery.find.attr( elem, "value" ); 8267 return val != null ? 8268 val : 8269 8270 // Support: IE <=10 - 11 only 8271 // option.text throws exceptions (#14686, #14858) 8272 // Strip and collapse whitespace 8273 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8274 stripAndCollapse( jQuery.text( elem ) ); 8275 } 8276 }, 8277 select: { 8278 get: function( elem ) { 8279 var value, option, i, 8280 options = elem.options, 8281 index = elem.selectedIndex, 8282 one = elem.type === "select-one", 8283 values = one ? null : [], 8284 max = one ? index + 1 : options.length; 8285 8286 if ( index < 0 ) { 8287 i = max; 8288 8289 } else { 8290 i = one ? index : 0; 8291 } 8292 8293 // Loop through all the selected options 8294 for ( ; i < max; i++ ) { 8295 option = options[ i ]; 8296 8297 // Support: IE <=9 only 8298 // IE8-9 doesn't update selected after form reset (#2551) 8299 if ( ( option.selected || i === index ) && 8300 8301 // Don't return options that are disabled or in a disabled optgroup 8302 !option.disabled && 8303 ( !option.parentNode.disabled || 8304 !nodeName( option.parentNode, "optgroup" ) ) ) { 8305 8306 // Get the specific value for the option 8307 value = jQuery( option ).val(); 8308 8309 // We don't need an array for one selects 8310 if ( one ) { 8311 return value; 8312 } 8313 8314 // Multi-Selects return an array 8315 values.push( value ); 8316 } 8317 } 8318 8319 return values; 8320 }, 8321 8322 set: function( elem, value ) { 8323 var optionSet, option, 8324 options = elem.options, 8325 values = jQuery.makeArray( value ), 8326 i = options.length; 8327 8328 while ( i-- ) { 8329 option = options[ i ]; 8330 8331 /* eslint-disable no-cond-assign */ 8332 8333 if ( option.selected = 8334 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 8335 ) { 8336 optionSet = true; 8337 } 8338 8339 /* eslint-enable no-cond-assign */ 8340 } 8341 8342 // Force browsers to behave consistently when non-matching value is set 8343 if ( !optionSet ) { 8344 elem.selectedIndex = -1; 8345 } 8346 return values; 8347 } 8348 } 8349 } 8350} ); 8351 8352// Radios and checkboxes getter/setter 8353jQuery.each( [ "radio", "checkbox" ], function() { 8354 jQuery.valHooks[ this ] = { 8355 set: function( elem, value ) { 8356 if ( Array.isArray( value ) ) { 8357 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 8358 } 8359 } 8360 }; 8361 if ( !support.checkOn ) { 8362 jQuery.valHooks[ this ].get = function( elem ) { 8363 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 8364 }; 8365 } 8366} ); 8367 8368 8369 8370 8371// Return jQuery for attributes-only inclusion 8372 8373 8374support.focusin = "onfocusin" in window; 8375 8376 8377var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 8378 stopPropagationCallback = function( e ) { 8379 e.stopPropagation(); 8380 }; 8381 8382jQuery.extend( jQuery.event, { 8383 8384 trigger: function( event, data, elem, onlyHandlers ) { 8385 8386 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 8387 eventPath = [ elem || document ], 8388 type = hasOwn.call( event, "type" ) ? event.type : event, 8389 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 8390 8391 cur = lastElement = tmp = elem = elem || document; 8392 8393 // Don't do events on text and comment nodes 8394 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 8395 return; 8396 } 8397 8398 // focus/blur morphs to focusin/out; ensure we're not firing them right now 8399 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 8400 return; 8401 } 8402 8403 if ( type.indexOf( "." ) > -1 ) { 8404 8405 // Namespaced trigger; create a regexp to match event type in handle() 8406 namespaces = type.split( "." ); 8407 type = namespaces.shift(); 8408 namespaces.sort(); 8409 } 8410 ontype = type.indexOf( ":" ) < 0 && "on" + type; 8411 8412 // Caller can pass in a jQuery.Event object, Object, or just an event type string 8413 event = event[ jQuery.expando ] ? 8414 event : 8415 new jQuery.Event( type, typeof event === "object" && event ); 8416 8417 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 8418 event.isTrigger = onlyHandlers ? 2 : 3; 8419 event.namespace = namespaces.join( "." ); 8420 event.rnamespace = event.namespace ? 8421 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 8422 null; 8423 8424 // Clean up the event in case it is being reused 8425 event.result = undefined; 8426 if ( !event.target ) { 8427 event.target = elem; 8428 } 8429 8430 // Clone any incoming data and prepend the event, creating the handler arg list 8431 data = data == null ? 8432 [ event ] : 8433 jQuery.makeArray( data, [ event ] ); 8434 8435 // Allow special events to draw outside the lines 8436 special = jQuery.event.special[ type ] || {}; 8437 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 8438 return; 8439 } 8440 8441 // Determine event propagation path in advance, per W3C events spec (#9951) 8442 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 8443 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 8444 8445 bubbleType = special.delegateType || type; 8446 if ( !rfocusMorph.test( bubbleType + type ) ) { 8447 cur = cur.parentNode; 8448 } 8449 for ( ; cur; cur = cur.parentNode ) { 8450 eventPath.push( cur ); 8451 tmp = cur; 8452 } 8453 8454 // Only add window if we got to document (e.g., not plain obj or detached DOM) 8455 if ( tmp === ( elem.ownerDocument || document ) ) { 8456 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 8457 } 8458 } 8459 8460 // Fire handlers on the event path 8461 i = 0; 8462 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 8463 lastElement = cur; 8464 event.type = i > 1 ? 8465 bubbleType : 8466 special.bindType || type; 8467 8468 // jQuery handler 8469 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 8470 dataPriv.get( cur, "handle" ); 8471 if ( handle ) { 8472 handle.apply( cur, data ); 8473 } 8474 8475 // Native handler 8476 handle = ontype && cur[ ontype ]; 8477 if ( handle && handle.apply && acceptData( cur ) ) { 8478 event.result = handle.apply( cur, data ); 8479 if ( event.result === false ) { 8480 event.preventDefault(); 8481 } 8482 } 8483 } 8484 event.type = type; 8485 8486 // If nobody prevented the default action, do it now 8487 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 8488 8489 if ( ( !special._default || 8490 special._default.apply( eventPath.pop(), data ) === false ) && 8491 acceptData( elem ) ) { 8492 8493 // Call a native DOM method on the target with the same name as the event. 8494 // Don't do default actions on window, that's where global variables be (#6170) 8495 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 8496 8497 // Don't re-trigger an onFOO event when we call its FOO() method 8498 tmp = elem[ ontype ]; 8499 8500 if ( tmp ) { 8501 elem[ ontype ] = null; 8502 } 8503 8504 // Prevent re-triggering of the same event, since we already bubbled it above 8505 jQuery.event.triggered = type; 8506 8507 if ( event.isPropagationStopped() ) { 8508 lastElement.addEventListener( type, stopPropagationCallback ); 8509 } 8510 8511 elem[ type ](); 8512 8513 if ( event.isPropagationStopped() ) { 8514 lastElement.removeEventListener( type, stopPropagationCallback ); 8515 } 8516 8517 jQuery.event.triggered = undefined; 8518 8519 if ( tmp ) { 8520 elem[ ontype ] = tmp; 8521 } 8522 } 8523 } 8524 } 8525 8526 return event.result; 8527 }, 8528 8529 // Piggyback on a donor event to simulate a different one 8530 // Used only for `focus(in | out)` events 8531 simulate: function( type, elem, event ) { 8532 var e = jQuery.extend( 8533 new jQuery.Event(), 8534 event, 8535 { 8536 type: type, 8537 isSimulated: true 8538 } 8539 ); 8540 8541 jQuery.event.trigger( e, null, elem ); 8542 } 8543 8544} ); 8545 8546jQuery.fn.extend( { 8547 8548 trigger: function( type, data ) { 8549 return this.each( function() { 8550 jQuery.event.trigger( type, data, this ); 8551 } ); 8552 }, 8553 triggerHandler: function( type, data ) { 8554 var elem = this[ 0 ]; 8555 if ( elem ) { 8556 return jQuery.event.trigger( type, data, elem, true ); 8557 } 8558 } 8559} ); 8560 8561 8562// Support: Firefox <=44 8563// Firefox doesn't have focus(in | out) events 8564// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 8565// 8566// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 8567// focus(in | out) events fire after focus & blur events, 8568// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 8569// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 8570if ( !support.focusin ) { 8571 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 8572 8573 // Attach a single capturing handler on the document while someone wants focusin/focusout 8574 var handler = function( event ) { 8575 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 8576 }; 8577 8578 jQuery.event.special[ fix ] = { 8579 setup: function() { 8580 var doc = this.ownerDocument || this, 8581 attaches = dataPriv.access( doc, fix ); 8582 8583 if ( !attaches ) { 8584 doc.addEventListener( orig, handler, true ); 8585 } 8586 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 8587 }, 8588 teardown: function() { 8589 var doc = this.ownerDocument || this, 8590 attaches = dataPriv.access( doc, fix ) - 1; 8591 8592 if ( !attaches ) { 8593 doc.removeEventListener( orig, handler, true ); 8594 dataPriv.remove( doc, fix ); 8595 8596 } else { 8597 dataPriv.access( doc, fix, attaches ); 8598 } 8599 } 8600 }; 8601 } ); 8602} 8603var location = window.location; 8604 8605var nonce = Date.now(); 8606 8607var rquery = ( /\?/ ); 8608 8609 8610 8611// Cross-browser xml parsing 8612jQuery.parseXML = function( data ) { 8613 var xml; 8614 if ( !data || typeof data !== "string" ) { 8615 return null; 8616 } 8617 8618 // Support: IE 9 - 11 only 8619 // IE throws on parseFromString with invalid input. 8620 try { 8621 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 8622 } catch ( e ) { 8623 xml = undefined; 8624 } 8625 8626 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 8627 jQuery.error( "Invalid XML: " + data ); 8628 } 8629 return xml; 8630}; 8631 8632 8633var 8634 rbracket = /\[\]$/, 8635 rCRLF = /\r?\n/g, 8636 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8637 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8638 8639function buildParams( prefix, obj, traditional, add ) { 8640 var name; 8641 8642 if ( Array.isArray( obj ) ) { 8643 8644 // Serialize array item. 8645 jQuery.each( obj, function( i, v ) { 8646 if ( traditional || rbracket.test( prefix ) ) { 8647 8648 // Treat each array item as a scalar. 8649 add( prefix, v ); 8650 8651 } else { 8652 8653 // Item is non-scalar (array or object), encode its numeric index. 8654 buildParams( 8655 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 8656 v, 8657 traditional, 8658 add 8659 ); 8660 } 8661 } ); 8662 8663 } else if ( !traditional && toType( obj ) === "object" ) { 8664 8665 // Serialize object item. 8666 for ( name in obj ) { 8667 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8668 } 8669 8670 } else { 8671 8672 // Serialize scalar item. 8673 add( prefix, obj ); 8674 } 8675} 8676 8677// Serialize an array of form elements or a set of 8678// key/values into a query string 8679jQuery.param = function( a, traditional ) { 8680 var prefix, 8681 s = [], 8682 add = function( key, valueOrFunction ) { 8683 8684 // If value is a function, invoke it and use its return value 8685 var value = isFunction( valueOrFunction ) ? 8686 valueOrFunction() : 8687 valueOrFunction; 8688 8689 s[ s.length ] = encodeURIComponent( key ) + "=" + 8690 encodeURIComponent( value == null ? "" : value ); 8691 }; 8692 8693 if ( a == null ) { 8694 return ""; 8695 } 8696 8697 // If an array was passed in, assume that it is an array of form elements. 8698 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 8699 8700 // Serialize the form elements 8701 jQuery.each( a, function() { 8702 add( this.name, this.value ); 8703 } ); 8704 8705 } else { 8706 8707 // If traditional, encode the "old" way (the way 1.3.2 or older 8708 // did it), otherwise encode params recursively. 8709 for ( prefix in a ) { 8710 buildParams( prefix, a[ prefix ], traditional, add ); 8711 } 8712 } 8713 8714 // Return the resulting serialization 8715 return s.join( "&" ); 8716}; 8717 8718jQuery.fn.extend( { 8719 serialize: function() { 8720 return jQuery.param( this.serializeArray() ); 8721 }, 8722 serializeArray: function() { 8723 return this.map( function() { 8724 8725 // Can add propHook for "elements" to filter or add form elements 8726 var elements = jQuery.prop( this, "elements" ); 8727 return elements ? jQuery.makeArray( elements ) : this; 8728 } ) 8729 .filter( function() { 8730 var type = this.type; 8731
vendor: 5,105 bytes, lines 8732-8904
8732 // Use .is( ":disabled" ) so that fieldset[disabled] works 8733 return this.name && !jQuery( this ).is( ":disabled" ) && 8734 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 8735 ( this.checked || !rcheckableType.test( type ) ); 8736 } ) 8737 .map( function( i, elem ) { 8738 var val = jQuery( this ).val(); 8739 8740 if ( val == null ) { 8741 return null; 8742 } 8743 8744 if ( Array.isArray( val ) ) { 8745 return jQuery.map( val, function( val ) { 8746 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8747 } ); 8748 } 8749 8750 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8751 } ).get(); 8752 } 8753} ); 8754 8755 8756var 8757 r20 = /%20/g, 8758 rhash = /#.*$/, 8759 rantiCache = /([?&])_=[^&]*/, 8760 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 8761 8762 // #7653, #8125, #8152: local protocol detection 8763 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 8764 rnoContent = /^(?:GET|HEAD)$/, 8765 rprotocol = /^\/\//, 8766 8767 /* Prefilters 8768 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 8769 * 2) These are called: 8770 * - BEFORE asking for a transport 8771 * - AFTER param serialization (s.data is a string if s.processData is true) 8772 * 3) key is the dataType 8773 * 4) the catchall symbol "*" can be used 8774 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 8775 */ 8776 prefilters = {}, 8777 8778 /* Transports bindings 8779 * 1) key is the dataType 8780 * 2) the catchall symbol "*" can be used 8781 * 3) selection will start with transport dataType and THEN go to "*" if needed 8782 */ 8783 transports = {}, 8784 8785 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 8786 allTypes = "*/".concat( "*" ), 8787 8788 // Anchor tag for parsing the document origin 8789 originAnchor = document.createElement( "a" ); 8790 originAnchor.href = location.href; 8791 8792// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 8793function addToPrefiltersOrTransports( structure ) { 8794 8795 // dataTypeExpression is optional and defaults to "*" 8796 return function( dataTypeExpression, func ) { 8797 8798 if ( typeof dataTypeExpression !== "string" ) { 8799 func = dataTypeExpression; 8800 dataTypeExpression = "*"; 8801 } 8802 8803 var dataType, 8804 i = 0, 8805 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 8806 8807 if ( isFunction( func ) ) { 8808 8809 // For each dataType in the dataTypeExpression 8810 while ( ( dataType = dataTypes[ i++ ] ) ) { 8811 8812 // Prepend if requested 8813 if ( dataType[ 0 ] === "+" ) { 8814 dataType = dataType.slice( 1 ) || "*"; 8815 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 8816 8817 // Otherwise append 8818 } else { 8819 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 8820 } 8821 } 8822 } 8823 }; 8824} 8825 8826// Base inspection function for prefilters and transports 8827function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 8828 8829 var inspected = {}, 8830 seekingTransport = ( structure === transports ); 8831 8832 function inspect( dataType ) { 8833 var selected; 8834 inspected[ dataType ] = true; 8835 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 8836 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 8837 if ( typeof dataTypeOrTransport === "string" && 8838 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 8839 8840 options.dataTypes.unshift( dataTypeOrTransport ); 8841 inspect( dataTypeOrTransport ); 8842 return false; 8843 } else if ( seekingTransport ) { 8844 return !( selected = dataTypeOrTransport ); 8845 } 8846 } ); 8847 return selected; 8848 } 8849 8850 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 8851} 8852 8853// A special extend for ajax options 8854// that takes "flat" options (not to be deep extended) 8855// Fixes #9887 8856function ajaxExtend( target, src ) { 8857 var key, deep, 8858 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 8859 8860 for ( key in src ) { 8861 if ( src[ key ] !== undefined ) { 8862 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 8863 } 8864 } 8865 if ( deep ) { 8866 jQuery.extend( true, target, deep ); 8867 } 8868 8869 return target; 8870} 8871 8872/* Handles responses to an ajax request: 8873 * - finds the right dataType (mediates between content-type and expected dataType) 8874 * - returns the corresponding response 8875 */ 8876function ajaxHandleResponses( s, jqXHR, responses ) { 8877 8878 var ct, type, finalDataType, firstDataType, 8879 contents = s.contents, 8880 dataTypes = s.dataTypes; 8881 8882 // Remove auto dataType and get content-type in the process 8883 while ( dataTypes[ 0 ] === "*" ) { 8884 dataTypes.shift(); 8885 if ( ct === undefined ) { 8886 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 8887 } 8888 } 8889 8890 // Check if we're dealing with a known content-type 8891 if ( ct ) { 8892 for ( type in contents ) { 8893 if ( contents[ type ] && contents[ type ].test( ct ) ) { 8894 dataTypes.unshift( type ); 8895 break; 8896 } 8897 } 8898 } 8899 8900 // Check to see if we have a response for the expected dataType 8901 if ( dataTypes[ 0 ] in responses ) { 8902 finalDataType = dataTypes[ 0 ]; 8903 } else { 8904
vendor: 9,521 bytes, lines 8905-9280
8905 // Try convertible dataTypes 8906 for ( type in responses ) { 8907 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 8908 finalDataType = type; 8909 break; 8910 } 8911 if ( !firstDataType ) { 8912 firstDataType = type; 8913 } 8914 } 8915 8916 // Or just use first one 8917 finalDataType = finalDataType || firstDataType; 8918 } 8919 8920 // If we found a dataType 8921 // We add the dataType to the list if needed 8922 // and return the corresponding response 8923 if ( finalDataType ) { 8924 if ( finalDataType !== dataTypes[ 0 ] ) { 8925 dataTypes.unshift( finalDataType ); 8926 } 8927 return responses[ finalDataType ]; 8928 } 8929} 8930 8931/* Chain conversions given the request and the original response 8932 * Also sets the responseXXX fields on the jqXHR instance 8933 */ 8934function ajaxConvert( s, response, jqXHR, isSuccess ) { 8935 var conv2, current, conv, tmp, prev, 8936 converters = {}, 8937 8938 // Work with a copy of dataTypes in case we need to modify it for conversion 8939 dataTypes = s.dataTypes.slice(); 8940 8941 // Create converters map with lowercased keys 8942 if ( dataTypes[ 1 ] ) { 8943 for ( conv in s.converters ) { 8944 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 8945 } 8946 } 8947 8948 current = dataTypes.shift(); 8949 8950 // Convert to each sequential dataType 8951 while ( current ) { 8952 8953 if ( s.responseFields[ current ] ) { 8954 jqXHR[ s.responseFields[ current ] ] = response; 8955 } 8956 8957 // Apply the dataFilter if provided 8958 if ( !prev && isSuccess && s.dataFilter ) { 8959 response = s.dataFilter( response, s.dataType ); 8960 } 8961 8962 prev = current; 8963 current = dataTypes.shift(); 8964 8965 if ( current ) { 8966 8967 // There's only work to do if current dataType is non-auto 8968 if ( current === "*" ) { 8969 8970 current = prev; 8971 8972 // Convert response if prev dataType is non-auto and differs from current 8973 } else if ( prev !== "*" && prev !== current ) { 8974 8975 // Seek a direct converter 8976 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 8977 8978 // If none found, seek a pair 8979 if ( !conv ) { 8980 for ( conv2 in converters ) { 8981 8982 // If conv2 outputs current 8983 tmp = conv2.split( " " ); 8984 if ( tmp[ 1 ] === current ) { 8985 8986 // If prev can be converted to accepted input 8987 conv = converters[ prev + " " + tmp[ 0 ] ] || 8988 converters[ "* " + tmp[ 0 ] ]; 8989 if ( conv ) { 8990 8991 // Condense equivalence converters 8992 if ( conv === true ) { 8993 conv = converters[ conv2 ]; 8994 8995 // Otherwise, insert the intermediate dataType 8996 } else if ( converters[ conv2 ] !== true ) { 8997 current = tmp[ 0 ]; 8998 dataTypes.unshift( tmp[ 1 ] ); 8999 } 9000 break; 9001 } 9002 } 9003 } 9004 } 9005 9006 // Apply converter (if not an equivalence) 9007 if ( conv !== true ) { 9008 9009 // Unless errors are allowed to bubble, catch and return them 9010 if ( conv && s.throws ) { 9011 response = conv( response ); 9012 } else { 9013 try { 9014 response = conv( response ); 9015 } catch ( e ) { 9016 return { 9017 state: "parsererror", 9018 error: conv ? e : "No conversion from " + prev + " to " + current 9019 }; 9020 } 9021 } 9022 } 9023 } 9024 } 9025 } 9026 9027 return { state: "success", data: response }; 9028} 9029 9030jQuery.extend( { 9031 9032 // Counter for holding the number of active queries 9033 active: 0, 9034 9035 // Last-Modified header cache for next request 9036 lastModified: {}, 9037 etag: {}, 9038 9039 ajaxSettings: { 9040 url: location.href, 9041 type: "GET", 9042 isLocal: rlocalProtocol.test( location.protocol ), 9043 global: true, 9044 processData: true, 9045 async: true, 9046 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9047 9048 /* 9049 timeout: 0, 9050 data: null, 9051 dataType: null, 9052 username: null, 9053 password: null, 9054 cache: null, 9055 throws: false, 9056 traditional: false, 9057 headers: {}, 9058 */ 9059 9060 accepts: { 9061 "*": allTypes, 9062 text: "text/plain", 9063 html: "text/html", 9064 xml: "application/xml, text/xml", 9065 json: "application/json, text/javascript" 9066 }, 9067 9068 contents: { 9069 xml: /\bxml\b/, 9070 html: /\bhtml/, 9071 json: /\bjson\b/ 9072 }, 9073 9074 responseFields: { 9075 xml: "responseXML", 9076 text: "responseText", 9077 json: "responseJSON" 9078 }, 9079 9080 // Data converters 9081 // Keys separate source (or catchall "*") and destination types with a single space 9082 converters: { 9083 9084 // Convert anything to text 9085 "* text": String, 9086 9087 // Text to html (true = no transformation) 9088 "text html": true, 9089 9090 // Evaluate text as a json expression 9091 "text json": JSON.parse, 9092 9093 // Parse text as xml 9094 "text xml": jQuery.parseXML 9095 }, 9096 9097 // For options that shouldn't be deep extended: 9098 // you can add your own custom options here if 9099 // and when you create one that shouldn't be 9100 // deep extended (see ajaxExtend) 9101 flatOptions: { 9102 url: true, 9103 context: true 9104 } 9105 }, 9106 9107 // Creates a full fledged settings object into target 9108 // with both ajaxSettings and settings fields. 9109 // If target is omitted, writes into ajaxSettings. 9110 ajaxSetup: function( target, settings ) { 9111 return settings ? 9112 9113 // Building a settings object 9114 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 9115 9116 // Extending ajaxSettings 9117 ajaxExtend( jQuery.ajaxSettings, target ); 9118 }, 9119 9120 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 9121 ajaxTransport: addToPrefiltersOrTransports( transports ), 9122 9123 // Main method 9124 ajax: function( url, options ) { 9125 9126 // If url is an object, simulate pre-1.5 signature 9127 if ( typeof url === "object" ) { 9128 options = url; 9129 url = undefined; 9130 } 9131 9132 // Force options to be an object 9133 options = options || {}; 9134 9135 var transport, 9136 9137 // URL without anti-cache param 9138 cacheURL, 9139 9140 // Response headers 9141 responseHeadersString, 9142 responseHeaders, 9143 9144 // timeout handle 9145 timeoutTimer, 9146 9147 // Url cleanup var 9148 urlAnchor, 9149 9150 // Request state (becomes false upon send and true upon completion) 9151 completed, 9152 9153 // To know if global events are to be dispatched 9154 fireGlobals, 9155 9156 // Loop variable 9157 i, 9158 9159 // uncached part of the url 9160 uncached, 9161 9162 // Create the final options object 9163 s = jQuery.ajaxSetup( {}, options ), 9164 9165 // Callbacks context 9166 callbackContext = s.context || s, 9167 9168 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9169 globalEventContext = s.context && 9170 ( callbackContext.nodeType || callbackContext.jquery ) ? 9171 jQuery( callbackContext ) : 9172 jQuery.event, 9173 9174 // Deferreds 9175 deferred = jQuery.Deferred(), 9176 completeDeferred = jQuery.Callbacks( "once memory" ), 9177 9178 // Status-dependent callbacks 9179 statusCode = s.statusCode || {}, 9180 9181 // Headers (they are sent all at once) 9182 requestHeaders = {}, 9183 requestHeadersNames = {}, 9184 9185 // Default abort message 9186 strAbort = "canceled", 9187 9188 // Fake xhr 9189 jqXHR = { 9190 readyState: 0, 9191 9192 // Builds headers hashtable if needed 9193 getResponseHeader: function( key ) { 9194 var match; 9195 if ( completed ) { 9196 if ( !responseHeaders ) { 9197 responseHeaders = {}; 9198 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 9199 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 9200 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 9201 .concat( match[ 2 ] ); 9202 } 9203 } 9204 match = responseHeaders[ key.toLowerCase() + " " ]; 9205 } 9206 return match == null ? null : match.join( ", " ); 9207 }, 9208 9209 // Raw string 9210 getAllResponseHeaders: function() { 9211 return completed ? responseHeadersString : null; 9212 }, 9213 9214 // Caches the header 9215 setRequestHeader: function( name, value ) { 9216 if ( completed == null ) { 9217 name = requestHeadersNames[ name.toLowerCase() ] = 9218 requestHeadersNames[ name.toLowerCase() ] || name; 9219 requestHeaders[ name ] = value; 9220 } 9221 return this; 9222 }, 9223 9224 // Overrides response content-type header 9225 overrideMimeType: function( type ) { 9226 if ( completed == null ) { 9227 s.mimeType = type; 9228 } 9229 return this; 9230 }, 9231 9232 // Status-dependent callbacks 9233 statusCode: function( map ) { 9234 var code; 9235 if ( map ) { 9236 if ( completed ) { 9237 9238 // Execute the appropriate callbacks 9239 jqXHR.always( map[ jqXHR.status ] ); 9240 } else { 9241 9242 // Lazy-add the new callbacks in a way that preserves old ones 9243 for ( code in map ) { 9244 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 9245 } 9246 } 9247 } 9248 return this; 9249 }, 9250 9251 // Cancel the request 9252 abort: function( statusText ) { 9253 var finalText = statusText || strAbort; 9254 if ( transport ) { 9255 transport.abort( finalText ); 9256 } 9257 done( 0, finalText ); 9258 return this; 9259 } 9260 }; 9261 9262 // Attach deferreds 9263 deferred.promise( jqXHR ); 9264 9265 // Add protocol if not provided (prefilters might expect it) 9266 // Handle falsy url in the settings object (#10093: consistency with old signature) 9267 // We also use the url parameter if available 9268 s.url = ( ( url || s.url || location.href ) + "" ) 9269 .replace( rprotocol, location.protocol + "//" ); 9270 9271 // Alias method option to type as per ticket #12004 9272 s.type = options.method || options.type || s.method || s.type; 9273 9274 // Extract dataTypes list 9275 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 9276 9277 // A cross-domain request is in order when the origin doesn't match the current origin. 9278 if ( s.crossDomain == null ) { 9279 urlAnchor = document.createElement( "a" ); 9280
vendor: 9,555 bytes, lines 9281-9616
9281 // Support: IE <=8 - 11, Edge 12 - 15 9282 // IE throws exception on accessing the href property if url is malformed, 9283 // e.g. http://example.com:80x/ 9284 try { 9285 urlAnchor.href = s.url; 9286 9287 // Support: IE <=8 - 11 only 9288 // Anchor's host property isn't correctly set when s.url is relative 9289 urlAnchor.href = urlAnchor.href; 9290 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 9291 urlAnchor.protocol + "//" + urlAnchor.host; 9292 } catch ( e ) { 9293 9294 // If there is an error parsing the URL, assume it is crossDomain, 9295 // it can be rejected by the transport if it is invalid 9296 s.crossDomain = true; 9297 } 9298 } 9299 9300 // Convert data if not already a string 9301 if ( s.data && s.processData && typeof s.data !== "string" ) { 9302 s.data = jQuery.param( s.data, s.traditional ); 9303 } 9304 9305 // Apply prefilters 9306 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 9307 9308 // If request was aborted inside a prefilter, stop there 9309 if ( completed ) { 9310 return jqXHR; 9311 } 9312 9313 // We can fire global events as of now if asked to 9314 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 9315 fireGlobals = jQuery.event && s.global; 9316 9317 // Watch for a new set of requests 9318 if ( fireGlobals && jQuery.active++ === 0 ) { 9319 jQuery.event.trigger( "ajaxStart" ); 9320 } 9321 9322 // Uppercase the type 9323 s.type = s.type.toUpperCase(); 9324 9325 // Determine if request has content 9326 s.hasContent = !rnoContent.test( s.type ); 9327 9328 // Save the URL in case we're toying with the If-Modified-Since 9329 // and/or If-None-Match header later on 9330 // Remove hash to simplify url manipulation 9331 cacheURL = s.url.replace( rhash, "" ); 9332 9333 // More options handling for requests with no content 9334 if ( !s.hasContent ) { 9335 9336 // Remember the hash so we can put it back 9337 uncached = s.url.slice( cacheURL.length ); 9338 9339 // If data is available and should be processed, append data to url 9340 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 9341 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 9342 9343 // #9682: remove data so that it's not used in an eventual retry 9344 delete s.data; 9345 } 9346 9347 // Add or update anti-cache param if needed 9348 if ( s.cache === false ) { 9349 cacheURL = cacheURL.replace( rantiCache, "$1" ); 9350 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; 9351 } 9352 9353 // Put hash and anti-cache on the URL that will be requested (gh-1732) 9354 s.url = cacheURL + uncached; 9355 9356 // Change '%20' to '+' if this is encoded form body content (gh-2658) 9357 } else if ( s.data && s.processData && 9358 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 9359 s.data = s.data.replace( r20, "+" ); 9360 } 9361 9362 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9363 if ( s.ifModified ) { 9364 if ( jQuery.lastModified[ cacheURL ] ) { 9365 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 9366 } 9367 if ( jQuery.etag[ cacheURL ] ) { 9368 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 9369 } 9370 } 9371 9372 // Set the correct header, if data is being sent 9373 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 9374 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 9375 } 9376 9377 // Set the Accepts header for the server, depending on the dataType 9378 jqXHR.setRequestHeader( 9379 "Accept", 9380 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 9381 s.accepts[ s.dataTypes[ 0 ] ] + 9382 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 9383 s.accepts[ "*" ] 9384 ); 9385 9386 // Check for headers option 9387 for ( i in s.headers ) { 9388 jqXHR.setRequestHeader( i, s.headers[ i ] ); 9389 } 9390 9391 // Allow custom headers/mimetypes and early abort 9392 if ( s.beforeSend && 9393 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 9394 9395 // Abort if not done already and return 9396 return jqXHR.abort(); 9397 } 9398 9399 // Aborting is no longer a cancellation 9400 strAbort = "abort"; 9401 9402 // Install callbacks on deferreds 9403 completeDeferred.add( s.complete ); 9404 jqXHR.done( s.success ); 9405 jqXHR.fail( s.error ); 9406 9407 // Get transport 9408 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 9409 9410 // If no transport, we auto-abort 9411 if ( !transport ) { 9412 done( -1, "No Transport" ); 9413 } else { 9414 jqXHR.readyState = 1; 9415 9416 // Send global event 9417 if ( fireGlobals ) { 9418 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 9419 } 9420 9421 // If request was aborted inside ajaxSend, stop there 9422 if ( completed ) { 9423 return jqXHR; 9424 } 9425 9426 // Timeout 9427 if ( s.async && s.timeout > 0 ) { 9428 timeoutTimer = window.setTimeout( function() { 9429 jqXHR.abort( "timeout" ); 9430 }, s.timeout ); 9431 } 9432 9433 try { 9434 completed = false; 9435 transport.send( requestHeaders, done ); 9436 } catch ( e ) { 9437 9438 // Rethrow post-completion exceptions 9439 if ( completed ) { 9440 throw e; 9441 } 9442 9443 // Propagate others as results 9444 done( -1, e ); 9445 } 9446 } 9447 9448 // Callback for when everything is done 9449 function done( status, nativeStatusText, responses, headers ) { 9450 var isSuccess, success, error, response, modified, 9451 statusText = nativeStatusText; 9452 9453 // Ignore repeat invocations 9454 if ( completed ) { 9455 return; 9456 } 9457 9458 completed = true; 9459 9460 // Clear timeout if it exists 9461 if ( timeoutTimer ) { 9462 window.clearTimeout( timeoutTimer ); 9463 } 9464 9465 // Dereference transport for early garbage collection 9466 // (no matter how long the jqXHR object will be used) 9467 transport = undefined; 9468 9469 // Cache response headers 9470 responseHeadersString = headers || ""; 9471 9472 // Set readyState 9473 jqXHR.readyState = status > 0 ? 4 : 0; 9474 9475 // Determine if successful 9476 isSuccess = status >= 200 && status < 300 || status === 304; 9477 9478 // Get response data 9479 if ( responses ) { 9480 response = ajaxHandleResponses( s, jqXHR, responses ); 9481 } 9482 9483 // Convert no matter what (that way responseXXX fields are always set) 9484 response = ajaxConvert( s, response, jqXHR, isSuccess ); 9485 9486 // If successful, handle type chaining 9487 if ( isSuccess ) { 9488 9489 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9490 if ( s.ifModified ) { 9491 modified = jqXHR.getResponseHeader( "Last-Modified" ); 9492 if ( modified ) { 9493 jQuery.lastModified[ cacheURL ] = modified; 9494 } 9495 modified = jqXHR.getResponseHeader( "etag" ); 9496 if ( modified ) { 9497 jQuery.etag[ cacheURL ] = modified; 9498 } 9499 } 9500 9501 // if no content 9502 if ( status === 204 || s.type === "HEAD" ) { 9503 statusText = "nocontent"; 9504 9505 // if not modified 9506 } else if ( status === 304 ) { 9507 statusText = "notmodified"; 9508 9509 // If we have data, let's convert it 9510 } else { 9511 statusText = response.state; 9512 success = response.data; 9513 error = response.error; 9514 isSuccess = !error; 9515 } 9516 } else { 9517 9518 // Extract error from statusText and normalize for non-aborts 9519 error = statusText; 9520 if ( status || !statusText ) { 9521 statusText = "error"; 9522 if ( status < 0 ) { 9523 status = 0; 9524 } 9525 } 9526 } 9527 9528 // Set data for the fake xhr object 9529 jqXHR.status = status; 9530 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 9531 9532 // Success/Error 9533 if ( isSuccess ) { 9534 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 9535 } else { 9536 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 9537 } 9538 9539 // Status-dependent callbacks 9540 jqXHR.statusCode( statusCode ); 9541 statusCode = undefined; 9542 9543 if ( fireGlobals ) { 9544 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 9545 [ jqXHR, s, isSuccess ? success : error ] ); 9546 } 9547 9548 // Complete 9549 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 9550 9551 if ( fireGlobals ) { 9552 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 9553 9554 // Handle the global AJAX counter 9555 if ( !( --jQuery.active ) ) { 9556 jQuery.event.trigger( "ajaxStop" ); 9557 } 9558 } 9559 } 9560 9561 return jqXHR; 9562 }, 9563 9564 getJSON: function( url, data, callback ) { 9565 return jQuery.get( url, data, callback, "json" ); 9566 }, 9567 9568 getScript: function( url, callback ) { 9569 return jQuery.get( url, undefined, callback, "script" ); 9570 } 9571} ); 9572 9573jQuery.each( [ "get", "post" ], function( i, method ) { 9574 jQuery[ method ] = function( url, data, callback, type ) { 9575 9576 // Shift arguments if data argument was omitted 9577 if ( isFunction( data ) ) { 9578 type = type || callback; 9579 callback = data; 9580 data = undefined; 9581 } 9582 9583 // The url can be an options object (which then must have .url) 9584 return jQuery.ajax( jQuery.extend( { 9585 url: url, 9586 type: method, 9587 dataType: type, 9588 data: data, 9589 success: callback 9590 }, jQuery.isPlainObject( url ) && url ) ); 9591 }; 9592} ); 9593 9594 9595jQuery._evalUrl = function( url, options ) { 9596 return jQuery.ajax( { 9597 url: url, 9598 9599 // Make this explicit, since user can override this through ajaxSetup (#11264) 9600 type: "GET", 9601 dataType: "script", 9602 cache: true, 9603 async: false, 9604 global: false, 9605 9606 // Only evaluate the response if it is successful (gh-4126) 9607 // dataFilter is not invoked for failure responses, so using it instead 9608 // of the default converter is kludgy but it works. 9609 converters: { 9610 "text script": function() {} 9611 }, 9612 dataFilter: function( response ) { 9613 jQuery.globalEval( response, options ); 9614 } 9615 } ); 9616};
vendor: 12,096 bytes, lines 9617-10078
9617 9618 9619jQuery.fn.extend( { 9620 wrapAll: function( html ) { 9621 var wrap; 9622 9623 if ( this[ 0 ] ) { 9624 if ( isFunction( html ) ) { 9625 html = html.call( this[ 0 ] ); 9626 } 9627 9628 // The elements to wrap the target around 9629 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 9630 9631 if ( this[ 0 ].parentNode ) { 9632 wrap.insertBefore( this[ 0 ] ); 9633 } 9634 9635 wrap.map( function() { 9636 var elem = this; 9637 9638 while ( elem.firstElementChild ) { 9639 elem = elem.firstElementChild; 9640 } 9641 9642 return elem; 9643 } ).append( this ); 9644 } 9645 9646 return this; 9647 }, 9648 9649 wrapInner: function( html ) { 9650 if ( isFunction( html ) ) { 9651 return this.each( function( i ) { 9652 jQuery( this ).wrapInner( html.call( this, i ) ); 9653 } ); 9654 } 9655 9656 return this.each( function() { 9657 var self = jQuery( this ), 9658 contents = self.contents(); 9659 9660 if ( contents.length ) { 9661 contents.wrapAll( html ); 9662 9663 } else { 9664 self.append( html ); 9665 } 9666 } ); 9667 }, 9668 9669 wrap: function( html ) { 9670 var htmlIsFunction = isFunction( html ); 9671 9672 return this.each( function( i ) { 9673 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 9674 } ); 9675 }, 9676 9677 unwrap: function( selector ) { 9678 this.parent( selector ).not( "body" ).each( function() { 9679 jQuery( this ).replaceWith( this.childNodes ); 9680 } ); 9681 return this; 9682 } 9683} ); 9684 9685 9686jQuery.expr.pseudos.hidden = function( elem ) { 9687 return !jQuery.expr.pseudos.visible( elem ); 9688}; 9689jQuery.expr.pseudos.visible = function( elem ) { 9690 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 9691}; 9692 9693 9694 9695 9696jQuery.ajaxSettings.xhr = function() { 9697 try { 9698 return new window.XMLHttpRequest(); 9699 } catch ( e ) {} 9700}; 9701 9702var xhrSuccessStatus = { 9703 9704 // File protocol always yields status code 0, assume 200 9705 0: 200, 9706 9707 // Support: IE <=9 only 9708 // #1450: sometimes IE returns 1223 when it should be 204 9709 1223: 204 9710 }, 9711 xhrSupported = jQuery.ajaxSettings.xhr(); 9712 9713support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 9714support.ajax = xhrSupported = !!xhrSupported; 9715 9716jQuery.ajaxTransport( function( options ) { 9717 var callback, errorCallback; 9718 9719 // Cross domain only allowed if supported through XMLHttpRequest 9720 if ( support.cors || xhrSupported && !options.crossDomain ) { 9721 return { 9722 send: function( headers, complete ) { 9723 var i, 9724 xhr = options.xhr(); 9725 9726 xhr.open( 9727 options.type, 9728 options.url, 9729 options.async, 9730 options.username, 9731 options.password 9732 ); 9733 9734 // Apply custom fields if provided 9735 if ( options.xhrFields ) { 9736 for ( i in options.xhrFields ) { 9737 xhr[ i ] = options.xhrFields[ i ]; 9738 } 9739 } 9740 9741 // Override mime type if needed 9742 if ( options.mimeType && xhr.overrideMimeType ) { 9743 xhr.overrideMimeType( options.mimeType ); 9744 } 9745 9746 // X-Requested-With header 9747 // For cross-domain requests, seeing as conditions for a preflight are 9748 // akin to a jigsaw puzzle, we simply never set it to be sure. 9749 // (it can always be set on a per-request basis or even using ajaxSetup) 9750 // For same-domain requests, won't change header if already provided. 9751 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 9752 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 9753 } 9754 9755 // Set headers 9756 for ( i in headers ) { 9757 xhr.setRequestHeader( i, headers[ i ] ); 9758 } 9759 9760 // Callback 9761 callback = function( type ) { 9762 return function() { 9763 if ( callback ) { 9764 callback = errorCallback = xhr.onload = 9765 xhr.onerror = xhr.onabort = xhr.ontimeout = 9766 xhr.onreadystatechange = null; 9767 9768 if ( type === "abort" ) { 9769 xhr.abort(); 9770 } else if ( type === "error" ) { 9771 9772 // Support: IE <=9 only 9773 // On a manual native abort, IE9 throws 9774 // errors on any property access that is not readyState 9775 if ( typeof xhr.status !== "number" ) { 9776 complete( 0, "error" ); 9777 } else { 9778 complete( 9779 9780 // File: protocol always yields status 0; see #8605, #14207 9781 xhr.status, 9782 xhr.statusText 9783 ); 9784 } 9785 } else { 9786 complete( 9787 xhrSuccessStatus[ xhr.status ] || xhr.status, 9788 xhr.statusText, 9789 9790 // Support: IE <=9 only 9791 // IE9 has no XHR2 but throws on binary (trac-11426) 9792 // For XHR2 non-text, let the caller handle it (gh-2498) 9793 ( xhr.responseType || "text" ) !== "text" || 9794 typeof xhr.responseText !== "string" ? 9795 { binary: xhr.response } : 9796 { text: xhr.responseText }, 9797 xhr.getAllResponseHeaders() 9798 ); 9799 } 9800 } 9801 }; 9802 }; 9803 9804 // Listen to events 9805 xhr.onload = callback(); 9806 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 9807 9808 // Support: IE 9 only 9809 // Use onreadystatechange to replace onabort 9810 // to handle uncaught aborts 9811 if ( xhr.onabort !== undefined ) { 9812 xhr.onabort = errorCallback; 9813 } else { 9814 xhr.onreadystatechange = function() { 9815 9816 // Check readyState before timeout as it changes 9817 if ( xhr.readyState === 4 ) { 9818 9819 // Allow onerror to be called first, 9820 // but that will not handle a native abort 9821 // Also, save errorCallback to a variable 9822 // as xhr.onerror cannot be accessed 9823 window.setTimeout( function() { 9824 if ( callback ) { 9825 errorCallback(); 9826 } 9827 } ); 9828 } 9829 }; 9830 } 9831 9832 // Create the abort callback 9833 callback = callback( "abort" ); 9834 9835 try { 9836 9837 // Do send the request (this may raise an exception) 9838 xhr.send( options.hasContent && options.data || null ); 9839 } catch ( e ) { 9840 9841 // #14683: Only rethrow if this hasn't been notified as an error yet 9842 if ( callback ) { 9843 throw e; 9844 } 9845 } 9846 }, 9847 9848 abort: function() { 9849 if ( callback ) { 9850 callback(); 9851 } 9852 } 9853 }; 9854 } 9855} ); 9856 9857 9858 9859 9860// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 9861jQuery.ajaxPrefilter( function( s ) { 9862 if ( s.crossDomain ) { 9863 s.contents.script = false; 9864 } 9865} ); 9866 9867// Install script dataType 9868jQuery.ajaxSetup( { 9869 accepts: { 9870 script: "text/javascript, application/javascript, " + 9871 "application/ecmascript, application/x-ecmascript" 9872 }, 9873 contents: { 9874 script: /\b(?:java|ecma)script\b/ 9875 }, 9876 converters: { 9877 "text script": function( text ) { 9878 jQuery.globalEval( text ); 9879 return text; 9880 } 9881 } 9882} ); 9883 9884// Handle cache's special case and crossDomain 9885jQuery.ajaxPrefilter( "script", function( s ) { 9886 if ( s.cache === undefined ) { 9887 s.cache = false; 9888 } 9889 if ( s.crossDomain ) { 9890 s.type = "GET"; 9891 } 9892} ); 9893 9894// Bind script tag hack transport 9895jQuery.ajaxTransport( "script", function( s ) { 9896 9897 // This transport only deals with cross domain or forced-by-attrs requests 9898 if ( s.crossDomain || s.scriptAttrs ) { 9899 var script, callback; 9900 return { 9901 send: function( _, complete ) { 9902 script = jQuery( "<script>" ) 9903 .attr( s.scriptAttrs || {} ) 9904 .prop( { charset: s.scriptCharset, src: s.url } ) 9905 .on( "load error", callback = function( evt ) { 9906 script.remove(); 9907 callback = null; 9908 if ( evt ) { 9909 complete( evt.type === "error" ? 404 : 200, evt.type ); 9910 } 9911 } ); 9912 9913 // Use native DOM manipulation to avoid our domManip AJAX trickery 9914 document.head.appendChild( script[ 0 ] ); 9915 }, 9916 abort: function() { 9917 if ( callback ) { 9918 callback(); 9919 } 9920 } 9921 }; 9922 } 9923} ); 9924 9925 9926 9927 9928var oldCallbacks = [], 9929 rjsonp = /(=)\?(?=&|$)|\?\?/; 9930 9931// Default jsonp settings 9932jQuery.ajaxSetup( { 9933 jsonp: "callback", 9934 jsonpCallback: function() { 9935 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 9936 this[ callback ] = true; 9937 return callback; 9938 } 9939} ); 9940 9941// Detect, normalize options and install callbacks for jsonp requests 9942jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 9943 9944 var callbackName, overwritten, responseContainer, 9945 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 9946 "url" : 9947 typeof s.data === "string" && 9948 ( s.contentType || "" ) 9949 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 9950 rjsonp.test( s.data ) && "data" 9951 ); 9952 9953 // Handle iff the expected data type is "jsonp" or we have a parameter to set 9954 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 9955 9956 // Get callback name, remembering preexisting value associated with it 9957 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 9958 s.jsonpCallback() : 9959 s.jsonpCallback; 9960 9961 // Insert callback into url or form data 9962 if ( jsonProp ) { 9963 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 9964 } else if ( s.jsonp !== false ) { 9965 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 9966 } 9967 9968 // Use data converter to retrieve json after script execution 9969 s.converters[ "script json" ] = function() { 9970 if ( !responseContainer ) { 9971 jQuery.error( callbackName + " was not called" ); 9972 } 9973 return responseContainer[ 0 ]; 9974 }; 9975 9976 // Force json dataType 9977 s.dataTypes[ 0 ] = "json"; 9978 9979 // Install callback 9980 overwritten = window[ callbackName ]; 9981 window[ callbackName ] = function() { 9982 responseContainer = arguments; 9983 }; 9984 9985 // Clean-up function (fires after converters) 9986 jqXHR.always( function() { 9987 9988 // If previous value didn't exist - remove it 9989 if ( overwritten === undefined ) { 9990 jQuery( window ).removeProp( callbackName ); 9991 9992 // Otherwise restore preexisting value 9993 } else { 9994 window[ callbackName ] = overwritten; 9995 } 9996 9997 // Save back as free 9998 if ( s[ callbackName ] ) { 9999 10000 // Make sure that re-using the options doesn't screw things around 10001 s.jsonpCallback = originalSettings.jsonpCallback; 10002 10003 // Save the callback name for future use 10004 oldCallbacks.push( callbackName ); 10005 } 10006 10007 // Call if it was a function and we have a response 10008 if ( responseContainer && isFunction( overwritten ) ) { 10009 overwritten( responseContainer[ 0 ] ); 10010 } 10011 10012 responseContainer = overwritten = undefined; 10013 } ); 10014 10015 // Delegate to script 10016 return "script"; 10017 } 10018} ); 10019 10020 10021 10022 10023// Support: Safari 8 only 10024// In Safari 8 documents created via document.implementation.createHTMLDocument 10025// collapse sibling forms: the second one becomes a child of the first one. 10026// Because of that, this security measure has to be disabled in Safari 8. 10027// https://bugs.webkit.org/show_bug.cgi?id=137337 10028support.createHTMLDocument = ( function() { 10029 var body = document.implementation.createHTMLDocument( "" ).body; 10030 body.innerHTML = "<form></form><form></form>"; 10031 return body.childNodes.length === 2; 10032} )(); 10033 10034 10035// Argument "data" should be string of html 10036// context (optional): If specified, the fragment will be created in this context, 10037// defaults to document 10038// keepScripts (optional): If true, will include scripts passed in the html string 10039jQuery.parseHTML = function( data, context, keepScripts ) { 10040 if ( typeof data !== "string" ) { 10041 return []; 10042 } 10043 if ( typeof context === "boolean" ) { 10044 keepScripts = context; 10045 context = false; 10046 } 10047 10048 var base, parsed, scripts; 10049 10050 if ( !context ) { 10051 10052 // Stop scripts or inline event handlers from being executed immediately 10053 // by using document.implementation 10054 if ( support.createHTMLDocument ) { 10055 context = document.implementation.createHTMLDocument( "" ); 10056 10057 // Set the base href for the created document 10058 // so any parsed elements with URLs 10059 // are based on the document's URL (gh-2965) 10060 base = context.createElement( "base" ); 10061 base.href = document.location.href; 10062 context.head.appendChild( base ); 10063 } else { 10064 context = document; 10065 } 10066 } 10067 10068 parsed = rsingleTag.exec( data ); 10069 scripts = !keepScripts && []; 10070 10071 // Single tag 10072 if ( parsed ) { 10073 return [ context.createElement( parsed[ 1 ] ) ]; 10074 } 10075 10076 parsed = buildFragment( [ data ], context, scripts ); 10077 10078 if ( scripts && scripts.length ) {
vendor: 4,309 bytes, lines 10079-10251
10079 jQuery( scripts ).remove(); 10080 } 10081 10082 return jQuery.merge( [], parsed.childNodes ); 10083}; 10084 10085 10086/** 10087 * Load a url into a page 10088 */ 10089jQuery.fn.load = function( url, params, callback ) { 10090 var selector, type, response, 10091 self = this, 10092 off = url.indexOf( " " ); 10093 10094 if ( off > -1 ) { 10095 selector = stripAndCollapse( url.slice( off ) ); 10096 url = url.slice( 0, off ); 10097 } 10098 10099 // If it's a function 10100 if ( isFunction( params ) ) { 10101 10102 // We assume that it's the callback 10103 callback = params; 10104 params = undefined; 10105 10106 // Otherwise, build a param string 10107 } else if ( params && typeof params === "object" ) { 10108 type = "POST"; 10109 } 10110 10111 // If we have elements to modify, make the request 10112 if ( self.length > 0 ) { 10113 jQuery.ajax( { 10114 url: url, 10115 10116 // If "type" variable is undefined, then "GET" method will be used. 10117 // Make value of this field explicit since 10118 // user can override it through ajaxSetup method 10119 type: type || "GET", 10120 dataType: "html", 10121 data: params 10122 } ).done( function( responseText ) { 10123 10124 // Save response for use in complete callback 10125 response = arguments; 10126 10127 self.html( selector ? 10128 10129 // If a selector was specified, locate the right elements in a dummy div 10130 // Exclude scripts to avoid IE 'Permission Denied' errors 10131 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 10132 10133 // Otherwise use the full result 10134 responseText ); 10135 10136 // If the request succeeds, this function gets "data", "status", "jqXHR" 10137 // but they are ignored because response was set above. 10138 // If it fails, this function gets "jqXHR", "status", "error" 10139 } ).always( callback && function( jqXHR, status ) { 10140 self.each( function() { 10141 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 10142 } ); 10143 } ); 10144 } 10145 10146 return this; 10147}; 10148 10149 10150 10151 10152// Attach a bunch of functions for handling common AJAX events 10153jQuery.each( [ 10154 "ajaxStart", 10155 "ajaxStop", 10156 "ajaxComplete", 10157 "ajaxError", 10158 "ajaxSuccess", 10159 "ajaxSend" 10160], function( i, type ) { 10161 jQuery.fn[ type ] = function( fn ) { 10162 return this.on( type, fn ); 10163 }; 10164} ); 10165 10166 10167 10168 10169jQuery.expr.pseudos.animated = function( elem ) { 10170 return jQuery.grep( jQuery.timers, function( fn ) { 10171 return elem === fn.elem; 10172 } ).length; 10173}; 10174 10175 10176 10177 10178jQuery.offset = { 10179 setOffset: function( elem, options, i ) { 10180 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 10181 position = jQuery.css( elem, "position" ), 10182 curElem = jQuery( elem ), 10183 props = {}; 10184 10185 // Set position first, in-case top/left are set even on static elem 10186 if ( position === "static" ) { 10187 elem.style.position = "relative"; 10188 } 10189 10190 curOffset = curElem.offset(); 10191 curCSSTop = jQuery.css( elem, "top" ); 10192 curCSSLeft = jQuery.css( elem, "left" ); 10193 calculatePosition = ( position === "absolute" || position === "fixed" ) && 10194 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 10195 10196 // Need to be able to calculate position if either 10197 // top or left is auto and position is either absolute or fixed 10198 if ( calculatePosition ) { 10199 curPosition = curElem.position(); 10200 curTop = curPosition.top; 10201 curLeft = curPosition.left; 10202 10203 } else { 10204 curTop = parseFloat( curCSSTop ) || 0; 10205 curLeft = parseFloat( curCSSLeft ) || 0; 10206 } 10207 10208 if ( isFunction( options ) ) { 10209 10210 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10211 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 10212 } 10213 10214 if ( options.top != null ) { 10215 props.top = ( options.top - curOffset.top ) + curTop; 10216 } 10217 if ( options.left != null ) { 10218 props.left = ( options.left - curOffset.left ) + curLeft; 10219 } 10220 10221 if ( "using" in options ) { 10222 options.using.call( elem, props ); 10223 10224 } else { 10225 curElem.css( props ); 10226 } 10227 } 10228}; 10229 10230jQuery.fn.extend( { 10231 10232 // offset() relates an element's border box to the document origin 10233 offset: function( options ) { 10234 10235 // Preserve chaining for setter 10236 if ( arguments.length ) { 10237 return options === undefined ? 10238 this : 10239 this.each( function( i ) { 10240 jQuery.offset.setOffset( this, options, i ); 10241 } ); 10242 } 10243 10244 var rect, win, 10245 elem = this[ 0 ]; 10246 10247 if ( !elem ) { 10248 return; 10249 } 10250 10251 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
vendor: 4,783 bytes, lines 10252-10392
10252 // Support: IE <=11 only 10253 // Running getBoundingClientRect on a 10254 // disconnected node in IE throws an error 10255 if ( !elem.getClientRects().length ) { 10256 return { top: 0, left: 0 }; 10257 } 10258 10259 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 10260 rect = elem.getBoundingClientRect(); 10261 win = elem.ownerDocument.defaultView; 10262 return { 10263 top: rect.top + win.pageYOffset, 10264 left: rect.left + win.pageXOffset 10265 }; 10266 }, 10267 10268 // position() relates an element's margin box to its offset parent's padding box 10269 // This corresponds to the behavior of CSS absolute positioning 10270 position: function() { 10271 if ( !this[ 0 ] ) { 10272 return; 10273 } 10274 10275 var offsetParent, offset, doc, 10276 elem = this[ 0 ], 10277 parentOffset = { top: 0, left: 0 }; 10278 10279 // position:fixed elements are offset from the viewport, which itself always has zero offset 10280 if ( jQuery.css( elem, "position" ) === "fixed" ) { 10281 10282 // Assume position:fixed implies availability of getBoundingClientRect 10283 offset = elem.getBoundingClientRect(); 10284 10285 } else { 10286 offset = this.offset(); 10287 10288 // Account for the *real* offset parent, which can be the document or its root element 10289 // when a statically positioned element is identified 10290 doc = elem.ownerDocument; 10291 offsetParent = elem.offsetParent || doc.documentElement; 10292 while ( offsetParent && 10293 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 10294 jQuery.css( offsetParent, "position" ) === "static" ) { 10295 10296 offsetParent = offsetParent.parentNode; 10297 } 10298 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 10299 10300 // Incorporate borders into its offset, since they are outside its content origin 10301 parentOffset = jQuery( offsetParent ).offset(); 10302 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 10303 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 10304 } 10305 } 10306 10307 // Subtract parent offsets and element margins 10308 return { 10309 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 10310 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 10311 }; 10312 }, 10313 10314 // This method will return documentElement in the following cases: 10315 // 1) For the element inside the iframe without offsetParent, this method will return 10316 // documentElement of the parent window 10317 // 2) For the hidden or detached element 10318 // 3) For body or html element, i.e. in case of the html node - it will return itself 10319 // 10320 // but those exceptions were never presented as a real life use-cases 10321 // and might be considered as more preferable results. 10322 // 10323 // This logic, however, is not guaranteed and can change at any point in the future 10324 offsetParent: function() { 10325 return this.map( function() { 10326 var offsetParent = this.offsetParent; 10327 10328 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 10329 offsetParent = offsetParent.offsetParent; 10330 } 10331 10332 return offsetParent || documentElement; 10333 } ); 10334 } 10335} ); 10336 10337// Create scrollLeft and scrollTop methods 10338jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 10339 var top = "pageYOffset" === prop; 10340 10341 jQuery.fn[ method ] = function( val ) { 10342 return access( this, function( elem, method, val ) { 10343 10344 // Coalesce documents and windows 10345 var win; 10346 if ( isWindow( elem ) ) { 10347 win = elem; 10348 } else if ( elem.nodeType === 9 ) { 10349 win = elem.defaultView; 10350 } 10351 10352 if ( val === undefined ) { 10353 return win ? win[ prop ] : elem[ method ]; 10354 } 10355 10356 if ( win ) { 10357 win.scrollTo( 10358 !top ? val : win.pageXOffset, 10359 top ? val : win.pageYOffset 10360 ); 10361 10362 } else { 10363 elem[ method ] = val; 10364 } 10365 }, method, val, arguments.length ); 10366 }; 10367} ); 10368 10369// Support: Safari <=7 - 9.1, Chrome <=37 - 49 10370// Add the top/left cssHooks using jQuery.fn.position 10371// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10372// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 10373// getComputedStyle returns percent when specified for top/left/bottom/right; 10374// rather than make the css module depend on the offset module, just check for it here 10375jQuery.each( [ "top", "left" ], function( i, prop ) { 10376 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 10377 function( elem, computed ) { 10378 if ( computed ) { 10379 computed = curCSS( elem, prop ); 10380 10381 // If curCSS returns percentage, fallback to offset 10382 return rnumnonpx.test( computed ) ? 10383 jQuery( elem ).position()[ prop ] + "px" : 10384 computed; 10385 } 10386 } 10387 ); 10388} ); 10389 10390 10391// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10392jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
vendor: 4,362 bytes, lines 10393-10541
10393 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 10394 function( defaultExtra, funcName ) { 10395 10396 // Margin is only for outerHeight, outerWidth 10397 jQuery.fn[ funcName ] = function( margin, value ) { 10398 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 10399 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 10400 10401 return access( this, function( elem, type, value ) { 10402 var doc; 10403 10404 if ( isWindow( elem ) ) { 10405 10406 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 10407 return funcName.indexOf( "outer" ) === 0 ? 10408 elem[ "inner" + name ] : 10409 elem.document.documentElement[ "client" + name ]; 10410 } 10411 10412 // Get document width or height 10413 if ( elem.nodeType === 9 ) { 10414 doc = elem.documentElement; 10415 10416 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10417 // whichever is greatest 10418 return Math.max( 10419 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 10420 elem.body[ "offset" + name ], doc[ "offset" + name ], 10421 doc[ "client" + name ] 10422 ); 10423 } 10424 10425 return value === undefined ? 10426 10427 // Get width or height on the element, requesting but not forcing parseFloat 10428 jQuery.css( elem, type, extra ) : 10429 10430 // Set width or height on the element 10431 jQuery.style( elem, type, value, extra ); 10432 }, type, chainable ? margin : undefined, chainable ); 10433 }; 10434 } ); 10435} ); 10436 10437 10438jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 10439 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 10440 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 10441 function( i, name ) { 10442 10443 // Handle event binding 10444 jQuery.fn[ name ] = function( data, fn ) { 10445 return arguments.length > 0 ? 10446 this.on( name, null, data, fn ) : 10447 this.trigger( name ); 10448 }; 10449} ); 10450 10451jQuery.fn.extend( { 10452 hover: function( fnOver, fnOut ) { 10453 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 10454 } 10455} ); 10456 10457 10458 10459 10460jQuery.fn.extend( { 10461 10462 bind: function( types, data, fn ) { 10463 return this.on( types, null, data, fn ); 10464 }, 10465 unbind: function( types, fn ) { 10466 return this.off( types, null, fn ); 10467 }, 10468 10469 delegate: function( selector, types, data, fn ) { 10470 return this.on( types, selector, data, fn ); 10471 }, 10472 undelegate: function( selector, types, fn ) { 10473 10474 // ( namespace ) or ( selector, types [, fn] ) 10475 return arguments.length === 1 ? 10476 this.off( selector, "**" ) : 10477 this.off( types, selector || "**", fn ); 10478 } 10479} ); 10480 10481// Bind a function to a context, optionally partially applying any 10482// arguments. 10483// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 10484// However, it is not slated for removal any time soon 10485jQuery.proxy = function( fn, context ) { 10486 var tmp, args, proxy; 10487 10488 if ( typeof context === "string" ) { 10489 tmp = fn[ context ]; 10490 context = fn; 10491 fn = tmp; 10492 } 10493 10494 // Quick check to determine if target is callable, in the spec 10495 // this throws a TypeError, but we will just return undefined. 10496 if ( !isFunction( fn ) ) { 10497 return undefined; 10498 } 10499 10500 // Simulated bind 10501 args = slice.call( arguments, 2 ); 10502 proxy = function() { 10503 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 10504 }; 10505 10506 // Set the guid of unique handler to the same of original handler, so it can be removed 10507 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 10508 10509 return proxy; 10510}; 10511 10512jQuery.holdReady = function( hold ) { 10513 if ( hold ) { 10514 jQuery.readyWait++; 10515 } else { 10516 jQuery.ready( true ); 10517 } 10518}; 10519jQuery.isArray = Array.isArray; 10520jQuery.parseJSON = JSON.parse; 10521jQuery.nodeName = nodeName; 10522jQuery.isFunction = isFunction; 10523jQuery.isWindow = isWindow; 10524jQuery.camelCase = camelCase; 10525jQuery.type = toType; 10526 10527jQuery.now = Date.now; 10528 10529jQuery.isNumeric = function( obj ) { 10530 10531 // As of jQuery 3.0, isNumeric is limited to 10532 // strings and numbers (primitives or objects) 10533 // that can be coerced to finite numbers (gh-2662) 10534 var type = jQuery.type( obj ); 10535 return ( type === "number" || type === "string" ) && 10536 10537 // parseFloat NaNs numeric-cast false positives ("") 10538 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 10539 // subtraction forces infinities to NaN 10540 !isNaN( obj - parseFloat( obj ) ); 10541};
10542 10543 10544 10545 10546// Register as a named AMD module, since jQuery can be concatenated with other 10547// files that may use define, but not via a proper concatenation script that 10548// understands anonymous AMD modules. A named AMD is safest and most robust 10549// way to register. Lowercase jquery is used because AMD module names are 10550// derived from file names, and jQuery is normally delivered in a lowercase 10551// file name. Do this after creating the global so that if an AMD module wants 10552// to call noConflict to hide this version of jQuery, it will work. 10553 10554// Note that for maximum portability, libraries that are not jQuery should 10555// declare themselves as anonymous modules, and avoid setting a global if an 10556// AMD loader is present. jQuery is a special case. For more information, see 10557// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10558 10559if ( typeof define === "function" && define.amd ) { 10560 define( "jquery", [], function() { 10561 return jQuery; 10562 } ); 10563} 10564 10565 10566 10567 10568var 10569 10570 // Map over jQuery in case of overwrite 10571 _jQuery = window.jQuery, 10572 10573 // Map over the $ in case of overwrite 10574 _$ = window.$; 10575 10576jQuery.noConflict = function( deep ) { 10577 if ( window.$ === jQuery ) { 10578 window.$ = _$; 10579 } 10580 10581 if ( deep && window.jQuery === jQuery ) { 10582 window.jQuery = _jQuery; 10583 } 10584 10585 return jQuery; 10586}; 10587 10588// Expose jQuery and $ identifiers, even in AMD 10589// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 10590// and CommonJS for browser emulators (#13566) 10591if ( !noGlobal ) { 10592 window.jQuery = window.$ = jQuery; 10593} 10594 10595 10596 10597 10598return jQuery; 10599} ); 10600 10601// импоÑÑиÑÑем Popper 10602/**! 10603 * @fileOverview Kickass library to create and place poppers near their reference elements. 10604 * @version 1.16.1 10605 * @license 10606 * Copyright (c) 2016 Federico Zivolo and contributors 10607 * 10608 * Permission is hereby granted, free of charge, to any person obtaining a copy 10609 * of this software and associated documentation files (the "Software"), to deal 10610 * in the Software without restriction, including without limitation the rights 10611 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10612 * copies of the Software, and to permit persons to whom the Software is 10613 * furnished to do so, subject to the following conditions: 10614 * 10615 * The above copyright notice and this permission notice shall be included in all 10616 * copies or substantial portions of the Software. 10617 * 10618 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10619 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10620 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 10621 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10622 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 10623 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 10624 * SOFTWARE. 10625 */ 10626(function (global, factory) { 10627 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 10628 typeof define === 'function' && define.amd ? define(factory) : 10629 (global.Popper = factory()); 10630}(this, (function () { 'use strict'; 10631 10632var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 10633 10634var timeoutDuration = function () { 10635 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 10636 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 10637 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 10638 return 1; 10639 } 10640 } 10641 return 0; 10642}(); 10643 10644function microtaskDebounce(fn) { 10645 var called = false; 10646 return function () { 10647 if (called) { 10648 return; 10649 } 10650 called = true; 10651 window.Promise.resolve().then(function () { 10652 called = false; 10653 fn(); 10654 }); 10655 }; 10656} 10657 10658function taskDebounce(fn) { 10659 var scheduled = false; 10660 return function () { 10661 if (!scheduled) { 10662 scheduled = true; 10663 setTimeout(function () { 10664 scheduled = false; 10665 fn(); 10666 }, timeoutDuration); 10667 } 10668 }; 10669} 10670 10671var supportsMicroTasks = isBrowser && window.Promise; 10672 10673/** 10674* Create a debounced version of a method, that's asynchronously deferred 10675* but called in the minimum time possible. 10676* 10677* @method 10678* @memberof Popper.Utils
vendor: 4,054 bytes, lines 10679-10821
10679* @argument {Function} fn 10680* @returns {Function} 10681*/ 10682var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 10683 10684/** 10685 * Check if the given variable is a function 10686 * @method 10687 * @memberof Popper.Utils 10688 * @argument {Any} functionToCheck - variable to check 10689 * @returns {Boolean} answer to: is a function? 10690 */ 10691function isFunction(functionToCheck) { 10692 var getType = {}; 10693 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 10694} 10695 10696/** 10697 * Get CSS computed property of the given element 10698 * @method 10699 * @memberof Popper.Utils 10700 * @argument {Eement} element 10701 * @argument {String} property 10702 */ 10703function getStyleComputedProperty(element, property) { 10704 if (element.nodeType !== 1) { 10705 return []; 10706 } 10707 // NOTE: 1 DOM access here 10708 var window = element.ownerDocument.defaultView; 10709 var css = window.getComputedStyle(element, null); 10710 return property ? css[property] : css; 10711} 10712 10713/** 10714 * Returns the parentNode or the host of the element 10715 * @method 10716 * @memberof Popper.Utils 10717 * @argument {Element} element 10718 * @returns {Element} parent 10719 */ 10720function getParentNode(element) { 10721 if (element.nodeName === 'HTML') { 10722 return element; 10723 } 10724 return element.parentNode || element.host; 10725} 10726 10727/** 10728 * Returns the scrolling parent of the given element 10729 * @method 10730 * @memberof Popper.Utils 10731 * @argument {Element} element 10732 * @returns {Element} scroll parent 10733 */ 10734function getScrollParent(element) { 10735 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 10736 if (!element) { 10737 return document.body; 10738 } 10739 10740 switch (element.nodeName) { 10741 case 'HTML': 10742 case 'BODY': 10743 return element.ownerDocument.body; 10744 case '#document': 10745 return element.body; 10746 } 10747 10748 // Firefox want us to check `-x` and `-y` variations as well 10749 10750 var _getStyleComputedProp = getStyleComputedProperty(element), 10751 overflow = _getStyleComputedProp.overflow, 10752 overflowX = _getStyleComputedProp.overflowX, 10753 overflowY = _getStyleComputedProp.overflowY; 10754 10755 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 10756 return element; 10757 } 10758 10759 return getScrollParent(getParentNode(element)); 10760} 10761 10762/** 10763 * Returns the reference node of the reference object, or the reference object itself. 10764 * @method 10765 * @memberof Popper.Utils 10766 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 10767 * @returns {Element} parent 10768 */ 10769function getReferenceNode(reference) { 10770 return reference && reference.referenceNode ? reference.referenceNode : reference; 10771} 10772 10773var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 10774var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 10775 10776/** 10777 * Determines if the browser is Internet Explorer 10778 * @method 10779 * @memberof Popper.Utils 10780 * @param {Number} version to check 10781 * @returns {Boolean} isIE 10782 */ 10783function isIE(version) { 10784 if (version === 11) { 10785 return isIE11; 10786 } 10787 if (version === 10) { 10788 return isIE10; 10789 } 10790 return isIE11 || isIE10; 10791} 10792 10793/** 10794 * Returns the offset parent of the given element 10795 * @method 10796 * @memberof Popper.Utils 10797 * @argument {Element} element 10798 * @returns {Element} offset parent 10799 */ 10800function getOffsetParent(element) { 10801 if (!element) { 10802 return document.documentElement; 10803 } 10804 10805 var noOffsetParent = isIE(10) ? document.body : null; 10806 10807 // NOTE: 1 DOM access here 10808 var offsetParent = element.offsetParent || null; 10809 // Skip hidden elements which don't have an offsetParent 10810 while (offsetParent === noOffsetParent && element.nextElementSibling) { 10811 offsetParent = (element = element.nextElementSibling).offsetParent; 10812 } 10813 10814 var nodeName = offsetParent && offsetParent.nodeName; 10815 10816 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 10817 return element ? element.ownerDocument.documentElement : document.documentElement; 10818 } 10819 10820 // .offsetParent will return the closest TH, TD or TABLE in case 10821 // no offsetParent is present, I hate this job...
vendor: 1,708 bytes, lines 10822-10877
10822 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 10823 return getOffsetParent(offsetParent); 10824 } 10825 10826 return offsetParent; 10827} 10828 10829function isOffsetContainer(element) { 10830 var nodeName = element.nodeName; 10831 10832 if (nodeName === 'BODY') { 10833 return false; 10834 } 10835 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 10836} 10837 10838/** 10839 * Finds the root node (document, shadowDOM root) of the given element 10840 * @method 10841 * @memberof Popper.Utils 10842 * @argument {Element} node 10843 * @returns {Element} root node 10844 */ 10845function getRoot(node) { 10846 if (node.parentNode !== null) { 10847 return getRoot(node.parentNode); 10848 } 10849 10850 return node; 10851} 10852 10853/** 10854 * Finds the offset parent common to the two provided nodes 10855 * @method 10856 * @memberof Popper.Utils 10857 * @argument {Element} element1 10858 * @argument {Element} element2 10859 * @returns {Element} common offset parent 10860 */ 10861function findCommonOffsetParent(element1, element2) { 10862 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 10863 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 10864 return document.documentElement; 10865 } 10866 10867 // Here we make sure to give as "start" the element that comes first in the DOM 10868 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 10869 var start = order ? element1 : element2; 10870 var end = order ? element2 : element1; 10871 10872 // Get common ancestor container 10873 var range = document.createRange(); 10874 range.setStart(start, 0); 10875 range.setEnd(end, 0); 10876 var commonAncestorContainer = range.commonAncestorContainer; 10877
vendor: 9,541 bytes, lines 10878-11159
10878 // Both nodes are inside #document 10879 10880 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 10881 if (isOffsetContainer(commonAncestorContainer)) { 10882 return commonAncestorContainer; 10883 } 10884 10885 return getOffsetParent(commonAncestorContainer); 10886 } 10887 10888 // one of the nodes is inside shadowDOM, find which one 10889 var element1root = getRoot(element1); 10890 if (element1root.host) { 10891 return findCommonOffsetParent(element1root.host, element2); 10892 } else { 10893 return findCommonOffsetParent(element1, getRoot(element2).host); 10894 } 10895} 10896 10897/** 10898 * Gets the scroll value of the given element in the given side (top and left) 10899 * @method 10900 * @memberof Popper.Utils 10901 * @argument {Element} element 10902 * @argument {String} side `top` or `left` 10903 * @returns {number} amount of scrolled pixels 10904 */ 10905function getScroll(element) { 10906 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 10907 10908 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 10909 var nodeName = element.nodeName; 10910 10911 if (nodeName === 'BODY' || nodeName === 'HTML') { 10912 var html = element.ownerDocument.documentElement; 10913 var scrollingElement = element.ownerDocument.scrollingElement || html; 10914 return scrollingElement[upperSide]; 10915 } 10916 10917 return element[upperSide]; 10918} 10919 10920/* 10921 * Sum or subtract the element scroll values (left and top) from a given rect object 10922 * @method 10923 * @memberof Popper.Utils 10924 * @param {Object} rect - Rect object you want to change 10925 * @param {HTMLElement} element - The element from the function reads the scroll values 10926 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 10927 * @return {Object} rect - The modifier rect object 10928 */ 10929function includeScroll(rect, element) { 10930 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 10931 10932 var scrollTop = getScroll(element, 'top'); 10933 var scrollLeft = getScroll(element, 'left'); 10934 var modifier = subtract ? -1 : 1; 10935 rect.top += scrollTop * modifier; 10936 rect.bottom += scrollTop * modifier; 10937 rect.left += scrollLeft * modifier; 10938 rect.right += scrollLeft * modifier; 10939 return rect; 10940} 10941 10942/* 10943 * Helper to detect borders of a given element 10944 * @method 10945 * @memberof Popper.Utils 10946 * @param {CSSStyleDeclaration} styles 10947 * Result of `getStyleComputedProperty` on the given element 10948 * @param {String} axis - `x` or `y` 10949 * @return {number} borders - The borders size of the given axis 10950 */ 10951 10952function getBordersSize(styles, axis) { 10953 var sideA = axis === 'x' ? 'Left' : 'Top'; 10954 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 10955 10956 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 10957} 10958 10959function getSize(axis, body, html, computedStyle) { 10960 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 10961} 10962 10963function getWindowSizes(document) { 10964 var body = document.body; 10965 var html = document.documentElement; 10966 var computedStyle = isIE(10) && getComputedStyle(html); 10967 10968 return { 10969 height: getSize('Height', body, html, computedStyle), 10970 width: getSize('Width', body, html, computedStyle) 10971 }; 10972} 10973 10974var classCallCheck = function (instance, Constructor) { 10975 if (!(instance instanceof Constructor)) { 10976 throw new TypeError("Cannot call a class as a function"); 10977 } 10978}; 10979 10980var createClass = function () { 10981 function defineProperties(target, props) { 10982 for (var i = 0; i < props.length; i++) { 10983 var descriptor = props[i]; 10984 descriptor.enumerable = descriptor.enumerable || false; 10985 descriptor.configurable = true; 10986 if ("value" in descriptor) descriptor.writable = true; 10987 Object.defineProperty(target, descriptor.key, descriptor); 10988 } 10989 } 10990 10991 return function (Constructor, protoProps, staticProps) { 10992 if (protoProps) defineProperties(Constructor.prototype, protoProps); 10993 if (staticProps) defineProperties(Constructor, staticProps); 10994 return Constructor; 10995 }; 10996}(); 10997 10998 10999 11000 11001 11002var defineProperty = function (obj, key, value) { 11003 if (key in obj) { 11004 Object.defineProperty(obj, key, { 11005 value: value, 11006 enumerable: true, 11007 configurable: true, 11008 writable: true 11009 }); 11010 } else { 11011 obj[key] = value; 11012 } 11013 11014 return obj; 11015}; 11016 11017var _extends = Object.assign || function (target) { 11018 for (var i = 1; i < arguments.length; i++) { 11019 var source = arguments[i]; 11020 11021 for (var key in source) { 11022 if (Object.prototype.hasOwnProperty.call(source, key)) { 11023 target[key] = source[key]; 11024 } 11025 } 11026 } 11027 11028 return target; 11029}; 11030 11031/** 11032 * Given element offsets, generate an output similar to getBoundingClientRect 11033 * @method 11034 * @memberof Popper.Utils 11035 * @argument {Object} offsets 11036 * @returns {Object} ClientRect like output 11037 */ 11038function getClientRect(offsets) { 11039 return _extends({}, offsets, { 11040 right: offsets.left + offsets.width, 11041 bottom: offsets.top + offsets.height 11042 }); 11043} 11044 11045/** 11046 * Get bounding client rect of given element 11047 * @method 11048 * @memberof Popper.Utils 11049 * @param {HTMLElement} element 11050 * @return {Object} client rect 11051 */ 11052function getBoundingClientRect(element) { 11053 var rect = {}; 11054 11055 // IE10 10 FIX: Please, don't ask, the element isn't 11056 // considered in DOM in some circumstances... 11057 // This isn't reproducible in IE10 compatibility mode of IE11 11058 try { 11059 if (isIE(10)) { 11060 rect = element.getBoundingClientRect(); 11061 var scrollTop = getScroll(element, 'top'); 11062 var scrollLeft = getScroll(element, 'left'); 11063 rect.top += scrollTop; 11064 rect.left += scrollLeft; 11065 rect.bottom += scrollTop; 11066 rect.right += scrollLeft; 11067 } else { 11068 rect = element.getBoundingClientRect(); 11069 } 11070 } catch (e) {} 11071 11072 var result = { 11073 left: rect.left, 11074 top: rect.top, 11075 width: rect.right - rect.left, 11076 height: rect.bottom - rect.top 11077 }; 11078 11079 // subtract scrollbar size from sizes 11080 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 11081 var width = sizes.width || element.clientWidth || result.width; 11082 var height = sizes.height || element.clientHeight || result.height; 11083 11084 var horizScrollbar = element.offsetWidth - width; 11085 var vertScrollbar = element.offsetHeight - height; 11086 11087 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 11088 // we make this check conditional for performance reasons 11089 if (horizScrollbar || vertScrollbar) { 11090 var styles = getStyleComputedProperty(element); 11091 horizScrollbar -= getBordersSize(styles, 'x'); 11092 vertScrollbar -= getBordersSize(styles, 'y'); 11093 11094 result.width -= horizScrollbar; 11095 result.height -= vertScrollbar; 11096 } 11097 11098 return getClientRect(result); 11099} 11100 11101function getOffsetRectRelativeToArbitraryNode(children, parent) { 11102 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 11103 11104 var isIE10 = isIE(10); 11105 var isHTML = parent.nodeName === 'HTML'; 11106 var childrenRect = getBoundingClientRect(children); 11107 var parentRect = getBoundingClientRect(parent); 11108 var scrollParent = getScrollParent(children); 11109 11110 var styles = getStyleComputedProperty(parent); 11111 var borderTopWidth = parseFloat(styles.borderTopWidth); 11112 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 11113 11114 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 11115 if (fixedPosition && isHTML) { 11116 parentRect.top = Math.max(parentRect.top, 0); 11117 parentRect.left = Math.max(parentRect.left, 0); 11118 } 11119 var offsets = getClientRect({ 11120 top: childrenRect.top - parentRect.top - borderTopWidth, 11121 left: childrenRect.left - parentRect.left - borderLeftWidth, 11122 width: childrenRect.width, 11123 height: childrenRect.height 11124 }); 11125 offsets.marginTop = 0; 11126 offsets.marginLeft = 0; 11127 11128 // Subtract margins of documentElement in case it's being used as parent 11129 // we do this only on HTML because it's the only element that behaves 11130 // differently when margins are applied to it. The margins are included in 11131 // the box of the documentElement, in the other cases not. 11132 if (!isIE10 && isHTML) { 11133 var marginTop = parseFloat(styles.marginTop); 11134 var marginLeft = parseFloat(styles.marginLeft); 11135 11136 offsets.top -= borderTopWidth - marginTop; 11137 offsets.bottom -= borderTopWidth - marginTop; 11138 offsets.left -= borderLeftWidth - marginLeft; 11139 offsets.right -= borderLeftWidth - marginLeft; 11140 11141 // Attach marginTop and marginLeft because in some circumstances we may need them 11142 offsets.marginTop = marginTop; 11143 offsets.marginLeft = marginLeft; 11144 } 11145 11146 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 11147 offsets = includeScroll(offsets, parent); 11148 } 11149 11150 return offsets; 11151} 11152 11153function getViewportOffsetRectRelativeToArtbitraryNode(element) { 11154 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 11155 11156 var html = element.ownerDocument.documentElement; 11157 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 11158 var width = Math.max(html.clientWidth, window.innerWidth || 0); 11159 var height = Math.max(html.clientHeight, window.innerHeight || 0
vendor: 5,628 bytes, lines 11159-11331
11159); 11160 11161 var scrollTop = !excludeScroll ? getScroll(html) : 0; 11162 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 11163 11164 var offset = { 11165 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 11166 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 11167 width: width, 11168 height: height 11169 }; 11170 11171 return getClientRect(offset); 11172} 11173 11174/** 11175 * Check if the given element is fixed or is inside a fixed parent 11176 * @method 11177 * @memberof Popper.Utils 11178 * @argument {Element} element 11179 * @argument {Element} customContainer 11180 * @returns {Boolean} answer to "isFixed?" 11181 */ 11182function isFixed(element) { 11183 var nodeName = element.nodeName; 11184 if (nodeName === 'BODY' || nodeName === 'HTML') { 11185 return false; 11186 } 11187 if (getStyleComputedProperty(element, 'position') === 'fixed') { 11188 return true; 11189 } 11190 var parentNode = getParentNode(element); 11191 if (!parentNode) { 11192 return false; 11193 } 11194 return isFixed(parentNode); 11195} 11196 11197/** 11198 * Finds the first parent of an element that has a transformed property defined 11199 * @method 11200 * @memberof Popper.Utils 11201 * @argument {Element} element 11202 * @returns {Element} first transformed parent or documentElement 11203 */ 11204 11205function getFixedPositionOffsetParent(element) { 11206 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 11207 if (!element || !element.parentElement || isIE()) { 11208 return document.documentElement; 11209 } 11210 var el = element.parentElement; 11211 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 11212 el = el.parentElement; 11213 } 11214 return el || document.documentElement; 11215} 11216 11217/** 11218 * Computed the boundaries limits and return them 11219 * @method 11220 * @memberof Popper.Utils 11221 * @param {HTMLElement} popper 11222 * @param {HTMLElement} reference 11223 * @param {number} padding 11224 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 11225 * @param {Boolean} fixedPosition - Is in fixed position mode 11226 * @returns {Object} Coordinates of the boundaries 11227 */ 11228function getBoundaries(popper, reference, padding, boundariesElement) { 11229 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 11230 11231 // NOTE: 1 DOM access here 11232 11233 var boundaries = { top: 0, left: 0 }; 11234 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 11235 11236 // Handle viewport case 11237 if (boundariesElement === 'viewport') { 11238 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 11239 } else { 11240 // Handle other cases based on DOM element used as boundaries 11241 var boundariesNode = void 0; 11242 if (boundariesElement === 'scrollParent') { 11243 boundariesNode = getScrollParent(getParentNode(reference)); 11244 if (boundariesNode.nodeName === 'BODY') { 11245 boundariesNode = popper.ownerDocument.documentElement; 11246 } 11247 } else if (boundariesElement === 'window') { 11248 boundariesNode = popper.ownerDocument.documentElement; 11249 } else { 11250 boundariesNode = boundariesElement; 11251 } 11252 11253 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 11254 11255 // In case of HTML, we need a different computation 11256 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 11257 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 11258 height = _getWindowSizes.height, 11259 width = _getWindowSizes.width; 11260 11261 boundaries.top += offsets.top - offsets.marginTop; 11262 boundaries.bottom = height + offsets.top; 11263 boundaries.left += offsets.left - offsets.marginLeft; 11264 boundaries.right = width + offsets.left; 11265 } else { 11266 // for all the other DOM elements, this one is good 11267 boundaries = offsets; 11268 } 11269 } 11270 11271 // Add paddings 11272 padding = padding || 0; 11273 var isPaddingNumber = typeof padding === 'number'; 11274 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 11275 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 11276 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 11277 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 11278 11279 return boundaries; 11280} 11281 11282function getArea(_ref) { 11283 var width = _ref.width, 11284 height = _ref.height; 11285 11286 return width * height; 11287} 11288 11289/** 11290 * Utility used to transform the `auto` placement to the placement with more 11291 * available space. 11292 * @method 11293 * @memberof Popper.Utils 11294 * @argument {Object} data - The data object generated by update method 11295 * @argument {Object} options - Modifiers configuration and options 11296 * @returns {Object} The data object, properly modified 11297 */ 11298function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 11299 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 11300 11301 if (placement.indexOf('auto') === -1) { 11302 return placement; 11303 } 11304 11305 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 11306 11307 var rects = { 11308 top: { 11309 width: boundaries.width, 11310 height: refRect.top - boundaries.top 11311 }, 11312 right: { 11313 width: boundaries.right - refRect.right, 11314 height: boundaries.height 11315 }, 11316 bottom: { 11317 width: boundaries.width, 11318 height: boundaries.bottom - refRect.bottom 11319 }, 11320 left: { 11321 width: refRect.left - boundaries.left, 11322 height: boundaries.height 11323 } 11324 }; 11325 11326 var sortedAreas = Object.keys(rects).map(function (key) { 11327 return _extends({ 11328 key: key 11329 }, rects[key], { 11330 area: getArea(rects[key]) 11331 });
vendor: 1,466 bytes, lines 11332-11371
11332 }).sort(function (a, b) { 11333 return b.area - a.area; 11334 }); 11335 11336 var filteredAreas = sortedAreas.filter(function (_ref2) { 11337 var width = _ref2.width, 11338 height = _ref2.height; 11339 return width >= popper.clientWidth && height >= popper.clientHeight; 11340 }); 11341 11342 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 11343 11344 var variation = placement.split('-')[1]; 11345 11346 return computedPlacement + (variation ? '-' + variation : ''); 11347} 11348 11349/** 11350 * Get offsets to the reference element 11351 * @method 11352 * @memberof Popper.Utils 11353 * @param {Object} state 11354 * @param {Element} popper - the popper element 11355 * @param {Element} reference - the reference element (the popper will be relative to this) 11356 * @param {Element} fixedPosition - is in fixed position mode 11357 * @returns {Object} An object containing the offsets which will be applied to the popper 11358 */ 11359function getReferenceOffsets(state, popper, reference) { 11360 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 11361 11362 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 11363 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 11364} 11365 11366/** 11367 * Get the outer sizes of the given element (offset size + margins) 11368 * @method 11369 * @memberof Popper.Utils 11370 * @argument {Element} element 11371 * @returns {Object}
vendor: 4,872 bytes, lines 11371-11520
11371 object containing width and height properties 11372 */ 11373function getOuterSizes(element) { 11374 var window = element.ownerDocument.defaultView; 11375 var styles = window.getComputedStyle(element); 11376 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 11377 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 11378 var result = { 11379 width: element.offsetWidth + y, 11380 height: element.offsetHeight + x 11381 }; 11382 return result; 11383} 11384 11385/** 11386 * Get the opposite placement of the given one 11387 * @method 11388 * @memberof Popper.Utils 11389 * @argument {String} placement 11390 * @returns {String} flipped placement 11391 */ 11392function getOppositePlacement(placement) { 11393 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 11394 return placement.replace(/left|right|bottom|top/g, function (matched) { 11395 return hash[matched]; 11396 }); 11397} 11398 11399/** 11400 * Get offsets to the popper 11401 * @method 11402 * @memberof Popper.Utils 11403 * @param {Object} position - CSS position the Popper will get applied 11404 * @param {HTMLElement} popper - the popper element 11405 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 11406 * @param {String} placement - one of the valid placement options 11407 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 11408 */ 11409function getPopperOffsets(popper, referenceOffsets, placement) { 11410 placement = placement.split('-')[0]; 11411 11412 // Get popper node sizes 11413 var popperRect = getOuterSizes(popper); 11414 11415 // Add position, width and height to our offsets object 11416 var popperOffsets = { 11417 width: popperRect.width, 11418 height: popperRect.height 11419 }; 11420 11421 // depending by the popper placement we have to compute its offsets slightly differently 11422 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 11423 var mainSide = isHoriz ? 'top' : 'left'; 11424 var secondarySide = isHoriz ? 'left' : 'top'; 11425 var measurement = isHoriz ? 'height' : 'width'; 11426 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 11427 11428 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 11429 if (placement === secondarySide) { 11430 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 11431 } else { 11432 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 11433 } 11434 11435 return popperOffsets; 11436} 11437 11438/** 11439 * Mimics the `find` method of Array 11440 * @method 11441 * @memberof Popper.Utils 11442 * @argument {Array} arr 11443 * @argument prop 11444 * @argument value 11445 * @returns index or -1 11446 */ 11447function find(arr, check) { 11448 // use native find if supported 11449 if (Array.prototype.find) { 11450 return arr.find(check); 11451 } 11452 11453 // use `filter` to obtain the same behavior of `find` 11454 return arr.filter(check)[0]; 11455} 11456 11457/** 11458 * Return the index of the matching object 11459 * @method 11460 * @memberof Popper.Utils 11461 * @argument {Array} arr 11462 * @argument prop 11463 * @argument value 11464 * @returns index or -1 11465 */ 11466function findIndex(arr, prop, value) { 11467 // use native findIndex if supported 11468 if (Array.prototype.findIndex) { 11469 return arr.findIndex(function (cur) { 11470 return cur[prop] === value; 11471 }); 11472 } 11473 11474 // use `find` + `indexOf` if `findIndex` isn't supported 11475 var match = find(arr, function (obj) { 11476 return obj[prop] === value; 11477 }); 11478 return arr.indexOf(match); 11479} 11480 11481/** 11482 * Loop trough the list of modifiers and run them in order, 11483 * each of them will then edit the data object. 11484 * @method 11485 * @memberof Popper.Utils 11486 * @param {dataObject} data 11487 * @param {Array} modifiers 11488 * @param {String} ends - Optional modifier name used as stopper 11489 * @returns {dataObject} 11490 */ 11491function runModifiers(modifiers, data, ends) { 11492 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 11493 11494 modifiersToRun.forEach(function (modifier) { 11495 if (modifier['function']) { 11496 // eslint-disable-line dot-notation 11497 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 11498 } 11499 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 11500 if (modifier.enabled && isFunction(fn)) { 11501 // Add properties to offsets to make them a complete clientRect object 11502 // we do this before each modifier to make sure the previous one doesn't 11503 // mess with these values 11504 data.offsets.popper = getClientRect(data.offsets.popper); 11505 data.offsets.reference = getClientRect(data.offsets.reference); 11506 11507 data = fn(data, modifier); 11508 } 11509 }); 11510 11511 return data; 11512} 11513 11514/** 11515 * Updates the position of the popper, computing the new offsets and applying 11516 * the new style.<br /> 11517 * Prefer `scheduleUpdate` over `update` because of performance reasons. 11518 * @method 11519 * @memberof Popper 11520 */
vendor: 41,728 bytes, lines 11521-12684
11521function update() { 11522 // if popper is destroyed, don't perform any further update 11523 if (this.state.isDestroyed) { 11524 return; 11525 } 11526 11527 var data = { 11528 instance: this, 11529 styles: {}, 11530 arrowStyles: {}, 11531 attributes: {}, 11532 flipped: false, 11533 offsets: {} 11534 }; 11535 11536 // compute reference element offsets 11537 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 11538 11539 // compute auto placement, store placement inside the data object, 11540 // modifiers will be able to edit `placement` if needed 11541 // and refer to originalPlacement to know the original value 11542 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 11543 11544 // store the computed placement inside `originalPlacement` 11545 data.originalPlacement = data.placement; 11546 11547 data.positionFixed = this.options.positionFixed; 11548 11549 // compute the popper offsets 11550 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 11551 11552 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 11553 11554 // run the modifiers 11555 data = runModifiers(this.modifiers, data); 11556 11557 // the first `update` will call `onCreate` callback 11558 // the other ones will call `onUpdate` callback 11559 if (!this.state.isCreated) { 11560 this.state.isCreated = true; 11561 this.options.onCreate(data); 11562 } else { 11563 this.options.onUpdate(data); 11564 } 11565} 11566 11567/** 11568 * Helper used to know if the given modifier is enabled. 11569 * @method 11570 * @memberof Popper.Utils 11571 * @returns {Boolean} 11572 */ 11573function isModifierEnabled(modifiers, modifierName) { 11574 return modifiers.some(function (_ref) { 11575 var name = _ref.name, 11576 enabled = _ref.enabled; 11577 return enabled && name === modifierName; 11578 }); 11579} 11580 11581/** 11582 * Get the prefixed supported property name 11583 * @method 11584 * @memberof Popper.Utils 11585 * @argument {String} property (camelCase) 11586 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 11587 */ 11588function getSupportedPropertyName(property) { 11589 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 11590 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 11591 11592 for (var i = 0; i < prefixes.length; i++) { 11593 var prefix = prefixes[i]; 11594 var toCheck = prefix ? '' + prefix + upperProp : property; 11595 if (typeof document.body.style[toCheck] !== 'undefined') { 11596 return toCheck; 11597 } 11598 } 11599 return null; 11600} 11601 11602/** 11603 * Destroys the popper. 11604 * @method 11605 * @memberof Popper 11606 */ 11607function destroy() { 11608 this.state.isDestroyed = true; 11609 11610 // touch DOM only if `applyStyle` modifier is enabled 11611 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 11612 this.popper.removeAttribute('x-placement'); 11613 this.popper.style.position = ''; 11614 this.popper.style.top = ''; 11615 this.popper.style.left = ''; 11616 this.popper.style.right = ''; 11617 this.popper.style.bottom = ''; 11618 this.popper.style.willChange = ''; 11619 this.popper.style[getSupportedPropertyName('transform')] = ''; 11620 } 11621 11622 this.disableEventListeners(); 11623 11624 // remove the popper if user explicitly asked for the deletion on destroy 11625 // do not use `remove` because IE11 doesn't support it 11626 if (this.options.removeOnDestroy) { 11627 this.popper.parentNode.removeChild(this.popper); 11628 } 11629 return this; 11630} 11631 11632/** 11633 * Get the window associated with the element 11634 * @argument {Element} element 11635 * @returns {Window} 11636 */ 11637function getWindow(element) { 11638 var ownerDocument = element.ownerDocument; 11639 return ownerDocument ? ownerDocument.defaultView : window; 11640} 11641 11642function attachToScrollParents(scrollParent, event, callback, scrollParents) { 11643 var isBody = scrollParent.nodeName === 'BODY'; 11644 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 11645 target.addEventListener(event, callback, { passive: true }); 11646 11647 if (!isBody) { 11648 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 11649 } 11650 scrollParents.push(target); 11651} 11652 11653/** 11654 * Setup needed event listeners used to update the popper position 11655 * @method 11656 * @memberof Popper.Utils 11657 * @private 11658 */ 11659function setupEventListeners(reference, options, state, updateBound) { 11660 // Resize event listener on window 11661 state.updateBound = updateBound; 11662 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 11663 11664 // Scroll event listener on scroll parents 11665 var scrollElement = getScrollParent(reference); 11666 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 11667 state.scrollElement = scrollElement; 11668 state.eventsEnabled = true; 11669 11670 return state; 11671} 11672 11673/** 11674 * It will add resize/scroll events and start recalculating 11675 * position of the popper element when they are triggered. 11676 * @method 11677 * @memberof Popper 11678 */ 11679function enableEventListeners() { 11680 if (!this.state.eventsEnabled) { 11681 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 11682 } 11683} 11684 11685/** 11686 * Remove event listeners used to update the popper position 11687 * @method 11688 * @memberof Popper.Utils 11689 * @private 11690 */ 11691function removeEventListeners(reference, state) { 11692 // Remove resize event listener on window 11693 getWindow(reference).removeEventListener('resize', state.updateBound); 11694 11695 // Remove scroll event listener on scroll parents 11696 state.scrollParents.forEach(function (target) { 11697 target.removeEventListener('scroll', state.updateBound); 11698 }); 11699 11700 // Reset state 11701 state.updateBound = null; 11702 state.scrollParents = []; 11703 state.scrollElement = null; 11704 state.eventsEnabled = false; 11705 return state; 11706} 11707 11708/** 11709 * It will remove resize/scroll events and won't recalculate popper position 11710 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 11711 * unless you call `update` method manually. 11712 * @method 11713 * @memberof Popper 11714 */ 11715function disableEventListeners() { 11716 if (this.state.eventsEnabled) { 11717 cancelAnimationFrame(this.scheduleUpdate); 11718 this.state = removeEventListeners(this.reference, this.state); 11719 } 11720} 11721 11722/** 11723 * Tells if a given input is a number 11724 * @method 11725 * @memberof Popper.Utils 11726 * @param {*} input to check 11727 * @return {Boolean} 11728 */ 11729function isNumeric(n) { 11730 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 11731} 11732 11733/** 11734 * Set the style to the given popper 11735 * @method 11736 * @memberof Popper.Utils 11737 * @argument {Element} element - Element to apply the style to 11738 * @argument {Object} styles 11739 * Object with a list of properties and values which will be applied to the element 11740 */ 11741function setStyles(element, styles) { 11742 Object.keys(styles).forEach(function (prop) { 11743 var unit = ''; 11744 // add unit if the value is numeric and is one of the following 11745 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 11746 unit = 'px'; 11747 } 11748 element.style[prop] = styles[prop] + unit; 11749 }); 11750} 11751 11752/** 11753 * Set the attributes to the given popper 11754 * @method 11755 * @memberof Popper.Utils 11756 * @argument {Element} element - Element to apply the attributes to 11757 * @argument {Object} styles 11758 * Object with a list of properties and values which will be applied to the element 11759 */ 11760function setAttributes(element, attributes) { 11761 Object.keys(attributes).forEach(function (prop) { 11762 var value = attributes[prop]; 11763 if (value !== false) { 11764 element.setAttribute(prop, attributes[prop]); 11765 } else { 11766 element.removeAttribute(prop); 11767 } 11768 }); 11769} 11770 11771/** 11772 * @function 11773 * @memberof Modifiers 11774 * @argument {Object} data - The data object generated by `update` method 11775 * @argument {Object} data.styles - List of style properties - values to apply to popper element 11776 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 11777 * @argument {Object} options - Modifiers configuration and options 11778 * @returns {Object} The same data object 11779 */ 11780function applyStyle(data) { 11781 // any property present in `data.styles` will be applied to the popper, 11782 // in this way we can make the 3rd party modifiers add custom styles to it 11783 // Be aware, modifiers could override the properties defined in the previous 11784 // lines of this modifier! 11785 setStyles(data.instance.popper, data.styles); 11786 11787 // any property present in `data.attributes` will be applied to the popper, 11788 // they will be set as HTML attributes of the element 11789 setAttributes(data.instance.popper, data.attributes); 11790 11791 // if arrowElement is defined and arrowStyles has some properties 11792 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 11793 setStyles(data.arrowElement, data.arrowStyles); 11794 } 11795 11796 return data; 11797} 11798 11799/** 11800 * Set the x-placement attribute before everything else because it could be used 11801 * to add margins to the popper margins needs to be calculated to get the 11802 * correct popper offsets. 11803 * @method 11804 * @memberof Popper.modifiers 11805 * @param {HTMLElement} reference - The reference element used to position the popper 11806 * @param {HTMLElement} popper - The HTML element used as popper 11807 * @param {Object} options - Popper.js options 11808 */ 11809function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 11810 // compute reference element offsets 11811 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 11812 11813 // compute auto placement, store placement inside the data object, 11814 // modifiers will be able to edit `placement` if needed 11815 // and refer to originalPlacement to know the original value 11816 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 11817 11818 popper.setAttribute('x-placement', placement); 11819 11820 // Apply `position` to popper before anything else because 11821 // without the position applied we can't guarantee correct computations 11822 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 11823 11824 return options; 11825} 11826 11827/** 11828 * @function 11829 * @memberof Popper.Utils 11830 * @argument {Object} data - The data object generated by `update` method 11831 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 11832 * @returns {Object} The popper's position offsets rounded 11833 * 11834 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 11835 * good as it can be within reason. 11836 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 11837 * 11838 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 11839 * as well on High DPI screens). 11840 * 11841 * Firefox prefers no rounding for positioning and does not have blurriness on 11842 * high DPI screens. 11843 * 11844 * Only horizontal placement and left/right values need to be considered. 11845 */ 11846function getRoundedOffsets(data, shouldRound) { 11847 var _data$offsets = data.offsets, 11848 popper = _data$offsets.popper, 11849 reference = _data$offsets.reference; 11850 var round = Math.round, 11851 floor = Math.floor; 11852 11853 var noRound = function noRound(v) { 11854 return v; 11855 }; 11856 11857 var referenceWidth = round(reference.width); 11858 var popperWidth = round(popper.width); 11859 11860 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 11861 var isVariation = data.placement.indexOf('-') !== -1; 11862 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 11863 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 11864 11865 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 11866 var verticalToInteger = !shouldRound ? noRound : round; 11867 11868 return { 11869 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 11870 top: verticalToInteger(popper.top), 11871 bottom: verticalToInteger(popper.bottom), 11872 right: horizontalToInteger(popper.right) 11873 }; 11874} 11875 11876var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 11877 11878/** 11879 * @function 11880 * @memberof Modifiers 11881 * @argument {Object} data - The data object generated by `update` method 11882 * @argument {Object} options - Modifiers configuration and options 11883 * @returns {Object} The data object, properly modified 11884 */ 11885function computeStyle(data, options) { 11886 var x = options.x, 11887 y = options.y; 11888 var popper = data.offsets.popper; 11889 11890 // Remove this legacy support in Popper.js v2 11891 11892 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 11893 return modifier.name === 'applyStyle'; 11894 }).gpuAcceleration; 11895 if (legacyGpuAccelerationOption !== undefined) { 11896 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 11897 } 11898 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 11899 11900 var offsetParent = getOffsetParent(data.instance.popper); 11901 var offsetParentRect = getBoundingClientRect(offsetParent); 11902 11903 // Styles 11904 var styles = { 11905 position: popper.position 11906 }; 11907 11908 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 11909 11910 var sideA = x === 'bottom' ? 'top' : 'bottom'; 11911 var sideB = y === 'right' ? 'left' : 'right'; 11912 11913 // if gpuAcceleration is set to `true` and transform is supported, 11914 // we use `translate3d` to apply the position to the popper we 11915 // automatically use the supported prefixed version if needed 11916 var prefixedProperty = getSupportedPropertyName('transform'); 11917 11918 // now, let's make a step back and look at this code closely (wtf?) 11919 // If the content of the popper grows once it's been positioned, it 11920 // may happen that the popper gets misplaced because of the new content 11921 // overflowing its reference element 11922 // To avoid this problem, we provide two options (x and y), which allow 11923 // the consumer to define the offset origin. 11924 // If we position a popper on top of a reference element, we can set 11925 // `x` to `top` to make the popper grow towards its top instead of 11926 // its bottom. 11927 var left = void 0, 11928 top = void 0; 11929 if (sideA === 'bottom') { 11930 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 11931 // and not the bottom of the html element 11932 if (offsetParent.nodeName === 'HTML') { 11933 top = -offsetParent.clientHeight + offsets.bottom; 11934 } else { 11935 top = -offsetParentRect.height + offsets.bottom; 11936 } 11937 } else { 11938 top = offsets.top; 11939 } 11940 if (sideB === 'right') { 11941 if (offsetParent.nodeName === 'HTML') { 11942 left = -offsetParent.clientWidth + offsets.right; 11943 } else { 11944 left = -offsetParentRect.width + offsets.right; 11945 } 11946 } else { 11947 left = offsets.left; 11948 } 11949 if (gpuAcceleration && prefixedProperty) { 11950 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 11951 styles[sideA] = 0; 11952 styles[sideB] = 0; 11953 styles.willChange = 'transform'; 11954 } else { 11955 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 11956 var invertTop = sideA === 'bottom' ? -1 : 1; 11957 var invertLeft = sideB === 'right' ? -1 : 1; 11958 styles[sideA] = top * invertTop; 11959 styles[sideB] = left * invertLeft; 11960 styles.willChange = sideA + ', ' + sideB; 11961 } 11962 11963 // Attributes 11964 var attributes = { 11965 'x-placement': data.placement 11966 }; 11967 11968 // Update `data` attributes, styles and arrowStyles 11969 data.attributes = _extends({}, attributes, data.attributes); 11970 data.styles = _extends({}, styles, data.styles); 11971 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 11972 11973 return data; 11974} 11975 11976/** 11977 * Helper used to know if the given modifier depends from another one.<br /> 11978 * It checks if the needed modifier is listed and enabled. 11979 * @method 11980 * @memberof Popper.Utils 11981 * @param {Array} modifiers - list of modifiers 11982 * @param {String} requestingName - name of requesting modifier 11983 * @param {String} requestedName - name of requested modifier 11984 * @returns {Boolean} 11985 */ 11986function isModifierRequired(modifiers, requestingName, requestedName) { 11987 var requesting = find(modifiers, function (_ref) { 11988 var name = _ref.name; 11989 return name === requestingName; 11990 }); 11991 11992 var isRequired = !!requesting && modifiers.some(function (modifier) { 11993 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 11994 }); 11995 11996 if (!isRequired) { 11997 var _requesting = '`' + requestingName + '`'; 11998 var requested = '`' + requestedName + '`'; 11999 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 12000 } 12001 return isRequired; 12002} 12003 12004/** 12005 * @function 12006 * @memberof Modifiers 12007 * @argument {Object} data - The data object generated by update method 12008 * @argument {Object} options - Modifiers configuration and options 12009 * @returns {Object} The data object, properly modified 12010 */ 12011function arrow(data, options) { 12012 var _data$offsets$arrow; 12013 12014 // arrow depends on keepTogether in order to work 12015 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 12016 return data; 12017 } 12018 12019 var arrowElement = options.element; 12020 12021 // if arrowElement is a string, suppose it's a CSS selector 12022 if (typeof arrowElement === 'string') { 12023 arrowElement = data.instance.popper.querySelector(arrowElement); 12024 12025 // if arrowElement is not found, don't run the modifier 12026 if (!arrowElement) { 12027 return data; 12028 } 12029 } else { 12030 // if the arrowElement isn't a query selector we must check that the 12031 // provided DOM node is child of its popper node 12032 if (!data.instance.popper.contains(arrowElement)) { 12033 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 12034 return data; 12035 } 12036 } 12037 12038 var placement = data.placement.split('-')[0]; 12039 var _data$offsets = data.offsets, 12040 popper = _data$offsets.popper, 12041 reference = _data$offsets.reference; 12042 12043 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 12044 12045 var len = isVertical ? 'height' : 'width'; 12046 var sideCapitalized = isVertical ? 'Top' : 'Left'; 12047 var side = sideCapitalized.toLowerCase(); 12048 var altSide = isVertical ? 'left' : 'top'; 12049 var opSide = isVertical ? 'bottom' : 'right'; 12050 var arrowElementSize = getOuterSizes(arrowElement)[len]; 12051 12052 // 12053 // extends keepTogether behavior making sure the popper and its 12054 // reference have enough pixels in conjunction 12055 // 12056 12057 // top/left side 12058 if (reference[opSide] - arrowElementSize < popper[side]) { 12059 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 12060 } 12061 // bottom/right side 12062 if (reference[side] + arrowElementSize > popper[opSide]) { 12063 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 12064 } 12065 data.offsets.popper = getClientRect(data.offsets.popper); 12066 12067 // compute center of the popper 12068 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 12069 12070 // Compute the sideValue using the updated popper offsets 12071 // take popper margin in account because we don't have this info available 12072 var css = getStyleComputedProperty(data.instance.popper); 12073 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 12074 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 12075 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 12076 12077 // prevent arrowElement from being placed not contiguously to its popper 12078 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 12079 12080 data.arrowElement = arrowElement; 12081 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 12082 12083 return data; 12084} 12085 12086/** 12087 * Get the opposite placement variation of the given one 12088 * @method 12089 * @memberof Popper.Utils 12090 * @argument {String} placement variation 12091 * @returns {String} flipped placement variation 12092 */ 12093function getOppositeVariation(variation) { 12094 if (variation === 'end') { 12095 return 'start'; 12096 } else if (variation === 'start') { 12097 return 'end'; 12098 } 12099 return variation; 12100} 12101 12102/** 12103 * List of accepted placements to use as values of the `placement` option.<br /> 12104 * Valid placements are: 12105 * - `auto` 12106 * - `top` 12107 * - `right` 12108 * - `bottom` 12109 * - `left` 12110 * 12111 * Each placement can have a variation from this list: 12112 * - `-start` 12113 * - `-end` 12114 * 12115 * Variations are interpreted easily if you think of them as the left to right 12116 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 12117 * is right.<br /> 12118 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 12119 * 12120 * Some valid examples are: 12121 * - `top-end` (on top of reference, right aligned) 12122 * - `right-start` (on right of reference, top aligned) 12123 * - `bottom` (on bottom, centered) 12124 * - `auto-end` (on the side with more space available, alignment depends by placement) 12125 * 12126 * @static 12127 * @type {Array} 12128 * @enum {String} 12129 * @readonly 12130 * @method placements 12131 * @memberof Popper 12132 */ 12133var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 12134 12135// Get rid of `auto` `auto-start` and `auto-end` 12136var validPlacements = placements.slice(3); 12137 12138/** 12139 * Given an initial placement, returns all the subsequent placements 12140 * clockwise (or counter-clockwise). 12141 * 12142 * @method 12143 * @memberof Popper.Utils 12144 * @argument {String} placement - A valid placement (it accepts variations) 12145 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 12146 * @returns {Array} placements including their variations 12147 */ 12148function clockwise(placement) { 12149 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 12150 12151 var index = validPlacements.indexOf(placement); 12152 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 12153 return counter ? arr.reverse() : arr; 12154} 12155 12156var BEHAVIORS = { 12157 FLIP: 'flip', 12158 CLOCKWISE: 'clockwise', 12159 COUNTERCLOCKWISE: 'counterclockwise' 12160}; 12161 12162/** 12163 * @function 12164 * @memberof Modifiers 12165 * @argument {Object} data - The data object generated by update method 12166 * @argument {Object} options - Modifiers configuration and options 12167 * @returns {Object} The data object, properly modified 12168 */ 12169function flip(data, options) { 12170 // if `inner` modifier is enabled, we can't use the `flip` modifier 12171 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 12172 return data; 12173 } 12174 12175 if (data.flipped && data.placement === data.originalPlacement) { 12176 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 12177 return data; 12178 } 12179 12180 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 12181 12182 var placement = data.placement.split('-')[0]; 12183 var placementOpposite = getOppositePlacement(placement); 12184 var variation = data.placement.split('-')[1] || ''; 12185 12186 var flipOrder = []; 12187 12188 switch (options.behavior) { 12189 case BEHAVIORS.FLIP: 12190 flipOrder = [placement, placementOpposite]; 12191 break; 12192 case BEHAVIORS.CLOCKWISE: 12193 flipOrder = clockwise(placement); 12194 break; 12195 case BEHAVIORS.COUNTERCLOCKWISE: 12196 flipOrder = clockwise(placement, true); 12197 break; 12198 default: 12199 flipOrder = options.behavior; 12200 } 12201 12202 flipOrder.forEach(function (step, index) { 12203 if (placement !== step || flipOrder.length === index + 1) { 12204 return data; 12205 } 12206 12207 placement = data.placement.split('-')[0]; 12208 placementOpposite = getOppositePlacement(placement); 12209 12210 var popperOffsets = data.offsets.popper; 12211 var refOffsets = data.offsets.reference; 12212 12213 // using floor because the reference offsets may contain decimals we are not going to consider here 12214 var floor = Math.floor; 12215 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 12216 12217 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 12218 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 12219 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 12220 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 12221 12222 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 12223 12224 // flip the variation if required 12225 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 12226 12227 // flips variation if reference element overflows boundaries 12228 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 12229 12230 // flips variation if popper content overflows boundaries 12231 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 12232 12233 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 12234 12235 if (overlapsRef || overflowsBoundaries || flippedVariation) { 12236 // this boolean to detect any flip loop 12237 data.flipped = true; 12238 12239 if (overlapsRef || overflowsBoundaries) { 12240 placement = flipOrder[index + 1]; 12241 } 12242 12243 if (flippedVariation) { 12244 variation = getOppositeVariation(variation); 12245 } 12246 12247 data.placement = placement + (variation ? '-' + variation : ''); 12248 12249 // this object contains `position`, we want to preserve it along with 12250 // any additional property we may add in the future 12251 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 12252 12253 data = runModifiers(data.instance.modifiers, data, 'flip'); 12254 } 12255 }); 12256 return data; 12257} 12258 12259/** 12260 * @function 12261 * @memberof Modifiers 12262 * @argument {Object} data - The data object generated by update method 12263 * @argument {Object} options - Modifiers configuration and options 12264 * @returns {Object} The data object, properly modified 12265 */ 12266function keepTogether(data) { 12267 var _data$offsets = data.offsets, 12268 popper = _data$offsets.popper, 12269 reference = _data$offsets.reference; 12270 12271 var placement = data.placement.split('-')[0]; 12272 var floor = Math.floor; 12273 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 12274 var side = isVertical ? 'right' : 'bottom'; 12275 var opSide = isVertical ? 'left' : 'top'; 12276 var measurement = isVertical ? 'width' : 'height'; 12277 12278 if (popper[side] < floor(reference[opSide])) { 12279 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 12280 } 12281 if (popper[opSide] > floor(reference[side])) { 12282 data.offsets.popper[opSide] = floor(reference[side]); 12283 } 12284 12285 return data; 12286} 12287 12288/** 12289 * Converts a string containing value + unit into a px value number 12290 * @function 12291 * @memberof {modifiers~offset} 12292 * @private 12293 * @argument {String} str - Value + unit string 12294 * @argument {String} measurement - `height` or `width` 12295 * @argument {Object} popperOffsets 12296 * @argument {Object} referenceOffsets 12297 * @returns {Number|String} 12298 * Value in pixels, or original string if no values were extracted 12299 */ 12300function toValue(str, measurement, popperOffsets, referenceOffsets) { 12301 // separate value from unit 12302 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 12303 var value = +split[1]; 12304 var unit = split[2]; 12305 12306 // If it's not a number it's an operator, I guess 12307 if (!value) { 12308 return str; 12309 } 12310 12311 if (unit.indexOf('%') === 0) { 12312 var element = void 0; 12313 switch (unit) { 12314 case '%p': 12315 element = popperOffsets; 12316 break; 12317 case '%': 12318 case '%r': 12319 default: 12320 element = referenceOffsets; 12321 } 12322 12323 var rect = getClientRect(element); 12324 return rect[measurement] / 100 * value; 12325 } else if (unit === 'vh' || unit === 'vw') { 12326 // if is a vh or vw, we calculate the size based on the viewport 12327 var size = void 0; 12328 if (unit === 'vh') { 12329 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 12330 } else { 12331 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 12332 } 12333 return size / 100 * value; 12334 } else { 12335 // if is an explicit pixel unit, we get rid of the unit and keep the value 12336 // if is an implicit unit, it's px, and we return just the value 12337 return value; 12338 } 12339} 12340 12341/** 12342 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 12343 * @function 12344 * @memberof {modifiers~offset} 12345 * @private 12346 * @argument {String} offset 12347 * @argument {Object} popperOffsets 12348 * @argument {Object} referenceOffsets 12349 * @argument {String} basePlacement 12350 * @returns {Array} a two cells array with x and y offsets in numbers 12351 */ 12352function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 12353 var offsets = [0, 0]; 12354 12355 // Use height if placement is left or right and index is 0 otherwise use width 12356 // in this way the first offset will use an axis and the second one 12357 // will use the other one 12358 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 12359 12360 // Split the offset string to obtain a list of values and operands 12361 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 12362 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 12363 return frag.trim(); 12364 }); 12365 12366 // Detect if the offset string contains a pair of values or a single one 12367 // they could be separated by comma or space 12368 var divider = fragments.indexOf(find(fragments, function (frag) { 12369 return frag.search(/,|\s/) !== -1; 12370 })); 12371 12372 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 12373 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 12374 } 12375 12376 // If divider is found, we divide the list of values and operands to divide 12377 // them by ofset X and Y. 12378 var splitRegex = /\s*,\s*|\s+/; 12379 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 12380 12381 // Convert the values with units to absolute pixels to allow our computations 12382 ops = ops.map(function (op, index) { 12383 // Most of the units rely on the orientation of the popper 12384 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 12385 var mergeWithPrevious = false; 12386 return op 12387 // This aggregates any `+` or `-` sign that aren't considered operators 12388 // e.g.: 10 + +5 => [10, +, +5] 12389 .reduce(function (a, b) { 12390 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 12391 a[a.length - 1] = b; 12392 mergeWithPrevious = true; 12393 return a; 12394 } else if (mergeWithPrevious) { 12395 a[a.length - 1] += b; 12396 mergeWithPrevious = false; 12397 return a; 12398 } else { 12399 return a.concat(b); 12400 } 12401 }, []) 12402 // Here we convert the string values into number values (in px) 12403 .map(function (str) { 12404 return toValue(str, measurement, popperOffsets, referenceOffsets); 12405 }); 12406 }); 12407 12408 // Loop trough the offsets arrays and execute the operations 12409 ops.forEach(function (op, index) { 12410 op.forEach(function (frag, index2) { 12411 if (isNumeric(frag)) { 12412 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 12413 } 12414 }); 12415 }); 12416 return offsets; 12417} 12418 12419/** 12420 * @function 12421 * @memberof Modifiers 12422 * @argument {Object} data - The data object generated by update method 12423 * @argument {Object} options - Modifiers configuration and options 12424 * @argument {Number|String} options.offset=0 12425 * The offset value as described in the modifier description 12426 * @returns {Object} The data object, properly modified 12427 */ 12428function offset(data, _ref) { 12429 var offset = _ref.offset; 12430 var placement = data.placement, 12431 _data$offsets = data.offsets, 12432 popper = _data$offsets.popper, 12433 reference = _data$offsets.reference; 12434 12435 var basePlacement = placement.split('-')[0]; 12436 12437 var offsets = void 0; 12438 if (isNumeric(+offset)) { 12439 offsets = [+offset, 0]; 12440 } else { 12441 offsets = parseOffset(offset, popper, reference, basePlacement); 12442 } 12443 12444 if (basePlacement === 'left') { 12445 popper.top += offsets[0]; 12446 popper.left -= offsets[1]; 12447 } else if (basePlacement === 'right') { 12448 popper.top += offsets[0]; 12449 popper.left += offsets[1]; 12450 } else if (basePlacement === 'top') { 12451 popper.left += offsets[0]; 12452 popper.top -= offsets[1]; 12453 } else if (basePlacement === 'bottom') { 12454 popper.left += offsets[0]; 12455 popper.top += offsets[1]; 12456 } 12457 12458 data.popper = popper; 12459 return data; 12460} 12461 12462/** 12463 * @function 12464 * @memberof Modifiers 12465 * @argument {Object} data - The data object generated by `update` method 12466 * @argument {Object} options - Modifiers configuration and options 12467 * @returns {Object} The data object, properly modified 12468 */ 12469function preventOverflow(data, options) { 12470 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 12471 12472 // If offsetParent is the reference element, we really want to 12473 // go one step up and use the next offsetParent as reference to 12474 // avoid to make this modifier completely useless and look like broken 12475 if (data.instance.reference === boundariesElement) { 12476 boundariesElement = getOffsetParent(boundariesElement); 12477 } 12478 12479 // NOTE: DOM access here 12480 // resets the popper's position so that the document size can be calculated excluding 12481 // the size of the popper element itself 12482 var transformProp = getSupportedPropertyName('transform'); 12483 var popperStyles = data.instance.popper.style; // assignment to help minification 12484 var top = popperStyles.top, 12485 left = popperStyles.left, 12486 transform = popperStyles[transformProp]; 12487 12488 popperStyles.top = ''; 12489 popperStyles.left = ''; 12490 popperStyles[transformProp] = ''; 12491 12492 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 12493 12494 // NOTE: DOM access here 12495 // restores the original style properties after the offsets have been computed 12496 popperStyles.top = top; 12497 popperStyles.left = left; 12498 popperStyles[transformProp] = transform; 12499 12500 options.boundaries = boundaries; 12501 12502 var order = options.priority; 12503 var popper = data.offsets.popper; 12504 12505 var check = { 12506 primary: function primary(placement) { 12507 var value = popper[placement]; 12508 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 12509 value = Math.max(popper[placement], boundaries[placement]); 12510 } 12511 return defineProperty({}, placement, value); 12512 }, 12513 secondary: function secondary(placement) { 12514 var mainSide = placement === 'right' ? 'left' : 'top'; 12515 var value = popper[mainSide]; 12516 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 12517 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 12518 } 12519 return defineProperty({}, mainSide, value); 12520 } 12521 }; 12522 12523 order.forEach(function (placement) { 12524 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 12525 popper = _extends({}, popper, check[side](placement)); 12526 }); 12527 12528 data.offsets.popper = popper; 12529 12530 return data; 12531} 12532 12533/** 12534 * @function 12535 * @memberof Modifiers 12536 * @argument {Object} data - The data object generated by `update` method 12537 * @argument {Object} options - Modifiers configuration and options 12538 * @returns {Object} The data object, properly modified 12539 */ 12540function shift(data) { 12541 var placement = data.placement; 12542 var basePlacement = placement.split('-')[0]; 12543 var shiftvariation = placement.split('-')[1]; 12544 12545 // if shift shiftvariation is specified, run the modifier 12546 if (shiftvariation) { 12547 var _data$offsets = data.offsets, 12548 reference = _data$offsets.reference, 12549 popper = _data$offsets.popper; 12550 12551 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 12552 var side = isVertical ? 'left' : 'top'; 12553 var measurement = isVertical ? 'width' : 'height'; 12554 12555 var shiftOffsets = { 12556 start: defineProperty({}, side, reference[side]), 12557 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 12558 }; 12559 12560 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 12561 } 12562 12563 return data; 12564} 12565 12566/** 12567 * @function 12568 * @memberof Modifiers 12569 * @argument {Object} data - The data object generated by update method 12570 * @argument {Object} options - Modifiers configuration and options 12571 * @returns {Object} The data object, properly modified 12572 */ 12573function hide(data) { 12574 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 12575 return data; 12576 } 12577 12578 var refRect = data.offsets.reference; 12579 var bound = find(data.instance.modifiers, function (modifier) { 12580 return modifier.name === 'preventOverflow'; 12581 }).boundaries; 12582 12583 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 12584 // Avoid unnecessary DOM access if visibility hasn't changed 12585 if (data.hide === true) { 12586 return data; 12587 } 12588 12589 data.hide = true; 12590 data.attributes['x-out-of-boundaries'] = ''; 12591 } else { 12592 // Avoid unnecessary DOM access if visibility hasn't changed 12593 if (data.hide === false) { 12594 return data; 12595 } 12596 12597 data.hide = false; 12598 data.attributes['x-out-of-boundaries'] = false; 12599 } 12600 12601 return data; 12602} 12603 12604/** 12605 * @function 12606 * @memberof Modifiers 12607 * @argument {Object} data - The data object generated by `update` method 12608 * @argument {Object} options - Modifiers configuration and options 12609 * @returns {Object} The data object, properly modified 12610 */ 12611function inner(data) { 12612 var placement = data.placement; 12613 var basePlacement = placement.split('-')[0]; 12614 var _data$offsets = data.offsets, 12615 popper = _data$offsets.popper, 12616 reference = _data$offsets.reference; 12617 12618 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 12619 12620 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 12621 12622 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 12623 12624 data.placement = getOppositePlacement(placement); 12625 data.offsets.popper = getClientRect(popper); 12626 12627 return data; 12628} 12629 12630/** 12631 * Modifier function, each modifier can have a function of this type assigned 12632 * to its `fn` property.<br /> 12633 * These functions will be called on each update, this means that you must 12634 * make sure they are performant enough to avoid performance bottlenecks. 12635 * 12636 * @function ModifierFn 12637 * @argument {dataObject} data - The data object generated by `update` method 12638 * @argument {Object} options - Modifiers configuration and options 12639 * @returns {dataObject} The data object, properly modified 12640 */ 12641 12642/** 12643 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 12644 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 12645 * needed by the library. 12646 * 12647 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 12648 * All the other properties are configurations that could be tweaked. 12649 * @namespace modifiers 12650 */ 12651var modifiers = { 12652 /** 12653 * Modifier used to shift the popper on the start or end of its reference 12654 * element.<br /> 12655 * It will read the variation of the `placement` property.<br /> 12656 * It can be one either `-end` or `-start`. 12657 * @memberof modifiers 12658 * @inner 12659 */ 12660 shift: { 12661 /** @prop {number} order=100 - Index used to define the order of execution */ 12662 order: 100, 12663 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12664 enabled: true, 12665 /** @prop {ModifierFn} */ 12666 fn: shift 12667 }, 12668 12669 /** 12670 * The `offset` modifier can shift your popper on both its axis. 12671 * 12672 * It accepts the following units: 12673 * - `px` or unit-less, interpreted as pixels 12674 * - `%` or `%r`, percentage relative to the length of the reference element 12675 * - `%p`, percentage relative to the length of the popper element 12676 * - `vw`, CSS viewport width unit 12677 * - `vh`, CSS viewport height unit 12678 * 12679 * For length is intended the main axis relative to the placement of the popper.<br /> 12680 * This means that if the placement is `top` or `bottom`, the length will be the 12681 * `width`. In case of `left` or `right`, it will be the `height`. 12682 * 12683 * You can provide a single value (as `Number` or `String`), or a pair of values 12684 * as `String` divided by a comma or one (or more) white space
12684s.<br /> 12685 * The latter is a deprecated method because it leads to confusion and will be 12686 * removed in v2.<br /> 12687 * Additionally, it accepts additions and subtractions between different units. 12688 * Note that multiplications and divisions aren't supported. 12689 * 12690 * Valid examples are: 12691 * ``` 12692 * 10 12693 * '10%' 12694 * '10, 10' 12695 * '10%, 10' 12696 * '10 + 10%' 12697 * '10 - 5vh + 3%' 12698 * '-10px + 5vh, 5px - 6%' 12699 * ``` 12700 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 12701 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 12702 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 12703 * 12704 * @memberof modifiers 12705 * @inner 12706 */ 12707 offset: { 12708 /** @prop {number} order=200 - Index used to define the order of execution */ 12709 order: 200, 12710 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12711 enabled: true, 12712 /** @prop {ModifierFn} */ 12713 fn: offset, 12714 /** @prop {Number|String} offset=0 12715 * The offset value as described in the modifier description 12716 */ 12717 offset: 0 12718 }, 12719 12720 /** 12721 * Modifier used to prevent the popper from being positioned outside the boundary. 12722 * 12723 * A scenario exists where the reference itself is not within the boundaries.<br /> 12724 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 12725 * In this case we need to decide whether the popper should either: 12726 * 12727 * - detach from the reference and remain "trapped" in the boundaries, or 12728 * - if it should ignore the boundary and "escape with its reference" 12729 * 12730 * When `escapeWithReference` is set to`true` and reference is completely 12731 * outside its boundaries, the popper will overflow (or completely leave) 12732 * the boundaries in order to remain attached to the edge of the reference. 12733 * 12734 * @memberof modifiers 12735 * @inner 12736 */ 12737 preventOverflow: { 12738 /** @prop {number} order=300 - Index used to define the order of execution */ 12739 order: 300, 12740 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12741 enabled: true, 12742 /** @prop {ModifierFn} */ 12743 fn: preventOverflow, 12744 /** 12745 * @prop {Array} [priority=['left','right','top','bottom']] 12746 * Popper will try to prevent overflow following these priorities by default, 12747 * then, it could overflow on the left and on top of the `boundariesElement` 12748 */ 12749 priority: ['left', 'right', 'top', 'bottom'], 12750 /** 12751 * @prop {number} padding=5 12752 * Amount of pixel used to define a minimum distance between the boundaries 12753 * and the popper. This makes sure the popper always has a little padding 12754 * between the edges of its container 12755 */ 12756 padding: 5, 12757 /** 12758 * @prop {String|HTMLElement} boundariesElement='scrollParent' 12759 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 12760 * `viewport` or any DOM element. 12761 */ 12762 boundariesElement: 'scrollParent' 12763 }, 12764 12765 /** 12766 * Modifier used to make sure the reference and its popper stay near each other 12767 * without leaving any gap between the two. Especially useful when the arrow is 12768 * enabled and you want to ensure that it points to its reference element. 12769 * It cares only about the first axis. You can still have poppers with margin 12770 * between the popper and its reference element. 12771 * @memberof modifiers 12772 * @inner 12773 */ 12774 keepTogether: { 12775 /** @prop {number} order=400 - Index used to define the order of execution */ 12776 order: 400, 12777 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12778 enabled: true, 12779 /** @prop {ModifierFn} */ 12780 fn: keepTogether 12781 }, 12782 12783 /** 12784 * This modifier is used to move the `arrowElement` of the popper to make 12785 * sure it is positioned between the reference element and its popper element. 12786 * It will read the outer size of the `arrowElement` node to detect how many 12787 * pixels of conjunction are needed. 12788 * 12789 * It has no effect if no `arrowElement` is provided. 12790 * @memberof modifiers 12791 * @inner 12792 */ 12793 arrow: { 12794 /** @prop {number} order=500 - Index used to define the order of execution */ 12795 order: 500, 12796 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12797 enabled: true, 12798 /** @prop {ModifierFn} */ 12799 fn: arrow, 12800 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 12801 element: '[x-arrow]' 12802 }, 12803 12804 /** 12805 * Modifier used to flip the popper's placement when it starts to overlap its 12806 * reference element. 12807 * 12808 * Requires the `preventOverflow` modifier before it in order to work. 12809 * 12810 * **NOTE:** this modifier will interrupt the current update cycle and will 12811 * restart it if it detects the need to flip the placement. 12812 * @memberof modifiers 12813 * @inner 12814 */ 12815 flip: { 12816 /** @prop {number} order=600 - Index used to define the order of execution */ 12817 order: 600, 12818 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12819 enabled: true, 12820 /** @prop {ModifierFn} */ 12821 fn: flip, 12822 /** 12823 * @prop {String|Array} behavior='flip' 12824 * The behavior used to change the popper's placement. It can be one of 12825 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 12826 * placements (with optional variations) 12827 */ 12828 behavior: 'flip', 12829 /** 12830 * @prop {number} padding=5 12831 * The popper will flip if it hits the edges of the `boundariesElement` 12832 */ 12833 padding: 5, 12834 /** 12835 * @prop {String|HTMLElement} boundariesElement='viewport' 12836 * The element which will define the boundaries of the popper position. 12837 * The popper will never be placed outside of the defined boundaries 12838 * (except if `keepTogether` is enabled) 12839 */ 12840 boundariesElement: 'viewport', 12841 /** 12842 * @prop {Boolean} flipVariations=false 12843 * The popper will switch placement variation between `-start` and `-end` when 12844 * the reference element overlaps its boundaries. 12845 * 12846 * The original placement should have a set variation. 12847 */ 12848 flipVariations: false, 12849 /** 12850 * @prop {Boolean} flipVariationsByContent=false 12851 * The popper will switch placement variation between `-start` and `-end` when 12852 * the popper element overlaps its reference boundaries. 12853 * 12854 * The original placement should have a set variation. 12855 */ 12856 flipVariationsByContent: false 12857 }, 12858 12859 /** 12860 * Modifier used to make the popper flow toward the inner of the reference element. 12861 * By default, when this modifier is disabled, the popper will be placed outside 12862 * the reference element. 12863 * @memberof modifiers 12864 * @inner 12865 */ 12866 inner: { 12867 /** @prop {number} order=700 - Index used to define the order of execution */ 12868 order: 700, 12869 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 12870 enabled: false, 12871 /** @prop {ModifierFn} */ 12872 fn: inner 12873 }, 12874 12875 /** 12876 * Modifier used to hide the popper when its reference element is outside of the 12877 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 12878 * be used to hide with a CSS selector the popper when its reference is 12879 * out of boundaries. 12880 * 12881 * Requires the `preventOverflow` modifier before it in order to work. 12882 * @memberof modifiers 12883 * @inner 12884 */ 12885 hide: { 12886 /** @prop {number} order=800 - Index used to define the order of execution */ 12887 order: 800, 12888 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12889 enabled: true, 12890 /** @prop {ModifierFn} */ 12891 fn: hide 12892 }, 12893 12894 /** 12895 * Computes the style that will be applied to the popper element to gets 12896 * properly positioned. 12897 * 12898 * Note that this modifier will not touch the DOM, it just prepares the styles 12899 * so that `applyStyle` modifier can apply it. This separation is useful 12900 * in case you need to replace `applyStyle` with a custom implementation. 12901 * 12902 * This modifier has `850` as `order` value to maintain backward compatibility 12903 * with previous versions of Popper.js. Expect the modifiers ordering method 12904 * to change in future major versions of the library. 12905 * 12906 * @memberof modifiers 12907 * @inner 12908 */ 12909 computeStyle: { 12910 /** @prop {number} order=850 - Index used to define the order of execution */ 12911 order: 850, 12912 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12913 enabled: true, 12914 /** @prop {ModifierFn} */ 12915 fn: computeStyle, 12916 /** 12917 * @prop {Boolean} gpuAcceleration=true 12918 * If true, it uses the CSS 3D transformation to position the popper. 12919 * Otherwise, it will use the `top` and `left` properties 12920 */ 12921 gpuAcceleration: true, 12922 /** 12923 * @prop {string} [x='bottom'] 12924 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 12925 * Change this if your popper should grow in a direction different from `bottom` 12926 */ 12927 x: 'bottom', 12928 /** 12929 * @prop {string} [x='left'] 12930 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 12931 * Change this if your popper should grow in a direction different from `right` 12932 */ 12933 y: 'right' 12934 }, 12935 12936 /** 12937 * Applies the computed styles to the popper element. 12938 * 12939 * All the DOM manipulations are limited to this modifier. This is useful in case 12940 * you want to integrate Popper.js inside a framework or view library and you 12941 * want to delegate all the DOM manipulations to it. 12942 * 12943 * Note that if you disable this modifier, you must make sure the popper element 12944 * has its position set to `absolute` before Popper.js can do its work! 12945 * 12946 * Just disable this modifier and define your own to achieve the desired effect. 12947 * 12948 * @memberof modifiers 12949 * @inner 12950 */ 12951 applyStyle: { 12952 /** @prop {number} order=900 - Index used to define the order of execution */ 12953 order: 900, 12954 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 12955 enabled: true, 12956 /** @prop {ModifierFn} */
vendor: 4,967 bytes, lines 12957-13095
12957 fn: applyStyle, 12958 /** @prop {Function} */ 12959 onLoad: applyStyleOnLoad, 12960 /** 12961 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 12962 * @prop {Boolean} gpuAcceleration=true 12963 * If true, it uses the CSS 3D transformation to position the popper. 12964 * Otherwise, it will use the `top` and `left` properties 12965 */ 12966 gpuAcceleration: undefined 12967 } 12968}; 12969 12970/** 12971 * The `dataObject` is an object containing all the information used by Popper.js. 12972 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 12973 * @name dataObject 12974 * @property {Object} data.instance The Popper.js instance 12975 * @property {String} data.placement Placement applied to popper 12976 * @property {String} data.originalPlacement Placement originally defined on init 12977 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 12978 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 12979 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 12980 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 12981 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 12982 * @property {Object} data.boundaries Offsets of the popper boundaries 12983 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 12984 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 12985 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 12986 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 12987 */ 12988 12989/** 12990 * Default options provided to Popper.js constructor.<br /> 12991 * These can be overridden using the `options` argument of Popper.js.<br /> 12992 * To override an option, simply pass an object with the same 12993 * structure of the `options` object, as the 3rd argument. For example: 12994 * ``` 12995 * new Popper(ref, pop, { 12996 * modifiers: { 12997 * preventOverflow: { enabled: false } 12998 * } 12999 * }) 13000 * ``` 13001 * @type {Object} 13002 * @static 13003 * @memberof Popper 13004 */ 13005var Defaults = { 13006 /** 13007 * Popper's placement. 13008 * @prop {Popper.placements} placement='bottom' 13009 */ 13010 placement: 'bottom', 13011 13012 /** 13013 * Set this to true if you want popper to position it self in 'fixed' mode 13014 * @prop {Boolean} positionFixed=false 13015 */ 13016 positionFixed: false, 13017 13018 /** 13019 * Whether events (resize, scroll) are initially enabled. 13020 * @prop {Boolean} eventsEnabled=true 13021 */ 13022 eventsEnabled: true, 13023 13024 /** 13025 * Set to true if you want to automatically remove the popper when 13026 * you call the `destroy` method. 13027 * @prop {Boolean} removeOnDestroy=false 13028 */ 13029 removeOnDestroy: false, 13030 13031 /** 13032 * Callback called when the popper is created.<br /> 13033 * By default, it is set to no-op.<br /> 13034 * Access Popper.js instance with `data.instance`. 13035 * @prop {onCreate} 13036 */ 13037 onCreate: function onCreate() {}, 13038 13039 /** 13040 * Callback called when the popper is updated. This callback is not called 13041 * on the initialization/creation of the popper, but only on subsequent 13042 * updates.<br /> 13043 * By default, it is set to no-op.<br /> 13044 * Access Popper.js instance with `data.instance`. 13045 * @prop {onUpdate} 13046 */ 13047 onUpdate: function onUpdate() {}, 13048 13049 /** 13050 * List of modifiers used to modify the offsets before they are applied to the popper. 13051 * They provide most of the functionalities of Popper.js. 13052 * @prop {modifiers} 13053 */ 13054 modifiers: modifiers 13055}; 13056 13057/** 13058 * @callback onCreate 13059 * @param {dataObject} data 13060 */ 13061 13062/** 13063 * @callback onUpdate 13064 * @param {dataObject} data 13065 */ 13066 13067// Utils 13068// Methods 13069var Popper = function () { 13070 /** 13071 * Creates a new Popper.js instance. 13072 * @class Popper 13073 * @param {Element|referenceObject} reference - The reference element used to position the popper 13074 * @param {Element} popper - The HTML / XML element used as the popper 13075 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 13076 * @return {Object} instance - The generated Popper.js instance 13077 */ 13078 function Popper(reference, popper) { 13079 var _this = this; 13080 13081 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 13082 classCallCheck(this, Popper); 13083 13084 this.scheduleUpdate = function () { 13085 return requestAnimationFrame(_this.update); 13086 }; 13087 13088 // make update() debounced, so that it only runs at most once-per-tick 13089 this.update = debounce(this.update.bind(this)); 13090 13091 // with {} we create a new object with the options inside it 13092 this.options = _extends({}, Popper.Defaults, options); 13093 13094 // init state 13095 this.state = {
13096 isDestroyed: false, 13097 isCreated: false, 13098 scrollParents: [] 13099 }; 13100 13101 // get reference and popper elements (allow jQuery wrappers) 13102 this.reference = reference && reference.jquery ? reference[0] : reference; 13103 this.popper = popper && popper.jquery ? popper[0] : popper; 13104 13105 // Deep merge modifiers options 13106 this.options.modifiers = {}; 13107 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 13108 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 13109 }); 13110 13111 // Refactoring modifiers' list (Object => Array) 13112 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 13113 return _extends({ 13114 name: name 13115 }, _this.options.modifiers[name]); 13116 }) 13117 // sort the modifiers by order 13118 .sort(function (a, b) { 13119 return a.order - b.order; 13120 }); 13121 13122 // modifiers have the ability to execute arbitrary code when Popper.js get inited 13123 // such code is executed in the same order of its modifier 13124 // they could add new properties to their options configuration 13125 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 13126 this.modifiers.forEach(function (modifierOptions) { 13127 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 13128 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 13129 } 13130 }); 13131 13132 // fire the first update to position the popper in the right place 13133 this.update(); 13134 13135 var eventsEnabled = this.options.eventsEnabled; 13136 if (eventsEnabled) { 13137 // setup event listeners, they will take care of update the position in specific situations 13138 this.enableEventListeners(); 13139 } 13140 13141 this.state.eventsEnabled = eventsEnabled; 13142 } 13143 13144 // We can't use class properties because they don't get listed in the 13145 // class prototype and break stuff like Sinon stubs 13146 13147 13148 createClass(Popper, [{ 13149 key: 'update', 13150 value: function update$$1() { 13151 return update.call(this); 13152 } 13153 }, { 13154 key: 'destroy', 13155 value: function destroy$$1() { 13156 return destroy.call(this); 13157 } 13158 }, { 13159 key: 'enableEventListeners', 13160 value: function enableEventListeners$$1() { 13161 return enableEventListeners.call(this); 13162 } 13163 }, { 13164 key: 'disableEventListeners', 13165 value: function disableEventListeners$$1() { 13166 return disableEventListeners.call(this); 13167 } 13168 13169 /** 13170 * Schedules an update. It will run on the next UI update available. 13171 * @method scheduleUpdate 13172 * @memberof Popper 13173 */ 13174 13175 13176 /** 13177 * Collection of utilities useful when writing custom modifiers. 13178 * Starting from version 1.7, this method is available only if you 13179 * include `popper-utils.js` before `popper.js`. 13180 * 13181 * **DEPRECATION**: This way to access PopperUtils is deprecated 13182 * and will be removed in v2! Use the PopperUtils module directly instead. 13183 * Due to the high instability of the methods contained in Utils, we can't 13184 * guarantee them to follow semver. Use them at your own risk! 13185 * @static 13186 * @private 13187 * @type {Object} 13188 * @deprecated since version 1.8 13189 * @member Utils 13190 * @memberof Popper 13191 */ 13192 13193 }]); 13194 return Popper; 13195}(); 13196 13197/** 13198 * The `referenceObject` is an object that provides an interface compatible with Popper.js 13199 * and lets you use it as replacement of a real DOM node.<br /> 13200 * You can use this method to position a popper relatively to a set of coordinates 13201 * in case you don't have a DOM node to use as reference. 13202 * 13203 * ``` 13204 * new Popper(referenceObject, popperNode); 13205 * ``` 13206 * 13207 * NB: This feature isn't supported in Internet Explorer 10. 13208 * @name referenceObject 13209 * @property {Function} data.getBoundingClientRect 13210 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 13211 * @property {number} data.clientWidth 13212 * An ES6 getter that will return the width of the virtual reference element. 13213 * @property {number} data.clientHeight 13214 * An ES6 getter that will return the height of the virtual reference element. 13215 */ 13216 13217 13218Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 13219Popper.placements = placements; 13220Popper.Defaults = Defaults; 13221 13222return Popper; 13223 13224}))); 13225//# sourceMappingURL=popper.js.map 13226 13227// импоÑÑиÑÑем Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе js-ÑÐ°Ð¹Ð»Ñ Bootstrap 4 13228/*! 13229 * Bootstrap util.js v4.4.1 (https://getbootstrap.com/) 13230 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13231 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 13232 */ 13233(function (global, factory) { 13234 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : 13235 typeof define === 'function' && define.amd ? define(['jquery'], factory) : 13236 (global = global || self, global.Util = factory(global.jQuery)); 13237}(this, (function ($) { 'use strict'; 13238 13239 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13240 13241 /** 13242 * -------------------------------------------------------------------------- 13243 * Bootstrap (v4.4.1): util.js 13244 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 13245 * -------------------------------------------------------------------------- 13246 */ 13247 /** 13248 * ------------------------------------------------------------------------ 13249 * Private TransitionEnd Helpers 13250 * ------------------------------------------------------------------------ 13251 */ 13252 13253 var TRANSITION_END = 'transitionend'; 13254 var MAX_UID = 1000000; 13255 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 13256 13257 function toType(obj) { 13258 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 13259 } 13260 13261 function getSpecialTransitionEndEvent() { 13262 return { 13263 bindType: TRANSITION_END, 13264 delegateType: TRANSITION_END, 13265 handle: function handle(event) { 13266 if ($(event.target).is(this)) { 13267 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 13268 } 13269 13270 return undefined; // eslint-disable-line no-undefined 13271 } 13272 }; 13273 } 13274 13275 function transitionEndEmulator(duration) { 13276 var _this = this; 13277 13278 var called = false; 13279 $(this).one(Util.TRANSITION_END, function () { 13280 called = true; 13281 });
vendor: 4,510 bytes, lines 13282-13405
13282 setTimeout(function () { 13283 if (!called) { 13284 Util.triggerTransitionEnd(_this); 13285 } 13286 }, duration); 13287 return this; 13288 } 13289 13290 function setTransitionEndSupport() { 13291 $.fn.emulateTransitionEnd = transitionEndEmulator; 13292 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 13293 } 13294 /** 13295 * -------------------------------------------------------------------------- 13296 * Public Util Api 13297 * -------------------------------------------------------------------------- 13298 */ 13299 13300 13301 var Util = { 13302 TRANSITION_END: 'bsTransitionEnd', 13303 getUID: function getUID(prefix) { 13304 do { 13305 // eslint-disable-next-line no-bitwise 13306 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 13307 } while (document.getElementById(prefix)); 13308 13309 return prefix; 13310 }, 13311 getSelectorFromElement: function getSelectorFromElement(element) { 13312 var selector = element.getAttribute('data-target'); 13313 13314 if (!selector || selector === '#') { 13315 var hrefAttr = element.getAttribute('href'); 13316 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 13317 } 13318 13319 try { 13320 return document.querySelector(selector) ? selector : null; 13321 } catch (err) { 13322 return null; 13323 } 13324 }, 13325 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 13326 if (!element) { 13327 return 0; 13328 } // Get transition-duration of the element 13329 13330 13331 var transitionDuration = $(element).css('transition-duration'); 13332 var transitionDelay = $(element).css('transition-delay'); 13333 var floatTransitionDuration = parseFloat(transitionDuration); 13334 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 13335 13336 if (!floatTransitionDuration && !floatTransitionDelay) { 13337 return 0; 13338 } // If multiple durations are defined, take the first 13339 13340 13341 transitionDuration = transitionDuration.split(',')[0]; 13342 transitionDelay = transitionDelay.split(',')[0]; 13343 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 13344 }, 13345 reflow: function reflow(element) { 13346 return element.offsetHeight; 13347 }, 13348 triggerTransitionEnd: function triggerTransitionEnd(element) { 13349 $(element).trigger(TRANSITION_END); 13350 }, 13351 // TODO: Remove in v5 13352 supportsTransitionEnd: function supportsTransitionEnd() { 13353 return Boolean(TRANSITION_END); 13354 }, 13355 isElement: function isElement(obj) { 13356 return (obj[0] || obj).nodeType; 13357 }, 13358 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 13359 for (var property in configTypes) { 13360 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 13361 var expectedTypes = configTypes[property]; 13362 var value = config[property]; 13363 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 13364 13365 if (!new RegExp(expectedTypes).test(valueType)) { 13366 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 13367 } 13368 } 13369 } 13370 }, 13371 findShadowRoot: function findShadowRoot(element) { 13372 if (!document.documentElement.attachShadow) { 13373 return null; 13374 } // Can find the shadow root otherwise it'll return the document 13375 13376 13377 if (typeof element.getRootNode === 'function') { 13378 var root = element.getRootNode(); 13379 return root instanceof ShadowRoot ? root : null; 13380 } 13381 13382 if (element instanceof ShadowRoot) { 13383 return element; 13384 } // when we don't find a shadow root 13385 13386 13387 if (!element.parentNode) { 13388 return null; 13389 } 13390 13391 return Util.findShadowRoot(element.parentNode); 13392 }, 13393 jQueryDetection: function jQueryDetection() { 13394 if (typeof $ === 'undefined') { 13395 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 13396 } 13397 13398 var version = $.fn.jquery.split(' ')[0].split('.'); 13399 var minMajor = 1; 13400 var ltMajor = 2; 13401 var minMinor = 9; 13402 var minPatch = 1; 13403 var maxMajor = 4; 13404 13405 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
13405= maxMajor) { 13406 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 13407 } 13408 } 13409 }; 13410 Util.jQueryDetection(); 13411 setTransitionEndSupport(); 13412 13413 return Util; 13414 13415}))); 13416//# sourceMappingURL=util.js.map 13417/*! 13418 * Bootstrap alert.js v4.4.1 (https://getbootstrap.com/) 13419 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13420 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 13421 */ 13422(function (global, factory) { 13423 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 13424 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 13425 (global = global || self, global.Alert = factory(global.jQuery, global.Util)); 13426}(this, (function ($, Util) { 'use strict'; 13427 13428 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13429 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 13430 13431 function _defineProperties(target, props) { 13432 for (var i = 0; i < props.length; i++) { 13433 var descriptor = props[i]; 13434 descriptor.enumerable = descriptor.enumerable || false; 13435 descriptor.configurable = true; 13436 if ("value" in descriptor) descriptor.writable = true; 13437 Object.defineProperty(target, descriptor.key, descriptor); 13438 } 13439 } 13440 13441 function _createClass(Constructor, protoProps, staticProps) { 13442 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 13443 if (staticProps) _defineProperties(Constructor, staticProps); 13444 return Constructor; 13445 } 13446 13447 /** 13448 * ------------------------------------------------------------------------ 13449 * Constants 13450 * ------------------------------------------------------------------------ 13451 */ 13452 13453 var NAME = 'alert'; 13454 var VERSION = '4.4.1'; 13455 var DATA_KEY = 'bs.alert'; 13456 var EVENT_KEY = "." + DATA_KEY; 13457 var DATA_API_KEY = '.data-api'; 13458 var JQUERY_NO_CONFLICT = $.fn[NAME]; 13459 var Selector = { 13460 DISMISS: '[data-dismiss="alert"]' 13461 }; 13462 var Event = { 13463 CLOSE: "close" + EVENT_KEY, 13464 CLOSED: "closed" + EVENT_KEY, 13465 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 13466 }; 13467 var ClassName = { 13468 ALERT: 'alert', 13469 FADE: 'fade', 13470 SHOW: 'show' 13471 }; 13472 /** 13473 * ------------------------------------------------------------------------ 13474 * Class Definition 13475 * ------------------------------------------------------------------------ 13476 */ 13477 13478 var Alert = 13479 /*#__PURE__*/ 13480 function () { 13481 function Alert(element) { 13482 this._element = element; 13483 } // Getters 13484 13485 13486 var _proto = Alert.prototype; 13487 13488 // Public 13489 _proto.close = function close(element) { 13490 var rootElement = this._element; 13491 13492 if (element) { 13493 rootElement = this._getRootElement(element); 13494 } 13495 13496 var customEvent = this._triggerCloseEvent(rootElement); 13497 13498 if (customEvent.isDefaultPrevented()) { 13499 return; 13500 } 13501 13502 this._removeElement(rootElement); 13503 }; 13504 13505 _proto.dispose = function dispose() { 13506 $.removeData(this._element, DATA_KEY); 13507 this._element = null; 13508 } // Private 13509 ; 13510 13511 _proto._getRootElement = function _getRootElement(element) { 13512 var selector = Util.getSelectorFromElement(element); 13513 var parent = false; 13514 13515 if (selector) { 13516 parent = document.querySelector(selector); 13517 } 13518 13519 if (!parent) { 13520 parent = $(element).closest("." + ClassName.ALERT)[0]; 13521 } 13522 13523 return parent; 13524 }; 13525 13526 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 13527 var closeEvent = $.Event(Event.CLOSE); 13528 $(element).trigger(closeEvent); 13529 return closeEvent; 13530 }; 13531 13532 _proto._removeElement = function _removeElement(element) { 13533 var _this = this; 13534 13535 $(element).removeClass(ClassName.SHOW); 13536 13537 if (!$(element).hasClass(ClassName.FADE)) { 13538 this._destroyElement(element); 13539 13540 return; 13541 } 13542 13543 var transitionDuration = Util.getTransitionDurationFromElement(element); 13544 $(element).one(Util.TRANSITION_END, function (event) { 13545 return _this._destroyElement(element, event); 13546 }).emulateTransitionEnd(transitionDuration); 13547 }; 13548 13549 _proto._destroyElement = function _destroyElement(element) { 13550 $(element).detach().trigger(Event.CLOSED).remove(); 13551 } // Static 13552 ; 13553 13554 Alert._jQueryInterface = function _jQueryInterface(config) { 13555 return this.each(function () { 13556 var $element = $(this); 13557 var data = $element.data(DATA_KEY); 13558 13559 if (!data) { 13560 data = new Alert(this); 13561 $element.data(DATA_KEY, data); 13562 } 13563 13564 if (config === 'close') { 13565 data[config](this); 13566 } 13567 }); 13568 }; 13569 13570 Alert._handleDismiss = function _handleDismiss(alertInstance) { 13571 return function (event) { 13572 if (event) { 13573 event.preventDefault(); 13574 } 13575 13576 alertInstance.close(this); 13577 }; 13578 }; 13579 13580 _createClass(Alert, null, [{ 13581 key: "VERSION", 13582 get: function get() { 13583 return VERSION; 13584 } 13585 }]); 13586 13587 return Alert; 13588 }(); 13589 /** 13590 * ------------------------------------------------------------------------ 13591 * Data Api implementation 13592 * ------------------------------------------------------------------------ 13593 */ 13594 13595 13596 $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 13597 /** 13598 * ------------------------------------------------------------------------ 13599 * jQuery 13600 * ------------------------------------------------------------------------ 13601 */ 13602 13603 $.fn[NAME] = Alert._jQueryInterface; 13604 $.fn[NAME].Constructor = Alert; 13605 13606 $.fn[NAME].noConflict = function () { 13607 $.fn[NAME] = JQUERY_NO_CONFLICT; 13608 return Alert._jQueryInterface; 13609 }; 13610 13611 return Alert; 13612 13613}))); 13614//# sourceMappingURL=alert.js.map 13615/*! 13616 * Bootstrap button.js v4.4.1 (https://getbootstrap.com/) 13617 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13618 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 13619 */ 13620(function (global, factory) { 13621 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : 13622 typeof define === 'function' && define.amd ? define(['jquery'], factory) : 13623 (global = global || self, global.Button = factory(global.jQuery)); 13624}(this, (function ($) { 'use strict'; 13625 13626 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13627 13628 function _defineProperties(target, props) { 13629 for (var i = 0; i < props.length; i++) { 13630 var descriptor = props[i]; 13631 descriptor.enumerable = descriptor.enumerable || false; 13632 descriptor.configurable = true; 13633 if ("value" in descriptor) descriptor.writable = true; 13634 Object.defineProperty(target, descriptor.key, descriptor); 13635 } 13636 } 13637 13638 function _createClass(Constructor, protoProps, staticProps) { 13639 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 13640 if (staticProps) _defineProperties(Constructor, staticProps); 13641 return Constructor; 13642 } 13643 13644 /** 13645 * ------------------------------------------------------------------------ 13646 * Constants 13647 * ------------------------------------------------------------------------ 13648 */ 13649 13650 var NAME = 'button'; 13651 var VERSION = '4.4.1'; 13652 var DATA_KEY = 'bs.button'; 13653 var EVENT_KEY = "." + DATA_KEY; 13654 var DATA_API_KEY = '.data-api'; 13655 var JQUERY_NO_CONFLICT = $.fn[NAME]; 13656 var ClassName = { 13657 ACTIVE: 'active', 13658 BUTTON: 'btn', 13659 FOCUS: 'focus' 13660 }; 13661 var Selector = { 13662 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 13663 DATA_TOGGLES: '[data-toggle="buttons"]', 13664 DATA_TOGGLE: '[data-toggle="button"]', 13665 DATA_TOGGLES_BUTTONS: '[data-toggle="buttons"] .btn', 13666 INPUT: 'input:not([type="hidden"])', 13667 ACTIVE: '.active', 13668 BUTTON: '.btn' 13669 }; 13670 var Event = { 13671 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY, 13672 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY), 13673 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY 13674 }; 13675 /** 13676 * ------------------------------------------------------------------------ 13677 * Class Definition 13678 * ------------------------------------------------------------------------ 13679 */ 13680 13681 var Button = 13682 /*#__PURE__*/ 13683 function () { 13684 function Button(element) { 13685 this._element = element; 13686 } // Getters 13687 13688 13689 var _proto = Button.prototype; 13690 13691 // Public
13692 _proto.toggle = function toggle() { 13693 var triggerChangeEvent = true; 13694 var addAriaPressed = true; 13695 var rootElement = $(this._element).closest(Selector.DATA_TOGGLES)[0]; 13696 13697 if (rootElement) { 13698 var input = this._element.querySelector(Selector.INPUT); 13699 13700 if (input) { 13701 if (input.type === 'radio') { 13702 if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) { 13703 triggerChangeEvent = false; 13704 } else { 13705 var activeElement = rootElement.querySelector(Selector.ACTIVE); 13706 13707 if (activeElement) { 13708 $(activeElement).removeClass(ClassName.ACTIVE); 13709 } 13710 } 13711 } else if (input.type === 'checkbox') { 13712 if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName.ACTIVE)) { 13713 triggerChangeEvent = false; 13714 } 13715 } else { 13716 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 13717 triggerChangeEvent = false; 13718 } 13719 13720 if (triggerChangeEvent) { 13721 input.checked = !this._element.classList.contains(ClassName.ACTIVE); 13722 $(input).trigger('change'); 13723 } 13724 13725 input.focus(); 13726 addAriaPressed = false; 13727 } 13728 } 13729 13730 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 13731 if (addAriaPressed) { 13732 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE)); 13733 } 13734 13735 if (triggerChangeEvent) { 13736 $(this._element).toggleClass(ClassName.ACTIVE); 13737 } 13738 } 13739 }; 13740 13741 _proto.dispose = function dispose() { 13742 $.removeData(this._element, DATA_KEY); 13743 this._element = null; 13744 } // Static 13745 ; 13746 13747 Button._jQueryInterface = function _jQueryInterface(config) { 13748 return this.each(function () { 13749 var data = $(this).data(DATA_KEY); 13750 13751 if (!data) { 13752 data = new Button(this); 13753 $(this).data(DATA_KEY, data); 13754 } 13755 13756 if (config === 'toggle') { 13757 data[config](); 13758 } 13759 }); 13760 }; 13761 13762 _createClass(Button, null, [{ 13763 key: "VERSION", 13764 get: function get() { 13765 return VERSION; 13766 } 13767 }]); 13768 13769 return Button; 13770 }(); 13771 /** 13772 * ------------------------------------------------------------------------ 13773 * Data Api implementation 13774 * ------------------------------------------------------------------------ 13775 */ 13776 13777 13778 $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { 13779 var button = event.target; 13780 13781 if (!$(button).hasClass(ClassName.BUTTON)) { 13782 button = $(button).closest(Selector.BUTTON)[0]; 13783 } 13784 13785 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 13786 event.preventDefault(); // work around Firefox bug #1540995 13787 } else { 13788 var inputBtn = button.querySelector(Selector.INPUT); 13789 13790 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 13791 event.preventDefault(); // work around Firefox bug #1540995 13792 13793 return; 13794 } 13795 13796 Button._jQueryInterface.call($(button), 'toggle'); 13797 } 13798 }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { 13799 var button = $(event.target).closest(Selector.BUTTON)[0]; 13800 $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); 13801 }); 13802 $(window).on(Event.LOAD_DATA_API, function () { 13803 // ensure correct active class is set to match the controls' actual values/states 13804 // find all checkboxes/readio buttons inside data-toggle groups 13805 var buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLES_BUTTONS)); 13806 13807 for (var i = 0, len = buttons.length; i < len; i++) { 13808 var button = buttons[i]; 13809 var input = button.querySelector(Selector.INPUT); 13810 13811 if (input.checked || input.hasAttribute('checked')) { 13812 button.classList.add(ClassName.ACTIVE); 13813 } else { 13814 button.classList.remove(ClassName.ACTIVE); 13815 } 13816 } // find all button toggles 13817 13818 13819 buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); 13820 13821 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 13822 var _button = buttons[_i]; 13823 13824 if (_button.getAttribute('aria-pressed') === 'true') { 13825 _button.classList.add(ClassName.ACTIVE); 13826 } else { 13827 _button.classList.remove(ClassName.ACTIVE); 13828 } 13829 } 13830 }); 13831 /** 13832 * ------------------------------------------------------------------------ 13833 * jQuery 13834 * ------------------------------------------------------------------------ 13835 */ 13836 13837 $.fn[NAME] = Button._jQueryInterface; 13838 $.fn[NAME].Constructor = Button; 13839 13840 $.fn[NAME].noConflict = function () { 13841 $.fn[NAME] = JQUERY_NO_CONFLICT; 13842 return Button._jQueryInterface; 13843 }; 13844 13845 return Button; 13846 13847}))); 13848//# sourceMappingURL=button.js.map 13849/*! 13850 * Bootstrap carousel.js v4.4.1 (https://getbootstrap.com/) 13851 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13852 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 13853 */ 13854(function (global, factory) { 13855 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 13856 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 13857 (global = global || self, global.Carousel = factory(global.jQuery, global.Util)); 13858}(this, (function ($, Util) { 'use strict'; 13859 13860 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13861 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 13862 13863 function _defineProperties(target, props) { 13864 for (var i = 0; i < props.length; i++) { 13865 var descriptor = props[i]; 13866 descriptor.enumerable = descriptor.enumerable || false; 13867 descriptor.configurable = true; 13868 if ("value" in descriptor) descriptor.writable = true; 13869 Object.defineProperty(target, descriptor.key, descriptor); 13870 } 13871 } 13872 13873 function _createClass(Constructor, protoProps, staticProps) { 13874 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 13875 if (staticProps) _defineProperties(Constructor, staticProps); 13876 return Constructor; 13877 } 13878 13879 function _defineProperty(obj, key, value) { 13880 if (key in obj) { 13881 Object.defineProperty(obj, key, { 13882 value: value, 13883 enumerable: true, 13884 configurable: true, 13885 writable: true 13886 }); 13887 } else { 13888 obj[key] = value; 13889 } 13890 13891 return obj;
13892 } 13893 13894 function ownKeys(object, enumerableOnly) { 13895 var keys = Object.keys(object); 13896 13897 if (Object.getOwnPropertySymbols) { 13898 var symbols = Object.getOwnPropertySymbols(object); 13899 if (enumerableOnly) symbols = symbols.filter(function (sym) { 13900 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13901 }); 13902 keys.push.apply(keys, symbols); 13903 } 13904 13905 return keys; 13906 } 13907 13908 function _objectSpread2(target) { 13909 for (var i = 1; i < arguments.length; i++) { 13910 var source = arguments[i] != null ? arguments[i] : {}; 13911 13912 if (i % 2) { 13913 ownKeys(Object(source), true).forEach(function (key) { 13914 _defineProperty(target, key, source[key]); 13915 }); 13916 } else if (Object.getOwnPropertyDescriptors) { 13917 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 13918 } else { 13919 ownKeys(Object(source)).forEach(function (key) { 13920 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13921 }); 13922 } 13923 } 13924 13925 return target; 13926 } 13927 13928 /** 13929 * ------------------------------------------------------------------------ 13930 * Constants 13931 * ------------------------------------------------------------------------ 13932 */ 13933 13934 var NAME = 'carousel'; 13935 var VERSION = '4.4.1'; 13936 var DATA_KEY = 'bs.carousel'; 13937 var EVENT_KEY = "." + DATA_KEY; 13938 var DATA_API_KEY = '.data-api'; 13939 var JQUERY_NO_CONFLICT = $.fn[NAME]; 13940 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 13941 13942 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 13943 13944 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 13945 13946 var SWIPE_THRESHOLD = 40; 13947 var Default = { 13948 interval: 5000, 13949 keyboard: true, 13950 slide: false, 13951 pause: 'hover', 13952 wrap: true, 13953 touch: true 13954 }; 13955 var DefaultType = { 13956 interval: '(number|boolean)', 13957 keyboard: 'boolean', 13958 slide: '(boolean|string)', 13959 pause: '(string|boolean)', 13960 wrap: 'boolean', 13961 touch: 'boolean' 13962 }; 13963 var Direction = { 13964 NEXT: 'next', 13965 PREV: 'prev', 13966 LEFT: 'left', 13967 RIGHT: 'right' 13968 }; 13969 var Event = { 13970 SLIDE: "slide" + EVENT_KEY, 13971 SLID: "slid" + EVENT_KEY, 13972 KEYDOWN: "keydown" + EVENT_KEY, 13973 MOUSEENTER: "mouseenter" + EVENT_KEY, 13974 MOUSELEAVE: "mouseleave" + EVENT_KEY, 13975 TOUCHSTART: "touchstart" + EVENT_KEY, 13976 TOUCHMOVE: "touchmove" + EVENT_KEY, 13977 TOUCHEND: "touchend" + EVENT_KEY, 13978 POINTERDOWN: "pointerdown" + EVENT_KEY, 13979 POINTERUP: "pointerup" + EVENT_KEY, 13980 DRAG_START: "dragstart" + EVENT_KEY, 13981 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY, 13982 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 13983 }; 13984 var ClassName = { 13985 CAROUSEL: 'carousel', 13986 ACTIVE: 'active', 13987 SLIDE: 'slide', 13988 RIGHT: 'carousel-item-right', 13989 LEFT: 'carousel-item-left', 13990 NEXT: 'carousel-item-next', 13991 PREV: 'carousel-item-prev', 13992 ITEM: 'carousel-item', 13993 POINTER_EVENT: 'pointer-event' 13994 }; 13995 var Selector = { 13996 ACTIVE: '.active', 13997 ACTIVE_ITEM: '.active.carousel-item', 13998 ITEM: '.carousel-item', 13999 ITEM_IMG: '.carousel-item img', 14000 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 14001 INDICATORS: '.carousel-indicators', 14002 DATA_SLIDE: '[data-slide], [data-slide-to]', 14003 DATA_RIDE: '[data-ride="carousel"]' 14004 }; 14005 var PointerType = { 14006 TOUCH: 'touch', 14007 PEN: 'pen' 14008 }; 14009 /** 14010 * ------------------------------------------------------------------------ 14011 * Class Definition 14012 * ------------------------------------------------------------------------ 14013 */ 14014 14015 var Carousel = 14016 /*#__PURE__*/ 14017 function () { 14018 function Carousel(element, config) { 14019 this._items = null; 14020 this._interval = null; 14021 this._activeElement = null; 14022 this._isPaused = false; 14023 this._isSliding = false; 14024 this.touchTimeout = null; 14025 this.touchStartX = 0; 14026 this.touchDeltaX = 0; 14027 this._config = this._getConfig(config); 14028 this._element = element; 14029 this._indicatorsElement = this._element.querySelector(Selector.INDICATORS); 14030 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 14031 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 14032 14033 this._addEventListeners(); 14034 } // Getters 14035 14036 14037 var _proto = Carousel.prototype; 14038 14039 // Public 14040 _proto.next = function next() { 14041 if (!this._isSliding) { 14042 this._slide(Direction.NEXT); 14043 } 14044 }; 14045 14046 _proto.nextWhenVisible = function nextWhenVisible() { 14047 // Don't call next when the page isn't visible 14048 // or the carousel or its parent isn't visible 14049 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 14050 this.next(); 14051 } 14052 }; 14053 14054 _proto.prev = function prev() { 14055 if (!this._isSliding) { 14056 this._slide(Direction.PREV); 14057 } 14058 }; 14059 14060 _proto.pause = function pause(event) { 14061 if (!event) { 14062 this._isPaused = true; 14063 } 14064 14065 if (this._element.querySelector(Selector.NEXT_PREV)) { 14066 Util.triggerTransitionEnd(this._element); 14067 this.cycle(true); 14068 } 14069 14070 clearInterval(this._interval); 14071 this._interval = null; 14072 }; 14073 14074 _proto.cycle = function cycle(event) { 14075 if (!event) { 14076 this._isPaused = false; 14077 } 14078 14079 if (this._interval) { 14080 clearInterval(this._interval); 14081 this._interval = null; 14082 } 14083 14084 if (this._config.interval && !this._isPaused) { 14085 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 14086 } 14087 }; 14088 14089 _proto.to = function to(index) { 14090 var _this = this; 14091 14092 this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); 14093 14094 var activeIndex = this._getItemIndex(this._activeElement); 14095 14096 if (index > this._items.length - 1 || index < 0) { 14097 return; 14098 } 14099 14100 if (this._isSliding) { 14101 $(this._element).one(Event.SLID, function () { 14102 return _this.to(index); 14103 }); 14104 return; 14105 } 14106 14107 if (activeIndex === index) { 14108 this.pause(); 14109 this.cycle(); 14110 return; 14111 } 14112 14113 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 14114 14115 this._slide(direction, this._items[index]); 14116 }; 14117 14118 _proto.dispose = function dispose() { 14119 $(this._element).off(EVENT_KEY); 14120 $.removeData(this._element, DATA_KEY); 14121 this._items = null; 14122 this._config = null; 14123 this._element = null; 14124 this._interval = null; 14125 this._isPaused = null; 14126 this._isSliding = null; 14127 this._activeElement = null; 14128 this._indicatorsElement = null; 14129 } // Private 14130 ; 14131 14132 _proto._getConfig = function _getConfig(config) {
14133 config = _objectSpread2({}, Default, {}, config); 14134 Util.typeCheckConfig(NAME, config, DefaultType); 14135 return config; 14136 }; 14137 14138 _proto._handleSwipe = function _handleSwipe() { 14139 var absDeltax = Math.abs(this.touchDeltaX); 14140 14141 if (absDeltax <= SWIPE_THRESHOLD) { 14142 return; 14143 } 14144 14145 var direction = absDeltax / this.touchDeltaX; 14146 this.touchDeltaX = 0; // swipe left 14147 14148 if (direction > 0) { 14149 this.prev(); 14150 } // swipe right 14151 14152 14153 if (direction < 0) { 14154 this.next(); 14155 } 14156 }; 14157 14158 _proto._addEventListeners = function _addEventListeners() { 14159 var _this2 = this; 14160 14161 if (this._config.keyboard) { 14162 $(this._element).on(Event.KEYDOWN, function (event) { 14163 return _this2._keydown(event); 14164 }); 14165 } 14166 14167 if (this._config.pause === 'hover') { 14168 $(this._element).on(Event.MOUSEENTER, function (event) { 14169 return _this2.pause(event); 14170 }).on(Event.MOUSELEAVE, function (event) { 14171 return _this2.cycle(event); 14172 }); 14173 } 14174 14175 if (this._config.touch) { 14176 this._addTouchEventListeners(); 14177 } 14178 }; 14179 14180 _proto._addTouchEventListeners = function _addTouchEventListeners() { 14181 var _this3 = this; 14182 14183 if (!this._touchSupported) { 14184 return; 14185 } 14186 14187 var start = function start(event) { 14188 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 14189 _this3.touchStartX = event.originalEvent.clientX; 14190 } else if (!_this3._pointerEvent) { 14191 _this3.touchStartX = event.originalEvent.touches[0].clientX; 14192 } 14193 }; 14194 14195 var move = function move(event) { 14196 // ensure swiping with one touch and not pinching 14197 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 14198 _this3.touchDeltaX = 0; 14199 } else { 14200 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 14201 } 14202 }; 14203 14204 var end = function end(event) { 14205 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 14206 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 14207 } 14208 14209 _this3._handleSwipe(); 14210 14211 if (_this3._config.pause === 'hover') { 14212 // If it's a touch-enabled device, mouseenter/leave are fired as 14213 // part of the mouse compatibility events on first tap - the carousel 14214 // would stop cycling until user tapped out of it; 14215 // here, we listen for touchend, explicitly pause the carousel 14216 // (as if it's the second time we tap on it, mouseenter compat event 14217 // is NOT fired) and after a timeout (to allow for mouse compatibility 14218 // events to fire) we explicitly restart cycling 14219 _this3.pause(); 14220 14221 if (_this3.touchTimeout) { 14222 clearTimeout(_this3.touchTimeout); 14223 } 14224 14225 _this3.touchTimeout = setTimeout(function (event) { 14226 return _this3.cycle(event); 14227 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 14228 } 14229 }; 14230 14231 $(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, function (e) { 14232 return e.preventDefault(); 14233 }); 14234 14235 if (this._pointerEvent) { 14236 $(this._element).on(Event.POINTERDOWN, function (event) { 14237 return start(event); 14238 }); 14239 $(this._element).on(Event.POINTERUP, function (event) { 14240 return end(event); 14241 }); 14242 14243 this._element.classList.add(ClassName.POINTER_EVENT); 14244 } else { 14245 $(this._element).on(Event.TOUCHSTART, function (event) { 14246 return start(event); 14247 }); 14248 $(this._element).on(Event.TOUCHMOVE, function (event) { 14249 return move(event); 14250 }); 14251 $(this._element).on(Event.TOUCHEND, function (event) { 14252 return end(event); 14253 }); 14254 } 14255 }; 14256 14257 _proto._keydown = function _keydown(event) { 14258 if (/input|textarea/i.test(event.target.tagName)) { 14259 return; 14260 } 14261 14262 switch (event.which) { 14263 case ARROW_LEFT_KEYCODE: 14264 event.preventDefault(); 14265 this.prev(); 14266 break; 14267 14268 case ARROW_RIGHT_KEYCODE: 14269 event.preventDefault(); 14270 this.next(); 14271 break; 14272 } 14273 }; 14274 14275 _proto._getItemIndex = function _getItemIndex(element) { 14276 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : []; 14277 return this._items.indexOf(element); 14278 }; 14279 14280 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 14281 var isNextDirection = direction === Direction.NEXT; 14282 var isPrevDirection = direction === Direction.PREV; 14283 14284 var activeIndex = this._getItemIndex(activeElement); 14285 14286 var lastItemIndex = this._items.length - 1; 14287 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 14288 14289 if (isGoingToWrap && !this._config.wrap) { 14290 return activeElement; 14291 } 14292 14293 var delta = direction === Direction.PREV ? -1 : 1; 14294 var itemIndex = (activeIndex + delta) % this._items.length; 14295 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 14296 }; 14297 14298 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 14299 var targetIndex = this._getItemIndex(relatedTarget); 14300 14301 var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM)); 14302 14303 var slideEvent = $.Event(Event.SLIDE, { 14304 relatedTarget: relatedTarget, 14305 direction: eventDirectionName, 14306 from: fromIndex, 14307 to: targetIndex 14308 }); 14309 $(this._element).trigger(slideEvent); 14310 return slideEvent; 14311 }; 14312 14313 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 14314 if (this._indicatorsElement) { 14315 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE)); 14316 $(indicators).removeClass(ClassName.ACTIVE); 14317 14318 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 14319 14320 if (nextIndicator) { 14321 $(nextIndicator).addClass(ClassName.ACTIVE); 14322 } 14323 } 14324 }; 14325 14326 _proto._slide = function _slide(direction, element) { 14327 var _this4 = this; 14328 14329 var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); 14330 14331 var activeElementIndex = this._getItemIndex(activeElement); 14332 14333 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 14334 14335 var nextElementIndex = this._getItemIndex(nextElement); 14336 14337 var isCycling = Boolean(this._interval); 14338 var directionalClassName; 14339 var orderClassName; 14340 var eventDirectionName; 14341 14342 if (direction === Direction.NEXT) { 14343 directionalClassName = ClassName.LEFT; 14344 orderClassName = ClassName.NEXT; 14345 eventDirectionName = Direction.LEFT; 14346 } else { 14347 directionalClassName = ClassName.RIGHT; 14348 orderClassName = ClassName.PREV; 14349 eventDirectionName = Direction.RIGHT; 14350 } 14351 14352 if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { 14353 this._isSliding = false; 14354 return; 14355 } 14356 14357 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 14358 14359 if (slideEvent.isDefaultPrevented()) { 14360 return; 14361 } 14362 14363 if (!activeElement || !nextElement) { 14364 // Some weirdness is happening, so we bail 14365 return; 14366 } 14367 14368 this._isSliding = true; 14369 14370 if (isCycling) { 14371 this.pause(); 14372 } 14373 14374 this._setActiveIndicatorElement(nextElement); 14375 14376 var slidEvent = $.Event(Event.SLID, { 14377 relatedTarget: nextElement, 14378 direction: eventDirectionName, 14379 from: activeElementIndex, 14380 to: nextElementIndex 14381 }); 14382 14383 if ($(this._element).hasClass(ClassName.SLIDE)) { 14384 $(nextElement).addClass(orderClassName); 14385 Util.reflow(nextElement); 14386 $(activeElement).addClass(directionalClassName); 14387 $(nextElement).addClass(directionalClassName); 14388 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 14389 14390 if (nextElementInterval) { 14391 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 14392 this._config.interval = nextElementInterval; 14393 } else { 14394 this._config.interval = this._config.defaultInterval || this._config.interval; 14395 } 14396 14397 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 14398 $(activeElement).one(Util.TRANSITION_END, function () { 14399 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE); 14400 $(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName); 14401 _this4._isSliding = false; 14402 setTimeout(function () { 14403 return $(_this4._element).trigger(slidEvent); 14404 }, 0); 14405 }).emulateTransitionEnd(transitionDuration); 14406 } else { 14407 $(activeElement).removeClass(ClassName.ACTIVE); 14408 $(nextElement).addClass(ClassName.ACTIVE); 14409 this._isSliding = false; 14410 $(this._element).trigger(slidEvent); 14411 } 14412 14413 if (isCycling) { 14414 this.cycle(); 14415 } 14416 } // Static 14417 ; 14418 14419 Carousel._jQueryInterface = function _jQueryInterface(config) { 14420 return this.each(function () { 14421 var data = $(this).data(DATA_KEY); 14422
14423 var _config = _objectSpread2({}, Default, {}, $(this).data()); 14424 14425 if (typeof config === 'object') { 14426 _config = _objectSpread2({}, _config, {}, config); 14427 } 14428 14429 var action = typeof config === 'string' ? config : _config.slide; 14430 14431 if (!data) { 14432 data = new Carousel(this, _config); 14433 $(this).data(DATA_KEY, data); 14434 } 14435 14436 if (typeof config === 'number') { 14437 data.to(config); 14438 } else if (typeof action === 'string') { 14439 if (typeof data[action] === 'undefined') { 14440 throw new TypeError("No method named \"" + action + "\""); 14441 } 14442 14443 data[action](); 14444 } else if (_config.interval && _config.ride) { 14445 data.pause(); 14446 data.cycle(); 14447 } 14448 }); 14449 }; 14450 14451 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 14452 var selector = Util.getSelectorFromElement(this); 14453 14454 if (!selector) { 14455 return; 14456 } 14457 14458 var target = $(selector)[0]; 14459 14460 if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { 14461 return; 14462 } 14463 14464 var config = _objectSpread2({}, $(target).data(), {}, $(this).data()); 14465 14466 var slideIndex = this.getAttribute('data-slide-to'); 14467 14468 if (slideIndex) { 14469 config.interval = false; 14470 } 14471 14472 Carousel._jQueryInterface.call($(target), config); 14473 14474 if (slideIndex) { 14475 $(target).data(DATA_KEY).to(slideIndex); 14476 } 14477 14478 event.preventDefault(); 14479 }; 14480 14481 _createClass(Carousel, null, [{ 14482 key: "VERSION", 14483 get: function get() { 14484 return VERSION; 14485 } 14486 }, { 14487 key: "Default", 14488 get: function get() { 14489 return Default; 14490 } 14491 }]); 14492 14493 return Carousel; 14494 }(); 14495 /** 14496 * ------------------------------------------------------------------------ 14497 * Data Api implementation 14498 * ------------------------------------------------------------------------ 14499 */ 14500 14501 14502 $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); 14503 $(window).on(Event.LOAD_DATA_API, function () { 14504 var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE)); 14505 14506 for (var i = 0, len = carousels.length; i < len; i++) { 14507 var $carousel = $(carousels[i]); 14508 14509 Carousel._jQueryInterface.call($carousel, $carousel.data()); 14510 } 14511 }); 14512 /** 14513 * ------------------------------------------------------------------------ 14514 * jQuery 14515 * ------------------------------------------------------------------------ 14516 */ 14517 14518 $.fn[NAME] = Carousel._jQueryInterface; 14519 $.fn[NAME].Constructor = Carousel; 14520 14521 $.fn[NAME].noConflict = function () { 14522 $.fn[NAME] = JQUERY_NO_CONFLICT; 14523 return Carousel._jQueryInterface; 14524 }; 14525 14526 return Carousel; 14527 14528}))); 14529//# sourceMappingURL=carousel.js.map 14530/*! 14531 * Bootstrap collapse.js v4.4.1 (https://getbootstrap.com/) 14532 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14533 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 14534 */ 14535(function (global, factory) { 14536 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 14537 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 14538 (global = global || self, global.Collapse = factory(global.jQuery, global.Util)); 14539}(this, (function ($, Util) { 'use strict'; 14540 14541 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 14542 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 14543 14544 function _defineProperties(target, props) { 14545 for (var i = 0; i < props.length; i++) { 14546 var descriptor = props[i]; 14547 descriptor.enumerable = descriptor.enumerable || false; 14548 descriptor.configurable = true; 14549 if ("value" in descriptor) descriptor.writable = true; 14550 Object.defineProperty(target, descriptor.key, descriptor); 14551 } 14552 } 14553 14554 function _createClass(Constructor, protoProps, staticProps) { 14555 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 14556 if (staticProps) _defineProperties(Constructor, staticProps); 14557 return Constructor; 14558 } 14559 14560 function _defineProperty(obj, key, value) { 14561 if (key in obj) { 14562 Object.defineProperty(obj, key, { 14563 value: value, 14564 enumerable: true, 14565 configurable: true, 14566 writable: true 14567 }); 14568 } else { 14569 obj[key] = value; 14570 } 14571 14572 return obj;
14573 } 14574 14575 function ownKeys(object, enumerableOnly) { 14576 var keys = Object.keys(object); 14577 14578 if (Object.getOwnPropertySymbols) { 14579 var symbols = Object.getOwnPropertySymbols(object); 14580 if (enumerableOnly) symbols = symbols.filter(function (sym) { 14581 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14582 }); 14583 keys.push.apply(keys, symbols); 14584 } 14585 14586 return keys; 14587 } 14588 14589 function _objectSpread2(target) { 14590 for (var i = 1; i < arguments.length; i++) { 14591 var source = arguments[i] != null ? arguments[i] : {}; 14592 14593 if (i % 2) { 14594 ownKeys(Object(source), true).forEach(function (key) { 14595 _defineProperty(target, key, source[key]); 14596 }); 14597 } else if (Object.getOwnPropertyDescriptors) { 14598 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 14599 } else { 14600 ownKeys(Object(source)).forEach(function (key) { 14601 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14602 }); 14603 } 14604 } 14605 14606 return target; 14607 } 14608 14609 /** 14610 * ------------------------------------------------------------------------ 14611 * Constants 14612 * ------------------------------------------------------------------------ 14613 */ 14614 14615 var NAME = 'collapse'; 14616 var VERSION = '4.4.1'; 14617 var DATA_KEY = 'bs.collapse'; 14618 var EVENT_KEY = "." + DATA_KEY; 14619 var DATA_API_KEY = '.data-api'; 14620 var JQUERY_NO_CONFLICT = $.fn[NAME]; 14621 var Default = { 14622 toggle: true, 14623 parent: '' 14624 }; 14625 var DefaultType = { 14626 toggle: 'boolean', 14627 parent: '(string|element)' 14628 }; 14629 var Event = { 14630 SHOW: "show" + EVENT_KEY, 14631 SHOWN: "shown" + EVENT_KEY, 14632 HIDE: "hide" + EVENT_KEY, 14633 HIDDEN: "hidden" + EVENT_KEY, 14634 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 14635 }; 14636 var ClassName = { 14637 SHOW: 'show', 14638 COLLAPSE: 'collapse', 14639 COLLAPSING: 'collapsing', 14640 COLLAPSED: 'collapsed' 14641 }; 14642 var Dimension = { 14643 WIDTH: 'width', 14644 HEIGHT: 'height' 14645 }; 14646 var Selector = { 14647 ACTIVES: '.show, .collapsing', 14648 DATA_TOGGLE: '[data-toggle="collapse"]' 14649 }; 14650 /** 14651 * ------------------------------------------------------------------------ 14652 * Class Definition 14653 * ------------------------------------------------------------------------ 14654 */ 14655 14656 var Collapse = 14657 /*#__PURE__*/ 14658 function () { 14659 function Collapse(element, config) { 14660 this._isTransitioning = false; 14661 this._element = element; 14662 this._config = this._getConfig(config); 14663 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 14664 var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); 14665 14666 for (var i = 0, len = toggleList.length; i < len; i++) { 14667 var elem = toggleList[i]; 14668 var selector = Util.getSelectorFromElement(elem); 14669 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 14670 return foundElem === element; 14671 }); 14672 14673 if (selector !== null && filterElement.length > 0) { 14674 this._selector = selector; 14675 14676 this._triggerArray.push(elem); 14677 } 14678 } 14679 14680 this._parent = this._config.parent ? this._getParent() : null; 14681 14682 if (!this._config.parent) { 14683 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 14684 } 14685 14686 if (this._config.toggle) { 14687 this.toggle(); 14688 } 14689 } // Getters 14690 14691 14692 var _proto = Collapse.prototype; 14693 14694 // Public 14695 _proto.toggle = function toggle() { 14696 if ($(this._element).hasClass(ClassName.SHOW)) { 14697 this.hide(); 14698 } else { 14699 this.show(); 14700 } 14701 }; 14702 14703 _proto.show = function show() { 14704 var _this = this; 14705 14706 if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) { 14707 return; 14708 } 14709 14710 var actives; 14711 var activesData; 14712 14713 if (this._parent) { 14714 actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) { 14715 if (typeof _this._config.parent === 'string') { 14716 return elem.getAttribute('data-parent') === _this._config.parent; 14717 } 14718 14719 return elem.classList.contains(ClassName.COLLAPSE); 14720 }); 14721 14722 if (actives.length === 0) { 14723 actives = null; 14724 } 14725 } 14726 14727 if (actives) { 14728 activesData = $(actives).not(this._selector).data(DATA_KEY); 14729 14730 if (activesData && activesData._isTransitioning) { 14731 return; 14732 } 14733 } 14734 14735 var startEvent = $.Event(Event.SHOW); 14736 $(this._element).trigger(startEvent); 14737 14738 if (startEvent.isDefaultPrevented()) { 14739 return; 14740 } 14741 14742 if (actives) { 14743 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 14744 14745 if (!activesData) { 14746 $(actives).data(DATA_KEY, null); 14747 } 14748 } 14749 14750 var dimension = this._getDimension(); 14751 14752 $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); 14753 this._element.style[dimension] = 0; 14754 14755 if (this._triggerArray.length) { 14756 $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); 14757 } 14758 14759 this.setTransitioning(true); 14760 14761 var complete = function complete() { 14762 $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW); 14763 _this._element.style[dimension] = ''; 14764 14765 _this.setTransitioning(false); 14766 14767 $(_this._element).trigger(Event.SHOWN); 14768 }; 14769 14770 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 14771 var scrollSize = "scroll" + capitalizedDimension; 14772 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 14773 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 14774 this._element.style[dimension] = this._element[scrollSize] + "px"; 14775 }; 14776 14777 _proto.hide = function hide() { 14778 var _this2 = this; 14779 14780 if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) { 14781 return; 14782 } 14783 14784 var startEvent = $.Event(Event.HIDE); 14785 $(this._element).trigger(startEvent); 14786 14787 if (startEvent.isDefaultPrevented()) { 14788 return; 14789 } 14790 14791 var dimension = this._getDimension(); 14792 14793 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 14794 Util.reflow(this._element); 14795 $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); 14796 var triggerArrayLength = this._triggerArray.length; 14797 14798 if (triggerArrayLength > 0) { 14799 for (var i = 0; i < triggerArrayLength; i++) { 14800 var trigger = this._triggerArray[i]; 14801 var selector = Util.getSelectorFromElement(trigger); 14802 14803 if (selector !== null) { 14804 var $elem = $([].slice.call(document.querySelectorAll(selector))); 14805 14806 if (!$elem.hasClass(ClassName.SHOW)) { 14807 $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); 14808 } 14809 } 14810 } 14811 } 14812 14813 this.setTransitioning(true); 14814 14815 var complete = function complete() { 14816 _this2.setTransitioning(false); 14817 14818 $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); 14819 }; 14820 14821 this._element.style[dimension] = ''; 14822 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 14823 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 14824 }; 14825 14826 _proto.setTransitioning = function setTransitioning(isTransitioning) { 14827 this._isTransitioning = isTransitioning; 14828 }; 14829 14830 _proto.dispose = function dispose() { 14831 $.removeData(this._element, DATA_KEY); 14832 this._config = null; 14833 this._parent = null; 14834 this._element = null; 14835 this._triggerArray = null; 14836 this._isTransitioning = null; 14837 } // Private 14838 ; 14839 14840 _proto._getConfig = function _getConfig(config) {
14841 config = _objectSpread2({}, Default, {}, config); 14842 config.toggle = Boolean(config.toggle); // Coerce string values 14843 14844 Util.typeCheckConfig(NAME, config, DefaultType); 14845 return config; 14846 }; 14847 14848 _proto._getDimension = function _getDimension() { 14849 var hasWidth = $(this._element).hasClass(Dimension.WIDTH); 14850 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 14851 }; 14852 14853 _proto._getParent = function _getParent() { 14854 var _this3 = this; 14855 14856 var parent; 14857 14858 if (Util.isElement(this._config.parent)) { 14859 parent = this._config.parent; // It's a jQuery object 14860 14861 if (typeof this._config.parent.jquery !== 'undefined') { 14862 parent = this._config.parent[0]; 14863 } 14864 } else { 14865 parent = document.querySelector(this._config.parent); 14866 } 14867 14868 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 14869 var children = [].slice.call(parent.querySelectorAll(selector)); 14870 $(children).each(function (i, element) { 14871 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 14872 }); 14873 return parent; 14874 }; 14875 14876 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 14877 var isOpen = $(element).hasClass(ClassName.SHOW); 14878 14879 if (triggerArray.length) { 14880 $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 14881 } 14882 } // Static 14883 ; 14884 14885 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 14886 var selector = Util.getSelectorFromElement(element); 14887 return selector ? document.querySelector(selector) : null; 14888 }; 14889 14890 Collapse._jQueryInterface = function _jQueryInterface(config) { 14891 return this.each(function () { 14892 var $this = $(this); 14893 var data = $this.data(DATA_KEY); 14894 14895 var _config = _objectSpread2({}, Default, {}, $this.data(), {}, typeof config === 'object' && config ? config : {}); 14896 14897 if (!data && _config.toggle && /show|hide/.test(config)) { 14898 _config.toggle = false; 14899 } 14900 14901 if (!data) { 14902 data = new Collapse(this, _config); 14903 $this.data(DATA_KEY, data); 14904 } 14905 14906 if (typeof config === 'string') { 14907 if (typeof data[config] === 'undefined') { 14908 throw new TypeError("No method named \"" + config + "\""); 14909 } 14910 14911 data[config](); 14912 } 14913 }); 14914 }; 14915 14916 _createClass(Collapse, null, [{ 14917 key: "VERSION", 14918 get: function get() { 14919 return VERSION; 14920 } 14921 }, { 14922 key: "Default", 14923 get: function get() { 14924 return Default; 14925 } 14926 }]); 14927 14928 return Collapse; 14929 }(); 14930 /** 14931 * ------------------------------------------------------------------------ 14932 * Data Api implementation 14933 * ------------------------------------------------------------------------ 14934 */ 14935 14936 14937 $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 14938 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 14939 if (event.currentTarget.tagName === 'A') { 14940 event.preventDefault(); 14941 } 14942 14943 var $trigger = $(this); 14944 var selector = Util.getSelectorFromElement(this); 14945 var selectors = [].slice.call(document.querySelectorAll(selector)); 14946 $(selectors).each(function () { 14947 var $target = $(this); 14948 var data = $target.data(DATA_KEY); 14949 var config = data ? 'toggle' : $trigger.data(); 14950 14951 Collapse._jQueryInterface.call($target, config); 14952 }); 14953 }); 14954 /** 14955 * ------------------------------------------------------------------------ 14956 * jQuery 14957 * ------------------------------------------------------------------------ 14958 */ 14959 14960 $.fn[NAME] = Collapse._jQueryInterface; 14961 $.fn[NAME].Constructor = Collapse; 14962 14963 $.fn[NAME].noConflict = function () { 14964 $.fn[NAME] = JQUERY_NO_CONFLICT; 14965 return Collapse._jQueryInterface; 14966 }; 14967 14968 return Collapse; 14969 14970}))); 14971//# sourceMappingURL=collapse.js.map 14972/*! 14973 * Bootstrap dropdown.js v4.4.1 (https://getbootstrap.com/) 14974 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14975 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 14976 */ 14977(function (global, factory) { 14978 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : 14979 typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : 14980 (global = global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util)); 14981}(this, (function ($, Popper, Util) { 'use strict'; 14982 14983 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 14984 Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 14985 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 14986 14987 function _defineProperties(target, props) { 14988 for (var i = 0; i < props.length; i++) { 14989 var descriptor = props[i]; 14990 descriptor.enumerable = descriptor.enumerable || false; 14991 descriptor.configurable = true; 14992 if ("value" in descriptor) descriptor.writable = true; 14993 Object.defineProperty(target, descriptor.key, descriptor); 14994 } 14995 } 14996 14997 function _createClass(Constructor, protoProps, staticProps) { 14998 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 14999 if (staticProps) _defineProperties(Constructor, staticProps); 15000 return Constructor; 15001 } 15002 15003 function _defineProperty(obj, key, value) { 15004 if (key in obj) { 15005 Object.defineProperty(obj, key, { 15006 value: value, 15007 enumerable: true, 15008 configurable: true, 15009 writable: true 15010 }); 15011 } else { 15012 obj[key] = value; 15013 } 15014 15015 return obj;
15016 } 15017 15018 function ownKeys(object, enumerableOnly) { 15019 var keys = Object.keys(object); 15020 15021 if (Object.getOwnPropertySymbols) { 15022 var symbols = Object.getOwnPropertySymbols(object); 15023 if (enumerableOnly) symbols = symbols.filter(function (sym) { 15024 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15025 }); 15026 keys.push.apply(keys, symbols); 15027 } 15028 15029 return keys; 15030 } 15031 15032 function _objectSpread2(target) { 15033 for (var i = 1; i < arguments.length; i++) { 15034 var source = arguments[i] != null ? arguments[i] : {}; 15035 15036 if (i % 2) { 15037 ownKeys(Object(source), true).forEach(function (key) { 15038 _defineProperty(target, key, source[key]); 15039 }); 15040 } else if (Object.getOwnPropertyDescriptors) { 15041 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 15042 } else { 15043 ownKeys(Object(source)).forEach(function (key) { 15044 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15045 }); 15046 } 15047 } 15048 15049 return target; 15050 } 15051 15052 /** 15053 * ------------------------------------------------------------------------ 15054 * Constants 15055 * ------------------------------------------------------------------------ 15056 */ 15057 15058 var NAME = 'dropdown'; 15059 var VERSION = '4.4.1'; 15060 var DATA_KEY = 'bs.dropdown'; 15061 var EVENT_KEY = "." + DATA_KEY; 15062 var DATA_API_KEY = '.data-api'; 15063 var JQUERY_NO_CONFLICT = $.fn[NAME]; 15064 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 15065 15066 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 15067 15068 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 15069 15070 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 15071 15072 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 15073 15074 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 15075 15076 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 15077 var Event = { 15078 HIDE: "hide" + EVENT_KEY, 15079 HIDDEN: "hidden" + EVENT_KEY, 15080 SHOW: "show" + EVENT_KEY, 15081 SHOWN: "shown" + EVENT_KEY, 15082 CLICK: "click" + EVENT_KEY, 15083 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY, 15084 KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY, 15085 KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY 15086 }; 15087 var ClassName = { 15088 DISABLED: 'disabled', 15089 SHOW: 'show', 15090 DROPUP: 'dropup', 15091 DROPRIGHT: 'dropright', 15092 DROPLEFT: 'dropleft', 15093 MENURIGHT: 'dropdown-menu-right', 15094 MENULEFT: 'dropdown-menu-left', 15095 POSITION_STATIC: 'position-static' 15096 }; 15097 var Selector = { 15098 DATA_TOGGLE: '[data-toggle="dropdown"]', 15099 FORM_CHILD: '.dropdown form', 15100 MENU: '.dropdown-menu', 15101 NAVBAR_NAV: '.navbar-nav', 15102 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 15103 }; 15104 var AttachmentMap = { 15105 TOP: 'top-start', 15106 TOPEND: 'top-end', 15107 BOTTOM: 'bottom-start', 15108 BOTTOMEND: 'bottom-end', 15109 RIGHT: 'right-start', 15110 RIGHTEND: 'right-end', 15111 LEFT: 'left-start', 15112 LEFTEND: 'left-end' 15113 }; 15114 var Default = { 15115 offset: 0, 15116 flip: true, 15117 boundary: 'scrollParent', 15118 reference: 'toggle', 15119 display: 'dynamic', 15120 popperConfig: null 15121 }; 15122 var DefaultType = { 15123 offset: '(number|string|function)', 15124 flip: 'boolean', 15125 boundary: '(string|element)', 15126 reference: '(string|element)', 15127 display: 'string', 15128 popperConfig: '(null|object)' 15129 }; 15130 /** 15131 * ------------------------------------------------------------------------ 15132 * Class Definition 15133 * ------------------------------------------------------------------------ 15134 */ 15135 15136 var Dropdown = 15137 /*#__PURE__*/ 15138 function () { 15139 function Dropdown(element, config) { 15140 this._element = element; 15141 this._popper = null; 15142 this._config = this._getConfig(config); 15143 this._menu = this._getMenuElement(); 15144 this._inNavbar = this._detectNavbar(); 15145 15146 this._addEventListeners(); 15147 } // Getters 15148 15149 15150 var _proto = Dropdown.prototype; 15151 15152 // Public
15153 _proto.toggle = function toggle() { 15154 if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { 15155 return; 15156 } 15157 15158 var isActive = $(this._menu).hasClass(ClassName.SHOW); 15159 15160 Dropdown._clearMenus(); 15161 15162 if (isActive) { 15163 return; 15164 } 15165 15166 this.show(true); 15167 }; 15168 15169 _proto.show = function show(usePopper) { 15170 if (usePopper === void 0) { 15171 usePopper = false; 15172 } 15173 15174 if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) { 15175 return; 15176 } 15177 15178 var relatedTarget = { 15179 relatedTarget: this._element 15180 }; 15181 var showEvent = $.Event(Event.SHOW, relatedTarget); 15182 15183 var parent = Dropdown._getParentFromElement(this._element); 15184 15185 $(parent).trigger(showEvent); 15186 15187 if (showEvent.isDefaultPrevented()) { 15188 return; 15189 } // Disable totally Popper.js for Dropdown in Navbar 15190 15191 15192 if (!this._inNavbar && usePopper) { 15193 /** 15194 * Check for Popper dependency 15195 * Popper - https://popper.js.org 15196 */ 15197 if (typeof Popper === 'undefined') { 15198 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 15199 } 15200 15201 var referenceElement = this._element; 15202 15203 if (this._config.reference === 'parent') { 15204 referenceElement = parent; 15205 } else if (Util.isElement(this._config.reference)) { 15206 referenceElement = this._config.reference; // Check if it's jQuery element 15207 15208 if (typeof this._config.reference.jquery !== 'undefined') { 15209 referenceElement = this._config.reference[0]; 15210 } 15211 } // If boundary is not `scrollParent`, then set position to `static` 15212 // to allow the menu to "escape" the scroll parent's boundaries 15213 // https://github.com/twbs/bootstrap/issues/24251 15214 15215 15216 if (this._config.boundary !== 'scrollParent') { 15217 $(parent).addClass(ClassName.POSITION_STATIC); 15218 } 15219 15220 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 15221 } // If this is a touch-enabled device we add extra 15222 // empty mouseover listeners to the body's immediate children; 15223 // only needed because of broken event delegation on iOS 15224 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 15225 15226 15227 if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) { 15228 $(document.body).children().on('mouseover', null, $.noop); 15229 } 15230 15231 this._element.focus(); 15232 15233 this._element.setAttribute('aria-expanded', true); 15234 15235 $(this._menu).toggleClass(ClassName.SHOW); 15236 $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); 15237 }; 15238 15239 _proto.hide = function hide() { 15240 if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) { 15241 return; 15242 } 15243 15244 var relatedTarget = { 15245 relatedTarget: this._element 15246 }; 15247 var hideEvent = $.Event(Event.HIDE, relatedTarget); 15248 15249 var parent = Dropdown._getParentFromElement(this._element); 15250 15251 $(parent).trigger(hideEvent); 15252 15253 if (hideEvent.isDefaultPrevented()) { 15254 return; 15255 } 15256 15257 if (this._popper) { 15258 this._popper.destroy(); 15259 } 15260 15261 $(this._menu).toggleClass(ClassName.SHOW); 15262 $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); 15263 }; 15264 15265 _proto.dispose = function dispose() { 15266 $.removeData(this._element, DATA_KEY); 15267 $(this._element).off(EVENT_KEY); 15268 this._element = null; 15269 this._menu = null; 15270 15271 if (this._popper !== null) { 15272 this._popper.destroy(); 15273 15274 this._popper = null; 15275 } 15276 }; 15277 15278 _proto.update = function update() { 15279 this._inNavbar = this._detectNavbar(); 15280 15281 if (this._popper !== null) { 15282 this._popper.scheduleUpdate(); 15283 } 15284 } // Private 15285 ; 15286 15287 _proto._addEventListeners = function _addEventListeners() { 15288 var _this = this; 15289 15290 $(this._element).on(Event.CLICK, function (event) { 15291 event.preventDefault(); 15292 event.stopPropagation(); 15293 15294 _this.toggle(); 15295 }); 15296 }; 15297 15298 _proto._getConfig = function _getConfig(config) {
15299 config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config); 15300 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 15301 return config; 15302 }; 15303 15304 _proto._getMenuElement = function _getMenuElement() { 15305 if (!this._menu) { 15306 var parent = Dropdown._getParentFromElement(this._element); 15307 15308 if (parent) { 15309 this._menu = parent.querySelector(Selector.MENU); 15310 } 15311 } 15312 15313 return this._menu; 15314 }; 15315 15316 _proto._getPlacement = function _getPlacement() { 15317 var $parentDropdown = $(this._element.parentNode); 15318 var placement = AttachmentMap.BOTTOM; // Handle dropup 15319 15320 if ($parentDropdown.hasClass(ClassName.DROPUP)) { 15321 placement = AttachmentMap.TOP; 15322 15323 if ($(this._menu).hasClass(ClassName.MENURIGHT)) { 15324 placement = AttachmentMap.TOPEND; 15325 } 15326 } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) { 15327 placement = AttachmentMap.RIGHT; 15328 } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) { 15329 placement = AttachmentMap.LEFT; 15330 } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { 15331 placement = AttachmentMap.BOTTOMEND; 15332 } 15333 15334 return placement; 15335 }; 15336 15337 _proto._detectNavbar = function _detectNavbar() { 15338 return $(this._element).closest('.navbar').length > 0; 15339 }; 15340 15341 _proto._getOffset = function _getOffset() { 15342 var _this2 = this; 15343 15344 var offset = {}; 15345 15346 if (typeof this._config.offset === 'function') { 15347 offset.fn = function (data) { 15348 data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {}); 15349 return data; 15350 }; 15351 } else { 15352 offset.offset = this._config.offset; 15353 } 15354 15355 return offset; 15356 }; 15357 15358 _proto._getPopperConfig = function _getPopperConfig() { 15359 var popperConfig = { 15360 placement: this._getPlacement(), 15361 modifiers: { 15362 offset: this._getOffset(), 15363 flip: { 15364 enabled: this._config.flip 15365 }, 15366 preventOverflow: { 15367 boundariesElement: this._config.boundary 15368 } 15369 } 15370 }; // Disable Popper.js if we have a static display 15371 15372 if (this._config.display === 'static') { 15373 popperConfig.modifiers.applyStyle = { 15374 enabled: false 15375 }; 15376 } 15377 15378 return _objectSpread2({}, popperConfig, {}, this._config.popperConfig); 15379 } // Static 15380 ; 15381 15382 Dropdown._jQueryInterface = function _jQueryInterface(config) { 15383 return this.each(function () { 15384 var data = $(this).data(DATA_KEY); 15385 15386 var _config = typeof config === 'object' ? config : null; 15387 15388 if (!data) { 15389 data = new Dropdown(this, _config); 15390 $(this).data(DATA_KEY, data); 15391 } 15392 15393 if (typeof config === 'string') { 15394 if (typeof data[config] === 'undefined') { 15395 throw new TypeError("No method named \"" + config + "\""); 15396 } 15397 15398 data[config](); 15399 } 15400 }); 15401 }; 15402 15403 Dropdown._clearMenus = function _clearMenus(event) { 15404 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 15405 return; 15406 } 15407 15408 var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); 15409 15410 for (var i = 0, len = toggles.length; i < len; i++) { 15411 var parent = Dropdown._getParentFromElement(toggles[i]); 15412 15413 var context = $(toggles[i]).data(DATA_KEY); 15414 var relatedTarget = { 15415 relatedTarget: toggles[i] 15416 }; 15417 15418 if (event && event.type === 'click') { 15419 relatedTarget.clickEvent = event; 15420 } 15421 15422 if (!context) { 15423 continue; 15424 } 15425 15426 var dropdownMenu = context._menu; 15427 15428 if (!$(parent).hasClass(ClassName.SHOW)) { 15429 continue; 15430 } 15431 15432 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 15433 continue; 15434 } 15435 15436 var hideEvent = $.Event(Event.HIDE, relatedTarget); 15437 $(parent).trigger(hideEvent); 15438 15439 if (hideEvent.isDefaultPrevented()) { 15440 continue; 15441 } // If this is a touch-enabled device we remove the extra 15442 // empty mouseover listeners we added for iOS support 15443 15444 15445 if ('ontouchstart' in document.documentElement) { 15446 $(document.body).children().off('mouseover', null, $.noop); 15447 } 15448 15449 toggles[i].setAttribute('aria-expanded', 'false'); 15450 15451 if (context._popper) { 15452 context._popper.destroy(); 15453 } 15454 15455 $(dropdownMenu).removeClass(ClassName.SHOW); 15456 $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); 15457 } 15458 }; 15459 15460 Dropdown._getParentFromElement = function _getParentFromElement(element) { 15461 var parent; 15462 var selector = Util.getSelectorFromElement(element); 15463 15464 if (selector) { 15465 parent = document.querySelector(selector); 15466 } 15467 15468 return parent || element.parentNode; 15469 } // eslint-disable-next-line complexity 15470 ; 15471 15472 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 15473 // If not input/textarea: 15474 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 15475 // If input/textarea: 15476 // - If space key => not a dropdown command 15477 // - If key is other than escape 15478 // - If key is not up or down => not a dropdown command 15479 // - If trigger inside the menu =>
15479 not a dropdown command 15480 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 15481 return; 15482 } 15483 15484 event.preventDefault(); 15485 event.stopPropagation(); 15486 15487 if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { 15488 return; 15489 } 15490 15491 var parent = Dropdown._getParentFromElement(this); 15492 15493 var isActive = $(parent).hasClass(ClassName.SHOW); 15494 15495 if (!isActive && event.which === ESCAPE_KEYCODE) { 15496 return; 15497 } 15498 15499 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 15500 if (event.which === ESCAPE_KEYCODE) { 15501 var toggle = parent.querySelector(Selector.DATA_TOGGLE); 15502 $(toggle).trigger('focus'); 15503 } 15504 15505 $(this).trigger('click'); 15506 return; 15507 } 15508 15509 var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)).filter(function (item) { 15510 return $(item).is(':visible'); 15511 }); 15512 15513 if (items.length === 0) { 15514 return; 15515 } 15516 15517 var index = items.indexOf(event.target); 15518 15519 if (event.which === ARROW_UP_KEYCODE && index > 0) { 15520 // Up 15521 index--; 15522 } 15523 15524 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 15525 // Down 15526 index++; 15527 } 15528 15529 if (index < 0) { 15530 index = 0; 15531 } 15532 15533 items[index].focus(); 15534 }; 15535 15536 _createClass(Dropdown, null, [{ 15537 key: "VERSION", 15538 get: function get() { 15539 return VERSION; 15540 } 15541 }, { 15542 key: "Default", 15543 get: function get() { 15544 return Default; 15545 } 15546 }, { 15547 key: "DefaultType", 15548 get: function get() { 15549 return DefaultType; 15550 } 15551 }]); 15552 15553 return Dropdown; 15554 }(); 15555 /** 15556 * ------------------------------------------------------------------------ 15557 * Data Api implementation 15558 * ------------------------------------------------------------------------ 15559 */ 15560 15561 15562 $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 15563 event.preventDefault(); 15564 event.stopPropagation(); 15565 15566 Dropdown._jQueryInterface.call($(this), 'toggle'); 15567 }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { 15568 e.stopPropagation(); 15569 }); 15570 /** 15571 * ------------------------------------------------------------------------ 15572 * jQuery 15573 * ------------------------------------------------------------------------ 15574 */ 15575 15576 $.fn[NAME] = Dropdown._jQueryInterface; 15577 $.fn[NAME].Constructor = Dropdown; 15578 15579 $.fn[NAME].noConflict = function () { 15580 $.fn[NAME] = JQUERY_NO_CONFLICT; 15581 return Dropdown._jQueryInterface; 15582 }; 15583 15584 return Dropdown; 15585 15586}))); 15587//# sourceMappingURL=dropdown.js.map 15588/*! 15589 * Bootstrap modal.js v4.4.1 (https://getbootstrap.com/) 15590 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 15591 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 15592 */ 15593(function (global, factory) { 15594 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 15595 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 15596 (global = global || self, global.Modal = factory(global.jQuery, global.Util)); 15597}(this, (function ($, Util) { 'use strict'; 15598 15599 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 15600 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 15601 15602 function _defineProperties(target, props) { 15603 for (var i = 0; i < props.length; i++) { 15604 var descriptor = props[i]; 15605 descriptor.enumerable = descriptor.enumerable || false; 15606 descriptor.configurable = true; 15607 if ("value" in descriptor) descriptor.writable = true; 15608 Object.defineProperty(target, descriptor.key, descriptor); 15609 } 15610 } 15611 15612 function _createClass(Constructor, protoProps, staticProps) { 15613 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 15614 if (staticProps) _defineProperties(Constructor, staticProps); 15615 return Constructor; 15616 } 15617 15618 function _defineProperty(obj, key, value) { 15619 if (key in obj) { 15620 Object.defineProperty(obj, key, { 15621 value: value, 15622 enumerable: true, 15623 configurable: true, 15624 writable: true 15625 }); 15626 } else { 15627 obj[key] = value; 15628 } 15629 15630 return obj;
15631 } 15632 15633 function ownKeys(object, enumerableOnly) { 15634 var keys = Object.keys(object); 15635 15636 if (Object.getOwnPropertySymbols) { 15637 var symbols = Object.getOwnPropertySymbols(object); 15638 if (enumerableOnly) symbols = symbols.filter(function (sym) { 15639 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15640 }); 15641 keys.push.apply(keys, symbols); 15642 } 15643 15644 return keys; 15645 } 15646 15647 function _objectSpread2(target) { 15648 for (var i = 1; i < arguments.length; i++) { 15649 var source = arguments[i] != null ? arguments[i] : {}; 15650 15651 if (i % 2) { 15652 ownKeys(Object(source), true).forEach(function (key) { 15653 _defineProperty(target, key, source[key]); 15654 }); 15655 } else if (Object.getOwnPropertyDescriptors) { 15656 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 15657 } else { 15658 ownKeys(Object(source)).forEach(function (key) { 15659 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15660 }); 15661 } 15662 } 15663 15664 return target; 15665 } 15666 15667 /** 15668 * ------------------------------------------------------------------------ 15669 * Constants 15670 * ------------------------------------------------------------------------ 15671 */ 15672 15673 var NAME = 'modal'; 15674 var VERSION = '4.4.1'; 15675 var DATA_KEY = 'bs.modal'; 15676 var EVENT_KEY = "." + DATA_KEY; 15677 var DATA_API_KEY = '.data-api'; 15678 var JQUERY_NO_CONFLICT = $.fn[NAME]; 15679 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 15680 15681 var Default = { 15682 backdrop: true, 15683 keyboard: true, 15684 focus: true, 15685 show: true 15686 }; 15687 var DefaultType = { 15688 backdrop: '(boolean|string)', 15689 keyboard: 'boolean', 15690 focus: 'boolean', 15691 show: 'boolean' 15692 }; 15693 var Event = { 15694 HIDE: "hide" + EVENT_KEY, 15695 HIDE_PREVENTED: "hidePrevented" + EVENT_KEY, 15696 HIDDEN: "hidden" + EVENT_KEY, 15697 SHOW: "show" + EVENT_KEY, 15698 SHOWN: "shown" + EVENT_KEY, 15699 FOCUSIN: "focusin" + EVENT_KEY, 15700 RESIZE: "resize" + EVENT_KEY, 15701 CLICK_DISMISS: "click.dismiss" + EVENT_KEY, 15702 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY, 15703 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY, 15704 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY, 15705 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 15706 }; 15707 var ClassName = { 15708 SCROLLABLE: 'modal-dialog-scrollable', 15709 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 15710 BACKDROP: 'modal-backdrop', 15711 OPEN: 'modal-open', 15712 FADE: 'fade', 15713 SHOW: 'show', 15714 STATIC: 'modal-static' 15715 }; 15716 var Selector = { 15717 DIALOG: '.modal-dialog', 15718 MODAL_BODY: '.modal-body', 15719 DATA_TOGGLE: '[data-toggle="modal"]', 15720 DATA_DISMISS: '[data-dismiss="modal"]', 15721 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 15722 STICKY_CONTENT: '.sticky-top' 15723 }; 15724 /** 15725 * ------------------------------------------------------------------------ 15726 * Class Definition 15727 * ------------------------------------------------------------------------ 15728 */ 15729 15730 var Modal = 15731 /*#__PURE__*/ 15732 function () { 15733 function Modal(element, config) { 15734 this._config = this._getConfig(config); 15735 this._element = element; 15736 this._dialog = element.querySelector(Selector.DIALOG); 15737 this._backdrop = null; 15738 this._isShown = false; 15739 this._isBodyOverflowing = false; 15740 this._ignoreBackdropClick = false; 15741 this._isTransitioning = false; 15742 this._scrollbarWidth = 0; 15743 } // Getters 15744 15745 15746 var _proto = Modal.prototype; 15747 15748 // Public 15749 _proto.toggle = function toggle(relatedTarget) { 15750 return this._isShown ? this.hide() : this.show(relatedTarget); 15751 }; 15752 15753 _proto.show = function show(relatedTarget) { 15754 var _this = this; 15755 15756 if (this._isShown || this._isTransitioning) { 15757 return; 15758 } 15759 15760 if ($(this._element).hasClass(ClassName.FADE)) { 15761 this._isTransitioning = true; 15762 } 15763 15764 var showEvent = $.Event(Event.SHOW, { 15765 relatedTarget: relatedTarget 15766 }); 15767 $(this._element).trigger(showEvent); 15768 15769 if (this._isShown || showEvent.isDefaultPrevented()) { 15770 return; 15771 } 15772 15773 this._isShown = true; 15774 15775 this._checkScrollbar(); 15776 15777 this._setScrollbar(); 15778 15779 this._adjustDialog(); 15780 15781 this._setEscapeEvent(); 15782 15783 this._setResizeEvent(); 15784 15785 $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { 15786 return _this.hide(event); 15787 }); 15788 $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { 15789 $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { 15790 if ($(event.target).is(_this._element)) { 15791 _this._ignoreBackdropClick = true; 15792 } 15793 }); 15794 }); 15795 15796 this._showBackdrop(function () { 15797 return _this._showElement(relatedTarget); 15798 }); 15799 }; 15800 15801 _proto.hide = function hide(event) { 15802 var _this2 = this; 15803 15804 if (event) { 15805 event.preventDefault(); 15806 } 15807 15808 if (!this._isShown || this._isTransitioning) { 15809 return; 15810 } 15811 15812 var hideEvent = $.Event(Event.HIDE); 15813 $(this._element).trigger(hideEvent); 15814 15815 if (!this._isShown || hideEvent.isDefaultPrevented()) { 15816 return; 15817 } 15818 15819 this._isShown = false; 15820 var transition = $(this._element).hasClass(ClassName.FADE); 15821 15822 if (transition) { 15823 this._isTransitioning = true; 15824 } 15825 15826 this._setEscapeEvent(); 15827 15828 this._setResizeEvent(); 15829 15830 $(document).off(Event.FOCUSIN); 15831 $(this._element).removeClass(ClassName.SHOW); 15832 $(this._element).off(Event.CLICK_DISMISS); 15833 $(this._dialog).off(Event.MOUSEDOWN_DISMISS); 15834 15835 if (transition) { 15836 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 15837 $(this._element).one(Util.TRANSITION_END, function (event) { 15838 return _this2._hideModal(event); 15839 }).emulateTransitionEnd(transitionDuration); 15840 } else { 15841 this._hideModal(); 15842 } 15843 }; 15844 15845 _proto.dispose = function dispose() { 15846 [window, this._element, this._dialog].forEach(function (htmlElement) { 15847 return $(htmlElement).off(EVENT_KEY); 15848 }); 15849 /** 15850 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 15851 * Do not move `document` in `htmlElements` array 15852 * It will remove `Event.CLICK_DATA_API` event that should remain 15853 */ 15854 15855 $(document).off(Event.FOCUSIN); 15856 $.removeData(this._element, DATA_KEY); 15857 this._config = null; 15858 this._element = null; 15859 this._dialog = null; 15860 this._backdrop = null; 15861 this._isShown = null; 15862 this._isBodyOverflowing = null; 15863 this._ignoreBackdropClick = null; 15864 this._isTransitioning = null; 15865 this._scrollbarWidth = null; 15866 }; 15867 15868 _proto.handleUpdate = function handleUpdate() { 15869 this._adjustDialog(); 15870 } // Private 15871 ; 15872 15873 _proto._getConfig = function _getConfig(config) {
15874 config = _objectSpread2({}, Default, {}, config); 15875 Util.typeCheckConfig(NAME, config, DefaultType); 15876 return config; 15877 }; 15878 15879 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 15880 var _this3 = this; 15881 15882 if (this._config.backdrop === 'static') { 15883 var hideEventPrevented = $.Event(Event.HIDE_PREVENTED); 15884 $(this._element).trigger(hideEventPrevented); 15885 15886 if (hideEventPrevented.defaultPrevented) { 15887 return; 15888 } 15889 15890 this._element.classList.add(ClassName.STATIC); 15891 15892 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element); 15893 $(this._element).one(Util.TRANSITION_END, function () { 15894 _this3._element.classList.remove(ClassName.STATIC); 15895 }).emulateTransitionEnd(modalTransitionDuration); 15896 15897 this._element.focus(); 15898 } else { 15899 this.hide(); 15900 } 15901 }; 15902 15903 _proto._showElement = function _showElement(relatedTarget) { 15904 var _this4 = this; 15905 15906 var transition = $(this._element).hasClass(ClassName.FADE); 15907 var modalBody = this._dialog ? this._dialog.querySelector(Selector.MODAL_BODY) : null; 15908 15909 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 15910 // Don't move modal's DOM position 15911 document.body.appendChild(this._element); 15912 } 15913 15914 this._element.style.display = 'block'; 15915 15916 this._element.removeAttribute('aria-hidden'); 15917 15918 this._element.setAttribute('aria-modal', true); 15919 15920 if ($(this._dialog).hasClass(ClassName.SCROLLABLE) && modalBody) { 15921 modalBody.scrollTop = 0; 15922 } else { 15923 this._element.scrollTop = 0; 15924 } 15925 15926 if (transition) { 15927 Util.reflow(this._element); 15928 } 15929 15930 $(this._element).addClass(ClassName.SHOW); 15931 15932 if (this._config.focus) { 15933 this._enforceFocus(); 15934 } 15935 15936 var shownEvent = $.Event(Event.SHOWN, { 15937 relatedTarget: relatedTarget 15938 }); 15939 15940 var transitionComplete = function transitionComplete() { 15941 if (_this4._config.focus) { 15942 _this4._element.focus(); 15943 } 15944 15945 _this4._isTransitioning = false; 15946 $(_this4._element).trigger(shownEvent); 15947 }; 15948 15949 if (transition) { 15950 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 15951 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 15952 } else { 15953 transitionComplete(); 15954 } 15955 }; 15956 15957 _proto._enforceFocus = function _enforceFocus() { 15958 var _this5 = this; 15959 15960 $(document).off(Event.FOCUSIN) // Guard against infinite focus loop 15961 .on(Event.FOCUSIN, function (event) { 15962 if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) { 15963 _this5._element.focus(); 15964 } 15965 }); 15966 }; 15967 15968 _proto._setEscapeEvent = function _setEscapeEvent() { 15969 var _this6 = this; 15970 15971 if (this._isShown && this._config.keyboard) { 15972 $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { 15973 if (event.which === ESCAPE_KEYCODE) { 15974 _this6._triggerBackdropTransition(); 15975 } 15976 }); 15977 } else if (!this._isShown) { 15978 $(this._element).off(Event.KEYDOWN_DISMISS); 15979 } 15980 }; 15981 15982 _proto._setResizeEvent = function _setResizeEvent() { 15983 var _this7 = this; 15984 15985 if (this._isShown) { 15986 $(window).on(Event.RESIZE, function (event) { 15987 return _this7.handleUpdate(event); 15988 }); 15989 } else { 15990 $(window).off(Event.RESIZE); 15991 } 15992 }; 15993 15994 _proto._hideModal = function _hideModal() { 15995 var _this8 = this; 15996 15997 this._element.style.display = 'none'; 15998 15999 this._element.setAttribute('aria-hidden', true); 16000 16001 this._element.removeAttribute('aria-modal'); 16002 16003 this._isTransitioning = false; 16004 16005 this._showBackdrop(function () { 16006 $(document.body).removeClass(ClassName.OPEN); 16007 16008 _this8._resetAdjustments(); 16009 16010 _this8._resetScrollbar(); 16011 16012 $(_this8._element).trigger(Event.HIDDEN); 16013 }); 16014 }; 16015 16016 _proto._removeBackdrop = function _removeBackdrop() { 16017 if (this._backdrop) { 16018 $(this._backdrop).remove(); 16019 this._backdrop = null; 16020 } 16021 }; 16022 16023 _proto._showBackdrop = function _showBackdrop(callback) { 16024 var _this9 = this; 16025 16026 var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; 16027 16028 if (this._isShown && this._config.backdrop) { 16029 this._backdrop = document.createElement('div'); 16030 this._backdrop.className = ClassName.BACKDROP; 16031 16032 if (animate) { 16033 this._backdrop.classList.add(animate); 16034 } 16035 16036 $(this._backdrop).appendTo(document.body); 16037 $(this._element).on(Event.CLICK_DISMISS, function (event) { 16038 if (_this9._ignoreBackdropClick) { 16039 _this9._ignoreBackdropClick = false; 16040 return; 16041 } 16042 16043 if (event.target !== event.currentTarget) { 16044 return; 16045 } 16046 16047 _this9._triggerBackdropTransition(); 16048 }); 16049 16050 if (animate) { 16051 Util.reflow(this._backdrop); 16052 } 16053 16054 $(this._backdrop).addClass(ClassName.SHOW); 16055 16056 if (!callback) { 16057 return; 16058 } 16059 16060 if (!animate) { 16061 callback(); 16062 return; 16063 } 16064 16065 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 16066 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 16067 } else if (!this._isShown && this._backdrop) { 16068 $(this._backdrop).removeClass(ClassName.SHOW); 16069 16070 var callbackRemove = function callbackRemove() { 16071 _this9._removeBackdrop(); 16072 16073 if (callback) { 16074 callback(); 16075 } 16076 }; 16077 16078 if ($(this._element).hasClass(ClassName.FADE)) { 16079 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 16080 16081 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 16082 } else { 16083 callbackRemove(); 16084 } 16085 } else if (callback) { 16086 callback(); 16087 } 16088 } // ---------------------------------------------------------------------- 16089 // the following methods are used to handle overflowing modals 16090 // todo (fat): these should probably be refactored out of modal.js 16091 // ---------------------------------------------------------------------- 16092 ; 16093
16094 _proto._adjustDialog = function _adjustDialog() { 16095 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 16096 16097 if (!this._isBodyOverflowing && isModalOverflowing) { 16098 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 16099 } 16100 16101 if (this._isBodyOverflowing && !isModalOverflowing) { 16102 this._element.style.paddingRight = this._scrollbarWidth + "px"; 16103 } 16104 }; 16105 16106 _proto._resetAdjustments = function _resetAdjustments() { 16107 this._element.style.paddingLeft = ''; 16108 this._element.style.paddingRight = ''; 16109 }; 16110 16111 _proto._checkScrollbar = function _checkScrollbar() { 16112 var rect = document.body.getBoundingClientRect(); 16113 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 16114 this._scrollbarWidth = this._getScrollbarWidth(); 16115 }; 16116 16117 _proto._setScrollbar = function _setScrollbar() { 16118 var _this10 = this; 16119 16120 if (this._isBodyOverflowing) { 16121 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 16122 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 16123 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); 16124 var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding 16125 16126 $(fixedContent).each(function (index, element) { 16127 var actualPadding = element.style.paddingRight; 16128 var calculatedPadding = $(element).css('padding-right'); 16129 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 16130 }); // Adjust sticky content margin 16131 16132 $(stickyContent).each(function (index, element) { 16133 var actualMargin = element.style.marginRight; 16134 var calculatedMargin = $(element).css('margin-right'); 16135 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 16136 }); // Adjust body padding 16137 16138 var actualPadding = document.body.style.paddingRight; 16139 var calculatedPadding = $(document.body).css('padding-right'); 16140 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 16141 } 16142 16143 $(document.body).addClass(ClassName.OPEN); 16144 }; 16145 16146 _proto._resetScrollbar = function _resetScrollbar() { 16147 // Restore fixed content padding 16148 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); 16149 $(fixedContent).each(function (index, element) { 16150 var padding = $(element).data('padding-right'); 16151 $(element).removeData('padding-right'); 16152 element.style.paddingRight = padding ? padding : ''; 16153 }); // Restore sticky content 16154 16155 var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT)); 16156 $(elements).each(function (index, element) { 16157 var margin = $(element).data('margin-right'); 16158 16159 if (typeof margin !== 'undefined') { 16160 $(element).css('margin-right', margin).removeData('margin-right'); 16161 } 16162 }); // Restore body padding 16163 16164 var padding = $(document.body).data('padding-right'); 16165 $(document.body).removeData('padding-right'); 16166 document.body.style.paddingRight = padding ? padding : ''; 16167 }; 16168 16169 _proto._getScrollbarWidth = function _getScrollbarWidth() { 16170 // thx d.walsh 16171 var scrollDiv = document.createElement('div'); 16172 scrollDiv.className = ClassName.SCROLLBAR_MEASURER; 16173 document.body.appendChild(scrollDiv); 16174 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 16175 document.body.removeChild(scrollDiv); 16176 return scrollbarWidth; 16177 } // Static 16178 ; 16179 16180 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 16181 return this.each(function () { 16182 var data = $(this).data(DATA_KEY); 16183
16184 var _config = _objectSpread2({}, Default, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {}); 16185 16186 if (!data) { 16187 data = new Modal(this, _config); 16188 $(this).data(DATA_KEY, data); 16189 } 16190 16191 if (typeof config === 'string') { 16192 if (typeof data[config] === 'undefined') { 16193 throw new TypeError("No method named \"" + config + "\""); 16194 } 16195 16196 data[config](relatedTarget); 16197 } else if (_config.show) { 16198 data.show(relatedTarget); 16199 } 16200 }); 16201 }; 16202 16203 _createClass(Modal, null, [{ 16204 key: "VERSION", 16205 get: function get() { 16206 return VERSION; 16207 } 16208 }, { 16209 key: "Default", 16210 get: function get() { 16211 return Default; 16212 } 16213 }]); 16214 16215 return Modal; 16216 }(); 16217 /** 16218 * ------------------------------------------------------------------------ 16219 * Data Api implementation 16220 * ------------------------------------------------------------------------ 16221 */ 16222 16223 16224 $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 16225 var _this11 = this; 16226 16227 var target; 16228 var selector = Util.getSelectorFromElement(this); 16229 16230 if (selector) { 16231 target = document.querySelector(selector); 16232 } 16233 16234 var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data()); 16235 16236 if (this.tagName === 'A' || this.tagName === 'AREA') { 16237 event.preventDefault(); 16238 } 16239 16240 var $target = $(target).one(Event.SHOW, function (showEvent) { 16241 if (showEvent.isDefaultPrevented()) { 16242 // Only register focus restorer if modal will actually get shown 16243 return; 16244 } 16245 16246 $target.one(Event.HIDDEN, function () { 16247 if ($(_this11).is(':visible')) { 16248 _this11.focus(); 16249 } 16250 }); 16251 }); 16252 16253 Modal._jQueryInterface.call($(target), config, this); 16254 }); 16255 /** 16256 * ------------------------------------------------------------------------ 16257 * jQuery 16258 * ------------------------------------------------------------------------ 16259 */ 16260 16261 $.fn[NAME] = Modal._jQueryInterface; 16262 $.fn[NAME].Constructor = Modal; 16263 16264 $.fn[NAME].noConflict = function () { 16265 $.fn[NAME] = JQUERY_NO_CONFLICT; 16266 return Modal._jQueryInterface; 16267 }; 16268 16269 return Modal; 16270 16271}))); 16272//# sourceMappingURL=modal.js.map 16273/*! 16274 * Bootstrap tooltip.js v4.4.1 (https://getbootstrap.com/) 16275 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 16276 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 16277 */ 16278(function (global, factory) { 16279 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : 16280 typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : 16281 (global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util)); 16282}(this, (function ($, Popper, Util) { 'use strict'; 16283 16284 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 16285 Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 16286 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 16287 16288 function _defineProperties(target, props) { 16289 for (var i = 0; i < props.length; i++) { 16290 var descriptor = props[i]; 16291 descriptor.enumerable = descriptor.enumerable || false; 16292 descriptor.configurable = true; 16293 if ("value" in descriptor) descriptor.writable = true; 16294 Object.defineProperty(target, descriptor.key, descriptor); 16295 } 16296 } 16297 16298 function _createClass(Constructor, protoProps, staticProps) { 16299 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 16300 if (staticProps) _defineProperties(Constructor, staticProps); 16301 return Constructor; 16302 } 16303 16304 function _defineProperty(obj, key, value) { 16305 if (key in obj) { 16306 Object.defineProperty(obj, key, { 16307 value: value, 16308 enumerable: true, 16309 configurable: true, 16310 writable: true 16311 }); 16312 } else { 16313 obj[key] = value; 16314 } 16315 16316 return obj;
16317 } 16318 16319 function ownKeys(object, enumerableOnly) { 16320 var keys = Object.keys(object); 16321 16322 if (Object.getOwnPropertySymbols) { 16323 var symbols = Object.getOwnPropertySymbols(object); 16324 if (enumerableOnly) symbols = symbols.filter(function (sym) { 16325 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16326 }); 16327 keys.push.apply(keys, symbols); 16328 } 16329 16330 return keys; 16331 } 16332 16333 function _objectSpread2(target) { 16334 for (var i = 1; i < arguments.length; i++) { 16335 var source = arguments[i] != null ? arguments[i] : {}; 16336 16337 if (i % 2) { 16338 ownKeys(Object(source), true).forEach(function (key) { 16339 _defineProperty(target, key, source[key]); 16340 }); 16341 } else if (Object.getOwnPropertyDescriptors) { 16342 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 16343 } else { 16344 ownKeys(Object(source)).forEach(function (key) { 16345 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16346 }); 16347 } 16348 } 16349 16350 return target; 16351 } 16352 16353 /** 16354 * -------------------------------------------------------------------------- 16355 * Bootstrap (v4.4.1): tools/sanitizer.js 16356 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 16357 * -------------------------------------------------------------------------- 16358 */ 16359 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 16360 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 16361 var DefaultWhitelist = { 16362 // Global attributes allowed on any supplied element below. 16363 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 16364 a: ['target', 'href', 'title', 'rel'], 16365 area: [], 16366 b: [], 16367 br: [], 16368 col: [], 16369 code: [], 16370 div: [], 16371 em: [], 16372 hr: [], 16373 h1: [], 16374 h2: [], 16375 h3: [], 16376 h4: [], 16377 h5: [], 16378 h6: [], 16379 i: [], 16380 img: ['src', 'alt', 'title', 'width', 'height'], 16381 li: [], 16382 ol: [], 16383 p: [], 16384 pre: [], 16385 s: [], 16386 small: [], 16387 span: [], 16388 sub: [], 16389 sup: [], 16390 strong: [], 16391 u: [], 16392 ul: [] 16393 }; 16394 /** 16395 * A pattern that recognizes a commonly useful subset of URLs that are safe. 16396 * 16397 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 16398 */ 16399 16400 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 16401 /** 16402 * A pattern that matches safe data URLs. Only matches image, video and audio types. 16403 * 16404 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 16405 */ 16406 16407 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 16408 16409 function allowedAttribute(attr, allowedAttributeList) { 16410 var attrName = attr.nodeName.toLowerCase(); 16411 16412 if (allowedAttributeList.indexOf(attrName) !== -1) { 16413 if (uriAttrs.indexOf(attrName) !== -1) { 16414 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 16415 } 16416 16417 return true; 16418 } 16419 16420 var regExp = allowedAttributeList.filter(function (attrRegex) { 16421 return attrRegex instanceof RegExp; 16422 }); // Check if a regular expression validates the attribute. 16423 16424 for (var i = 0, l = regExp.length; i < l; i++) { 16425 if (attrName.match(regExp[i])) { 16426 return true; 16427 } 16428 } 16429 16430 return false; 16431 } 16432 16433 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 16434 if (unsafeHtml.length === 0) { 16435 return unsafeHtml; 16436 } 16437 16438 if (sanitizeFn && typeof sanitizeFn === 'function') { 16439 return sanitizeFn(unsafeHtml); 16440 } 16441 16442 var domParser = new window.DOMParser(); 16443 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 16444 var whitelistKeys = Object.keys(whiteList); 16445 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 16446 16447 var _loop = function _loop(i, len) { 16448 var el = elements[i]; 16449 var elName = el.nodeName.toLowerCase(); 16450 16451 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 16452 el.parentNode.removeChild(el); 16453 return "continue"; 16454 } 16455 16456 var attributeList = [].slice.call(el.attributes); 16457 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 16458 attributeList.forEach(function (attr) { 16459 if (!allowedAttribute(attr, whitelistedAttributes)) { 16460 el.removeAttribute(attr.nodeName); 16461 } 16462 }); 16463 }; 16464 16465 for (var i = 0, len = elements.length; i < len; i++) { 16466 var _ret = _loop(i); 16467 16468 if (_ret === "continue") continue; 16469 } 16470 16471 return createdDocument.body.innerHTML; 16472 } 16473 16474 /** 16475 * ------------------------------------------------------------------------ 16476 * Constants 16477 * ------------------------------------------------------------------------ 16478 */ 16479 16480 var NAME = 'tooltip'; 16481 var VERSION = '4.4.1'; 16482 var DATA_KEY = 'bs.tooltip'; 16483 var EVENT_KEY = "." + DATA_KEY; 16484 var JQUERY_NO_CONFLICT = $.fn[NAME]; 16485 var CLASS_PREFIX = 'bs-tooltip'; 16486 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 16487 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 16488 var DefaultType = { 16489 animation: 'boolean', 16490 template: 'string', 16491 title: '(string|element|function)', 16492 trigger: 'string', 16493 delay: '(number|object)', 16494 html: 'boolean', 16495 selector: '(string|boolean)', 16496 placement: '(string|function)', 16497 offset: '(number|string|function)', 16498 container: '(string|element|boolean)', 16499 fallbackPlacement: '(string|array)', 16500 boundary: '(string|element)', 16501 sanitize: 'boolean', 16502 sanitizeFn: '(null|function)', 16503 whiteList: 'object', 16504 popperConfig: '(null|object)' 16505 }; 16506 var AttachmentMap = { 16507 AUTO: 'auto', 16508 TOP: 'top', 16509 RIGHT: 'right', 16510 BOTTOM: 'bottom', 16511 LEFT: 'left' 16512 }; 16513 var Default = { 16514 animation: true, 16515 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 16516 trigger: 'hover focus', 16517 title: '', 16518 delay: 0, 16519 html: false, 16520 selector: false, 16521 placement: 'top', 16522 offset: 0, 16523 container: false, 16524 fallbackPlacement: 'flip', 16525 boundary: 'scrollParent', 16526 sanitize: true, 16527 sanitizeFn: null, 16528 whiteList: DefaultWhitelist, 16529 popperConfig: null 16530 }; 16531 var HoverState = { 16532 SHOW: 'show', 16533 OUT: 'out' 16534 }; 16535 var Event = { 16536 HIDE: "hide" + EVENT_KEY, 16537 HIDDEN: "hidden" + EVENT_KEY, 16538 SHOW: "show" + EVENT_KEY, 16539 SHOWN: "shown" + EVENT_KEY, 16540 INSERTED: "inserted" + EVENT_KEY, 16541 CLICK: "click" + EVENT_KEY, 16542 FOCUSIN: "focusin" + EVENT_KEY, 16543 FOCUSOUT: "focusout" + EVENT_KEY, 16544 MOUSEENTER: "mouseenter" + EVENT_KEY, 16545 MOUSELEAVE: "mouseleave" + EVENT_KEY 16546 }; 16547 var ClassName = { 16548 FADE: 'fade', 16549 SHOW: 'show' 16550 }; 16551 var Selector = { 16552 TOOLTIP: '.tooltip', 16553 TOOLTIP_INNER: '.tooltip-inner', 16554 ARROW: '.arrow' 16555 }; 16556 var Trigger = { 16557 HOVER: 'hover', 16558 FOCUS: 'focus', 16559 CLICK: 'click', 16560 MANUAL: 'manual' 16561 }; 16562 /** 16563 * ------------------------------------------------------------------------ 16564 * Class Definition 16565 * ------------------------------------------------------------------------ 16566 */ 16567 16568 var Tooltip = 16569 /*#__PURE__*/ 16570 function () { 16571 function Tooltip(element, config) { 16572 if (typeof Popper === 'undefined') { 16573 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 16574 } // private 16575 16576 16577 this._isEnabled = true; 16578 this._timeout = 0; 16579 this._hoverState = ''; 16580 this._activeTrigger = {}; 16581 this._popper = null; // Protected 16582 16583 this.element = element; 16584 this.config = this._getConfig(config); 16585 this.tip = null; 16586 16587 this._setListeners(); 16588 } // Getters 16589 16590 16591 var _proto = Tooltip.prototype; 16592 16593 // Public 16594 _proto.enable = function enable() { 16595 this._isEnabled = true; 16596 }; 16597 16598 _proto.disable = function disable() { 16599 this._isEnabled = false; 16600 }; 16601 16602 _proto.toggleEnabled = function toggleEnabled() { 16603 this._isEnabled = !this._isEnabled; 16604 }; 16605 16606 _proto.toggle = function toggle(event) { 16607 if (!this._isEnabled) { 16608 return; 16609 } 16610 16611 if (event) { 16612 var dataKey = this.constructor.DATA_KEY; 16613 var context = $(event.currentTarget).data(dataKey); 16614 16615 if (!context) { 16616 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 16617 $(event.currentTarget).data(dataKey, context); 16618 } 16619 16620 context._activeTrigger.click = !context._activeTrigger.click; 16621 16622 if (context._isWithActiveTrigger()) { 16623 context._enter(null, context); 16624 } else { 16625 context._leave(null, context); 16626 } 16627 } else { 16628 if ($(this.getTipElement()).hasClass(ClassName.SHOW)) { 16629 this._leave(null, this); 16630 16631 return; 16632 } 16633 16634 this._enter(null, this); 16635 } 16636 }; 16637 16638 _proto.dispose = function dispose() { 16639 clearTimeout(this._timeout); 16640 $.removeData(this.element, this.constructor.DATA_KEY); 16641 $(this.element).off(this.constructor.EVENT_KEY); 16642 $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 16643 16644 if (this.tip) { 16645 $(this.tip).remove(); 16646 } 16647 16648 this._isEnabled = null; 16649 this._timeout = null; 16650 this._hoverState = null; 16651 this._activeTrigger = null; 16652 16653 if (this._popper) { 16654 this._popper.destroy(); 16655 } 16656 16657 this._popper = null; 16658 this.element = null; 16659 this.config = null; 16660 this.tip = null; 16661 }; 16662 16663 _proto.show = function show() { 16664 var _this = this; 16665 16666 if ($(this.element).css('display') === 'none') { 16667 throw new Error('Please use show on visible elements'); 16668 } 16669 16670 var showEvent = $.Event(this.constructor.Event.SHOW); 16671 16672 if (this.isWithContent() && this._isEnabled) { 16673 $(this.element).trigger(showEvent); 16674 var shadowRoot = Util.findShadowRoot(this.element); 16675 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 16676 16677 if (showEvent.isDefaultPrevented() || !isInTheDom) { 16678 return; 16679 } 16680 16681 var tip = this.getTipElement(); 16682 var tipId = Util.getUID(this.constructor.NAME);
16683 tip.setAttribute('id', tipId); 16684 this.element.setAttribute('aria-describedby', tipId); 16685 this.setContent(); 16686 16687 if (this.config.animation) { 16688 $(tip).addClass(ClassName.FADE); 16689 } 16690 16691 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 16692 16693 var attachment = this._getAttachment(placement); 16694 16695 this.addAttachmentClass(attachment); 16696 16697 var container = this._getContainer(); 16698 16699 $(tip).data(this.constructor.DATA_KEY, this); 16700 16701 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 16702 $(tip).appendTo(container); 16703 } 16704 16705 $(this.element).trigger(this.constructor.Event.INSERTED); 16706 this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment)); 16707 $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra 16708 // empty mouseover listeners to the body's immediate children; 16709 // only needed because of broken event delegation on iOS 16710 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 16711 16712 if ('ontouchstart' in document.documentElement) { 16713 $(document.body).children().on('mouseover', null, $.noop); 16714 } 16715 16716 var complete = function complete() { 16717 if (_this.config.animation) { 16718 _this._fixTransition(); 16719 } 16720 16721 var prevHoverState = _this._hoverState; 16722 _this._hoverState = null; 16723 $(_this.element).trigger(_this.constructor.Event.SHOWN); 16724 16725 if (prevHoverState === HoverState.OUT) { 16726 _this._leave(null, _this); 16727 } 16728 }; 16729 16730 if ($(this.tip).hasClass(ClassName.FADE)) { 16731 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 16732 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 16733 } else { 16734 complete(); 16735 } 16736 } 16737 }; 16738 16739 _proto.hide = function hide(callback) { 16740 var _this2 = this; 16741 16742 var tip = this.getTipElement(); 16743 var hideEvent = $.Event(this.constructor.Event.HIDE); 16744 16745 var complete = function complete() { 16746 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 16747 tip.parentNode.removeChild(tip); 16748 } 16749 16750 _this2._cleanTipClass(); 16751 16752 _this2.element.removeAttribute('aria-describedby'); 16753 16754 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 16755 16756 if (_this2._popper !== null) { 16757 _this2._popper.destroy(); 16758 } 16759 16760 if (callback) { 16761 callback(); 16762 } 16763 }; 16764 16765 $(this.element).trigger(hideEvent); 16766 16767 if (hideEvent.isDefaultPrevented()) { 16768 return; 16769 } 16770 16771 $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra 16772 // empty mouseover listeners we added for iOS support 16773 16774 if ('ontouchstart' in document.documentElement) { 16775 $(document.body).children().off('mouseover', null, $.noop); 16776 } 16777 16778 this._activeTrigger[Trigger.CLICK] = false; 16779 this._activeTrigger[Trigger.FOCUS] = false; 16780 this._activeTrigger[Trigger.HOVER] = false; 16781 16782 if ($(this.tip).hasClass(ClassName.FADE)) { 16783 var transitionDuration = Util.getTransitionDurationFromElement(tip); 16784 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 16785 } else { 16786 complete(); 16787 } 16788 16789 this._hoverState = ''; 16790 }; 16791 16792 _proto.update = function update() { 16793 if (this._popper !== null) { 16794 this._popper.scheduleUpdate(); 16795 } 16796 } // Protected 16797 ; 16798 16799 _proto.isWithContent = function isWithContent() { 16800 return Boolean(this.getTitle()); 16801 }; 16802 16803 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 16804 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 16805 }; 16806 16807 _proto.getTipElement = function getTipElement() { 16808 this.tip = this.tip || $(this.config.template)[0]; 16809 return this.tip; 16810 }; 16811 16812 _proto.setContent = function setContent() { 16813 var tip = this.getTipElement(); 16814 this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle()); 16815 $(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW); 16816 }; 16817 16818 _proto.setElementContent = function setElementContent($element, content) { 16819 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 16820 // Content is a DOM node or a jQuery 16821 if (this.config.html) { 16822 if (!$(content).parent().is($element)) { 16823 $element.empty().append(content); 16824 } 16825 } else { 16826 $element.text($(content).text()); 16827 } 16828 16829 return; 16830 } 16831 16832 if (this.config.html) { 16833 if (this.config.sanitize) { 16834 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 16835 } 16836 16837 $element.html(content); 16838 } else { 16839 $element.text(content); 16840 } 16841 }; 16842 16843 _proto.getTitle = function getTitle() { 16844 var title = this.element.getAttribute('data-original-title'); 16845 16846 if (!title) { 16847 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 16848 } 16849 16850 return title; 16851 } // Private 16852 ; 16853 16854 _proto._getPopperConfig = function _getPopperConfig(attachment) { 16855 var _this3 = this; 16856 16857 var defaultBsConfig = { 16858 placement: attachment, 16859 modifiers: { 16860 offset: this._getOffset(), 16861 flip: { 16862 behavior: this.config.fallbackPlacement 16863 }, 16864 arrow: { 16865 element: Selector.ARROW 16866 }, 16867 preventOverflow: {
16868 boundariesElement: this.config.boundary 16869 } 16870 }, 16871 onCreate: function onCreate(data) { 16872 if (data.originalPlacement !== data.placement) { 16873 _this3._handlePopperPlacementChange(data); 16874 } 16875 }, 16876 onUpdate: function onUpdate(data) { 16877 return _this3._handlePopperPlacementChange(data); 16878 } 16879 }; 16880 return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig); 16881 }; 16882 16883 _proto._getOffset = function _getOffset() { 16884 var _this4 = this; 16885 16886 var offset = {}; 16887 16888 if (typeof this.config.offset === 'function') { 16889 offset.fn = function (data) { 16890 data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {}); 16891 return data; 16892 }; 16893 } else { 16894 offset.offset = this.config.offset; 16895 } 16896 16897 return offset; 16898 }; 16899 16900 _proto._getContainer = function _getContainer() { 16901 if (this.config.container === false) { 16902 return document.body; 16903 } 16904 16905 if (Util.isElement(this.config.container)) { 16906 return $(this.config.container); 16907 } 16908 16909 return $(document).find(this.config.container); 16910 }; 16911 16912 _proto._getAttachment = function _getAttachment(placement) { 16913 return AttachmentMap[placement.toUpperCase()]; 16914 }; 16915 16916 _proto._setListeners = function _setListeners() { 16917 var _this5 = this; 16918 16919 var triggers = this.config.trigger.split(' '); 16920 triggers.forEach(function (trigger) { 16921 if (trigger === 'click') { 16922 $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 16923 return _this5.toggle(event); 16924 }); 16925 } else if (trigger !== Trigger.MANUAL) { 16926 var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 16927 var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 16928 $(_this5.element).on(eventIn, _this5.config.selector, function (event) { 16929 return _this5._enter(event); 16930 }).on(eventOut, _this5.config.selector, function (event) { 16931 return _this5._leave(event); 16932 }); 16933 } 16934 }); 16935 16936 this._hideModalHandler = function () { 16937 if (_this5.element) { 16938 _this5.hide(); 16939 } 16940 }; 16941 16942 $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 16943 16944 if (this.config.selector) { 16945 this.config = _objectSpread2({}, this.config, { 16946 trigger: 'manual', 16947 selector: '' 16948 }); 16949 } else { 16950 this._fixTitle(); 16951 } 16952 }; 16953 16954 _proto._fixTitle = function _fixTitle() { 16955 var titleType = typeof this.element.getAttribute('data-original-title'); 16956 16957 if (this.element.getAttribute('title') || titleType !== 'string') { 16958 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 16959 this.element.setAttribute('title', ''); 16960 } 16961 }; 16962 16963 _proto._enter = function _enter(event, context) { 16964 var dataKey = this.constructor.DATA_KEY; 16965 context = context || $(event.currentTarget).data(dataKey); 16966 16967 if (!context) { 16968 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 16969 $(event.currentTarget).data(dataKey, context); 16970 } 16971 16972 if (event) { 16973 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 16974 } 16975 16976 if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) { 16977 context._hoverState = HoverState.SHOW; 16978 return; 16979 } 16980 16981 clearTimeout(context._timeout); 16982 context._hoverState = HoverState.SHOW; 16983 16984 if (!context.config.delay || !context.config.delay.show) { 16985 context.show(); 16986 return; 16987 } 16988 16989 context._timeout = setTimeout(function () { 16990 if (context._hoverState === HoverState.SHOW) { 16991 context.show(); 16992 } 16993 }, context.config.delay.show); 16994 }; 16995 16996 _proto._leave = function _leave(event, context) { 16997 var dataKey = this.constructor.DATA_KEY; 16998 context = context || $(event.currentTarget).data(dataKey); 16999 17000 if (!context) { 17001 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 17002 $(event.currentTarget).data(dataKey, context); 17003 } 17004 17005 if (event) { 17006 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; 17007 } 17008 17009 if (context._isWithActiveTrigger()) { 17010 return; 17011 } 17012 17013 clearTimeout(context._timeout); 17014 context._hoverState = HoverState.OUT; 17015 17016 if (!context.config.delay || !context.config.delay.hide) { 17017 context.hide(); 17018 return; 17019 } 17020 17021 context._timeout = setTimeout(function () { 17022 if (context._hoverState === HoverState.OUT) { 17023 context.hide(); 17024 } 17025 }, context.config.delay.hide); 17026 }; 17027 17028 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 17029 for (var trigger in this._activeTrigger) { 17030 if (this._activeTrigger[trigger]) { 17031 return true; 17032 } 17033 } 17034 17035 return false; 17036 }; 17037 17038 _proto._getConfig = function _getConfig(config) { 17039 var dataAttributes = $(this.element).data();
17040 Object.keys(dataAttributes).forEach(function (dataAttr) { 17041 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 17042 delete dataAttributes[dataAttr]; 17043 } 17044 }); 17045 config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {}); 17046 17047 if (typeof config.delay === 'number') { 17048 config.delay = { 17049 show: config.delay, 17050 hide: config.delay 17051 }; 17052 } 17053 17054 if (typeof config.title === 'number') { 17055 config.title = config.title.toString(); 17056 } 17057 17058 if (typeof config.content === 'number') { 17059 config.content = config.content.toString(); 17060 } 17061 17062 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 17063 17064 if (config.sanitize) { 17065 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 17066 } 17067 17068 return config; 17069 }; 17070 17071 _proto._getDelegateConfig = function _getDelegateConfig() { 17072 var config = {}; 17073 17074 if (this.config) { 17075 for (var key in this.config) { 17076 if (this.constructor.Default[key] !== this.config[key]) { 17077 config[key] = this.config[key]; 17078 } 17079 } 17080 } 17081 17082 return config; 17083 }; 17084 17085 _proto._cleanTipClass = function _cleanTipClass() { 17086 var $tip = $(this.getTipElement()); 17087 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 17088 17089 if (tabClass !== null && tabClass.length) { 17090 $tip.removeClass(tabClass.join('')); 17091 } 17092 }; 17093 17094 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 17095 var popperInstance = popperData.instance; 17096 this.tip = popperInstance.popper; 17097 17098 this._cleanTipClass(); 17099 17100 this.addAttachmentClass(this._getAttachment(popperData.placement)); 17101 }; 17102 17103 _proto._fixTransition = function _fixTransition() { 17104 var tip = this.getTipElement(); 17105 var initConfigAnimation = this.config.animation; 17106 17107 if (tip.getAttribute('x-placement') !== null) { 17108 return; 17109 } 17110 17111 $(tip).removeClass(ClassName.FADE); 17112 this.config.animation = false; 17113 this.hide(); 17114 this.show(); 17115 this.config.animation = initConfigAnimation; 17116 } // Static 17117 ; 17118 17119 Tooltip._jQueryInterface = function _jQueryInterface(config) { 17120 return this.each(function () { 17121 var data = $(this).data(DATA_KEY); 17122 17123 var _config = typeof config === 'object' && config; 17124 17125 if (!data && /dispose|hide/.test(config)) { 17126 return; 17127 } 17128 17129 if (!data) { 17130 data = new Tooltip(this, _config); 17131 $(this).data(DATA_KEY, data); 17132 } 17133 17134 if (typeof config === 'string') { 17135 if (typeof data[config] === 'undefined') { 17136 throw new TypeError("No method named \"" + config + "\""); 17137 } 17138 17139 data[config](); 17140 } 17141 }); 17142 }; 17143 17144 _createClass(Tooltip, null, [{ 17145 key: "VERSION", 17146 get: function get() { 17147 return VERSION; 17148 } 17149 }, { 17150 key: "Default", 17151 get: function get() { 17152 return Default; 17153 } 17154 }, { 17155 key: "NAME", 17156 get: function get() { 17157 return NAME; 17158 } 17159 }, { 17160 key: "DATA_KEY", 17161 get: function get() { 17162 return DATA_KEY; 17163 } 17164 }, { 17165 key: "Event", 17166 get: function get() { 17167 return Event; 17168 } 17169 }, { 17170 key: "EVENT_KEY", 17171 get: function get() { 17172 return EVENT_KEY; 17173 } 17174 }, { 17175 key: "DefaultType", 17176 get: function get() { 17177 return DefaultType; 17178 } 17179 }]); 17180 17181 return Tooltip; 17182 }(); 17183 /** 17184 * ------------------------------------------------------------------------ 17185 * jQuery 17186 * ------------------------------------------------------------------------ 17187 */ 17188 17189 17190 $.fn[NAME] = Tooltip._jQueryInterface; 17191 $.fn[NAME].Constructor = Tooltip; 17192 17193 $.fn[NAME].noConflict = function () { 17194 $.fn[NAME] = JQUERY_NO_CONFLICT; 17195 return Tooltip._jQueryInterface; 17196 }; 17197 17198 return Tooltip; 17199 17200}))); 17201//# sourceMappingURL=tooltip.js.map 17202/*! 17203 * Bootstrap popover.js v4.4.1 (https://getbootstrap.com/) 17204 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 17205 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 17206 */ 17207(function (global, factory) { 17208 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) : 17209 typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) : 17210 (global = global || self, global.Popover = factory(global.jQuery, global.Tooltip)); 17211}(this, (function ($, Tooltip) { 'use strict'; 17212 17213 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 17214 Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip; 17215 17216 function _defineProperties(target, props) { 17217 for (var i = 0; i < props.length; i++) { 17218 var descriptor = props[i]; 17219 descriptor.enumerable = descriptor.enumerable || false; 17220 descriptor.configurable = true; 17221 if ("value" in descriptor) descriptor.writable = true; 17222 Object.defineProperty(target, descriptor.key, descriptor); 17223 } 17224 } 17225 17226 function _createClass(Constructor, protoProps, staticProps) { 17227 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 17228 if (staticProps) _defineProperties(Constructor, staticProps); 17229 return Constructor; 17230 } 17231 17232 function _defineProperty(obj, key, value) { 17233 if (key in obj) { 17234 Object.defineProperty(obj, key, { 17235 value: value, 17236 enumerable: true, 17237 configurable: true, 17238 writable: true 17239 }); 17240 } else { 17241 obj[key] = value; 17242 } 17243 17244 return obj;
17245 } 17246 17247 function ownKeys(object, enumerableOnly) { 17248 var keys = Object.keys(object); 17249 17250 if (Object.getOwnPropertySymbols) { 17251 var symbols = Object.getOwnPropertySymbols(object); 17252 if (enumerableOnly) symbols = symbols.filter(function (sym) { 17253 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17254 }); 17255 keys.push.apply(keys, symbols); 17256 } 17257 17258 return keys; 17259 } 17260 17261 function _objectSpread2(target) { 17262 for (var i = 1; i < arguments.length; i++) { 17263 var source = arguments[i] != null ? arguments[i] : {}; 17264 17265 if (i % 2) { 17266 ownKeys(Object(source), true).forEach(function (key) { 17267 _defineProperty(target, key, source[key]); 17268 }); 17269 } else if (Object.getOwnPropertyDescriptors) { 17270 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 17271 } else { 17272 ownKeys(Object(source)).forEach(function (key) { 17273 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17274 }); 17275 } 17276 } 17277 17278 return target; 17279 } 17280 17281 function _inheritsLoose(subClass, superClass) { 17282 subClass.prototype = Object.create(superClass.prototype); 17283 subClass.prototype.constructor = subClass; 17284 subClass.__proto__ = superClass; 17285 } 17286 17287 /** 17288 * ------------------------------------------------------------------------ 17289 * Constants 17290 * ------------------------------------------------------------------------ 17291 */ 17292 17293 var NAME = 'popover'; 17294 var VERSION = '4.4.1'; 17295 var DATA_KEY = 'bs.popover'; 17296 var EVENT_KEY = "." + DATA_KEY; 17297 var JQUERY_NO_CONFLICT = $.fn[NAME]; 17298 var CLASS_PREFIX = 'bs-popover'; 17299 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 17300 17301 var Default = _objectSpread2({}, Tooltip.Default, { 17302 placement: 'right', 17303 trigger: 'click', 17304 content: '', 17305 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 17306 }); 17307 17308 var DefaultType = _objectSpread2({}, Tooltip.DefaultType, { 17309 content: '(string|element|function)' 17310 }); 17311 17312 var ClassName = { 17313 FADE: 'fade', 17314 SHOW: 'show' 17315 }; 17316 var Selector = { 17317 TITLE: '.popover-header', 17318 CONTENT: '.popover-body' 17319 }; 17320 var Event = { 17321 HIDE: "hide" + EVENT_KEY, 17322 HIDDEN: "hidden" + EVENT_KEY, 17323 SHOW: "show" + EVENT_KEY, 17324 SHOWN: "shown" + EVENT_KEY, 17325 INSERTED: "inserted" + EVENT_KEY, 17326 CLICK: "click" + EVENT_KEY, 17327 FOCUSIN: "focusin" + EVENT_KEY, 17328 FOCUSOUT: "focusout" + EVENT_KEY, 17329 MOUSEENTER: "mouseenter" + EVENT_KEY, 17330 MOUSELEAVE: "mouseleave" + EVENT_KEY 17331 }; 17332 /** 17333 * ------------------------------------------------------------------------ 17334 * Class Definition 17335 * ------------------------------------------------------------------------ 17336 */ 17337 17338 var Popover = 17339 /*#__PURE__*/ 17340 function (_Tooltip) { 17341 _inheritsLoose(Popover, _Tooltip); 17342 17343 function Popover() { 17344 return _Tooltip.apply(this, arguments) || this; 17345 } 17346 17347 var _proto = Popover.prototype; 17348 17349 // Overrides 17350 _proto.isWithContent = function isWithContent() { 17351 return this.getTitle() || this._getContent(); 17352 }; 17353 17354 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 17355 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 17356 }; 17357 17358 _proto.getTipElement = function getTipElement() { 17359 this.tip = this.tip || $(this.config.template)[0]; 17360 return this.tip; 17361 }; 17362 17363 _proto.setContent = function setContent() { 17364 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 17365 17366 this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); 17367 17368 var content = this._getContent(); 17369 17370 if (typeof content === 'function') { 17371 content = content.call(this.element); 17372 } 17373 17374 this.setElementContent($tip.find(Selector.CONTENT), content); 17375 $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW); 17376 } // Private 17377 ; 17378 17379 _proto._getContent = function _getContent() { 17380 return this.element.getAttribute('data-content') || this.config.content; 17381 }; 17382 17383 _proto._cleanTipClass = function _cleanTipClass() { 17384 var $tip = $(this.getTipElement()); 17385 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 17386 17387 if (tabClass !== null && tabClass.length > 0) { 17388 $tip.removeClass(tabClass.join(''));
17389 } 17390 } // Static 17391 ; 17392 17393 Popover._jQueryInterface = function _jQueryInterface(config) { 17394 return this.each(function () { 17395 var data = $(this).data(DATA_KEY); 17396 17397 var _config = typeof config === 'object' ? config : null; 17398 17399 if (!data && /dispose|hide/.test(config)) { 17400 return; 17401 } 17402 17403 if (!data) { 17404 data = new Popover(this, _config); 17405 $(this).data(DATA_KEY, data); 17406 } 17407 17408 if (typeof config === 'string') { 17409 if (typeof data[config] === 'undefined') { 17410 throw new TypeError("No method named \"" + config + "\""); 17411 } 17412 17413 data[config](); 17414 } 17415 }); 17416 }; 17417 17418 _createClass(Popover, null, [{ 17419 key: "VERSION", 17420 // Getters 17421 get: function get() { 17422 return VERSION; 17423 } 17424 }, { 17425 key: "Default", 17426 get: function get() { 17427 return Default; 17428 } 17429 }, { 17430 key: "NAME", 17431 get: function get() { 17432 return NAME; 17433 } 17434 }, { 17435 key: "DATA_KEY", 17436 get: function get() { 17437 return DATA_KEY; 17438 } 17439 }, { 17440 key: "Event", 17441 get: function get() { 17442 return Event; 17443 } 17444 }, { 17445 key: "EVENT_KEY", 17446 get: function get() { 17447 return EVENT_KEY; 17448 } 17449 }, { 17450 key: "DefaultType", 17451 get: function get() { 17452 return DefaultType; 17453 } 17454 }]); 17455 17456 return Popover; 17457 }(Tooltip); 17458 /** 17459 * ------------------------------------------------------------------------ 17460 * jQuery 17461 * ------------------------------------------------------------------------ 17462 */ 17463 17464 17465 $.fn[NAME] = Popover._jQueryInterface; 17466 $.fn[NAME].Constructor = Popover; 17467 17468 $.fn[NAME].noConflict = function () { 17469 $.fn[NAME] = JQUERY_NO_CONFLICT; 17470 return Popover._jQueryInterface; 17471 }; 17472 17473 return Popover; 17474 17475}))); 17476//# sourceMappingURL=popover.js.map 17477/*! 17478 * Bootstrap scrollspy.js v4.4.1 (https://getbootstrap.com/) 17479 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 17480 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 17481 */ 17482(function (global, factory) { 17483 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 17484 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 17485 (global = global || self, global.ScrollSpy = factory(global.jQuery, global.Util)); 17486}(this, (function ($, Util) { 'use strict'; 17487 17488 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 17489 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 17490 17491 function _defineProperties(target, props) { 17492 for (var i = 0; i < props.length; i++) { 17493 var descriptor = props[i]; 17494 descriptor.enumerable = descriptor.enumerable || false; 17495 descriptor.configurable = true; 17496 if ("value" in descriptor) descriptor.writable = true; 17497 Object.defineProperty(target, descriptor.key, descriptor); 17498 } 17499 } 17500 17501 function _createClass(Constructor, protoProps, staticProps) { 17502 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 17503 if (staticProps) _defineProperties(Constructor, staticProps); 17504 return Constructor; 17505 } 17506 17507 function _defineProperty(obj, key, value) { 17508 if (key in obj) { 17509 Object.defineProperty(obj, key, { 17510 value: value, 17511 enumerable: true, 17512 configurable: true, 17513 writable: true 17514 }); 17515 } else { 17516 obj[key] = value; 17517 } 17518 17519 return obj; 17520 } 17521 17522 function ownKeys(object, enumerableOnly) { 17523 var keys = Object.keys(object); 17524 17525 if (Object.getOwnPropertySymbols) { 17526 var symbols = Object.getOwnPropertySymbols(object); 17527 if (enumerableOnly) symbols = symbols.filter(function (sym) { 17528 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17529 }); 17530 keys.push.apply(keys, symbols); 17531 } 17532 17533 return keys; 17534 } 17535 17536 function _objectSpread2(target) { 17537 for (var i = 1; i < arguments.length; i++) { 17538 var source = arguments[i] != null ? arguments[i] : {}; 17539 17540 if (i % 2) { 17541 ownKeys(Object(source), true).forEach(function (key) { 17542 _defineProperty(target, key, source[key]); 17543 }); 17544 } else if (Object.getOwnPropertyDescriptors) { 17545 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 17546 } else {
17547 ownKeys(Object(source)).forEach(function (key) { 17548 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17549 }); 17550 } 17551 } 17552 17553 return target; 17554 } 17555 17556 /** 17557 * ------------------------------------------------------------------------ 17558 * Constants 17559 * ------------------------------------------------------------------------ 17560 */ 17561 17562 var NAME = 'scrollspy'; 17563 var VERSION = '4.4.1'; 17564 var DATA_KEY = 'bs.scrollspy'; 17565 var EVENT_KEY = "." + DATA_KEY; 17566 var DATA_API_KEY = '.data-api'; 17567 var JQUERY_NO_CONFLICT = $.fn[NAME]; 17568 var Default = { 17569 offset: 10, 17570 method: 'auto', 17571 target: '' 17572 }; 17573 var DefaultType = { 17574 offset: 'number', 17575 method: 'string', 17576 target: '(string|element)' 17577 }; 17578 var Event = { 17579 ACTIVATE: "activate" + EVENT_KEY, 17580 SCROLL: "scroll" + EVENT_KEY, 17581 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY 17582 }; 17583 var ClassName = { 17584 DROPDOWN_ITEM: 'dropdown-item', 17585 DROPDOWN_MENU: 'dropdown-menu', 17586 ACTIVE: 'active' 17587 }; 17588 var Selector = { 17589 DATA_SPY: '[data-spy="scroll"]', 17590 ACTIVE: '.active', 17591 NAV_LIST_GROUP: '.nav, .list-group', 17592 NAV_LINKS: '.nav-link', 17593 NAV_ITEMS: '.nav-item', 17594 LIST_ITEMS: '.list-group-item', 17595 DROPDOWN: '.dropdown', 17596 DROPDOWN_ITEMS: '.dropdown-item', 17597 DROPDOWN_TOGGLE: '.dropdown-toggle' 17598 }; 17599 var OffsetMethod = { 17600 OFFSET: 'offset', 17601 POSITION: 'position' 17602 }; 17603 /** 17604 * ------------------------------------------------------------------------ 17605 * Class Definition 17606 * ------------------------------------------------------------------------ 17607 */ 17608 17609 var ScrollSpy = 17610 /*#__PURE__*/ 17611 function () { 17612 function ScrollSpy(element, config) { 17613 var _this = this; 17614 17615 this._element = element; 17616 this._scrollElement = element.tagName === 'BODY' ? window : element; 17617 this._config = this._getConfig(config); 17618 this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS); 17619 this._offsets = []; 17620 this._targets = []; 17621 this._activeTarget = null; 17622 this._scrollHeight = 0; 17623 $(this._scrollElement).on(Event.SCROLL, function (event) { 17624 return _this._process(event); 17625 }); 17626 this.refresh(); 17627 17628 this._process(); 17629 } // Getters 17630 17631 17632 var _proto = ScrollSpy.prototype; 17633 17634 // Public 17635 _proto.refresh = function refresh() { 17636 var _this2 = this; 17637 17638 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 17639 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 17640 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 17641 this._offsets = []; 17642 this._targets = []; 17643 this._scrollHeight = this._getScrollHeight(); 17644 var targets = [].slice.call(document.querySelectorAll(this._selector)); 17645 targets.map(function (element) { 17646 var target; 17647 var targetSelector = Util.getSelectorFromElement(element); 17648 17649 if (targetSelector) { 17650 target = document.querySelector(targetSelector); 17651 } 17652 17653 if (target) { 17654 var targetBCR = target.getBoundingClientRect(); 17655 17656 if (targetBCR.width || targetBCR.height) { 17657 // TODO (fat): remove sketch reliance on jQuery position/offset 17658 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 17659 } 17660 } 17661 17662 return null; 17663 }).filter(function (item) { 17664 return item; 17665 }).sort(function (a, b) { 17666 return a[0] - b[0]; 17667 }
17667).forEach(function (item) { 17668 _this2._offsets.push(item[0]); 17669 17670 _this2._targets.push(item[1]); 17671 }); 17672 }; 17673 17674 _proto.dispose = function dispose() { 17675 $.removeData(this._element, DATA_KEY); 17676 $(this._scrollElement).off(EVENT_KEY); 17677 this._element = null; 17678 this._scrollElement = null; 17679 this._config = null; 17680 this._selector = null; 17681 this._offsets = null; 17682 this._targets = null; 17683 this._activeTarget = null; 17684 this._scrollHeight = null; 17685 } // Private 17686 ; 17687 17688 _proto._getConfig = function _getConfig(config) { 17689 config = _objectSpread2({}, Default, {}, typeof config === 'object' && config ? config : {}); 17690 17691 if (typeof config.target !== 'string') { 17692 var id = $(config.target).attr('id'); 17693 17694 if (!id) { 17695 id = Util.getUID(NAME); 17696 $(config.target).attr('id', id); 17697 } 17698 17699 config.target = "#" + id; 17700 } 17701 17702 Util.typeCheckConfig(NAME, config, DefaultType); 17703 return config; 17704 }; 17705 17706 _proto._getScrollTop = function _getScrollTop() { 17707 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 17708 }; 17709 17710 _proto._getScrollHeight = function _getScrollHeight() { 17711 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 17712 }; 17713 17714 _proto._getOffsetHeight = function _getOffsetHeight() { 17715 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 17716 }; 17717 17718 _proto._process = function _process() { 17719 var scrollTop = this._getScrollTop() + this._config.offset; 17720 17721 var scrollHeight = this._getScrollHeight(); 17722 17723 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 17724 17725 if (this._scrollHeight !== scrollHeight) { 17726 this.refresh(); 17727 } 17728 17729 if (scrollTop >= maxScroll) { 17730 var target = this._targets[this._targets.length - 1]; 17731 17732 if (this._activeTarget !== target) { 17733 this._activate(target); 17734 } 17735 17736 return; 17737 } 17738 17739 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 17740 this._activeTarget = null; 17741 17742 this._clear(); 17743 17744 return; 17745 } 17746 17747 var offsetLength = this._offsets.length; 17748 17749 for (var i = offsetLength; i--;) { 17750 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 17751 17752 if (isActiveTarget) { 17753 this._activate(this._targets[i]); 17754 } 17755 } 17756 }; 17757 17758 _proto._activate = function _activate(target) { 17759 this._activeTarget = target; 17760 17761 this._clear(); 17762 17763 var queries = this._selector.split(',').map(function (selector) { 17764 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 17765 }); 17766 17767 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 17768 17769 if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { 17770 $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); 17771 $link.addClass(ClassName.ACTIVE); 17772 } else { 17773 // Set triggered link as active 17774 $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active 17775 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 17776 17777 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item 17778 17779 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); 17780 } 17781 17782 $(this._scrollElement).trigger(Event.ACTIVATE, { 17783 relatedTarget: target 17784 }); 17785 }; 17786 17787 _proto._clear = function _clear() { 17788 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 17789 return node.classList.contains(ClassName.ACTIVE); 17790 }
17790).forEach(function (node) { 17791 return node.classList.remove(ClassName.ACTIVE); 17792 }); 17793 } // Static 17794 ; 17795 17796 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 17797 return this.each(function () { 17798 var data = $(this).data(DATA_KEY); 17799 17800 var _config = typeof config === 'object' && config; 17801 17802 if (!data) { 17803 data = new ScrollSpy(this, _config); 17804 $(this).data(DATA_KEY, data); 17805 } 17806 17807 if (typeof config === 'string') { 17808 if (typeof data[config] === 'undefined') { 17809 throw new TypeError("No method named \"" + config + "\""); 17810 } 17811 17812 data[config](); 17813 } 17814 }); 17815 }; 17816 17817 _createClass(ScrollSpy, null, [{ 17818 key: "VERSION", 17819 get: function get() { 17820 return VERSION; 17821 } 17822 }, { 17823 key: "Default", 17824 get: function get() { 17825 return Default; 17826 } 17827 }]); 17828 17829 return ScrollSpy; 17830 }(); 17831 /** 17832 * ------------------------------------------------------------------------ 17833 * Data Api implementation 17834 * ------------------------------------------------------------------------ 17835 */ 17836 17837 17838 $(window).on(Event.LOAD_DATA_API, function () { 17839 var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY)); 17840 var scrollSpysLength = scrollSpys.length; 17841 17842 for (var i = scrollSpysLength; i--;) { 17843 var $spy = $(scrollSpys[i]); 17844 17845 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 17846 } 17847 }); 17848 /** 17849 * ------------------------------------------------------------------------ 17850 * jQuery 17851 * ------------------------------------------------------------------------ 17852 */ 17853 17854 $.fn[NAME] = ScrollSpy._jQueryInterface; 17855 $.fn[NAME].Constructor = ScrollSpy; 17856 17857 $.fn[NAME].noConflict = function () { 17858 $.fn[NAME] = JQUERY_NO_CONFLICT; 17859 return ScrollSpy._jQueryInterface; 17860 }; 17861 17862 return ScrollSpy; 17863 17864}))); 17865//# sourceMappingURL=scrollspy.js.map 17866/*! 17867 * Bootstrap tab.js v4.4.1 (https://getbootstrap.com/) 17868 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 17869 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 17870 */ 17871(function (global, factory) { 17872 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 17873 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 17874 (global = global || self, global.Tab = factory(global.jQuery, global.Util)); 17875}(this, (function ($, Util) { 'use strict'; 17876 17877 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 17878 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 17879 17880 function _defineProperties(target, props) { 17881 for (var i = 0; i < props.length; i++) { 17882 var descriptor = props[i]; 17883 descriptor.enumerable = descriptor.enumerable || false; 17884 descriptor.configurable = true; 17885 if ("value" in descriptor) descriptor.writable = true; 17886 Object.defineProperty(target, descriptor.key, descriptor); 17887 } 17888 } 17889 17890 function _createClass(Constructor, protoProps, staticProps) { 17891 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 17892 if (staticProps) _defineProperties(Constructor, staticProps); 17893 return Constructor; 17894 } 17895 17896 /** 17897 * ------------------------------------------------------------------------ 17898 * Constants 17899 * ------------------------------------------------------------------------ 17900 */ 17901 17902 var NAME = 'tab'; 17903 var VERSION = '4.4.1'; 17904 var DATA_KEY = 'bs.tab'; 17905 var EVENT_KEY = "." + DATA_KEY; 17906 var DATA_API_KEY = '.data-api'; 17907 var JQUERY_NO_CONFLICT = $.fn[NAME]; 17908 var Event = { 17909 HIDE: "hide" + EVENT_KEY, 17910 HIDDEN: "hidden" + EVENT_KEY, 17911 SHOW: "show" + EVENT_KEY, 17912 SHOWN: "shown" + EVENT_KEY, 17913 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 17914 }; 17915 var ClassName = { 17916 DROPDOWN_MENU: 'dropdown-menu', 17917 ACTIVE: 'active', 17918 DISABLED: 'disabled', 17919 FADE: 'fade', 17920 SHOW: 'show' 17921 }; 17922 var Selector = { 17923 DROPDOWN: '.dropdown', 17924 NAV_LIST_GROUP: '.nav, .list-group', 17925 ACTIVE: '.active', 17926 ACTIVE_UL: '> li > .active', 17927 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 17928 DROPDOWN_TOGGLE: '.dropdown-toggle', 17929 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 17930 }; 17931 /** 17932 * ------------------------------------------------------------------------ 17933 * Class Definition 17934 * ------------------------------------------------------------------------ 17935 */ 17936 17937 var Tab = 17938 /*#__PURE__*/ 17939 function () { 17940 function Tab(element) { 17941 this._element = element; 17942 } // Getters 17943 17944 17945 var _proto = Tab.prototype; 17946 17947 // Public 17948 _proto.show = function show() { 17949 var _this = this; 17950 17951 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) { 17952 return; 17953 } 17954 17955 var target; 17956 var previous; 17957 var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]; 17958 var selector = Util.getSelectorFromElement(this._element); 17959 17960 if (listElement) { 17961 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE; 17962 previous = $.makeArray($(listElement).find(itemSelector)); 17963 previous = previous[previous.length - 1]; 17964 } 17965 17966 var hideEvent = $.Event(Event.HIDE, { 17967 relatedTarget: this._element 17968 }); 17969 var showEvent = $.Event(Event.SHOW, { 17970 relatedTarget: previous 17971 }); 17972 17973 if (previous) { 17974 $(previous).trigger(hideEvent); 17975 } 17976 17977 $(this._element).trigger(showEvent); 17978 17979 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 17980 return; 17981 } 17982 17983 if (selector) { 17984 target = document.querySelector(selector); 17985 } 17986 17987 this._activate(this._element, listElement); 17988 17989 var complete = function complete() { 17990 var hiddenEvent = $.Event(Event.HIDDEN, { 17991 relatedTarget: _this._element 17992 }); 17993 var shownEvent = $.Event(Event.SHOWN, { 17994 relatedTarget: previous 17995 }); 17996 $(previous).trigger(hiddenEvent); 17997 $(_this._element).trigger(shownEvent); 17998 }; 17999 18000 if (target) { 18001 this._activate(target, target.parentNode, complete); 18002 } else { 18003 complete(); 18004 } 18005 }; 18006 18007 _proto.dispose = function dispose() { 18008 $.removeData(this._element, DATA_KEY); 18009 this._element = null; 18010 } // Private 18011 ; 18012 18013 _proto._activate = function _activate(element, container, callback) { 18014 var _this2 = this; 18015 18016 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector.ACTIVE_UL) : $(container).children(Selector.ACTIVE); 18017 var active = activeElements[0]; 18018 var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE); 18019 18020 var complete = function complete() { 18021 return _this2._transitionComplete(element, active, callback); 18022 }; 18023 18024 if (active && isTransitioning) { 18025 var transitionDuration = Util.getTransitionDurationFromElement(active); 18026 $(active).removeClass(ClassName.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 18027 } else { 18028 complete(); 18029 } 18030 }; 18031 18032 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 18033 if (active) { 18034 $(active).removeClass(ClassName.ACTIVE);
vendor: 4,336 bytes, lines 18035-18176
18035 var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; 18036 18037 if (dropdownChild) { 18038 $(dropdownChild).removeClass(ClassName.ACTIVE); 18039 } 18040 18041 if (active.getAttribute('role') === 'tab') { 18042 active.setAttribute('aria-selected', false); 18043 } 18044 } 18045 18046 $(element).addClass(ClassName.ACTIVE); 18047 18048 if (element.getAttribute('role') === 'tab') { 18049 element.setAttribute('aria-selected', true); 18050 } 18051 18052 Util.reflow(element); 18053 18054 if (element.classList.contains(ClassName.FADE)) { 18055 element.classList.add(ClassName.SHOW); 18056 } 18057 18058 if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { 18059 var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; 18060 18061 if (dropdownElement) { 18062 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE)); 18063 $(dropdownToggleList).addClass(ClassName.ACTIVE); 18064 } 18065 18066 element.setAttribute('aria-expanded', true); 18067 } 18068 18069 if (callback) { 18070 callback(); 18071 } 18072 } // Static 18073 ; 18074 18075 Tab._jQueryInterface = function _jQueryInterface(config) { 18076 return this.each(function () { 18077 var $this = $(this); 18078 var data = $this.data(DATA_KEY); 18079 18080 if (!data) { 18081 data = new Tab(this); 18082 $this.data(DATA_KEY, data); 18083 } 18084 18085 if (typeof config === 'string') { 18086 if (typeof data[config] === 'undefined') { 18087 throw new TypeError("No method named \"" + config + "\""); 18088 } 18089 18090 data[config](); 18091 } 18092 }); 18093 }; 18094 18095 _createClass(Tab, null, [{ 18096 key: "VERSION", 18097 get: function get() { 18098 return VERSION; 18099 } 18100 }]); 18101 18102 return Tab; 18103 }(); 18104 /** 18105 * ------------------------------------------------------------------------ 18106 * Data Api implementation 18107 * ------------------------------------------------------------------------ 18108 */ 18109 18110 18111 $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 18112 event.preventDefault(); 18113 18114 Tab._jQueryInterface.call($(this), 'show'); 18115 }); 18116 /** 18117 * ------------------------------------------------------------------------ 18118 * jQuery 18119 * ------------------------------------------------------------------------ 18120 */ 18121 18122 $.fn[NAME] = Tab._jQueryInterface; 18123 $.fn[NAME].Constructor = Tab; 18124 18125 $.fn[NAME].noConflict = function () { 18126 $.fn[NAME] = JQUERY_NO_CONFLICT; 18127 return Tab._jQueryInterface; 18128 }; 18129 18130 return Tab; 18131 18132}))); 18133//# sourceMappingURL=tab.js.map 18134/*! 18135 * Bootstrap toast.js v4.4.1 (https://getbootstrap.com/) 18136 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 18137 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 18138 */ 18139(function (global, factory) { 18140 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : 18141 typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : 18142 (global = global || self, global.Toast = factory(global.jQuery, global.Util)); 18143}(this, (function ($, Util) { 'use strict'; 18144 18145 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 18146 Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; 18147 18148 function _defineProperties(target, props) { 18149 for (var i = 0; i < props.length; i++) { 18150 var descriptor = props[i]; 18151 descriptor.enumerable = descriptor.enumerable || false; 18152 descriptor.configurable = true; 18153 if ("value" in descriptor) descriptor.writable = true; 18154 Object.defineProperty(target, descriptor.key, descriptor); 18155 } 18156 } 18157 18158 function _createClass(Constructor, protoProps, staticProps) { 18159 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 18160 if (staticProps) _defineProperties(Constructor, staticProps); 18161 return Constructor; 18162 } 18163 18164 function _defineProperty(obj, key, value) { 18165 if (key in obj) { 18166 Object.defineProperty(obj, key, { 18167 value: value, 18168 enumerable: true, 18169 configurable: true, 18170 writable: true 18171 }); 18172 } else { 18173 obj[key] = value; 18174 } 18175 18176 return obj;
18177 } 18178 18179 function ownKeys(object, enumerableOnly) { 18180 var keys = Object.keys(object); 18181 18182 if (Object.getOwnPropertySymbols) { 18183 var symbols = Object.getOwnPropertySymbols(object); 18184 if (enumerableOnly) symbols = symbols.filter(function (sym) { 18185 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18186 }); 18187 keys.push.apply(keys, symbols); 18188 } 18189 18190 return keys; 18191 } 18192 18193 function _objectSpread2(target) { 18194 for (var i = 1; i < arguments.length; i++) { 18195 var source = arguments[i] != null ? arguments[i] : {}; 18196 18197 if (i % 2) { 18198 ownKeys(Object(source), true).forEach(function (key) { 18199 _defineProperty(target, key, source[key]); 18200 }); 18201 } else if (Object.getOwnPropertyDescriptors) { 18202 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 18203 } else { 18204 ownKeys(Object(source)).forEach(function (key) { 18205 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18206 }); 18207 } 18208 } 18209 18210 return target; 18211 } 18212 18213 /** 18214 * ------------------------------------------------------------------------ 18215 * Constants 18216 * ------------------------------------------------------------------------ 18217 */ 18218 18219 var NAME = 'toast'; 18220 var VERSION = '4.4.1'; 18221 var DATA_KEY = 'bs.toast'; 18222 var EVENT_KEY = "." + DATA_KEY; 18223 var JQUERY_NO_CONFLICT = $.fn[NAME]; 18224 var Event = { 18225 CLICK_DISMISS: "click.dismiss" + EVENT_KEY, 18226 HIDE: "hide" + EVENT_KEY, 18227 HIDDEN: "hidden" + EVENT_KEY, 18228 SHOW: "show" + EVENT_KEY, 18229 SHOWN: "shown" + EVENT_KEY 18230 }; 18231 var ClassName = { 18232 FADE: 'fade', 18233 HIDE: 'hide', 18234 SHOW: 'show', 18235 SHOWING: 'showing' 18236 }; 18237 var DefaultType = { 18238 animation: 'boolean', 18239 autohide: 'boolean', 18240 delay: 'number' 18241 }; 18242 var Default = { 18243 animation: true, 18244 autohide: true, 18245 delay: 500 18246 }; 18247 var Selector = { 18248 DATA_DISMISS: '[data-dismiss="toast"]' 18249 }; 18250 /** 18251 * ------------------------------------------------------------------------ 18252 * Class Definition 18253 * ------------------------------------------------------------------------ 18254 */ 18255 18256 var Toast = 18257 /*#__PURE__*/ 18258 function () { 18259 function Toast(element, config) { 18260 this._element = element; 18261 this._config = this._getConfig(config); 18262 this._timeout = null; 18263 18264 this._setListeners(); 18265 } // Getters 18266 18267 18268 var _proto = Toast.prototype; 18269 18270 // Public 18271 _proto.show = function show() { 18272 var _this = this; 18273 18274 var showEvent = $.Event(Event.SHOW); 18275 $(this._element).trigger(showEvent); 18276 18277 if (showEvent.isDefaultPrevented()) { 18278 return; 18279 } 18280 18281 if (this._config.animation) { 18282 this._element.classList.add(ClassName.FADE); 18283 } 18284 18285 var complete = function complete() { 18286 _this._element.classList.remove(ClassName.SHOWING); 18287 18288 _this._element.classList.add(ClassName.SHOW); 18289 18290 $(_this._element).trigger(Event.SHOWN); 18291 18292 if (_this._config.autohide) { 18293 _this._timeout = setTimeout(function () { 18294 _this.hide(); 18295 }, _this._config.delay); 18296 } 18297 }; 18298 18299 this._element.classList.remove(ClassName.HIDE); 18300 18301 Util.reflow(this._element); 18302 18303 this._element.classList.add(ClassName.SHOWING); 18304 18305 if (this._config.animation) { 18306 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 18307 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 18308 } else { 18309 complete(); 18310 } 18311 }; 18312 18313 _proto.hide = function hide() { 18314 if (!this._element.classList.contains(ClassName.SHOW)) { 18315 return; 18316 } 18317 18318 var hideEvent = $.Event(Event.HIDE); 18319 $(this._element).trigger(hideEvent); 18320 18321 if (hideEvent.isDefaultPrevented()) { 18322 return; 18323 } 18324 18325 this._close(); 18326 }; 18327 18328 _proto.dispose = function dispose() { 18329 clearTimeout(this._timeout); 18330 this._timeout = null; 18331 18332 if (this._element.classList.contains(ClassName.SHOW)) { 18333 this._element.classList.remove(ClassName.SHOW); 18334 } 18335 18336 $(this._element).off(Event.CLICK_DISMISS); 18337 $.removeData(this._element, DATA_KEY); 18338 this._element = null; 18339 this._config = null; 18340 } // Private 18341 ; 18342 18343 _proto._getConfig = function _getConfig(config) {
18344 config = _objectSpread2({}, Default, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {}); 18345 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 18346 return config; 18347 }; 18348 18349 _proto._setListeners = function _setListeners() { 18350 var _this2 = this; 18351 18352 $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () { 18353 return _this2.hide(); 18354 }); 18355 }; 18356 18357 _proto._close = function _close() { 18358 var _this3 = this; 18359 18360 var complete = function complete() { 18361 _this3._element.classList.add(ClassName.HIDE); 18362 18363 $(_this3._element).trigger(Event.HIDDEN); 18364 }; 18365 18366 this._element.classList.remove(ClassName.SHOW); 18367 18368 if (this._config.animation) { 18369 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 18370 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 18371 } else { 18372 complete(); 18373 } 18374 } // Static 18375 ; 18376 18377 Toast._jQueryInterface = function _jQueryInterface(config) { 18378 return this.each(function () { 18379 var $element = $(this); 18380 var data = $element.data(DATA_KEY); 18381 18382 var _config = typeof config === 'object' && config; 18383 18384 if (!data) { 18385 data = new Toast(this, _config); 18386 $element.data(DATA_KEY, data); 18387 } 18388 18389 if (typeof config === 'string') { 18390 if (typeof data[config] === 'undefined') { 18391 throw new TypeError("No method named \"" + config + "\""); 18392 } 18393 18394 data[config](this); 18395 } 18396 }); 18397 }; 18398 18399 _createClass(Toast, null, [{ 18400 key: "VERSION", 18401 get: function get() { 18402 return VERSION; 18403 } 18404 }, { 18405 key: "DefaultType", 18406 get: function get() { 18407 return DefaultType; 18408 } 18409 }, { 18410 key: "Default", 18411 get: function get() { 18412 return Default; 18413 } 18414 }]); 18415 18416 return Toast; 18417 }(); 18418 /** 18419 * ------------------------------------------------------------------------ 18420 * jQuery 18421 * ------------------------------------------------------------------------ 18422 */ 18423 18424 18425 $.fn[NAME] = Toast._jQueryInterface; 18426 $.fn[NAME].Constructor = Toast; 18427 18428 $.fn[NAME].noConflict = function () { 18429 $.fn[NAME] = JQUERY_NO_CONFLICT; 18430 return Toast._jQueryInterface; 18431 }; 18432 18433 return Toast; 18434 18435}))); 18436//# sourceMappingURL=toast.js.map 18437 18438// импоÑÑиÑÑем jQuery Masked Input 18439(function (factory) { 18440 if (typeof define === 'function' && define.amd) { 18441 // AMD. Register as an anonymous module. 18442 define(['jquery'], factory); 18443 } else if (typeof exports === 'object') { 18444 // Node/CommonJS 18445 factory(require('jquery')); 18446 } else { 18447 // Browser globals 18448 factory(jQuery); 18449 } 18450}(function ($) { 18451 18452var ua = navigator.userAgent, 18453 iPhone = /iphone/i.test(ua), 18454 chrome = /chrome/i.test(ua), 18455 android = /android/i.test(ua), 18456 caretTimeoutId; 18457 18458$.mask = { 18459 //Predefined character definitions 18460 definitions: { 18461 '9': "[0-9]", 18462 'a': "[A-Za-z]", 18463 '*': "[A-Za-z0-9]" 18464 }, 18465 autoclear: true, 18466 dataName: "rawMaskFn", 18467 placeholder: '_' 18468}; 18469 18470$.fn.extend({ 18471 //Helper Function for Caret positioning 18472 caret: function(begin, end) { 18473 var range; 18474 18475 if (this.length === 0 || this.is(":hidden") || this.get(0) !== document.activeElement) { 18476 return; 18477 } 18478 18479 if (typeof begin == 'number') { 18480 end = (typeof end === 'number') ? end : begin; 18481 return this.each(function() { 18482 if (this.setSelectionRange) { 18483 this.setSelectionRange(begin, end); 18484 } else if (this.createTextRange) { 18485 range = this.createTextRange(); 18486 range.collapse(true); 18487 range.moveEnd('character', end); 18488 range.moveStart('character', begin); 18489 range.select(); 18490 } 18491 }); 18492 } else { 18493 if (this[0].setSelectionRange) { 18494 begin = this[0].selectionStart; 18495 end = this[0].selectionEnd; 18496 } else if (document.selection && document.selection.createRange) { 18497 range = document.selection.createRange(); 18498 begin = 0 - range.duplicate().moveStart('character', -100000); 18499 end = begin + range.text.length; 18500 } 18501 return { begin: begin, end: end }; 18502 } 18503 }, 18504 unmask: function() { 18505 return this.trigger("unmask"); 18506 }, 18507 mask: function(mask, settings) { 18508 var input, 18509 defs, 18510 tests, 18511 partialPosition, 18512 firstNonMaskPos, 18513 lastRequiredNonMaskPos, 18514 len, 18515 oldVal; 18516 18517 if (!mask && this.length > 0) { 18518 input = $(this[0]); 18519 var fn = input.data($.mask.dataName)
18520 return fn?fn():undefined; 18521 } 18522 18523 settings = $.extend({ 18524 autoclear: $.mask.autoclear, 18525 placeholder: $.mask.placeholder, // Load default placeholder 18526 completed: null 18527 }, settings); 18528 18529 18530 defs = $.mask.definitions; 18531 tests = []; 18532 partialPosition = len = mask.length; 18533 firstNonMaskPos = null; 18534 18535 mask = String(mask); 18536 18537 $.each(mask.split(""), function(i, c) { 18538 if (c == '?') { 18539 len--; 18540 partialPosition = i; 18541 } else if (defs[c]) { 18542 tests.push(new RegExp(defs[c])); 18543 if (firstNonMaskPos === null) { 18544 firstNonMaskPos = tests.length - 1; 18545 } 18546 if(i < partialPosition){ 18547 lastRequiredNonMaskPos = tests.length - 1; 18548 } 18549 } else { 18550 tests.push(null); 18551 } 18552 }); 18553 18554 return this.trigger("unmask").each(function() { 18555 var input = $(this), 18556 buffer = $.map( 18557 mask.split(""), 18558 function(c, i) { 18559 if (c != '?') { 18560 return defs[c] ? getPlaceholder(i) : c; 18561 } 18562 }), 18563 defaultBuffer = buffer.join(''), 18564 focusText = input.val(); 18565 18566 function tryFireCompleted(){ 18567 if (!settings.completed) { 18568 return; 18569 } 18570 18571 for (var i = firstNonMaskPos; i <= lastRequiredNonMaskPos; i++) { 18572 if (tests[i] && buffer[i] === getPlaceholder(i)) { 18573 return; 18574 } 18575 } 18576 settings.completed.call(input); 18577 } 18578 18579 function getPlaceholder(i){ 18580 if(i < settings.placeholder.length) 18581 return settings.placeholder.charAt(i); 18582 return settings.placeholder.charAt(0);
18583 } 18584 18585 function seekNext(pos) { 18586 while (++pos < len && !tests[pos]); 18587 return pos; 18588 } 18589 18590 function seekPrev(pos) { 18591 while (--pos >= 0 && !tests[pos]); 18592 return pos; 18593 } 18594 18595 function shiftL(begin,end) { 18596 var i, 18597 j; 18598 18599 if (begin<0) { 18600 return; 18601 } 18602 18603 for (i = begin, j = seekNext(end); i < len; i++) { 18604 if (tests[i]) { 18605 if (j < len && tests[i].test(buffer[j])) { 18606 buffer[i] = buffer[j]; 18607 buffer[j] = getPlaceholder(j); 18608 } else { 18609 break; 18610 } 18611 18612 j = seekNext(j); 18613 } 18614 } 18615 writeBuffer(); 18616 input.caret(Math.max(firstNonMaskPos, begin)); 18617 } 18618 18619 function shiftR(pos) { 18620 var i, 18621 c, 18622 j, 18623 t; 18624 18625 for (i = pos, c = getPlaceholder(pos); i < len; i++) { 18626 if (tests[i]) { 18627 j = seekNext(i); 18628 t = buffer[i]; 18629 buffer[i] = c; 18630 if (j < len && tests[j].test(t)) { 18631 c = t; 18632 } else { 18633 break; 18634 } 18635 } 18636 } 18637 } 18638 18639 function androidInputEvent(e) { 18640 var curVal = input.val(); 18641 var pos = input.caret(); 18642 if (oldVal && oldVal.length && oldVal.length > curVal.length ) { 18643 // a deletion or backspace happened 18644 checkVal(true); 18645 while (pos.begin > 0 && !tests[pos.begin-1]) 18646 pos.begin--; 18647 if (pos.begin === 0) 18648 { 18649 while (pos.begin < firstNonMaskPos && !tests[pos.begin]) 18650 pos.begin++; 18651 } 18652 input.caret(pos.begin,pos.begin); 18653 } else { 18654 var pos2 = checkVal(true); 18655 var lastEnteredValue = curVal.charAt(pos.begin); 18656 if (pos.begin < len){ 18657 if(!tests[pos.begin]){ 18658 pos.begin++; 18659 if(tests[pos.begin].test(lastEnteredValue)){ 18660 pos.begin++; 18661 } 18662 }else{ 18663 if(tests[pos.begin].test(lastEnteredValue)){ 18664 pos.begin++; 18665 } 18666 } 18667 } 18668 input.caret(pos.begin,pos.begin); 18669 } 18670 tryFireCompleted(); 18671 } 18672 18673 18674 function blurEvent(e) { 18675 checkVal(); 18676 18677 if (input.val() != focusText) 18678 input.change(); 18679 } 18680 18681 function keydownEvent(e) { 18682 if (input.prop("readonly")){ 18683 return; 18684 } 18685 18686 var k = e.which || e.keyCode, 18687 pos, 18688 begin, 18689 end; 18690 oldVal = input.val(); 18691 //backspace, delete, and escape get special treatment 18692 if (k === 8 || k === 46 || (iPhone && k === 127)) { 18693 pos = input.caret(); 18694 begin = pos.begin; 18695 end = pos.end; 18696 18697 if (end - begin === 0) { 18698 begin=k!==46?seekPrev(begin):(end=seekNext(begin-1)); 18699 end=k===46?seekNext(end):end; 18700 } 18701 clearBuffer(begin, end); 18702 shiftL(begin, end - 1); 18703 18704 e.preventDefault(); 18705 } else if( k === 13 ) { // enter 18706 blurEvent.call(this, e); 18707 } else if (k === 27) { // escape 18708 input.val(focusText); 18709 input.caret(0, checkVal()); 18710 e.preventDefault(); 18711 } 18712 } 18713 18714 function keypressEvent(e) { 18715 if (input.prop("readonly")){ 18716 return; 18717 } 18718 18719 var k = e.which || e.keyCode, 18720 pos = input.caret(), 18721 p, 18722 c, 18723 next; 18724 18725 if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore 18726 return; 18727 } else if ( k && k !== 13 ) { 18728 if (pos.end - pos.begin !== 0){ 18729 clearBuffer(pos.begin, pos.end); 18730 shiftL(pos.begin, pos.end-1); 18731 } 18732 18733 p = seekNext(pos.begin - 1); 18734 if (p < len) { 18735 c = String.fromCharCode(k); 18736 if (tests[p].test(c)) { 18737 shiftR(p); 18738 18739 buffer[p] = c; 18740 writeBuffer(); 18741 next = seekNext(p); 18742 18743 if(android){ 18744 //Path for CSP Violation on FireFox OS 1.1 18745 var proxy = function() { 18746 $.proxy($.fn.caret,input,next)(); 18747 }; 18748 18749 setTimeout(proxy,0); 18750 }else{ 18751 input.caret(next); 18752 } 18753 if(pos.begin <= lastRequiredNonMaskPos){ 18754 tryFireCompleted(); 18755 } 18756 } 18757 } 18758 e.preventDefault(); 18759 } 18760 } 18761 18762 function clearBuffer(start, end) { 18763 var i; 18764 for (i = start; i < end && i < len; i++) { 18765 if (tests[i]) { 18766 buffer[i] = getPlaceholder(i); 18767 } 18768 } 18769 } 18770 18771 function writeBuffer() { input.val(buffer.join('')); } 18772 18773 function checkVal(allow) { 18774 //try to place characters where they belong 18775 var test = input.val(), 18776 lastMatch = -1, 18777 i, 18778 c, 18779 pos; 18780 18781 for (i = 0, pos = 0; i < len; i++) { 18782 if (tests[i]) { 18783 buffer[i] = getPlaceholder(i); 18784 while (pos++ < test.length) { 18785 c = test.charAt(pos - 1); 18786 if (tests[i].test(c)) { 18787 buffer[i] = c; 18788 lastMatch = i; 18789 break; 18790 } 18791 } 18792 if (pos > test.length) { 18793 clearBuffer(i + 1, len); 18794 break; 18795 } 18796 } else { 18797 if (buffer[i] === test.charAt(pos)) { 18798 pos++; 18799 } 18800 if( i < partialPosition){ 18801 lastMatch = i; 18802 } 18803 } 18804 } 18805 if (allow) { 18806 writeBuffer(); 18807 } else if (lastMatch + 1 < partialPosition) { 18808 if (settings.autoclear || buffer.join('') === defaultBuffer) { 18809 // Invalid value. Remove it and replace it with the 18810 // mask, which is the default behavior. 18811 if(input.val()) input.val(""); 18812 clearBuffer(0, len); 18813 } else { 18814 // Invalid value, but we opt to show the value to the 18815 // user and allow them to correct their mistake. 18816 writeBuffer(); 18817 } 18818 } else { 18819 writeBuffer(); 18820 input.val(input.val().substring(0, lastMatch + 1)); 18821 } 18822 return (partialPosition ? i : firstNonMaskPos);
18823 } 18824 18825 input.data($.mask.dataName,function(){ 18826 return $.map(buffer, function(c, i) { 18827 return tests[i]&&c!=getPlaceholder(i) ? c : null; 18828 }).join(''); 18829 }); 18830 18831 18832 input 18833 .one("unmask", function() { 18834 input 18835 .off(".mask") 18836 .removeData($.mask.dataName); 18837 }) 18838 .on("focus.mask", function() { 18839 if (input.prop("readonly")){ 18840 return; 18841 } 18842 18843 clearTimeout(caretTimeoutId); 18844 var pos; 18845 18846 focusText = input.val(); 18847 18848 pos = checkVal(); 18849 18850 caretTimeoutId = setTimeout(function(){ 18851 if(input.get(0) !== document.activeElement){ 18852 return; 18853 } 18854 writeBuffer(); 18855 if (pos == mask.replace("?","").length) { 18856 input.caret(0, pos); 18857 } else { 18858 input.caret(pos); 18859 } 18860 }, 10); 18861 }) 18862 .on("blur.mask", blurEvent) 18863 .on("keydown.mask", keydownEvent) 18864 .on("keypress.mask", keypressEvent) 18865 .on("input.mask paste.mask", function() { 18866 if (input.prop("readonly")){ 18867 return; 18868 } 18869 18870 setTimeout(function() { 18871 var pos=checkVal(true); 18872 input.caret(pos); 18873 tryFireCompleted(); 18874 }, 0); 18875 }); 18876 if (chrome && android) 18877 { 18878 input 18879 .off('input.mask') 18880 .on('input.mask', androidInputEvent); 18881 } 18882 checkVal(); //Perform initial check for existing values 18883 }); 18884 } 18885}); 18886})); 18887 18888// ÐмпоÑÑиÑÑем Owl 18889/** 18890 * Owl Carousel v2.3.4 18891 * Copyright 2013-2018 David Deutsch 18892 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 18893 */ 18894/** 18895 * Owl carousel 18896 * @version 2.3.4 18897 * @author Bartosz Wojciechowski 18898 * @author David Deutsch 18899 * @license The MIT License (MIT) 18900 * @todo Lazy Load Icon 18901 * @todo prevent animationend bubling 18902 * @todo itemsScaleUp 18903 * @todo Test Zepto 18904 * @todo stagePadding calculate wrong active classes 18905 */ 18906;(function($, window, document, undefined) { 18907 18908 /** 18909 * Creates a carousel. 18910 * @class The Owl Carousel. 18911 * @public 18912 * @param {HTMLElement|jQuery} element - The element to create the carousel for. 18913 * @param {Object} [options] - The options 18914 */ 18915 function Owl(element, options) { 18916 18917 /** 18918 * Current settings for the carousel. 18919 * @public 18920 */ 18921 this.settings = null; 18922 18923 /** 18924 * Current options set by the caller including defaults. 18925 * @public 18926 */ 18927 this.options = $.extend({}, Owl.Defaults, options); 18928 18929 /** 18930 * Plugin element. 18931 * @public 18932 */ 18933 this.$element = $(element); 18934 18935 /** 18936 * Proxied event handlers. 18937 * @protected 18938 */ 18939 this._handlers = {}; 18940 18941 /** 18942 * References to the running plugins of this carousel. 18943 * @protected 18944 */ 18945 this._plugins = {}; 18946 18947 /** 18948 * Currently suppressed events to prevent them from being retriggered. 18949 * @protected 18950 */ 18951 this._supress = {}; 18952 18953 /** 18954 * Absolute current position. 18955 * @protected 18956 */ 18957 this._current = null; 18958 18959 /** 18960 * Animation speed in milliseconds. 18961 * @protected 18962 */ 18963 this._speed = null; 18964 18965 /** 18966 * Coordinates of all items in pixel. 18967 * @todo The name of this member is missleading. 18968 * @protected 18969 */ 18970 this._coordinates = []; 18971 18972 /** 18973 * Current breakpoint. 18974 * @todo Real media queries would be nice. 18975 * @protected 18976 */ 18977 this._breakpoint = null; 18978 18979 /** 18980 * Current width of the plugin element. 18981 */ 18982 this._width = null; 18983 18984 /** 18985 * All real items. 18986 * @protected 18987 */ 18988 this._items = []; 18989 18990 /** 18991 * All cloned items. 18992 * @protected 18993 */ 18994 this._clones = []; 18995 18996 /** 18997 * Merge values of all items. 18998 * @todo Maybe this could be part of a plugin. 18999 * @protected 19000 */ 19001 this._mergers = []; 19002 19003 /** 19004 * Widths of all items. 19005 */ 19006 this._widths = []; 19007 19008 /** 19009 * Invalidated parts within the update process. 19010 * @protected 19011 */ 19012 this._invalidated = {}; 19013 19014 /** 19015 * Ordered list of workers for the update process. 19016 * @protected 19017 */ 19018 this._pipe = []; 19019 19020 /** 19021 * Current state information for the drag operation. 19022 * @todo #261 19023 * @protected 19024 */ 19025 this._drag = { 19026 time: null, 19027 target: null, 19028 pointer: null, 19029 stage: { 19030 start: null, 19031 current: null 19032 }, 19033 direction: null 19034 }; 19035 19036 /** 19037 * Current state information and their tags. 19038 * @type {Object} 19039 * @protected 19040 */ 19041 this._states = { 19042 current: {}, 19043 tags: { 19044 'initializing': [ 'busy' ], 19045 'animating': [ 'busy' ], 19046 'dragging': [ 'interacting' ] 19047 } 19048 }; 19049 19050 $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) { 19051 this._handlers[handler] = $.proxy(this[handler], this); 19052 }, this)); 19053 19054 $.each(Owl.Plugins, $.proxy(function(key, plugin) { 19055 this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] 19056 = new plugin(this); 19057 }, this)); 19058 19059 $.each(Owl.Workers, $.proxy(function(priority, worker) { 19060 this._pipe.push({ 19061 'filter': worker.filter, 19062 'run': $.proxy(worker.run, this) 19063 }); 19064 }, this)); 19065 19066 this.setup(); 19067 this.initialize(); 19068 } 19069 19070 /** 19071 * Default options for the carousel. 19072 * @public 19073 */ 19074 Owl.Defaults = { 19075 items: 3, 19076 loop: false, 19077 center: false, 19078 rewind: false, 19079 checkVisibility: true, 19080
vendor: 89,546 bytes, lines 19081-22332
19081 mouseDrag: true, 19082 touchDrag: true, 19083 pullDrag: true, 19084 freeDrag: false, 19085 19086 margin: 0, 19087 stagePadding: 0, 19088 19089 merge: false, 19090 mergeFit: true, 19091 autoWidth: false, 19092 19093 startPosition: 0, 19094 rtl: false, 19095 19096 smartSpeed: 250, 19097 fluidSpeed: false, 19098 dragEndSpeed: false, 19099 19100 responsive: {}, 19101 responsiveRefreshRate: 200, 19102 responsiveBaseElement: window, 19103 19104 fallbackEasing: 'swing', 19105 slideTransition: '', 19106 19107 info: false, 19108 19109 nestedItemSelector: false, 19110 itemElement: 'div', 19111 stageElement: 'div', 19112 19113 refreshClass: 'owl-refresh', 19114 loadedClass: 'owl-loaded', 19115 loadingClass: 'owl-loading', 19116 rtlClass: 'owl-rtl', 19117 responsiveClass: 'owl-responsive', 19118 dragClass: 'owl-drag', 19119 itemClass: 'owl-item', 19120 stageClass: 'owl-stage', 19121 stageOuterClass: 'owl-stage-outer', 19122 grabClass: 'owl-grab' 19123 }; 19124 19125 /** 19126 * Enumeration for width. 19127 * @public 19128 * @readonly 19129 * @enum {String} 19130 */ 19131 Owl.Width = { 19132 Default: 'default', 19133 Inner: 'inner', 19134 Outer: 'outer' 19135 }; 19136 19137 /** 19138 * Enumeration for types. 19139 * @public 19140 * @readonly 19141 * @enum {String} 19142 */ 19143 Owl.Type = { 19144 Event: 'event', 19145 State: 'state' 19146 }; 19147 19148 /** 19149 * Contains all registered plugins. 19150 * @public 19151 */ 19152 Owl.Plugins = {}; 19153 19154 /** 19155 * List of workers involved in the update process. 19156 */ 19157 Owl.Workers = [ { 19158 filter: [ 'width', 'settings' ], 19159 run: function() { 19160 this._width = this.$element.width(); 19161 } 19162 }, { 19163 filter: [ 'width', 'items', 'settings' ], 19164 run: function(cache) { 19165 cache.current = this._items && this._items[this.relative(this._current)]; 19166 } 19167 }, { 19168 filter: [ 'items', 'settings' ], 19169 run: function() { 19170 this.$stage.children('.cloned').remove(); 19171 } 19172 }, { 19173 filter: [ 'width', 'items', 'settings' ], 19174 run: function(cache) { 19175 var margin = this.settings.margin || '', 19176 grid = !this.settings.autoWidth, 19177 rtl = this.settings.rtl, 19178 css = { 19179 'width': 'auto', 19180 'margin-left': rtl ? margin : '', 19181 'margin-right': rtl ? '' : margin 19182 }; 19183 19184 !grid && this.$stage.children().css(css); 19185 19186 cache.css = css; 19187 } 19188 }, { 19189 filter: [ 'width', 'items', 'settings' ], 19190 run: function(cache) { 19191 var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, 19192 merge = null, 19193 iterator = this._items.length, 19194 grid = !this.settings.autoWidth, 19195 widths = []; 19196 19197 cache.items = { 19198 merge: false, 19199 width: width 19200 }; 19201 19202 while (iterator--) { 19203 merge = this._mergers[iterator]; 19204 merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge; 19205 19206 cache.items.merge = merge > 1 || cache.items.merge; 19207 19208 widths[iterator] = !grid ? this._items[iterator].width() : width * merge; 19209 } 19210 19211 this._widths = widths; 19212 } 19213 }, { 19214 filter: [ 'items', 'settings' ], 19215 run: function() { 19216 var clones = [], 19217 items = this._items, 19218 settings = this.settings, 19219 // TODO: Should be computed from number of min width items in stage 19220 view = Math.max(settings.items * 2, 4), 19221 size = Math.ceil(items.length / 2) * 2, 19222 repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0, 19223 append = '', 19224 prepend = ''; 19225 19226 repeat /= 2; 19227 19228 while (repeat > 0) { 19229 // Switch to only using appended clones 19230 clones.push(this.normalize(clones.length / 2, true)); 19231 append = append + items[clones[clones.length - 1]][0].outerHTML; 19232 clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); 19233 prepend = items[clones[clones.length - 1]][0].outerHTML + prepend; 19234 repeat -= 1; 19235 } 19236 19237 this._clones = clones; 19238 19239 $(append).addClass('cloned').appendTo(this.$stage); 19240 $(prepend).addClass('cloned').prependTo(this.$stage); 19241 } 19242 }, { 19243 filter: [ 'width', 'items', 'settings' ], 19244 run: function() { 19245 var rtl = this.settings.rtl ? 1 : -1, 19246 size = this._clones.length + this._items.length, 19247 iterator = -1, 19248 previous = 0, 19249 current = 0, 19250 coordinates = []; 19251 19252 while (++iterator < size) { 19253 previous = coordinates[iterator - 1] || 0; 19254 current = this._widths[this.relative(iterator)] + this.settings.margin; 19255 coordinates.push(previous + current * rtl); 19256 } 19257 19258 this._coordinates = coordinates; 19259 } 19260 }, { 19261 filter: [ 'width', 'items', 'settings' ], 19262 run: function() { 19263 var padding = this.settings.stagePadding, 19264 coordinates = this._coordinates, 19265 css = { 19266 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 19267 'padding-left': padding || '', 19268 'padding-right': padding || '' 19269 }; 19270 19271 this.$stage.css(css); 19272 } 19273 }, { 19274 filter: [ 'width', 'items', 'settings' ], 19275 run: function(cache) { 19276 var iterator = this._coordinates.length, 19277 grid = !this.settings.autoWidth, 19278 items = this.$stage.children(); 19279 19280 if (grid && cache.items.merge) { 19281 while (iterator--) { 19282 cache.css.width = this._widths[this.relative(iterator)]; 19283 items.eq(iterator).css(cache.css); 19284 } 19285 } else if (grid) { 19286 cache.css.width = cache.items.width; 19287 items.css(cache.css); 19288 } 19289 } 19290 }, { 19291 filter: [ 'items' ], 19292 run: function() { 19293 this._coordinates.length < 1 && this.$stage.removeAttr('style'); 19294 } 19295 }, { 19296 filter: [ 'width', 'items', 'settings' ], 19297 run: function(cache) { 19298 cache.current = cache.current ? this.$stage.children().index(cache.current) : 0; 19299 cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); 19300 this.reset(cache.current); 19301 } 19302 }, { 19303 filter: [ 'position' ], 19304 run: function() { 19305 this.animate(this.coordinates(this._current)); 19306 } 19307 }, { 19308 filter: [ 'width', 'position', 'items', 'settings' ], 19309 run: function() { 19310 var rtl = this.settings.rtl ? 1 : -1, 19311 padding = this.settings.stagePadding * 2, 19312 begin = this.coordinates(this.current()) + padding, 19313 end = begin + this.width() * rtl, 19314 inner, outer, matches = [], i, n; 19315 19316 for (i = 0, n = this._coordinates.length; i < n; i++) { 19317 inner = this._coordinates[i - 1] || 0; 19318 outer = Math.abs(this._coordinates[i]) + padding * rtl; 19319 19320 if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end))) 19321 || (this.op(outer, '<', begin) && this.op(outer, '>', end))) { 19322 matches.push(i); 19323 } 19324 } 19325 19326 this.$stage.children('.active').removeClass('active'); 19327 this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); 19328 19329 this.$stage.children('.center').removeClass('center'); 19330 if (this.settings.center) { 19331 this.$stage.children().eq(this.current()).addClass('center'); 19332 } 19333 } 19334 } ]; 19335 19336 /** 19337 * Create the stage DOM element 19338 */ 19339 Owl.prototype.initializeStage = function() { 19340 this.$stage = this.$element.find('.' + this.settings.stageClass); 19341 19342 // if the stage is already in the DOM, grab it and skip stage initialization 19343 if (this.$stage.length) { 19344 return; 19345 } 19346 19347 this.$element.addClass(this.options.loadingClass); 19348 19349 // create stage 19350 this.$stage = $('<' + this.settings.stageElement + '>', { 19351 "class": this.settings.stageClass 19352 }).wrap( $( '<div/>', { 19353 "class": this.settings.stageOuterClass 19354 })); 19355 19356 // append stage 19357 this.$element.append(this.$stage.parent()); 19358 }; 19359 19360 /** 19361 * Create item DOM elements 19362 */ 19363 Owl.prototype.initializeItems = function() { 19364 var $items = this.$element.find('.owl-item'); 19365 19366 // if the items are already in the DOM, grab them and skip item initialization 19367 if ($items.length) { 19368 this._items = $items.get().map(function(item) { 19369 return $(item); 19370 }); 19371 19372 this._mergers = this._items.map(function() { 19373 return 1; 19374 }); 19375 19376 this.refresh(); 19377 19378 return; 19379 } 19380 19381 // append content 19382 this.replace(this.$element.children().not(this.$stage.parent())); 19383 19384 // check visibility 19385 if (this.isVisible()) { 19386 // update view 19387 this.refresh(); 19388 } else { 19389 // invalidate width 19390 this.invalidate('width'); 19391 } 19392 19393 this.$element 19394 .removeClass(this.options.loadingClass) 19395 .addClass(this.options.loadedClass); 19396 }; 19397 19398 /** 19399 * Initializes the carousel. 19400 * @protected 19401 */ 19402 Owl.prototype.initialize = function() { 19403 this.enter('initializing'); 19404 this.trigger('initialize'); 19405 19406 this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); 19407 19408 if (this.settings.autoWidth && !this.is('pre-loading')) { 19409 var imgs, nestedSelector, width; 19410 imgs = this.$element.find('img'); 19411 nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; 19412 width = this.$element.children(nestedSelector).width(); 19413 19414 if (imgs.length && width <= 0) { 19415 this.preloadAutoWidthImages(imgs); 19416 } 19417 } 19418 19419 this.initializeStage(); 19420 this.initializeItems(); 19421 19422 // register event handlers 19423 this.registerEventHandlers(); 19424 19425 this.leave('initializing'); 19426 this.trigger('initialized'); 19427 }; 19428 19429 /** 19430 * @returns {Boolean} visibility of $element 19431 * if you know the carousel will always be visible you can set `checkVisibility` to `false` to 19432 * prevent the expensive browser layout forced reflow the $element.is(':visible') does 19433 */ 19434 Owl.prototype.isVisible = function() { 19435 return this.settings.checkVisibility 19436 ? this.$element.is(':visible') 19437 : true; 19438 }; 19439 19440 /** 19441 * Setups the current settings. 19442 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8? 19443 * @todo Support for media queries by using `matchMedia` would be nice. 19444 * @public 19445 */ 19446 Owl.prototype.setup = function() { 19447 var viewport = this.viewport(), 19448 overwrites = this.options.responsive, 19449 match = -1, 19450 settings = null; 19451 19452 if (!overwrites) { 19453 settings = $.extend({}, this.options); 19454 } else { 19455 $.each(overwrites, function(breakpoint) { 19456 if (breakpoint <= viewport && breakpoint > match) { 19457 match = Number(breakpoint); 19458 } 19459 }); 19460 19461 settings = $.extend({}, this.options, overwrites[match]); 19462 if (typeof settings.stagePadding === 'function') { 19463 settings.stagePadding = settings.stagePadding(); 19464 } 19465 delete settings.responsive; 19466 19467 // responsive class 19468 if (settings.responsiveClass) { 19469 this.$element.attr('class', 19470 this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match) 19471 ); 19472 } 19473 } 19474 19475 this.trigger('change', { property: { name: 'settings', value: settings } }); 19476 this._breakpoint = match; 19477 this.settings = settings; 19478 this.invalidate('settings'); 19479 this.trigger('changed', { property: { name: 'settings', value: this.settings } }); 19480 }; 19481 19482 /** 19483 * Updates option logic if necessery. 19484 * @protected 19485 */ 19486 Owl.prototype.optionsLogic = function() { 19487 if (this.settings.autoWidth) { 19488 this.settings.stagePadding = false; 19489 this.settings.merge = false; 19490 } 19491 }; 19492 19493 /** 19494 * Prepares an item before add. 19495 * @todo Rename event parameter `content` to `item`. 19496 * @protected 19497 * @returns {jQuery|HTMLElement} - The item container. 19498 */ 19499 Owl.prototype.prepare = function(item) { 19500 var event = this.trigger('prepare', { content: item }); 19501 19502 if (!event.data) { 19503 event.data = $('<' + this.settings.itemElement + '/>') 19504 .addClass(this.options.itemClass).append(item) 19505 } 19506 19507 this.trigger('prepared', { content: event.data }); 19508 19509 return event.data; 19510 }; 19511 19512 /** 19513 * Updates the view. 19514 * @public 19515 */ 19516 Owl.prototype.update = function() { 19517 var i = 0, 19518 n = this._pipe.length, 19519 filter = $.proxy(function(p) { return this[p] }, this._invalidated), 19520 cache = {}; 19521 19522 while (i < n) { 19523 if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { 19524 this._pipe[i].run(cache); 19525 } 19526 i++; 19527 } 19528 19529 this._invalidated = {}; 19530 19531 !this.is('valid') && this.enter('valid'); 19532 }; 19533 19534 /** 19535 * Gets the width of the view. 19536 * @public 19537 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return. 19538 * @returns {Number} - The width of the view in pixel. 19539 */ 19540 Owl.prototype.width = function(dimension) { 19541 dimension = dimension || Owl.Width.Default; 19542 switch (dimension) { 19543 case Owl.Width.Inner: 19544 case Owl.Width.Outer: 19545 return this._width; 19546 default: 19547 return this._width - this.settings.stagePadding * 2 + this.settings.margin; 19548 } 19549 }; 19550 19551 /** 19552 * Refreshes the carousel primarily for adaptive purposes. 19553 * @public 19554 */ 19555 Owl.prototype.refresh = function() { 19556 this.enter('refreshing'); 19557 this.trigger('refresh'); 19558 19559 this.setup(); 19560 19561 this.optionsLogic(); 19562 19563 this.$element.addClass(this.options.refreshClass); 19564 19565 this.update(); 19566 19567 this.$element.removeClass(this.options.refreshClass); 19568 19569 this.leave('refreshing'); 19570 this.trigger('refreshed'); 19571 }; 19572 19573 /** 19574 * Checks window `resize` event. 19575 * @protected 19576 */ 19577 Owl.prototype.onThrottledResize = function() { 19578 window.clearTimeout(this.resizeTimer); 19579 this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); 19580 }; 19581 19582 /** 19583 * Checks window `resize` event. 19584 * @protected 19585 */ 19586 Owl.prototype.onResize = function() { 19587 if (!this._items.length) { 19588 return false; 19589 } 19590 19591 if (this._width === this.$element.width()) { 19592 return false; 19593 } 19594 19595 if (!this.isVisible()) { 19596 return false; 19597 } 19598 19599 this.enter('resizing'); 19600 19601 if (this.trigger('resize').isDefaultPrevented()) { 19602 this.leave('resizing'); 19603 return false; 19604 } 19605 19606 this.invalidate('width'); 19607 19608 this.refresh(); 19609 19610 this.leave('resizing'); 19611 this.trigger('resized'); 19612 }; 19613 19614 /** 19615 * Registers event handlers. 19616 * @todo Check `msPointerEnabled` 19617 * @todo #261 19618 * @protected 19619 */ 19620 Owl.prototype.registerEventHandlers = function() { 19621 if ($.support.transition) { 19622 this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); 19623 } 19624 19625 if (this.settings.responsive !== false) { 19626 this.on(window, 'resize', this._handlers.onThrottledResize); 19627 } 19628 19629 if (this.settings.mouseDrag) { 19630 this.$element.addClass(this.options.dragClass); 19631 this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); 19632 this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false }); 19633 } 19634 19635 if (this.settings.touchDrag){ 19636 this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); 19637 this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); 19638 } 19639 }; 19640 19641 /** 19642 * Handles `touchstart` and `mousedown` events. 19643 * @todo Horizontal swipe threshold as option 19644 * @todo #261 19645 * @protected 19646 * @param {Event} event - The event arguments. 19647 */ 19648 Owl.prototype.onDragStart = function(event) { 19649 var stage = null; 19650 19651 if (event.which === 3) { 19652 return; 19653 } 19654 19655 if ($.support.transform) { 19656 stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); 19657 stage = { 19658 x: stage[stage.length === 16 ? 12 : 4], 19659 y: stage[stage.length === 16 ? 13 : 5] 19660 }; 19661 } else { 19662 stage = this.$stage.position(); 19663 stage = { 19664 x: this.settings.rtl ? 19665 stage.left + this.$stage.width() - this.width() + this.settings.margin : 19666 stage.left, 19667 y: stage.top 19668 }; 19669 } 19670 19671 if (this.is('animating')) { 19672 $.support.transform ? this.animate(stage.x) : this.$stage.stop() 19673 this.invalidate('position'); 19674 } 19675 19676 this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown'); 19677 19678 this.speed(0); 19679 19680 this._drag.time = new Date().getTime(); 19681 this._drag.target = $(event.target); 19682 this._drag.stage.start = stage; 19683 this._drag.stage.current = stage; 19684 this._drag.pointer = this.pointer(event); 19685 19686 $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); 19687 19688 $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) { 19689 var delta = this.difference(this._drag.pointer, this.pointer(event)); 19690 19691 $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); 19692 19693 if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) { 19694 return; 19695 } 19696 19697 event.preventDefault(); 19698 19699 this.enter('dragging'); 19700 this.trigger('drag'); 19701 }, this)); 19702 }; 19703 19704 /** 19705 * Handles the `touchmove` and `mousemove` events. 19706 * @todo #261 19707 * @protected 19708 * @param {Event} event - The event arguments. 19709 */ 19710 Owl.prototype.onDragMove = function(event) { 19711 var minimum = null, 19712 maximum = null, 19713 pull = null, 19714 delta = this.difference(this._drag.pointer, this.pointer(event)), 19715 stage = this.difference(this._drag.stage.start, delta); 19716 19717 if (!this.is('dragging')) { 19718 return; 19719 } 19720 19721 event.preventDefault(); 19722 19723 if (this.settings.loop) { 19724 minimum = this.coordinates(this.minimum()); 19725 maximum = this.coordinates(this.maximum() + 1) - minimum; 19726 stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum; 19727 } else { 19728 minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); 19729 maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); 19730 pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0; 19731 stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull); 19732 } 19733 19734 this._drag.stage.current = stage; 19735 19736 this.animate(stage.x); 19737 }; 19738 19739 /** 19740 * Handles the `touchend` and `mouseup` events. 19741 * @todo #261 19742 * @todo Threshold for click event 19743 * @protected 19744 * @param {Event} event - The event arguments. 19745 */ 19746 Owl.prototype.onDragEnd = function(event) { 19747 var delta = this.difference(this._drag.pointer, this.pointer(event)), 19748 stage = this._drag.stage.current, 19749 direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right'; 19750 19751 $(document).off('.owl.core'); 19752 19753 this.$element.removeClass(this.options.grabClass); 19754 19755 if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) { 19756 this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); 19757 this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction)); 19758 this.invalidate('position'); 19759 this.update(); 19760 19761 this._drag.direction = direction; 19762 19763 if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) { 19764 this._drag.target.one('click.owl.core', function() { return false; }); 19765 } 19766 } 19767 19768 if (!this.is('dragging')) { 19769 return; 19770 } 19771 19772 this.leave('dragging'); 19773 this.trigger('dragged'); 19774 }; 19775 19776 /** 19777 * Gets absolute position of the closest item for a coordinate. 19778 * @todo Setting `freeDrag` makes `closest` not reusable. See #165. 19779 * @protected 19780 * @param {Number} coordinate - The coordinate in pixel. 19781 * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`. 19782 * @return {Number} - The absolute position of the closest item. 19783 */ 19784 Owl.prototype.closest = function(coordinate, direction) { 19785 var position = -1, 19786 pull = 30, 19787 width = this.width(), 19788 coordinates = this.coordinates(); 19789 19790 if (!this.settings.freeDrag) { 19791 // check closest item 19792 $.each(coordinates, $.proxy(function(index, value) { 19793 // on a left pull, check on current index 19794 if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) { 19795 position = index; 19796 // on a right pull, check on previous index 19797 // to do so, subtract width from value and set position = index + 1 19798 } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) { 19799 position = index + 1; 19800 } else if (this.op(coordinate, '<', value) 19801 && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) { 19802 position = direction === 'left' ? index + 1 : index; 19803 } 19804 return position === -1; 19805 }, this)); 19806 } 19807 19808 if (!this.settings.loop) { 19809 // non loop boundries 19810 if (this.op(coordinate, '>', coordinates[this.minimum()])) { 19811 position = coordinate = this.minimum(); 19812 } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { 19813 position = coordinate = this.maximum(); 19814 } 19815 } 19816 19817 return position; 19818 }; 19819 19820 /** 19821 * Animates the stage. 19822 * @todo #270 19823 * @public 19824 * @param {Number} coordinate - The coordinate in pixels. 19825 */ 19826 Owl.prototype.animate = function(coordinate) { 19827 var animate = this.speed() > 0; 19828 19829 this.is('animating') && this.onTransitionEnd(); 19830 19831 if (animate) { 19832 this.enter('animating'); 19833 this.trigger('translate'); 19834 } 19835 19836 if ($.support.transform3d && $.support.transition) { 19837 this.$stage.css({ 19838 transform: 'translate3d(' + coordinate + 'px,0px,0px)', 19839 transition: (this.speed() / 1000) + 's' + ( 19840 this.settings.slideTransition ? ' ' + this.settings.slideTransition : '' 19841 ) 19842 }); 19843 } else if (animate) { 19844 this.$stage.animate({ 19845 left: coordinate + 'px' 19846 }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); 19847 } else { 19848 this.$stage.css({ 19849 left: coordinate + 'px' 19850 }); 19851 } 19852 }; 19853 19854 /** 19855 * Checks whether the carousel is in a specific state or not. 19856 * @param {String} state - The state to check. 19857 * @returns {Boolean} - The flag which indicates if the carousel is busy. 19858 */ 19859 Owl.prototype.is = function(state) { 19860 return this._states.current[state] && this._states.current[state] > 0; 19861 }; 19862 19863 /** 19864 * Sets the absolute position of the current item. 19865 * @public 19866 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged. 19867 * @returns {Number} - The absolute position of the current item. 19868 */ 19869 Owl.prototype.current = function(position) { 19870 if (position === undefined) { 19871 return this._current; 19872 } 19873 19874 if (this._items.length === 0) { 19875 return undefined; 19876 } 19877 19878 position = this.normalize(position); 19879 19880 if (this._current !== position) { 19881 var event = this.trigger('change', { property: { name: 'position', value: position } }); 19882 19883 if (event.data !== undefined) { 19884 position = this.normalize(event.data); 19885 } 19886 19887 this._current = position; 19888 19889 this.invalidate('position'); 19890 19891 this.trigger('changed', { property: { name: 'position', value: this._current } }); 19892 } 19893 19894 return this._current; 19895 }; 19896 19897 /** 19898 * Invalidates the given part of the update routine. 19899 * @param {String} [part] - The part to invalidate. 19900 * @returns {Array.<String>} - The invalidated parts. 19901 */ 19902 Owl.prototype.invalidate = function(part) { 19903 if ($.type(part) === 'string') { 19904 this._invalidated[part] = true; 19905 this.is('valid') && this.leave('valid'); 19906 } 19907 return $.map(this._invalidated, function(v, i) { return i }); 19908 }; 19909 19910 /** 19911 * Resets the absolute position of the current item. 19912 * @public 19913 * @param {Number} position - The absolute position of the new item. 19914 */ 19915 Owl.prototype.reset = function(position) { 19916 position = this.normalize(position); 19917 19918 if (position === undefined) { 19919 return; 19920 } 19921 19922 this._speed = 0; 19923 this._current = position; 19924 19925 this.suppress([ 'translate', 'translated' ]); 19926 19927 this.animate(this.coordinates(position)); 19928 19929 this.release([ 'translate', 'translated' ]); 19930 }; 19931 19932 /** 19933 * Normalizes an absolute or a relative position of an item. 19934 * @public 19935 * @param {Number} position - The absolute or relative position to normalize. 19936 * @param {Boolean} [relative=false] - Whether the given position is relative or not. 19937 * @returns {Number} - The normalized position. 19938 */ 19939 Owl.prototype.normalize = function(position, relative) { 19940 var n = this._items.length, 19941 m = relative ? 0 : this._clones.length; 19942 19943 if (!this.isNumeric(position) || n < 1) { 19944 position = undefined; 19945 } else if (position < 0 || position >= n + m) { 19946 position = ((position - m / 2) % n + n) % n + m / 2; 19947 } 19948 19949 return position; 19950 }; 19951 19952 /** 19953 * Converts an absolute position of an item into a relative one. 19954 * @public 19955 * @param {Number} position - The absolute position to convert. 19956 * @returns {Number} - The converted position. 19957 */ 19958 Owl.prototype.relative = function(position) { 19959 position -= this._clones.length / 2; 19960 return this.normalize(position, true); 19961 }; 19962 19963 /** 19964 * Gets the maximum position for the current item. 19965 * @public 19966 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 19967 * @returns {Number} 19968 */ 19969 Owl.prototype.maximum = function(relative) { 19970 var settings = this.settings, 19971 maximum = this._coordinates.length, 19972 iterator, 19973 reciprocalItemsWidth, 19974 elementWidth; 19975 19976 if (settings.loop) { 19977 maximum = this._clones.length / 2 + this._items.length - 1; 19978 } else if (settings.autoWidth || settings.merge) { 19979 iterator = this._items.length; 19980 if (iterator) { 19981 reciprocalItemsWidth = this._items[--iterator].width(); 19982 elementWidth = this.$element.width(); 19983 while (iterator--) { 19984 reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin; 19985 if (reciprocalItemsWidth > elementWidth) { 19986 break; 19987 } 19988 } 19989 } 19990 maximum = iterator + 1; 19991 } else if (settings.center) { 19992 maximum = this._items.length - 1; 19993 } else { 19994 maximum = this._items.length - settings.items; 19995 } 19996 19997 if (relative) { 19998 maximum -= this._clones.length / 2; 19999 } 20000 20001 return Math.max(maximum, 0); 20002 }; 20003 20004 /** 20005 * Gets the minimum position for the current item. 20006 * @public 20007 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 20008 * @returns {Number} 20009 */ 20010 Owl.prototype.minimum = function(relative) { 20011 return relative ? 0 : this._clones.length / 2; 20012 }; 20013 20014 /** 20015 * Gets an item at the specified relative position. 20016 * @public 20017 * @param {Number} [position] - The relative position of the item. 20018 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 20019 */ 20020 Owl.prototype.items = function(position) { 20021 if (position === undefined) { 20022 return this._items.slice(); 20023 } 20024 20025 position = this.normalize(position, true); 20026 return this._items[position]; 20027 }; 20028 20029 /** 20030 * Gets an item at the specified relative position. 20031 * @public 20032 * @param {Number} [position] - The relative position of the item. 20033 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 20034 */ 20035 Owl.prototype.mergers = function(position) { 20036 if (position === undefined) { 20037 return this._mergers.slice(); 20038 } 20039 20040 position = this.normalize(position, true); 20041 return this._mergers[position]; 20042 }; 20043 20044 /** 20045 * Gets the absolute positions of clones for an item. 20046 * @public 20047 * @param {Number} [position] - The relative position of the item. 20048 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given. 20049 */ 20050 Owl.prototype.clones = function(position) { 20051 var odd = this._clones.length / 2, 20052 even = odd + this._items.length, 20053 map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 }; 20054 20055 if (position === undefined) { 20056 return $.map(this._clones, function(v, i) { return map(i) }); 20057 } 20058 20059 return $.map(this._clones, function(v, i) { return v === position ? map(i) : null }); 20060 }; 20061 20062 /** 20063 * Sets the current animation speed. 20064 * @public 20065 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged. 20066 * @returns {Number} - The current animation speed in milliseconds. 20067 */ 20068 Owl.prototype.speed = function(speed) { 20069 if (speed !== undefined) { 20070 this._speed = speed; 20071 } 20072 20073 return this._speed; 20074 }; 20075 20076 /** 20077 * Gets the coordinate of an item. 20078 * @todo The name of this method is missleanding. 20079 * @public 20080 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`. 20081 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates. 20082 */ 20083 Owl.prototype.coordinates = function(position) { 20084 var multiplier = 1, 20085 newPosition = position - 1, 20086 coordinate; 20087 20088 if (position === undefined) { 20089 return $.map(this._coordinates, $.proxy(function(coordinate, index) { 20090 return this.coordinates(index); 20091 }, this)); 20092 } 20093 20094 if (this.settings.center) { 20095 if (this.settings.rtl) { 20096 multiplier = -1; 20097 newPosition = position + 1; 20098 } 20099 20100 coordinate = this._coordinates[position]; 20101 coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier; 20102 } else { 20103 coordinate = this._coordinates[newPosition] || 0; 20104 } 20105 20106 coordinate = Math.ceil(coordinate); 20107 20108 return coordinate; 20109 }; 20110 20111 /** 20112 * Calculates the speed for a translation. 20113 * @protected 20114 * @param {Number} from - The absolute position of the start item. 20115 * @param {Number} to - The absolute position of the target item. 20116 * @param {Number} [factor=undefined] - The time factor in milliseconds. 20117 * @returns {Number} - The time in milliseconds for the translation. 20118 */ 20119 Owl.prototype.duration = function(from, to, factor) { 20120 if (factor === 0) { 20121 return 0; 20122 } 20123 20124 return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed)); 20125 }; 20126 20127 /** 20128 * Slides to the specified item. 20129 * @public 20130 * @param {Number} position - The position of the item. 20131 * @param {Number} [speed] - The time in milliseconds for the transition. 20132 */ 20133 Owl.prototype.to = function(position, speed) { 20134 var current = this.current(), 20135 revert = null, 20136 distance = position - this.relative(current), 20137 direction = (distance > 0) - (distance < 0), 20138 items = this._items.length, 20139 minimum = this.minimum(), 20140 maximum = this.maximum(); 20141 20142 if (this.settings.loop) { 20143 if (!this.settings.rewind && Math.abs(distance) > items / 2) { 20144 distance += direction * -1 * items; 20145 } 20146 20147 position = current + distance; 20148 revert = ((position - minimum) % items + items) % items + minimum; 20149 20150 if (revert !== position && revert - distance <= maximum && revert - distance > 0) { 20151 current = revert - distance; 20152 position = revert; 20153 this.reset(current); 20154 } 20155 } else if (this.settings.rewind) { 20156 maximum += 1; 20157 position = (position % maximum + maximum) % maximum; 20158 } else { 20159 position = Math.max(minimum, Math.min(maximum, position)); 20160 } 20161 20162 this.speed(this.duration(current, position, speed)); 20163 this.current(position); 20164 20165 if (this.isVisible()) { 20166 this.update(); 20167 } 20168 }; 20169 20170 /** 20171 * Slides to the next item. 20172 * @public 20173 * @param {Number} [speed] - The time in milliseconds for the transition. 20174 */ 20175 Owl.prototype.next = function(speed) { 20176 speed = speed || false; 20177 this.to(this.relative(this.current()) + 1, speed); 20178 }; 20179 20180 /** 20181 * Slides to the previous item. 20182 * @public 20183 * @param {Number} [speed] - The time in milliseconds for the transition. 20184 */ 20185 Owl.prototype.prev = function(speed) { 20186 speed = speed || false; 20187 this.to(this.relative(this.current()) - 1, speed); 20188 }; 20189 20190 /** 20191 * Handles the end of an animation. 20192 * @protected 20193 * @param {Event} event - The event arguments. 20194 */ 20195 Owl.prototype.onTransitionEnd = function(event) { 20196 20197 // if css2 animation then event object is undefined 20198 if (event !== undefined) { 20199 event.stopPropagation(); 20200 20201 // Catch only owl-stage transitionEnd event 20202 if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { 20203 return false; 20204 } 20205 } 20206 20207 this.leave('animating'); 20208 this.trigger('translated'); 20209 }; 20210 20211 /** 20212 * Gets viewport width. 20213 * @protected 20214 * @return {Number} - The width in pixel. 20215 */ 20216 Owl.prototype.viewport = function() { 20217 var width; 20218 if (this.options.responsiveBaseElement !== window) { 20219 width = $(this.options.responsiveBaseElement).width(); 20220 } else if (window.innerWidth) { 20221 width = window.innerWidth; 20222 } else if (document.documentElement && document.documentElement.clientWidth) { 20223 width = document.documentElement.clientWidth; 20224 } else { 20225 console.warn('Can not detect viewport width.'); 20226 } 20227 return width; 20228 }; 20229 20230 /** 20231 * Replaces the current content. 20232 * @public 20233 * @param {HTMLElement|jQuery|String} content - The new content. 20234 */ 20235 Owl.prototype.replace = function(content) { 20236 this.$stage.empty(); 20237 this._items = []; 20238 20239 if (content) { 20240 content = (content instanceof jQuery) ? content : $(content); 20241 } 20242 20243 if (this.settings.nestedItemSelector) { 20244 content = content.find('.' + this.settings.nestedItemSelector); 20245 } 20246 20247 content.filter(function() { 20248 return this.nodeType === 1; 20249 }).each($.proxy(function(index, item) { 20250 item = this.prepare(item); 20251 this.$stage.append(item); 20252 this._items.push(item); 20253 this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 20254 }, this)); 20255 20256 this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); 20257 20258 this.invalidate('items'); 20259 }; 20260 20261 /** 20262 * Adds an item. 20263 * @todo Use `item` instead of `content` for the event arguments. 20264 * @public 20265 * @param {HTMLElement|jQuery|String} content - The item content to add. 20266 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end. 20267 */ 20268 Owl.prototype.add = function(content, position) { 20269 var current = this.relative(this._current); 20270 20271 position = position === undefined ? this._items.length : this.normalize(position, true); 20272 content = content instanceof jQuery ? content : $(content); 20273 20274 this.trigger('add', { content: content, position: position }); 20275 20276 content = this.prepare(content); 20277 20278 if (this._items.length === 0 || position === this._items.length) { 20279 this._items.length === 0 && this.$stage.append(content); 20280 this._items.length !== 0 && this._items[position - 1].after(content); 20281 this._items.push(content); 20282 this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 20283 } else { 20284 this._items[position].before(content); 20285 this._items.splice(position, 0, content); 20286 this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 20287 } 20288 20289 this._items[current] && this.reset(this._items[current].index()); 20290 20291 this.invalidate('items'); 20292 20293 this.trigger('added', { content: content, position: position }); 20294 }; 20295 20296 /** 20297 * Removes an item by its position. 20298 * @todo Use `item` instead of `content` for the event arguments. 20299 * @public 20300 * @param {Number} position - The relative position of the item to remove. 20301 */ 20302 Owl.prototype.remove = function(position) { 20303 position = this.normalize(position, true); 20304 20305 if (position === undefined) { 20306 return; 20307 } 20308 20309 this.trigger('remove', { content: this._items[position], position: position }); 20310 20311 this._items[position].remove(); 20312 this._items.splice(position, 1); 20313 this._mergers.splice(position, 1); 20314 20315 this.invalidate('items'); 20316 20317 this.trigger('removed', { content: null, position: position }); 20318 }; 20319 20320 /** 20321 * Preloads images with auto width. 20322 * @todo Replace by a more generic approach 20323 * @protected 20324 */ 20325 Owl.prototype.preloadAutoWidthImages = function(images) { 20326 images.each($.proxy(function(i, element) { 20327 this.enter('pre-loading'); 20328 element = $(element); 20329 $(new Image()).one('load', $.proxy(function(e) { 20330 element.attr('src', e.target.src); 20331 element.css('opacity', 1); 20332 this.leave('pre-loading'); 20333 !this.is('pre-loading') && !this.is('initializing') && this.refresh(); 20334 }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina')); 20335 }, this)); 20336 }; 20337 20338 /** 20339 * Destroys the carousel. 20340 * @public 20341 */ 20342 Owl.prototype.destroy = function() { 20343 20344 this.$element.off('.owl.core'); 20345 this.$stage.off('.owl.core'); 20346 $(document).off('.owl.core'); 20347 20348 if (this.settings.responsive !== false) { 20349 window.clearTimeout(this.resizeTimer); 20350 this.off(window, 'resize', this._handlers.onThrottledResize); 20351 } 20352 20353 for (var i in this._plugins) { 20354 this._plugins[i].destroy(); 20355 } 20356 20357 this.$stage.children('.cloned').remove(); 20358 20359 this.$stage.unwrap(); 20360 this.$stage.children().contents().unwrap(); 20361 this.$stage.children().unwrap(); 20362 this.$stage.remove(); 20363 this.$element 20364 .removeClass(this.options.refreshClass) 20365 .removeClass(this.options.loadingClass) 20366 .removeClass(this.options.loadedClass) 20367 .removeClass(this.options.rtlClass) 20368 .removeClass(this.options.dragClass) 20369 .removeClass(this.options.grabClass) 20370 .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), '')) 20371 .removeData('owl.carousel'); 20372 }; 20373 20374 /** 20375 * Operators to calculate right-to-left and left-to-right. 20376 * @protected 20377 * @param {Number} [a] - The left side operand. 20378 * @param {String} [o] - The operator. 20379 * @param {Number} [b] - The right side operand. 20380 */ 20381 Owl.prototype.op = function(a, o, b) { 20382 var rtl = this.settings.rtl; 20383 switch (o) { 20384 case '<': 20385 return rtl ? a > b : a < b; 20386 case '>': 20387 return rtl ? a < b : a > b; 20388 case '>=': 20389 return rtl ? a <= b : a >= b; 20390 case '<=': 20391 return rtl ? a >= b : a <= b; 20392 default: 20393 break; 20394 } 20395 }; 20396 20397 /** 20398 * Attaches to an internal event. 20399 * @protected 20400 * @param {HTMLElement} element - The event source. 20401 * @param {String} event - The event name. 20402 * @param {Function} listener - The event handler to attach. 20403 * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not. 20404 */ 20405 Owl.prototype.on = function(element, event, listener, capture) { 20406 if (element.addEventListener) { 20407 element.addEventListener(event, listener, capture); 20408 } else if (element.attachEvent) { 20409 element.attachEvent('on' + event, listener); 20410 } 20411 }; 20412 20413 /** 20414 * Detaches from an internal event. 20415 * @protected 20416 * @param {HTMLElement} element - The event source. 20417 * @param {String} event - The event name. 20418 * @param {Function} listener - The attached event handler to detach. 20419 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not. 20420 */ 20421 Owl.prototype.off = function(element, event, listener, capture) { 20422 if (element.removeEventListener) { 20423 element.removeEventListener(event, listener, capture); 20424 } else if (element.detachEvent) { 20425 element.detachEvent('on' + event, listener); 20426 } 20427 }; 20428 20429 /** 20430 * Triggers a public event. 20431 * @todo Remove `status`, `relatedTarget` should be used instead. 20432 * @protected 20433 * @param {String} name - The event name. 20434 * @param {*} [data=null] - The event data. 20435 * @param {String} [namespace=carousel] - The event namespace. 20436 * @param {String} [state] - The state which is associated with the event. 20437 * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not. 20438 * @returns {Event} - The event arguments. 20439 */ 20440 Owl.prototype.trigger = function(name, data, namespace, state, enter) { 20441 var status = { 20442 item: { count: this._items.length, index: this.current() } 20443 }, handler = $.camelCase( 20444 $.grep([ 'on', name, namespace ], function(v) { return v }) 20445 .join('-').toLowerCase() 20446 ), event = $.Event( 20447 [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(), 20448 $.extend({ relatedTarget: this }, status, data) 20449 ); 20450 20451 if (!this._supress[name]) { 20452 $.each(this._plugins, function(name, plugin) { 20453 if (plugin.onTrigger) { 20454 plugin.onTrigger(event); 20455 } 20456 }); 20457 20458 this.register({ type: Owl.Type.Event, name: name }); 20459 this.$element.trigger(event); 20460 20461 if (this.settings && typeof this.settings[handler] === 'function') { 20462 this.settings[handler].call(this, event); 20463 } 20464 } 20465 20466 return event; 20467 }; 20468 20469 /** 20470 * Enters a state. 20471 * @param name - The state name. 20472 */ 20473 Owl.prototype.enter = function(name) { 20474 $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) { 20475 if (this._states.current[name] === undefined) { 20476 this._states.current[name] = 0; 20477 } 20478 20479 this._states.current[name]++; 20480 }, this)); 20481 }; 20482 20483 /** 20484 * Leaves a state. 20485 * @param name - The state name. 20486 */ 20487 Owl.prototype.leave = function(name) { 20488 $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) { 20489 this._states.current[name]--; 20490 }, this)); 20491 }; 20492 20493 /** 20494 * Registers an event or state. 20495 * @public 20496 * @param {Object} object - The event or state to register. 20497 */ 20498 Owl.prototype.register = function(object) { 20499 if (object.type === Owl.Type.Event) { 20500 if (!$.event.special[object.name]) { 20501 $.event.special[object.name] = {}; 20502 } 20503 20504 if (!$.event.special[object.name].owl) { 20505 var _default = $.event.special[object.name]._default; 20506 $.event.special[object.name]._default = function(e) { 20507 if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) { 20508 return _default.apply(this, arguments); 20509 } 20510 return e.namespace && e.namespace.indexOf('owl') > -1; 20511 }; 20512 $.event.special[object.name].owl = true; 20513 } 20514 } else if (object.type === Owl.Type.State) { 20515 if (!this._states.tags[object.name]) { 20516 this._states.tags[object.name] = object.tags; 20517 } else { 20518 this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags); 20519 } 20520 20521 this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) { 20522 return $.inArray(tag, this._states.tags[object.name]) === i; 20523 }, this)); 20524 } 20525 }; 20526 20527 /** 20528 * Suppresses events. 20529 * @protected 20530 * @param {Array.<String>} events - The events to suppress. 20531 */ 20532 Owl.prototype.suppress = function(events) { 20533 $.each(events, $.proxy(function(index, event) { 20534 this._supress[event] = true; 20535 }, this)); 20536 }; 20537 20538 /** 20539 * Releases suppressed events. 20540 * @protected 20541 * @param {Array.<String>} events - The events to release. 20542 */ 20543 Owl.prototype.release = function(events) { 20544 $.each(events, $.proxy(function(index, event) { 20545 delete this._supress[event]; 20546 }, this)); 20547 }; 20548 20549 /** 20550 * Gets unified pointer coordinates from event. 20551 * @todo #261 20552 * @protected 20553 * @param {Event} - The `mousedown` or `touchstart` event. 20554 * @returns {Object} - Contains `x` and `y` coordinates of current pointer position. 20555 */ 20556 Owl.prototype.pointer = function(event) { 20557 var result = { x: null, y: null }; 20558 20559 event = event.originalEvent || event || window.event; 20560 20561 event = event.touches && event.touches.length ? 20562 event.touches[0] : event.changedTouches && event.changedTouches.length ? 20563 event.changedTouches[0] : event; 20564 20565 if (event.pageX) { 20566 result.x = event.pageX; 20567 result.y = event.pageY; 20568 } else { 20569 result.x = event.clientX; 20570 result.y = event.clientY; 20571 } 20572 20573 return result; 20574 }; 20575 20576 /** 20577 * Determines if the input is a Number or something that can be coerced to a Number 20578 * @protected 20579 * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested 20580 * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number 20581 */ 20582 Owl.prototype.isNumeric = function(number) { 20583 return !isNaN(parseFloat(number)); 20584 }; 20585 20586 /** 20587 * Gets the difference of two vectors. 20588 * @todo #261 20589 * @protected 20590 * @param {Object} - The first vector. 20591 * @param {Object} - The second vector. 20592 * @returns {Object} - The difference. 20593 */ 20594 Owl.prototype.difference = function(first, second) { 20595 return { 20596 x: first.x - second.x, 20597 y: first.y - second.y 20598 }; 20599 }; 20600 20601 /** 20602 * The jQuery Plugin for the Owl Carousel 20603 * @todo Navigation plugin `next` and `prev` 20604 * @public 20605 */ 20606 $.fn.owlCarousel = function(option) { 20607 var args = Array.prototype.slice.call(arguments, 1); 20608 20609 return this.each(function() { 20610 var $this = $(this), 20611 data = $this.data('owl.carousel'); 20612 20613 if (!data) { 20614 data = new Owl(this, typeof option == 'object' && option); 20615 $this.data('owl.carousel', data); 20616 20617 $.each([ 20618 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove' 20619 ], function(i, event) { 20620 data.register({ type: Owl.Type.Event, name: event }); 20621 data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) { 20622 if (e.namespace && e.relatedTarget !== this) { 20623 this.suppress([ event ]); 20624 data[event].apply(this, [].slice.call(arguments, 1)); 20625 this.release([ event ]); 20626 } 20627 }, data)); 20628 }); 20629 } 20630 20631 if (typeof option == 'string' && option.charAt(0) !== '_') { 20632 data[option].apply(data, args); 20633 } 20634 }); 20635 }; 20636 20637 /** 20638 * The constructor for the jQuery Plugin 20639 * @public 20640 */ 20641 $.fn.owlCarousel.Constructor = Owl; 20642 20643})(window.Zepto || window.jQuery, window, document); 20644 20645/** 20646 * AutoRefresh Plugin 20647 * @version 2.3.4 20648 * @author Artus Kolanowski 20649 * @author David Deutsch 20650 * @license The MIT License (MIT) 20651 */ 20652;(function($, window, document, undefined) { 20653 20654 /** 20655 * Creates the auto refresh plugin. 20656 * @class The Auto Refresh Plugin 20657 * @param {Owl} carousel - The Owl Carousel 20658 */ 20659 var AutoRefresh = function(carousel) { 20660 /** 20661 * Reference to the core. 20662 * @protected 20663 * @type {Owl} 20664 */ 20665 this._core = carousel; 20666 20667 /** 20668 * Refresh interval. 20669 * @protected 20670 * @type {number} 20671 */ 20672 this._interval = null; 20673 20674 /** 20675 * Whether the element is currently visible or not. 20676 * @protected 20677 * @type {Boolean} 20678 */ 20679 this._visible = null; 20680 20681 /** 20682 * All event handlers. 20683 * @protected 20684 * @type {Object} 20685 */ 20686 this._handlers = { 20687 'initialized.owl.carousel': $.proxy(function(e) { 20688 if (e.namespace && this._core.settings.autoRefresh) { 20689 this.watch(); 20690 } 20691 }, this) 20692 }; 20693 20694 // set default options 20695 this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options); 20696 20697 // register event handlers 20698 this._core.$element.on(this._handlers); 20699 }; 20700 20701 /** 20702 * Default options. 20703 * @public 20704 */ 20705 AutoRefresh.Defaults = { 20706 autoRefresh: true, 20707 autoRefreshInterval: 500 20708 }; 20709 20710 /** 20711 * Watches the element. 20712 */ 20713 AutoRefresh.prototype.watch = function() { 20714 if (this._interval) { 20715 return; 20716 } 20717 20718 this._visible = this._core.isVisible(); 20719 this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); 20720 }; 20721 20722 /** 20723 * Refreshes the element. 20724 */ 20725 AutoRefresh.prototype.refresh = function() { 20726 if (this._core.isVisible() === this._visible) { 20727 return; 20728 } 20729 20730 this._visible = !this._visible; 20731 20732 this._core.$element.toggleClass('owl-hidden', !this._visible); 20733 20734 this._visible && (this._core.invalidate('width') && this._core.refresh()); 20735 }; 20736 20737 /** 20738 * Destroys the plugin. 20739 */ 20740 AutoRefresh.prototype.destroy = function() { 20741 var handler, property; 20742 20743 window.clearInterval(this._interval); 20744 20745 for (handler in this._handlers) { 20746 this._core.$element.off(handler, this._handlers[handler]); 20747 } 20748 for (property in Object.getOwnPropertyNames(this)) { 20749 typeof this[property] != 'function' && (this[property] = null); 20750 } 20751 }; 20752 20753 $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh; 20754 20755})(window.Zepto || window.jQuery, window, document); 20756 20757/** 20758 * Lazy Plugin 20759 * @version 2.3.4 20760 * @author Bartosz Wojciechowski 20761 * @author David Deutsch 20762 * @license The MIT License (MIT) 20763 */ 20764;(function($, window, document, undefined) { 20765 20766 /** 20767 * Creates the lazy plugin. 20768 * @class The Lazy Plugin 20769 * @param {Owl} carousel - The Owl Carousel 20770 */ 20771 var Lazy = function(carousel) { 20772 20773 /** 20774 * Reference to the core. 20775 * @protected 20776 * @type {Owl} 20777 */ 20778 this._core = carousel; 20779 20780 /** 20781 * Already loaded items. 20782 * @protected 20783 * @type {Array.<jQuery>} 20784 */ 20785 this._loaded = []; 20786 20787 /** 20788 * Event handlers. 20789 * @protected 20790 * @type {Object} 20791 */ 20792 this._handlers = { 20793 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) { 20794 if (!e.namespace) { 20795 return; 20796 } 20797 20798 if (!this._core.settings || !this._core.settings.lazyLoad) { 20799 return; 20800 } 20801 20802 if ((e.property && e.property.name == 'position') || e.type == 'initialized') { 20803 var settings = this._core.settings, 20804 n = (settings.center && Math.ceil(settings.items / 2) || settings.items), 20805 i = ((settings.center && n * -1) || 0), 20806 position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i, 20807 clones = this._core.clones().length, 20808 load = $.proxy(function(i, v) { this.load(v) }, this); 20809 //TODO: Need documentation for this new option 20810 if (settings.lazyLoadEager > 0) { 20811 n += settings.lazyLoadEager; 20812 // If the carousel is looping also preload images that are to the "left" 20813 if (settings.loop) { 20814 position -= settings.lazyLoadEager; 20815 n++; 20816 } 20817 } 20818 20819 while (i++ < n) { 20820 this.load(clones / 2 + this._core.relative(position)); 20821 clones && $.each(this._core.clones(this._core.relative(position)), load); 20822 position++; 20823 } 20824 } 20825 }, this) 20826 }; 20827 20828 // set the default options 20829 this._core.options = $.extend({}, Lazy.Defaults, this._core.options); 20830 20831 // register event handler 20832 this._core.$element.on(this._handlers); 20833 }; 20834 20835 /** 20836 * Default options. 20837 * @public 20838 */ 20839 Lazy.Defaults = { 20840 lazyLoad: false, 20841 lazyLoadEager: 0 20842 }; 20843 20844 /** 20845 * Loads all resources of an item at the specified position. 20846 * @param {Number} position - The absolute position of the item. 20847 * @protected 20848 */ 20849 Lazy.prototype.load = function(position) { 20850 var $item = this._core.$stage.children().eq(position), 20851 $elements = $item && $item.find('.owl-lazy'); 20852 20853 if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { 20854 return; 20855 } 20856 20857 $elements.each($.proxy(function(index, element) { 20858 var $element = $(element), image, 20859 url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset'); 20860 20861 this._core.trigger('load', { element: $element, url: url }, 'lazy'); 20862 20863 if ($element.is('img')) { 20864 $element.one('load.owl.lazy', $.proxy(function() { 20865 $element.css('opacity', 1); 20866 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 20867 }, this)).attr('src', url); 20868 } else if ($element.is('source')) { 20869 $element.one('load.owl.lazy', $.proxy(function() { 20870 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 20871 }, this)).attr('srcset', url); 20872 } else { 20873 image = new Image(); 20874 image.onload = $.proxy(function() { 20875 $element.css({ 20876 'background-image': 'url("' + url + '")', 20877 'opacity': '1' 20878 }); 20879 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 20880 }, this); 20881 image.src = url; 20882 } 20883 }, this)); 20884 20885 this._loaded.push($item.get(0)); 20886 }; 20887 20888 /** 20889 * Destroys the plugin. 20890 * @public 20891 */ 20892 Lazy.prototype.destroy = function() { 20893 var handler, property; 20894 20895 for (handler in this.handlers) { 20896 this._core.$element.off(handler, this.handlers[handler]); 20897 } 20898 for (property in Object.getOwnPropertyNames(this)) { 20899 typeof this[property] != 'function' && (this[property] = null); 20900 } 20901 }; 20902 20903 $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy; 20904 20905})(window.Zepto || window.jQuery, window, document); 20906 20907/** 20908 * AutoHeight Plugin 20909 * @version 2.3.4 20910 * @author Bartosz Wojciechowski 20911 * @author David Deutsch 20912 * @license The MIT License (MIT) 20913 */ 20914;(function($, window, document, undefined) { 20915 20916 /** 20917 * Creates the auto height plugin. 20918 * @class The Auto Height Plugin 20919 * @param {Owl} carousel - The Owl Carousel 20920 */ 20921 var AutoHeight = function(carousel) { 20922 /** 20923 * Reference to the core. 20924 * @protected 20925 * @type {Owl} 20926 */ 20927 this._core = carousel; 20928 20929 this._previousHeight = null; 20930 20931 /** 20932 * All event handlers. 20933 * @protected 20934 * @type {Object} 20935 */ 20936 this._handlers = { 20937 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) { 20938 if (e.namespace && this._core.settings.autoHeight) { 20939 this.update(); 20940 } 20941 }, this), 20942 'changed.owl.carousel': $.proxy(function(e) { 20943 if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){ 20944 this.update(); 20945 } 20946 }, this), 20947 'loaded.owl.lazy': $.proxy(function(e) { 20948 if (e.namespace && this._core.settings.autoHeight 20949 && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) { 20950 this.update(); 20951 } 20952 }, this) 20953 }; 20954 20955 // set default options 20956 this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); 20957 20958 // register event handlers 20959 this._core.$element.on(this._handlers); 20960 this._intervalId = null; 20961 var refThis = this; 20962 20963 // These changes have been taken from a PR by gavrochelegnou proposed in #1575 20964 // and have been made compatible with the latest jQuery version 20965 $(window).on('load', function() { 20966 if (refThis._core.settings.autoHeight) { 20967 refThis.update(); 20968 } 20969 }); 20970 20971 // Autoresize the height of the carousel when window is resized 20972 // When carousel has images, the height is dependent on the width 20973 // and should also change on resize 20974 $(window).resize(function() { 20975 if (refThis._core.settings.autoHeight) { 20976 if (refThis._intervalId != null) { 20977 clearTimeout(refThis._intervalId); 20978 } 20979 20980 refThis._intervalId = setTimeout(function() { 20981 refThis.update(); 20982 }, 250); 20983 } 20984 }); 20985 20986 }; 20987 20988 /** 20989 * Default options. 20990 * @public 20991 */ 20992 AutoHeight.Defaults = { 20993 autoHeight: false, 20994 autoHeightClass: 'owl-height' 20995 }; 20996 20997 /** 20998 * Updates the view. 20999 */ 21000 AutoHeight.prototype.update = function() { 21001 var start = this._core._current, 21002 end = start + this._core.settings.items, 21003 lazyLoadEnabled = this._core.settings.lazyLoad, 21004 visible = this._core.$stage.children().toArray().slice(start, end), 21005 heights = [], 21006 maxheight = 0; 21007 21008 $.each(visible, function(index, item) { 21009 heights.push($(item).height()); 21010 }); 21011 21012 maxheight = Math.max.apply(null, heights); 21013 21014 if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) { 21015 maxheight = this._previousHeight; 21016 } 21017 21018 this._previousHeight = maxheight; 21019 21020 this._core.$stage.parent() 21021 .height(maxheight) 21022 .addClass(this._core.settings.autoHeightClass); 21023 }; 21024 21025 AutoHeight.prototype.destroy = function() { 21026 var handler, property; 21027 21028 for (handler in this._handlers) { 21029 this._core.$element.off(handler, this._handlers[handler]); 21030 } 21031 for (property in Object.getOwnPropertyNames(this)) { 21032 typeof this[property] !== 'function' && (this[property] = null); 21033 } 21034 }; 21035 21036 $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight; 21037 21038})(window.Zepto || window.jQuery, window, document); 21039 21040/** 21041 * Video Plugin 21042 * @version 2.3.4 21043 * @author Bartosz Wojciechowski 21044 * @author David Deutsch 21045 * @license The MIT License (MIT) 21046 */ 21047;(function($, window, document, undefined) { 21048 21049 /** 21050 * Creates the video plugin. 21051 * @class The Video Plugin 21052 * @param {Owl} carousel - The Owl Carousel 21053 */ 21054 var Video = function(carousel) { 21055 /** 21056 * Reference to the core. 21057 * @protected 21058 * @type {Owl} 21059 */ 21060 this._core = carousel; 21061 21062 /** 21063 * Cache all video URLs. 21064 * @protected 21065 * @type {Object} 21066 */ 21067 this._videos = {}; 21068 21069 /** 21070 * Current playing item. 21071 * @protected 21072 * @type {jQuery} 21073 */ 21074 this._playing = null; 21075 21076 /** 21077 * All event handlers. 21078 * @todo The cloned content removale is too late 21079 * @protected 21080 * @type {Object} 21081 */ 21082 this._handlers = { 21083 'initialized.owl.carousel': $.proxy(function(e) { 21084 if (e.namespace) { 21085 this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] }); 21086 } 21087 }, this), 21088 'resize.owl.carousel': $.proxy(function(e) { 21089 if (e.namespace && this._core.settings.video && this.isInFullScreen()) { 21090 e.preventDefault(); 21091 } 21092 }, this), 21093 'refreshed.owl.carousel': $.proxy(function(e) { 21094 if (e.namespace && this._core.is('resizing')) { 21095 this._core.$stage.find('.cloned .owl-video-frame').remove(); 21096 } 21097 }, this), 21098 'changed.owl.carousel': $.proxy(function(e) { 21099 if (e.namespace && e.property.name === 'position' && this._playing) { 21100 this.stop(); 21101 } 21102 }, this), 21103 'prepared.owl.carousel': $.proxy(function(e) { 21104 if (!e.namespace) { 21105 return; 21106 } 21107 21108 var $element = $(e.content).find('.owl-video'); 21109 21110 if ($element.length) { 21111 $element.css('display', 'none'); 21112 this.fetch($element, $(e.content)); 21113 } 21114 }, this) 21115 }; 21116 21117 // set default options 21118 this._core.options = $.extend({}, Video.Defaults, this._core.options); 21119 21120 // register event handlers 21121 this._core.$element.on(this._handlers); 21122 21123 this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) { 21124 this.play(e); 21125 }, this)); 21126 }; 21127 21128 /** 21129 * Default options. 21130 * @public 21131 */ 21132 Video.Defaults = { 21133 video: false, 21134 videoHeight: false, 21135 videoWidth: false 21136 }; 21137 21138 /** 21139 * Gets the video ID and the type (YouTube/Vimeo/vzaar only). 21140 * @protected 21141 * @param {jQuery} target - The target containing the video data. 21142 * @param {jQuery} item - The item containing the video. 21143 */ 21144 Video.prototype.fetch = function(target, item) { 21145 var type = (function() { 21146 if (target.attr('data-vimeo-id')) { 21147 return 'vimeo'; 21148 } else if (target.attr('data-vzaar-id')) { 21149 return 'vzaar' 21150 } else { 21151 return 'youtube'; 21152 } 21153 })(), 21154 id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'), 21155 width = target.attr('data-width') || this._core.settings.videoWidth, 21156 height = target.attr('data-height') || this._core.settings.videoHeight, 21157 url = target.attr('href'); 21158 21159 if (url) { 21160 21161 /* 21162 Parses the id's out of the following urls (and probably more): 21163 https://www.youtube.com/watch?v=:id 21164 https://youtu.be/:id 21165 https://vimeo.com/:id 21166 https://vimeo.com/channels/:channel/:id 21167 https://vimeo.com/groups/:group/videos/:id 21168 https://app.vzaar.com/videos/:id 21169 21170 Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F 21171 */ 21172 21173 id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); 21174 21175 if (id[3].indexOf('youtu') > -1) { 21176 type = 'youtube'; 21177 } else if (id[3].indexOf('vimeo') > -1) { 21178 type = 'vimeo'; 21179 } else if (id[3].indexOf('vzaar') > -1) { 21180 type = 'vzaar'; 21181 } else { 21182 throw new Error('Video URL not supported.'); 21183 } 21184 id = id[6]; 21185 } else { 21186 throw new Error('Missing video URL.'); 21187 } 21188 21189 this._videos[url] = { 21190 type: type, 21191 id: id, 21192 width: width, 21193 height: height 21194 }; 21195 21196 item.attr('data-video', url); 21197 21198 this.thumbnail(target, this._videos[url]); 21199 }; 21200 21201 /** 21202 * Creates video thumbnail. 21203 * @protected 21204 * @param {jQuery} target - The target containing the video data. 21205 * @param {Object} info - The video info object. 21206 * @see `fetch` 21207 */ 21208 Video.prototype.thumbnail = function(target, video) { 21209 var tnLink, 21210 icon, 21211 path, 21212 dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '', 21213 customTn = target.find('img'), 21214 srcType = 'src', 21215 lazyClass = '', 21216 settings = this._core.settings, 21217 create = function(path) { 21218 icon = '<div class="owl-video-play-icon"></div>'; 21219 21220 if (settings.lazyLoad) { 21221 tnLink = $('<div/>',{ 21222 "class": 'owl-video-tn ' + lazyClass, 21223 "srcType": path 21224 }); 21225 } else { 21226 tnLink = $( '<div/>', { 21227 "class": "owl-video-tn", 21228 "style": 'opacity:1;background-image:url(' + path + ')' 21229 }); 21230 } 21231 target.after(tnLink); 21232 target.after(icon); 21233 }; 21234 21235 // wrap video content into owl-video-wrapper div 21236 target.wrap( $( '<div/>', { 21237 "class": "owl-video-wrapper", 21238 "style": dimensions 21239 })); 21240 21241 if (this._core.settings.lazyLoad) { 21242 srcType = 'data-src'; 21243 lazyClass = 'owl-lazy'; 21244 } 21245 21246 // custom thumbnail 21247 if (customTn.length) { 21248 create(customTn.attr(srcType)); 21249 customTn.remove(); 21250 return false; 21251 } 21252 21253 if (video.type === 'youtube') { 21254 path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; 21255 create(path); 21256 } else if (video.type === 'vimeo') { 21257 $.ajax({ 21258 type: 'GET', 21259 url: '//vimeo.com/api/v2/video/' + video.id + '.json', 21260 jsonp: 'callback', 21261 dataType: 'jsonp', 21262 success: function(data) { 21263 path = data[0].thumbnail_large; 21264 create(path); 21265 } 21266 }); 21267 } else if (video.type === 'vzaar') { 21268 $.ajax({ 21269 type: 'GET', 21270 url: '//vzaar.com/api/videos/' + video.id + '.json', 21271 jsonp: 'callback', 21272 dataType: 'jsonp', 21273 success: function(data) { 21274 path = data.framegrab_url; 21275 create(path); 21276 } 21277 }); 21278 } 21279 }; 21280 21281 /** 21282 * Stops the current video. 21283 * @public 21284 */ 21285 Video.prototype.stop = function() { 21286 this._core.trigger('stop', null, 'video'); 21287 this._playing.find('.owl-video-frame').remove(); 21288 this._playing.removeClass('owl-video-playing'); 21289 this._playing = null; 21290 this._core.leave('playing'); 21291 this._core.trigger('stopped', null, 'video'); 21292 }; 21293 21294 /** 21295 * Starts the current video. 21296 * @public 21297 * @param {Event} event - The event arguments. 21298 */ 21299 Video.prototype.play = function(event) { 21300 var target = $(event.target), 21301 item = target.closest('.' + this._core.settings.itemClass), 21302 video = this._videos[item.attr('data-video')], 21303 width = video.width || '100%', 21304 height = video.height || this._core.$stage.height(), 21305 html, 21306 iframe; 21307 21308 if (this._playing) { 21309 return; 21310 } 21311 21312 this._core.enter('playing'); 21313 this._core.trigger('play', null, 'video'); 21314 21315 item = this._core.items(this._core.relative(item.index())); 21316 21317 this._core.reset(item.index()); 21318 21319 html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' ); 21320 html.attr( 'height', height ); 21321 html.attr( 'width', width ); 21322 if (video.type === 'youtube') { 21323 html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id ); 21324 } else if (video.type === 'vimeo') { 21325 html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' ); 21326 } else if (video.type === 'vzaar') { 21327 html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' ); 21328 } 21329 21330 iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video')); 21331 21332 this._playing = item.addClass('owl-video-playing'); 21333 }; 21334 21335 /** 21336 * Checks whether an video is currently in full screen mode or not. 21337 * @todo Bad style because looks like a readonly method but changes members. 21338 * @protected 21339 * @returns {Boolean} 21340 */ 21341 Video.prototype.isInFullScreen = function() { 21342 var element = document.fullscreenElement || document.mozFullScreenElement || 21343 document.webkitFullscreenElement; 21344 21345 return element && $(element).parent().hasClass('owl-video-frame'); 21346 }; 21347 21348 /** 21349 * Destroys the plugin. 21350 */ 21351 Video.prototype.destroy = function() { 21352 var handler, property; 21353 21354 this._core.$element.off('click.owl.video'); 21355 21356 for (handler in this._handlers) { 21357 this._core.$element.off(handler, this._handlers[handler]); 21358 } 21359 for (property in Object.getOwnPropertyNames(this)) { 21360 typeof this[property] != 'function' && (this[property] = null); 21361 } 21362 }; 21363 21364 $.fn.owlCarousel.Constructor.Plugins.Video = Video; 21365 21366})(window.Zepto || window.jQuery, window, document); 21367 21368/** 21369 * Animate Plugin 21370 * @version 2.3.4 21371 * @author Bartosz Wojciechowski 21372 * @author David Deutsch 21373 * @license The MIT License (MIT) 21374 */ 21375;(function($, window, document, undefined) { 21376 21377 /** 21378 * Creates the animate plugin. 21379 * @class The Navigation Plugin 21380 * @param {Owl} scope - The Owl Carousel 21381 */ 21382 var Animate = function(scope) { 21383 this.core = scope; 21384 this.core.options = $.extend({}, Animate.Defaults, this.core.options); 21385 this.swapping = true; 21386 this.previous = undefined; 21387 this.next = undefined; 21388 21389 this.handlers = { 21390 'change.owl.carousel': $.proxy(function(e) { 21391 if (e.namespace && e.property.name == 'position') { 21392 this.previous = this.core.current(); 21393 this.next = e.property.value; 21394 } 21395 }, this), 21396 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) { 21397 if (e.namespace) { 21398 this.swapping = e.type == 'translated'; 21399 } 21400 }, this), 21401 'translate.owl.carousel': $.proxy(function(e) { 21402 if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { 21403 this.swap(); 21404 } 21405 }, this) 21406 }; 21407 21408 this.core.$element.on(this.handlers); 21409 }; 21410 21411 /** 21412 * Default options. 21413 * @public 21414 */ 21415 Animate.Defaults = { 21416 animateOut: false, 21417 animateIn: false 21418 }; 21419 21420 /** 21421 * Toggles the animation classes whenever an translations starts. 21422 * @protected 21423 * @returns {Boolean|undefined} 21424 */ 21425 Animate.prototype.swap = function() { 21426 21427 if (this.core.settings.items !== 1) { 21428 return; 21429 } 21430 21431 if (!$.support.animation || !$.support.transition) { 21432 return; 21433 } 21434 21435 this.core.speed(0); 21436 21437 var left, 21438 clear = $.proxy(this.clear, this), 21439 previous = this.core.$stage.children().eq(this.previous), 21440 next = this.core.$stage.children().eq(this.next), 21441 incoming = this.core.settings.animateIn, 21442 outgoing = this.core.settings.animateOut; 21443 21444 if (this.core.current() === this.previous) { 21445 return; 21446 } 21447 21448 if (outgoing) { 21449 left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); 21450 previous.one($.support.animation.end, clear) 21451 .css( { 'left': left + 'px' } ) 21452 .addClass('animated owl-animated-out') 21453 .addClass(outgoing); 21454 } 21455 21456 if (incoming) { 21457 next.one($.support.animation.end, clear) 21458 .addClass('animated owl-animated-in') 21459 .addClass(incoming); 21460 } 21461 }; 21462 21463 Animate.prototype.clear = function(e) { 21464 $(e.target).css( { 'left': '' } ) 21465 .removeClass('animated owl-animated-out owl-animated-in') 21466 .removeClass(this.core.settings.animateIn) 21467 .removeClass(this.core.settings.animateOut); 21468 this.core.onTransitionEnd(); 21469 }; 21470 21471 /** 21472 * Destroys the plugin. 21473 * @public 21474 */ 21475 Animate.prototype.destroy = function() { 21476 var handler, property; 21477 21478 for (handler in this.handlers) { 21479 this.core.$element.off(handler, this.handlers[handler]); 21480 } 21481 for (property in Object.getOwnPropertyNames(this)) { 21482 typeof this[property] != 'function' && (this[property] = null); 21483 } 21484 }; 21485 21486 $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; 21487 21488})(window.Zepto || window.jQuery, window, document); 21489 21490/** 21491 * Autoplay Plugin 21492 * @version 2.3.4 21493 * @author Bartosz Wojciechowski 21494 * @author Artus Kolanowski 21495 * @author David Deutsch 21496 * @author Tom De Caluwé 21497 * @license The MIT License (MIT) 21498 */ 21499;(function($, window, document, undefined) { 21500 21501 /** 21502 * Creates the autoplay plugin. 21503 * @class The Autoplay Plugin 21504 * @param {Owl} scope - The Owl Carousel 21505 */ 21506 var Autoplay = function(carousel) { 21507 /** 21508 * Reference to the core. 21509 * @protected 21510 * @type {Owl} 21511 */ 21512 this._core = carousel; 21513 21514 /** 21515 * The autoplay timeout id. 21516 * @type {Number} 21517 */ 21518 this._call = null; 21519 21520 /** 21521 * Depending on the state of the plugin, this variable contains either 21522 * the start time of the timer or the current timer value if it's 21523 * paused. Since we start in a paused state we initialize the timer 21524 * value. 21525 * @type {Number} 21526 */ 21527 this._time = 0; 21528 21529 /** 21530 * Stores the timeout currently used. 21531 * @type {Number} 21532 */ 21533 this._timeout = 0; 21534 21535 /** 21536 * Indicates whenever the autoplay is paused. 21537 * @type {Boolean} 21538 */ 21539 this._paused = true; 21540 21541 /** 21542 * All event handlers. 21543 * @protected 21544 * @type {Object} 21545 */ 21546 this._handlers = { 21547 'changed.owl.carousel': $.proxy(function(e) { 21548 if (e.namespace && e.property.name === 'settings') { 21549 if (this._core.settings.autoplay) { 21550 this.play(); 21551 } else { 21552 this.stop(); 21553 } 21554 } else if (e.namespace && e.property.name === 'position' && this._paused) { 21555 // Reset the timer. This code is triggered when the position 21556 // of the carousel was changed through user interaction. 21557 this._time = 0; 21558 } 21559 }, this), 21560 'initialized.owl.carousel': $.proxy(function(e) { 21561 if (e.namespace && this._core.settings.autoplay) { 21562 this.play(); 21563 } 21564 }, this), 21565 'play.owl.autoplay': $.proxy(function(e, t, s) { 21566 if (e.namespace) { 21567 this.play(t, s); 21568 } 21569 }, this), 21570 'stop.owl.autoplay': $.proxy(function(e) { 21571 if (e.namespace) { 21572 this.stop(); 21573 } 21574 }, this), 21575 'mouseover.owl.autoplay': $.proxy(function() { 21576 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 21577 this.pause(); 21578 } 21579 }, this), 21580 'mouseleave.owl.autoplay': $.proxy(function() { 21581 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 21582 this.play(); 21583 } 21584 }, this), 21585 'touchstart.owl.core': $.proxy(function() { 21586 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 21587 this.pause(); 21588 } 21589 }, this), 21590 'touchend.owl.core': $.proxy(function() { 21591 if (this._core.settings.autoplayHoverPause) { 21592 this.play(); 21593 } 21594 }, this) 21595 }; 21596 21597 // register event handlers 21598 this._core.$element.on(this._handlers); 21599 21600 // set default options 21601 this._core.options = $.extend({}, Autoplay.Defaults, this._core.options); 21602 }; 21603 21604 /** 21605 * Default options. 21606 * @public 21607 */ 21608 Autoplay.Defaults = { 21609 autoplay: false, 21610 autoplayTimeout: 5000, 21611 autoplayHoverPause: false, 21612 autoplaySpeed: false 21613 }; 21614 21615 /** 21616 * Transition to the next slide and set a timeout for the next transition. 21617 * @private 21618 * @param {Number} [speed] - The animation speed for the animations. 21619 */ 21620 Autoplay.prototype._next = function(speed) { 21621 this._call = window.setTimeout( 21622 $.proxy(this._next, this, speed), 21623 this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read() 21624 ); 21625 21626 if (this._core.is('interacting') || document.hidden) { 21627 return; 21628 } 21629 this._core.next(speed || this._core.settings.autoplaySpeed); 21630 } 21631 21632 /** 21633 * Reads the current timer value when the timer is playing. 21634 * @public 21635 */ 21636 Autoplay.prototype.read = function() { 21637 return new Date().getTime() - this._time; 21638 }; 21639 21640 /** 21641 * Starts the autoplay. 21642 * @public 21643 * @param {Number} [timeout] - The interval before the next animation starts. 21644 * @param {Number} [speed] - The animation speed for the animations. 21645 */ 21646 Autoplay.prototype.play = function(timeout, speed) { 21647 var elapsed; 21648 21649 if (!this._core.is('rotating')) { 21650 this._core.enter('rotating'); 21651 } 21652 21653 timeout = timeout || this._core.settings.autoplayTimeout; 21654 21655 // Calculate the elapsed time since the last transition. If the carousel 21656 // wasn't playing this calculation will yield zero. 21657 elapsed = Math.min(this._time % (this._timeout || timeout), timeout); 21658 21659 if (this._paused) { 21660 // Start the clock. 21661 this._time = this.read(); 21662 this._paused = false; 21663 } else { 21664 // Clear the active timeout to allow replacement. 21665 window.clearTimeout(this._call); 21666 } 21667 21668 // Adjust the origin of the timer to match the new timeout value. 21669 this._time += this.read() % timeout - elapsed; 21670 21671 this._timeout = timeout; 21672 this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed); 21673 }; 21674 21675 /** 21676 * Stops the autoplay. 21677 * @public 21678 */ 21679 Autoplay.prototype.stop = function() { 21680 if (this._core.is('rotating')) { 21681 // Reset the clock. 21682 this._time = 0; 21683 this._paused = true; 21684 21685 window.clearTimeout(this._call); 21686 this._core.leave('rotating'); 21687 } 21688 }; 21689 21690 /** 21691 * Pauses the autoplay. 21692 * @public 21693 */ 21694 Autoplay.prototype.pause = function() { 21695 if (this._core.is('rotating') && !this._paused) { 21696 // Pause the clock. 21697 this._time = this.read(); 21698 this._paused = true; 21699 21700 window.clearTimeout(this._call); 21701 } 21702 }; 21703 21704 /** 21705 * Destroys the plugin. 21706 */ 21707 Autoplay.prototype.destroy = function() { 21708 var handler, property; 21709 21710 this.stop(); 21711 21712 for (handler in this._handlers) { 21713 this._core.$element.off(handler, this._handlers[handler]); 21714 } 21715 for (property in Object.getOwnPropertyNames(this)) { 21716 typeof this[property] != 'function' && (this[property] = null); 21717 } 21718 }; 21719 21720 $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; 21721 21722})(window.Zepto || window.jQuery, window, document); 21723 21724/** 21725 * Navigation Plugin 21726 * @version 2.3.4 21727 * @author Artus Kolanowski 21728 * @author David Deutsch 21729 * @license The MIT License (MIT) 21730 */ 21731;(function($, window, document, undefined) { 21732 'use strict'; 21733 21734 /** 21735 * Creates the navigation plugin. 21736 * @class The Navigation Plugin 21737 * @param {Owl} carousel - The Owl Carousel. 21738 */ 21739 var Navigation = function(carousel) { 21740 /** 21741 * Reference to the core. 21742 * @protected 21743 * @type {Owl} 21744 */ 21745 this._core = carousel; 21746 21747 /** 21748 * Indicates whether the plugin is initialized or not. 21749 * @protected 21750 * @type {Boolean} 21751 */ 21752 this._initialized = false; 21753 21754 /** 21755 * The current paging indexes. 21756 * @protected 21757 * @type {Array} 21758 */ 21759 this._pages = []; 21760 21761 /** 21762 * All DOM elements of the user interface. 21763 * @protected 21764 * @type {Object} 21765 */ 21766 this._controls = {}; 21767 21768 /** 21769 * Markup for an indicator. 21770 * @protected 21771 * @type {Array.<String>} 21772 */ 21773 this._templates = []; 21774 21775 /** 21776 * The carousel element. 21777 * @type {jQuery} 21778 */ 21779 this.$element = this._core.$element; 21780 21781 /** 21782 * Overridden methods of the carousel. 21783 * @protected 21784 * @type {Object} 21785 */ 21786 this._overrides = { 21787 next: this._core.next, 21788 prev: this._core.prev, 21789 to: this._core.to 21790 }; 21791 21792 /** 21793 * All event handlers. 21794 * @protected 21795 * @type {Object} 21796 */ 21797 this._handlers = { 21798 'prepared.owl.carousel': $.proxy(function(e) { 21799 if (e.namespace && this._core.settings.dotsData) { 21800 this._templates.push('<div class="' + this._core.settings.dotClass + '">' + 21801 $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>'); 21802 } 21803 }, this), 21804 'added.owl.carousel': $.proxy(function(e) { 21805 if (e.namespace && this._core.settings.dotsData) { 21806 this._templates.splice(e.position, 0, this._templates.pop()); 21807 } 21808 }, this), 21809 'remove.owl.carousel': $.proxy(function(e) { 21810 if (e.namespace && this._core.settings.dotsData) { 21811 this._templates.splice(e.position, 1); 21812 } 21813 }, this), 21814 'changed.owl.carousel': $.proxy(function(e) { 21815 if (e.namespace && e.property.name == 'position') { 21816 this.draw(); 21817 } 21818 }, this), 21819 'initialized.owl.carousel': $.proxy(function(e) { 21820 if (e.namespace && !this._initialized) { 21821 this._core.trigger('initialize', null, 'navigation'); 21822 this.initialize(); 21823 this.update(); 21824 this.draw(); 21825 this._initialized = true; 21826 this._core.trigger('initialized', null, 'navigation'); 21827 } 21828 }, this), 21829 'refreshed.owl.carousel': $.proxy(function(e) { 21830 if (e.namespace && this._initialized) { 21831 this._core.trigger('refresh', null, 'navigation'); 21832 this.update(); 21833 this.draw(); 21834 this._core.trigger('refreshed', null, 'navigation'); 21835 } 21836 }, this) 21837 }; 21838 21839 // set default options 21840 this._core.options = $.extend({}, Navigation.Defaults, this._core.options); 21841 21842 // register event handlers 21843 this.$element.on(this._handlers); 21844 }; 21845 21846 /** 21847 * Default options. 21848 * @public 21849 * @todo Rename `slideBy` to `navBy` 21850 */ 21851 Navigation.Defaults = { 21852 nav: false, 21853 navText: [ 21854 '<span aria-label="' + 'Previous' + '">‹</span>', 21855 '<span aria-label="' + 'Next' + '">›</span>' 21856 ], 21857 navSpeed: false, 21858 navElement: 'button type="button" role="presentation"', 21859 navContainer: false, 21860 navContainerClass: 'owl-nav', 21861 navClass: [ 21862 'owl-prev', 21863 'owl-next' 21864 ], 21865 slideBy: 1, 21866 dotClass: 'owl-dot', 21867 dotsClass: 'owl-dots', 21868 dots: true, 21869 dotsEach: false, 21870 dotsData: false, 21871 dotsSpeed: false, 21872 dotsContainer: false 21873 }; 21874 21875 /** 21876 * Initializes the layout of the plugin and extends the carousel. 21877 * @protected 21878 */ 21879 Navigation.prototype.initialize = function() { 21880 var override, 21881 settings = this._core.settings; 21882 21883 // create DOM structure for relative navigation 21884 this._controls.$relative = (settings.navContainer ? $(settings.navContainer) 21885 : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); 21886 21887 this._controls.$previous = $('<' + settings.navElement + '>') 21888 .addClass(settings.navClass[0]) 21889 .html(settings.navText[0]) 21890 .prependTo(this._controls.$relative) 21891 .on('click', $.proxy(function(e) { 21892 this.prev(settings.navSpeed); 21893 }, this)); 21894 this._controls.$next = $('<' + settings.navElement + '>') 21895 .addClass(settings.navClass[1]) 21896 .html(settings.navText[1]) 21897 .appendTo(this._controls.$relative) 21898 .on('click', $.proxy(function(e) { 21899 this.next(settings.navSpeed); 21900 }, this)); 21901 21902 // create DOM structure for absolute navigation 21903 if (!settings.dotsData) { 21904 this._templates = [ $('<button role="button">') 21905 .addClass(settings.dotClass) 21906 .append($('<span>')) 21907 .prop('outerHTML') ]; 21908 } 21909 21910 this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) 21911 : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); 21912 21913 this._controls.$absolute.on('click', 'button', $.proxy(function(e) { 21914 var index = $(e.target).parent().is(this._controls.$absolute) 21915 ? $(e.target).index() : $(e.target).parent().index(); 21916 21917 e.preventDefault(); 21918 21919 this.to(index, settings.dotsSpeed); 21920 }, this)); 21921 21922 /*$el.on('focusin', function() { 21923 $(document).off(".carousel"); 21924 21925 $(document).on('keydown.carousel', function(e) { 21926 if(e.keyCode == 37) { 21927 $el.trigger('prev.owl') 21928 } 21929 if(e.keyCode == 39) { 21930 $el.trigger('next.owl') 21931 } 21932 }); 21933 });*/ 21934 21935 // override public methods of the carousel 21936 for (override in this._overrides) { 21937 this._core[override] = $.proxy(this[override], this); 21938 } 21939 }; 21940 21941 /** 21942 * Destroys the plugin. 21943 * @protected 21944 */ 21945 Navigation.prototype.destroy = function() { 21946 var handler, control, property, override, settings; 21947 settings = this._core.settings; 21948 21949 for (handler in this._handlers) { 21950 this.$element.off(handler, this._handlers[handler]); 21951 } 21952 for (control in this._controls) { 21953 if (control === '$relative' && settings.navContainer) { 21954 this._controls[control].html(''); 21955 } else { 21956 this._controls[control].remove(); 21957 } 21958 } 21959 for (override in this.overides) { 21960 this._core[override] = this._overrides[override]; 21961 } 21962 for (property in Object.getOwnPropertyNames(this)) { 21963 typeof this[property] != 'function' && (this[property] = null); 21964 } 21965 }; 21966 21967 /** 21968 * Updates the internal state. 21969 * @protected 21970 */ 21971 Navigation.prototype.update = function() { 21972 var i, j, k, 21973 lower = this._core.clones().length / 2, 21974 upper = lower + this._core.items().length, 21975 maximum = this._core.maximum(true), 21976 settings = this._core.settings, 21977 size = settings.center || settings.autoWidth || settings.dotsData 21978 ? 1 : settings.dotsEach || settings.items; 21979 21980 if (settings.slideBy !== 'page') { 21981 settings.slideBy = Math.min(settings.slideBy, settings.items); 21982 } 21983 21984 if (settings.dots || settings.slideBy == 'page') { 21985 this._pages = []; 21986 21987 for (i = lower, j = 0, k = 0; i < upper; i++) { 21988 if (j >= size || j === 0) { 21989 this._pages.push({ 21990 start: Math.min(maximum, i - lower), 21991 end: i - lower + size - 1 21992 }); 21993 if (Math.min(maximum, i - lower) === maximum) { 21994 break; 21995 } 21996 j = 0, ++k; 21997 } 21998 j += this._core.mergers(this._core.relative(i)); 21999 } 22000 } 22001 }; 22002 22003 /** 22004 * Draws the user interface. 22005 * @todo The option `dotsData` wont work. 22006 * @protected 22007 */ 22008 Navigation.prototype.draw = function() { 22009 var difference, 22010 settings = this._core.settings, 22011 disabled = this._core.items().length <= settings.items, 22012 index = this._core.relative(this._core.current()), 22013 loop = settings.loop || settings.rewind; 22014 22015 this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); 22016 22017 if (settings.nav) { 22018 this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true)); 22019 this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true)); 22020 } 22021 22022 this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); 22023 22024 if (settings.dots) { 22025 difference = this._pages.length - this._controls.$absolute.children().length; 22026 22027 if (settings.dotsData && difference !== 0) { 22028 this._controls.$absolute.html(this._templates.join('')); 22029 } else if (difference > 0) { 22030 this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); 22031 } else if (difference < 0) { 22032 this._controls.$absolute.children().slice(difference).remove(); 22033 } 22034 22035 this._controls.$absolute.find('.active').removeClass('active'); 22036 this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); 22037 } 22038 }; 22039 22040 /** 22041 * Extends event data. 22042 * @protected 22043 * @param {Event} event - The event object which gets thrown. 22044 */ 22045 Navigation.prototype.onTrigger = function(event) { 22046 var settings = this._core.settings; 22047 22048 event.page = { 22049 index: $.inArray(this.current(), this._pages), 22050 count: this._pages.length, 22051 size: settings && (settings.center || settings.autoWidth || settings.dotsData 22052 ? 1 : settings.dotsEach || settings.items) 22053 }; 22054 }; 22055 22056 /** 22057 * Gets the current page position of the carousel. 22058 * @protected 22059 * @returns {Number} 22060 */ 22061 Navigation.prototype.current = function() { 22062 var current = this._core.relative(this._core.current()); 22063 return $.grep(this._pages, $.proxy(function(page, index) { 22064 return page.start <= current && page.end >= current; 22065 }, this)).pop(); 22066 }; 22067 22068 /** 22069 * Gets the current succesor/predecessor position. 22070 * @protected 22071 * @returns {Number} 22072 */ 22073 Navigation.prototype.getPosition = function(successor) { 22074 var position, length, 22075 settings = this._core.settings; 22076 22077 if (settings.slideBy == 'page') { 22078 position = $.inArray(this.current(), this._pages); 22079 length = this._pages.length; 22080 successor ? ++position : --position; 22081 position = this._pages[((position % length) + length) % length].start; 22082 } else { 22083 position = this._core.relative(this._core.current()); 22084 length = this._core.items().length; 22085 successor ? position += settings.slideBy : position -= settings.slideBy; 22086 } 22087 22088 return position; 22089 }; 22090 22091 /** 22092 * Slides to the next item or page. 22093 * @public 22094 * @param {Number} [speed=false] - The time in milliseconds for the transition. 22095 */ 22096 Navigation.prototype.next = function(speed) { 22097 $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); 22098 }; 22099 22100 /** 22101 * Slides to the previous item or page. 22102 * @public 22103 * @param {Number} [speed=false] - The time in milliseconds for the transition. 22104 */ 22105 Navigation.prototype.prev = function(speed) { 22106 $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); 22107 }; 22108 22109 /** 22110 * Slides to the specified item or page. 22111 * @public 22112 * @param {Number} position - The position of the item or page. 22113 * @param {Number} [speed] - The time in milliseconds for the transition. 22114 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not. 22115 */ 22116 Navigation.prototype.to = function(position, speed, standard) { 22117 var length; 22118 22119 if (!standard && this._pages.length) { 22120 length = this._pages.length; 22121 $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); 22122 } else { 22123 $.proxy(this._overrides.to, this._core)(position, speed); 22124 } 22125 }; 22126 22127 $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation; 22128 22129})(window.Zepto || window.jQuery, window, document); 22130 22131/** 22132 * Hash Plugin 22133 * @version 2.3.4 22134 * @author Artus Kolanowski 22135 * @author David Deutsch 22136 * @license The MIT License (MIT) 22137 */ 22138;(function($, window, document, undefined) { 22139 'use strict'; 22140 22141 /** 22142 * Creates the hash plugin. 22143 * @class The Hash Plugin 22144 * @param {Owl} carousel - The Owl Carousel 22145 */ 22146 var Hash = function(carousel) { 22147 /** 22148 * Reference to the core. 22149 * @protected 22150 * @type {Owl} 22151 */ 22152 this._core = carousel; 22153 22154 /** 22155 * Hash index for the items. 22156 * @protected 22157 * @type {Object} 22158 */ 22159 this._hashes = {}; 22160 22161 /** 22162 * The carousel element. 22163 * @type {jQuery} 22164 */ 22165 this.$element = this._core.$element; 22166 22167 /** 22168 * All event handlers. 22169 * @protected 22170 * @type {Object} 22171 */ 22172 this._handlers = { 22173 'initialized.owl.carousel': $.proxy(function(e) { 22174 if (e.namespace && this._core.settings.startPosition === 'URLHash') { 22175 $(window).trigger('hashchange.owl.navigation'); 22176 } 22177 }, this), 22178 'prepared.owl.carousel': $.proxy(function(e) { 22179 if (e.namespace) { 22180 var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); 22181 22182 if (!hash) { 22183 return; 22184 } 22185 22186 this._hashes[hash] = e.content; 22187 } 22188 }, this), 22189 'changed.owl.carousel': $.proxy(function(e) { 22190 if (e.namespace && e.property.name === 'position') { 22191 var current = this._core.items(this._core.relative(this._core.current())), 22192 hash = $.map(this._hashes, function(item, hash) { 22193 return item === current ? hash : null; 22194 }).join(); 22195 22196 if (!hash || window.location.hash.slice(1) === hash) { 22197 return; 22198 } 22199 22200 window.location.hash = hash; 22201 } 22202 }, this) 22203 }; 22204 22205 // set default options 22206 this._core.options = $.extend({}, Hash.Defaults, this._core.options); 22207 22208 // register the event handlers 22209 this.$element.on(this._handlers); 22210 22211 // register event listener for hash navigation 22212 $(window).on('hashchange.owl.navigation', $.proxy(function(e) { 22213 var hash = window.location.hash.substring(1), 22214 items = this._core.$stage.children(), 22215 position = this._hashes[hash] && items.index(this._hashes[hash]); 22216 22217 if (position === undefined || position === this._core.current()) { 22218 return; 22219 } 22220 22221 this._core.to(this._core.relative(position), false, true); 22222 }, this)); 22223 }; 22224 22225 /** 22226 * Default options. 22227 * @public 22228 */ 22229 Hash.Defaults = { 22230 URLhashListener: false 22231 }; 22232 22233 /** 22234 * Destroys the plugin. 22235 * @public 22236 */ 22237 Hash.prototype.destroy = function() { 22238 var handler, property; 22239 22240 $(window).off('hashchange.owl.navigation'); 22241 22242 for (handler in this._handlers) { 22243 this._core.$element.off(handler, this._handlers[handler]); 22244 } 22245 for (property in Object.getOwnPropertyNames(this)) { 22246 typeof this[property] != 'function' && (this[property] = null); 22247 } 22248 }; 22249 22250 $.fn.owlCarousel.Constructor.Plugins.Hash = Hash; 22251 22252})(window.Zepto || window.jQuery, window, document); 22253 22254/** 22255 * Support Plugin 22256 * 22257 * @version 2.3.4 22258 * @author Vivid Planet Software GmbH 22259 * @author Artus Kolanowski 22260 * @author David Deutsch 22261 * @license The MIT License (MIT) 22262 */ 22263;(function($, window, document, undefined) { 22264 22265 var style = $('<support>').get(0).style, 22266 prefixes = 'Webkit Moz O ms'.split(' '), 22267 events = { 22268 transition: { 22269 end: { 22270 WebkitTransition: 'webkitTransitionEnd', 22271 MozTransition: 'transitionend', 22272 OTransition: 'oTransitionEnd', 22273 transition: 'transitionend' 22274 } 22275 }, 22276 animation: { 22277 end: { 22278 WebkitAnimation: 'webkitAnimationEnd', 22279 MozAnimation: 'animationend', 22280 OAnimation: 'oAnimationEnd', 22281 animation: 'animationend' 22282 } 22283 } 22284 }, 22285 tests = { 22286 csstransforms: function() { 22287 return !!test('transform'); 22288 }, 22289 csstransforms3d: function() { 22290 return !!test('perspective'); 22291 }, 22292 csstransitions: function() { 22293 return !!test('transition'); 22294 }, 22295 cssanimations: function() { 22296 return !!test('animation'); 22297 } 22298 }; 22299 22300 function test(property, prefixed) { 22301 var result = false, 22302 upper = property.charAt(0).toUpperCase() + property.slice(1); 22303 22304 $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) { 22305 if (style[property] !== undefined) { 22306 result = prefixed ? property : true; 22307 return false; 22308 } 22309 }); 22310 22311 return result; 22312 } 22313 22314 function prefixed(property) { 22315 return test(property, true); 22316 } 22317 22318 if (tests.csstransitions()) { 22319 /* jshint -W053 */ 22320 $.support.transition = new String(prefixed('transition')) 22321 $.support.transition.end = events.transition.end[ $.support.transition ]; 22322 } 22323 22324 if (tests.cssanimations()) { 22325 /* jshint -W053 */ 22326 $.support.animation = new String(prefixed('animation')) 22327 $.support.animation.end = events.animation.end[ $.support.animation ]; 22328 } 22329 22330 if (tests.csstransforms()) { 22331 /* jshint -W053 */ 22332 $.support.transform = new String(prefixed('transform'));
22333 $.support.transform3d = tests.csstransforms3d(); 22334 } 22335 22336})(window.Zepto || window.jQuery, window, document); 22337(function ($) { 22338 22339 var $gallery = null; 22340 22341 var methods = { 22342 init: function () { 22343 return this.each(function () { 22344 22345 var $this = $(this); 22346 var data = $this.data('waterwheel'); 22347 22348 if (!data) { 22349 $this.children(".slide").addClass("hideRight"); 22350 $this.children(".slide").eq(0).removeClass("hideRight").addClass("prevSecond"); 22351 $this.children(".slide").eq(1).removeClass("hideRight").addClass("prev"); 22352 $this.children(".slide").eq(2).removeClass("hideRight").addClass("selected"); 22353 $this.children(".slide").eq(3).removeClass("hideRight").addClass("next"); 22354 $this.children(".slide").eq(4).removeClass("hideRight").addClass("nextSecond"); 22355 22356 var $buttons = $('<div class="buttons">\ 22357 <button class= "prev-btn" ></ >\ 22358 <button class="next-btn"></button>\ 22359 </div >'); 22360 22361 $this.after($buttons); 22362 $buttons.find(".next-btn").on('click', methods.nextClick); 22363 $buttons.find(".prev-btn").on('click', methods.prevClick); 22364 22365 $this.data('waterwheel', { 22366 target: $this, 22367 prevSecond: $this.children(".slide").eq(0), 22368 prev: $this.children(".slide").eq(1), 22369 selected: $this.children(".slide").eq(2), 22370 next: $this.children(".slide").eq(3), 22371 nextSecond: $this.children(".slide").eq(4), 22372 buttons: $buttons 22373 }); 22374 $gallery = $this; 22375 methods.calcPositions(); 22376 } 22377 }); 22378 }, 22379 nextClick: function () { 22380 methods.moveTo('next'); 22381 }, 22382 prevClick: function () { 22383 methods.moveTo('prev'); 22384 }, 22385 moveTo: function (direction) { 22386 22387 var data = $gallery.data('waterwheel'); 22388 var $selected = null; 22389 22390 if (direction == "next") { 22391 $selected = data.next; 22392 } else if (direction == "prev") { 22393 $selected = data.prev; 22394 } 22395 22396 var $next = $selected.next(); 22397 var $prev = $selected.prev(); 22398 22399 if($prev.prev().length === 0 ) { 22400 var lastSlide = $gallery.find("div.slide:last-child"); 22401 lastSlide.clone().prependTo($gallery); 22402 lastSlide.remove(); 22403 } 22404 22405 if($next.next().length === 0) { 22406 var firstSlide = $gallery.find("div.slide:first-child"); 22407 firstSlide.clone().appendTo($gallery); 22408 firstSlide.remove(); 22409 } 22410 22411 var $prevSecond = $prev.prev(); 22412 var $nextSecond = $next.next(); 22413 22414 $selected.removeClass().addClass("slide").addClass("selected"); 22415 $prev.removeClass().addClass("slide").addClass("prev"); 22416 $next.removeClass().addClass("slide").addClass("next"); 22417 22418 $nextSecond.removeClass().addClass("slide").addClass("nextSecond"); 22419 $prevSecond.removeClass().addClass("slide").addClass("prevSecond"); 22420 22421 $nextSecond.nextAll().removeClass().addClass("slide").addClass('hideRight').css({"width": "auto", "left"
22421: "", "top": ""}); 22422 $prevSecond.prevAll().removeClass().addClass("slide").addClass('hideLeft').css({"width": "auto", "left": "", "top": ""}); 22423 22424 var newData = Object.assign({}, data, { 22425 prevSecond: $prevSecond, 22426 prev: $prev, 22427 selected: $selected, 22428 next: $next, 22429 nextSecond: $nextSecond, 22430 }); 22431 $gallery.data('waterwheel', newData); 22432 methods.calcPositions(); 22433 }, 22434 calcPositions: function() { 22435 var data = $gallery.data('waterwheel'); 22436 22437 var $selected = data.selected; 22438 var $next = data.next; 22439 var $prev = data.prev; 22440 var $prevSecond = data.prevSecond; 22441 var $nextSecond = data.nextSecond; 22442 22443 var containerWidth = data.target.width(); 22444 $selected.css({ top: 0 }); 22445 22446 var selectedWidth = containerWidth * 57.3 / 100; 22447 var secondWidth = containerWidth * 39 / 100; 22448 var thirdWidth = containerWidth * 29.9 / 100; 22449 22450 $selected.width(selectedWidth); 22451 $next.width(secondWidth); 22452 $prev.width(secondWidth); 22453 $nextSecond.width(thirdWidth); 22454 $prevSecond.width(thirdWidth); 22455 22456 var selectedLeft = (containerWidth - selectedWidth) / 2; 22457 $selected.css({ left: selectedLeft }); 22458 22459 var secondX = (containerWidth - selectedWidth - 2 * (secondWidth / 3)) / 2; 22460 $next.css({ left: containerWidth - secondX - secondWidth }); 22461 $prev.css({ left: secondX }); 22462 22463 var thirdX = (containerWidth - selectedWidth - 2 * (secondWidth / 3) - 2 * (thirdWidth / 3)) / 2; 22464 $nextSecond.css({ left: containerWidth - thirdX - thirdWidth }); 22465 $prevSecond.css({ left: thirdX }); 22466 22467 var secondY = (selectedWidth * 0.66878981 - secondWidth * 0.66878981) / 2; 22468 $next.css({ top: secondY }); 22469 $prev.css({ top: secondY }); 22470 22471 var thirdY = (selectedWidth * 0.66878981 - thirdWidth * 0.66878981) / 2; 22472 $nextSecond.css({ top: thirdY }); 22473 $prevSecond.css({ top: thirdY }); 22474 22475 $gallery.children('.hideRight').css({ top: thirdY}); 22476 $gallery.children('.hideLeft').css({ top: thirdY}); 22477 }, 22478 destroy: function () { 22479 return this.each(function () { 22480 22481 var $this = $(this); 22482 var data = $this.data('waterwheel'); 22483 22484 if (data) { 22485 $this.children().removeClass("hideRight"); 22486 $this.children().removeClass("prevSecond"); 22487 $this.children().removeClass("prev"); 22488 $this.children().removeClass("selected"); 22489 $this.children().removeClass("next"); 22490 $this.children().removeClass("nextSecond"); 22491 $this.children().css({"width": "auto", "left"
22491: "", "top": ""}); 22492 22493 var $buttons = data.buttons; 22494 $buttons.find(".next-btn").on('click', methods.nextClick); 22495 $buttons.find(".prev-btn").on('click', methods.prevClick); 22496 $buttons.remove(); 22497 22498 $this.removeData('waterwheel'); 22499 $gallery = null; 22500 } 22501 }); 22502 } 22503 }; 22504 22505 $.fn.waterwheel = function (method) { 22506 22507 if (methods[method]) { 22508 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 22509 } else if (typeof method === 'object' || !method) { 22510 return methods.init.apply(this, arguments); 22511 } else { 22512 $.error('ÐеÑод Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ ' + method + ' не ÑÑÑеÑÑвÑÐµÑ Ð´Ð»Ñ jQuery.waterwheel'); 22513 } 22514 22515 }; 22516})(jQuery); 22517 22518var map; 22519var windowsSize = { 22520 Medium: 2, 22521 Large: 3, 22522}; 22523 22524var mapSettingsCollection = { 22525 Large: { 22526 center: [59.99950430055228, 30.20306198749192], zoom: 14, 22527 imgUrls: ["/themes/mytimefitness/assets/img/1.png", "/themes/mytimefitness/assets/img/2.png", '/themes/mytimefitness/assets/img/3.png', '/themes/mytimefitness/assets/img/4.png'], imgSize: [55, 76] 22528 }, 22529 Medium: { 22530 center: [60.00685152257632, 30.219946304289866], zoom: 14, 22531 imgUrls: ["/themes/mytimefitness/assets/img/1small.png", "/themes/mytimefitness/assets/img/2small.png", '/themes/mytimefitness/assets/img/3small.png', '/themes/mytimefitness/assets/img/4small.png'], imgSize: [44, 58] 22532 } 22533}; 22534 22535var createLayout = function (id) { 22536 var Layout = ymaps.templateLayoutFactory.createClass( 22537 '<div class="club"></div>', 22538 { 22539 build: function () { 22540 Layout.superclass.build.call(this); 22541 var placemarkMap = this.getData().geoObject.getMap(); 22542 22543 if (!this.inited) { 22544 this.inited = true; 22545 22546 placemarkMap.events.add('sizechange', function () { 22547 this.rebuild(); 22548 }, this); 22549 22550 } 22551 22552 var img = document.createElement("img"); 22553 img.src = mapSettings.imgUrls[id]; 22554 img.width = mapSettings.imgSize[0]; 22555 img.height = mapSettings.imgSize[1]; 22556 22557 var options = this.getData().options, 22558 element = this.getParentElement().getElementsByClassName('club')[0], 22559 circleShape = { 22560 type: 'Rectangle', coordinates: [ 22561 [-mapSettings.imgSize[0] / 2, -mapSettings.imgSize[1] / 2], 22562 [mapSettings.imgSize[0] / 2, mapSettings.imgSize[1] / 2]] 22563 }; 22564 element.appendChild(img); 22565 22566 element.style.width = mapSettings.imgSize[0]; 22567 element.style.height = mapSettings.imgSize[1]; 22568 22569 element.style.marginLeft = -mapSettings.imgSize[0] / 2 + 'px'; 22570 element.style.marginTop = -mapSettings.imgSize[1] / 2 + 'px'; 22571 element.style.left = -mapSettings.imgSize[0] / 2 + 'px'; 22572 element.style.top = -mapSettings.imgSize[1] / 2 + 'px'; 22573 22574 options.set('shape', circleShape); 22575 } 22576 } 22577 ); 22578 22579 return Layout; 22580}; 22581 22582function init() { 22583 22584 var width = document.documentElement.clientWidth; 22585 22586 if (width >= 977) { 22587 currentSize = windowsSize.Large; 22588 mapSettings = mapSettingsCollection.Large; 22589 } else { 22590 currentSize = windowsSize.Medium; 22591 mapSettings = mapSettingsCollection.Medium; 22592 } 22593 22594 map = new ymaps.Map("map", { 22595 center: mapSettings.center, 22596 zoom: mapSettings.zoom, 22597 }); 22598 22599 var akademicheskaya = new ymaps.Placemark( 22600 [59.99910206407877, 30.220116499999992], { 22601 id: 0, 22602 hintContent: 'СанкÑ-ÐеÑеÑбÑÑг м.ÐеговаÑ, Ñл. ÐпÑиков 30' 22603 }, { 22604 iconLayout: createLayout(3) 22605 } 22606 ); 22607 22608 map.controls.remove('geolocationControl'); 22609 map.controls.remove('searchControl'); 22610 map.controls.remove('trafficControl'); 22611 map.controls.remove('typeSelector'); 22612 map.controls.remove('fullscreenControl'); 22613 map.controls.remove('rulerControl'); 22614 map.behaviors.disable(['scrollZoom']); 22615 map.controls.remove('zoomControl'); 22616 map.controls.add('zoomControl', { position: { right: '10px', bottom: '20px' }, size: 'small' }); 22617 22618 map.events.add('sizechange', function (event) { 22619 var size = map.container.getSize(); 22620 var width = size[0]; 22621 var toChange = false; 22622 22623 if (toChange = (width >= 975 && currentSize != windowsSize.Large)) { 22624 currentSize = windowsSize.Large; 22625 mapSettings = mapSettingsCollection.Large; 22626 22627 } else if (toChange = (width < 975 && currentSize != windowsSize.Medium)) { 22628 currentSize = windowsSize.Medium; 22629 mapSettings = mapSettingsCollection.Medium; 22630 } 22631 22632 if (toChange) { 22633 map.setCenter(mapSettings.center, mapSettings.zoom); 22634 } 22635 22636 });
22637 22638 ymaps.geoQuery(akademicheskaya).addToMap(map); 22639} 22640 22641function promoNextClick() { 22642 var next = $(this).data("next"); 22643 22644 var name = document.getElementById("promoName"); 22645 var phone = document.getElementById("promoPhone"); 22646 22647 if (!name.checkValidity()) { 22648 name.parentElement.setAttribute("style", "background-color: #FFDBDC"); 22649 } 22650 22651 if (!phone.checkValidity()) { 22652 phone.parentElement.setAttribute("style", "background-color: #FFDBDC"); 22653 } 22654 22655 if (name.checkValidity() && phone.checkValidity()) { 22656 var next = $(this).data("next"); 22657 22658 $.ajax({ 22659 url: next, 22660 dataType: 'html' 22661 }).done(function (html) { 22662 $("#promo-modal .modal-body").html(html); 22663 }); 22664 } 22665} 22666 22667var md = 992; 22668var lg = 1400; 22669 22670function announceNextClick() { 22671 var name = document.getElementById("announceName"); 22672 var phone = document.getElementById("announcePhone"); 22673 var consent = document.getElementById("annconsent"); // ÑÐµÐºÐ±Ð¾ÐºÑ ÑоглаÑÐ¸Ñ 22674 22675 // СбÑаÑÑваем пÑедÑдÑÑие ÑÑили валидаÑии 22676 name.parentElement.style.backgroundColor = ""; 22677 phone.parentElement.style.backgroundColor = ""; 22678 consent.style.outline = ""; 22679 22680 var isValid = true; 22681 22682 // ÐалидаÑÐ¸Ñ Ð¸Ð¼ÐµÐ½Ð¸ 22683 if (!name.checkValidity()) { 22684 name.parentElement.style.backgroundColor = "#FFDBDC"; 22685 isValid = false; 22686 } 22687 22688 // ÐалидаÑÐ¸Ñ ÑелеÑона 22689 if (!phone.checkValidity()) { 22690 phone.parentElement.style.backgroundColor = "#FFDBDC"; 22691 isValid = false; 22692 } 22693 22694 // ÐалидаÑÐ¸Ñ ÑекбокÑа ÑоглаÑÐ¸Ñ 22695 if (!consent.checked) { 22696 consent.style.outline = "2px solid #FFDBDC"; 22697 isValid = false; 22698 } 22699 22700 // ÐÑли вÑÑ Ð²Ð°Ð»Ð¸Ð´Ð½Ð¾ â вÑполнÑем AJAX 22701 if (isValid) { 22702 var next = $(this).data("next"); 22703 22704 $.ajax({ 22705 url: next, 22706 dataType: 'html' 22707 }).done(function (html) { 22708 $(".announce-block").html(html); 22709 }); 22710 } 22711} 22712 22713function couponNextClick() { 22714 var phone = document.getElementById("couponPhone"); 22715 var consent = document.getElementById("consent"); // ÑÐµÐºÐ±Ð¾ÐºÑ ÑоглаÑÐ¸Ñ 22716 22717 // СбÑаÑÑваем ÑÑили 22718 phone.style.backgroundColor = ""; 22719 consent.style.outline = ""; 22720 22721 var isValid = true; 22722 22723 // ÐалидаÑÐ¸Ñ ÑелеÑона 22724 if (!phone.checkValidity()) { 22725 phone.style.backgroundColor = "#FFDBDC"; 22726 isValid = false; 22727 } 22728 22729 // ÐалидаÑÐ¸Ñ ÑекбокÑа 22730 if (!consent.checked) { 22731 // Ðожно подÑвеÑиÑÑ Ð³ÑаниÑÑ, Ñ.к. Ñон ÑекбокÑа мало замеÑен 22732 consent.style.outline = "2px solid #FFDBDC"; 22733 isValid = false; 22734 } 22735 22736 // ÐÑли вÑÑ Ð²Ð°Ð»Ð¸Ð´Ð½Ð¾ â лезем в AJAX 22737 if (isValid) { 22738 var next = $(this).data("next"); 22739 22740 $.ajax({ 22741 url: next, 22742 dataType: 'html' 22743 }).done(function (html) { 22744 $(".banner-area .promo-block .inner").html(html); 22745 }); 22746 } 22747} 22748 22749 22750function bossModalNextClick() { 22751 var name = document.getElementById("bossContactName"); 22752 var phone = document.getElementById("bossContactPhone"); 22753 var email = document.getElementById("bossContactEmail"); 22754 var consent = document.getElementById("bossconsent"); // ÑÐµÐºÐ±Ð¾ÐºÑ ÑоглаÑÐ¸Ñ 22755 22756 // СбÑаÑÑваем пÑедÑдÑÑие ÑÑили валидаÑии 22757 name.parentElement.style.backgroundColor = ""; 22758 phone.parentElement.style.backgroundColor = ""; 22759 email.parentElement.style.backgroundColor = ""; 22760 consent.style.outline = ""; 22761 22762 var isValid = true; 22763 22764 // ÐалидаÑÐ¸Ñ Ð¸Ð¼ÐµÐ½Ð¸ 22765 if (!name.checkValidity()) { 22766 name.parentElement.style.backgroundColor = "#FFDBDC"; 22767 isValid = false; 22768 } 22769 22770 // ÐалидаÑÐ¸Ñ ÑелеÑона 22771 if (!phone.checkValidity()) { 22772 phone.parentElement.style.backgroundColor = "#FFDBDC"; 22773 isValid = false; 22774 } 22775 22776 // ÐалидаÑÐ¸Ñ email 22777 if (!email.checkValidity()) { 22778 email.parentElement.style.backgroundColor = "#FFDBDC"; 22779 isValid = false; 22780 } 22781 22782 // ÐалидаÑÐ¸Ñ ÑекбокÑа ÑоглаÑÐ¸Ñ 22783 if (!consent.checked) { 22784 consent.style.outline = "2px solid #FFDBDC"; 22785 isValid = false; 22786 } 22787 22788 // ÐÑли вÑÑ Ð²Ð°Ð»Ð¸Ð´Ð½Ð¾ â вÑполнÑем AJAX 22789 if (isValid) { 22790 var next = $(this).data("next"); 22791 $.ajax({
22792 url: next, 22793 dataType: 'html' 22794 }).done(function (html) { 22795 $("#contact-boss-modal .modal-body").html(html); 22796 }); 22797 } 22798} 22799 22800function setClubName() { 22801 sessionStorage.setItem('club-link', 'optikov'); 22802 sessionStorage.setItem('club-name', 'ÐпÑиков'); 22803 setCookie('setClub', "optikov", 240) 22804 22805 22806 $('#club-name').html('<span class="n-bottom-club">ÐпÑиков</span>'); 22807 $('#header-club-name').html('ÐпÑиков'); 22808} 22809 22810function scrollToSection() { 22811 var hash = sessionStorage.getItem('club-hash'); 22812 22813 if (hash) { 22814 setTimeout(function () { 22815 $('html, body').animate({ 22816 scrollTop: $(hash).offset().top 22817 }, 'slow', function () { 22818 22819 sessionStorage.removeItem('club-hash') 22820 }); 22821 22822 }, 1000); 22823 } 22824} 22825 22826function pageNavClick(event) { 22827 event.preventDefault(); 22828 22829 if (this.hash !== "") { 22830 var hash = this.hash; 22831 22832 $('html, body').animate({ 22833 scrollTop: $(hash).offset().top 22834 }, 'slow'); 22835 } 22836} 22837 22838$(function () { 22839 22840 setClubName(); 22841 scrollToSection(); 22842 22843 $('.navbar a.nav-link').click(pageNavClick); 22844 $("a.page-nav-item").click(pageNavClick); 22845 22846 $('#signupFormBtn').bind("click", announceNextClick); 22847 $('#couponFormBtn').bind("click", couponNextClick); 22848 22849 $("#couponPhone").mask("+7(999) 999-99-99"); 22850 $("#bossContactPhone").mask("+7(999) 999-99-99"); 22851 $("#announcePhone").mask("+7(999) 999-99-99"); 22852 22853 $('#promo-modal').on('show.bs.modal', function (e) { 22854 $("#promo-modal .promo-btn").bind("click", promoNextClick); 22855 $("#promoPhone").mask("+7(999) 999-99-99"); 22856 22857 $('#selectedPromoClub').val('ÐпÑиков'); 22858 }); 22859 22860 $('.gallery-area button.prev-btn').click(function () { 22861 moveToSelected('prev'); 22862 }); 22863 22864 $('.gallery-area button.next-btn').click(function () { 22865 moveToSelected('next'); 22866 }); 22867 22868 $('#contact-boss-modal').on('shown.bs.modal', function (e) { 22869 $("#contact-boss-modal .promo-btn").bind("click", bossModalNextClick); 22870 }); 22871 22872 var galleryOwl = $('.gallery-carousel'), 22873 galleryOwlOptions = { 22874 loop: true, 22875 mouseDrag: false, 22876 navText: ["", ""], 22877 responsive: { 22878 0: { 22879 items: 1, 22880 nav: true 22881 } 22882 } 22883 }; 22884 22885 var owl = $('.scheme-slides'), 22886 owlOptions = { 22887 loop: true, 22888 mouseDrag: false, 22889 navText: ["", ""], 22890 dots: false, 22891 items: 1, 22892 onTranslated: function (property) { 22893 $(".number-animation").removeClass("number-scale"); 22894 22895 var current = property.item.index; 22896 var item = $(property.target).find(".owl-item").eq(current).find(".slide").data('number'); 22897 22898 $('.' + item).addClass('number-scale'); 22899 } 22900 }; 22901 22902 if ($(window).width() < md) { 22903 owl.owlCarousel(owlOptions); 22904 } else { 22905 owl.addClass('off'); 22906 } 22907 22908 if ($(window).width() < lg) { 22909 galleryOwl.addClass('owl-carousel'); 22910 galleryOwl.owlCarousel(galleryOwlOptions); 22911 } else { 22912 $(".gallery-carousel").waterwheel(); 22913 galleryOwl.addClass('off'); 22914 } 22915 22916 $(window).resize(function () { 22917 22918 if ($(window).width() < md) { 22919 if ($('.scheme-slides').hasClass('off')) { 22920 owl.owlCarousel(owlOptions); 22921 owl.removeClass('off'); 22922 } 22923 } else { 22924 if (!$('.scheme-slides').hasClass('off')) { 22925 owl.addClass('off').trigger('destroy.owl.carousel'); 22926 owl.find('.owl-stage-outer').children(':eq(0)').unwrap(); 22927 } 22928 } 22929 22930 if ($(window).width() < lg) { 22931 $(".gallery-carousel").waterwheel('destroy'); 22932 if ($('.gallery-carousel').hasClass('off')) { 22933 galleryOwl.addClass('owl-carousel'); 22934 galleryOwl.owlCarousel(galleryOwlOptions); 22935 galleryOwl.removeClass('off'); 22936 } 22937 } else { 22938 galleryOwl.removeClass('owl-carousel'); 22939 22940 if (!$('.gallery-carousel').hasClass('off')) { 22941 galleryOwl.addClass('off').trigger('destroy.owl.carousel'); 22942 galleryOwl.find('.owl-stage-outer').children(':eq(0)').unwrap(); 22943 } 22944 22945 $(".gallery-carousel").waterwheel(); 22946 } 22947 22948 });
22949 22950 $("#scroll-control").click(function () { 22951 $("html, body").animate({ scrollTop: 0 }, "slow"); 22952 return false; 22953 }); 22954 22955 $(window).scroll(function () { 22956 if ($(this).scrollTop()) { 22957 $('#scroll-control').fadeIn(); 22958 } else { 22959 $('#scroll-control').fadeOut(); 22960 } 22961 }); 22962 22963});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.