vendor: 2,248 bytes, lines 1-79
1/*! 2 * jQuery JavaScript Library v3.7.1 3 * https://jquery.com/ 4 * 5 * Copyright OpenJS Foundation and other contributors 6 * Released under the MIT license 7 * https://jquery.org/license 8 * 9 * Date: 2023-08-28T13:37Z 10 */ 11( function( global, factory ) { 12 13 "use strict"; 14 15 if ( typeof module === "object" && typeof module.exports === "object" ) { 16 17 // For CommonJS and CommonJS-like environments where a proper `window` 18 // is present, execute the factory and get jQuery. 19 // For environments that do not have a `window` with a `document` 20 // (such as Node.js), expose a factory as module.exports. 21 // This accentuates the need for the creation of a real `window`. 22 // e.g. var jQuery = require("jquery")(window); 23 // See ticket trac-14549 for more info. 24 module.exports = global.document ? 25 factory( global, true ) : 26 function( w ) { 27 if ( !w.document ) { 28 throw new Error( "jQuery requires a window with a document" ); 29 } 30 return factory( w ); 31 }; 32 } else { 33 factory( global ); 34 } 35 36// Pass this if window is not defined yet 37} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 38 39// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 40// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 41// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 42// enough that all such attempts are guarded in a try block. 43"use strict"; 44 45var arr = []; 46 47var getProto = Object.getPrototypeOf; 48 49var slice = arr.slice; 50 51var flat = arr.flat ? function( array ) { 52 return arr.flat.call( array ); 53} : function( array ) { 54 return arr.concat.apply( [], array ); 55}; 56 57 58var push = arr.push; 59 60var indexOf = arr.indexOf; 61 62var class2type = {}; 63 64var toString = class2type.toString; 65 66var hasOwn = class2type.hasOwnProperty; 67 68var fnToString = hasOwn.toString; 69 70var ObjectFunctionString = fnToString.call( Object ); 71 72var support = {}; 73 74var isFunction = function isFunction( obj ) { 75 76 // Support: Chrome <=57, Firefox <=52 77 // In some browsers, typeof returns "function" for HTML <object> elements 78 // (i.e., `typeof document.createElement( "object" ) === "function"`). 79 // We don't want to classify *any* DOM node as a function.
vendor: 10,176 bytes, lines 80-508
80 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 81 // Plus for old WebKit, typeof returns "function" for HTML collections 82 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 83 return typeof obj === "function" && typeof obj.nodeType !== "number" && 84 typeof obj.item !== "function"; 85 }; 86 87 88var isWindow = function isWindow( obj ) { 89 return obj != null && obj === obj.window; 90 }; 91 92 93var document = window.document; 94 95 96 97 var preservedScriptAttributes = { 98 type: true, 99 src: true, 100 nonce: true, 101 noModule: true 102 }; 103 104 function DOMEval( code, node, doc ) { 105 doc = doc || document; 106 107 var i, val, 108 script = doc.createElement( "script" ); 109 110 script.text = code; 111 if ( node ) { 112 for ( i in preservedScriptAttributes ) { 113 114 // Support: Firefox 64+, Edge 18+ 115 // Some browsers don't support the "nonce" property on scripts. 116 // On the other hand, just using `getAttribute` is not enough as 117 // the `nonce` attribute is reset to an empty string whenever it 118 // becomes browsing-context connected. 119 // See https://github.com/whatwg/html/issues/2369 120 // See https://html.spec.whatwg.org/#nonce-attributes 121 // The `node.getAttribute` check was added for the sake of 122 // `jQuery.globalEval` so that it can fake a nonce-containing node 123 // via an object. 124 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 125 if ( val ) { 126 script.setAttribute( i, val ); 127 } 128 } 129 } 130 doc.head.appendChild( script ).parentNode.removeChild( script ); 131 } 132 133 134function toType( obj ) { 135 if ( obj == null ) { 136 return obj + ""; 137 } 138 139 // Support: Android <=2.3 only (functionish RegExp) 140 return typeof obj === "object" || typeof obj === "function" ? 141 class2type[ toString.call( obj ) ] || "object" : 142 typeof obj; 143} 144/* global Symbol */ 145// Defining this global in .eslintrc.json would create a danger of using the global 146// unguarded in another place, it seems safer to define global only for this module 147 148 149 150var version = "3.7.1", 151 152 rhtmlSuffix = /HTML$/i, 153 154 // Define a local copy of jQuery 155 jQuery = function( selector, context ) { 156 157 // The jQuery object is actually just the init constructor 'enhanced' 158 // Need init if jQuery is called (just allow error to be thrown if not included) 159 return new jQuery.fn.init( selector, context ); 160 }; 161 162jQuery.fn = jQuery.prototype = { 163 164 // The current version of jQuery being used 165 jquery: version, 166 167 constructor: jQuery, 168 169 // The default length of a jQuery object is 0 170 length: 0, 171 172 toArray: function() { 173 return slice.call( this ); 174 }, 175 176 // Get the Nth element in the matched element set OR 177 // Get the whole matched element set as a clean array 178 get: function( num ) { 179 180 // Return all the elements in a clean array 181 if ( num == null ) { 182 return slice.call( this ); 183 } 184 185 // Return just the one element from the set 186 return num < 0 ? this[ num + this.length ] : this[ num ]; 187 }, 188 189 // Take an array of elements and push it onto the stack 190 // (returning the new matched element set) 191 pushStack: function( elems ) { 192 193 // Build a new jQuery matched element set 194 var ret = jQuery.merge( this.constructor(), elems ); 195 196 // Add the old object onto the stack (as a reference) 197 ret.prevObject = this; 198 199 // Return the newly-formed element set 200 return ret; 201 }, 202 203 // Execute a callback for every element in the matched set. 204 each: function( callback ) { 205 return jQuery.each( this, callback ); 206 }, 207 208 map: function( callback ) { 209 return this.pushStack( jQuery.map( this, function( elem, i ) { 210 return callback.call( elem, i, elem ); 211 } ) ); 212 }, 213 214 slice: function() { 215 return this.pushStack( slice.apply( this, arguments ) ); 216 }, 217 218 first: function() { 219 return this.eq( 0 ); 220 }, 221 222 last: function() { 223 return this.eq( -1 ); 224 }, 225 226 even: function() { 227 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 228 return ( i + 1 ) % 2; 229 } ) ); 230 }, 231 232 odd: function() { 233 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 234 return i % 2; 235 } ) ); 236 }, 237 238 eq: function( i ) { 239 var len = this.length, 240 j = +i + ( i < 0 ? len : 0 ); 241 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 242 }, 243 244 end: function() { 245 return this.prevObject || this.constructor(); 246 }, 247 248 // For internal use only. 249 // Behaves like an Array's method, not like a jQuery method. 250 push: push, 251 sort: arr.sort, 252 splice: arr.splice 253}; 254 255jQuery.extend = jQuery.fn.extend = function() { 256 var options, name, src, copy, copyIsArray, clone, 257 target = arguments[ 0 ] || {}, 258 i = 1, 259 length = arguments.length, 260 deep = false; 261 262 // Handle a deep copy situation 263 if ( typeof target === "boolean" ) { 264 deep = target; 265 266 // Skip the boolean and the target 267 target = arguments[ i ] || {}; 268 i++; 269 } 270 271 // Handle case when target is a string or something (possible in deep copy) 272 if ( typeof target !== "object" && !isFunction( target ) ) { 273 target = {}; 274 } 275 276 // Extend jQuery itself if only one argument is passed 277 if ( i === length ) { 278 target = this; 279 i--; 280 } 281 282 for ( ; i < length; i++ ) { 283 284 // Only deal with non-null/undefined values 285 if ( ( options = arguments[ i ] ) != null ) { 286 287 // Extend the base object 288 for ( name in options ) { 289 copy = options[ name ]; 290 291 // Prevent Object.prototype pollution 292 // Prevent never-ending loop 293 if ( name === "__proto__" || target === copy ) { 294 continue; 295 } 296 297 // Recurse if we're merging plain objects or arrays 298 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 299 ( copyIsArray = Array.isArray( copy ) ) ) ) { 300 src = target[ name ]; 301 302 // Ensure proper type for the source value 303 if ( copyIsArray && !Array.isArray( src ) ) { 304 clone = []; 305 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 306 clone = {}; 307 } else { 308 clone = src; 309 } 310 copyIsArray = false; 311 312 // Never move original objects, clone them 313 target[ name ] = jQuery.extend( deep, clone, copy ); 314 315 // Don't bring in undefined values 316 } else if ( copy !== undefined ) { 317 target[ name ] = copy; 318 } 319 } 320 } 321 } 322 323 // Return the modified object 324 return target; 325}; 326 327jQuery.extend( { 328 329 // Unique for each copy of jQuery on the page 330 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 331 332 // Assume jQuery is ready without the ready module 333 isReady: true, 334 335 error: function( msg ) { 336 throw new Error( msg ); 337 }, 338 339 noop: function() {}, 340 341 isPlainObject: function( obj ) { 342 var proto, Ctor; 343 344 // Detect obvious negatives 345 // Use toString instead of jQuery.type to catch host objects 346 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 347 return false; 348 } 349 350 proto = getProto( obj ); 351 352 // Objects with no prototype (e.g., `Object.create( null )`) are plain 353 if ( !proto ) { 354 return true; 355 } 356 357 // Objects with prototype are plain iff they were constructed by a global Object function 358 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 359 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 360 }, 361 362 isEmptyObject: function( obj ) { 363 var name; 364 365 for ( name in obj ) { 366 return false; 367 } 368 return true; 369 }, 370 371 // Evaluates a script in a provided context; falls back to the global one 372 // if not specified. 373 globalEval: function( code, options, doc ) { 374 DOMEval( code, { nonce: options && options.nonce }, doc ); 375 }, 376 377 each: function( obj, callback ) { 378 var length, i = 0; 379 380 if ( isArrayLike( obj ) ) { 381 length = obj.length; 382 for ( ; i < length; i++ ) { 383 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 384 break; 385 } 386 } 387 } else { 388 for ( i in obj ) { 389 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 390 break; 391 } 392 } 393 } 394 395 return obj; 396 }, 397 398 399 // Retrieve the text value of an array of DOM nodes 400 text: function( elem ) { 401 var node, 402 ret = "", 403 i = 0, 404 nodeType = elem.nodeType; 405 406 if ( !nodeType ) { 407 408 // If no nodeType, this is expected to be an array 409 while ( ( node = elem[ i++ ] ) ) { 410 411 // Do not traverse comment nodes 412 ret += jQuery.text( node ); 413 } 414 } 415 if ( nodeType === 1 || nodeType === 11 ) { 416 return elem.textContent; 417 } 418 if ( nodeType === 9 ) { 419 return elem.documentElement.textContent; 420 } 421 if ( nodeType === 3 || nodeType === 4 ) { 422 return elem.nodeValue; 423 } 424 425 // Do not include comment or processing instruction nodes 426 427 return ret; 428 }, 429 430 // results is for internal usage only 431 makeArray: function( arr, results ) { 432 var ret = results || []; 433 434 if ( arr != null ) { 435 if ( isArrayLike( Object( arr ) ) ) { 436 jQuery.merge( ret, 437 typeof arr === "string" ? 438 [ arr ] : arr 439 ); 440 } else { 441 push.call( ret, arr ); 442 } 443 } 444 445 return ret; 446 }, 447 448 inArray: function( elem, arr, i ) { 449 return arr == null ? -1 : indexOf.call( arr, elem, i ); 450 }, 451 452 isXMLDoc: function( elem ) { 453 var namespace = elem && elem.namespaceURI, 454 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 455 456 // Assume HTML when documentElement doesn't yet exist, such as inside 457 // document fragments. 458 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 459 }, 460 461 // Support: Android <=4.0 only, PhantomJS 1 only 462 // push.apply(_, arraylike) throws on ancient WebKit 463 merge: function( first, second ) { 464 var len = +second.length, 465 j = 0, 466 i = first.length; 467 468 for ( ; j < len; j++ ) { 469 first[ i++ ] = second[ j ]; 470 } 471 472 first.length = i; 473 474 return first; 475 }, 476 477 grep: function( elems, callback, invert ) { 478 var callbackInverse, 479 matches = [], 480 i = 0, 481 length = elems.length, 482 callbackExpect = !invert; 483 484 // Go through the array, only saving the items 485 // that pass the validator function 486 for ( ; i < length; i++ ) { 487 callbackInverse = !callback( elems[ i ], i ); 488 if ( callbackInverse !== callbackExpect ) { 489 matches.push( elems[ i ] ); 490 } 491 } 492 493 return matches; 494 }, 495 496 // arg is for internal usage only 497 map: function( elems, callback, arg ) { 498 var length, value, 499 i = 0, 500 ret = []; 501 502 // Go through the array, translating each of the items to their new values 503 if ( isArrayLike( elems ) ) { 504 length = elems.length; 505 for ( ; i < length; i++ ) { 506 value = callback( elems[ i ], i, arg ); 507 508 if ( value != null ) {
vendor: 17,514 bytes, lines 509-1130
509 ret.push( value ); 510 } 511 } 512 513 // Go through every key on the object, 514 } else { 515 for ( i in elems ) { 516 value = callback( elems[ i ], i, arg ); 517 518 if ( value != null ) { 519 ret.push( value ); 520 } 521 } 522 } 523 524 // Flatten any nested arrays 525 return flat( ret ); 526 }, 527 528 // A global GUID counter for objects 529 guid: 1, 530 531 // jQuery.support is not used in Core but other projects attach their 532 // properties to it so it needs to exist. 533 support: support 534} ); 535 536if ( typeof Symbol === "function" ) { 537 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 538} 539 540// Populate the class2type map 541jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 542 function( _i, name ) { 543 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 544 } ); 545 546function isArrayLike( obj ) { 547 548 // Support: real iOS 8.2 only (not reproducible in simulator) 549 // `in` check used to prevent JIT error (gh-2145) 550 // hasOwn isn't used here due to false negatives 551 // regarding Nodelist length in IE 552 var length = !!obj && "length" in obj && obj.length, 553 type = toType( obj ); 554 555 if ( isFunction( obj ) || isWindow( obj ) ) { 556 return false; 557 } 558 559 return type === "array" || length === 0 || 560 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 561} 562 563 564function nodeName( elem, name ) { 565 566 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 567 568} 569var pop = arr.pop; 570 571 572var sort = arr.sort; 573 574 575var splice = arr.splice; 576 577 578var whitespace = "[\\x20\\t\\r\\n\\f]"; 579 580 581var rtrimCSS = new RegExp( 582 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 583 "g" 584); 585 586 587 588 589// Note: an element does not contain itself 590jQuery.contains = function( a, b ) { 591 var bup = b && b.parentNode; 592 593 return a === bup || !!( bup && bup.nodeType === 1 && ( 594 595 // Support: IE 9 - 11+ 596 // IE doesn't have `contains` on SVG. 597 a.contains ? 598 a.contains( bup ) : 599 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 600 ) ); 601}; 602 603 604 605 606// CSS string/identifier serialization 607// https://drafts.csswg.org/cssom/#common-serializing-idioms 608var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 609 610function fcssescape( ch, asCodePoint ) { 611 if ( asCodePoint ) { 612 613 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 614 if ( ch === "\0" ) { 615 return "\uFFFD"; 616 } 617 618 // Control characters and (dependent upon position) numbers get escaped as code points 619 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 620 } 621 622 // Other potentially-special ASCII characters get backslash-escaped 623 return "\\" + ch; 624} 625 626jQuery.escapeSelector = function( sel ) { 627 return ( sel + "" ).replace( rcssescape, fcssescape ); 628}; 629 630 631 632 633var preferredDoc = document, 634 pushNative = push; 635 636( function() { 637 638var i, 639 Expr, 640 outermostContext, 641 sortInput, 642 hasDuplicate, 643 push = pushNative, 644 645 // Local document vars 646 document, 647 documentElement, 648 documentIsHTML, 649 rbuggyQSA, 650 matches, 651 652 // Instance-specific data 653 expando = jQuery.expando, 654 dirruns = 0, 655 done = 0, 656 classCache = createCache(), 657 tokenCache = createCache(), 658 compilerCache = createCache(), 659 nonnativeSelectorCache = createCache(), 660 sortOrder = function( a, b ) { 661 if ( a === b ) { 662 hasDuplicate = true; 663 } 664 return 0; 665 }, 666 667 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 668 "loop|multiple|open|readonly|required|scoped", 669 670 // Regular expressions 671 672 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 673 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 674 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 675 676 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 677 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 678 679 // Operator (capture 2) 680 "*([*^$|!~]?=)" + whitespace + 681 682 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 683 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 684 whitespace + "*\\]", 685 686 pseudos = ":(" + identifier + ")(?:\\((" + 687 688 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 689 // 1. quoted (capture 3; capture 4 or capture 5) 690 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 691 692 // 2. simple (capture 6) 693 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 694 695 // 3. anything else (capture 2) 696 ".*" + 697 ")\\)|)", 698 699 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 700 rwhitespace = new RegExp( whitespace + "+", "g" ), 701 702 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 703 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 704 whitespace + "*" ), 705 rdescend = new RegExp( whitespace + "|>" ), 706 707 rpseudo = new RegExp( pseudos ), 708 ridentifier = new RegExp( "^" + identifier + "$" ), 709 710 matchExpr = { 711 ID: new RegExp( "^#(" + identifier + ")" ), 712 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 713 TAG: new RegExp( "^(" + identifier + "|[*])" ), 714 ATTR: new RegExp( "^" + attributes ), 715 PSEUDO: new RegExp( "^" + pseudos ), 716 CHILD: new RegExp( 717 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 718 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 719 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 720 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 721 722 // For use in libraries implementing .is() 723 // We use this for POS matching in `select` 724 needsContext: new RegExp( "^" + whitespace + 725 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 726 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 727 }, 728 729 rinputs = /^(?:input|select|textarea|button)$/i, 730 rheader = /^h\d$/i, 731 732 // Easily-parseable/retrievable ID or TAG or CLASS selectors 733 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 734 735 rsibling = /[+~]/, 736 737 // CSS escapes 738 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 739 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 740 "?|\\\\([^\\r\\n\\f])", "g" ), 741 funescape = function( escape, nonHex ) { 742 var high = "0x" + escape.slice( 1 ) - 0x10000; 743 744 if ( nonHex ) { 745 746 // Strip the backslash prefix from a non-hex escape sequence 747 return nonHex; 748 } 749 750 // Replace a hexadecimal escape sequence with the encoded Unicode code point 751 // Support: IE <=11+ 752 // For values outside the Basic Multilingual Plane (BMP), manually construct a 753 // surrogate pair 754 return high < 0 ? 755 String.fromCharCode( high + 0x10000 ) : 756 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 757 }, 758 759 // Used for iframes; see `setDocument`. 760 // Support: IE 9 - 11+, Edge 12 - 18+ 761 // Removing the function wrapper causes a "Permission Denied" 762 // error in IE/Edge. 763 unloadHandler = function() { 764 setDocument(); 765 }, 766 767 inDisabledFieldset = addCombinator( 768 function( elem ) { 769 return elem.disabled === true && nodeName( elem, "fieldset" ); 770 }, 771 { dir: "parentNode", next: "legend" } 772 ); 773 774// Support: IE <=9 only 775// Accessing document.activeElement can throw unexpectedly 776// https://bugs.jquery.com/ticket/13393 777function safeActiveElement() { 778 try { 779 return document.activeElement; 780 } catch ( err ) { } 781} 782 783// Optimize for push.apply( _, NodeList ) 784try { 785 push.apply( 786 ( arr = slice.call( preferredDoc.childNodes ) ), 787 preferredDoc.childNodes 788 ); 789 790 // Support: Android <=4.0 791 // Detect silently failing push.apply 792 // eslint-disable-next-line no-unused-expressions 793 arr[ preferredDoc.childNodes.length ].nodeType; 794} catch ( e ) { 795 push = { 796 apply: function( target, els ) { 797 pushNative.apply( target, slice.call( els ) ); 798 }, 799 call: function( target ) { 800 pushNative.apply( target, slice.call( arguments, 1 ) ); 801 } 802 }; 803} 804 805function find( selector, context, results, seed ) { 806 var m, i, elem, nid, match, groups, newSelector, 807 newContext = context && context.ownerDocument, 808 809 // nodeType defaults to 9, since context defaults to document 810 nodeType = context ? context.nodeType : 9; 811 812 results = results || []; 813 814 // Return early from calls with invalid selector or context 815 if ( typeof selector !== "string" || !selector || 816 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 817 818 return results; 819 } 820 821 // Try to shortcut find operations (as opposed to filters) in HTML documents 822 if ( !seed ) { 823 setDocument( context ); 824 context = context || document; 825 826 if ( documentIsHTML ) { 827 828 // If the selector is sufficiently simple, try using a "get*By*" DOM method 829 // (excepting DocumentFragment context, where the methods don't exist) 830 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 831 832 // ID selector 833 if ( ( m = match[ 1 ] ) ) { 834 835 // Document context 836 if ( nodeType === 9 ) { 837 if ( ( elem = context.getElementById( m ) ) ) { 838 839 // Support: IE 9 only 840 // getElementById can match elements by name instead of ID 841 if ( elem.id === m ) { 842 push.call( results, elem ); 843 return results; 844 } 845 } else { 846 return results; 847 } 848 849 // Element context 850 } else { 851 852 // Support: IE 9 only 853 // getElementById can match elements by name instead of ID 854 if ( newContext && ( elem = newContext.getElementById( m ) ) && 855 find.contains( context, elem ) && 856 elem.id === m ) { 857 858 push.call( results, elem ); 859 return results; 860 } 861 } 862 863 // Type selector 864 } else if ( match[ 2 ] ) { 865 push.apply( results, context.getElementsByTagName( selector ) ); 866 return results; 867 868 // Class selector 869 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 870 push.apply( results, context.getElementsByClassName( m ) ); 871 return results; 872 } 873 } 874 875 // Take advantage of querySelectorAll 876 if ( !nonnativeSelectorCache[ selector + " " ] && 877 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 878 879 newSelector = selector; 880 newContext = context; 881 882 // qSA considers elements outside a scoping root when evaluating child or 883 // descendant combinators, which is not what we want. 884 // In such cases, we work around the behavior by prefixing every selector in the 885 // list with an ID selector referencing the scope context. 886 // The technique has to be used as well when a leading combinator is used 887 // as such selectors are not recognized by querySelectorAll. 888 // Thanks to Andrew Dupont for this technique. 889 if ( nodeType === 1 && 890 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 891 892 // Expand context for sibling selectors 893 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 894 context; 895 896 // We can use :scope instead of the ID hack if the browser 897 // supports it & if we're not changing the context. 898 // Support: IE 11+, Edge 17 - 18+ 899 // IE/Edge sometimes throw a "Permission denied" error when 900 // strict-comparing two documents; shallow comparisons work. 901 // eslint-disable-next-line eqeqeq 902 if ( newContext != context || !support.scope ) { 903 904 // Capture the context ID, setting it first if necessary 905 if ( ( nid = context.getAttribute( "id" ) ) ) { 906 nid = jQuery.escapeSelector( nid ); 907 } else { 908 context.setAttribute( "id", ( nid = expando ) ); 909 } 910 } 911 912 // Prefix every selector in the list 913 groups = tokenize( selector ); 914 i = groups.length; 915 while ( i-- ) { 916 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 917 toSelector( groups[ i ] ); 918 } 919 newSelector = groups.join( "," ); 920 } 921 922 try { 923 push.apply( results, 924 newContext.querySelectorAll( newSelector ) 925 ); 926 return results; 927 } catch ( qsaError ) { 928 nonnativeSelectorCache( selector, true ); 929 } finally { 930 if ( nid === expando ) { 931 context.removeAttribute( "id" ); 932 } 933 } 934 } 935 } 936 } 937 938 // All others 939 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 940} 941 942/** 943 * Create key-value caches of limited size 944 * @returns {function(string, object)} Returns the Object data after storing it on itself with 945 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 946 * deleting the oldest entry 947 */ 948function createCache() { 949 var keys = []; 950 951 function cache( key, value ) { 952 953 // Use (key + " ") to avoid collision with native prototype properties 954 // (see https://github.com/jquery/sizzle/issues/157) 955 if ( keys.push( key + " " ) > Expr.cacheLength ) { 956 957 // Only keep the most recent entries 958 delete cache[ keys.shift() ]; 959 } 960 return ( cache[ key + " " ] = value ); 961 } 962 return cache; 963} 964 965/** 966 * Mark a function for special use by jQuery selector module 967 * @param {Function} fn The function to mark 968 */ 969function markFunction( fn ) { 970 fn[ expando ] = true; 971 return fn; 972} 973 974/** 975 * Support testing using an element 976 * @param {Function} fn Passed the created element and returns a boolean result 977 */ 978function assert( fn ) { 979 var el = document.createElement( "fieldset" ); 980 981 try { 982 return !!fn( el ); 983 } catch ( e ) { 984 return false; 985 } finally { 986 987 // Remove from its parent by default 988 if ( el.parentNode ) { 989 el.parentNode.removeChild( el ); 990 } 991 992 // release memory in IE 993 el = null; 994 } 995} 996 997/** 998 * Returns a function to use in pseudos for input types 999 * @param {String} type 1000 */ 1001function createInputPseudo( type ) { 1002 return function( elem ) { 1003 return nodeName( elem, "input" ) && elem.type === type; 1004 }; 1005} 1006 1007/** 1008 * Returns a function to use in pseudos for buttons 1009 * @param {String} type 1010 */ 1011function createButtonPseudo( type ) { 1012 return function( elem ) { 1013 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 1014 elem.type === type; 1015 }; 1016} 1017 1018/** 1019 * Returns a function to use in pseudos for :enabled/:disabled 1020 * @param {Boolean} disabled true for :disabled; false for :enabled 1021 */ 1022function createDisabledPseudo( disabled ) { 1023 1024 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 1025 return function( elem ) { 1026 1027 // Only certain elements can match :enabled or :disabled 1028 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 1029 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 1030 if ( "form" in elem ) { 1031 1032 // Check for inherited disabledness on relevant non-disabled elements: 1033 // * listed form-associated elements in a disabled fieldset 1034 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 1035 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 1036 // * option elements in a disabled optgroup 1037 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 1038 // All such elements have a "form" property. 1039 if ( elem.parentNode && elem.disabled === false ) { 1040 1041 // Option elements defer to a parent optgroup if present 1042 if ( "label" in elem ) { 1043 if ( "label" in elem.parentNode ) { 1044 return elem.parentNode.disabled === disabled; 1045 } else { 1046 return elem.disabled === disabled; 1047 } 1048 } 1049 1050 // Support: IE 6 - 11+ 1051 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 1052 return elem.isDisabled === disabled || 1053 1054 // Where there is no isDisabled, check manually 1055 elem.isDisabled !== !disabled && 1056 inDisabledFieldset( elem ) === disabled; 1057 } 1058 1059 return elem.disabled === disabled; 1060 1061 // Try to winnow out elements that can't be disabled before trusting the disabled property. 1062 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 1063 // even exist on them, let alone have a boolean value. 1064 } else if ( "label" in elem ) { 1065 return elem.disabled === disabled; 1066 } 1067 1068 // Remaining elements are neither :enabled nor :disabled 1069 return false; 1070 }; 1071} 1072 1073/** 1074 * Returns a function to use in pseudos for positionals 1075 * @param {Function} fn 1076 */ 1077function createPositionalPseudo( fn ) { 1078 return markFunction( function( argument ) { 1079 argument = +argument; 1080 return markFunction( function( seed, matches ) { 1081 var j, 1082 matchIndexes = fn( [], seed.length, argument ), 1083 i = matchIndexes.length; 1084 1085 // Match elements found at the specified indexes 1086 while ( i-- ) { 1087 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 1088 seed[ j ] = !( matches[ j ] = seed[ j ] ); 1089 } 1090 } 1091 } ); 1092 } ); 1093} 1094 1095/** 1096 * Checks a node for validity as a jQuery selector context 1097 * @param {Element|Object=} context 1098 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1099 */ 1100function testContext( context ) { 1101 return context && typeof context.getElementsByTagName !== "undefined" && context; 1102} 1103 1104/** 1105 * Sets document-related variables once based on the current document 1106 * @param {Element|Object} [node] An element or document object to use to set the document 1107 * @returns {Object} Returns the current document 1108 */ 1109function setDocument( node ) { 1110 var subWindow, 1111 doc = node ? node.ownerDocument || node : preferredDoc; 1112 1113 // Return early if doc is invalid or already selected 1114 // Support: IE 11+, Edge 17 - 18+ 1115 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1116 // two documents; shallow comparisons work. 1117 // eslint-disable-next-line eqeqeq 1118 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 1119 return document; 1120 } 1121 1122 // Update global variables 1123 document = doc; 1124 documentElement = document.documentElement; 1125 documentIsHTML = !jQuery.isXMLDoc( document ); 1126 1127 // Support: iOS 7 only, IE 9 - 11+ 1128 // Older browsers didn't support unprefixed `matches`. 1129 matches = documentElement.matches || 1130 documentElement.webkitMatchesSelector ||
vendor: 4,667 bytes, lines 1131-1282
1131 documentElement.msMatchesSelector; 1132 1133 // Support: IE 9 - 11+, Edge 12 - 18+ 1134 // Accessing iframe documents after unload throws "permission denied" errors 1135 // (see trac-13936). 1136 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 1137 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 1138 if ( documentElement.msMatchesSelector && 1139 1140 // Support: IE 11+, Edge 17 - 18+ 1141 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1142 // two documents; shallow comparisons work. 1143 // eslint-disable-next-line eqeqeq 1144 preferredDoc != document && 1145 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 1146 1147 // Support: IE 9 - 11+, Edge 12 - 18+ 1148 subWindow.addEventListener( "unload", unloadHandler ); 1149 } 1150 1151 // Support: IE <10 1152 // Check if getElementById returns elements by name 1153 // The broken getElementById methods don't pick up programmatically-set names, 1154 // so use a roundabout getElementsByName test 1155 support.getById = assert( function( el ) { 1156 documentElement.appendChild( el ).id = jQuery.expando; 1157 return !document.getElementsByName || 1158 !document.getElementsByName( jQuery.expando ).length; 1159 } ); 1160 1161 // Support: IE 9 only 1162 // Check to see if it's possible to do matchesSelector 1163 // on a disconnected node. 1164 support.disconnectedMatch = assert( function( el ) { 1165 return matches.call( el, "*" ); 1166 } ); 1167 1168 // Support: IE 9 - 11+, Edge 12 - 18+ 1169 // IE/Edge don't support the :scope pseudo-class. 1170 support.scope = assert( function() { 1171 return document.querySelectorAll( ":scope" ); 1172 } ); 1173 1174 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 1175 // Make sure the `:has()` argument is parsed unforgivingly. 1176 // We include `*` in the test to detect buggy implementations that are 1177 // _selectively_ forgiving (specifically when the list includes at least 1178 // one valid selector). 1179 // Note that we treat complete lack of support for `:has()` as if it were 1180 // spec-compliant support, which is fine because use of `:has()` in such 1181 // environments will fail in the qSA path and fall back to jQuery traversal 1182 // anyway. 1183 support.cssHas = assert( function() { 1184 try { 1185 document.querySelector( ":has(*,:jqfake)" ); 1186 return false; 1187 } catch ( e ) { 1188 return true; 1189 } 1190 } ); 1191 1192 // ID filter and find 1193 if ( support.getById ) { 1194 Expr.filter.ID = function( id ) { 1195 var attrId = id.replace( runescape, funescape ); 1196 return function( elem ) { 1197 return elem.getAttribute( "id" ) === attrId; 1198 }; 1199 }; 1200 Expr.find.ID = function( id, context ) { 1201 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1202 var elem = context.getElementById( id ); 1203 return elem ? [ elem ] : []; 1204 } 1205 }; 1206 } else { 1207 Expr.filter.ID = function( id ) { 1208 var attrId = id.replace( runescape, funescape ); 1209 return function( elem ) { 1210 var node = typeof elem.getAttributeNode !== "undefined" && 1211 elem.getAttributeNode( "id" ); 1212 return node && node.value === attrId; 1213 }; 1214 }; 1215 1216 // Support: IE 6 - 7 only 1217 // getElementById is not reliable as a find shortcut 1218 Expr.find.ID = function( id, context ) { 1219 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1220 var node, i, elems, 1221 elem = context.getElementById( id ); 1222 1223 if ( elem ) { 1224 1225 // Verify the id attribute 1226 node = elem.getAttributeNode( "id" ); 1227 if ( node && node.value === id ) { 1228 return [ elem ]; 1229 } 1230 1231 // Fall back on getElementsByName 1232 elems = context.getElementsByName( id ); 1233 i = 0; 1234 while ( ( elem = elems[ i++ ] ) ) { 1235 node = elem.getAttributeNode( "id" ); 1236 if ( node && node.value === id ) { 1237 return [ elem ]; 1238 } 1239 } 1240 } 1241 1242 return []; 1243 } 1244 }; 1245 } 1246 1247 // Tag 1248 Expr.find.TAG = function( tag, context ) { 1249 if ( typeof context.getElementsByTagName !== "undefined" ) { 1250 return context.getElementsByTagName( tag ); 1251 1252 // DocumentFragment nodes don't have gEBTN 1253 } else { 1254 return context.querySelectorAll( tag ); 1255 } 1256 }; 1257 1258 // Class 1259 Expr.find.CLASS = function( className, context ) { 1260 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1261 return context.getElementsByClassName( className ); 1262 } 1263 }; 1264 1265 /* QSA/matchesSelector 1266 ---------------------------------------------------------------------- */ 1267 1268 // QSA and matchesSelector support 1269 1270 rbuggyQSA = []; 1271 1272 // Build QSA regex 1273 // Regex strategy adopted from Diego Perini 1274 assert( function( el ) { 1275 1276 var input; 1277 1278 documentElement.appendChild( el ).innerHTML = 1279 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 1280 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 1281 "<option selected=''></option></select>"; 1282
vendor: 38,614 bytes, lines 1283-2654
1283 // Support: iOS <=7 - 8 only 1284 // Boolean attributes and "value" are not treated correctly in some XML documents 1285 if ( !el.querySelectorAll( "[selected]" ).length ) { 1286 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1287 } 1288 1289 // Support: iOS <=7 - 8 only 1290 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1291 rbuggyQSA.push( "~=" ); 1292 } 1293 1294 // Support: iOS 8 only 1295 // https://bugs.webkit.org/show_bug.cgi?id=136851 1296 // In-page `selector#id sibling-combinator selector` fails 1297 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 1298 rbuggyQSA.push( ".#.+[+~]" ); 1299 } 1300 1301 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 1302 // In some of the document kinds, these selectors wouldn't work natively. 1303 // This is probably OK but for backwards compatibility we want to maintain 1304 // handling them through jQuery traversal in jQuery 3.x. 1305 if ( !el.querySelectorAll( ":checked" ).length ) { 1306 rbuggyQSA.push( ":checked" ); 1307 } 1308 1309 // Support: Windows 8 Native Apps 1310 // The type and name attributes are restricted during .innerHTML assignment 1311 input = document.createElement( "input" ); 1312 input.setAttribute( "type", "hidden" ); 1313 el.appendChild( input ).setAttribute( "name", "D" ); 1314 1315 // Support: IE 9 - 11+ 1316 // IE's :disabled selector does not pick up the children of disabled fieldsets 1317 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 1318 // In some of the document kinds, these selectors wouldn't work natively. 1319 // This is probably OK but for backwards compatibility we want to maintain 1320 // handling them through jQuery traversal in jQuery 3.x. 1321 documentElement.appendChild( el ).disabled = true; 1322 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 1323 rbuggyQSA.push( ":enabled", ":disabled" ); 1324 } 1325 1326 // Support: IE 11+, Edge 15 - 18+ 1327 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 1328 // Adding a temporary attribute to the document before the selection works 1329 // around the issue. 1330 // Interestingly, IE 10 & older don't seem to have the issue. 1331 input = document.createElement( "input" ); 1332 input.setAttribute( "name", "" ); 1333 el.appendChild( input ); 1334 if ( !el.querySelectorAll( "[name='']" ).length ) { 1335 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 1336 whitespace + "*(?:''|\"\")" ); 1337 } 1338 } ); 1339 1340 if ( !support.cssHas ) { 1341 1342 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 1343 // Our regular `try-catch` mechanism fails to detect natively-unsupported 1344 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 1345 // in browsers that parse the `:has()` argument as a forgiving selector list. 1346 // https://drafts.csswg.org/selectors/#relational now requires the argument 1347 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 1348 rbuggyQSA.push( ":has" ); 1349 } 1350 1351 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 1352 1353 /* Sorting 1354 ---------------------------------------------------------------------- */ 1355 1356 // Document order sorting 1357 sortOrder = function( a, b ) { 1358 1359 // Flag for duplicate removal 1360 if ( a === b ) { 1361 hasDuplicate = true; 1362 return 0; 1363 } 1364 1365 // Sort on method existence if only one input has compareDocumentPosition 1366 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1367 if ( compare ) { 1368 return compare; 1369 } 1370 1371 // Calculate position if both inputs belong to the same document 1372 // Support: IE 11+, Edge 17 - 18+ 1373 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1374 // two documents; shallow comparisons work. 1375 // eslint-disable-next-line eqeqeq 1376 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 1377 a.compareDocumentPosition( b ) : 1378 1379 // Otherwise we know they are disconnected 1380 1; 1381 1382 // Disconnected nodes 1383 if ( compare & 1 || 1384 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 1385 1386 // Choose the first element that is related to our preferred document 1387 // Support: IE 11+, Edge 17 - 18+ 1388 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1389 // two documents; shallow comparisons work. 1390 // eslint-disable-next-line eqeqeq 1391 if ( a === document || a.ownerDocument == preferredDoc && 1392 find.contains( preferredDoc, a ) ) { 1393 return -1; 1394 } 1395 1396 // Support: IE 11+, Edge 17 - 18+ 1397 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1398 // two documents; shallow comparisons work. 1399 // eslint-disable-next-line eqeqeq 1400 if ( b === document || b.ownerDocument == preferredDoc && 1401 find.contains( preferredDoc, b ) ) { 1402 return 1; 1403 } 1404 1405 // Maintain original order 1406 return sortInput ? 1407 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 1408 0; 1409 } 1410 1411 return compare & 4 ? -1 : 1; 1412 }; 1413 1414 return document; 1415} 1416 1417find.matches = function( expr, elements ) { 1418 return find( expr, null, null, elements ); 1419}; 1420 1421find.matchesSelector = function( elem, expr ) { 1422 setDocument( elem ); 1423 1424 if ( documentIsHTML && 1425 !nonnativeSelectorCache[ expr + " " ] && 1426 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1427 1428 try { 1429 var ret = matches.call( elem, expr ); 1430 1431 // IE 9's matchesSelector returns false on disconnected nodes 1432 if ( ret || support.disconnectedMatch || 1433 1434 // As well, disconnected nodes are said to be in a document 1435 // fragment in IE 9 1436 elem.document && elem.document.nodeType !== 11 ) { 1437 return ret; 1438 } 1439 } catch ( e ) { 1440 nonnativeSelectorCache( expr, true ); 1441 } 1442 } 1443 1444 return find( expr, document, null, [ elem ] ).length > 0; 1445}; 1446 1447find.contains = function( context, elem ) { 1448 1449 // Set document vars if needed 1450 // Support: IE 11+, Edge 17 - 18+ 1451 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1452 // two documents; shallow comparisons work. 1453 // eslint-disable-next-line eqeqeq 1454 if ( ( context.ownerDocument || context ) != document ) { 1455 setDocument( context ); 1456 } 1457 return jQuery.contains( context, elem ); 1458}; 1459 1460 1461find.attr = function( elem, name ) { 1462 1463 // Set document vars if needed 1464 // Support: IE 11+, Edge 17 - 18+ 1465 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1466 // two documents; shallow comparisons work. 1467 // eslint-disable-next-line eqeqeq 1468 if ( ( elem.ownerDocument || elem ) != document ) { 1469 setDocument( elem ); 1470 } 1471 1472 var fn = Expr.attrHandle[ name.toLowerCase() ], 1473 1474 // Don't get fooled by Object.prototype properties (see trac-13807) 1475 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1476 fn( elem, name, !documentIsHTML ) : 1477 undefined; 1478 1479 if ( val !== undefined ) { 1480 return val; 1481 } 1482 1483 return elem.getAttribute( name ); 1484}; 1485 1486find.error = function( msg ) { 1487 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1488}; 1489 1490/** 1491 * Document sorting and removing duplicates 1492 * @param {ArrayLike} results 1493 */ 1494jQuery.uniqueSort = function( results ) { 1495 var elem, 1496 duplicates = [], 1497 j = 0, 1498 i = 0; 1499 1500 // Unless we *know* we can detect duplicates, assume their presence 1501 // 1502 // Support: Android <=4.0+ 1503 // Testing for detecting duplicates is unpredictable so instead assume we can't 1504 // depend on duplicate detection in all browsers without a stable sort. 1505 hasDuplicate = !support.sortStable; 1506 sortInput = !support.sortStable && slice.call( results, 0 ); 1507 sort.call( results, sortOrder ); 1508 1509 if ( hasDuplicate ) { 1510 while ( ( elem = results[ i++ ] ) ) { 1511 if ( elem === results[ i ] ) { 1512 j = duplicates.push( i ); 1513 } 1514 } 1515 while ( j-- ) { 1516 splice.call( results, duplicates[ j ], 1 ); 1517 } 1518 } 1519 1520 // Clear input after sorting to release objects 1521 // See https://github.com/jquery/sizzle/pull/225 1522 sortInput = null; 1523 1524 return results; 1525}; 1526 1527jQuery.fn.uniqueSort = function() { 1528 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 1529}; 1530 1531Expr = jQuery.expr = { 1532 1533 // Can be adjusted by the user 1534 cacheLength: 50, 1535 1536 createPseudo: markFunction, 1537 1538 match: matchExpr, 1539 1540 attrHandle: {}, 1541 1542 find: {}, 1543 1544 relative: { 1545 ">": { dir: "parentNode", first: true }, 1546 " ": { dir: "parentNode" }, 1547 "+": { dir: "previousSibling", first: true }, 1548 "~": { dir: "previousSibling" } 1549 }, 1550 1551 preFilter: { 1552 ATTR: function( match ) { 1553 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 1554 1555 // Move the given value to match[3] whether quoted or unquoted 1556 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 1557 .replace( runescape, funescape ); 1558 1559 if ( match[ 2 ] === "~=" ) { 1560 match[ 3 ] = " " + match[ 3 ] + " "; 1561 } 1562 1563 return match.slice( 0, 4 ); 1564 }, 1565 1566 CHILD: function( match ) { 1567 1568 /* matches from matchExpr["CHILD"] 1569 1 type (only|nth|...) 1570 2 what (child|of-type) 1571 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1572 4 xn-component of xn+y argument ([+-]?\d*n|) 1573 5 sign of xn-component 1574 6 x of xn-component 1575 7 sign of y-component 1576 8 y of y-component 1577 */ 1578 match[ 1 ] = match[ 1 ].toLowerCase(); 1579 1580 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 1581 1582 // nth-* requires argument 1583 if ( !match[ 3 ] ) { 1584 find.error( match[ 0 ] ); 1585 } 1586 1587 // numeric x and y parameters for Expr.filter.CHILD 1588 // remember that false/true cast respectively to 0/1 1589 match[ 4 ] = +( match[ 4 ] ? 1590 match[ 5 ] + ( match[ 6 ] || 1 ) : 1591 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 1592 ); 1593 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 1594 1595 // other types prohibit arguments 1596 } else if ( match[ 3 ] ) { 1597 find.error( match[ 0 ] ); 1598 } 1599 1600 return match; 1601 }, 1602 1603 PSEUDO: function( match ) { 1604 var excess, 1605 unquoted = !match[ 6 ] && match[ 2 ]; 1606 1607 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 1608 return null; 1609 } 1610 1611 // Accept quoted arguments as-is 1612 if ( match[ 3 ] ) { 1613 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 1614 1615 // Strip excess characters from unquoted arguments 1616 } else if ( unquoted && rpseudo.test( unquoted ) && 1617 1618 // Get excess from tokenize (recursively) 1619 ( excess = tokenize( unquoted, true ) ) && 1620 1621 // advance to the next closing parenthesis 1622 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 1623 1624 // excess is a negative index 1625 match[ 0 ] = match[ 0 ].slice( 0, excess ); 1626 match[ 2 ] = unquoted.slice( 0, excess ); 1627 } 1628 1629 // Return only captures needed by the pseudo filter method (type and argument) 1630 return match.slice( 0, 3 ); 1631 } 1632 }, 1633 1634 filter: { 1635 1636 TAG: function( nodeNameSelector ) { 1637 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1638 return nodeNameSelector === "*" ? 1639 function() { 1640 return true; 1641 } : 1642 function( elem ) { 1643 return nodeName( elem, expectedNodeName ); 1644 }; 1645 }, 1646 1647 CLASS: function( className ) { 1648 var pattern = classCache[ className + " " ]; 1649 1650 return pattern || 1651 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 1652 "(" + whitespace + "|$)" ) ) && 1653 classCache( className, function( elem ) { 1654 return pattern.test( 1655 typeof elem.className === "string" && elem.className || 1656 typeof elem.getAttribute !== "undefined" && 1657 elem.getAttribute( "class" ) || 1658 "" 1659 ); 1660 } ); 1661 }, 1662 1663 ATTR: function( name, operator, check ) { 1664 return function( elem ) { 1665 var result = find.attr( elem, name ); 1666 1667 if ( result == null ) { 1668 return operator === "!="; 1669 } 1670 if ( !operator ) { 1671 return true; 1672 } 1673 1674 result += ""; 1675 1676 if ( operator === "=" ) { 1677 return result === check; 1678 } 1679 if ( operator === "!=" ) { 1680 return result !== check; 1681 } 1682 if ( operator === "^=" ) { 1683 return check && result.indexOf( check ) === 0; 1684 } 1685 if ( operator === "*=" ) { 1686 return check && result.indexOf( check ) > -1; 1687 } 1688 if ( operator === "$=" ) { 1689 return check && result.slice( -check.length ) === check; 1690 } 1691 if ( operator === "~=" ) { 1692 return ( " " + result.replace( rwhitespace, " " ) + " " ) 1693 .indexOf( check ) > -1; 1694 } 1695 if ( operator === "|=" ) { 1696 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 1697 } 1698 1699 return false; 1700 }; 1701 }, 1702 1703 CHILD: function( type, what, _argument, first, last ) { 1704 var simple = type.slice( 0, 3 ) !== "nth", 1705 forward = type.slice( -4 ) !== "last", 1706 ofType = what === "of-type"; 1707 1708 return first === 1 && last === 0 ? 1709 1710 // Shortcut for :nth-*(n) 1711 function( elem ) { 1712 return !!elem.parentNode; 1713 } : 1714 1715 function( elem, _context, xml ) { 1716 var cache, outerCache, node, nodeIndex, start, 1717 dir = simple !== forward ? "nextSibling" : "previousSibling", 1718 parent = elem.parentNode, 1719 name = ofType && elem.nodeName.toLowerCase(), 1720 useCache = !xml && !ofType, 1721 diff = false; 1722 1723 if ( parent ) { 1724 1725 // :(first|last|only)-(child|of-type) 1726 if ( simple ) { 1727 while ( dir ) { 1728 node = elem; 1729 while ( ( node = node[ dir ] ) ) { 1730 if ( ofType ? 1731 nodeName( node, name ) : 1732 node.nodeType === 1 ) { 1733 1734 return false; 1735 } 1736 } 1737 1738 // Reverse direction for :only-* (if we haven't yet done so) 1739 start = dir = type === "only" && !start && "nextSibling"; 1740 } 1741 return true; 1742 } 1743 1744 start = [ forward ? parent.firstChild : parent.lastChild ]; 1745 1746 // non-xml :nth-child(...) stores cache data on `parent` 1747 if ( forward && useCache ) { 1748 1749 // Seek `elem` from a previously-cached index 1750 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 1751 cache = outerCache[ type ] || []; 1752 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1753 diff = nodeIndex && cache[ 2 ]; 1754 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1755 1756 while ( ( node = ++nodeIndex && node && node[ dir ] || 1757 1758 // Fallback to seeking `elem` from the start 1759 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 1760 1761 // When found, cache indexes on `parent` and break 1762 if ( node.nodeType === 1 && ++diff && node === elem ) { 1763 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 1764 break; 1765 } 1766 } 1767 1768 } else { 1769 1770 // Use previously-cached element index if available 1771 if ( useCache ) { 1772 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 1773 cache = outerCache[ type ] || []; 1774 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1775 diff = nodeIndex; 1776 } 1777 1778 // xml :nth-child(...) 1779 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1780 if ( diff === false ) { 1781 1782 // Use the same loop as above to seek `elem` from the start 1783 while ( ( node = ++nodeIndex && node && node[ dir ] || 1784 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 1785 1786 if ( ( ofType ? 1787 nodeName( node, name ) : 1788 node.nodeType === 1 ) && 1789 ++diff ) { 1790 1791 // Cache the index of each encountered element 1792 if ( useCache ) { 1793 outerCache = node[ expando ] || 1794 ( node[ expando ] = {} ); 1795 outerCache[ type ] = [ dirruns, diff ]; 1796 } 1797 1798 if ( node === elem ) { 1799 break; 1800 } 1801 } 1802 } 1803 } 1804 } 1805 1806 // Incorporate the offset, then check against cycle size 1807 diff -= last; 1808 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1809 } 1810 }; 1811 }, 1812 1813 PSEUDO: function( pseudo, argument ) { 1814 1815 // pseudo-class names are case-insensitive 1816 // https://www.w3.org/TR/selectors/#pseudo-classes 1817 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1818 // Remember that setFilters inherits from pseudos 1819 var args, 1820 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1821 find.error( "unsupported pseudo: " + pseudo ); 1822 1823 // The user may use createPseudo to indicate that 1824 // arguments are needed to create the filter function 1825 // just as jQuery does 1826 if ( fn[ expando ] ) { 1827 return fn( argument ); 1828 } 1829 1830 // But maintain support for old signatures 1831 if ( fn.length > 1 ) { 1832 args = [ pseudo, pseudo, "", argument ]; 1833 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1834 markFunction( function( seed, matches ) { 1835 var idx, 1836 matched = fn( seed, argument ), 1837 i = matched.length; 1838 while ( i-- ) { 1839 idx = indexOf.call( seed, matched[ i ] ); 1840 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 1841 } 1842 } ) : 1843 function( elem ) { 1844 return fn( elem, 0, args ); 1845 }; 1846 } 1847 1848 return fn; 1849 } 1850 }, 1851 1852 pseudos: { 1853 1854 // Potentially complex pseudos 1855 not: markFunction( function( selector ) { 1856 1857 // Trim the selector passed to compile 1858 // to avoid treating leading and trailing 1859 // spaces as combinators 1860 var input = [], 1861 results = [], 1862 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 1863 1864 return matcher[ expando ] ? 1865 markFunction( function( seed, matches, _context, xml ) { 1866 var elem, 1867 unmatched = matcher( seed, null, xml, [] ), 1868 i = seed.length; 1869 1870 // Match elements unmatched by `matcher` 1871 while ( i-- ) { 1872 if ( ( elem = unmatched[ i ] ) ) { 1873 seed[ i ] = !( matches[ i ] = elem ); 1874 } 1875 } 1876 } ) : 1877 function( elem, _context, xml ) { 1878 input[ 0 ] = elem; 1879 matcher( input, null, xml, results ); 1880 1881 // Don't keep the element 1882 // (see https://github.com/jquery/sizzle/issues/299) 1883 input[ 0 ] = null; 1884 return !results.pop(); 1885 }; 1886 } ), 1887 1888 has: markFunction( function( selector ) { 1889 return function( elem ) { 1890 return find( selector, elem ).length > 0; 1891 }; 1892 } ), 1893 1894 contains: markFunction( function( text ) { 1895 text = text.replace( runescape, funescape ); 1896 return function( elem ) { 1897 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 1898 }; 1899 } ), 1900 1901 // "Whether an element is represented by a :lang() selector 1902 // is based solely on the element's language value 1903 // being equal to the identifier C, 1904 // or beginning with the identifier C immediately followed by "-". 1905 // The matching of C against the element's language value is performed case-insensitively. 1906 // The identifier C does not have to be a valid language name." 1907 // https://www.w3.org/TR/selectors/#lang-pseudo 1908 lang: markFunction( function( lang ) { 1909 1910 // lang value must be a valid identifier 1911 if ( !ridentifier.test( lang || "" ) ) { 1912 find.error( "unsupported lang: " + lang ); 1913 } 1914 lang = lang.replace( runescape, funescape ).toLowerCase(); 1915 return function( elem ) { 1916 var elemLang; 1917 do { 1918 if ( ( elemLang = documentIsHTML ? 1919 elem.lang : 1920 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 1921 1922 elemLang = elemLang.toLowerCase(); 1923 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1924 } 1925 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 1926 return false; 1927 }; 1928 } ), 1929 1930 // Miscellaneous 1931 target: function( elem ) { 1932 var hash = window.location && window.location.hash; 1933 return hash && hash.slice( 1 ) === elem.id; 1934 }, 1935 1936 root: function( elem ) { 1937 return elem === documentElement; 1938 }, 1939 1940 focus: function( elem ) { 1941 return elem === safeActiveElement() && 1942 document.hasFocus() && 1943 !!( elem.type || elem.href || ~elem.tabIndex ); 1944 }, 1945 1946 // Boolean properties 1947 enabled: createDisabledPseudo( false ), 1948 disabled: createDisabledPseudo( true ), 1949 1950 checked: function( elem ) { 1951 1952 // In CSS3, :checked should return both checked and selected elements 1953 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1954 return ( nodeName( elem, "input" ) && !!elem.checked ) || 1955 ( nodeName( elem, "option" ) && !!elem.selected ); 1956 }, 1957 1958 selected: function( elem ) { 1959 1960 // Support: IE <=11+ 1961 // Accessing the selectedIndex property 1962 // forces the browser to treat the default option as 1963 // selected when in an optgroup. 1964 if ( elem.parentNode ) { 1965 // eslint-disable-next-line no-unused-expressions 1966 elem.parentNode.selectedIndex; 1967 } 1968 1969 return elem.selected === true; 1970 }, 1971 1972 // Contents 1973 empty: function( elem ) { 1974 1975 // https://www.w3.org/TR/selectors/#empty-pseudo 1976 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1977 // but not by others (comment: 8; processing instruction: 7; etc.) 1978 // nodeType < 6 works because attributes (2) do not appear as children 1979 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1980 if ( elem.nodeType < 6 ) { 1981 return false; 1982 } 1983 } 1984 return true; 1985 }, 1986 1987 parent: function( elem ) { 1988 return !Expr.pseudos.empty( elem ); 1989 }, 1990 1991 // Element/input types 1992 header: function( elem ) { 1993 return rheader.test( elem.nodeName ); 1994 }, 1995 1996 input: function( elem ) { 1997 return rinputs.test( elem.nodeName ); 1998 }, 1999 2000 button: function( elem ) { 2001 return nodeName( elem, "input" ) && elem.type === "button" || 2002 nodeName( elem, "button" ); 2003 }, 2004 2005 text: function( elem ) { 2006 var attr; 2007 return nodeName( elem, "input" ) && elem.type === "text" && 2008 2009 // Support: IE <10 only 2010 // New HTML5 attribute values (e.g., "search") appear 2011 // with elem.type === "text" 2012 ( ( attr = elem.getAttribute( "type" ) ) == null || 2013 attr.toLowerCase() === "text" ); 2014 }, 2015 2016 // Position-in-collection 2017 first: createPositionalPseudo( function() { 2018 return [ 0 ]; 2019 } ), 2020 2021 last: createPositionalPseudo( function( _matchIndexes, length ) { 2022 return [ length - 1 ]; 2023 } ), 2024 2025 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 2026 return [ argument < 0 ? argument + length : argument ]; 2027 } ), 2028 2029 even: createPositionalPseudo( function( matchIndexes, length ) { 2030 var i = 0; 2031 for ( ; i < length; i += 2 ) { 2032 matchIndexes.push( i ); 2033 } 2034 return matchIndexes; 2035 } ), 2036 2037 odd: createPositionalPseudo( function( matchIndexes, length ) { 2038 var i = 1; 2039 for ( ; i < length; i += 2 ) { 2040 matchIndexes.push( i ); 2041 } 2042 return matchIndexes; 2043 } ), 2044 2045 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 2046 var i; 2047 2048 if ( argument < 0 ) { 2049 i = argument + length; 2050 } else if ( argument > length ) { 2051 i = length; 2052 } else { 2053 i = argument; 2054 } 2055 2056 for ( ; --i >= 0; ) { 2057 matchIndexes.push( i ); 2058 } 2059 return matchIndexes; 2060 } ), 2061 2062 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 2063 var i = argument < 0 ? argument + length : argument; 2064 for ( ; ++i < length; ) { 2065 matchIndexes.push( i ); 2066 } 2067 return matchIndexes; 2068 } ) 2069 } 2070}; 2071 2072Expr.pseudos.nth = Expr.pseudos.eq; 2073 2074// Add button/input type pseudos 2075for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2076 Expr.pseudos[ i ] = createInputPseudo( i ); 2077} 2078for ( i in { submit: true, reset: true } ) { 2079 Expr.pseudos[ i ] = createButtonPseudo( i ); 2080} 2081 2082// Easy API for creating new setFilters 2083function setFilters() {} 2084setFilters.prototype = Expr.filters = Expr.pseudos; 2085Expr.setFilters = new setFilters(); 2086 2087function tokenize( selector, parseOnly ) { 2088 var matched, match, tokens, type, 2089 soFar, groups, preFilters, 2090 cached = tokenCache[ selector + " " ]; 2091 2092 if ( cached ) { 2093 return parseOnly ? 0 : cached.slice( 0 ); 2094 } 2095 2096 soFar = selector; 2097 groups = []; 2098 preFilters = Expr.preFilter; 2099 2100 while ( soFar ) { 2101 2102 // Comma and first run 2103 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 2104 if ( match ) { 2105 2106 // Don't consume trailing commas as valid 2107 soFar = soFar.slice( match[ 0 ].length ) || soFar; 2108 } 2109 groups.push( ( tokens = [] ) ); 2110 } 2111 2112 matched = false; 2113 2114 // Combinators 2115 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 2116 matched = match.shift(); 2117 tokens.push( { 2118 value: matched, 2119 2120 // Cast descendant combinators to space 2121 type: match[ 0 ].replace( rtrimCSS, " " ) 2122 } ); 2123 soFar = soFar.slice( matched.length ); 2124 } 2125 2126 // Filters 2127 for ( type in Expr.filter ) { 2128 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 2129 ( match = preFilters[ type ]( match ) ) ) ) { 2130 matched = match.shift(); 2131 tokens.push( { 2132 value: matched, 2133 type: type, 2134 matches: match 2135 } ); 2136 soFar = soFar.slice( matched.length ); 2137 } 2138 } 2139 2140 if ( !matched ) { 2141 break; 2142 } 2143 } 2144 2145 // Return the length of the invalid excess 2146 // if we're just parsing 2147 // Otherwise, throw an error or return tokens 2148 if ( parseOnly ) { 2149 return soFar.length; 2150 } 2151 2152 return soFar ? 2153 find.error( selector ) : 2154 2155 // Cache the tokens 2156 tokenCache( selector, groups ).slice( 0 ); 2157} 2158 2159function toSelector( tokens ) { 2160 var i = 0, 2161 len = tokens.length, 2162 selector = ""; 2163 for ( ; i < len; i++ ) { 2164 selector += tokens[ i ].value; 2165 } 2166 return selector; 2167} 2168 2169function addCombinator( matcher, combinator, base ) { 2170 var dir = combinator.dir, 2171 skip = combinator.next, 2172 key = skip || dir, 2173 checkNonElements = base && key === "parentNode", 2174 doneName = done++; 2175 2176 return combinator.first ? 2177 2178 // Check against closest ancestor/preceding element 2179 function( elem, context, xml ) { 2180 while ( ( elem = elem[ dir ] ) ) { 2181 if ( elem.nodeType === 1 || checkNonElements ) { 2182 return matcher( elem, context, xml ); 2183 } 2184 } 2185 return false; 2186 } : 2187 2188 // Check against all ancestor/preceding elements 2189 function( elem, context, xml ) { 2190 var oldCache, outerCache, 2191 newCache = [ dirruns, doneName ]; 2192 2193 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2194 if ( xml ) { 2195 while ( ( elem = elem[ dir ] ) ) { 2196 if ( elem.nodeType === 1 || checkNonElements ) { 2197 if ( matcher( elem, context, xml ) ) { 2198 return true; 2199 } 2200 } 2201 } 2202 } else { 2203 while ( ( elem = elem[ dir ] ) ) { 2204 if ( elem.nodeType === 1 || checkNonElements ) { 2205 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 2206 2207 if ( skip && nodeName( elem, skip ) ) { 2208 elem = elem[ dir ] || elem; 2209 } else if ( ( oldCache = outerCache[ key ] ) && 2210 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2211 2212 // Assign to newCache so results back-propagate to previous elements 2213 return ( newCache[ 2 ] = oldCache[ 2 ] ); 2214 } else { 2215 2216 // Reuse newcache so results back-propagate to previous elements 2217 outerCache[ key ] = newCache; 2218 2219 // A match means we're done; a fail means we have to keep checking 2220 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 2221 return true; 2222 } 2223 } 2224 } 2225 } 2226 } 2227 return false; 2228 }; 2229} 2230 2231function elementMatcher( matchers ) { 2232 return matchers.length > 1 ? 2233 function( elem, context, xml ) { 2234 var i = matchers.length; 2235 while ( i-- ) { 2236 if ( !matchers[ i ]( elem, context, xml ) ) { 2237 return false; 2238 } 2239 } 2240 return true; 2241 } : 2242 matchers[ 0 ]; 2243} 2244 2245function multipleContexts( selector, contexts, results ) { 2246 var i = 0, 2247 len = contexts.length; 2248 for ( ; i < len; i++ ) { 2249 find( selector, contexts[ i ], results ); 2250 } 2251 return results; 2252} 2253 2254function condense( unmatched, map, filter, context, xml ) { 2255 var elem, 2256 newUnmatched = [], 2257 i = 0, 2258 len = unmatched.length, 2259 mapped = map != null; 2260 2261 for ( ; i < len; i++ ) { 2262 if ( ( elem = unmatched[ i ] ) ) { 2263 if ( !filter || filter( elem, context, xml ) ) { 2264 newUnmatched.push( elem ); 2265 if ( mapped ) { 2266 map.push( i ); 2267 } 2268 } 2269 } 2270 } 2271 2272 return newUnmatched; 2273} 2274 2275function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2276 if ( postFilter && !postFilter[ expando ] ) { 2277 postFilter = setMatcher( postFilter ); 2278 } 2279 if ( postFinder && !postFinder[ expando ] ) { 2280 postFinder = setMatcher( postFinder, postSelector ); 2281 } 2282 return markFunction( function( seed, results, context, xml ) { 2283 var temp, i, elem, matcherOut, 2284 preMap = [], 2285 postMap = [], 2286 preexisting = results.length, 2287 2288 // Get initial elements from seed or context 2289 elems = seed || 2290 multipleContexts( selector || "*", 2291 context.nodeType ? [ context ] : context, [] ), 2292 2293 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2294 matcherIn = preFilter && ( seed || !selector ) ? 2295 condense( elems, preMap, preFilter, context, xml ) : 2296 elems; 2297 2298 if ( matcher ) { 2299 2300 // If we have a postFinder, or filtered seed, or non-seed postFilter 2301 // or preexisting results, 2302 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2303 2304 // ...intermediate processing is necessary 2305 [] : 2306 2307 // ...otherwise use results directly 2308 results; 2309 2310 // Find primary matches 2311 matcher( matcherIn, matcherOut, context, xml ); 2312 } else { 2313 matcherOut = matcherIn; 2314 } 2315 2316 // Apply postFilter 2317 if ( postFilter ) { 2318 temp = condense( matcherOut, postMap ); 2319 postFilter( temp, [], context, xml ); 2320 2321 // Un-match failing elements by moving them back to matcherIn 2322 i = temp.length; 2323 while ( i-- ) { 2324 if ( ( elem = temp[ i ] ) ) { 2325 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 2326 } 2327 } 2328 } 2329 2330 if ( seed ) { 2331 if ( postFinder || preFilter ) { 2332 if ( postFinder ) { 2333 2334 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2335 temp = []; 2336 i = matcherOut.length; 2337 while ( i-- ) { 2338 if ( ( elem = matcherOut[ i ] ) ) { 2339 2340 // Restore matcherIn since elem is not yet a final match 2341 temp.push( ( matcherIn[ i ] = elem ) ); 2342 } 2343 } 2344 postFinder( null, ( matcherOut = [] ), temp, xml ); 2345 } 2346 2347 // Move matched elements from seed to results to keep them synchronized 2348 i = matcherOut.length; 2349 while ( i-- ) { 2350 if ( ( elem = matcherOut[ i ] ) && 2351 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 2352 2353 seed[ temp ] = !( results[ temp ] = elem ); 2354 } 2355 } 2356 } 2357 2358 // Add elements to results, through postFinder if defined 2359 } else { 2360 matcherOut = condense( 2361 matcherOut === results ? 2362 matcherOut.splice( preexisting, matcherOut.length ) : 2363 matcherOut 2364 ); 2365 if ( postFinder ) { 2366 postFinder( null, results, matcherOut, xml ); 2367 } else { 2368 push.apply( results, matcherOut ); 2369 } 2370 } 2371 } ); 2372} 2373 2374function matcherFromTokens( tokens ) { 2375 var checkContext, matcher, j, 2376 len = tokens.length, 2377 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 2378 implicitRelative = leadingRelative || Expr.relative[ " " ], 2379 i = leadingRelative ? 1 : 0, 2380 2381 // The foundational matcher ensures that elements are reachable from top-level context(s) 2382 matchContext = addCombinator( function( elem ) { 2383 return elem === checkContext; 2384 }, implicitRelative, true ), 2385 matchAnyContext = addCombinator( function( elem ) { 2386 return indexOf.call( checkContext, elem ) > -1; 2387 }, implicitRelative, true ), 2388 matchers = [ function( elem, context, xml ) { 2389 2390 // Support: IE 11+, Edge 17 - 18+ 2391 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2392 // two documents; shallow comparisons work. 2393 // eslint-disable-next-line eqeqeq 2394 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 2395 ( checkContext = context ).nodeType ? 2396 matchContext( elem, context, xml ) : 2397 matchAnyContext( elem, context, xml ) ); 2398 2399 // Avoid hanging onto element 2400 // (see https://github.com/jquery/sizzle/issues/299) 2401 checkContext = null; 2402 return ret; 2403 } ]; 2404 2405 for ( ; i < len; i++ ) { 2406 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 2407 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 2408 } else { 2409 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 2410 2411 // Return special upon seeing a positional matcher 2412 if ( matcher[ expando ] ) { 2413 2414 // Find the next relative operator (if any) for proper handling 2415 j = ++i; 2416 for ( ; j < len; j++ ) { 2417 if ( Expr.relative[ tokens[ j ].type ] ) { 2418 break; 2419 } 2420 } 2421 return setMatcher( 2422 i > 1 && elementMatcher( matchers ), 2423 i > 1 && toSelector( 2424 2425 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2426 tokens.slice( 0, i - 1 ) 2427 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 2428 ).replace( rtrimCSS, "$1" ), 2429 matcher, 2430 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2431 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 2432 j < len && toSelector( tokens ) 2433 ); 2434 } 2435 matchers.push( matcher ); 2436 } 2437 } 2438 2439 return elementMatcher( matchers ); 2440} 2441 2442function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2443 var bySet = setMatchers.length > 0, 2444 byElement = elementMatchers.length > 0, 2445 superMatcher = function( seed, context, xml, results, outermost ) { 2446 var elem, j, matcher, 2447 matchedCount = 0, 2448 i = "0", 2449 unmatched = seed && [], 2450 setMatched = [], 2451 contextBackup = outermostContext, 2452 2453 // We must always have either seed elements or outermost context 2454 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 2455 2456 // Use integer dirruns iff this is the outermost matcher 2457 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 2458 len = elems.length; 2459 2460 if ( outermost ) { 2461 2462 // Support: IE 11+, Edge 17 - 18+ 2463 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2464 // two documents; shallow comparisons work. 2465 // eslint-disable-next-line eqeqeq 2466 outermostContext = context == document || context || outermost; 2467 } 2468 2469 // Add elements passing elementMatchers directly to results 2470 // Support: iOS <=7 - 9 only 2471 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 2472 // elements by id. (see trac-14142) 2473 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 2474 if ( byElement && elem ) { 2475 j = 0; 2476 2477 // Support: IE 11+, Edge 17 - 18+ 2478 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2479 // two documents; shallow comparisons work. 2480 // eslint-disable-next-line eqeqeq 2481 if ( !context && elem.ownerDocument != document ) { 2482 setDocument( elem ); 2483 xml = !documentIsHTML; 2484 } 2485 while ( ( matcher = elementMatchers[ j++ ] ) ) { 2486 if ( matcher( elem, context || document, xml ) ) { 2487 push.call( results, elem ); 2488 break; 2489 } 2490 } 2491 if ( outermost ) { 2492 dirruns = dirrunsUnique; 2493 } 2494 } 2495 2496 // Track unmatched elements for set filters 2497 if ( bySet ) { 2498 2499 // They will have gone through all possible matchers 2500 if ( ( elem = !matcher && elem ) ) { 2501 matchedCount--; 2502 } 2503 2504 // Lengthen the array for every element, matched or not 2505 if ( seed ) { 2506 unmatched.push( elem ); 2507 } 2508 } 2509 } 2510 2511 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2512 // makes the latter nonnegative. 2513 matchedCount += i; 2514 2515 // Apply set filters to unmatched elements 2516 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2517 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2518 // no element matchers and no seed. 2519 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2520 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2521 // numerically zero. 2522 if ( bySet && i !== matchedCount ) { 2523 j = 0; 2524 while ( ( matcher = setMatchers[ j++ ] ) ) { 2525 matcher( unmatched, setMatched, context, xml ); 2526 } 2527 2528 if ( seed ) { 2529 2530 // Reintegrate element matches to eliminate the need for sorting 2531 if ( matchedCount > 0 ) { 2532 while ( i-- ) { 2533 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 2534 setMatched[ i ] = pop.call( results ); 2535 } 2536 } 2537 } 2538 2539 // Discard index placeholder values to get only actual matches 2540 setMatched = condense( setMatched ); 2541 } 2542 2543 // Add matches to results 2544 push.apply( results, setMatched ); 2545 2546 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2547 if ( outermost && !seed && setMatched.length > 0 && 2548 ( matchedCount + setMatchers.length ) > 1 ) { 2549 2550 jQuery.uniqueSort( results ); 2551 } 2552 } 2553 2554 // Override manipulation of globals by nested matchers 2555 if ( outermost ) { 2556 dirruns = dirrunsUnique; 2557 outermostContext = contextBackup; 2558 } 2559 2560 return unmatched; 2561 }; 2562 2563 return bySet ? 2564 markFunction( superMatcher ) : 2565 superMatcher; 2566} 2567 2568function compile( selector, match /* Internal Use Only */ ) { 2569 var i, 2570 setMatchers = [], 2571 elementMatchers = [], 2572 cached = compilerCache[ selector + " " ]; 2573 2574 if ( !cached ) { 2575 2576 // Generate a function of recursive functions that can be used to check each element 2577 if ( !match ) { 2578 match = tokenize( selector ); 2579 } 2580 i = match.length; 2581 while ( i-- ) { 2582 cached = matcherFromTokens( match[ i ] ); 2583 if ( cached[ expando ] ) { 2584 setMatchers.push( cached ); 2585 } else { 2586 elementMatchers.push( cached ); 2587 } 2588 } 2589 2590 // Cache the compiled function 2591 cached = compilerCache( selector, 2592 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2593 2594 // Save selector and tokenization 2595 cached.selector = selector; 2596 } 2597 return cached; 2598} 2599 2600/** 2601 * A low-level selection function that works with jQuery's compiled 2602 * selector functions 2603 * @param {String|Function} selector A selector or a pre-compiled 2604 * selector function built with jQuery selector compile 2605 * @param {Element} context 2606 * @param {Array} [results] 2607 * @param {Array} [seed] A set of elements to match against 2608 */ 2609function select( selector, context, results, seed ) { 2610 var i, tokens, token, type, find, 2611 compiled = typeof selector === "function" && selector, 2612 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 2613 2614 results = results || []; 2615 2616 // Try to minimize operations if there is only one selector in the list and no seed 2617 // (the latter of which guarantees us context) 2618 if ( match.length === 1 ) { 2619 2620 // Reduce context if the leading compound selector is an ID 2621 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 2622 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 2623 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 2624 2625 context = ( Expr.find.ID( 2626 token.matches[ 0 ].replace( runescape, funescape ), 2627 context 2628 ) || [] )[ 0 ]; 2629 if ( !context ) { 2630 return results; 2631 2632 // Precompiled matchers will still verify ancestry, so step up a level 2633 } else if ( compiled ) { 2634 context = context.parentNode; 2635 } 2636 2637 selector = selector.slice( tokens.shift().value.length ); 2638 } 2639 2640 // Fetch a seed set for right-to-left matching 2641 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 2642 while ( i-- ) { 2643 token = tokens[ i ]; 2644 2645 // Abort if we hit a combinator 2646 if ( Expr.relative[ ( type = token.type ) ] ) { 2647 break; 2648 } 2649 if ( ( find = Expr.find[ type ] ) ) { 2650 2651 // Search, expanding context for leading sibling combinators 2652 if ( ( seed = find( 2653 token.matches[ 0 ].replace( runescape, funescape ), 2654 rsibling.test( tokens[ 0 ].type ) &&
vendor: 4,497 bytes, lines 2655-2839
2655 testContext( context.parentNode ) || context 2656 ) ) ) { 2657 2658 // If seed is empty or no tokens remain, we can return early 2659 tokens.splice( i, 1 ); 2660 selector = seed.length && toSelector( tokens ); 2661 if ( !selector ) { 2662 push.apply( results, seed ); 2663 return results; 2664 } 2665 2666 break; 2667 } 2668 } 2669 } 2670 } 2671 2672 // Compile and execute a filtering function if one is not provided 2673 // Provide `match` to avoid retokenization if we modified the selector above 2674 ( compiled || compile( selector, match ) )( 2675 seed, 2676 context, 2677 !documentIsHTML, 2678 results, 2679 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2680 ); 2681 return results; 2682} 2683 2684// One-time assignments 2685 2686// Support: Android <=4.0 - 4.1+ 2687// Sort stability 2688support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 2689 2690// Initialize against the default document 2691setDocument(); 2692 2693// Support: Android <=4.0 - 4.1+ 2694// Detached nodes confoundingly follow *each other* 2695support.sortDetached = assert( function( el ) { 2696 2697 // Should return 1, but returns 4 (following) 2698 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 2699} ); 2700 2701jQuery.find = find; 2702 2703// Deprecated 2704jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2705jQuery.unique = jQuery.uniqueSort; 2706 2707// These have always been private, but they used to be documented as part of 2708// Sizzle so let's maintain them for now for backwards compatibility purposes. 2709find.compile = compile; 2710find.select = select; 2711find.setDocument = setDocument; 2712find.tokenize = tokenize; 2713 2714find.escape = jQuery.escapeSelector; 2715find.getText = jQuery.text; 2716find.isXML = jQuery.isXMLDoc; 2717find.selectors = jQuery.expr; 2718find.support = jQuery.support; 2719find.uniqueSort = jQuery.uniqueSort; 2720 2721 /* eslint-enable */ 2722 2723} )(); 2724 2725 2726var dir = function( elem, dir, until ) { 2727 var matched = [], 2728 truncate = until !== undefined; 2729 2730 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2731 if ( elem.nodeType === 1 ) { 2732 if ( truncate && jQuery( elem ).is( until ) ) { 2733 break; 2734 } 2735 matched.push( elem ); 2736 } 2737 } 2738 return matched; 2739}; 2740 2741 2742var siblings = function( n, elem ) { 2743 var matched = []; 2744 2745 for ( ; n; n = n.nextSibling ) { 2746 if ( n.nodeType === 1 && n !== elem ) { 2747 matched.push( n ); 2748 } 2749 } 2750 2751 return matched; 2752}; 2753 2754 2755var rneedsContext = jQuery.expr.match.needsContext; 2756 2757var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 2758 2759 2760 2761// Implement the identical functionality for filter and not 2762function winnow( elements, qualifier, not ) { 2763 if ( isFunction( qualifier ) ) { 2764 return jQuery.grep( elements, function( elem, i ) { 2765 return !!qualifier.call( elem, i, elem ) !== not; 2766 } ); 2767 } 2768 2769 // Single element 2770 if ( qualifier.nodeType ) { 2771 return jQuery.grep( elements, function( elem ) { 2772 return ( elem === qualifier ) !== not; 2773 } ); 2774 } 2775 2776 // Arraylike of elements (jQuery, arguments, Array) 2777 if ( typeof qualifier !== "string" ) { 2778 return jQuery.grep( elements, function( elem ) { 2779 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 2780 } ); 2781 } 2782 2783 // Filtered directly for both simple and complex selectors 2784 return jQuery.filter( qualifier, elements, not ); 2785} 2786 2787jQuery.filter = function( expr, elems, not ) { 2788 var elem = elems[ 0 ]; 2789 2790 if ( not ) { 2791 expr = ":not(" + expr + ")"; 2792 } 2793 2794 if ( elems.length === 1 && elem.nodeType === 1 ) { 2795 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 2796 } 2797 2798 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2799 return elem.nodeType === 1; 2800 } ) ); 2801}; 2802 2803jQuery.fn.extend( { 2804 find: function( selector ) { 2805 var i, ret, 2806 len = this.length, 2807 self = this; 2808 2809 if ( typeof selector !== "string" ) { 2810 return this.pushStack( jQuery( selector ).filter( function() { 2811 for ( i = 0; i < len; i++ ) { 2812 if ( jQuery.contains( self[ i ], this ) ) { 2813 return true; 2814 } 2815 } 2816 } ) ); 2817 } 2818 2819 ret = this.pushStack( [] ); 2820 2821 for ( i = 0; i < len; i++ ) { 2822 jQuery.find( selector, self[ i ], ret ); 2823 } 2824 2825 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 2826 }, 2827 filter: function( selector ) { 2828 return this.pushStack( winnow( this, selector || [], false ) ); 2829 }, 2830 not: function( selector ) { 2831 return this.pushStack( winnow( this, selector || [], true ) ); 2832 }, 2833 is: function( selector ) { 2834 return !!winnow( 2835 this, 2836 2837 // If this is a positional/relative selector, check membership in the returned set 2838 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2839 typeof selector === "string" && rneedsContext.test( selector ) ?
vendor: 9,941 bytes, lines 2840-3228
2840 jQuery( selector ) : 2841 selector || [], 2842 false 2843 ).length; 2844 } 2845} ); 2846 2847 2848// Initialize a jQuery object 2849 2850 2851// A central reference to the root jQuery(document) 2852var rootjQuery, 2853 2854 // A simple way to check for HTML strings 2855 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 2856 // Strict HTML recognition (trac-11290: must start with <) 2857 // Shortcut simple #id case for speed 2858 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 2859 2860 init = jQuery.fn.init = function( selector, context, root ) { 2861 var match, elem; 2862 2863 // HANDLE: $(""), $(null), $(undefined), $(false) 2864 if ( !selector ) { 2865 return this; 2866 } 2867 2868 // Method init() accepts an alternate rootjQuery 2869 // so migrate can support jQuery.sub (gh-2101) 2870 root = root || rootjQuery; 2871 2872 // Handle HTML strings 2873 if ( typeof selector === "string" ) { 2874 if ( selector[ 0 ] === "<" && 2875 selector[ selector.length - 1 ] === ">" && 2876 selector.length >= 3 ) { 2877 2878 // Assume that strings that start and end with <> are HTML and skip the regex check 2879 match = [ null, selector, null ]; 2880 2881 } else { 2882 match = rquickExpr.exec( selector ); 2883 } 2884 2885 // Match html or make sure no context is specified for #id 2886 if ( match && ( match[ 1 ] || !context ) ) { 2887 2888 // HANDLE: $(html) -> $(array) 2889 if ( match[ 1 ] ) { 2890 context = context instanceof jQuery ? context[ 0 ] : context; 2891 2892 // Option to run scripts is true for back-compat 2893 // Intentionally let the error be thrown if parseHTML is not present 2894 jQuery.merge( this, jQuery.parseHTML( 2895 match[ 1 ], 2896 context && context.nodeType ? context.ownerDocument || context : document, 2897 true 2898 ) ); 2899 2900 // HANDLE: $(html, props) 2901 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2902 for ( match in context ) { 2903 2904 // Properties of context are called as methods if possible 2905 if ( isFunction( this[ match ] ) ) { 2906 this[ match ]( context[ match ] ); 2907 2908 // ...and otherwise set as attributes 2909 } else { 2910 this.attr( match, context[ match ] ); 2911 } 2912 } 2913 } 2914 2915 return this; 2916 2917 // HANDLE: $(#id) 2918 } else { 2919 elem = document.getElementById( match[ 2 ] ); 2920 2921 if ( elem ) { 2922 2923 // Inject the element directly into the jQuery object 2924 this[ 0 ] = elem; 2925 this.length = 1; 2926 } 2927 return this; 2928 } 2929 2930 // HANDLE: $(expr, $(...)) 2931 } else if ( !context || context.jquery ) { 2932 return ( context || root ).find( selector ); 2933 2934 // HANDLE: $(expr, context) 2935 // (which is just equivalent to: $(context).find(expr) 2936 } else { 2937 return this.constructor( context ).find( selector ); 2938 } 2939 2940 // HANDLE: $(DOMElement) 2941 } else if ( selector.nodeType ) { 2942 this[ 0 ] = selector; 2943 this.length = 1; 2944 return this; 2945 2946 // HANDLE: $(function) 2947 // Shortcut for document ready 2948 } else if ( isFunction( selector ) ) { 2949 return root.ready !== undefined ? 2950 root.ready( selector ) : 2951 2952 // Execute immediately if ready is not present 2953 selector( jQuery ); 2954 } 2955 2956 return jQuery.makeArray( selector, this ); 2957 }; 2958 2959// Give the init function the jQuery prototype for later instantiation 2960init.prototype = jQuery.fn; 2961 2962// Initialize central reference 2963rootjQuery = jQuery( document ); 2964 2965 2966var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2967 2968 // Methods guaranteed to produce a unique set when starting from a unique set 2969 guaranteedUnique = { 2970 children: true, 2971 contents: true, 2972 next: true, 2973 prev: true 2974 }; 2975 2976jQuery.fn.extend( { 2977 has: function( target ) { 2978 var targets = jQuery( target, this ), 2979 l = targets.length; 2980 2981 return this.filter( function() { 2982 var i = 0; 2983 for ( ; i < l; i++ ) { 2984 if ( jQuery.contains( this, targets[ i ] ) ) { 2985 return true; 2986 } 2987 } 2988 } ); 2989 }, 2990 2991 closest: function( selectors, context ) { 2992 var cur, 2993 i = 0, 2994 l = this.length, 2995 matched = [], 2996 targets = typeof selectors !== "string" && jQuery( selectors ); 2997 2998 // Positional selectors never match, since there's no _selection_ context 2999 if ( !rneedsContext.test( selectors ) ) { 3000 for ( ; i < l; i++ ) { 3001 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 3002 3003 // Always skip document fragments 3004 if ( cur.nodeType < 11 && ( targets ? 3005 targets.index( cur ) > -1 : 3006 3007 // Don't pass non-elements to jQuery#find 3008 cur.nodeType === 1 && 3009 jQuery.find.matchesSelector( cur, selectors ) ) ) { 3010 3011 matched.push( cur ); 3012 break; 3013 } 3014 } 3015 } 3016 } 3017 3018 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3019 }, 3020 3021 // Determine the position of an element within the set 3022 index: function( elem ) { 3023 3024 // No argument, return index in parent 3025 if ( !elem ) { 3026 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3027 } 3028 3029 // Index in selector 3030 if ( typeof elem === "string" ) { 3031 return indexOf.call( jQuery( elem ), this[ 0 ] ); 3032 } 3033 3034 // Locate the position of the desired element 3035 return indexOf.call( this, 3036 3037 // If it receives a jQuery object, the first element is used 3038 elem.jquery ? elem[ 0 ] : elem 3039 ); 3040 }, 3041 3042 add: function( selector, context ) { 3043 return this.pushStack( 3044 jQuery.uniqueSort( 3045 jQuery.merge( this.get(), jQuery( selector, context ) ) 3046 ) 3047 ); 3048 }, 3049 3050 addBack: function( selector ) { 3051 return this.add( selector == null ? 3052 this.prevObject : this.prevObject.filter( selector ) 3053 ); 3054 } 3055} ); 3056 3057function sibling( cur, dir ) { 3058 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 3059 return cur; 3060} 3061 3062jQuery.each( { 3063 parent: function( elem ) { 3064 var parent = elem.parentNode; 3065 return parent && parent.nodeType !== 11 ? parent : null; 3066 }, 3067 parents: function( elem ) { 3068 return dir( elem, "parentNode" ); 3069 }, 3070 parentsUntil: function( elem, _i, until ) { 3071 return dir( elem, "parentNode", until ); 3072 }, 3073 next: function( elem ) { 3074 return sibling( elem, "nextSibling" ); 3075 }, 3076 prev: function( elem ) { 3077 return sibling( elem, "previousSibling" ); 3078 }, 3079 nextAll: function( elem ) { 3080 return dir( elem, "nextSibling" ); 3081 }, 3082 prevAll: function( elem ) { 3083 return dir( elem, "previousSibling" ); 3084 }, 3085 nextUntil: function( elem, _i, until ) { 3086 return dir( elem, "nextSibling", until ); 3087 }, 3088 prevUntil: function( elem, _i, until ) { 3089 return dir( elem, "previousSibling", until ); 3090 }, 3091 siblings: function( elem ) { 3092 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3093 }, 3094 children: function( elem ) { 3095 return siblings( elem.firstChild ); 3096 }, 3097 contents: function( elem ) { 3098 if ( elem.contentDocument != null && 3099 3100 // Support: IE 11+ 3101 // <object> elements with no `data` attribute has an object 3102 // `contentDocument` with a `null` prototype. 3103 getProto( elem.contentDocument ) ) { 3104 3105 return elem.contentDocument; 3106 } 3107 3108 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 3109 // Treat the template element as a regular one in browsers that 3110 // don't support it. 3111 if ( nodeName( elem, "template" ) ) { 3112 elem = elem.content || elem; 3113 } 3114 3115 return jQuery.merge( [], elem.childNodes ); 3116 } 3117}, function( name, fn ) { 3118 jQuery.fn[ name ] = function( until, selector ) { 3119 var matched = jQuery.map( this, fn, until ); 3120 3121 if ( name.slice( -5 ) !== "Until" ) { 3122 selector = until; 3123 } 3124 3125 if ( selector && typeof selector === "string" ) { 3126 matched = jQuery.filter( selector, matched ); 3127 } 3128 3129 if ( this.length > 1 ) { 3130 3131 // Remove duplicates 3132 if ( !guaranteedUnique[ name ] ) { 3133 jQuery.uniqueSort( matched ); 3134 } 3135 3136 // Reverse order for parents* and prev-derivatives 3137 if ( rparentsprev.test( name ) ) { 3138 matched.reverse(); 3139 } 3140 } 3141 3142 return this.pushStack( matched ); 3143 }; 3144} ); 3145var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 3146 3147 3148 3149// Convert String-formatted options into Object-formatted ones 3150function createOptions( options ) { 3151 var object = {}; 3152 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 3153 object[ flag ] = true; 3154 } ); 3155 return object; 3156} 3157 3158/* 3159 * Create a callback list using the following parameters: 3160 * 3161 * options: an optional list of space-separated options that will change how 3162 * the callback list behaves or a more traditional option object 3163 * 3164 * By default a callback list will act like an event callback list and can be 3165 * "fired" multiple times. 3166 * 3167 * Possible options: 3168 * 3169 * once: will ensure the callback list can only be fired once (like a Deferred) 3170 * 3171 * memory: will keep track of previous values and will call any callback added 3172 * after the list has been fired right away with the latest "memorized" 3173 * values (like a Deferred) 3174 * 3175 * unique: will ensure a callback can only be added once (no duplicate in the list) 3176 * 3177 * stopOnFalse: interrupt callings when a callback returns false 3178 * 3179 */ 3180jQuery.Callbacks = function( options ) { 3181 3182 // Convert options from String-formatted to Object-formatted if needed 3183 // (we check in cache first) 3184 options = typeof options === "string" ? 3185 createOptions( options ) : 3186 jQuery.extend( {}, options ); 3187 3188 var // Flag to know if list is currently firing 3189 firing, 3190 3191 // Last fire value for non-forgettable lists 3192 memory, 3193 3194 // Flag to know if list was already fired 3195 fired, 3196 3197 // Flag to prevent firing 3198 locked, 3199 3200 // Actual callback list 3201 list = [], 3202 3203 // Queue of execution data for repeatable lists 3204 queue = [], 3205 3206 // Index of currently firing callback (modified by add/remove as needed) 3207 firingIndex = -1, 3208 3209 // Fire callbacks 3210 fire = function() { 3211 3212 // Enforce single-firing 3213 locked = locked || options.once; 3214 3215 // Execute callbacks for all pending executions, 3216 // respecting firingIndex overrides and runtime changes 3217 fired = firing = true; 3218 for ( ; queue.length; firingIndex = -1 ) { 3219 memory = queue.shift(); 3220 while ( ++firingIndex < list.length ) { 3221 3222 // Run callback and check for early termination 3223 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3224 options.stopOnFalse ) { 3225 3226 // Jump to end and forget the data so .add doesn't re-fire 3227 firingIndex = list.length; 3228 memory = false;
vendor: 4,918 bytes, lines 3229-3438
3229 } 3230 } 3231 } 3232 3233 // Forget the data if we're done with it 3234 if ( !options.memory ) { 3235 memory = false; 3236 } 3237 3238 firing = false; 3239 3240 // Clean up if we're done firing for good 3241 if ( locked ) { 3242 3243 // Keep an empty list if we have data for future add calls 3244 if ( memory ) { 3245 list = []; 3246 3247 // Otherwise, this object is spent 3248 } else { 3249 list = ""; 3250 } 3251 } 3252 }, 3253 3254 // Actual Callbacks object 3255 self = { 3256 3257 // Add a callback or a collection of callbacks to the list 3258 add: function() { 3259 if ( list ) { 3260 3261 // If we have memory from a past run, we should fire after adding 3262 if ( memory && !firing ) { 3263 firingIndex = list.length - 1; 3264 queue.push( memory ); 3265 } 3266 3267 ( function add( args ) { 3268 jQuery.each( args, function( _, arg ) { 3269 if ( isFunction( arg ) ) { 3270 if ( !options.unique || !self.has( arg ) ) { 3271 list.push( arg ); 3272 } 3273 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 3274 3275 // Inspect recursively 3276 add( arg ); 3277 } 3278 } ); 3279 } )( arguments ); 3280 3281 if ( memory && !firing ) { 3282 fire(); 3283 } 3284 } 3285 return this; 3286 }, 3287 3288 // Remove a callback from the list 3289 remove: function() { 3290 jQuery.each( arguments, function( _, arg ) { 3291 var index; 3292 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3293 list.splice( index, 1 ); 3294 3295 // Handle firing indexes 3296 if ( index <= firingIndex ) { 3297 firingIndex--; 3298 } 3299 } 3300 } ); 3301 return this; 3302 }, 3303 3304 // Check if a given callback is in the list. 3305 // If no argument is given, return whether or not list has callbacks attached. 3306 has: function( fn ) { 3307 return fn ? 3308 jQuery.inArray( fn, list ) > -1 : 3309 list.length > 0; 3310 }, 3311 3312 // Remove all callbacks from the list 3313 empty: function() { 3314 if ( list ) { 3315 list = []; 3316 } 3317 return this; 3318 }, 3319 3320 // Disable .fire and .add 3321 // Abort any current/pending executions 3322 // Clear all callbacks and values 3323 disable: function() { 3324 locked = queue = []; 3325 list = memory = ""; 3326 return this; 3327 }, 3328 disabled: function() { 3329 return !list; 3330 }, 3331 3332 // Disable .fire 3333 // Also disable .add unless we have memory (since it would have no effect) 3334 // Abort any pending executions 3335 lock: function() { 3336 locked = queue = []; 3337 if ( !memory && !firing ) { 3338 list = memory = ""; 3339 } 3340 return this; 3341 }, 3342 locked: function() { 3343 return !!locked; 3344 }, 3345 3346 // Call all callbacks with the given context and arguments 3347 fireWith: function( context, args ) { 3348 if ( !locked ) { 3349 args = args || []; 3350 args = [ context, args.slice ? args.slice() : args ]; 3351 queue.push( args ); 3352 if ( !firing ) { 3353 fire(); 3354 } 3355 } 3356 return this; 3357 }, 3358 3359 // Call all the callbacks with the given arguments 3360 fire: function() { 3361 self.fireWith( this, arguments ); 3362 return this; 3363 }, 3364 3365 // To know if the callbacks have already been called at least once 3366 fired: function() { 3367 return !!fired; 3368 } 3369 }; 3370 3371 return self; 3372}; 3373 3374 3375function Identity( v ) { 3376 return v; 3377} 3378function Thrower( ex ) { 3379 throw ex; 3380} 3381 3382function adoptValue( value, resolve, reject, noValue ) { 3383 var method; 3384 3385 try { 3386 3387 // Check for promise aspect first to privilege synchronous behavior 3388 if ( value && isFunction( ( method = value.promise ) ) ) { 3389 method.call( value ).done( resolve ).fail( reject ); 3390 3391 // Other thenables 3392 } else if ( value && isFunction( ( method = value.then ) ) ) { 3393 method.call( value, resolve, reject ); 3394 3395 // Other non-thenables 3396 } else { 3397 3398 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 3399 // * false: [ value ].slice( 0 ) => resolve( value ) 3400 // * true: [ value ].slice( 1 ) => resolve() 3401 resolve.apply( undefined, [ value ].slice( noValue ) ); 3402 } 3403 3404 // For Promises/A+, convert exceptions into rejections 3405 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 3406 // Deferred#then to conditionally suppress rejection. 3407 } catch ( value ) { 3408 3409 // Support: Android 4.0 only 3410 // Strict mode functions invoked without .call/.apply get global-object context 3411 reject.apply( undefined, [ value ] ); 3412 } 3413} 3414 3415jQuery.extend( { 3416 3417 Deferred: function( func ) { 3418 var tuples = [ 3419 3420 // action, add listener, callbacks, 3421 // ... .then handlers, argument index, [final state] 3422 [ "notify", "progress", jQuery.Callbacks( "memory" ), 3423 jQuery.Callbacks( "memory" ), 2 ], 3424 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 3425 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 3426 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 3427 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 3428 ], 3429 state = "pending", 3430 promise = { 3431 state: function() { 3432 return state; 3433 }, 3434 always: function() { 3435 deferred.done( arguments ).fail( arguments ); 3436 return this; 3437 }, 3438 "catch": function( fn ) {
vendor: 28,472 bytes, lines 3439-4550
3439 return promise.then( null, fn ); 3440 }, 3441 3442 // Keep pipe for back-compat 3443 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 3444 var fns = arguments; 3445 3446 return jQuery.Deferred( function( newDefer ) { 3447 jQuery.each( tuples, function( _i, tuple ) { 3448 3449 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 3450 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 3451 3452 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 3453 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 3454 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 3455 deferred[ tuple[ 1 ] ]( function() { 3456 var returned = fn && fn.apply( this, arguments ); 3457 if ( returned && isFunction( returned.promise ) ) { 3458 returned.promise() 3459 .progress( newDefer.notify ) 3460 .done( newDefer.resolve ) 3461 .fail( newDefer.reject ); 3462 } else { 3463 newDefer[ tuple[ 0 ] + "With" ]( 3464 this, 3465 fn ? [ returned ] : arguments 3466 ); 3467 } 3468 } ); 3469 } ); 3470 fns = null; 3471 } ).promise(); 3472 }, 3473 then: function( onFulfilled, onRejected, onProgress ) { 3474 var maxDepth = 0; 3475 function resolve( depth, deferred, handler, special ) { 3476 return function() { 3477 var that = this, 3478 args = arguments, 3479 mightThrow = function() { 3480 var returned, then; 3481 3482 // Support: Promises/A+ section 2.3.3.3.3 3483 // https://promisesaplus.com/#point-59 3484 // Ignore double-resolution attempts 3485 if ( depth < maxDepth ) { 3486 return; 3487 } 3488 3489 returned = handler.apply( that, args ); 3490 3491 // Support: Promises/A+ section 2.3.1 3492 // https://promisesaplus.com/#point-48 3493 if ( returned === deferred.promise() ) { 3494 throw new TypeError( "Thenable self-resolution" ); 3495 } 3496 3497 // Support: Promises/A+ sections 2.3.3.1, 3.5 3498 // https://promisesaplus.com/#point-54 3499 // https://promisesaplus.com/#point-75 3500 // Retrieve `then` only once 3501 then = returned && 3502 3503 // Support: Promises/A+ section 2.3.4 3504 // https://promisesaplus.com/#point-64 3505 // Only check objects and functions for thenability 3506 ( typeof returned === "object" || 3507 typeof returned === "function" ) && 3508 returned.then; 3509 3510 // Handle a returned thenable 3511 if ( isFunction( then ) ) { 3512 3513 // Special processors (notify) just wait for resolution 3514 if ( special ) { 3515 then.call( 3516 returned, 3517 resolve( maxDepth, deferred, Identity, special ), 3518 resolve( maxDepth, deferred, Thrower, special ) 3519 ); 3520 3521 // Normal processors (resolve) also hook into progress 3522 } else { 3523 3524 // ...and disregard older resolution values 3525 maxDepth++; 3526 3527 then.call( 3528 returned, 3529 resolve( maxDepth, deferred, Identity, special ), 3530 resolve( maxDepth, deferred, Thrower, special ), 3531 resolve( maxDepth, deferred, Identity, 3532 deferred.notifyWith ) 3533 ); 3534 } 3535 3536 // Handle all other returned values 3537 } else { 3538 3539 // Only substitute handlers pass on context 3540 // and multiple values (non-spec behavior) 3541 if ( handler !== Identity ) { 3542 that = undefined; 3543 args = [ returned ]; 3544 } 3545 3546 // Process the value(s) 3547 // Default process is resolve 3548 ( special || deferred.resolveWith )( that, args ); 3549 } 3550 }, 3551 3552 // Only normal processors (resolve) catch and reject exceptions 3553 process = special ? 3554 mightThrow : 3555 function() { 3556 try { 3557 mightThrow(); 3558 } catch ( e ) { 3559 3560 if ( jQuery.Deferred.exceptionHook ) { 3561 jQuery.Deferred.exceptionHook( e, 3562 process.error ); 3563 } 3564 3565 // Support: Promises/A+ section 2.3.3.3.4.1 3566 // https://promisesaplus.com/#point-61 3567 // Ignore post-resolution exceptions 3568 if ( depth + 1 >= maxDepth ) { 3569 3570 // Only substitute handlers pass on context 3571 // and multiple values (non-spec behavior) 3572 if ( handler !== Thrower ) { 3573 that = undefined; 3574 args = [ e ]; 3575 } 3576 3577 deferred.rejectWith( that, args ); 3578 } 3579 } 3580 }; 3581 3582 // Support: Promises/A+ section 2.3.3.3.1 3583 // https://promisesaplus.com/#point-57 3584 // Re-resolve promises immediately to dodge false rejection from 3585 // subsequent errors 3586 if ( depth ) { 3587 process(); 3588 } else { 3589 3590 // Call an optional hook to record the error, in case of exception 3591 // since it's otherwise lost when execution goes async 3592 if ( jQuery.Deferred.getErrorHook ) { 3593 process.error = jQuery.Deferred.getErrorHook(); 3594 3595 // The deprecated alias of the above. While the name suggests 3596 // returning the stack, not an error instance, jQuery just passes 3597 // it directly to `console.warn` so both will work; an instance 3598 // just better cooperates with source maps. 3599 } else if ( jQuery.Deferred.getStackHook ) { 3600 process.error = jQuery.Deferred.getStackHook(); 3601 } 3602 window.setTimeout( process ); 3603 } 3604 }; 3605 } 3606 3607 return jQuery.Deferred( function( newDefer ) { 3608 3609 // progress_handlers.add( ... ) 3610 tuples[ 0 ][ 3 ].add( 3611 resolve( 3612 0, 3613 newDefer, 3614 isFunction( onProgress ) ? 3615 onProgress : 3616 Identity, 3617 newDefer.notifyWith 3618 ) 3619 ); 3620 3621 // fulfilled_handlers.add( ... ) 3622 tuples[ 1 ][ 3 ].add( 3623 resolve( 3624 0, 3625 newDefer, 3626 isFunction( onFulfilled ) ? 3627 onFulfilled : 3628 Identity 3629 ) 3630 ); 3631 3632 // rejected_handlers.add( ... ) 3633 tuples[ 2 ][ 3 ].add( 3634 resolve( 3635 0, 3636 newDefer, 3637 isFunction( onRejected ) ? 3638 onRejected : 3639 Thrower 3640 ) 3641 ); 3642 } ).promise(); 3643 }, 3644 3645 // Get a promise for this deferred 3646 // If obj is provided, the promise aspect is added to the object 3647 promise: function( obj ) { 3648 return obj != null ? jQuery.extend( obj, promise ) : promise; 3649 } 3650 }, 3651 deferred = {}; 3652 3653 // Add list-specific methods 3654 jQuery.each( tuples, function( i, tuple ) { 3655 var list = tuple[ 2 ], 3656 stateString = tuple[ 5 ]; 3657 3658 // promise.progress = list.add 3659 // promise.done = list.add 3660 // promise.fail = list.add 3661 promise[ tuple[ 1 ] ] = list.add; 3662 3663 // Handle state 3664 if ( stateString ) { 3665 list.add( 3666 function() { 3667 3668 // state = "resolved" (i.e., fulfilled) 3669 // state = "rejected" 3670 state = stateString; 3671 }, 3672 3673 // rejected_callbacks.disable 3674 // fulfilled_callbacks.disable 3675 tuples[ 3 - i ][ 2 ].disable, 3676 3677 // rejected_handlers.disable 3678 // fulfilled_handlers.disable 3679 tuples[ 3 - i ][ 3 ].disable, 3680 3681 // progress_callbacks.lock 3682 tuples[ 0 ][ 2 ].lock, 3683 3684 // progress_handlers.lock 3685 tuples[ 0 ][ 3 ].lock 3686 ); 3687 } 3688 3689 // progress_handlers.fire 3690 // fulfilled_handlers.fire 3691 // rejected_handlers.fire 3692 list.add( tuple[ 3 ].fire ); 3693 3694 // deferred.notify = function() { deferred.notifyWith(...) } 3695 // deferred.resolve = function() { deferred.resolveWith(...) } 3696 // deferred.reject = function() { deferred.rejectWith(...) } 3697 deferred[ tuple[ 0 ] ] = function() { 3698 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 3699 return this; 3700 }; 3701 3702 // deferred.notifyWith = list.fireWith 3703 // deferred.resolveWith = list.fireWith 3704 // deferred.rejectWith = list.fireWith 3705 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3706 } ); 3707 3708 // Make the deferred a promise 3709 promise.promise( deferred ); 3710 3711 // Call given func if any 3712 if ( func ) { 3713 func.call( deferred, deferred ); 3714 } 3715 3716 // All done! 3717 return deferred; 3718 }, 3719 3720 // Deferred helper 3721 when: function( singleValue ) { 3722 var 3723 3724 // count of uncompleted subordinates 3725 remaining = arguments.length, 3726 3727 // count of unprocessed arguments 3728 i = remaining, 3729 3730 // subordinate fulfillment data 3731 resolveContexts = Array( i ), 3732 resolveValues = slice.call( arguments ), 3733 3734 // the primary Deferred 3735 primary = jQuery.Deferred(), 3736 3737 // subordinate callback factory 3738 updateFunc = function( i ) { 3739 return function( value ) { 3740 resolveContexts[ i ] = this; 3741 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3742 if ( !( --remaining ) ) { 3743 primary.resolveWith( resolveContexts, resolveValues ); 3744 } 3745 }; 3746 }; 3747 3748 // Single- and empty arguments are adopted like Promise.resolve 3749 if ( remaining <= 1 ) { 3750 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 3751 !remaining ); 3752 3753 // Use .then() to unwrap secondary thenables (cf. gh-3000) 3754 if ( primary.state() === "pending" || 3755 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 3756 3757 return primary.then(); 3758 } 3759 } 3760 3761 // Multiple arguments are aggregated like Promise.all array elements 3762 while ( i-- ) { 3763 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 3764 } 3765 3766 return primary.promise(); 3767 } 3768} ); 3769 3770 3771// These usually indicate a programmer mistake during development, 3772// warn about them ASAP rather than swallowing them by default. 3773var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 3774 3775// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 3776// captured before the async barrier to get the original error cause 3777// which may otherwise be hidden. 3778jQuery.Deferred.exceptionHook = function( error, asyncError ) { 3779 3780 // Support: IE 8 - 9 only 3781 // Console exists when dev tools are open, which can happen at any time 3782 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 3783 window.console.warn( "jQuery.Deferred exception: " + error.message, 3784 error.stack, asyncError ); 3785 } 3786}; 3787 3788 3789 3790 3791jQuery.readyException = function( error ) { 3792 window.setTimeout( function() { 3793 throw error; 3794 } ); 3795}; 3796 3797 3798 3799 3800// The deferred used on DOM ready 3801var readyList = jQuery.Deferred(); 3802 3803jQuery.fn.ready = function( fn ) { 3804 3805 readyList 3806 .then( fn ) 3807 3808 // Wrap jQuery.readyException in a function so that the lookup 3809 // happens at the time of error handling instead of callback 3810 // registration. 3811 .catch( function( error ) { 3812 jQuery.readyException( error ); 3813 } ); 3814 3815 return this; 3816}; 3817 3818jQuery.extend( { 3819 3820 // Is the DOM ready to be used? Set to true once it occurs. 3821 isReady: false, 3822 3823 // A counter to track how many items to wait for before 3824 // the ready event fires. See trac-6781 3825 readyWait: 1, 3826 3827 // Handle when the DOM is ready 3828 ready: function( wait ) { 3829 3830 // Abort if there are pending holds or we're already ready 3831 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3832 return; 3833 } 3834 3835 // Remember that the DOM is ready 3836 jQuery.isReady = true; 3837 3838 // If a normal DOM Ready event fired, decrement, and wait if need be 3839 if ( wait !== true && --jQuery.readyWait > 0 ) { 3840 return; 3841 } 3842 3843 // If there are functions bound, to execute 3844 readyList.resolveWith( document, [ jQuery ] ); 3845 } 3846} ); 3847 3848jQuery.ready.then = readyList.then; 3849 3850// The ready event handler and self cleanup method 3851function completed() { 3852 document.removeEventListener( "DOMContentLoaded", completed ); 3853 window.removeEventListener( "load", completed ); 3854 jQuery.ready(); 3855} 3856 3857// Catch cases where $(document).ready() is called 3858// after the browser event has already occurred. 3859// Support: IE <=9 - 10 only 3860// Older IE sometimes signals "interactive" too soon 3861if ( document.readyState === "complete" || 3862 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3863 3864 // Handle it asynchronously to allow scripts the opportunity to delay ready 3865 window.setTimeout( jQuery.ready ); 3866 3867} else { 3868 3869 // Use the handy event callback 3870 document.addEventListener( "DOMContentLoaded", completed ); 3871 3872 // A fallback to window.onload, that will always work 3873 window.addEventListener( "load", completed ); 3874} 3875 3876 3877 3878 3879// Multifunctional method to get and set values of a collection 3880// The value/s can optionally be executed if it's a function 3881var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 3882 var i = 0, 3883 len = elems.length, 3884 bulk = key == null; 3885 3886 // Sets many values 3887 if ( toType( key ) === "object" ) { 3888 chainable = true; 3889 for ( i in key ) { 3890 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 3891 } 3892 3893 // Sets one value 3894 } else if ( value !== undefined ) { 3895 chainable = true; 3896 3897 if ( !isFunction( value ) ) { 3898 raw = true; 3899 } 3900 3901 if ( bulk ) { 3902 3903 // Bulk operations run against the entire set 3904 if ( raw ) { 3905 fn.call( elems, value ); 3906 fn = null; 3907 3908 // ...except when executing function values 3909 } else { 3910 bulk = fn; 3911 fn = function( elem, _key, value ) { 3912 return bulk.call( jQuery( elem ), value ); 3913 }; 3914 } 3915 } 3916 3917 if ( fn ) { 3918 for ( ; i < len; i++ ) { 3919 fn( 3920 elems[ i ], key, raw ? 3921 value : 3922 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 3923 ); 3924 } 3925 } 3926 } 3927 3928 if ( chainable ) { 3929 return elems; 3930 } 3931 3932 // Gets 3933 if ( bulk ) { 3934 return fn.call( elems ); 3935 } 3936 3937 return len ? fn( elems[ 0 ], key ) : emptyGet; 3938}; 3939 3940 3941// Matches dashed string for camelizing 3942var rmsPrefix = /^-ms-/, 3943 rdashAlpha = /-([a-z])/g; 3944 3945// Used by camelCase as callback to replace() 3946function fcamelCase( _all, letter ) { 3947 return letter.toUpperCase(); 3948} 3949 3950// Convert dashed to camelCase; used by the css and data modules 3951// Support: IE <=9 - 11, Edge 12 - 15 3952// Microsoft forgot to hump their vendor prefix (trac-9572) 3953function camelCase( string ) { 3954 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 3955} 3956var acceptData = function( owner ) { 3957 3958 // Accepts only: 3959 // - Node 3960 // - Node.ELEMENT_NODE 3961 // - Node.DOCUMENT_NODE 3962 // - Object 3963 // - Any 3964 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 3965}; 3966 3967 3968 3969 3970function Data() { 3971 this.expando = jQuery.expando + Data.uid++; 3972} 3973 3974Data.uid = 1; 3975 3976Data.prototype = { 3977 3978 cache: function( owner ) { 3979 3980 // Check if the owner object already has a cache 3981 var value = owner[ this.expando ]; 3982 3983 // If not, create one 3984 if ( !value ) { 3985 value = {}; 3986 3987 // We can accept data for non-element nodes in modern browsers, 3988 // but we should not, see trac-8335. 3989 // Always return an empty object. 3990 if ( acceptData( owner ) ) { 3991 3992 // If it is a node unlikely to be stringify-ed or looped over 3993 // use plain assignment 3994 if ( owner.nodeType ) { 3995 owner[ this.expando ] = value; 3996 3997 // Otherwise secure it in a non-enumerable property 3998 // configurable must be true to allow the property to be 3999 // deleted when data is removed 4000 } else { 4001 Object.defineProperty( owner, this.expando, { 4002 value: value, 4003 configurable: true 4004 } ); 4005 } 4006 } 4007 } 4008 4009 return value; 4010 }, 4011 set: function( owner, data, value ) { 4012 var prop, 4013 cache = this.cache( owner ); 4014 4015 // Handle: [ owner, key, value ] args 4016 // Always use camelCase key (gh-2257) 4017 if ( typeof data === "string" ) { 4018 cache[ camelCase( data ) ] = value; 4019 4020 // Handle: [ owner, { properties } ] args 4021 } else { 4022 4023 // Copy the properties one-by-one to the cache object 4024 for ( prop in data ) { 4025 cache[ camelCase( prop ) ] = data[ prop ]; 4026 } 4027 } 4028 return cache; 4029 }, 4030 get: function( owner, key ) { 4031 return key === undefined ? 4032 this.cache( owner ) : 4033 4034 // Always use camelCase key (gh-2257) 4035 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 4036 }, 4037 access: function( owner, key, value ) { 4038 4039 // In cases where either: 4040 // 4041 // 1. No key was specified 4042 // 2. A string key was specified, but no value provided 4043 // 4044 // Take the "read" path and allow the get method to determine 4045 // which value to return, respectively either: 4046 // 4047 // 1. The entire cache object 4048 // 2. The data stored at the key 4049 // 4050 if ( key === undefined || 4051 ( ( key && typeof key === "string" ) && value === undefined ) ) { 4052 4053 return this.get( owner, key ); 4054 } 4055 4056 // When the key is not a string, or both a key and value 4057 // are specified, set or extend (existing objects) with either: 4058 // 4059 // 1. An object of properties 4060 // 2. A key and value 4061 // 4062 this.set( owner, key, value ); 4063 4064 // Since the "set" path can have two possible entry points 4065 // return the expected data based on which path was taken[*] 4066 return value !== undefined ? value : key; 4067 }, 4068 remove: function( owner, key ) { 4069 var i, 4070 cache = owner[ this.expando ]; 4071 4072 if ( cache === undefined ) { 4073 return; 4074 } 4075 4076 if ( key !== undefined ) { 4077 4078 // Support array or space separated string of keys 4079 if ( Array.isArray( key ) ) { 4080 4081 // If key is an array of keys... 4082 // We always set camelCase keys, so remove that. 4083 key = key.map( camelCase ); 4084 } else { 4085 key = camelCase( key ); 4086 4087 // If a key with the spaces exists, use it. 4088 // Otherwise, create an array by matching non-whitespace 4089 key = key in cache ? 4090 [ key ] : 4091 ( key.match( rnothtmlwhite ) || [] ); 4092 } 4093 4094 i = key.length; 4095 4096 while ( i-- ) { 4097 delete cache[ key[ i ] ]; 4098 } 4099 } 4100 4101 // Remove the expando if there's no more data 4102 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 4103 4104 // Support: Chrome <=35 - 45 4105 // Webkit & Blink performance suffers when deleting properties 4106 // from DOM nodes, so set to undefined instead 4107 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 4108 if ( owner.nodeType ) { 4109 owner[ this.expando ] = undefined; 4110 } else { 4111 delete owner[ this.expando ]; 4112 } 4113 } 4114 }, 4115 hasData: function( owner ) { 4116 var cache = owner[ this.expando ]; 4117 return cache !== undefined && !jQuery.isEmptyObject( cache ); 4118 } 4119}; 4120var dataPriv = new Data(); 4121 4122var dataUser = new Data(); 4123 4124 4125 4126// Implementation Summary 4127// 4128// 1. Enforce API surface and semantic compatibility with 1.9.x branch 4129// 2. Improve the module's maintainability by reducing the storage 4130// paths to a single mechanism. 4131// 3. Use the same single mechanism to support "private" and "user" data. 4132// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 4133// 5. Avoid exposing implementation details on user objects (eg. expando properties) 4134// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 4135 4136var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 4137 rmultiDash = /[A-Z]/g; 4138 4139function getData( data ) { 4140 if ( data === "true" ) { 4141 return true; 4142 } 4143 4144 if ( data === "false" ) { 4145 return false; 4146 } 4147 4148 if ( data === "null" ) { 4149 return null; 4150 } 4151 4152 // Only convert to a number if it doesn't change the string 4153 if ( data === +data + "" ) { 4154 return +data; 4155 } 4156 4157 if ( rbrace.test( data ) ) { 4158 return JSON.parse( data ); 4159 } 4160 4161 return data; 4162} 4163 4164function dataAttr( elem, key, data ) { 4165 var name; 4166 4167 // If nothing was found internally, try to fetch any 4168 // data from the HTML5 data-* attribute 4169 if ( data === undefined && elem.nodeType === 1 ) { 4170 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 4171 data = elem.getAttribute( name ); 4172 4173 if ( typeof data === "string" ) { 4174 try { 4175 data = getData( data ); 4176 } catch ( e ) {} 4177 4178 // Make sure we set the data so it isn't changed later 4179 dataUser.set( elem, key, data ); 4180 } else { 4181 data = undefined; 4182 } 4183 } 4184 return data; 4185} 4186 4187jQuery.extend( { 4188 hasData: function( elem ) { 4189 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 4190 }, 4191 4192 data: function( elem, name, data ) { 4193 return dataUser.access( elem, name, data ); 4194 }, 4195 4196 removeData: function( elem, name ) { 4197 dataUser.remove( elem, name ); 4198 }, 4199 4200 // TODO: Now that all calls to _data and _removeData have been replaced 4201 // with direct calls to dataPriv methods, these can be deprecated. 4202 _data: function( elem, name, data ) { 4203 return dataPriv.access( elem, name, data ); 4204 }, 4205 4206 _removeData: function( elem, name ) { 4207 dataPriv.remove( elem, name ); 4208 } 4209} ); 4210 4211jQuery.fn.extend( { 4212 data: function( key, value ) { 4213 var i, name, data, 4214 elem = this[ 0 ], 4215 attrs = elem && elem.attributes; 4216 4217 // Gets all values 4218 if ( key === undefined ) { 4219 if ( this.length ) { 4220 data = dataUser.get( elem ); 4221 4222 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 4223 i = attrs.length; 4224 while ( i-- ) { 4225 4226 // Support: IE 11 only 4227 // The attrs elements can be null (trac-14894) 4228 if ( attrs[ i ] ) { 4229 name = attrs[ i ].name; 4230 if ( name.indexOf( "data-" ) === 0 ) { 4231 name = camelCase( name.slice( 5 ) ); 4232 dataAttr( elem, name, data[ name ] ); 4233 } 4234 } 4235 } 4236 dataPriv.set( elem, "hasDataAttrs", true ); 4237 } 4238 } 4239 4240 return data; 4241 } 4242 4243 // Sets multiple values 4244 if ( typeof key === "object" ) { 4245 return this.each( function() { 4246 dataUser.set( this, key ); 4247 } ); 4248 } 4249 4250 return access( this, function( value ) { 4251 var data; 4252 4253 // The calling jQuery object (element matches) is not empty 4254 // (and therefore has an element appears at this[ 0 ]) and the 4255 // `value` parameter was not undefined. An empty jQuery object 4256 // will result in `undefined` for elem = this[ 0 ] which will 4257 // throw an exception if an attempt to read a data cache is made. 4258 if ( elem && value === undefined ) { 4259 4260 // Attempt to get data from the cache 4261 // The key will always be camelCased in Data 4262 data = dataUser.get( elem, key ); 4263 if ( data !== undefined ) { 4264 return data; 4265 } 4266 4267 // Attempt to "discover" the data in 4268 // HTML5 custom data-* attrs 4269 data = dataAttr( elem, key ); 4270 if ( data !== undefined ) { 4271 return data; 4272 } 4273 4274 // We tried really hard, but the data doesn't exist. 4275 return; 4276 } 4277 4278 // Set the data... 4279 this.each( function() { 4280 4281 // We always store the camelCased key 4282 dataUser.set( this, key, value ); 4283 } ); 4284 }, null, value, arguments.length > 1, null, true ); 4285 }, 4286 4287 removeData: function( key ) { 4288 return this.each( function() { 4289 dataUser.remove( this, key ); 4290 } ); 4291 } 4292} ); 4293 4294 4295jQuery.extend( { 4296 queue: function( elem, type, data ) { 4297 var queue; 4298 4299 if ( elem ) { 4300 type = ( type || "fx" ) + "queue"; 4301 queue = dataPriv.get( elem, type ); 4302 4303 // Speed up dequeue by getting out quickly if this is just a lookup 4304 if ( data ) { 4305 if ( !queue || Array.isArray( data ) ) { 4306 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 4307 } else { 4308 queue.push( data ); 4309 } 4310 } 4311 return queue || []; 4312 } 4313 }, 4314 4315 dequeue: function( elem, type ) { 4316 type = type || "fx"; 4317 4318 var queue = jQuery.queue( elem, type ), 4319 startLength = queue.length, 4320 fn = queue.shift(), 4321 hooks = jQuery._queueHooks( elem, type ), 4322 next = function() { 4323 jQuery.dequeue( elem, type ); 4324 }; 4325 4326 // If the fx queue is dequeued, always remove the progress sentinel 4327 if ( fn === "inprogress" ) { 4328 fn = queue.shift(); 4329 startLength--; 4330 } 4331 4332 if ( fn ) { 4333 4334 // Add a progress sentinel to prevent the fx queue from being 4335 // automatically dequeued 4336 if ( type === "fx" ) { 4337 queue.unshift( "inprogress" ); 4338 } 4339 4340 // Clear up the last queue stop function 4341 delete hooks.stop; 4342 fn.call( elem, next, hooks ); 4343 } 4344 4345 if ( !startLength && hooks ) { 4346 hooks.empty.fire(); 4347 } 4348 }, 4349 4350 // Not public - generate a queueHooks object, or return the current one 4351 _queueHooks: function( elem, type ) { 4352 var key = type + "queueHooks"; 4353 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 4354 empty: jQuery.Callbacks( "once memory" ).add( function() { 4355 dataPriv.remove( elem, [ type + "queue", key ] ); 4356 } ) 4357 } ); 4358 } 4359} ); 4360 4361jQuery.fn.extend( { 4362 queue: function( type, data ) { 4363 var setter = 2; 4364 4365 if ( typeof type !== "string" ) { 4366 data = type; 4367 type = "fx"; 4368 setter--; 4369 } 4370 4371 if ( arguments.length < setter ) { 4372 return jQuery.queue( this[ 0 ], type ); 4373 } 4374 4375 return data === undefined ? 4376 this : 4377 this.each( function() { 4378 var queue = jQuery.queue( this, type, data ); 4379 4380 // Ensure a hooks for this queue 4381 jQuery._queueHooks( this, type ); 4382 4383 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4384 jQuery.dequeue( this, type ); 4385 } 4386 } ); 4387 }, 4388 dequeue: function( type ) { 4389 return this.each( function() { 4390 jQuery.dequeue( this, type ); 4391 } ); 4392 }, 4393 clearQueue: function( type ) { 4394 return this.queue( type || "fx", [] ); 4395 }, 4396 4397 // Get a promise resolved when queues of a certain type 4398 // are emptied (fx is the type by default) 4399 promise: function( type, obj ) { 4400 var tmp, 4401 count = 1, 4402 defer = jQuery.Deferred(), 4403 elements = this, 4404 i = this.length, 4405 resolve = function() { 4406 if ( !( --count ) ) { 4407 defer.resolveWith( elements, [ elements ] ); 4408 } 4409 }; 4410 4411 if ( typeof type !== "string" ) { 4412 obj = type; 4413 type = undefined; 4414 } 4415 type = type || "fx"; 4416 4417 while ( i-- ) { 4418 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 4419 if ( tmp && tmp.empty ) { 4420 count++; 4421 tmp.empty.add( resolve ); 4422 } 4423 } 4424 resolve(); 4425 return defer.promise( obj ); 4426 } 4427} ); 4428var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4429 4430var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4431 4432 4433var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4434 4435var documentElement = document.documentElement; 4436 4437 4438 4439 var isAttached = function( elem ) { 4440 return jQuery.contains( elem.ownerDocument, elem ); 4441 }, 4442 composed = { composed: true }; 4443 4444 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 4445 // Check attachment across shadow DOM boundaries when possible (gh-3504) 4446 // Support: iOS 10.0-10.2 only 4447 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 4448 // leading to errors. We need to check for `getRootNode`. 4449 if ( documentElement.getRootNode ) { 4450 isAttached = function( elem ) { 4451 return jQuery.contains( elem.ownerDocument, elem ) || 4452 elem.getRootNode( composed ) === elem.ownerDocument; 4453 }; 4454 } 4455var isHiddenWithinTree = function( elem, el ) { 4456 4457 // isHiddenWithinTree might be called from jQuery#filter function; 4458 // in that case, element will be second argument 4459 elem = el || elem; 4460 4461 // Inline style trumps all 4462 return elem.style.display === "none" || 4463 elem.style.display === "" && 4464 4465 // Otherwise, check computed style 4466 // Support: Firefox <=43 - 45 4467 // Disconnected elements can have computed display: none, so first confirm that elem is 4468 // in the document. 4469 isAttached( elem ) && 4470 4471 jQuery.css( elem, "display" ) === "none"; 4472 }; 4473 4474 4475 4476function adjustCSS( elem, prop, valueParts, tween ) { 4477 var adjusted, scale, 4478 maxIterations = 20, 4479 currentValue = tween ? 4480 function() { 4481 return tween.cur(); 4482 } : 4483 function() { 4484 return jQuery.css( elem, prop, "" ); 4485 }, 4486 initial = currentValue(), 4487 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4488 4489 // Starting value computation is required for potential unit mismatches 4490 initialInUnit = elem.nodeType && 4491 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4492 rcssNum.exec( jQuery.css( elem, prop ) ); 4493 4494 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4495 4496 // Support: Firefox <=54 4497 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 4498 initial = initial / 2; 4499 4500 // Trust units reported by jQuery.css 4501 unit = unit || initialInUnit[ 3 ]; 4502 4503 // Iteratively approximate from a nonzero starting point 4504 initialInUnit = +initial || 1; 4505 4506 while ( maxIterations-- ) { 4507 4508 // Evaluate and update our best guess (doubling guesses that zero out). 4509 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 4510 jQuery.style( elem, prop, initialInUnit + unit ); 4511 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 4512 maxIterations = 0; 4513 } 4514 initialInUnit = initialInUnit / scale; 4515 4516 } 4517 4518 initialInUnit = initialInUnit * 2; 4519 jQuery.style( elem, prop, initialInUnit + unit ); 4520 4521 // Make sure we update the tween properties later on 4522 valueParts = valueParts || []; 4523 } 4524 4525 if ( valueParts ) { 4526 initialInUnit = +initialInUnit || +initial || 0; 4527 4528 // Apply relative offset (+=/-=) if specified 4529 adjusted = valueParts[ 1 ] ? 4530 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4531 +valueParts[ 2 ]; 4532 if ( tween ) { 4533 tween.unit = unit; 4534 tween.start = initialInUnit; 4535 tween.end = adjusted; 4536 } 4537 } 4538 return adjusted; 4539} 4540 4541 4542var defaultDisplayMap = {}; 4543 4544function getDefaultDisplay( elem ) { 4545 var temp, 4546 doc = elem.ownerDocument, 4547 nodeName = elem.nodeName, 4548 display = defaultDisplayMap[ nodeName ]; 4549 4550 if ( display ) {
vendor: 2,317 bytes, lines 4551-4649
4551 return display; 4552 } 4553 4554 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 4555 display = jQuery.css( temp, "display" ); 4556 4557 temp.parentNode.removeChild( temp ); 4558 4559 if ( display === "none" ) { 4560 display = "block"; 4561 } 4562 defaultDisplayMap[ nodeName ] = display; 4563 4564 return display; 4565} 4566 4567function showHide( elements, show ) { 4568 var display, elem, 4569 values = [], 4570 index = 0, 4571 length = elements.length; 4572 4573 // Determine new display value for elements that need to change 4574 for ( ; index < length; index++ ) { 4575 elem = elements[ index ]; 4576 if ( !elem.style ) { 4577 continue; 4578 } 4579 4580 display = elem.style.display; 4581 if ( show ) { 4582 4583 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 4584 // check is required in this first loop unless we have a nonempty display value (either 4585 // inline or about-to-be-restored) 4586 if ( display === "none" ) { 4587 values[ index ] = dataPriv.get( elem, "display" ) || null; 4588 if ( !values[ index ] ) { 4589 elem.style.display = ""; 4590 } 4591 } 4592 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 4593 values[ index ] = getDefaultDisplay( elem ); 4594 } 4595 } else { 4596 if ( display !== "none" ) { 4597 values[ index ] = "none"; 4598 4599 // Remember what we're overwriting 4600 dataPriv.set( elem, "display", display ); 4601 } 4602 } 4603 } 4604 4605 // Set the display of the elements in a second loop to avoid constant reflow 4606 for ( index = 0; index < length; index++ ) { 4607 if ( values[ index ] != null ) { 4608 elements[ index ].style.display = values[ index ]; 4609 } 4610 } 4611 4612 return elements; 4613} 4614 4615jQuery.fn.extend( { 4616 show: function() { 4617 return showHide( this, true ); 4618 }, 4619 hide: function() { 4620 return showHide( this ); 4621 }, 4622 toggle: function( state ) { 4623 if ( typeof state === "boolean" ) { 4624 return state ? this.show() : this.hide(); 4625 } 4626 4627 return this.each( function() { 4628 if ( isHiddenWithinTree( this ) ) { 4629 jQuery( this ).show(); 4630 } else { 4631 jQuery( this ).hide(); 4632 } 4633 } ); 4634 } 4635} ); 4636var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4637 4638var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 4639 4640var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 4641 4642 4643 4644( function() { 4645 var fragment = document.createDocumentFragment(), 4646 div = fragment.appendChild( document.createElement( "div" ) ), 4647 input = document.createElement( "input" ); 4648 4649 // Support: Android 4.0 - 4.3 only
vendor: 10,092 bytes, lines 4650-5034
4650 // Check state lost if the name is set (trac-11217) 4651 // Support: Windows Web Apps (WWA) 4652 // `name` and `type` must use .setAttribute for WWA (trac-14901) 4653 input.setAttribute( "type", "radio" ); 4654 input.setAttribute( "checked", "checked" ); 4655 input.setAttribute( "name", "t" ); 4656 4657 div.appendChild( input ); 4658 4659 // Support: Android <=4.1 only 4660 // Older WebKit doesn't clone checked state correctly in fragments 4661 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4662 4663 // Support: IE <=11 only 4664 // Make sure textarea (and checkbox) defaultValue is properly cloned 4665 div.innerHTML = "<textarea>x</textarea>"; 4666 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4667 4668 // Support: IE <=9 only 4669 // IE <=9 replaces <option> tags with their contents when inserted outside of 4670 // the select element. 4671 div.innerHTML = "<option></option>"; 4672 support.option = !!div.lastChild; 4673} )(); 4674 4675 4676// We have to close these tags to support XHTML (trac-13200) 4677var wrapMap = { 4678 4679 // XHTML parsers do not magically insert elements in the 4680 // same way that tag soup parsers do. So we cannot shorten 4681 // this by omitting <tbody> or other required elements. 4682 thead: [ 1, "<table>", "</table>" ], 4683 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4684 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4685 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4686 4687 _default: [ 0, "", "" ] 4688}; 4689 4690wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4691wrapMap.th = wrapMap.td; 4692 4693// Support: IE <=9 only 4694if ( !support.option ) { 4695 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 4696} 4697 4698 4699function getAll( context, tag ) { 4700 4701 // Support: IE <=9 - 11 only 4702 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 4703 var ret; 4704 4705 if ( typeof context.getElementsByTagName !== "undefined" ) { 4706 ret = context.getElementsByTagName( tag || "*" ); 4707 4708 } else if ( typeof context.querySelectorAll !== "undefined" ) { 4709 ret = context.querySelectorAll( tag || "*" ); 4710 4711 } else { 4712 ret = []; 4713 } 4714 4715 if ( tag === undefined || tag && nodeName( context, tag ) ) { 4716 return jQuery.merge( [ context ], ret ); 4717 } 4718 4719 return ret; 4720} 4721 4722 4723// Mark scripts as having already been evaluated 4724function setGlobalEval( elems, refElements ) { 4725 var i = 0, 4726 l = elems.length; 4727 4728 for ( ; i < l; i++ ) { 4729 dataPriv.set( 4730 elems[ i ], 4731 "globalEval", 4732 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 4733 ); 4734 } 4735} 4736 4737 4738var rhtml = /<|&#?\w+;/; 4739 4740function buildFragment( elems, context, scripts, selection, ignored ) { 4741 var elem, tmp, tag, wrap, attached, j, 4742 fragment = context.createDocumentFragment(), 4743 nodes = [], 4744 i = 0, 4745 l = elems.length; 4746 4747 for ( ; i < l; i++ ) { 4748 elem = elems[ i ]; 4749 4750 if ( elem || elem === 0 ) { 4751 4752 // Add nodes directly 4753 if ( toType( elem ) === "object" ) { 4754 4755 // Support: Android <=4.0 only, PhantomJS 1 only 4756 // push.apply(_, arraylike) throws on ancient WebKit 4757 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4758 4759 // Convert non-html into a text node 4760 } else if ( !rhtml.test( elem ) ) { 4761 nodes.push( context.createTextNode( elem ) ); 4762 4763 // Convert html into DOM nodes 4764 } else { 4765 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 4766 4767 // Deserialize a standard representation 4768 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4769 wrap = wrapMap[ tag ] || wrapMap._default; 4770 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4771 4772 // Descend through wrappers to the right content 4773 j = wrap[ 0 ]; 4774 while ( j-- ) { 4775 tmp = tmp.lastChild; 4776 } 4777 4778 // Support: Android <=4.0 only, PhantomJS 1 only 4779 // push.apply(_, arraylike) throws on ancient WebKit 4780 jQuery.merge( nodes, tmp.childNodes ); 4781 4782 // Remember the top-level container 4783 tmp = fragment.firstChild; 4784 4785 // Ensure the created nodes are orphaned (trac-12392) 4786 tmp.textContent = ""; 4787 } 4788 } 4789 } 4790 4791 // Remove wrapper from fragment 4792 fragment.textContent = ""; 4793 4794 i = 0; 4795 while ( ( elem = nodes[ i++ ] ) ) { 4796 4797 // Skip elements already in the context collection (trac-4087) 4798 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4799 if ( ignored ) { 4800 ignored.push( elem ); 4801 } 4802 continue; 4803 } 4804 4805 attached = isAttached( elem ); 4806 4807 // Append to fragment 4808 tmp = getAll( fragment.appendChild( elem ), "script" ); 4809 4810 // Preserve script evaluation history 4811 if ( attached ) { 4812 setGlobalEval( tmp ); 4813 } 4814 4815 // Capture executables 4816 if ( scripts ) { 4817 j = 0; 4818 while ( ( elem = tmp[ j++ ] ) ) { 4819 if ( rscriptType.test( elem.type || "" ) ) { 4820 scripts.push( elem ); 4821 } 4822 } 4823 } 4824 } 4825 4826 return fragment; 4827} 4828 4829 4830var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4831 4832function returnTrue() { 4833 return true; 4834} 4835 4836function returnFalse() { 4837 return false; 4838} 4839 4840function on( elem, types, selector, data, fn, one ) { 4841 var origFn, type; 4842 4843 // Types can be a map of types/handlers 4844 if ( typeof types === "object" ) { 4845 4846 // ( types-Object, selector, data ) 4847 if ( typeof selector !== "string" ) { 4848 4849 // ( types-Object, data ) 4850 data = data || selector; 4851 selector = undefined; 4852 } 4853 for ( type in types ) { 4854 on( elem, type, selector, data, types[ type ], one ); 4855 } 4856 return elem; 4857 } 4858 4859 if ( data == null && fn == null ) { 4860 4861 // ( types, fn ) 4862 fn = selector; 4863 data = selector = undefined; 4864 } else if ( fn == null ) { 4865 if ( typeof selector === "string" ) { 4866 4867 // ( types, selector, fn ) 4868 fn = data; 4869 data = undefined; 4870 } else { 4871 4872 // ( types, data, fn ) 4873 fn = data; 4874 data = selector; 4875 selector = undefined; 4876 } 4877 } 4878 if ( fn === false ) { 4879 fn = returnFalse; 4880 } else if ( !fn ) { 4881 return elem; 4882 } 4883 4884 if ( one === 1 ) { 4885 origFn = fn; 4886 fn = function( event ) { 4887 4888 // Can use an empty set, since event contains the info 4889 jQuery().off( event ); 4890 return origFn.apply( this, arguments ); 4891 }; 4892 4893 // Use same guid so caller can remove using origFn 4894 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4895 } 4896 return elem.each( function() { 4897 jQuery.event.add( this, types, fn, data, selector ); 4898 } ); 4899} 4900 4901/* 4902 * Helper functions for managing events -- not part of the public interface. 4903 * Props to Dean Edwards' addEvent library for many of the ideas. 4904 */ 4905jQuery.event = { 4906 4907 global: {}, 4908 4909 add: function( elem, types, handler, data, selector ) { 4910 4911 var handleObjIn, eventHandle, tmp, 4912 events, t, handleObj, 4913 special, handlers, type, namespaces, origType, 4914 elemData = dataPriv.get( elem ); 4915 4916 // Only attach events to objects that accept data 4917 if ( !acceptData( elem ) ) { 4918 return; 4919 } 4920 4921 // Caller can pass in an object of custom data in lieu of the handler 4922 if ( handler.handler ) { 4923 handleObjIn = handler; 4924 handler = handleObjIn.handler; 4925 selector = handleObjIn.selector; 4926 } 4927 4928 // Ensure that invalid selectors throw exceptions at attach time 4929 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 4930 if ( selector ) { 4931 jQuery.find.matchesSelector( documentElement, selector ); 4932 } 4933 4934 // Make sure that the handler has a unique ID, used to find/remove it later 4935 if ( !handler.guid ) { 4936 handler.guid = jQuery.guid++; 4937 } 4938 4939 // Init the element's event structure and main handler, if this is the first 4940 if ( !( events = elemData.events ) ) { 4941 events = elemData.events = Object.create( null ); 4942 } 4943 if ( !( eventHandle = elemData.handle ) ) { 4944 eventHandle = elemData.handle = function( e ) { 4945 4946 // Discard the second event of a jQuery.event.trigger() and 4947 // when an event is called after a page has unloaded 4948 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 4949 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 4950 }; 4951 } 4952 4953 // Handle multiple events separated by a space 4954 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 4955 t = types.length; 4956 while ( t-- ) { 4957 tmp = rtypenamespace.exec( types[ t ] ) || []; 4958 type = origType = tmp[ 1 ]; 4959 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4960 4961 // There *must* be a type, no attaching namespace-only handlers 4962 if ( !type ) { 4963 continue; 4964 } 4965 4966 // If event changes its type, use the special event handlers for the changed type 4967 special = jQuery.event.special[ type ] || {}; 4968 4969 // If selector defined, determine special event api type, otherwise given type 4970 type = ( selector ? special.delegateType : special.bindType ) || type; 4971 4972 // Update special based on newly reset type 4973 special = jQuery.event.special[ type ] || {}; 4974 4975 // handleObj is passed to all event handlers 4976 handleObj = jQuery.extend( { 4977 type: type, 4978 origType: origType, 4979 data: data, 4980 handler: handler, 4981 guid: handler.guid, 4982 selector: selector, 4983 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4984 namespace: namespaces.join( "." ) 4985 }, handleObjIn ); 4986 4987 // Init the event handler queue if we're the first 4988 if ( !( handlers = events[ type ] ) ) { 4989 handlers = events[ type ] = []; 4990 handlers.delegateCount = 0; 4991 4992 // Only use addEventListener if the special events handler returns false 4993 if ( !special.setup || 4994 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4995 4996 if ( elem.addEventListener ) { 4997 elem.addEventListener( type, eventHandle ); 4998 } 4999 } 5000 } 5001 5002 if ( special.add ) { 5003 special.add.call( elem, handleObj ); 5004 5005 if ( !handleObj.handler.guid ) { 5006 handleObj.handler.guid = handler.guid; 5007 } 5008 } 5009 5010 // Add to the element's handler list, delegates in front 5011 if ( selector ) { 5012 handlers.splice( handlers.delegateCount++, 0, handleObj ); 5013 } else { 5014 handlers.push( handleObj ); 5015 } 5016 5017 // Keep track of which events have ever been used, for event optimization 5018 jQuery.event.global[ type ] = true; 5019 } 5020 5021 }, 5022 5023 // Detach an event or set of events from an element 5024 remove: function( elem, types, handler, selector, mappedTypes ) { 5025 5026 var j, origCount, tmp, 5027 events, t, handleObj, 5028 special, handlers, type, namespaces, origType, 5029 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 5030 5031 if ( !elemData || !( events = elemData.events ) ) { 5032 return; 5033 } 5034
vendor: 4,197 bytes, lines 5035-5173
5035 // Once for each type.namespace in types; type may be omitted 5036 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 5037 t = types.length; 5038 while ( t-- ) { 5039 tmp = rtypenamespace.exec( types[ t ] ) || []; 5040 type = origType = tmp[ 1 ]; 5041 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 5042 5043 // Unbind all events (on this namespace, if provided) for the element 5044 if ( !type ) { 5045 for ( type in events ) { 5046 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 5047 } 5048 continue; 5049 } 5050 5051 special = jQuery.event.special[ type ] || {}; 5052 type = ( selector ? special.delegateType : special.bindType ) || type; 5053 handlers = events[ type ] || []; 5054 tmp = tmp[ 2 ] && 5055 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 5056 5057 // Remove matching events 5058 origCount = j = handlers.length; 5059 while ( j-- ) { 5060 handleObj = handlers[ j ]; 5061 5062 if ( ( mappedTypes || origType === handleObj.origType ) && 5063 ( !handler || handler.guid === handleObj.guid ) && 5064 ( !tmp || tmp.test( handleObj.namespace ) ) && 5065 ( !selector || selector === handleObj.selector || 5066 selector === "**" && handleObj.selector ) ) { 5067 handlers.splice( j, 1 ); 5068 5069 if ( handleObj.selector ) { 5070 handlers.delegateCount--; 5071 } 5072 if ( special.remove ) { 5073 special.remove.call( elem, handleObj ); 5074 } 5075 } 5076 } 5077 5078 // Remove generic event handler if we removed something and no more handlers exist 5079 // (avoids potential for endless recursion during removal of special event handlers) 5080 if ( origCount && !handlers.length ) { 5081 if ( !special.teardown || 5082 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5083 5084 jQuery.removeEvent( elem, type, elemData.handle ); 5085 } 5086 5087 delete events[ type ]; 5088 } 5089 } 5090 5091 // Remove data and the expando if it's no longer used 5092 if ( jQuery.isEmptyObject( events ) ) { 5093 dataPriv.remove( elem, "handle events" ); 5094 } 5095 }, 5096 5097 dispatch: function( nativeEvent ) { 5098 5099 var i, j, ret, matched, handleObj, handlerQueue, 5100 args = new Array( arguments.length ), 5101 5102 // Make a writable jQuery.Event from the native event object 5103 event = jQuery.event.fix( nativeEvent ), 5104 5105 handlers = ( 5106 dataPriv.get( this, "events" ) || Object.create( null ) 5107 )[ event.type ] || [], 5108 special = jQuery.event.special[ event.type ] || {}; 5109 5110 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5111 args[ 0 ] = event; 5112 5113 for ( i = 1; i < arguments.length; i++ ) { 5114 args[ i ] = arguments[ i ]; 5115 } 5116 5117 event.delegateTarget = this; 5118 5119 // Call the preDispatch hook for the mapped type, and let it bail if desired 5120 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 5121 return; 5122 } 5123 5124 // Determine handlers 5125 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 5126 5127 // Run delegates first; they may want to stop propagation beneath us 5128 i = 0; 5129 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 5130 event.currentTarget = matched.elem; 5131 5132 j = 0; 5133 while ( ( handleObj = matched.handlers[ j++ ] ) && 5134 !event.isImmediatePropagationStopped() ) { 5135 5136 // If the event is namespaced, then each handler is only invoked if it is 5137 // specially universal or its namespaces are a superset of the event's. 5138 if ( !event.rnamespace || handleObj.namespace === false || 5139 event.rnamespace.test( handleObj.namespace ) ) { 5140 5141 event.handleObj = handleObj; 5142 event.data = handleObj.data; 5143 5144 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 5145 handleObj.handler ).apply( matched.elem, args ); 5146 5147 if ( ret !== undefined ) { 5148 if ( ( event.result = ret ) === false ) { 5149 event.preventDefault(); 5150 event.stopPropagation(); 5151 } 5152 } 5153 } 5154 } 5155 } 5156 5157 // Call the postDispatch hook for the mapped type 5158 if ( special.postDispatch ) { 5159 special.postDispatch.call( this, event ); 5160 } 5161 5162 return event.result; 5163 }, 5164 5165 handlers: function( event, handlers ) { 5166 var i, handleObj, sel, matchedHandlers, matchedSelectors, 5167 handlerQueue = [], 5168 delegateCount = handlers.delegateCount, 5169 cur = event.target; 5170 5171 // Find delegate handlers 5172 if ( delegateCount && 5173
vendor: 19,034 bytes, lines 5174-5820
5174 // Support: IE <=9 5175 // Black-hole SVG <use> instance trees (trac-13180) 5176 cur.nodeType && 5177 5178 // Support: Firefox <=42 5179 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 5180 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 5181 // Support: IE 11 only 5182 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 5183 !( event.type === "click" && event.button >= 1 ) ) { 5184 5185 for ( ; cur !== this; cur = cur.parentNode || this ) { 5186 5187 // Don't check non-elements (trac-13208) 5188 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 5189 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 5190 matchedHandlers = []; 5191 matchedSelectors = {}; 5192 for ( i = 0; i < delegateCount; i++ ) { 5193 handleObj = handlers[ i ]; 5194 5195 // Don't conflict with Object.prototype properties (trac-13203) 5196 sel = handleObj.selector + " "; 5197 5198 if ( matchedSelectors[ sel ] === undefined ) { 5199 matchedSelectors[ sel ] = handleObj.needsContext ? 5200 jQuery( sel, this ).index( cur ) > -1 : 5201 jQuery.find( sel, this, null, [ cur ] ).length; 5202 } 5203 if ( matchedSelectors[ sel ] ) { 5204 matchedHandlers.push( handleObj ); 5205 } 5206 } 5207 if ( matchedHandlers.length ) { 5208 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 5209 } 5210 } 5211 } 5212 } 5213 5214 // Add the remaining (directly-bound) handlers 5215 cur = this; 5216 if ( delegateCount < handlers.length ) { 5217 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 5218 } 5219 5220 return handlerQueue; 5221 }, 5222 5223 addProp: function( name, hook ) { 5224 Object.defineProperty( jQuery.Event.prototype, name, { 5225 enumerable: true, 5226 configurable: true, 5227 5228 get: isFunction( hook ) ? 5229 function() { 5230 if ( this.originalEvent ) { 5231 return hook( this.originalEvent ); 5232 } 5233 } : 5234 function() { 5235 if ( this.originalEvent ) { 5236 return this.originalEvent[ name ]; 5237 } 5238 }, 5239 5240 set: function( value ) { 5241 Object.defineProperty( this, name, { 5242 enumerable: true, 5243 configurable: true, 5244 writable: true, 5245 value: value 5246 } ); 5247 } 5248 } ); 5249 }, 5250 5251 fix: function( originalEvent ) { 5252 return originalEvent[ jQuery.expando ] ? 5253 originalEvent : 5254 new jQuery.Event( originalEvent ); 5255 }, 5256 5257 special: { 5258 load: { 5259 5260 // Prevent triggered image.load events from bubbling to window.load 5261 noBubble: true 5262 }, 5263 click: { 5264 5265 // Utilize native event to ensure correct state for checkable inputs 5266 setup: function( data ) { 5267 5268 // For mutual compressibility with _default, replace `this` access with a local var. 5269 // `|| data` is dead code meant only to preserve the variable through minification. 5270 var el = this || data; 5271 5272 // Claim the first handler 5273 if ( rcheckableType.test( el.type ) && 5274 el.click && nodeName( el, "input" ) ) { 5275 5276 // dataPriv.set( el, "click", ... ) 5277 leverageNative( el, "click", true ); 5278 } 5279 5280 // Return false to allow normal processing in the caller 5281 return false; 5282 }, 5283 trigger: function( data ) { 5284 5285 // For mutual compressibility with _default, replace `this` access with a local var. 5286 // `|| data` is dead code meant only to preserve the variable through minification. 5287 var el = this || data; 5288 5289 // Force setup before triggering a click 5290 if ( rcheckableType.test( el.type ) && 5291 el.click && nodeName( el, "input" ) ) { 5292 5293 leverageNative( el, "click" ); 5294 } 5295 5296 // Return non-false to allow normal event-path propagation 5297 return true; 5298 }, 5299 5300 // For cross-browser consistency, suppress native .click() on links 5301 // Also prevent it if we're currently inside a leveraged native-event stack 5302 _default: function( event ) { 5303 var target = event.target; 5304 return rcheckableType.test( target.type ) && 5305 target.click && nodeName( target, "input" ) && 5306 dataPriv.get( target, "click" ) || 5307 nodeName( target, "a" ); 5308 } 5309 }, 5310 5311 beforeunload: { 5312 postDispatch: function( event ) { 5313 5314 // Support: Firefox 20+ 5315 // Firefox doesn't alert if the returnValue field is not set. 5316 if ( event.result !== undefined && event.originalEvent ) { 5317 event.originalEvent.returnValue = event.result; 5318 } 5319 } 5320 } 5321 } 5322}; 5323 5324// Ensure the presence of an event listener that handles manually-triggered 5325// synthetic events by interrupting progress until reinvoked in response to 5326// *native* events that it fires directly, ensuring that state changes have 5327// already occurred before other listeners are invoked. 5328function leverageNative( el, type, isSetup ) { 5329 5330 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 5331 if ( !isSetup ) { 5332 if ( dataPriv.get( el, type ) === undefined ) { 5333 jQuery.event.add( el, type, returnTrue ); 5334 } 5335 return; 5336 } 5337 5338 // Register the controller as a special universal handler for all event namespaces 5339 dataPriv.set( el, type, false ); 5340 jQuery.event.add( el, type, { 5341 namespace: false, 5342 handler: function( event ) { 5343 var result, 5344 saved = dataPriv.get( this, type ); 5345 5346 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 5347 5348 // Interrupt processing of the outer synthetic .trigger()ed event 5349 if ( !saved ) { 5350 5351 // Store arguments for use when handling the inner native event 5352 // There will always be at least one argument (an event object), so this array 5353 // will not be confused with a leftover capture object. 5354 saved = slice.call( arguments ); 5355 dataPriv.set( this, type, saved ); 5356 5357 // Trigger the native event and capture its result 5358 this[ type ](); 5359 result = dataPriv.get( this, type ); 5360 dataPriv.set( this, type, false ); 5361 5362 if ( saved !== result ) { 5363 5364 // Cancel the outer synthetic event 5365 event.stopImmediatePropagation(); 5366 event.preventDefault(); 5367 5368 return result; 5369 } 5370 5371 // If this is an inner synthetic event for an event with a bubbling surrogate 5372 // (focus or blur), assume that the surrogate already propagated from triggering 5373 // the native event and prevent that from happening again here. 5374 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 5375 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 5376 // less bad than duplication. 5377 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 5378 event.stopPropagation(); 5379 } 5380 5381 // If this is a native event triggered above, everything is now in order 5382 // Fire an inner synthetic event with the original arguments 5383 } else if ( saved ) { 5384 5385 // ...and capture the result 5386 dataPriv.set( this, type, jQuery.event.trigger( 5387 saved[ 0 ], 5388 saved.slice( 1 ), 5389 this 5390 ) ); 5391 5392 // Abort handling of the native event by all jQuery handlers while allowing 5393 // native handlers on the same element to run. On target, this is achieved 5394 // by stopping immediate propagation just on the jQuery event. However, 5395 // the native event is re-wrapped by a jQuery one on each level of the 5396 // propagation so the only way to stop it for jQuery is to stop it for 5397 // everyone via native `stopPropagation()`. This is not a problem for 5398 // focus/blur which don't bubble, but it does also stop click on checkboxes 5399 // and radios. We accept this limitation. 5400 event.stopPropagation(); 5401 event.isImmediatePropagationStopped = returnTrue; 5402 } 5403 } 5404 } ); 5405} 5406 5407jQuery.removeEvent = function( elem, type, handle ) { 5408 5409 // This "if" is needed for plain objects 5410 if ( elem.removeEventListener ) { 5411 elem.removeEventListener( type, handle ); 5412 } 5413}; 5414 5415jQuery.Event = function( src, props ) { 5416 5417 // Allow instantiation without the 'new' keyword 5418 if ( !( this instanceof jQuery.Event ) ) { 5419 return new jQuery.Event( src, props ); 5420 } 5421 5422 // Event object 5423 if ( src && src.type ) { 5424 this.originalEvent = src; 5425 this.type = src.type; 5426 5427 // Events bubbling up the document may have been marked as prevented 5428 // by a handler lower down the tree; reflect the correct value. 5429 this.isDefaultPrevented = src.defaultPrevented || 5430 src.defaultPrevented === undefined && 5431 5432 // Support: Android <=2.3 only 5433 src.returnValue === false ? 5434 returnTrue : 5435 returnFalse; 5436 5437 // Create target properties 5438 // Support: Safari <=6 - 7 only 5439 // Target should not be a text node (trac-504, trac-13143) 5440 this.target = ( src.target && src.target.nodeType === 3 ) ? 5441 src.target.parentNode : 5442 src.target; 5443 5444 this.currentTarget = src.currentTarget; 5445 this.relatedTarget = src.relatedTarget; 5446 5447 // Event type 5448 } else { 5449 this.type = src; 5450 } 5451 5452 // Put explicitly provided properties onto the event object 5453 if ( props ) { 5454 jQuery.extend( this, props ); 5455 } 5456 5457 // Create a timestamp if incoming event doesn't have one 5458 this.timeStamp = src && src.timeStamp || Date.now(); 5459 5460 // Mark it as fixed 5461 this[ jQuery.expando ] = true; 5462}; 5463 5464// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5465// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5466jQuery.Event.prototype = { 5467 constructor: jQuery.Event, 5468 isDefaultPrevented: returnFalse, 5469 isPropagationStopped: returnFalse, 5470 isImmediatePropagationStopped: returnFalse, 5471 isSimulated: false, 5472 5473 preventDefault: function() { 5474 var e = this.originalEvent; 5475 5476 this.isDefaultPrevented = returnTrue; 5477 5478 if ( e && !this.isSimulated ) { 5479 e.preventDefault(); 5480 } 5481 }, 5482 stopPropagation: function() { 5483 var e = this.originalEvent; 5484 5485 this.isPropagationStopped = returnTrue; 5486 5487 if ( e && !this.isSimulated ) { 5488 e.stopPropagation(); 5489 } 5490 }, 5491 stopImmediatePropagation: function() { 5492 var e = this.originalEvent; 5493 5494 this.isImmediatePropagationStopped = returnTrue; 5495 5496 if ( e && !this.isSimulated ) { 5497 e.stopImmediatePropagation(); 5498 } 5499 5500 this.stopPropagation(); 5501 } 5502}; 5503 5504// Includes all common event props including KeyEvent and MouseEvent specific props 5505jQuery.each( { 5506 altKey: true, 5507 bubbles: true, 5508 cancelable: true, 5509 changedTouches: true, 5510 ctrlKey: true, 5511 detail: true, 5512 eventPhase: true, 5513 metaKey: true, 5514 pageX: true, 5515 pageY: true, 5516 shiftKey: true, 5517 view: true, 5518 "char": true, 5519 code: true, 5520 charCode: true, 5521 key: true, 5522 keyCode: true, 5523 button: true, 5524 buttons: true, 5525 clientX: true, 5526 clientY: true, 5527 offsetX: true, 5528 offsetY: true, 5529 pointerId: true, 5530 pointerType: true, 5531 screenX: true, 5532 screenY: true, 5533 targetTouches: true, 5534 toElement: true, 5535 touches: true, 5536 which: true 5537}, jQuery.event.addProp ); 5538 5539jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 5540 5541 function focusMappedHandler( nativeEvent ) { 5542 if ( document.documentMode ) { 5543 5544 // Support: IE 11+ 5545 // Attach a single focusin/focusout handler on the document while someone wants 5546 // focus/blur. This is because the former are synchronous in IE while the latter 5547 // are async. In other browsers, all those handlers are invoked synchronously. 5548 5549 // `handle` from private data would already wrap the event, but we need 5550 // to change the `type` here. 5551 var handle = dataPriv.get( this, "handle" ), 5552 event = jQuery.event.fix( nativeEvent ); 5553 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 5554 event.isSimulated = true; 5555 5556 // First, handle focusin/focusout 5557 handle( nativeEvent ); 5558 5559 // ...then, handle focus/blur 5560 // 5561 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 5562 // invoking the handler at the lower level. 5563 if ( event.target === event.currentTarget ) { 5564 5565 // The setup part calls `leverageNative`, which, in turn, calls 5566 // `jQuery.event.add`, so event handle will already have been set 5567 // by this point. 5568 handle( event ); 5569 } 5570 } else { 5571 5572 // For non-IE browsers, attach a single capturing handler on the document 5573 // while someone wants focusin/focusout. 5574 jQuery.event.simulate( delegateType, nativeEvent.target, 5575 jQuery.event.fix( nativeEvent ) ); 5576 } 5577 } 5578 5579 jQuery.event.special[ type ] = { 5580 5581 // Utilize native event if possible so blur/focus sequence is correct 5582 setup: function() { 5583 5584 var attaches; 5585 5586 // Claim the first handler 5587 // dataPriv.set( this, "focus", ... ) 5588 // dataPriv.set( this, "blur", ... ) 5589 leverageNative( this, type, true ); 5590 5591 if ( document.documentMode ) { 5592 5593 // Support: IE 9 - 11+ 5594 // We use the same native handler for focusin & focus (and focusout & blur) 5595 // so we need to coordinate setup & teardown parts between those events. 5596 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 5597 attaches = dataPriv.get( this, delegateType ); 5598 if ( !attaches ) { 5599 this.addEventListener( delegateType, focusMappedHandler ); 5600 } 5601 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 5602 } else { 5603 5604 // Return false to allow normal processing in the caller 5605 return false; 5606 } 5607 }, 5608 trigger: function() { 5609 5610 // Force setup before trigger 5611 leverageNative( this, type ); 5612 5613 // Return non-false to allow normal event-path propagation 5614 return true; 5615 }, 5616 5617 teardown: function() { 5618 var attaches; 5619 5620 if ( document.documentMode ) { 5621 attaches = dataPriv.get( this, delegateType ) - 1; 5622 if ( !attaches ) { 5623 this.removeEventListener( delegateType, focusMappedHandler ); 5624 dataPriv.remove( this, delegateType ); 5625 } else { 5626 dataPriv.set( this, delegateType, attaches ); 5627 } 5628 } else { 5629 5630 // Return false to indicate standard teardown should be applied 5631 return false; 5632 } 5633 }, 5634 5635 // Suppress native focus or blur if we're currently inside 5636 // a leveraged native-event stack 5637 _default: function( event ) { 5638 return dataPriv.get( event.target, type ); 5639 }, 5640 5641 delegateType: delegateType 5642 }; 5643 5644 // Support: Firefox <=44 5645 // Firefox doesn't have focus(in | out) events 5646 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 5647 // 5648 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 5649 // focus(in | out) events fire after focus & blur events, 5650 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 5651 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 5652 // 5653 // Support: IE 9 - 11+ 5654 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 5655 // attach a single handler for both events in IE. 5656 jQuery.event.special[ delegateType ] = { 5657 setup: function() { 5658 5659 // Handle: regular nodes (via `this.ownerDocument`), window 5660 // (via `this.document`) & document (via `this`). 5661 var doc = this.ownerDocument || this.document || this, 5662 dataHolder = document.documentMode ? this : doc, 5663 attaches = dataPriv.get( dataHolder, delegateType ); 5664 5665 // Support: IE 9 - 11+ 5666 // We use the same native handler for focusin & focus (and focusout & blur) 5667 // so we need to coordinate setup & teardown parts between those events. 5668 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 5669 if ( !attaches ) { 5670 if ( document.documentMode ) { 5671 this.addEventListener( delegateType, focusMappedHandler ); 5672 } else { 5673 doc.addEventListener( type, focusMappedHandler, true ); 5674 } 5675 } 5676 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 5677 }, 5678 teardown: function() { 5679 var doc = this.ownerDocument || this.document || this, 5680 dataHolder = document.documentMode ? this : doc, 5681 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 5682 5683 if ( !attaches ) { 5684 if ( document.documentMode ) { 5685 this.removeEventListener( delegateType, focusMappedHandler ); 5686 } else { 5687 doc.removeEventListener( type, focusMappedHandler, true ); 5688 } 5689 dataPriv.remove( dataHolder, delegateType ); 5690 } else { 5691 dataPriv.set( dataHolder, delegateType, attaches ); 5692 } 5693 } 5694 }; 5695} ); 5696 5697// Create mouseenter/leave events using mouseover/out and event-time checks 5698// so that event delegation works in jQuery. 5699// Do the same for pointerenter/pointerleave and pointerover/pointerout 5700// 5701// Support: Safari 7 only 5702// Safari sends mouseenter too often; see: 5703// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 5704// for the description of the bug (it existed in older Chrome versions as well). 5705jQuery.each( { 5706 mouseenter: "mouseover", 5707 mouseleave: "mouseout", 5708 pointerenter: "pointerover", 5709 pointerleave: "pointerout" 5710}, function( orig, fix ) { 5711 jQuery.event.special[ orig ] = { 5712 delegateType: fix, 5713 bindType: fix, 5714 5715 handle: function( event ) { 5716 var ret, 5717 target = this, 5718 related = event.relatedTarget, 5719 handleObj = event.handleObj; 5720 5721 // For mouseenter/leave call the handler if related is outside the target. 5722 // NB: No relatedTarget if the mouse left/entered the browser window 5723 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5724 event.type = handleObj.origType; 5725 ret = handleObj.handler.apply( this, arguments ); 5726 event.type = fix; 5727 } 5728 return ret; 5729 } 5730 }; 5731} ); 5732 5733jQuery.fn.extend( { 5734 5735 on: function( types, selector, data, fn ) { 5736 return on( this, types, selector, data, fn ); 5737 }, 5738 one: function( types, selector, data, fn ) { 5739 return on( this, types, selector, data, fn, 1 ); 5740 }, 5741 off: function( types, selector, fn ) { 5742 var handleObj, type; 5743 if ( types && types.preventDefault && types.handleObj ) { 5744 5745 // ( event ) dispatched jQuery.Event 5746 handleObj = types.handleObj; 5747 jQuery( types.delegateTarget ).off( 5748 handleObj.namespace ? 5749 handleObj.origType + "." + handleObj.namespace : 5750 handleObj.origType, 5751 handleObj.selector, 5752 handleObj.handler 5753 ); 5754 return this; 5755 } 5756 if ( typeof types === "object" ) { 5757 5758 // ( types-object [, selector] ) 5759 for ( type in types ) { 5760 this.off( type, selector, types[ type ] ); 5761 } 5762 return this; 5763 } 5764 if ( selector === false || typeof selector === "function" ) { 5765 5766 // ( types [, fn] ) 5767 fn = selector; 5768 selector = undefined; 5769 } 5770 if ( fn === false ) { 5771 fn = returnFalse; 5772 } 5773 return this.each( function() { 5774 jQuery.event.remove( this, types, fn, selector ); 5775 } ); 5776 } 5777} ); 5778 5779 5780var 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 5790 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 5791 5792// Prefer a tbody over its parent table for containing new rows 5793function manipulationTarget( elem, content ) { 5794 if ( nodeName( elem, "table" ) && 5795 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 5796 5797 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 5798 } 5799 5800 return elem; 5801} 5802 5803// Replace/restore the type attribute of script elements for safe DOM manipulation 5804function disableScript( elem ) { 5805 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 5806 return elem; 5807} 5808function restoreScript( elem ) { 5809 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 5810 elem.type = elem.type.slice( 5 ); 5811 } else { 5812 elem.removeAttribute( "type" ); 5813 } 5814 5815 return elem; 5816} 5817 5818function cloneCopyEvent( src, dest ) { 5819 var i, l, type, pdataOld, udataOld, udataCur, events; 5820
vendor: 6,382 bytes, lines 5821-6050
5821 if ( dest.nodeType !== 1 ) { 5822 return; 5823 } 5824 5825 // 1. Copy private data: events, handlers, etc. 5826 if ( dataPriv.hasData( src ) ) { 5827 pdataOld = dataPriv.get( src ); 5828 events = pdataOld.events; 5829 5830 if ( events ) { 5831 dataPriv.remove( dest, "handle events" ); 5832 5833 for ( type in events ) { 5834 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5835 jQuery.event.add( dest, type, events[ type ][ i ] ); 5836 } 5837 } 5838 } 5839 } 5840 5841 // 2. Copy user data 5842 if ( dataUser.hasData( src ) ) { 5843 udataOld = dataUser.access( src ); 5844 udataCur = jQuery.extend( {}, udataOld ); 5845 5846 dataUser.set( dest, udataCur ); 5847 } 5848} 5849 5850// Fix IE bugs, see support tests 5851function fixInput( src, dest ) { 5852 var nodeName = dest.nodeName.toLowerCase(); 5853 5854 // Fails to persist the checked state of a cloned checkbox or radio button. 5855 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5856 dest.checked = src.checked; 5857 5858 // Fails to return the selected option to the default selected state when cloning options 5859 } else if ( nodeName === "input" || nodeName === "textarea" ) { 5860 dest.defaultValue = src.defaultValue; 5861 } 5862} 5863 5864function domManip( collection, args, callback, ignored ) { 5865 5866 // Flatten any nested arrays 5867 args = flat( args ); 5868 5869 var fragment, first, scripts, hasScripts, node, doc, 5870 i = 0, 5871 l = collection.length, 5872 iNoClone = l - 1, 5873 value = args[ 0 ], 5874 valueIsFunction = isFunction( value ); 5875 5876 // We can't cloneNode fragments that contain checked, in WebKit 5877 if ( valueIsFunction || 5878 ( l > 1 && typeof value === "string" && 5879 !support.checkClone && rchecked.test( value ) ) ) { 5880 return collection.each( function( index ) { 5881 var self = collection.eq( index ); 5882 if ( valueIsFunction ) { 5883 args[ 0 ] = value.call( this, index, self.html() ); 5884 } 5885 domManip( self, args, callback, ignored ); 5886 } ); 5887 } 5888 5889 if ( l ) { 5890 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 5891 first = fragment.firstChild; 5892 5893 if ( fragment.childNodes.length === 1 ) { 5894 fragment = first; 5895 } 5896 5897 // Require either new content or an interest in ignored elements to invoke the callback 5898 if ( first || ignored ) { 5899 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 5900 hasScripts = scripts.length; 5901 5902 // Use the original fragment for the last item 5903 // instead of the first because it can end up 5904 // being emptied incorrectly in certain situations (trac-8070). 5905 for ( ; i < l; i++ ) { 5906 node = fragment; 5907 5908 if ( i !== iNoClone ) { 5909 node = jQuery.clone( node, true, true ); 5910 5911 // Keep references to cloned scripts for later restoration 5912 if ( hasScripts ) { 5913 5914 // Support: Android <=4.0 only, PhantomJS 1 only 5915 // push.apply(_, arraylike) throws on ancient WebKit 5916 jQuery.merge( scripts, getAll( node, "script" ) ); 5917 } 5918 } 5919 5920 callback.call( collection[ i ], node, i ); 5921 } 5922 5923 if ( hasScripts ) { 5924 doc = scripts[ scripts.length - 1 ].ownerDocument; 5925 5926 // Re-enable scripts 5927 jQuery.map( scripts, restoreScript ); 5928 5929 // Evaluate executable scripts on first document insertion 5930 for ( i = 0; i < hasScripts; i++ ) { 5931 node = scripts[ i ]; 5932 if ( rscriptType.test( node.type || "" ) && 5933 !dataPriv.access( node, "globalEval" ) && 5934 jQuery.contains( doc, node ) ) { 5935 5936 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 5937 5938 // Optional AJAX dependency, but won't run scripts if not present 5939 if ( jQuery._evalUrl && !node.noModule ) { 5940 jQuery._evalUrl( node.src, { 5941 nonce: node.nonce || node.getAttribute( "nonce" ) 5942 }, doc ); 5943 } 5944 } else { 5945 5946 // Unwrap a CDATA section containing script contents. This shouldn't be 5947 // needed as in XML documents they're already not visible when 5948 // inspecting element contents and in HTML documents they have no 5949 // meaning but we're preserving that logic for backwards compatibility. 5950 // This will be removed completely in 4.0. See gh-4904. 5951 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 5952 } 5953 } 5954 } 5955 } 5956 } 5957 } 5958 5959 return collection; 5960} 5961 5962function remove( elem, selector, keepData ) { 5963 var node, 5964 nodes = selector ? jQuery.filter( selector, elem ) : elem, 5965 i = 0; 5966 5967 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 5968 if ( !keepData && node.nodeType === 1 ) { 5969 jQuery.cleanData( getAll( node ) ); 5970 } 5971 5972 if ( node.parentNode ) { 5973 if ( keepData && isAttached( node ) ) { 5974 setGlobalEval( getAll( node, "script" ) ); 5975 } 5976 node.parentNode.removeChild( node ); 5977 } 5978 } 5979 5980 return elem; 5981} 5982 5983jQuery.extend( { 5984 htmlPrefilter: function( html ) { 5985 return html; 5986 }, 5987 5988 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 5989 var i, l, srcElements, destElements, 5990 clone = elem.cloneNode( true ), 5991 inPage = isAttached( elem ); 5992 5993 // Fix IE cloning issues 5994 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 5995 !jQuery.isXMLDoc( elem ) ) { 5996 5997 // We eschew jQuery#find here for performance reasons: 5998 // https://jsperf.com/getall-vs-sizzle/2 5999 destElements = getAll( clone ); 6000 srcElements = getAll( elem ); 6001 6002 for ( i = 0, l = srcElements.length; i < l; i++ ) { 6003 fixInput( srcElements[ i ], destElements[ i ] ); 6004 } 6005 } 6006 6007 // Copy the events from the original to the clone 6008 if ( dataAndEvents ) { 6009 if ( deepDataAndEvents ) { 6010 srcElements = srcElements || getAll( elem ); 6011 destElements = destElements || getAll( clone ); 6012 6013 for ( i = 0, l = srcElements.length; i < l; i++ ) { 6014 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 6015 } 6016 } else { 6017 cloneCopyEvent( elem, clone ); 6018 } 6019 } 6020 6021 // Preserve script evaluation history 6022 destElements = getAll( clone, "script" ); 6023 if ( destElements.length > 0 ) { 6024 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 6025 } 6026 6027 // Return the cloned set 6028 return clone; 6029 }, 6030 6031 cleanData: function( elems ) { 6032 var data, elem, type, 6033 special = jQuery.event.special, 6034 i = 0; 6035 6036 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 6037 if ( acceptData( elem ) ) { 6038 if ( ( data = elem[ dataPriv.expando ] ) ) { 6039 if ( data.events ) { 6040 for ( type in data.events ) { 6041 if ( special[ type ] ) { 6042 jQuery.event.remove( elem, type ); 6043 6044 // This is a shortcut to avoid jQuery.event.remove's overhead 6045 } else { 6046 jQuery.removeEvent( elem, type, data.handle ); 6047 } 6048 } 6049 } 6050
vendor: 1,119 bytes, lines 6051-6095
6051 // Support: Chrome <=35 - 45+ 6052 // Assign undefined instead of using delete, see Data#remove 6053 elem[ dataPriv.expando ] = undefined; 6054 } 6055 if ( elem[ dataUser.expando ] ) { 6056 6057 // Support: Chrome <=35 - 45+ 6058 // Assign undefined instead of using delete, see Data#remove 6059 elem[ dataUser.expando ] = undefined; 6060 } 6061 } 6062 } 6063 } 6064} ); 6065 6066jQuery.fn.extend( { 6067 detach: function( selector ) { 6068 return remove( this, selector, true ); 6069 }, 6070 6071 remove: function( selector ) { 6072 return remove( this, selector ); 6073 }, 6074 6075 text: function( value ) { 6076 return access( this, function( value ) { 6077 return value === undefined ? 6078 jQuery.text( this ) : 6079 this.empty().each( function() { 6080 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6081 this.textContent = value; 6082 } 6083 } ); 6084 }, null, value, arguments.length ); 6085 }, 6086 6087 append: function() { 6088 return domManip( this, arguments, function( elem ) { 6089 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6090 var target = manipulationTarget( this, elem ); 6091 target.appendChild( elem ); 6092 } 6093 } ); 6094 }, 6095
vendor: 4,514 bytes, lines 6096-6287
6096 prepend: function() { 6097 return domManip( this, arguments, function( elem ) { 6098 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6099 var target = manipulationTarget( this, elem ); 6100 target.insertBefore( elem, target.firstChild ); 6101 } 6102 } ); 6103 }, 6104 6105 before: function() { 6106 return domManip( this, arguments, function( elem ) { 6107 if ( this.parentNode ) { 6108 this.parentNode.insertBefore( elem, this ); 6109 } 6110 } ); 6111 }, 6112 6113 after: function() { 6114 return domManip( this, arguments, function( elem ) { 6115 if ( this.parentNode ) { 6116 this.parentNode.insertBefore( elem, this.nextSibling ); 6117 } 6118 } ); 6119 }, 6120 6121 empty: function() { 6122 var elem, 6123 i = 0; 6124 6125 for ( ; ( elem = this[ i ] ) != null; i++ ) { 6126 if ( elem.nodeType === 1 ) { 6127 6128 // Prevent memory leaks 6129 jQuery.cleanData( getAll( elem, false ) ); 6130 6131 // Remove any remaining nodes 6132 elem.textContent = ""; 6133 } 6134 } 6135 6136 return this; 6137 }, 6138 6139 clone: function( dataAndEvents, deepDataAndEvents ) { 6140 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6141 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6142 6143 return this.map( function() { 6144 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 6145 } ); 6146 }, 6147 6148 html: function( value ) { 6149 return access( this, function( value ) { 6150 var elem = this[ 0 ] || {}, 6151 i = 0, 6152 l = this.length; 6153 6154 if ( value === undefined && elem.nodeType === 1 ) { 6155 return elem.innerHTML; 6156 } 6157 6158 // See if we can take a shortcut and just use innerHTML 6159 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 6160 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 6161 6162 value = jQuery.htmlPrefilter( value ); 6163 6164 try { 6165 for ( ; i < l; i++ ) { 6166 elem = this[ i ] || {}; 6167 6168 // Remove element nodes and prevent memory leaks 6169 if ( elem.nodeType === 1 ) { 6170 jQuery.cleanData( getAll( elem, false ) ); 6171 elem.innerHTML = value; 6172 } 6173 } 6174 6175 elem = 0; 6176 6177 // If using innerHTML throws an exception, use the fallback method 6178 } catch ( e ) {} 6179 } 6180 6181 if ( elem ) { 6182 this.empty().append( value ); 6183 } 6184 }, null, value, arguments.length ); 6185 }, 6186 6187 replaceWith: function() { 6188 var ignored = []; 6189 6190 // Make the changes, replacing each non-ignored context element with the new content 6191 return domManip( this, arguments, function( elem ) { 6192 var parent = this.parentNode; 6193 6194 if ( jQuery.inArray( this, ignored ) < 0 ) { 6195 jQuery.cleanData( getAll( this ) ); 6196 if ( parent ) { 6197 parent.replaceChild( elem, this ); 6198 } 6199 } 6200 6201 // Force callback invocation 6202 }, ignored ); 6203 } 6204} ); 6205 6206jQuery.each( { 6207 appendTo: "append", 6208 prependTo: "prepend", 6209 insertBefore: "before", 6210 insertAfter: "after", 6211 replaceAll: "replaceWith" 6212}, function( name, original ) { 6213 jQuery.fn[ name ] = function( selector ) { 6214 var elems, 6215 ret = [], 6216 insert = jQuery( selector ), 6217 last = insert.length - 1, 6218 i = 0; 6219 6220 for ( ; i <= last; i++ ) { 6221 elems = i === last ? this : this.clone( true ); 6222 jQuery( insert[ i ] )[ original ]( elems ); 6223 6224 // Support: Android <=4.0 only, PhantomJS 1 only 6225 // .get() because push.apply(_, arraylike) throws on ancient WebKit 6226 push.apply( ret, elems.get() ); 6227 } 6228 6229 return this.pushStack( ret ); 6230 }; 6231} ); 6232var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 6233 6234var rcustomProp = /^--/; 6235 6236 6237var getStyles = function( elem ) { 6238 6239 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 6240 // IE throws on elements created in popups 6241 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6242 var view = elem.ownerDocument.defaultView; 6243 6244 if ( !view || !view.opener ) { 6245 view = window; 6246 } 6247 6248 return view.getComputedStyle( elem ); 6249 }; 6250 6251var swap = function( elem, options, callback ) { 6252 var ret, name, 6253 old = {}; 6254 6255 // Remember the old values, and insert the new ones 6256 for ( name in options ) { 6257 old[ name ] = elem.style[ name ]; 6258 elem.style[ name ] = options[ name ]; 6259 } 6260 6261 ret = callback.call( elem ); 6262 6263 // Revert the old values 6264 for ( name in options ) { 6265 elem.style[ name ] = old[ name ]; 6266 } 6267 6268 return ret; 6269}; 6270 6271 6272var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 6273 6274 6275 6276( function() { 6277 6278 // Executing both pixelPosition & boxSizingReliable tests require only one layout 6279 // so they're executed at the same time to save the second computation. 6280 function computeStyleTests() { 6281 6282 // This is a singleton, we need to execute it only once 6283 if ( !div ) { 6284 return; 6285 } 6286 6287 container.style.cssText = "position:absolute;
vendor: 4,156 bytes, lines 6287-6406
6287left:-11111px;width:60px;" + 6288 "margin-top:1px;padding:0;border:0"; 6289 div.style.cssText = 6290 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 6291 "margin:auto;border:1px;padding:1px;" + 6292 "width:60%;top:1%"; 6293 documentElement.appendChild( container ).appendChild( div ); 6294 6295 var divStyle = window.getComputedStyle( div ); 6296 pixelPositionVal = divStyle.top !== "1%"; 6297 6298 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 6299 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 6300 6301 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 6302 // Some styles come back with percentage values, even though they shouldn't 6303 div.style.right = "60%"; 6304 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 6305 6306 // Support: IE 9 - 11 only 6307 // Detect misreporting of content dimensions for box-sizing:border-box elements 6308 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 6309 6310 // Support: IE 9 only 6311 // Detect overflow:scroll screwiness (gh-3699) 6312 // Support: Chrome <=64 6313 // Don't get tricked when zoom affects offsetWidth (gh-4029) 6314 div.style.position = "absolute"; 6315 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 6316 6317 documentElement.removeChild( container ); 6318 6319 // Nullify the div so it wouldn't be stored in the memory and 6320 // it will also be a sign that checks already performed 6321 div = null; 6322 } 6323 6324 function roundPixelMeasures( measure ) { 6325 return Math.round( parseFloat( measure ) ); 6326 } 6327 6328 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 6329 reliableTrDimensionsVal, reliableMarginLeftVal, 6330 container = document.createElement( "div" ), 6331 div = document.createElement( "div" ); 6332 6333 // Finish early in limited (non-browser) environments 6334 if ( !div.style ) { 6335 return; 6336 } 6337 6338 // Support: IE <=9 - 11 only 6339 // Style of cloned element affects source element cloned (trac-8908) 6340 div.style.backgroundClip = "content-box"; 6341 div.cloneNode( true ).style.backgroundClip = ""; 6342 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6343 6344 jQuery.extend( support, { 6345 boxSizingReliable: function() { 6346 computeStyleTests(); 6347 return boxSizingReliableVal; 6348 }, 6349 pixelBoxStyles: function() { 6350 computeStyleTests(); 6351 return pixelBoxStylesVal; 6352 }, 6353 pixelPosition: function() { 6354 computeStyleTests(); 6355 return pixelPositionVal; 6356 }, 6357 reliableMarginLeft: function() { 6358 computeStyleTests(); 6359 return reliableMarginLeftVal; 6360 }, 6361 scrollboxSize: function() { 6362 computeStyleTests(); 6363 return scrollboxSizeVal; 6364 }, 6365 6366 // Support: IE 9 - 11+, Edge 15 - 18+ 6367 // IE/Edge misreport `getComputedStyle` of table rows with width/height 6368 // set in CSS while `offset*` properties report correct values. 6369 // Behavior in IE 9 is more subtle than in newer versions & it passes 6370 // some versions of this test; make sure not to make it pass there! 6371 // 6372 // Support: Firefox 70+ 6373 // Only Firefox includes border widths 6374 // in computed dimensions. (gh-4529) 6375 reliableTrDimensions: function() { 6376 var table, tr, trChild, trStyle; 6377 if ( reliableTrDimensionsVal == null ) { 6378 table = document.createElement( "table" ); 6379 tr = document.createElement( "tr" ); 6380 trChild = document.createElement( "div" ); 6381 6382 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 6383 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 6384 6385 // Support: Chrome 86+ 6386 // Height set through cssText does not get applied. 6387 // Computed height then comes back as 0. 6388 tr.style.height = "1px"; 6389 trChild.style.height = "9px"; 6390 6391 // Support: Android 8 Chrome 86+ 6392 // In our bodyBackground.html iframe, 6393 // display for all div elements is set to "inline", 6394 // which causes a problem only in Android 8 Chrome 86. 6395 // Ensuring the div is `display: block` 6396 // gets around this issue. 6397 trChild.style.display = "block"; 6398 6399 documentElement 6400 .appendChild( table ) 6401 .appendChild( tr ) 6402 .appendChild( trChild ); 6403 6404 trStyle = window.getComputedStyle( tr ); 6405 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 6406 parseInt( trStyle.borderTopWidth, 10 ) +
vendor: 12,879 bytes, lines 6407-6833
6407 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 6408 6409 documentElement.removeChild( table ); 6410 } 6411 return reliableTrDimensionsVal; 6412 } 6413 } ); 6414} )(); 6415 6416 6417function curCSS( elem, name, computed ) { 6418 var width, minWidth, maxWidth, ret, 6419 isCustomProp = rcustomProp.test( name ), 6420 6421 // Support: Firefox 51+ 6422 // Retrieving style before computed somehow 6423 // fixes an issue with getting wrong values 6424 // on detached elements 6425 style = elem.style; 6426 6427 computed = computed || getStyles( elem ); 6428 6429 // getPropertyValue is needed for: 6430 // .css('filter') (IE 9 only, trac-12537) 6431 // .css('--customProperty) (gh-3144) 6432 if ( computed ) { 6433 6434 // Support: IE <=9 - 11+ 6435 // IE only supports `"float"` in `getPropertyValue`; in computed styles 6436 // it's only available as `"cssFloat"`. We no longer modify properties 6437 // sent to `.css()` apart from camelCasing, so we need to check both. 6438 // Normally, this would create difference in behavior: if 6439 // `getPropertyValue` returns an empty string, the value returned 6440 // by `.css()` would be `undefined`. This is usually the case for 6441 // disconnected elements. However, in IE even disconnected elements 6442 // with no styles return `"none"` for `getPropertyValue( "float" )` 6443 ret = computed.getPropertyValue( name ) || computed[ name ]; 6444 6445 if ( isCustomProp && ret ) { 6446 6447 // Support: Firefox 105+, Chrome <=105+ 6448 // Spec requires trimming whitespace for custom properties (gh-4926). 6449 // Firefox only trims leading whitespace. Chrome just collapses 6450 // both leading & trailing whitespace to a single space. 6451 // 6452 // Fall back to `undefined` if empty string returned. 6453 // This collapses a missing definition with property defined 6454 // and set to an empty string but there's no standard API 6455 // allowing us to differentiate them without a performance penalty 6456 // and returning `undefined` aligns with older jQuery. 6457 // 6458 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 6459 // as whitespace while CSS does not, but this is not a problem 6460 // because CSS preprocessing replaces them with U+000A LINE FEED 6461 // (which *is* CSS whitespace) 6462 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 6463 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 6464 } 6465 6466 if ( ret === "" && !isAttached( elem ) ) { 6467 ret = jQuery.style( elem, name ); 6468 } 6469 6470 // A tribute to the "awesome hack by Dean Edwards" 6471 // Android Browser returns percentage for some values, 6472 // but width seems to be reliably pixels. 6473 // This is against the CSSOM draft spec: 6474 // https://drafts.csswg.org/cssom/#resolved-values 6475 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 6476 6477 // Remember the original values 6478 width = style.width; 6479 minWidth = style.minWidth; 6480 maxWidth = style.maxWidth; 6481 6482 // Put in the new values to get a computed value out 6483 style.minWidth = style.maxWidth = style.width = ret; 6484 ret = computed.width; 6485 6486 // Revert the changed values 6487 style.width = width; 6488 style.minWidth = minWidth; 6489 style.maxWidth = maxWidth; 6490 } 6491 } 6492 6493 return ret !== undefined ? 6494 6495 // Support: IE <=9 - 11 only 6496 // IE returns zIndex value as an integer. 6497 ret + "" : 6498 ret; 6499} 6500 6501 6502function addGetHookIf( conditionFn, hookFn ) { 6503 6504 // Define the hook, we'll check on the first run if it's really needed. 6505 return { 6506 get: function() { 6507 if ( conditionFn() ) { 6508 6509 // Hook not needed (or it's not possible to use it due 6510 // to missing dependency), remove it. 6511 delete this.get; 6512 return; 6513 } 6514 6515 // Hook needed; redefine it so that the support test is not executed again. 6516 return ( this.get = hookFn ).apply( this, arguments ); 6517 } 6518 }; 6519} 6520 6521 6522var cssPrefixes = [ "Webkit", "Moz", "ms" ], 6523 emptyStyle = document.createElement( "div" ).style, 6524 vendorProps = {}; 6525 6526// Return a vendor-prefixed property or undefined 6527function vendorPropName( name ) { 6528 6529 // Check for vendor prefixed names 6530 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 6531 i = cssPrefixes.length; 6532 6533 while ( i-- ) { 6534 name = cssPrefixes[ i ] + capName; 6535 if ( name in emptyStyle ) { 6536 return name; 6537 } 6538 } 6539} 6540 6541// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 6542function finalPropName( name ) { 6543 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 6544 6545 if ( final ) { 6546 return final; 6547 } 6548 if ( name in emptyStyle ) { 6549 return name; 6550 } 6551 return vendorProps[ name ] = vendorPropName( name ) || name; 6552} 6553 6554 6555var 6556 6557 // Swappable if display is none or starts with table 6558 // except "table", "table-cell", or "table-caption" 6559 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 6560 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6561 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6562 cssNormalTransform = { 6563 letterSpacing: "0", 6564 fontWeight: "400" 6565 }; 6566 6567function setPositiveNumber( _elem, value, subtract ) { 6568 6569 // Any relative (+/-) values have already been 6570 // normalized at this point 6571 var matches = rcssNum.exec( value ); 6572 return matches ? 6573 6574 // Guard against undefined "subtract", e.g., when used as in cssHooks 6575 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 6576 value; 6577} 6578 6579function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 6580 var i = dimension === "width" ? 1 : 0, 6581 extra = 0, 6582 delta = 0, 6583 marginDelta = 0; 6584 6585 // Adjustment may not be necessary 6586 if ( box === ( isBorderBox ? "border" : "content" ) ) { 6587 return 0; 6588 } 6589 6590 for ( ; i < 4; i += 2 ) { 6591 6592 // Both box models exclude margin 6593 // Count margin delta separately to only add it after scroll gutter adjustment. 6594 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 6595 if ( box === "margin" ) { 6596 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 6597 } 6598 6599 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 6600 if ( !isBorderBox ) { 6601 6602 // Add padding 6603 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6604 6605 // For "border" or "margin", add border 6606 if ( box !== "padding" ) { 6607 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6608 6609 // But still keep track of it otherwise 6610 } else { 6611 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6612 } 6613 6614 // If we get here with a border-box (content + padding + border), we're seeking "content" or 6615 // "padding" or "margin" 6616 } else { 6617 6618 // For "content", subtract padding 6619 if ( box === "content" ) { 6620 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6621 } 6622 6623 // For "content" or "padding", subtract border 6624 if ( box !== "margin" ) { 6625 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6626 } 6627 } 6628 } 6629 6630 // Account for positive content-box scroll gutter when requested by providing computedVal 6631 if ( !isBorderBox && computedVal >= 0 ) { 6632 6633 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 6634 // Assuming integer scroll gutter, subtract the rest and round down 6635 delta += Math.max( 0, Math.ceil( 6636 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 6637 computedVal - 6638 delta - 6639 extra - 6640 0.5 6641 6642 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 6643 // Use an explicit zero to avoid NaN (gh-3964) 6644 ) ) || 0; 6645 } 6646 6647 return delta + marginDelta; 6648} 6649 6650function getWidthOrHeight( elem, dimension, extra ) { 6651 6652 // Start with computed style 6653 var styles = getStyles( elem ), 6654 6655 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 6656 // Fake content-box until we know it's needed to know the true value. 6657 boxSizingNeeded = !support.boxSizingReliable() || extra, 6658 isBorderBox = boxSizingNeeded && 6659 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6660 valueIsBorderBox = isBorderBox, 6661 6662 val = curCSS( elem, dimension, styles ), 6663 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 6664 6665 // Support: Firefox <=54 6666 // Return a confounding non-pixel value or feign ignorance, as appropriate. 6667 if ( rnumnonpx.test( val ) ) { 6668 if ( !extra ) { 6669 return val; 6670 } 6671 val = "auto"; 6672 } 6673 6674 6675 // Support: IE 9 - 11 only 6676 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 6677 // In those cases, the computed value can be trusted to be border-box. 6678 if ( ( !support.boxSizingReliable() && isBorderBox || 6679 6680 // Support: IE 10 - 11+, Edge 15 - 18+ 6681 // IE/Edge misreport `getComputedStyle` of table rows with width/height 6682 // set in CSS while `offset*` properties report correct values. 6683 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 6684 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 6685 6686 // Fall back to offsetWidth/offsetHeight when value is "auto" 6687 // This happens for inline elements with no explicit setting (gh-3571) 6688 val === "auto" || 6689 6690 // Support: Android <=4.1 - 4.3 only 6691 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 6692 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 6693 6694 // Make sure the element is visible & connected 6695 elem.getClientRects().length ) { 6696 6697 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 6698 6699 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 6700 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 6701 // retrieved value as a content box dimension. 6702 valueIsBorderBox = offsetProp in elem; 6703 if ( valueIsBorderBox ) { 6704 val = elem[ offsetProp ]; 6705 } 6706 } 6707 6708 // Normalize "" and auto 6709 val = parseFloat( val ) || 0; 6710 6711 // Adjust for the element's box model 6712 return ( val + 6713 boxModelAdjustment( 6714 elem, 6715 dimension, 6716 extra || ( isBorderBox ? "border" : "content" ), 6717 valueIsBorderBox, 6718 styles, 6719 6720 // Provide the current computed size to request scroll gutter calculation (gh-3589) 6721 val 6722 ) 6723 ) + "px"; 6724} 6725 6726jQuery.extend( { 6727 6728 // Add in style property hooks for overriding the default 6729 // behavior of getting and setting a style property 6730 cssHooks: { 6731 opacity: { 6732 get: function( elem, computed ) { 6733 if ( computed ) { 6734 6735 // We should always get a number back from opacity 6736 var ret = curCSS( elem, "opacity" ); 6737 return ret === "" ? "1" : ret; 6738 } 6739 } 6740 } 6741 }, 6742 6743 // Don't automatically add "px" to these possibly-unitless properties 6744 cssNumber: { 6745 animationIterationCount: true, 6746 aspectRatio: true, 6747 borderImageSlice: true, 6748 columnCount: true, 6749 flexGrow: true, 6750 flexShrink: true, 6751 fontWeight: true, 6752 gridArea: true, 6753 gridColumn: true, 6754 gridColumnEnd: true, 6755 gridColumnStart: true, 6756 gridRow: true, 6757 gridRowEnd: true, 6758 gridRowStart: true, 6759 lineHeight: true, 6760 opacity: true, 6761 order: true, 6762 orphans: true, 6763 scale: true, 6764 widows: true, 6765 zIndex: true, 6766 zoom: true, 6767 6768 // SVG-related 6769 fillOpacity: true, 6770 floodOpacity: true, 6771 stopOpacity: true, 6772 strokeMiterlimit: true, 6773 strokeOpacity: true 6774 }, 6775 6776 // Add in properties whose names you wish to fix before 6777 // setting or getting the value 6778 cssProps: {}, 6779 6780 // Get and set the style property on a DOM Node 6781 style: function( elem, name, value, extra ) { 6782 6783 // Don't set styles on text and comment nodes 6784 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6785 return; 6786 } 6787 6788 // Make sure that we're working with the right name 6789 var ret, type, hooks, 6790 origName = camelCase( name ), 6791 isCustomProp = rcustomProp.test( name ), 6792 style = elem.style; 6793 6794 // Make sure that we're working with the right name. We don't 6795 // want to query the value if it is a CSS custom property 6796 // since they are user-defined. 6797 if ( !isCustomProp ) { 6798 name = finalPropName( origName ); 6799 } 6800 6801 // Gets hook for the prefixed version, then unprefixed version 6802 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6803 6804 // Check if we're setting a value 6805 if ( value !== undefined ) { 6806 type = typeof value; 6807 6808 // Convert "+=" or "-=" to relative numbers (trac-7345) 6809 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 6810 value = adjustCSS( elem, name, ret ); 6811 6812 // Fixes bug trac-9237 6813 type = "number"; 6814 } 6815 6816 // Make sure that null and NaN values aren't set (trac-7116) 6817 if ( value == null || value !== value ) { 6818 return; 6819 } 6820 6821 // If a number was passed in, add the unit (except for certain CSS properties) 6822 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 6823 // "px" to a few hardcoded values. 6824 if ( type === "number" && !isCustomProp ) { 6825 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 6826 } 6827 6828 // background-* props affect original clone's values 6829 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 6830 style[ name ] = "inherit"; 6831 } 6832 6833 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 16,052 bytes, lines 6834-7438
6834 if ( !hooks || !( "set" in hooks ) || 6835 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 6836 6837 if ( isCustomProp ) { 6838 style.setProperty( name, value ); 6839 } else { 6840 style[ name ] = value; 6841 } 6842 } 6843 6844 } else { 6845 6846 // If a hook was provided get the non-computed value from there 6847 if ( hooks && "get" in hooks && 6848 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 6849 6850 return ret; 6851 } 6852 6853 // Otherwise just get the value from the style object 6854 return style[ name ]; 6855 } 6856 }, 6857 6858 css: function( elem, name, extra, styles ) { 6859 var val, num, hooks, 6860 origName = camelCase( name ), 6861 isCustomProp = rcustomProp.test( name ); 6862 6863 // Make sure that we're working with the right name. We don't 6864 // want to modify the value if it is a CSS custom property 6865 // since they are user-defined. 6866 if ( !isCustomProp ) { 6867 name = finalPropName( origName ); 6868 } 6869 6870 // Try prefixed name followed by the unprefixed name 6871 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6872 6873 // If a hook was provided get the computed value from there 6874 if ( hooks && "get" in hooks ) { 6875 val = hooks.get( elem, true, extra ); 6876 } 6877 6878 // Otherwise, if a way to get the computed value exists, use that 6879 if ( val === undefined ) { 6880 val = curCSS( elem, name, styles ); 6881 } 6882 6883 // Convert "normal" to computed value 6884 if ( val === "normal" && name in cssNormalTransform ) { 6885 val = cssNormalTransform[ name ]; 6886 } 6887 6888 // Make numeric if forced or a qualifier was provided and val looks numeric 6889 if ( extra === "" || extra ) { 6890 num = parseFloat( val ); 6891 return extra === true || isFinite( num ) ? num || 0 : val; 6892 } 6893 6894 return val; 6895 } 6896} ); 6897 6898jQuery.each( [ "height", "width" ], function( _i, dimension ) { 6899 jQuery.cssHooks[ dimension ] = { 6900 get: function( elem, computed, extra ) { 6901 if ( computed ) { 6902 6903 // Certain elements can have dimension info if we invisibly show them 6904 // but it must have a current display style that would benefit 6905 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 6906 6907 // Support: Safari 8+ 6908 // Table columns in Safari have non-zero offsetWidth & zero 6909 // getBoundingClientRect().width unless display is changed. 6910 // Support: IE <=11 only 6911 // Running getBoundingClientRect on a disconnected node 6912 // in IE throws an error. 6913 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 6914 swap( elem, cssShow, function() { 6915 return getWidthOrHeight( elem, dimension, extra ); 6916 } ) : 6917 getWidthOrHeight( elem, dimension, extra ); 6918 } 6919 }, 6920 6921 set: function( elem, value, extra ) { 6922 var matches, 6923 styles = getStyles( elem ), 6924 6925 // Only read styles.position if the test has a chance to fail 6926 // to avoid forcing a reflow. 6927 scrollboxSizeBuggy = !support.scrollboxSize() && 6928 styles.position === "absolute", 6929 6930 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 6931 boxSizingNeeded = scrollboxSizeBuggy || extra, 6932 isBorderBox = boxSizingNeeded && 6933 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6934 subtract = extra ? 6935 boxModelAdjustment( 6936 elem, 6937 dimension, 6938 extra, 6939 isBorderBox, 6940 styles 6941 ) : 6942 0; 6943 6944 // Account for unreliable border-box dimensions by comparing offset* to computed and 6945 // faking a content-box to get border and padding (gh-3699) 6946 if ( isBorderBox && scrollboxSizeBuggy ) { 6947 subtract -= Math.ceil( 6948 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 6949 parseFloat( styles[ dimension ] ) - 6950 boxModelAdjustment( elem, dimension, "border", false, styles ) - 6951 0.5 6952 ); 6953 } 6954 6955 // Convert to pixels if value adjustment is needed 6956 if ( subtract && ( matches = rcssNum.exec( value ) ) && 6957 ( matches[ 3 ] || "px" ) !== "px" ) { 6958 6959 elem.style[ dimension ] = value; 6960 value = jQuery.css( elem, dimension ); 6961 } 6962 6963 return setPositiveNumber( elem, value, subtract ); 6964 } 6965 }; 6966} ); 6967 6968jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 6969 function( elem, computed ) { 6970 if ( computed ) { 6971 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 6972 elem.getBoundingClientRect().left - 6973 swap( elem, { marginLeft: 0 }, function() { 6974 return elem.getBoundingClientRect().left; 6975 } ) 6976 ) + "px"; 6977 } 6978 } 6979); 6980 6981// These hooks are used by animate to expand properties 6982jQuery.each( { 6983 margin: "", 6984 padding: "", 6985 border: "Width" 6986}, function( prefix, suffix ) { 6987 jQuery.cssHooks[ prefix + suffix ] = { 6988 expand: function( value ) { 6989 var i = 0, 6990 expanded = {}, 6991 6992 // Assumes a single number if not a string 6993 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 6994 6995 for ( ; i < 4; i++ ) { 6996 expanded[ prefix + cssExpand[ i ] + suffix ] = 6997 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6998 } 6999 7000 return expanded; 7001 } 7002 }; 7003 7004 if ( prefix !== "margin" ) { 7005 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 7006 } 7007} ); 7008 7009jQuery.fn.extend( { 7010 css: function( name, value ) { 7011 return access( this, function( elem, name, value ) { 7012 var styles, len, 7013 map = {}, 7014 i = 0; 7015 7016 if ( Array.isArray( name ) ) { 7017 styles = getStyles( elem ); 7018 len = name.length; 7019 7020 for ( ; i < len; i++ ) { 7021 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 7022 } 7023 7024 return map; 7025 } 7026 7027 return value !== undefined ? 7028 jQuery.style( elem, name, value ) : 7029 jQuery.css( elem, name ); 7030 }, name, value, arguments.length > 1 ); 7031 } 7032} ); 7033 7034 7035function Tween( elem, options, prop, end, easing ) { 7036 return new Tween.prototype.init( elem, options, prop, end, easing ); 7037} 7038jQuery.Tween = Tween; 7039 7040Tween.prototype = { 7041 constructor: Tween, 7042 init: function( elem, options, prop, end, easing, unit ) { 7043 this.elem = elem; 7044 this.prop = prop; 7045 this.easing = easing || jQuery.easing._default; 7046 this.options = options; 7047 this.start = this.now = this.cur(); 7048 this.end = end; 7049 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 7050 }, 7051 cur: function() { 7052 var hooks = Tween.propHooks[ this.prop ]; 7053 7054 return hooks && hooks.get ? 7055 hooks.get( this ) : 7056 Tween.propHooks._default.get( this ); 7057 }, 7058 run: function( percent ) { 7059 var eased, 7060 hooks = Tween.propHooks[ this.prop ]; 7061 7062 if ( this.options.duration ) { 7063 this.pos = eased = jQuery.easing[ this.easing ]( 7064 percent, this.options.duration * percent, 0, 1, this.options.duration 7065 ); 7066 } else { 7067 this.pos = eased = percent; 7068 } 7069 this.now = ( this.end - this.start ) * eased + this.start; 7070 7071 if ( this.options.step ) { 7072 this.options.step.call( this.elem, this.now, this ); 7073 } 7074 7075 if ( hooks && hooks.set ) { 7076 hooks.set( this ); 7077 } else { 7078 Tween.propHooks._default.set( this ); 7079 } 7080 return this; 7081 } 7082}; 7083 7084Tween.prototype.init.prototype = Tween.prototype; 7085 7086Tween.propHooks = { 7087 _default: { 7088 get: function( tween ) { 7089 var result; 7090 7091 // Use a property on the element directly when it is not a DOM element, 7092 // or when there is no matching style property that exists. 7093 if ( tween.elem.nodeType !== 1 || 7094 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 7095 return tween.elem[ tween.prop ]; 7096 } 7097 7098 // Passing an empty string as a 3rd parameter to .css will automatically 7099 // attempt a parseFloat and fallback to a string if the parse fails. 7100 // Simple values such as "10px" are parsed to Float; 7101 // complex values such as "rotate(1rad)" are returned as-is. 7102 result = jQuery.css( tween.elem, tween.prop, "" ); 7103 7104 // Empty strings, null, undefined and "auto" are converted to 0. 7105 return !result || result === "auto" ? 0 : result; 7106 }, 7107 set: function( tween ) { 7108 7109 // Use step hook for back compat. 7110 // Use cssHook if its there. 7111 // Use .style if available and use plain properties where available. 7112 if ( jQuery.fx.step[ tween.prop ] ) { 7113 jQuery.fx.step[ tween.prop ]( tween ); 7114 } else if ( tween.elem.nodeType === 1 && ( 7115 jQuery.cssHooks[ tween.prop ] || 7116 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 7117 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 7118 } else { 7119 tween.elem[ tween.prop ] = tween.now; 7120 } 7121 } 7122 } 7123}; 7124 7125// Support: IE <=9 only 7126// Panic based approach to setting things on disconnected nodes 7127Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 7128 set: function( tween ) { 7129 if ( tween.elem.nodeType && tween.elem.parentNode ) { 7130 tween.elem[ tween.prop ] = tween.now; 7131 } 7132 } 7133}; 7134 7135jQuery.easing = { 7136 linear: function( p ) { 7137 return p; 7138 }, 7139 swing: function( p ) { 7140 return 0.5 - Math.cos( p * Math.PI ) / 2; 7141 }, 7142 _default: "swing" 7143}; 7144 7145jQuery.fx = Tween.prototype.init; 7146 7147// Back compat <1.8 extension point 7148jQuery.fx.step = {}; 7149 7150 7151 7152 7153var 7154 fxNow, inProgress, 7155 rfxtypes = /^(?:toggle|show|hide)$/, 7156 rrun = /queueHooks$/; 7157 7158function schedule() { 7159 if ( inProgress ) { 7160 if ( document.hidden === false && window.requestAnimationFrame ) { 7161 window.requestAnimationFrame( schedule ); 7162 } else { 7163 window.setTimeout( schedule, jQuery.fx.interval ); 7164 } 7165 7166 jQuery.fx.tick(); 7167 } 7168} 7169 7170// Animations created synchronously will run synchronously 7171function createFxNow() { 7172 window.setTimeout( function() { 7173 fxNow = undefined; 7174 } ); 7175 return ( fxNow = Date.now() ); 7176} 7177 7178// Generate parameters to create a standard animation 7179function genFx( type, includeWidth ) { 7180 var which, 7181 i = 0, 7182 attrs = { height: type }; 7183 7184 // If we include width, step value is 1 to do all cssExpand values, 7185 // otherwise step value is 2 to skip over Left and Right 7186 includeWidth = includeWidth ? 1 : 0; 7187 for ( ; i < 4; i += 2 - includeWidth ) { 7188 which = cssExpand[ i ]; 7189 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 7190 } 7191 7192 if ( includeWidth ) { 7193 attrs.opacity = attrs.width = type; 7194 } 7195 7196 return attrs; 7197} 7198 7199function createTween( value, prop, animation ) { 7200 var tween, 7201 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 7202 index = 0, 7203 length = collection.length; 7204 for ( ; index < length; index++ ) { 7205 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 7206 7207 // We're done with this property 7208 return tween; 7209 } 7210 } 7211} 7212 7213function defaultPrefilter( elem, props, opts ) { 7214 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 7215 isBox = "width" in props || "height" in props, 7216 anim = this, 7217 orig = {}, 7218 style = elem.style, 7219 hidden = elem.nodeType && isHiddenWithinTree( elem ), 7220 dataShow = dataPriv.get( elem, "fxshow" ); 7221 7222 // Queue-skipping animations hijack the fx hooks 7223 if ( !opts.queue ) { 7224 hooks = jQuery._queueHooks( elem, "fx" ); 7225 if ( hooks.unqueued == null ) { 7226 hooks.unqueued = 0; 7227 oldfire = hooks.empty.fire; 7228 hooks.empty.fire = function() { 7229 if ( !hooks.unqueued ) { 7230 oldfire(); 7231 } 7232 }; 7233 } 7234 hooks.unqueued++; 7235 7236 anim.always( function() { 7237 7238 // Ensure the complete handler is called before this completes 7239 anim.always( function() { 7240 hooks.unqueued--; 7241 if ( !jQuery.queue( elem, "fx" ).length ) { 7242 hooks.empty.fire(); 7243 } 7244 } ); 7245 } ); 7246 } 7247 7248 // Detect show/hide animations 7249 for ( prop in props ) { 7250 value = props[ prop ]; 7251 if ( rfxtypes.test( value ) ) { 7252 delete props[ prop ]; 7253 toggle = toggle || value === "toggle"; 7254 if ( value === ( hidden ? "hide" : "show" ) ) { 7255 7256 // Pretend to be hidden if this is a "show" and 7257 // there is still data from a stopped show/hide 7258 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 7259 hidden = true; 7260 7261 // Ignore all other no-op show/hide data 7262 } else { 7263 continue; 7264 } 7265 } 7266 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 7267 } 7268 } 7269 7270 // Bail out if this is a no-op like .hide().hide() 7271 propTween = !jQuery.isEmptyObject( props ); 7272 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 7273 return; 7274 } 7275 7276 // Restrict "overflow" and "display" styles during box animations 7277 if ( isBox && elem.nodeType === 1 ) { 7278 7279 // Support: IE <=9 - 11, Edge 12 - 15 7280 // Record all 3 overflow attributes because IE does not infer the shorthand 7281 // from identically-valued overflowX and overflowY and Edge just mirrors 7282 // the overflowX value there. 7283 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 7284 7285 // Identify a display type, preferring old show/hide data over the CSS cascade 7286 restoreDisplay = dataShow && dataShow.display; 7287 if ( restoreDisplay == null ) { 7288 restoreDisplay = dataPriv.get( elem, "display" ); 7289 } 7290 display = jQuery.css( elem, "display" ); 7291 if ( display === "none" ) { 7292 if ( restoreDisplay ) { 7293 display = restoreDisplay; 7294 } else { 7295 7296 // Get nonempty value(s) by temporarily forcing visibility 7297 showHide( [ elem ], true ); 7298 restoreDisplay = elem.style.display || restoreDisplay; 7299 display = jQuery.css( elem, "display" ); 7300 showHide( [ elem ] ); 7301 } 7302 } 7303 7304 // Animate inline elements as inline-block 7305 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 7306 if ( jQuery.css( elem, "float" ) === "none" ) { 7307 7308 // Restore the original display value at the end of pure show/hide animations 7309 if ( !propTween ) { 7310 anim.done( function() { 7311 style.display = restoreDisplay; 7312 } ); 7313 if ( restoreDisplay == null ) { 7314 display = style.display; 7315 restoreDisplay = display === "none" ? "" : display; 7316 } 7317 } 7318 style.display = "inline-block"; 7319 } 7320 } 7321 } 7322 7323 if ( opts.overflow ) { 7324 style.overflow = "hidden"; 7325 anim.always( function() { 7326 style.overflow = opts.overflow[ 0 ]; 7327 style.overflowX = opts.overflow[ 1 ]; 7328 style.overflowY = opts.overflow[ 2 ]; 7329 } ); 7330 } 7331 7332 // Implement show/hide animations 7333 propTween = false; 7334 for ( prop in orig ) { 7335 7336 // General show/hide setup for this element animation 7337 if ( !propTween ) { 7338 if ( dataShow ) { 7339 if ( "hidden" in dataShow ) { 7340 hidden = dataShow.hidden; 7341 } 7342 } else { 7343 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 7344 } 7345 7346 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 7347 if ( toggle ) { 7348 dataShow.hidden = !hidden; 7349 } 7350 7351 // Show elements before animating them 7352 if ( hidden ) { 7353 showHide( [ elem ], true ); 7354 } 7355 7356 /* eslint-disable no-loop-func */ 7357 7358 anim.done( function() { 7359 7360 /* eslint-enable no-loop-func */ 7361 7362 // The final step of a "hide" animation is actually hiding the element 7363 if ( !hidden ) { 7364 showHide( [ elem ] ); 7365 } 7366 dataPriv.remove( elem, "fxshow" ); 7367 for ( prop in orig ) { 7368 jQuery.style( elem, prop, orig[ prop ] ); 7369 } 7370 } ); 7371 } 7372 7373 // Per-property setup 7374 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 7375 if ( !( prop in dataShow ) ) { 7376 dataShow[ prop ] = propTween.start; 7377 if ( hidden ) { 7378 propTween.end = propTween.start; 7379 propTween.start = 0; 7380 } 7381 } 7382 } 7383} 7384 7385function propFilter( props, specialEasing ) { 7386 var index, name, easing, value, hooks; 7387 7388 // camelCase, specialEasing and expand cssHook pass 7389 for ( index in props ) { 7390 name = camelCase( index ); 7391 easing = specialEasing[ name ]; 7392 value = props[ index ]; 7393 if ( Array.isArray( value ) ) { 7394 easing = value[ 1 ]; 7395 value = props[ index ] = value[ 0 ]; 7396 } 7397 7398 if ( index !== name ) { 7399 props[ name ] = value; 7400 delete props[ index ]; 7401 } 7402 7403 hooks = jQuery.cssHooks[ name ]; 7404 if ( hooks && "expand" in hooks ) { 7405 value = hooks.expand( value ); 7406 delete props[ name ]; 7407 7408 // Not quite $.extend, this won't overwrite existing keys. 7409 // Reusing 'index' because we have the correct "name" 7410 for ( index in value ) { 7411 if ( !( index in props ) ) { 7412 props[ index ] = value[ index ]; 7413 specialEasing[ index ] = easing; 7414 } 7415 } 7416 } else { 7417 specialEasing[ name ] = easing; 7418 } 7419 } 7420} 7421 7422function Animation( elem, properties, options ) { 7423 var result, 7424 stopped, 7425 index = 0, 7426 length = Animation.prefilters.length, 7427 deferred = jQuery.Deferred().always( function() { 7428 7429 // Don't match elem in the :animated selector 7430 delete tick.elem; 7431 } ), 7432 tick = function() { 7433 if ( stopped ) { 7434 return false; 7435 } 7436 var currentTime = fxNow || createFxNow(), 7437 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 7438
vendor: 9,542 bytes, lines 7439-7829
7439 // Support: Android 2.3 only 7440 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 7441 temp = remaining / animation.duration || 0, 7442 percent = 1 - temp, 7443 index = 0, 7444 length = animation.tweens.length; 7445 7446 for ( ; index < length; index++ ) { 7447 animation.tweens[ index ].run( percent ); 7448 } 7449 7450 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 7451 7452 // If there's more to do, yield 7453 if ( percent < 1 && length ) { 7454 return remaining; 7455 } 7456 7457 // If this was an empty animation, synthesize a final progress notification 7458 if ( !length ) { 7459 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7460 } 7461 7462 // Resolve the animation and report its conclusion 7463 deferred.resolveWith( elem, [ animation ] ); 7464 return false; 7465 }, 7466 animation = deferred.promise( { 7467 elem: elem, 7468 props: jQuery.extend( {}, properties ), 7469 opts: jQuery.extend( true, { 7470 specialEasing: {}, 7471 easing: jQuery.easing._default 7472 }, options ), 7473 originalProperties: properties, 7474 originalOptions: options, 7475 startTime: fxNow || createFxNow(), 7476 duration: options.duration, 7477 tweens: [], 7478 createTween: function( prop, end ) { 7479 var tween = jQuery.Tween( elem, animation.opts, prop, end, 7480 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 7481 animation.tweens.push( tween ); 7482 return tween; 7483 }, 7484 stop: function( gotoEnd ) { 7485 var index = 0, 7486 7487 // If we are going to the end, we want to run all the tweens 7488 // otherwise we skip this part 7489 length = gotoEnd ? animation.tweens.length : 0; 7490 if ( stopped ) { 7491 return this; 7492 } 7493 stopped = true; 7494 for ( ; index < length; index++ ) { 7495 animation.tweens[ index ].run( 1 ); 7496 } 7497 7498 // Resolve when we played the last frame; otherwise, reject 7499 if ( gotoEnd ) { 7500 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7501 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 7502 } else { 7503 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 7504 } 7505 return this; 7506 } 7507 } ), 7508 props = animation.props; 7509 7510 propFilter( props, animation.opts.specialEasing ); 7511 7512 for ( ; index < length; index++ ) { 7513 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 7514 if ( result ) { 7515 if ( isFunction( result.stop ) ) { 7516 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 7517 result.stop.bind( result ); 7518 } 7519 return result; 7520 } 7521 } 7522 7523 jQuery.map( props, createTween, animation ); 7524 7525 if ( isFunction( animation.opts.start ) ) { 7526 animation.opts.start.call( elem, animation ); 7527 } 7528 7529 // Attach callbacks from options 7530 animation 7531 .progress( animation.opts.progress ) 7532 .done( animation.opts.done, animation.opts.complete ) 7533 .fail( animation.opts.fail ) 7534 .always( animation.opts.always ); 7535 7536 jQuery.fx.timer( 7537 jQuery.extend( tick, { 7538 elem: elem, 7539 anim: animation, 7540 queue: animation.opts.queue 7541 } ) 7542 ); 7543 7544 return animation; 7545} 7546 7547jQuery.Animation = jQuery.extend( Animation, { 7548 7549 tweeners: { 7550 "*": [ function( prop, value ) { 7551 var tween = this.createTween( prop, value ); 7552 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 7553 return tween; 7554 } ] 7555 }, 7556 7557 tweener: function( props, callback ) { 7558 if ( isFunction( props ) ) { 7559 callback = props; 7560 props = [ "*" ]; 7561 } else { 7562 props = props.match( rnothtmlwhite ); 7563 } 7564 7565 var prop, 7566 index = 0, 7567 length = props.length; 7568 7569 for ( ; index < length; index++ ) { 7570 prop = props[ index ]; 7571 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 7572 Animation.tweeners[ prop ].unshift( callback ); 7573 } 7574 }, 7575 7576 prefilters: [ defaultPrefilter ], 7577 7578 prefilter: function( callback, prepend ) { 7579 if ( prepend ) { 7580 Animation.prefilters.unshift( callback ); 7581 } else { 7582 Animation.prefilters.push( callback ); 7583 } 7584 } 7585} ); 7586 7587jQuery.speed = function( speed, easing, fn ) { 7588 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 7589 complete: fn || !fn && easing || 7590 isFunction( speed ) && speed, 7591 duration: speed, 7592 easing: fn && easing || easing && !isFunction( easing ) && easing 7593 }; 7594 7595 // Go to the end state if fx are off 7596 if ( jQuery.fx.off ) { 7597 opt.duration = 0; 7598 7599 } else { 7600 if ( typeof opt.duration !== "number" ) { 7601 if ( opt.duration in jQuery.fx.speeds ) { 7602 opt.duration = jQuery.fx.speeds[ opt.duration ]; 7603 7604 } else { 7605 opt.duration = jQuery.fx.speeds._default; 7606 } 7607 } 7608 } 7609 7610 // Normalize opt.queue - true/undefined/null -> "fx" 7611 if ( opt.queue == null || opt.queue === true ) { 7612 opt.queue = "fx"; 7613 } 7614 7615 // Queueing 7616 opt.old = opt.complete; 7617 7618 opt.complete = function() { 7619 if ( isFunction( opt.old ) ) { 7620 opt.old.call( this ); 7621 } 7622 7623 if ( opt.queue ) { 7624 jQuery.dequeue( this, opt.queue ); 7625 } 7626 }; 7627 7628 return opt; 7629}; 7630 7631jQuery.fn.extend( { 7632 fadeTo: function( speed, to, easing, callback ) { 7633 7634 // Show any hidden elements after setting opacity to 0 7635 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 7636 7637 // Animate to the value specified 7638 .end().animate( { opacity: to }, speed, easing, callback ); 7639 }, 7640 animate: function( prop, speed, easing, callback ) { 7641 var empty = jQuery.isEmptyObject( prop ), 7642 optall = jQuery.speed( speed, easing, callback ), 7643 doAnimation = function() { 7644 7645 // Operate on a copy of prop so per-property easing won't be lost 7646 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 7647 7648 // Empty animations, or finishing resolves immediately 7649 if ( empty || dataPriv.get( this, "finish" ) ) { 7650 anim.stop( true ); 7651 } 7652 }; 7653 7654 doAnimation.finish = doAnimation; 7655 7656 return empty || optall.queue === false ? 7657 this.each( doAnimation ) : 7658 this.queue( optall.queue, doAnimation ); 7659 }, 7660 stop: function( type, clearQueue, gotoEnd ) { 7661 var stopQueue = function( hooks ) { 7662 var stop = hooks.stop; 7663 delete hooks.stop; 7664 stop( gotoEnd ); 7665 }; 7666 7667 if ( typeof type !== "string" ) { 7668 gotoEnd = clearQueue; 7669 clearQueue = type; 7670 type = undefined; 7671 } 7672 if ( clearQueue ) { 7673 this.queue( type || "fx", [] ); 7674 } 7675 7676 return this.each( function() { 7677 var dequeue = true, 7678 index = type != null && type + "queueHooks", 7679 timers = jQuery.timers, 7680 data = dataPriv.get( this ); 7681 7682 if ( index ) { 7683 if ( data[ index ] && data[ index ].stop ) { 7684 stopQueue( data[ index ] ); 7685 } 7686 } else { 7687 for ( index in data ) { 7688 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 7689 stopQueue( data[ index ] ); 7690 } 7691 } 7692 } 7693 7694 for ( index = timers.length; index--; ) { 7695 if ( timers[ index ].elem === this && 7696 ( type == null || timers[ index ].queue === type ) ) { 7697 7698 timers[ index ].anim.stop( gotoEnd ); 7699 dequeue = false; 7700 timers.splice( index, 1 ); 7701 } 7702 } 7703 7704 // Start the next in the queue if the last step wasn't forced. 7705 // Timers currently will call their complete callbacks, which 7706 // will dequeue but only if they were gotoEnd. 7707 if ( dequeue || !gotoEnd ) { 7708 jQuery.dequeue( this, type ); 7709 } 7710 } ); 7711 }, 7712 finish: function( type ) { 7713 if ( type !== false ) { 7714 type = type || "fx"; 7715 } 7716 return this.each( function() { 7717 var index, 7718 data = dataPriv.get( this ), 7719 queue = data[ type + "queue" ], 7720 hooks = data[ type + "queueHooks" ], 7721 timers = jQuery.timers, 7722 length = queue ? queue.length : 0; 7723 7724 // Enable finishing flag on private data 7725 data.finish = true; 7726 7727 // Empty the queue first 7728 jQuery.queue( this, type, [] ); 7729 7730 if ( hooks && hooks.stop ) { 7731 hooks.stop.call( this, true ); 7732 } 7733 7734 // Look for any active animations, and finish them 7735 for ( index = timers.length; index--; ) { 7736 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 7737 timers[ index ].anim.stop( true ); 7738 timers.splice( index, 1 ); 7739 } 7740 } 7741 7742 // Look for any animations in the old queue and finish them 7743 for ( index = 0; index < length; index++ ) { 7744 if ( queue[ index ] && queue[ index ].finish ) { 7745 queue[ index ].finish.call( this ); 7746 } 7747 } 7748 7749 // Turn off finishing flag 7750 delete data.finish; 7751 } ); 7752 } 7753} ); 7754 7755jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 7756 var cssFn = jQuery.fn[ name ]; 7757 jQuery.fn[ name ] = function( speed, easing, callback ) { 7758 return speed == null || typeof speed === "boolean" ? 7759 cssFn.apply( this, arguments ) : 7760 this.animate( genFx( name, true ), speed, easing, callback ); 7761 }; 7762} ); 7763 7764// Generate shortcuts for custom animations 7765jQuery.each( { 7766 slideDown: genFx( "show" ), 7767 slideUp: genFx( "hide" ), 7768 slideToggle: genFx( "toggle" ), 7769 fadeIn: { opacity: "show" }, 7770 fadeOut: { opacity: "hide" }, 7771 fadeToggle: { opacity: "toggle" } 7772}, function( name, props ) { 7773 jQuery.fn[ name ] = function( speed, easing, callback ) { 7774 return this.animate( props, speed, easing, callback ); 7775 }; 7776} ); 7777 7778jQuery.timers = []; 7779jQuery.fx.tick = function() { 7780 var timer, 7781 i = 0, 7782 timers = jQuery.timers; 7783 7784 fxNow = Date.now(); 7785 7786 for ( ; i < timers.length; i++ ) { 7787 timer = timers[ i ]; 7788 7789 // Run the timer and safely remove it when done (allowing for external removal) 7790 if ( !timer() && timers[ i ] === timer ) { 7791 timers.splice( i--, 1 ); 7792 } 7793 } 7794 7795 if ( !timers.length ) { 7796 jQuery.fx.stop(); 7797 } 7798 fxNow = undefined; 7799}; 7800 7801jQuery.fx.timer = function( timer ) { 7802 jQuery.timers.push( timer ); 7803 jQuery.fx.start(); 7804}; 7805 7806jQuery.fx.interval = 13; 7807jQuery.fx.start = function() { 7808 if ( inProgress ) { 7809 return; 7810 } 7811 7812 inProgress = true; 7813 schedule(); 7814}; 7815 7816jQuery.fx.stop = function() { 7817 inProgress = null; 7818}; 7819 7820jQuery.fx.speeds = { 7821 slow: 600, 7822 fast: 200, 7823 7824 // Default speed 7825 _default: 400 7826}; 7827 7828 7829// Based off of the plugin by Clint Helfers, with permission.
vendor: 5,177 bytes, lines 7830-8050
7830jQuery.fn.delay = function( time, type ) { 7831 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 7832 type = type || "fx"; 7833 7834 return this.queue( type, function( next, hooks ) { 7835 var timeout = window.setTimeout( next, time ); 7836 hooks.stop = function() { 7837 window.clearTimeout( timeout ); 7838 }; 7839 } ); 7840}; 7841 7842 7843( function() { 7844 var input = document.createElement( "input" ), 7845 select = document.createElement( "select" ), 7846 opt = select.appendChild( document.createElement( "option" ) ); 7847 7848 input.type = "checkbox"; 7849 7850 // Support: Android <=4.3 only 7851 // Default value for a checkbox should be "on" 7852 support.checkOn = input.value !== ""; 7853 7854 // Support: IE <=11 only 7855 // Must access selectedIndex to make default options select 7856 support.optSelected = opt.selected; 7857 7858 // Support: IE <=11 only 7859 // An input loses its value after becoming a radio 7860 input = document.createElement( "input" ); 7861 input.value = "t"; 7862 input.type = "radio"; 7863 support.radioValue = input.value === "t"; 7864} )(); 7865 7866 7867var boolHook, 7868 attrHandle = jQuery.expr.attrHandle; 7869 7870jQuery.fn.extend( { 7871 attr: function( name, value ) { 7872 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 7873 }, 7874 7875 removeAttr: function( name ) { 7876 return this.each( function() { 7877 jQuery.removeAttr( this, name ); 7878 } ); 7879 } 7880} ); 7881 7882jQuery.extend( { 7883 attr: function( elem, name, value ) { 7884 var ret, hooks, 7885 nType = elem.nodeType; 7886 7887 // Don't get/set attributes on text, comment and attribute nodes 7888 if ( nType === 3 || nType === 8 || nType === 2 ) { 7889 return; 7890 } 7891 7892 // Fallback to prop when attributes are not supported 7893 if ( typeof elem.getAttribute === "undefined" ) { 7894 return jQuery.prop( elem, name, value ); 7895 } 7896 7897 // Attribute hooks are determined by the lowercase version 7898 // Grab necessary hook if one is defined 7899 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7900 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 7901 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 7902 } 7903 7904 if ( value !== undefined ) { 7905 if ( value === null ) { 7906 jQuery.removeAttr( elem, name ); 7907 return; 7908 } 7909 7910 if ( hooks && "set" in hooks && 7911 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7912 return ret; 7913 } 7914 7915 elem.setAttribute( name, value + "" ); 7916 return value; 7917 } 7918 7919 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7920 return ret; 7921 } 7922 7923 ret = jQuery.find.attr( elem, name ); 7924 7925 // Non-existent attributes return null, we normalize to undefined 7926 return ret == null ? undefined : ret; 7927 }, 7928 7929 attrHooks: { 7930 type: { 7931 set: function( elem, value ) { 7932 if ( !support.radioValue && value === "radio" && 7933 nodeName( elem, "input" ) ) { 7934 var val = elem.value; 7935 elem.setAttribute( "type", value ); 7936 if ( val ) { 7937 elem.value = val; 7938 } 7939 return value; 7940 } 7941 } 7942 } 7943 }, 7944 7945 removeAttr: function( elem, value ) { 7946 var name, 7947 i = 0, 7948 7949 // Attribute names can contain non-HTML whitespace characters 7950 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 7951 attrNames = value && value.match( rnothtmlwhite ); 7952 7953 if ( attrNames && elem.nodeType === 1 ) { 7954 while ( ( name = attrNames[ i++ ] ) ) { 7955 elem.removeAttribute( name ); 7956 } 7957 } 7958 } 7959} ); 7960 7961// Hooks for boolean attributes 7962boolHook = { 7963 set: function( elem, value, name ) { 7964 if ( value === false ) { 7965 7966 // Remove boolean attributes when set to false 7967 jQuery.removeAttr( elem, name ); 7968 } else { 7969 elem.setAttribute( name, name ); 7970 } 7971 return name; 7972 } 7973}; 7974 7975jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 7976 var getter = attrHandle[ name ] || jQuery.find.attr; 7977 7978 attrHandle[ name ] = function( elem, name, isXML ) { 7979 var ret, handle, 7980 lowercaseName = name.toLowerCase(); 7981 7982 if ( !isXML ) { 7983 7984 // Avoid an infinite loop by temporarily removing this function from the getter 7985 handle = attrHandle[ lowercaseName ]; 7986 attrHandle[ lowercaseName ] = ret; 7987 ret = getter( elem, name, isXML ) != null ? 7988 lowercaseName : 7989 null; 7990 attrHandle[ lowercaseName ] = handle; 7991 } 7992 return ret; 7993 }; 7994} ); 7995 7996 7997 7998 7999var rfocusable = /^(?:input|select|textarea|button)$/i, 8000 rclickable = /^(?:a|area)$/i; 8001 8002jQuery.fn.extend( { 8003 prop: function( name, value ) { 8004 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 8005 }, 8006 8007 removeProp: function( name ) { 8008 return this.each( function() { 8009 delete this[ jQuery.propFix[ name ] || name ]; 8010 } ); 8011 } 8012} ); 8013 8014jQuery.extend( { 8015 prop: function( elem, name, value ) { 8016 var ret, hooks, 8017 nType = elem.nodeType; 8018 8019 // Don't get/set properties on text, comment and attribute nodes 8020 if ( nType === 3 || nType === 8 || nType === 2 ) { 8021 return; 8022 } 8023 8024 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8025 8026 // Fix name and attach hooks 8027 name = jQuery.propFix[ name ] || name; 8028 hooks = jQuery.propHooks[ name ]; 8029 } 8030 8031 if ( value !== undefined ) { 8032 if ( hooks && "set" in hooks && 8033 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8034 return ret; 8035 } 8036 8037 return ( elem[ name ] = value ); 8038 } 8039 8040 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8041 return ret; 8042 } 8043 8044 return elem[ name ]; 8045 }, 8046 8047 propHooks: { 8048 tabIndex: { 8049 get: function( elem ) { 8050
vendor: 6,126 bytes, lines 8051-8310
8051 // Support: IE <=9 - 11 only 8052 // elem.tabIndex doesn't always return the 8053 // correct value when it hasn't been explicitly set 8054 // Use proper attribute retrieval (trac-12072) 8055 var tabindex = jQuery.find.attr( elem, "tabindex" ); 8056 8057 if ( tabindex ) { 8058 return parseInt( tabindex, 10 ); 8059 } 8060 8061 if ( 8062 rfocusable.test( elem.nodeName ) || 8063 rclickable.test( elem.nodeName ) && 8064 elem.href 8065 ) { 8066 return 0; 8067 } 8068 8069 return -1; 8070 } 8071 } 8072 }, 8073 8074 propFix: { 8075 "for": "htmlFor", 8076 "class": "className" 8077 } 8078} ); 8079 8080// Support: IE <=11 only 8081// Accessing the selectedIndex property 8082// forces the browser to respect setting selected 8083// on the option 8084// The getter ensures a default option is selected 8085// when in an optgroup 8086// eslint rule "no-unused-expressions" is disabled for this code 8087// since it considers such accessions noop 8088if ( !support.optSelected ) { 8089 jQuery.propHooks.selected = { 8090 get: function( elem ) { 8091 8092 /* eslint no-unused-expressions: "off" */ 8093 8094 var parent = elem.parentNode; 8095 if ( parent && parent.parentNode ) { 8096 parent.parentNode.selectedIndex; 8097 } 8098 return null; 8099 }, 8100 set: function( elem ) { 8101 8102 /* eslint no-unused-expressions: "off" */ 8103 8104 var parent = elem.parentNode; 8105 if ( parent ) { 8106 parent.selectedIndex; 8107 8108 if ( parent.parentNode ) { 8109 parent.parentNode.selectedIndex; 8110 } 8111 } 8112 } 8113 }; 8114} 8115 8116jQuery.each( [ 8117 "tabIndex", 8118 "readOnly", 8119 "maxLength", 8120 "cellSpacing", 8121 "cellPadding", 8122 "rowSpan", 8123 "colSpan", 8124 "useMap", 8125 "frameBorder", 8126 "contentEditable" 8127], function() { 8128 jQuery.propFix[ this.toLowerCase() ] = this; 8129} ); 8130 8131 8132 8133 8134 // Strip and collapse whitespace according to HTML spec 8135 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 8136 function stripAndCollapse( value ) { 8137 var tokens = value.match( rnothtmlwhite ) || []; 8138 return tokens.join( " " ); 8139 } 8140 8141 8142function getClass( elem ) { 8143 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 8144} 8145 8146function classesToArray( value ) { 8147 if ( Array.isArray( value ) ) { 8148 return value; 8149 } 8150 if ( typeof value === "string" ) { 8151 return value.match( rnothtmlwhite ) || []; 8152 } 8153 return []; 8154} 8155 8156jQuery.fn.extend( { 8157 addClass: function( value ) { 8158 var classNames, cur, curValue, className, i, finalValue; 8159 8160 if ( isFunction( value ) ) { 8161 return this.each( function( j ) { 8162 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 8163 } ); 8164 } 8165 8166 classNames = classesToArray( value ); 8167 8168 if ( classNames.length ) { 8169 return this.each( function() { 8170 curValue = getClass( this ); 8171 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8172 8173 if ( cur ) { 8174 for ( i = 0; i < classNames.length; i++ ) { 8175 className = classNames[ i ]; 8176 if ( cur.indexOf( " " + className + " " ) < 0 ) { 8177 cur += className + " "; 8178 } 8179 } 8180 8181 // Only assign if different to avoid unneeded rendering. 8182 finalValue = stripAndCollapse( cur ); 8183 if ( curValue !== finalValue ) { 8184 this.setAttribute( "class", finalValue ); 8185 } 8186 } 8187 } ); 8188 } 8189 8190 return this; 8191 }, 8192 8193 removeClass: function( value ) { 8194 var classNames, cur, curValue, className, i, finalValue; 8195 8196 if ( isFunction( value ) ) { 8197 return this.each( function( j ) { 8198 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 8199 } ); 8200 } 8201 8202 if ( !arguments.length ) { 8203 return this.attr( "class", "" ); 8204 } 8205 8206 classNames = classesToArray( value ); 8207 8208 if ( classNames.length ) { 8209 return this.each( function() { 8210 curValue = getClass( this ); 8211 8212 // This expression is here for better compressibility (see addClass) 8213 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8214 8215 if ( cur ) { 8216 for ( i = 0; i < classNames.length; i++ ) { 8217 className = classNames[ i ]; 8218 8219 // Remove *all* instances 8220 while ( cur.indexOf( " " + className + " " ) > -1 ) { 8221 cur = cur.replace( " " + className + " ", " " ); 8222 } 8223 } 8224 8225 // Only assign if different to avoid unneeded rendering. 8226 finalValue = stripAndCollapse( cur ); 8227 if ( curValue !== finalValue ) { 8228 this.setAttribute( "class", finalValue ); 8229 } 8230 } 8231 } ); 8232 } 8233 8234 return this; 8235 }, 8236 8237 toggleClass: function( value, stateVal ) { 8238 var classNames, className, i, self, 8239 type = typeof value, 8240 isValidValue = type === "string" || Array.isArray( value ); 8241 8242 if ( isFunction( value ) ) { 8243 return this.each( function( i ) { 8244 jQuery( this ).toggleClass( 8245 value.call( this, i, getClass( this ), stateVal ), 8246 stateVal 8247 ); 8248 } ); 8249 } 8250 8251 if ( typeof stateVal === "boolean" && isValidValue ) { 8252 return stateVal ? this.addClass( value ) : this.removeClass( value ); 8253 } 8254 8255 classNames = classesToArray( value ); 8256 8257 return this.each( function() { 8258 if ( isValidValue ) { 8259 8260 // Toggle individual class names 8261 self = jQuery( this ); 8262 8263 for ( i = 0; i < classNames.length; i++ ) { 8264 className = classNames[ i ]; 8265 8266 // Check each className given, space separated list 8267 if ( self.hasClass( className ) ) { 8268 self.removeClass( className ); 8269 } else { 8270 self.addClass( className ); 8271 } 8272 } 8273 8274 // Toggle whole class name 8275 } else if ( value === undefined || type === "boolean" ) { 8276 className = getClass( this ); 8277 if ( className ) { 8278 8279 // Store className if set 8280 dataPriv.set( this, "__className__", className ); 8281 } 8282 8283 // If the element has a class name or if we're passed `false`, 8284 // then remove the whole classname (if there was one, the above saved it). 8285 // Otherwise bring back whatever was previously saved (if anything), 8286 // falling back to the empty string if nothing was stored. 8287 if ( this.setAttribute ) { 8288 this.setAttribute( "class", 8289 className || value === false ? 8290 "" : 8291 dataPriv.get( this, "__className__" ) || "" 8292 ); 8293 } 8294 } 8295 } ); 8296 }, 8297 8298 hasClass: function( selector ) { 8299 var className, elem, 8300 i = 0; 8301 8302 className = " " + selector + " "; 8303 while ( ( elem = this[ i++ ] ) ) { 8304 if ( elem.nodeType === 1 && 8305 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 8306 return true; 8307 } 8308 } 8309 8310 return false;
vendor: 1,385 bytes, lines 8311-8380
8311 } 8312} ); 8313 8314 8315 8316 8317var rreturn = /\r/g; 8318 8319jQuery.fn.extend( { 8320 val: function( value ) { 8321 var hooks, ret, valueIsFunction, 8322 elem = this[ 0 ]; 8323 8324 if ( !arguments.length ) { 8325 if ( elem ) { 8326 hooks = jQuery.valHooks[ elem.type ] || 8327 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 8328 8329 if ( hooks && 8330 "get" in hooks && 8331 ( ret = hooks.get( elem, "value" ) ) !== undefined 8332 ) { 8333 return ret; 8334 } 8335 8336 ret = elem.value; 8337 8338 // Handle most common string cases 8339 if ( typeof ret === "string" ) { 8340 return ret.replace( rreturn, "" ); 8341 } 8342 8343 // Handle cases where value is null/undef or number 8344 return ret == null ? "" : ret; 8345 } 8346 8347 return; 8348 } 8349 8350 valueIsFunction = isFunction( value ); 8351 8352 return this.each( function( i ) { 8353 var val; 8354 8355 if ( this.nodeType !== 1 ) { 8356 return; 8357 } 8358 8359 if ( valueIsFunction ) { 8360 val = value.call( this, i, jQuery( this ).val() ); 8361 } else { 8362 val = value; 8363 } 8364 8365 // Treat null/undefined as ""; convert numbers to string 8366 if ( val == null ) { 8367 val = ""; 8368 8369 } else if ( typeof val === "number" ) { 8370 val += ""; 8371 8372 } else if ( Array.isArray( val ) ) { 8373 val = jQuery.map( val, function( value ) { 8374 return value == null ? "" : value + ""; 8375 } ); 8376 } 8377 8378 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 8379 8380 // If set returns undefined, fall back to normal setting
vendor: 4,458 bytes, lines 8381-8566
8381 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 8382 this.value = val; 8383 } 8384 } ); 8385 } 8386} ); 8387 8388jQuery.extend( { 8389 valHooks: { 8390 option: { 8391 get: function( elem ) { 8392 8393 var val = jQuery.find.attr( elem, "value" ); 8394 return val != null ? 8395 val : 8396 8397 // Support: IE <=10 - 11 only 8398 // option.text throws exceptions (trac-14686, trac-14858) 8399 // Strip and collapse whitespace 8400 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8401 stripAndCollapse( jQuery.text( elem ) ); 8402 } 8403 }, 8404 select: { 8405 get: function( elem ) { 8406 var value, option, i, 8407 options = elem.options, 8408 index = elem.selectedIndex, 8409 one = elem.type === "select-one", 8410 values = one ? null : [], 8411 max = one ? index + 1 : options.length; 8412 8413 if ( index < 0 ) { 8414 i = max; 8415 8416 } else { 8417 i = one ? index : 0; 8418 } 8419 8420 // Loop through all the selected options 8421 for ( ; i < max; i++ ) { 8422 option = options[ i ]; 8423 8424 // Support: IE <=9 only 8425 // IE8-9 doesn't update selected after form reset (trac-2551) 8426 if ( ( option.selected || i === index ) && 8427 8428 // Don't return options that are disabled or in a disabled optgroup 8429 !option.disabled && 8430 ( !option.parentNode.disabled || 8431 !nodeName( option.parentNode, "optgroup" ) ) ) { 8432 8433 // Get the specific value for the option 8434 value = jQuery( option ).val(); 8435 8436 // We don't need an array for one selects 8437 if ( one ) { 8438 return value; 8439 } 8440 8441 // Multi-Selects return an array 8442 values.push( value ); 8443 } 8444 } 8445 8446 return values; 8447 }, 8448 8449 set: function( elem, value ) { 8450 var optionSet, option, 8451 options = elem.options, 8452 values = jQuery.makeArray( value ), 8453 i = options.length; 8454 8455 while ( i-- ) { 8456 option = options[ i ]; 8457 8458 /* eslint-disable no-cond-assign */ 8459 8460 if ( option.selected = 8461 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 8462 ) { 8463 optionSet = true; 8464 } 8465 8466 /* eslint-enable no-cond-assign */ 8467 } 8468 8469 // Force browsers to behave consistently when non-matching value is set 8470 if ( !optionSet ) { 8471 elem.selectedIndex = -1; 8472 } 8473 return values; 8474 } 8475 } 8476 } 8477} ); 8478 8479// Radios and checkboxes getter/setter 8480jQuery.each( [ "radio", "checkbox" ], function() { 8481 jQuery.valHooks[ this ] = { 8482 set: function( elem, value ) { 8483 if ( Array.isArray( value ) ) { 8484 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 8485 } 8486 } 8487 }; 8488 if ( !support.checkOn ) { 8489 jQuery.valHooks[ this ].get = function( elem ) { 8490 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 8491 }; 8492 } 8493} ); 8494 8495 8496 8497 8498// Return jQuery for attributes-only inclusion 8499var location = window.location; 8500 8501var nonce = { guid: Date.now() }; 8502 8503var rquery = ( /\?/ ); 8504 8505 8506 8507// Cross-browser xml parsing 8508jQuery.parseXML = function( data ) { 8509 var xml, parserErrorElem; 8510 if ( !data || typeof data !== "string" ) { 8511 return null; 8512 } 8513 8514 // Support: IE 9 - 11 only 8515 // IE throws on parseFromString with invalid input. 8516 try { 8517 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 8518 } catch ( e ) {} 8519 8520 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 8521 if ( !xml || parserErrorElem ) { 8522 jQuery.error( "Invalid XML: " + ( 8523 parserErrorElem ? 8524 jQuery.map( parserErrorElem.childNodes, function( el ) { 8525 return el.textContent; 8526 } ).join( "\n" ) : 8527 data 8528 ) ); 8529 } 8530 return xml; 8531}; 8532 8533 8534var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 8535 stopPropagationCallback = function( e ) { 8536 e.stopPropagation(); 8537 }; 8538 8539jQuery.extend( jQuery.event, { 8540 8541 trigger: function( event, data, elem, onlyHandlers ) { 8542 8543 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 8544 eventPath = [ elem || document ], 8545 type = hasOwn.call( event, "type" ) ? event.type : event, 8546 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 8547 8548 cur = lastElement = tmp = elem = elem || document; 8549 8550 // Don't do events on text and comment nodes 8551 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 8552 return; 8553 } 8554 8555 // focus/blur morphs to focusin/out; ensure we're not firing them right now 8556 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 8557 return; 8558 } 8559 8560 if ( type.indexOf( "." ) > -1 ) { 8561 8562 // Namespaced trigger; create a regexp to match event type in handle() 8563 namespaces = type.split( "." ); 8564 type = namespaces.shift(); 8565 namespaces.sort(); 8566 }
vendor: 6,524 bytes, lines 8567-8816
8567 ontype = type.indexOf( ":" ) < 0 && "on" + type; 8568 8569 // Caller can pass in a jQuery.Event object, Object, or just an event type string 8570 event = event[ jQuery.expando ] ? 8571 event : 8572 new jQuery.Event( type, typeof event === "object" && event ); 8573 8574 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 8575 event.isTrigger = onlyHandlers ? 2 : 3; 8576 event.namespace = namespaces.join( "." ); 8577 event.rnamespace = event.namespace ? 8578 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 8579 null; 8580 8581 // Clean up the event in case it is being reused 8582 event.result = undefined; 8583 if ( !event.target ) { 8584 event.target = elem; 8585 } 8586 8587 // Clone any incoming data and prepend the event, creating the handler arg list 8588 data = data == null ? 8589 [ event ] : 8590 jQuery.makeArray( data, [ event ] ); 8591 8592 // Allow special events to draw outside the lines 8593 special = jQuery.event.special[ type ] || {}; 8594 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 8595 return; 8596 } 8597 8598 // Determine event propagation path in advance, per W3C events spec (trac-9951) 8599 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 8600 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 8601 8602 bubbleType = special.delegateType || type; 8603 if ( !rfocusMorph.test( bubbleType + type ) ) { 8604 cur = cur.parentNode; 8605 } 8606 for ( ; cur; cur = cur.parentNode ) { 8607 eventPath.push( cur ); 8608 tmp = cur; 8609 } 8610 8611 // Only add window if we got to document (e.g., not plain obj or detached DOM) 8612 if ( tmp === ( elem.ownerDocument || document ) ) { 8613 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 8614 } 8615 } 8616 8617 // Fire handlers on the event path 8618 i = 0; 8619 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 8620 lastElement = cur; 8621 event.type = i > 1 ? 8622 bubbleType : 8623 special.bindType || type; 8624 8625 // jQuery handler 8626 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 8627 dataPriv.get( cur, "handle" ); 8628 if ( handle ) { 8629 handle.apply( cur, data ); 8630 } 8631 8632 // Native handler 8633 handle = ontype && cur[ ontype ]; 8634 if ( handle && handle.apply && acceptData( cur ) ) { 8635 event.result = handle.apply( cur, data ); 8636 if ( event.result === false ) { 8637 event.preventDefault(); 8638 } 8639 } 8640 } 8641 event.type = type; 8642 8643 // If nobody prevented the default action, do it now 8644 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 8645 8646 if ( ( !special._default || 8647 special._default.apply( eventPath.pop(), data ) === false ) && 8648 acceptData( elem ) ) { 8649 8650 // Call a native DOM method on the target with the same name as the event. 8651 // Don't do default actions on window, that's where global variables be (trac-6170) 8652 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 8653 8654 // Don't re-trigger an onFOO event when we call its FOO() method 8655 tmp = elem[ ontype ]; 8656 8657 if ( tmp ) { 8658 elem[ ontype ] = null; 8659 } 8660 8661 // Prevent re-triggering of the same event, since we already bubbled it above 8662 jQuery.event.triggered = type; 8663 8664 if ( event.isPropagationStopped() ) { 8665 lastElement.addEventListener( type, stopPropagationCallback ); 8666 } 8667 8668 elem[ type ](); 8669 8670 if ( event.isPropagationStopped() ) { 8671 lastElement.removeEventListener( type, stopPropagationCallback ); 8672 } 8673 8674 jQuery.event.triggered = undefined; 8675 8676 if ( tmp ) { 8677 elem[ ontype ] = tmp; 8678 } 8679 } 8680 } 8681 } 8682 8683 return event.result; 8684 }, 8685 8686 // Piggyback on a donor event to simulate a different one 8687 // Used only for `focus(in | out)` events 8688 simulate: function( type, elem, event ) { 8689 var e = jQuery.extend( 8690 new jQuery.Event(), 8691 event, 8692 { 8693 type: type, 8694 isSimulated: true 8695 } 8696 ); 8697 8698 jQuery.event.trigger( e, null, elem ); 8699 } 8700 8701} ); 8702 8703jQuery.fn.extend( { 8704 8705 trigger: function( type, data ) { 8706 return this.each( function() { 8707 jQuery.event.trigger( type, data, this ); 8708 } ); 8709 }, 8710 triggerHandler: function( type, data ) { 8711 var elem = this[ 0 ]; 8712 if ( elem ) { 8713 return jQuery.event.trigger( type, data, elem, true ); 8714 } 8715 } 8716} ); 8717 8718 8719var 8720 rbracket = /\[\]$/, 8721 rCRLF = /\r?\n/g, 8722 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8723 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8724 8725function buildParams( prefix, obj, traditional, add ) { 8726 var name; 8727 8728 if ( Array.isArray( obj ) ) { 8729 8730 // Serialize array item. 8731 jQuery.each( obj, function( i, v ) { 8732 if ( traditional || rbracket.test( prefix ) ) { 8733 8734 // Treat each array item as a scalar. 8735 add( prefix, v ); 8736 8737 } else { 8738 8739 // Item is non-scalar (array or object), encode its numeric index. 8740 buildParams( 8741 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 8742 v, 8743 traditional, 8744 add 8745 ); 8746 } 8747 } ); 8748 8749 } else if ( !traditional && toType( obj ) === "object" ) { 8750 8751 // Serialize object item. 8752 for ( name in obj ) { 8753 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8754 } 8755 8756 } else { 8757 8758 // Serialize scalar item. 8759 add( prefix, obj ); 8760 } 8761} 8762 8763// Serialize an array of form elements or a set of 8764// key/values into a query string 8765jQuery.param = function( a, traditional ) { 8766 var prefix, 8767 s = [], 8768 add = function( key, valueOrFunction ) { 8769 8770 // If value is a function, invoke it and use its return value 8771 var value = isFunction( valueOrFunction ) ? 8772 valueOrFunction() : 8773 valueOrFunction; 8774 8775 s[ s.length ] = encodeURIComponent( key ) + "=" + 8776 encodeURIComponent( value == null ? "" : value ); 8777 }; 8778 8779 if ( a == null ) { 8780 return ""; 8781 } 8782 8783 // If an array was passed in, assume that it is an array of form elements. 8784 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 8785 8786 // Serialize the form elements 8787 jQuery.each( a, function() { 8788 add( this.name, this.value ); 8789 } ); 8790 8791 } else { 8792 8793 // If traditional, encode the "old" way (the way 1.3.2 or older 8794 // did it), otherwise encode params recursively. 8795 for ( prefix in a ) { 8796 buildParams( prefix, a[ prefix ], traditional, add ); 8797 } 8798 } 8799 8800 // Return the resulting serialization 8801 return s.join( "&" ); 8802}; 8803 8804jQuery.fn.extend( { 8805 serialize: function() { 8806 return jQuery.param( this.serializeArray() ); 8807 }, 8808 serializeArray: function() { 8809 return this.map( function() { 8810 8811 // Can add propHook for "elements" to filter or add form elements 8812 var elements = jQuery.prop( this, "elements" ); 8813 return elements ? jQuery.makeArray( elements ) : this; 8814 } ).filter( function() { 8815 var type = this.type; 8816
vendor: 32,437 bytes, lines 8817-10070
8817 // Use .is( ":disabled" ) so that fieldset[disabled] works 8818 return this.name && !jQuery( this ).is( ":disabled" ) && 8819 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 8820 ( this.checked || !rcheckableType.test( type ) ); 8821 } ).map( function( _i, elem ) { 8822 var val = jQuery( this ).val(); 8823 8824 if ( val == null ) { 8825 return null; 8826 } 8827 8828 if ( Array.isArray( val ) ) { 8829 return jQuery.map( val, function( val ) { 8830 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8831 } ); 8832 } 8833 8834 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8835 } ).get(); 8836 } 8837} ); 8838 8839 8840var 8841 r20 = /%20/g, 8842 rhash = /#.*$/, 8843 rantiCache = /([?&])_=[^&]*/, 8844 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 8845 8846 // trac-7653, trac-8125, trac-8152: local protocol detection 8847 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 8848 rnoContent = /^(?:GET|HEAD)$/, 8849 rprotocol = /^\/\//, 8850 8851 /* Prefilters 8852 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 8853 * 2) These are called: 8854 * - BEFORE asking for a transport 8855 * - AFTER param serialization (s.data is a string if s.processData is true) 8856 * 3) key is the dataType 8857 * 4) the catchall symbol "*" can be used 8858 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 8859 */ 8860 prefilters = {}, 8861 8862 /* Transports bindings 8863 * 1) key is the dataType 8864 * 2) the catchall symbol "*" can be used 8865 * 3) selection will start with transport dataType and THEN go to "*" if needed 8866 */ 8867 transports = {}, 8868 8869 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 8870 allTypes = "*/".concat( "*" ), 8871 8872 // Anchor tag for parsing the document origin 8873 originAnchor = document.createElement( "a" ); 8874 8875originAnchor.href = location.href; 8876 8877// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 8878function addToPrefiltersOrTransports( structure ) { 8879 8880 // dataTypeExpression is optional and defaults to "*" 8881 return function( dataTypeExpression, func ) { 8882 8883 if ( typeof dataTypeExpression !== "string" ) { 8884 func = dataTypeExpression; 8885 dataTypeExpression = "*"; 8886 } 8887 8888 var dataType, 8889 i = 0, 8890 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 8891 8892 if ( isFunction( func ) ) { 8893 8894 // For each dataType in the dataTypeExpression 8895 while ( ( dataType = dataTypes[ i++ ] ) ) { 8896 8897 // Prepend if requested 8898 if ( dataType[ 0 ] === "+" ) { 8899 dataType = dataType.slice( 1 ) || "*"; 8900 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 8901 8902 // Otherwise append 8903 } else { 8904 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 8905 } 8906 } 8907 } 8908 }; 8909} 8910 8911// Base inspection function for prefilters and transports 8912function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 8913 8914 var inspected = {}, 8915 seekingTransport = ( structure === transports ); 8916 8917 function inspect( dataType ) { 8918 var selected; 8919 inspected[ dataType ] = true; 8920 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 8921 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 8922 if ( typeof dataTypeOrTransport === "string" && 8923 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 8924 8925 options.dataTypes.unshift( dataTypeOrTransport ); 8926 inspect( dataTypeOrTransport ); 8927 return false; 8928 } else if ( seekingTransport ) { 8929 return !( selected = dataTypeOrTransport ); 8930 } 8931 } ); 8932 return selected; 8933 } 8934 8935 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 8936} 8937 8938// A special extend for ajax options 8939// that takes "flat" options (not to be deep extended) 8940// Fixes trac-9887 8941function ajaxExtend( target, src ) { 8942 var key, deep, 8943 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 8944 8945 for ( key in src ) { 8946 if ( src[ key ] !== undefined ) { 8947 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 8948 } 8949 } 8950 if ( deep ) { 8951 jQuery.extend( true, target, deep ); 8952 } 8953 8954 return target; 8955} 8956 8957/* Handles responses to an ajax request: 8958 * - finds the right dataType (mediates between content-type and expected dataType) 8959 * - returns the corresponding response 8960 */ 8961function ajaxHandleResponses( s, jqXHR, responses ) { 8962 8963 var ct, type, finalDataType, firstDataType, 8964 contents = s.contents, 8965 dataTypes = s.dataTypes; 8966 8967 // Remove auto dataType and get content-type in the process 8968 while ( dataTypes[ 0 ] === "*" ) { 8969 dataTypes.shift(); 8970 if ( ct === undefined ) { 8971 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 8972 } 8973 } 8974 8975 // Check if we're dealing with a known content-type 8976 if ( ct ) { 8977 for ( type in contents ) { 8978 if ( contents[ type ] && contents[ type ].test( ct ) ) { 8979 dataTypes.unshift( type ); 8980 break; 8981 } 8982 } 8983 } 8984 8985 // Check to see if we have a response for the expected dataType 8986 if ( dataTypes[ 0 ] in responses ) { 8987 finalDataType = dataTypes[ 0 ]; 8988 } else { 8989 8990 // Try convertible dataTypes 8991 for ( type in responses ) { 8992 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 8993 finalDataType = type; 8994 break; 8995 } 8996 if ( !firstDataType ) { 8997 firstDataType = type; 8998 } 8999 } 9000 9001 // Or just use first one 9002 finalDataType = finalDataType || firstDataType; 9003 } 9004 9005 // If we found a dataType 9006 // We add the dataType to the list if needed 9007 // and return the corresponding response 9008 if ( finalDataType ) { 9009 if ( finalDataType !== dataTypes[ 0 ] ) { 9010 dataTypes.unshift( finalDataType ); 9011 } 9012 return responses[ finalDataType ]; 9013 } 9014} 9015 9016/* Chain conversions given the request and the original response 9017 * Also sets the responseXXX fields on the jqXHR instance 9018 */ 9019function ajaxConvert( s, response, jqXHR, isSuccess ) { 9020 var conv2, current, conv, tmp, prev, 9021 converters = {}, 9022 9023 // Work with a copy of dataTypes in case we need to modify it for conversion 9024 dataTypes = s.dataTypes.slice(); 9025 9026 // Create converters map with lowercased keys 9027 if ( dataTypes[ 1 ] ) { 9028 for ( conv in s.converters ) { 9029 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 9030 } 9031 } 9032 9033 current = dataTypes.shift(); 9034 9035 // Convert to each sequential dataType 9036 while ( current ) { 9037 9038 if ( s.responseFields[ current ] ) { 9039 jqXHR[ s.responseFields[ current ] ] = response; 9040 } 9041 9042 // Apply the dataFilter if provided 9043 if ( !prev && isSuccess && s.dataFilter ) { 9044 response = s.dataFilter( response, s.dataType ); 9045 } 9046 9047 prev = current; 9048 current = dataTypes.shift(); 9049 9050 if ( current ) { 9051 9052 // There's only work to do if current dataType is non-auto 9053 if ( current === "*" ) { 9054 9055 current = prev; 9056 9057 // Convert response if prev dataType is non-auto and differs from current 9058 } else if ( prev !== "*" && prev !== current ) { 9059 9060 // Seek a direct converter 9061 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 9062 9063 // If none found, seek a pair 9064 if ( !conv ) { 9065 for ( conv2 in converters ) { 9066 9067 // If conv2 outputs current 9068 tmp = conv2.split( " " ); 9069 if ( tmp[ 1 ] === current ) { 9070 9071 // If prev can be converted to accepted input 9072 conv = converters[ prev + " " + tmp[ 0 ] ] || 9073 converters[ "* " + tmp[ 0 ] ]; 9074 if ( conv ) { 9075 9076 // Condense equivalence converters 9077 if ( conv === true ) { 9078 conv = converters[ conv2 ]; 9079 9080 // Otherwise, insert the intermediate dataType 9081 } else if ( converters[ conv2 ] !== true ) { 9082 current = tmp[ 0 ]; 9083 dataTypes.unshift( tmp[ 1 ] ); 9084 } 9085 break; 9086 } 9087 } 9088 } 9089 } 9090 9091 // Apply converter (if not an equivalence) 9092 if ( conv !== true ) { 9093 9094 // Unless errors are allowed to bubble, catch and return them 9095 if ( conv && s.throws ) { 9096 response = conv( response ); 9097 } else { 9098 try { 9099 response = conv( response ); 9100 } catch ( e ) { 9101 return { 9102 state: "parsererror", 9103 error: conv ? e : "No conversion from " + prev + " to " + current 9104 }; 9105 } 9106 } 9107 } 9108 } 9109 } 9110 } 9111 9112 return { state: "success", data: response }; 9113} 9114 9115jQuery.extend( { 9116 9117 // Counter for holding the number of active queries 9118 active: 0, 9119 9120 // Last-Modified header cache for next request 9121 lastModified: {}, 9122 etag: {}, 9123 9124 ajaxSettings: { 9125 url: location.href, 9126 type: "GET", 9127 isLocal: rlocalProtocol.test( location.protocol ), 9128 global: true, 9129 processData: true, 9130 async: true, 9131 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9132 9133 /* 9134 timeout: 0, 9135 data: null, 9136 dataType: null, 9137 username: null, 9138 password: null, 9139 cache: null, 9140 throws: false, 9141 traditional: false, 9142 headers: {}, 9143 */ 9144 9145 accepts: { 9146 "*": allTypes, 9147 text: "text/plain", 9148 html: "text/html", 9149 xml: "application/xml, text/xml", 9150 json: "application/json, text/javascript" 9151 }, 9152 9153 contents: { 9154 xml: /\bxml\b/, 9155 html: /\bhtml/, 9156 json: /\bjson\b/ 9157 }, 9158 9159 responseFields: { 9160 xml: "responseXML", 9161 text: "responseText", 9162 json: "responseJSON" 9163 }, 9164 9165 // Data converters 9166 // Keys separate source (or catchall "*") and destination types with a single space 9167 converters: { 9168 9169 // Convert anything to text 9170 "* text": String, 9171 9172 // Text to html (true = no transformation) 9173 "text html": true, 9174 9175 // Evaluate text as a json expression 9176 "text json": JSON.parse, 9177 9178 // Parse text as xml 9179 "text xml": jQuery.parseXML 9180 }, 9181 9182 // For options that shouldn't be deep extended: 9183 // you can add your own custom options here if 9184 // and when you create one that shouldn't be 9185 // deep extended (see ajaxExtend) 9186 flatOptions: { 9187 url: true, 9188 context: true 9189 } 9190 }, 9191 9192 // Creates a full fledged settings object into target 9193 // with both ajaxSettings and settings fields. 9194 // If target is omitted, writes into ajaxSettings. 9195 ajaxSetup: function( target, settings ) { 9196 return settings ? 9197 9198 // Building a settings object 9199 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 9200 9201 // Extending ajaxSettings 9202 ajaxExtend( jQuery.ajaxSettings, target ); 9203 }, 9204 9205 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 9206 ajaxTransport: addToPrefiltersOrTransports( transports ), 9207 9208 // Main method 9209 ajax: function( url, options ) { 9210 9211 // If url is an object, simulate pre-1.5 signature 9212 if ( typeof url === "object" ) { 9213 options = url; 9214 url = undefined; 9215 } 9216 9217 // Force options to be an object 9218 options = options || {}; 9219 9220 var transport, 9221 9222 // URL without anti-cache param 9223 cacheURL, 9224 9225 // Response headers 9226 responseHeadersString, 9227 responseHeaders, 9228 9229 // timeout handle 9230 timeoutTimer, 9231 9232 // Url cleanup var 9233 urlAnchor, 9234 9235 // Request state (becomes false upon send and true upon completion) 9236 completed, 9237 9238 // To know if global events are to be dispatched 9239 fireGlobals, 9240 9241 // Loop variable 9242 i, 9243 9244 // uncached part of the url 9245 uncached, 9246 9247 // Create the final options object 9248 s = jQuery.ajaxSetup( {}, options ), 9249 9250 // Callbacks context 9251 callbackContext = s.context || s, 9252 9253 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9254 globalEventContext = s.context && 9255 ( callbackContext.nodeType || callbackContext.jquery ) ? 9256 jQuery( callbackContext ) : 9257 jQuery.event, 9258 9259 // Deferreds 9260 deferred = jQuery.Deferred(), 9261 completeDeferred = jQuery.Callbacks( "once memory" ), 9262 9263 // Status-dependent callbacks 9264 statusCode = s.statusCode || {}, 9265 9266 // Headers (they are sent all at once) 9267 requestHeaders = {}, 9268 requestHeadersNames = {}, 9269 9270 // Default abort message 9271 strAbort = "canceled", 9272 9273 // Fake xhr 9274 jqXHR = { 9275 readyState: 0, 9276 9277 // Builds headers hashtable if needed 9278 getResponseHeader: function( key ) { 9279 var match; 9280 if ( completed ) { 9281 if ( !responseHeaders ) { 9282 responseHeaders = {}; 9283 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 9284 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 9285 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 9286 .concat( match[ 2 ] ); 9287 } 9288 } 9289 match = responseHeaders[ key.toLowerCase() + " " ]; 9290 } 9291 return match == null ? null : match.join( ", " ); 9292 }, 9293 9294 // Raw string 9295 getAllResponseHeaders: function() { 9296 return completed ? responseHeadersString : null; 9297 }, 9298 9299 // Caches the header 9300 setRequestHeader: function( name, value ) { 9301 if ( completed == null ) { 9302 name = requestHeadersNames[ name.toLowerCase() ] = 9303 requestHeadersNames[ name.toLowerCase() ] || name; 9304 requestHeaders[ name ] = value; 9305 } 9306 return this; 9307 }, 9308 9309 // Overrides response content-type header 9310 overrideMimeType: function( type ) { 9311 if ( completed == null ) { 9312 s.mimeType = type; 9313 } 9314 return this; 9315 }, 9316 9317 // Status-dependent callbacks 9318 statusCode: function( map ) { 9319 var code; 9320 if ( map ) { 9321 if ( completed ) { 9322 9323 // Execute the appropriate callbacks 9324 jqXHR.always( map[ jqXHR.status ] ); 9325 } else { 9326 9327 // Lazy-add the new callbacks in a way that preserves old ones 9328 for ( code in map ) { 9329 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 9330 } 9331 } 9332 } 9333 return this; 9334 }, 9335 9336 // Cancel the request 9337 abort: function( statusText ) { 9338 var finalText = statusText || strAbort; 9339 if ( transport ) { 9340 transport.abort( finalText ); 9341 } 9342 done( 0, finalText ); 9343 return this; 9344 } 9345 }; 9346 9347 // Attach deferreds 9348 deferred.promise( jqXHR ); 9349 9350 // Add protocol if not provided (prefilters might expect it) 9351 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 9352 // We also use the url parameter if available 9353 s.url = ( ( url || s.url || location.href ) + "" ) 9354 .replace( rprotocol, location.protocol + "//" ); 9355 9356 // Alias method option to type as per ticket trac-12004 9357 s.type = options.method || options.type || s.method || s.type; 9358 9359 // Extract dataTypes list 9360 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 9361 9362 // A cross-domain request is in order when the origin doesn't match the current origin. 9363 if ( s.crossDomain == null ) { 9364 urlAnchor = document.createElement( "a" ); 9365 9366 // Support: IE <=8 - 11, Edge 12 - 15 9367 // IE throws exception on accessing the href property if url is malformed, 9368 // e.g. http://example.com:80x/ 9369 try { 9370 urlAnchor.href = s.url; 9371 9372 // Support: IE <=8 - 11 only 9373 // Anchor's host property isn't correctly set when s.url is relative 9374 urlAnchor.href = urlAnchor.href; 9375 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 9376 urlAnchor.protocol + "//" + urlAnchor.host; 9377 } catch ( e ) { 9378 9379 // If there is an error parsing the URL, assume it is crossDomain, 9380 // it can be rejected by the transport if it is invalid 9381 s.crossDomain = true; 9382 } 9383 } 9384 9385 // Convert data if not already a string 9386 if ( s.data && s.processData && typeof s.data !== "string" ) { 9387 s.data = jQuery.param( s.data, s.traditional ); 9388 } 9389 9390 // Apply prefilters 9391 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 9392 9393 // If request was aborted inside a prefilter, stop there 9394 if ( completed ) { 9395 return jqXHR; 9396 } 9397 9398 // We can fire global events as of now if asked to 9399 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 9400 fireGlobals = jQuery.event && s.global; 9401 9402 // Watch for a new set of requests 9403 if ( fireGlobals && jQuery.active++ === 0 ) { 9404 jQuery.event.trigger( "ajaxStart" ); 9405 } 9406 9407 // Uppercase the type 9408 s.type = s.type.toUpperCase(); 9409 9410 // Determine if request has content 9411 s.hasContent = !rnoContent.test( s.type ); 9412 9413 // Save the URL in case we're toying with the If-Modified-Since 9414 // and/or If-None-Match header later on 9415 // Remove hash to simplify url manipulation 9416 cacheURL = s.url.replace( rhash, "" ); 9417 9418 // More options handling for requests with no content 9419 if ( !s.hasContent ) { 9420 9421 // Remember the hash so we can put it back 9422 uncached = s.url.slice( cacheURL.length ); 9423 9424 // If data is available and should be processed, append data to url 9425 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 9426 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 9427 9428 // trac-9682: remove data so that it's not used in an eventual retry 9429 delete s.data; 9430 } 9431 9432 // Add or update anti-cache param if needed 9433 if ( s.cache === false ) { 9434 cacheURL = cacheURL.replace( rantiCache, "$1" ); 9435 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 9436 uncached; 9437 } 9438 9439 // Put hash and anti-cache on the URL that will be requested (gh-1732) 9440 s.url = cacheURL + uncached; 9441 9442 // Change '%20' to '+' if this is encoded form body content (gh-2658) 9443 } else if ( s.data && s.processData && 9444 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 9445 s.data = s.data.replace( r20, "+" ); 9446 } 9447 9448 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9449 if ( s.ifModified ) { 9450 if ( jQuery.lastModified[ cacheURL ] ) { 9451 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 9452 } 9453 if ( jQuery.etag[ cacheURL ] ) { 9454 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 9455 } 9456 } 9457 9458 // Set the correct header, if data is being sent 9459 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 9460 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 9461 } 9462 9463 // Set the Accepts header for the server, depending on the dataType 9464 jqXHR.setRequestHeader( 9465 "Accept", 9466 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 9467 s.accepts[ s.dataTypes[ 0 ] ] + 9468 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 9469 s.accepts[ "*" ] 9470 ); 9471 9472 // Check for headers option 9473 for ( i in s.headers ) { 9474 jqXHR.setRequestHeader( i, s.headers[ i ] ); 9475 } 9476 9477 // Allow custom headers/mimetypes and early abort 9478 if ( s.beforeSend && 9479 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 9480 9481 // Abort if not done already and return 9482 return jqXHR.abort(); 9483 } 9484 9485 // Aborting is no longer a cancellation 9486 strAbort = "abort"; 9487 9488 // Install callbacks on deferreds 9489 completeDeferred.add( s.complete ); 9490 jqXHR.done( s.success ); 9491 jqXHR.fail( s.error ); 9492 9493 // Get transport 9494 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 9495 9496 // If no transport, we auto-abort 9497 if ( !transport ) { 9498 done( -1, "No Transport" ); 9499 } else { 9500 jqXHR.readyState = 1; 9501 9502 // Send global event 9503 if ( fireGlobals ) { 9504 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 9505 } 9506 9507 // If request was aborted inside ajaxSend, stop there 9508 if ( completed ) { 9509 return jqXHR; 9510 } 9511 9512 // Timeout 9513 if ( s.async && s.timeout > 0 ) { 9514 timeoutTimer = window.setTimeout( function() { 9515 jqXHR.abort( "timeout" ); 9516 }, s.timeout ); 9517 } 9518 9519 try { 9520 completed = false; 9521 transport.send( requestHeaders, done ); 9522 } catch ( e ) { 9523 9524 // Rethrow post-completion exceptions 9525 if ( completed ) { 9526 throw e; 9527 } 9528 9529 // Propagate others as results 9530 done( -1, e ); 9531 } 9532 } 9533 9534 // Callback for when everything is done 9535 function done( status, nativeStatusText, responses, headers ) { 9536 var isSuccess, success, error, response, modified, 9537 statusText = nativeStatusText; 9538 9539 // Ignore repeat invocations 9540 if ( completed ) { 9541 return; 9542 } 9543 9544 completed = true; 9545 9546 // Clear timeout if it exists 9547 if ( timeoutTimer ) { 9548 window.clearTimeout( timeoutTimer ); 9549 } 9550 9551 // Dereference transport for early garbage collection 9552 // (no matter how long the jqXHR object will be used) 9553 transport = undefined; 9554 9555 // Cache response headers 9556 responseHeadersString = headers || ""; 9557 9558 // Set readyState 9559 jqXHR.readyState = status > 0 ? 4 : 0; 9560 9561 // Determine if successful 9562 isSuccess = status >= 200 && status < 300 || status === 304; 9563 9564 // Get response data 9565 if ( responses ) { 9566 response = ajaxHandleResponses( s, jqXHR, responses ); 9567 } 9568 9569 // Use a noop converter for missing script but not if jsonp 9570 if ( !isSuccess && 9571 jQuery.inArray( "script", s.dataTypes ) > -1 && 9572 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 9573 s.converters[ "text script" ] = function() {}; 9574 } 9575 9576 // Convert no matter what (that way responseXXX fields are always set) 9577 response = ajaxConvert( s, response, jqXHR, isSuccess ); 9578 9579 // If successful, handle type chaining 9580 if ( isSuccess ) { 9581 9582 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9583 if ( s.ifModified ) { 9584 modified = jqXHR.getResponseHeader( "Last-Modified" ); 9585 if ( modified ) { 9586 jQuery.lastModified[ cacheURL ] = modified; 9587 } 9588 modified = jqXHR.getResponseHeader( "etag" ); 9589 if ( modified ) { 9590 jQuery.etag[ cacheURL ] = modified; 9591 } 9592 } 9593 9594 // if no content 9595 if ( status === 204 || s.type === "HEAD" ) { 9596 statusText = "nocontent"; 9597 9598 // if not modified 9599 } else if ( status === 304 ) { 9600 statusText = "notmodified"; 9601 9602 // If we have data, let's convert it 9603 } else { 9604 statusText = response.state; 9605 success = response.data; 9606 error = response.error; 9607 isSuccess = !error; 9608 } 9609 } else { 9610 9611 // Extract error from statusText and normalize for non-aborts 9612 error = statusText; 9613 if ( status || !statusText ) { 9614 statusText = "error"; 9615 if ( status < 0 ) { 9616 status = 0; 9617 } 9618 } 9619 } 9620 9621 // Set data for the fake xhr object 9622 jqXHR.status = status; 9623 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 9624 9625 // Success/Error 9626 if ( isSuccess ) { 9627 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 9628 } else { 9629 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 9630 } 9631 9632 // Status-dependent callbacks 9633 jqXHR.statusCode( statusCode ); 9634 statusCode = undefined; 9635 9636 if ( fireGlobals ) { 9637 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 9638 [ jqXHR, s, isSuccess ? success : error ] ); 9639 } 9640 9641 // Complete 9642 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 9643 9644 if ( fireGlobals ) { 9645 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 9646 9647 // Handle the global AJAX counter 9648 if ( !( --jQuery.active ) ) { 9649 jQuery.event.trigger( "ajaxStop" ); 9650 } 9651 } 9652 } 9653 9654 return jqXHR; 9655 }, 9656 9657 getJSON: function( url, data, callback ) { 9658 return jQuery.get( url, data, callback, "json" ); 9659 }, 9660 9661 getScript: function( url, callback ) { 9662 return jQuery.get( url, undefined, callback, "script" ); 9663 } 9664} ); 9665 9666jQuery.each( [ "get", "post" ], function( _i, method ) { 9667 jQuery[ method ] = function( url, data, callback, type ) { 9668 9669 // Shift arguments if data argument was omitted 9670 if ( isFunction( data ) ) { 9671 type = type || callback; 9672 callback = data; 9673 data = undefined; 9674 } 9675 9676 // The url can be an options object (which then must have .url) 9677 return jQuery.ajax( jQuery.extend( { 9678 url: url, 9679 type: method, 9680 dataType: type, 9681 data: data, 9682 success: callback 9683 }, jQuery.isPlainObject( url ) && url ) ); 9684 }; 9685} ); 9686 9687jQuery.ajaxPrefilter( function( s ) { 9688 var i; 9689 for ( i in s.headers ) { 9690 if ( i.toLowerCase() === "content-type" ) { 9691 s.contentType = s.headers[ i ] || ""; 9692 } 9693 } 9694} ); 9695 9696 9697jQuery._evalUrl = function( url, options, doc ) { 9698 return jQuery.ajax( { 9699 url: url, 9700 9701 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 9702 type: "GET", 9703 dataType: "script", 9704 cache: true, 9705 async: false, 9706 global: false, 9707 9708 // Only evaluate the response if it is successful (gh-4126) 9709 // dataFilter is not invoked for failure responses, so using it instead 9710 // of the default converter is kludgy but it works. 9711 converters: { 9712 "text script": function() {} 9713 }, 9714 dataFilter: function( response ) { 9715 jQuery.globalEval( response, options, doc ); 9716 } 9717 } ); 9718}; 9719 9720 9721jQuery.fn.extend( { 9722 wrapAll: function( html ) { 9723 var wrap; 9724 9725 if ( this[ 0 ] ) { 9726 if ( isFunction( html ) ) { 9727 html = html.call( this[ 0 ] ); 9728 } 9729 9730 // The elements to wrap the target around 9731 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 9732 9733 if ( this[ 0 ].parentNode ) { 9734 wrap.insertBefore( this[ 0 ] ); 9735 } 9736 9737 wrap.map( function() { 9738 var elem = this; 9739 9740 while ( elem.firstElementChild ) { 9741 elem = elem.firstElementChild; 9742 } 9743 9744 return elem; 9745 } ).append( this ); 9746 } 9747 9748 return this; 9749 }, 9750 9751 wrapInner: function( html ) { 9752 if ( isFunction( html ) ) { 9753 return this.each( function( i ) { 9754 jQuery( this ).wrapInner( html.call( this, i ) ); 9755 } ); 9756 } 9757 9758 return this.each( function() { 9759 var self = jQuery( this ), 9760 contents = self.contents(); 9761 9762 if ( contents.length ) { 9763 contents.wrapAll( html ); 9764 9765 } else { 9766 self.append( html ); 9767 } 9768 } ); 9769 }, 9770 9771 wrap: function( html ) { 9772 var htmlIsFunction = isFunction( html ); 9773 9774 return this.each( function( i ) { 9775 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 9776 } ); 9777 }, 9778 9779 unwrap: function( selector ) { 9780 this.parent( selector ).not( "body" ).each( function() { 9781 jQuery( this ).replaceWith( this.childNodes ); 9782 } ); 9783 return this; 9784 } 9785} ); 9786 9787 9788jQuery.expr.pseudos.hidden = function( elem ) { 9789 return !jQuery.expr.pseudos.visible( elem ); 9790}; 9791jQuery.expr.pseudos.visible = function( elem ) { 9792 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 9793}; 9794 9795 9796 9797 9798jQuery.ajaxSettings.xhr = function() { 9799 try { 9800 return new window.XMLHttpRequest(); 9801 } catch ( e ) {} 9802}; 9803 9804var xhrSuccessStatus = { 9805 9806 // File protocol always yields status code 0, assume 200 9807 0: 200, 9808 9809 // Support: IE <=9 only 9810 // trac-1450: sometimes IE returns 1223 when it should be 204 9811 1223: 204 9812 }, 9813 xhrSupported = jQuery.ajaxSettings.xhr(); 9814 9815support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 9816support.ajax = xhrSupported = !!xhrSupported; 9817 9818jQuery.ajaxTransport( function( options ) { 9819 var callback, errorCallback; 9820 9821 // Cross domain only allowed if supported through XMLHttpRequest 9822 if ( support.cors || xhrSupported && !options.crossDomain ) { 9823 return { 9824 send: function( headers, complete ) { 9825 var i, 9826 xhr = options.xhr(); 9827 9828 xhr.open( 9829 options.type, 9830 options.url, 9831 options.async, 9832 options.username, 9833 options.password 9834 ); 9835 9836 // Apply custom fields if provided 9837 if ( options.xhrFields ) { 9838 for ( i in options.xhrFields ) { 9839 xhr[ i ] = options.xhrFields[ i ]; 9840 } 9841 } 9842 9843 // Override mime type if needed 9844 if ( options.mimeType && xhr.overrideMimeType ) { 9845 xhr.overrideMimeType( options.mimeType ); 9846 } 9847 9848 // X-Requested-With header 9849 // For cross-domain requests, seeing as conditions for a preflight are 9850 // akin to a jigsaw puzzle, we simply never set it to be sure. 9851 // (it can always be set on a per-request basis or even using ajaxSetup) 9852 // For same-domain requests, won't change header if already provided. 9853 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 9854 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 9855 } 9856 9857 // Set headers 9858 for ( i in headers ) { 9859 xhr.setRequestHeader( i, headers[ i ] ); 9860 } 9861 9862 // Callback 9863 callback = function( type ) { 9864 return function() { 9865 if ( callback ) { 9866 callback = errorCallback = xhr.onload = 9867 xhr.onerror = xhr.onabort = xhr.ontimeout = 9868 xhr.onreadystatechange = null; 9869 9870 if ( type === "abort" ) { 9871 xhr.abort(); 9872 } else if ( type === "error" ) { 9873 9874 // Support: IE <=9 only 9875 // On a manual native abort, IE9 throws 9876 // errors on any property access that is not readyState 9877 if ( typeof xhr.status !== "number" ) { 9878 complete( 0, "error" ); 9879 } else { 9880 complete( 9881 9882 // File: protocol always yields status 0; see trac-8605, trac-14207 9883 xhr.status, 9884 xhr.statusText 9885 ); 9886 } 9887 } else { 9888 complete( 9889 xhrSuccessStatus[ xhr.status ] || xhr.status, 9890 xhr.statusText, 9891 9892 // Support: IE <=9 only 9893 // IE9 has no XHR2 but throws on binary (trac-11426) 9894 // For XHR2 non-text, let the caller handle it (gh-2498) 9895 ( xhr.responseType || "text" ) !== "text" || 9896 typeof xhr.responseText !== "string" ? 9897 { binary: xhr.response } : 9898 { text: xhr.responseText }, 9899 xhr.getAllResponseHeaders() 9900 ); 9901 } 9902 } 9903 }; 9904 }; 9905 9906 // Listen to events 9907 xhr.onload = callback(); 9908 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 9909 9910 // Support: IE 9 only 9911 // Use onreadystatechange to replace onabort 9912 // to handle uncaught aborts 9913 if ( xhr.onabort !== undefined ) { 9914 xhr.onabort = errorCallback; 9915 } else { 9916 xhr.onreadystatechange = function() { 9917 9918 // Check readyState before timeout as it changes 9919 if ( xhr.readyState === 4 ) { 9920 9921 // Allow onerror to be called first, 9922 // but that will not handle a native abort 9923 // Also, save errorCallback to a variable 9924 // as xhr.onerror cannot be accessed 9925 window.setTimeout( function() { 9926 if ( callback ) { 9927 errorCallback(); 9928 } 9929 } ); 9930 } 9931 }; 9932 } 9933 9934 // Create the abort callback 9935 callback = callback( "abort" ); 9936 9937 try { 9938 9939 // Do send the request (this may raise an exception) 9940 xhr.send( options.hasContent && options.data || null ); 9941 } catch ( e ) { 9942 9943 // trac-14683: Only rethrow if this hasn't been notified as an error yet 9944 if ( callback ) { 9945 throw e; 9946 } 9947 } 9948 }, 9949 9950 abort: function() { 9951 if ( callback ) { 9952 callback(); 9953 } 9954 } 9955 }; 9956 } 9957} ); 9958 9959 9960 9961 9962// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 9963jQuery.ajaxPrefilter( function( s ) { 9964 if ( s.crossDomain ) { 9965 s.contents.script = false; 9966 } 9967} ); 9968 9969// Install script dataType 9970jQuery.ajaxSetup( { 9971 accepts: { 9972 script: "text/javascript, application/javascript, " + 9973 "application/ecmascript, application/x-ecmascript" 9974 }, 9975 contents: { 9976 script: /\b(?:java|ecma)script\b/ 9977 }, 9978 converters: { 9979 "text script": function( text ) { 9980 jQuery.globalEval( text ); 9981 return text; 9982 } 9983 } 9984} ); 9985 9986// Handle cache's special case and crossDomain 9987jQuery.ajaxPrefilter( "script", function( s ) { 9988 if ( s.cache === undefined ) { 9989 s.cache = false; 9990 } 9991 if ( s.crossDomain ) { 9992 s.type = "GET"; 9993 } 9994} ); 9995 9996// Bind script tag hack transport 9997jQuery.ajaxTransport( "script", function( s ) { 9998 9999 // This transport only deals with cross domain or forced-by-attrs requests 10000 if ( s.crossDomain || s.scriptAttrs ) { 10001 var script, callback; 10002 return { 10003 send: function( _, complete ) { 10004 script = jQuery( "<script>" ) 10005 .attr( s.scriptAttrs || {} ) 10006 .prop( { charset: s.scriptCharset, src: s.url } ) 10007 .on( "load error", callback = function( evt ) { 10008 script.remove(); 10009 callback = null; 10010 if ( evt ) { 10011 complete( evt.type === "error" ? 404 : 200, evt.type ); 10012 } 10013 } ); 10014 10015 // Use native DOM manipulation to avoid our domManip AJAX trickery 10016 document.head.appendChild( script[ 0 ] ); 10017 }, 10018 abort: function() { 10019 if ( callback ) { 10020 callback(); 10021 } 10022 } 10023 }; 10024 } 10025} ); 10026 10027 10028 10029 10030var oldCallbacks = [], 10031 rjsonp = /(=)\?(?=&|$)|\?\?/; 10032 10033// Default jsonp settings 10034jQuery.ajaxSetup( { 10035 jsonp: "callback", 10036 jsonpCallback: function() { 10037 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 10038 this[ callback ] = true; 10039 return callback; 10040 } 10041} ); 10042 10043// Detect, normalize options and install callbacks for jsonp requests 10044jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 10045 10046 var callbackName, overwritten, responseContainer, 10047 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 10048 "url" : 10049 typeof s.data === "string" && 10050 ( s.contentType || "" ) 10051 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 10052 rjsonp.test( s.data ) && "data" 10053 ); 10054 10055 // Handle iff the expected data type is "jsonp" or we have a parameter to set 10056 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 10057 10058 // Get callback name, remembering preexisting value associated with it 10059 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 10060 s.jsonpCallback() : 10061 s.jsonpCallback; 10062 10063 // Insert callback into url or form data 10064 if ( jsonProp ) { 10065 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 10066 } else if ( s.jsonp !== false ) { 10067 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 10068 } 10069 10070 // Use data converter to retrieve json after script execution
vendor: 8,362 bytes, lines 10071-10382
10071 s.converters[ "script json" ] = function() { 10072 if ( !responseContainer ) { 10073 jQuery.error( callbackName + " was not called" ); 10074 } 10075 return responseContainer[ 0 ]; 10076 }; 10077 10078 // Force json dataType 10079 s.dataTypes[ 0 ] = "json"; 10080 10081 // Install callback 10082 overwritten = window[ callbackName ]; 10083 window[ callbackName ] = function() { 10084 responseContainer = arguments; 10085 }; 10086 10087 // Clean-up function (fires after converters) 10088 jqXHR.always( function() { 10089 10090 // If previous value didn't exist - remove it 10091 if ( overwritten === undefined ) { 10092 jQuery( window ).removeProp( callbackName ); 10093 10094 // Otherwise restore preexisting value 10095 } else { 10096 window[ callbackName ] = overwritten; 10097 } 10098 10099 // Save back as free 10100 if ( s[ callbackName ] ) { 10101 10102 // Make sure that re-using the options doesn't screw things around 10103 s.jsonpCallback = originalSettings.jsonpCallback; 10104 10105 // Save the callback name for future use 10106 oldCallbacks.push( callbackName ); 10107 } 10108 10109 // Call if it was a function and we have a response 10110 if ( responseContainer && isFunction( overwritten ) ) { 10111 overwritten( responseContainer[ 0 ] ); 10112 } 10113 10114 responseContainer = overwritten = undefined; 10115 } ); 10116 10117 // Delegate to script 10118 return "script"; 10119 } 10120} ); 10121 10122 10123 10124 10125// Support: Safari 8 only 10126// In Safari 8 documents created via document.implementation.createHTMLDocument 10127// collapse sibling forms: the second one becomes a child of the first one. 10128// Because of that, this security measure has to be disabled in Safari 8. 10129// https://bugs.webkit.org/show_bug.cgi?id=137337 10130support.createHTMLDocument = ( function() { 10131 var body = document.implementation.createHTMLDocument( "" ).body; 10132 body.innerHTML = "<form></form><form></form>"; 10133 return body.childNodes.length === 2; 10134} )(); 10135 10136 10137// Argument "data" should be string of html 10138// context (optional): If specified, the fragment will be created in this context, 10139// defaults to document 10140// keepScripts (optional): If true, will include scripts passed in the html string 10141jQuery.parseHTML = function( data, context, keepScripts ) { 10142 if ( typeof data !== "string" ) { 10143 return []; 10144 } 10145 if ( typeof context === "boolean" ) { 10146 keepScripts = context; 10147 context = false; 10148 } 10149 10150 var base, parsed, scripts; 10151 10152 if ( !context ) { 10153 10154 // Stop scripts or inline event handlers from being executed immediately 10155 // by using document.implementation 10156 if ( support.createHTMLDocument ) { 10157 context = document.implementation.createHTMLDocument( "" ); 10158 10159 // Set the base href for the created document 10160 // so any parsed elements with URLs 10161 // are based on the document's URL (gh-2965) 10162 base = context.createElement( "base" ); 10163 base.href = document.location.href; 10164 context.head.appendChild( base ); 10165 } else { 10166 context = document; 10167 } 10168 } 10169 10170 parsed = rsingleTag.exec( data ); 10171 scripts = !keepScripts && []; 10172 10173 // Single tag 10174 if ( parsed ) { 10175 return [ context.createElement( parsed[ 1 ] ) ]; 10176 } 10177 10178 parsed = buildFragment( [ data ], context, scripts ); 10179 10180 if ( scripts && scripts.length ) { 10181 jQuery( scripts ).remove(); 10182 } 10183 10184 return jQuery.merge( [], parsed.childNodes ); 10185}; 10186 10187 10188/** 10189 * Load a url into a page 10190 */ 10191jQuery.fn.load = function( url, params, callback ) { 10192 var selector, type, response, 10193 self = this, 10194 off = url.indexOf( " " ); 10195 10196 if ( off > -1 ) { 10197 selector = stripAndCollapse( url.slice( off ) ); 10198 url = url.slice( 0, off ); 10199 } 10200 10201 // If it's a function 10202 if ( isFunction( params ) ) { 10203 10204 // We assume that it's the callback 10205 callback = params; 10206 params = undefined; 10207 10208 // Otherwise, build a param string 10209 } else if ( params && typeof params === "object" ) { 10210 type = "POST"; 10211 } 10212 10213 // If we have elements to modify, make the request 10214 if ( self.length > 0 ) { 10215 jQuery.ajax( { 10216 url: url, 10217 10218 // If "type" variable is undefined, then "GET" method will be used. 10219 // Make value of this field explicit since 10220 // user can override it through ajaxSetup method 10221 type: type || "GET", 10222 dataType: "html", 10223 data: params 10224 } ).done( function( responseText ) { 10225 10226 // Save response for use in complete callback 10227 response = arguments; 10228 10229 self.html( selector ? 10230 10231 // If a selector was specified, locate the right elements in a dummy div 10232 // Exclude scripts to avoid IE 'Permission Denied' errors 10233 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 10234 10235 // Otherwise use the full result 10236 responseText ); 10237 10238 // If the request succeeds, this function gets "data", "status", "jqXHR" 10239 // but they are ignored because response was set above. 10240 // If it fails, this function gets "jqXHR", "status", "error" 10241 } ).always( callback && function( jqXHR, status ) { 10242 self.each( function() { 10243 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 10244 } ); 10245 } ); 10246 } 10247 10248 return this; 10249}; 10250 10251 10252 10253 10254jQuery.expr.pseudos.animated = function( elem ) { 10255 return jQuery.grep( jQuery.timers, function( fn ) { 10256 return elem === fn.elem; 10257 } ).length; 10258}; 10259 10260 10261 10262 10263jQuery.offset = { 10264 setOffset: function( elem, options, i ) { 10265 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 10266 position = jQuery.css( elem, "position" ), 10267 curElem = jQuery( elem ), 10268 props = {}; 10269 10270 // Set position first, in-case top/left are set even on static elem 10271 if ( position === "static" ) { 10272 elem.style.position = "relative"; 10273 } 10274 10275 curOffset = curElem.offset(); 10276 curCSSTop = jQuery.css( elem, "top" ); 10277 curCSSLeft = jQuery.css( elem, "left" ); 10278 calculatePosition = ( position === "absolute" || position === "fixed" ) && 10279 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 10280 10281 // Need to be able to calculate position if either 10282 // top or left is auto and position is either absolute or fixed 10283 if ( calculatePosition ) { 10284 curPosition = curElem.position(); 10285 curTop = curPosition.top; 10286 curLeft = curPosition.left; 10287 10288 } else { 10289 curTop = parseFloat( curCSSTop ) || 0; 10290 curLeft = parseFloat( curCSSLeft ) || 0; 10291 } 10292 10293 if ( isFunction( options ) ) { 10294 10295 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10296 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 10297 } 10298 10299 if ( options.top != null ) { 10300 props.top = ( options.top - curOffset.top ) + curTop; 10301 } 10302 if ( options.left != null ) { 10303 props.left = ( options.left - curOffset.left ) + curLeft; 10304 } 10305 10306 if ( "using" in options ) { 10307 options.using.call( elem, props ); 10308 10309 } else { 10310 curElem.css( props ); 10311 } 10312 } 10313}; 10314 10315jQuery.fn.extend( { 10316 10317 // offset() relates an element's border box to the document origin 10318 offset: function( options ) { 10319 10320 // Preserve chaining for setter 10321 if ( arguments.length ) { 10322 return options === undefined ? 10323 this : 10324 this.each( function( i ) { 10325 jQuery.offset.setOffset( this, options, i ); 10326 } ); 10327 } 10328 10329 var rect, win, 10330 elem = this[ 0 ]; 10331 10332 if ( !elem ) { 10333 return; 10334 } 10335 10336 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 10337 // Support: IE <=11 only 10338 // Running getBoundingClientRect on a 10339 // disconnected node in IE throws an error 10340 if ( !elem.getClientRects().length ) { 10341 return { top: 0, left: 0 }; 10342 } 10343 10344 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 10345 rect = elem.getBoundingClientRect(); 10346 win = elem.ownerDocument.defaultView; 10347 return { 10348 top: rect.top + win.pageYOffset, 10349 left: rect.left + win.pageXOffset 10350 }; 10351 }, 10352 10353 // position() relates an element's margin box to its offset parent's padding box 10354 // This corresponds to the behavior of CSS absolute positioning 10355 position: function() { 10356 if ( !this[ 0 ] ) { 10357 return; 10358 } 10359 10360 var offsetParent, offset, doc, 10361 elem = this[ 0 ], 10362 parentOffset = { top: 0, left: 0 }; 10363 10364 // position:fixed elements are offset from the viewport, which itself always has zero offset 10365 if ( jQuery.css( elem, "position" ) === "fixed" ) { 10366 10367 // Assume position:fixed implies availability of getBoundingClientRect 10368 offset = elem.getBoundingClientRect(); 10369 10370 } else { 10371 offset = this.offset(); 10372 10373 // Account for the *real* offset parent, which can be the document or its root element 10374 // when a statically positioned element is identified 10375 doc = elem.ownerDocument; 10376 offsetParent = elem.offsetParent || doc.documentElement; 10377 while ( offsetParent && 10378 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 10379 jQuery.css( offsetParent, "position" ) === "static" ) { 10380 10381 offsetParent = offsetParent.parentNode; 10382 }
vendor: 8,818 bytes, lines 10383-10676
10383 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 10384 10385 // Incorporate borders into its offset, since they are outside its content origin 10386 parentOffset = jQuery( offsetParent ).offset(); 10387 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 10388 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 10389 } 10390 } 10391 10392 // Subtract parent offsets and element margins 10393 return { 10394 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 10395 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 10396 }; 10397 }, 10398 10399 // This method will return documentElement in the following cases: 10400 // 1) For the element inside the iframe without offsetParent, this method will return 10401 // documentElement of the parent window 10402 // 2) For the hidden or detached element 10403 // 3) For body or html element, i.e. in case of the html node - it will return itself 10404 // 10405 // but those exceptions were never presented as a real life use-cases 10406 // and might be considered as more preferable results. 10407 // 10408 // This logic, however, is not guaranteed and can change at any point in the future 10409 offsetParent: function() { 10410 return this.map( function() { 10411 var offsetParent = this.offsetParent; 10412 10413 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 10414 offsetParent = offsetParent.offsetParent; 10415 } 10416 10417 return offsetParent || documentElement; 10418 } ); 10419 } 10420} ); 10421 10422// Create scrollLeft and scrollTop methods 10423jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 10424 var top = "pageYOffset" === prop; 10425 10426 jQuery.fn[ method ] = function( val ) { 10427 return access( this, function( elem, method, val ) { 10428 10429 // Coalesce documents and windows 10430 var win; 10431 if ( isWindow( elem ) ) { 10432 win = elem; 10433 } else if ( elem.nodeType === 9 ) { 10434 win = elem.defaultView; 10435 } 10436 10437 if ( val === undefined ) { 10438 return win ? win[ prop ] : elem[ method ]; 10439 } 10440 10441 if ( win ) { 10442 win.scrollTo( 10443 !top ? val : win.pageXOffset, 10444 top ? val : win.pageYOffset 10445 ); 10446 10447 } else { 10448 elem[ method ] = val; 10449 } 10450 }, method, val, arguments.length ); 10451 }; 10452} ); 10453 10454// Support: Safari <=7 - 9.1, Chrome <=37 - 49 10455// Add the top/left cssHooks using jQuery.fn.position 10456// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10457// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 10458// getComputedStyle returns percent when specified for top/left/bottom/right; 10459// rather than make the css module depend on the offset module, just check for it here 10460jQuery.each( [ "top", "left" ], function( _i, prop ) { 10461 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 10462 function( elem, computed ) { 10463 if ( computed ) { 10464 computed = curCSS( elem, prop ); 10465 10466 // If curCSS returns percentage, fallback to offset 10467 return rnumnonpx.test( computed ) ? 10468 jQuery( elem ).position()[ prop ] + "px" : 10469 computed; 10470 } 10471 } 10472 ); 10473} ); 10474 10475 10476// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10477jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 10478 jQuery.each( { 10479 padding: "inner" + name, 10480 content: type, 10481 "": "outer" + name 10482 }, function( defaultExtra, funcName ) { 10483 10484 // Margin is only for outerHeight, outerWidth 10485 jQuery.fn[ funcName ] = function( margin, value ) { 10486 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 10487 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 10488 10489 return access( this, function( elem, type, value ) { 10490 var doc; 10491 10492 if ( isWindow( elem ) ) { 10493 10494 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 10495 return funcName.indexOf( "outer" ) === 0 ? 10496 elem[ "inner" + name ] : 10497 elem.document.documentElement[ "client" + name ]; 10498 } 10499 10500 // Get document width or height 10501 if ( elem.nodeType === 9 ) { 10502 doc = elem.documentElement; 10503 10504 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10505 // whichever is greatest 10506 return Math.max( 10507 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 10508 elem.body[ "offset" + name ], doc[ "offset" + name ], 10509 doc[ "client" + name ] 10510 ); 10511 } 10512 10513 return value === undefined ? 10514 10515 // Get width or height on the element, requesting but not forcing parseFloat 10516 jQuery.css( elem, type, extra ) : 10517 10518 // Set width or height on the element 10519 jQuery.style( elem, type, value, extra ); 10520 }, type, chainable ? margin : undefined, chainable ); 10521 }; 10522 } ); 10523} ); 10524 10525 10526jQuery.each( [ 10527 "ajaxStart", 10528 "ajaxStop", 10529 "ajaxComplete", 10530 "ajaxError", 10531 "ajaxSuccess", 10532 "ajaxSend" 10533], function( _i, type ) { 10534 jQuery.fn[ type ] = function( fn ) { 10535 return this.on( type, fn ); 10536 }; 10537} ); 10538 10539 10540 10541 10542jQuery.fn.extend( { 10543 10544 bind: function( types, data, fn ) { 10545 return this.on( types, null, data, fn ); 10546 }, 10547 unbind: function( types, fn ) { 10548 return this.off( types, null, fn ); 10549 }, 10550 10551 delegate: function( selector, types, data, fn ) { 10552 return this.on( types, selector, data, fn ); 10553 }, 10554 undelegate: function( selector, types, fn ) { 10555 10556 // ( namespace ) or ( selector, types [, fn] ) 10557 return arguments.length === 1 ? 10558 this.off( selector, "**" ) : 10559 this.off( types, selector || "**", fn ); 10560 }, 10561 10562 hover: function( fnOver, fnOut ) { 10563 return this 10564 .on( "mouseenter", fnOver ) 10565 .on( "mouseleave", fnOut || fnOver ); 10566 } 10567} ); 10568 10569jQuery.each( 10570 ( "blur focus focusin focusout resize scroll click dblclick " + 10571 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 10572 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 10573 function( _i, name ) { 10574 10575 // Handle event binding 10576 jQuery.fn[ name ] = function( data, fn ) { 10577 return arguments.length > 0 ? 10578 this.on( name, null, data, fn ) : 10579 this.trigger( name ); 10580 }; 10581 } 10582); 10583 10584 10585 10586 10587// Support: Android <=4.0 only 10588// Make sure we trim BOM and NBSP 10589// Require that the "whitespace run" starts from a non-whitespace 10590// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 10591var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 10592 10593// Bind a function to a context, optionally partially applying any 10594// arguments. 10595// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 10596// However, it is not slated for removal any time soon 10597jQuery.proxy = function( fn, context ) { 10598 var tmp, args, proxy; 10599 10600 if ( typeof context === "string" ) { 10601 tmp = fn[ context ]; 10602 context = fn; 10603 fn = tmp; 10604 } 10605 10606 // Quick check to determine if target is callable, in the spec 10607 // this throws a TypeError, but we will just return undefined. 10608 if ( !isFunction( fn ) ) { 10609 return undefined; 10610 } 10611 10612 // Simulated bind 10613 args = slice.call( arguments, 2 ); 10614 proxy = function() { 10615 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 10616 }; 10617 10618 // Set the guid of unique handler to the same of original handler, so it can be removed 10619 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 10620 10621 return proxy; 10622}; 10623 10624jQuery.holdReady = function( hold ) { 10625 if ( hold ) { 10626 jQuery.readyWait++; 10627 } else { 10628 jQuery.ready( true ); 10629 } 10630}; 10631jQuery.isArray = Array.isArray; 10632jQuery.parseJSON = JSON.parse; 10633jQuery.nodeName = nodeName; 10634jQuery.isFunction = isFunction; 10635jQuery.isWindow = isWindow; 10636jQuery.camelCase = camelCase; 10637jQuery.type = toType; 10638 10639jQuery.now = Date.now; 10640 10641jQuery.isNumeric = function( obj ) { 10642 10643 // As of jQuery 3.0, isNumeric is limited to 10644 // strings and numbers (primitives or objects) 10645 // that can be coerced to finite numbers (gh-2662) 10646 var type = jQuery.type( obj ); 10647 return ( type === "number" || type === "string" ) && 10648 10649 // parseFloat NaNs numeric-cast false positives ("") 10650 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 10651 // subtraction forces infinities to NaN 10652 !isNaN( obj - parseFloat( obj ) ); 10653}; 10654 10655jQuery.trim = function( text ) { 10656 return text == null ? 10657 "" : 10658 ( text + "" ).replace( rtrim, "$1" ); 10659}; 10660 10661 10662 10663// Register as a named AMD module, since jQuery can be concatenated with other 10664// files that may use define, but not via a proper concatenation script that 10665// understands anonymous AMD modules. A named AMD is safest and most robust 10666// way to register. Lowercase jquery is used because AMD module names are 10667// derived from file names, and jQuery is normally delivered in a lowercase 10668// file name. Do this after creating the global so that if an AMD module wants 10669// to call noConflict to hide this version of jQuery, it will work. 10670 10671// Note that for maximum portability, libraries that are not jQuery should 10672// declare themselves as anonymous modules, and avoid setting a global if an 10673// AMD loader is present. jQuery is a special case. For more information, see 10674// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10675 10676if ( t
vendor: 19,996 bytes, lines 10676-10721
10676ypeof define === "function" && define.amd ) { 10677 define( "jquery", [], function() { 10678 return jQuery; 10679 } ); 10680} 10681 10682 10683 10684 10685var 10686 10687 // Map over jQuery in case of overwrite 10688 _jQuery = window.jQuery, 10689 10690 // Map over the $ in case of overwrite 10691 _$ = window.$; 10692 10693jQuery.noConflict = function( deep ) { 10694 if ( window.$ === jQuery ) { 10695 window.$ = _$; 10696 } 10697 10698 if ( deep && window.jQuery === jQuery ) { 10699 window.jQuery = _jQuery; 10700 } 10701 10702 return jQuery; 10703}; 10704 10705// Expose jQuery and $ identifiers, even in AMD 10706// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 10707// and CommonJS for browser emulators (trac-13566) 10708if ( typeof noGlobal === "undefined" ) { 10709 window.jQuery = window.$ = jQuery; 10710} 10711 10712 10713 10714 10715return jQuery; 10716} ); 10717/** 10718 * @popperjs/core v2.11.8 - MIT License 10719 */ 10720 10721!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function N(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function I(e,r,o){return r===H?N(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):N(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function _(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&C(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=I(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),I(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function F(e){return e.split("-")[0]}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?F(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=_(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=N(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Z(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,o=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?K:i;return function(e,t,r){void 0===r&&(r=a);var i,s,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},K,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],p=!1,u={state:f,setOptions:function(r){var i="function"==typeof r?r(f.options):r;l(),f.options=Object.assign({},a,f.options,i),f.scrollParents={reference:n(e)?w(e):e.contextElement?w(e.contextElement):[],popper:w(t)};var s,p,d=function(e){var t=q(e);return V.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,f.options.modifiers),p=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(p).map((function(e){return p[e]}))));return f.orderedModifiers=d.filter((function(e){return e.enabled})),f.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:f,name:t,instance:u,options:r}),a=function(){};c.push(i||a)}})),u.update()},forceUpdate:function(){if(!p){var e=f.elements,t=e.reference,n=e.popper;if(Q(t,n)){f.rects={reference:y(t,E(n),"fixed"===f.options.strategy),popper:g(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach((function(e){return f.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<f.orderedModifiers.length;r++)if(!0!==f.reset){var o=f.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,c=o.name;"function"==typeof i&&(f=i({state:f,options:s,name:c,instance:u})||f)}else f.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(f)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){l(),p=!0}};if(!Q(e,t))return u;function l(){c.forEach((function(e){return e()})),c=[]}return u.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),u}}var $={passive:!0};var ee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,f=void 0===s||s,c=t(n.elements.popper),p=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&p.forEach((function(e){e.addEventListener("scroll",r.update,$)})),f&&c.addEventListener("resize",r.update,$),function(){a&&p.forEach((function(e){e.removeEventListener("scroll",r.update,$)})),f&&c.removeEventListener("resize",r.update,$)}},data:{}};var te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ne={top:"auto",right:"auto",bottom:"auto",left:"auto"};function re(e){var n,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,c=e.position,p=e.gpuAcceleration,u=e.adaptive,l=e.roundOffsets,h=e.isFixed,v=f.x,y=void 0===v?0:v,g=f.y,b=void 0===g?0:g,x="function"==typeof l?l({x:y,y:b}):{x:y,y:b};y=x.x,b=x.y;var w=f.hasOwnProperty("x"),O=f.hasOwnProperty("y"),j=P,M=D,k=window;if(u){var W=E(r),H="clientHeight",T="clientWidth";if(W===t(r)&&"static"!==m(W=d(r)).position&&"absolute"===c&&(H="scrollHeight",T="scrollWidth"),W=W,i===D||(i===P||i===L)&&a===B)M=A,b-=(h&&W===k&&k.visualViewport?k.visualViewport.height:W[H])-o.height,b*=p?1:-1;if(i===P||(i===D||i===A)&&a===B)j=L,y-=(h&&W===k&&k.visualViewport?k.visualViewport.width:W[T])-o.width,y*=p?1:-1}var R,S=Object.assign({position:c},u&&ne),V=!0===l?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:s(n*o)/o||0,y:s(r*o)/o||0}}({x:y,y:b},t(r)):{x:y,y:b};return y=V.x,b=V.y,p?Object.assign({},S,((R={})[M]=O?"0":"",R[j]=w?"0":"",R.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",R)):Object.assign({},S,((n={})[M]=O?b+"px":"",n[j]=w?y+"px":"",n.transform="",n))}var oe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:F(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,re(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,re(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ie={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];r(i)&&l(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&l(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=S.reduce((function(e,n){return e[n]=function(e,t,n){var r=F(e),o=[P,D].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[F(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=F(v),g=f||(y===v||!h?[fe(v)]:function(e){if(F(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(F(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k<b.length;k++){var B=b[k],H=F(B),T=U(B)===W,R=[D,A].indexOf(H)>=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var C=fe(q),N=[];if(i&&N.push(V[H]<=0),s&&N.push(V[q]<=0,V[C]<=0),N.every((function(e){return e}))){E=B,j=!1;break}O.set(B,N)}if(j)for(var I=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},_=h?3:1;_>0;_--){if("break"===I(_))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=F(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,C="y"===j?D:P,N="y"===j?A:L,I="y"===j?"height":"width",_=k[j],X=_+b[C],Y=_-b[N],G=m?-H[I]/2:0,K=w===W?B[I]:H[I],Q=w===W?-H[I]:-B[I],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[C],ne=ee[N],re=de(0,B[I],$[I]),oe=O?B[I]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[I]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=_+ie-fe,pe=de(m?a(X,_+oe-fe-se):X,_,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-_}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=F(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&C(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.re
10721cts.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})})); 10722// Set a `globalThis` so that bootstrap components are defined on window.bootstrap instead of window. 10723window['bootstrap'] = { 10724 "@popperjs/core": window.Popper, 10725 _originalGlobalThis: window['globalThis'] 10726}; 10727window['globalThis'] = window['bootstrap']; 10728/*! 10729 * Bootstrap data.js v5.3.8 (https://getbootstrap.com/) 10730 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 10731 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 10732 */ 10733(function (global, factory) { 10734 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 10735 typeof define === 'function' && define.amd ? define(factory) : 10736 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Data = factory()); 10737})(this, (function () { 'use strict'; 10738 10739 /** 10740 * -------------------------------------------------------------------------- 10741 * Bootstrap dom/data.js 10742 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 10743 * -------------------------------------------------------------------------- 10744 */ 10745 10746 /** 10747 * Constants 10748 */ 10749 10750 const elementMap = new Map(); 10751 const data = { 10752 set(element, key, instance) { 10753 if (!elementMap.has(element)) { 10754 elementMap.set(element, new Map()); 10755 } 10756 const instanceMap = elementMap.get(element); 10757 10758 // make it clear we only want one instance per element 10759 // can be removed later when multiple key/instances are fine to be used 10760 if (!instanceMap.has(key) && instanceMap.size !== 0) { 10761 // eslint-disable-next-line no-console 10762 console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); 10763 return; 10764 } 10765 instanceMap.set(key, instance); 10766 }, 10767 get(element, key) { 10768 if (elementMap.has(element)) { 10769 return elementMap.get(element).get(key) || null; 10770 } 10771 return null; 10772 }, 10773 remove(element, key) { 10774 if (!elementMap.has(element)) { 10775 return; 10776 } 10777 const instanceMap = elementMap.get(element); 10778 instanceMap.delete(key); 10779 10780 // free up element references if there are no instances left for an element 10781 if (instanceMap.size === 0) { 10782 elementMap.delete(element); 10783 } 10784 } 10785 }; 10786 10787 return data; 10788 10789})); 10790/*! 10791 * Bootstrap index.js v5.3.8 (https://getbootstrap.com/) 10792 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 10793 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 10794 */ 10795(function (global, factory) { 10796 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 10797 typeof define === 'function' && define.amd ? define(['exports'], factory) : 10798 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Index = {})); 10799})(this, (function (exports) { 'use strict'
vendor: 7,859 bytes, lines 10799-11047
10799; 10800 10801 /** 10802 * -------------------------------------------------------------------------- 10803 * Bootstrap util/index.js 10804 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 10805 * -------------------------------------------------------------------------- 10806 */ 10807 10808 const MAX_UID = 1000000; 10809 const MILLISECONDS_MULTIPLIER = 1000; 10810 const TRANSITION_END = 'transitionend'; 10811 10812 /** 10813 * Properly escape IDs selectors to handle weird IDs 10814 * @param {string} selector 10815 * @returns {string} 10816 */ 10817 const parseSelector = selector => { 10818 if (selector && window.CSS && window.CSS.escape) { 10819 // document.querySelector needs escaping to handle IDs (html5+) containing for instance / 10820 selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); 10821 } 10822 return selector; 10823 }; 10824 10825 // Shout-out Angus Croll (https://goo.gl/pxwQGp) 10826 const toType = object => { 10827 if (object === null || object === undefined) { 10828 return `${object}`; 10829 } 10830 return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); 10831 }; 10832 10833 /** 10834 * Public Util API 10835 */ 10836 10837 const getUID = prefix => { 10838 do { 10839 prefix += Math.floor(Math.random() * MAX_UID); 10840 } while (document.getElementById(prefix)); 10841 return prefix; 10842 }; 10843 const getTransitionDurationFromElement = element => { 10844 if (!element) { 10845 return 0; 10846 } 10847 10848 // Get transition-duration of the element 10849 let { 10850 transitionDuration, 10851 transitionDelay 10852 } = window.getComputedStyle(element); 10853 const floatTransitionDuration = Number.parseFloat(transitionDuration); 10854 const floatTransitionDelay = Number.parseFloat(transitionDelay); 10855 10856 // Return 0 if element or transition duration is not found 10857 if (!floatTransitionDuration && !floatTransitionDelay) { 10858 return 0; 10859 } 10860 10861 // If multiple durations are defined, take the first 10862 transitionDuration = transitionDuration.split(',')[0]; 10863 transitionDelay = transitionDelay.split(',')[0]; 10864 return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 10865 }; 10866 const triggerTransitionEnd = element => { 10867 element.dispatchEvent(new Event(TRANSITION_END)); 10868 }; 10869 const isElement = object => { 10870 if (!object || typeof object !== 'object') { 10871 return false; 10872 } 10873 if (typeof object.jquery !== 'undefined') { 10874 object = object[0]; 10875 } 10876 return typeof object.nodeType !== 'undefined'; 10877 }; 10878 const getElement = object => { 10879 // it's a jQuery object or a node element 10880 if (isElement(object)) { 10881 return object.jquery ? object[0] : object; 10882 } 10883 if (typeof object === 'string' && object.length > 0) { 10884 return document.querySelector(parseSelector(object)); 10885 } 10886 return null; 10887 }; 10888 const isVisible = element => { 10889 if (!isElement(element) || element.getClientRects().length === 0) { 10890 return false; 10891 } 10892 const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; 10893 // Handle `details` element as its content may falsie appear visible when it is closed 10894 const closedDetails = element.closest('details:not([open])'); 10895 if (!closedDetails) { 10896 return elementIsVisible; 10897 } 10898 if (closedDetails !== element) { 10899 const summary = element.closest('summary'); 10900 if (summary && summary.parentNode !== closedDetails) { 10901 return false; 10902 } 10903 if (summary === null) { 10904 return false; 10905 } 10906 } 10907 return elementIsVisible; 10908 }; 10909 const isDisabled = element => { 10910 if (!element || element.nodeType !== Node.ELEMENT_NODE) { 10911 return true; 10912 } 10913 if (element.classList.contains('disabled')) { 10914 return true; 10915 } 10916 if (typeof element.disabled !== 'undefined') { 10917 return element.disabled; 10918 } 10919 return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; 10920 }; 10921 const findShadowRoot = element => { 10922 if (!document.documentElement.attachShadow) { 10923 return null; 10924 } 10925 10926 // Can find the shadow root otherwise it'll return the document 10927 if (typeof element.getRootNode === 'function') { 10928 const root = element.getRootNode(); 10929 return root instanceof ShadowRoot ? root : null; 10930 } 10931 if (element instanceof ShadowRoot) { 10932 return element; 10933 } 10934 10935 // when we don't find a shadow root 10936 if (!element.parentNode) { 10937 return null; 10938 } 10939 return findShadowRoot(element.parentNode); 10940 }; 10941 const noop = () => {}; 10942 10943 /** 10944 * Trick to restart an element's animation 10945 * 10946 * @param {HTMLElement} element 10947 * @return void 10948 * 10949 * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation 10950 */ 10951 const reflow = element => { 10952 element.offsetHeight; // eslint-disable-line no-unused-expressions 10953 }; 10954 const getjQuery = () => { 10955 if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { 10956 return window.jQuery; 10957 } 10958 return null; 10959 }; 10960 const DOMContentLoadedCallbacks = []; 10961 const onDOMContentLoaded = callback => { 10962 if (document.readyState === 'loading') { 10963 // add listener on the first call when the document is in loading state 10964 if (!DOMContentLoadedCallbacks.length) { 10965 document.addEventListener('DOMContentLoaded', () => { 10966 for (const callback of DOMContentLoadedCallbacks) { 10967 callback(); 10968 } 10969 }); 10970 } 10971 DOMContentLoadedCallbacks.push(callback); 10972 } else { 10973 callback(); 10974 } 10975 }; 10976 const isRTL = () => document.documentElement.dir === 'rtl'; 10977 const defineJQueryPlugin = plugin => { 10978 onDOMContentLoaded(() => { 10979 const $ = getjQuery(); 10980 /* istanbul ignore if */ 10981 if ($) { 10982 const name = plugin.NAME; 10983 const JQUERY_NO_CONFLICT = $.fn[name]; 10984 $.fn[name] = plugin.jQueryInterface; 10985 $.fn[name].Constructor = plugin; 10986 $.fn[name].noConflict = () => { 10987 $.fn[name] = JQUERY_NO_CONFLICT; 10988 return plugin.jQueryInterface; 10989 }; 10990 } 10991 }); 10992 }; 10993 const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { 10994 return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue; 10995 }; 10996 const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { 10997 if (!waitForTransition) { 10998 execute(callback); 10999 return; 11000 } 11001 const durationPadding = 5; 11002 const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; 11003 let called = false; 11004 const handler = ({ 11005 target 11006 }) => { 11007 if (target !== transitionElement) { 11008 return; 11009 } 11010 called = true; 11011 transitionElement.removeEventListener(TRANSITION_END, handler); 11012 execute(callback); 11013 }; 11014 transitionElement.addEventListener(TRANSITION_END, handler); 11015 setTimeout(() => { 11016 if (!called) { 11017 triggerTransitionEnd(transitionElement); 11018 } 11019 }, emulatedDuration); 11020 }; 11021 11022 /** 11023 * Return the previous/next element of a list. 11024 * 11025 * @param {array} list The list of elements 11026 * @param activeElement The active element 11027 * @param shouldGetNext Choose to get next or previous element 11028 * @param isCycleAllowed 11029 * @return {Element|elem} The proper element 11030 */ 11031 const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { 11032 const listLength = list.length; 11033 let index = list.indexOf(activeElement); 11034 11035 // if the element does not exist in the list return an element 11036 // depending on the direction and if cycle is allowed 11037 if (index === -1) { 11038 return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]; 11039 } 11040 index += shouldGetNext ? 1 : -1; 11041 if (isCycleAllowed) { 11042 index = (index + listLength) % listLength; 11043 } 11044 return list[Math.max(0, Math.min(index, listLength - 1))]; 11045 }; 11046 11047
vendor: 5,424 bytes, lines 11047-11173
11047exports.defineJQueryPlugin = defineJQueryPlugin; 11048 exports.execute = execute; 11049 exports.executeAfterTransition = executeAfterTransition; 11050 exports.findShadowRoot = findShadowRoot; 11051 exports.getElement = getElement; 11052 exports.getNextActiveElement = getNextActiveElement; 11053 exports.getTransitionDurationFromElement = getTransitionDurationFromElement; 11054 exports.getUID = getUID; 11055 exports.getjQuery = getjQuery; 11056 exports.isDisabled = isDisabled; 11057 exports.isElement = isElement; 11058 exports.isRTL = isRTL; 11059 exports.isVisible = isVisible; 11060 exports.noop = noop; 11061 exports.onDOMContentLoaded = onDOMContentLoaded; 11062 exports.parseSelector = parseSelector; 11063 exports.reflow = reflow; 11064 exports.toType = toType; 11065 exports.triggerTransitionEnd = triggerTransitionEnd; 11066 11067 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 11068 11069})); 11070/*! 11071 * Bootstrap event-handler.js v5.3.8 (https://getbootstrap.com/) 11072 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11073 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11074 */ 11075(function (global, factory) { 11076 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) : 11077 typeof define === 'function' && define.amd ? define(['../util/index'], factory) : 11078 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory(global.Index)); 11079})(this, (function (index_js) { 'use strict'; 11080 11081 /** 11082 * -------------------------------------------------------------------------- 11083 * Bootstrap dom/event-handler.js 11084 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11085 * -------------------------------------------------------------------------- 11086 */ 11087 11088 11089 /** 11090 * Constants 11091 */ 11092 11093 const namespaceRegex = /[^.]*(?=\..*)\.|.*/; 11094 const stripNameRegex = /\..*/; 11095 const stripUidRegex = /::\d+$/; 11096 const eventRegistry = {}; // Events storage 11097 let uidEvent = 1; 11098 const customEvents = { 11099 mouseenter: 'mouseover', 11100 mouseleave: 'mouseout' 11101 }; 11102 const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); 11103 11104 /** 11105 * Private methods 11106 */ 11107 11108 function makeEventUid(element, uid) { 11109 return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; 11110 } 11111 function getElementEvents(element) { 11112 const uid = makeEventUid(element); 11113 element.uidEvent = uid; 11114 eventRegistry[uid] = eventRegistry[uid] || {}; 11115 return eventRegistry[uid]; 11116 } 11117 function bootstrapHandler(element, fn) { 11118 return function handler(event) { 11119 hydrateObj(event, { 11120 delegateTarget: element 11121 }); 11122 if (handler.oneOff) { 11123 EventHandler.off(element, event.type, fn); 11124 } 11125 return fn.apply(element, [event]); 11126 }; 11127 } 11128 function bootstrapDelegationHandler(element, selector, fn) { 11129 return function handler(event) { 11130 const domElements = element.querySelectorAll(selector); 11131 for (let { 11132 target 11133 } = event; target && target !== this; target = target.parentNode) { 11134 for (const domElement of domElements) { 11135 if (domElement !== target) { 11136 continue; 11137 } 11138 hydrateObj(event, { 11139 delegateTarget: target 11140 }); 11141 if (handler.oneOff) { 11142 EventHandler.off(element, event.type, selector, fn); 11143 } 11144 return fn.apply(target, [event]); 11145 } 11146 } 11147 }; 11148 } 11149 function findHandler(events, callable, delegationSelector = null) { 11150 return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); 11151 } 11152 function normalizeParameters(originalTypeEvent, handler, delegationFunction) { 11153 const isDelegated = typeof handler === 'string'; 11154 // TODO: tooltip passes `false` instead of selector, so we need to check 11155 const callable = isDelegated ? delegationFunction : handler || delegationFunction; 11156 let typeEvent = getTypeEvent(originalTypeEvent); 11157 if (!nativeEvents.has(typeEvent)) { 11158 typeEvent = originalTypeEvent; 11159 } 11160 return [isDelegated, callable, typeEvent]; 11161 } 11162 function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) { 11163 if (typeof originalTypeEvent !== 'string' || !element) { 11164 return; 11165 } 11166 let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); 11167 11168 // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position 11169 // this prevents the handler from being dispatched the same way as mouseover or mouseout does 11170 if (originalTypeEvent in customEvents) { 11171 const wrapFunction = fn => { 11172 return function (event) { 11173 if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
vendor: 40,907 bytes, lines 11174-12343
11174 return fn.call(this, event); 11175 } 11176 }; 11177 }; 11178 callable = wrapFunction(callable); 11179 } 11180 const events = getElementEvents(element); 11181 const handlers = events[typeEvent] || (events[typeEvent] = {}); 11182 const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); 11183 if (previousFunction) { 11184 previousFunction.oneOff = previousFunction.oneOff && oneOff; 11185 return; 11186 } 11187 const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); 11188 const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); 11189 fn.delegationSelector = isDelegated ? handler : null; 11190 fn.callable = callable; 11191 fn.oneOff = oneOff; 11192 fn.uidEvent = uid; 11193 handlers[uid] = fn; 11194 element.addEventListener(typeEvent, fn, isDelegated); 11195 } 11196 function removeHandler(element, events, typeEvent, handler, delegationSelector) { 11197 const fn = findHandler(events[typeEvent], handler, delegationSelector); 11198 if (!fn) { 11199 return; 11200 } 11201 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); 11202 delete events[typeEvent][fn.uidEvent]; 11203 } 11204 function removeNamespacedHandlers(element, events, typeEvent, namespace) { 11205 const storeElementEvent = events[typeEvent] || {}; 11206 for (const [handlerKey, event] of Object.entries(storeElementEvent)) { 11207 if (handlerKey.includes(namespace)) { 11208 removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); 11209 } 11210 } 11211 } 11212 function getTypeEvent(event) { 11213 // allow to get the native events from namespaced events ('click.bs.button' --> 'click') 11214 event = event.replace(stripNameRegex, ''); 11215 return customEvents[event] || event; 11216 } 11217 const EventHandler = { 11218 on(element, event, handler, delegationFunction) { 11219 addHandler(element, event, handler, delegationFunction, false); 11220 }, 11221 one(element, event, handler, delegationFunction) { 11222 addHandler(element, event, handler, delegationFunction, true); 11223 }, 11224 off(element, originalTypeEvent, handler, delegationFunction) { 11225 if (typeof originalTypeEvent !== 'string' || !element) { 11226 return; 11227 } 11228 const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); 11229 const inNamespace = typeEvent !== originalTypeEvent; 11230 const events = getElementEvents(element); 11231 const storeElementEvent = events[typeEvent] || {}; 11232 const isNamespace = originalTypeEvent.startsWith('.'); 11233 if (typeof callable !== 'undefined') { 11234 // Simplest case: handler is passed, remove that listener ONLY. 11235 if (!Object.keys(storeElementEvent).length) { 11236 return; 11237 } 11238 removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null); 11239 return; 11240 } 11241 if (isNamespace) { 11242 for (const elementEvent of Object.keys(events)) { 11243 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); 11244 } 11245 } 11246 for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { 11247 const handlerKey = keyHandlers.replace(stripUidRegex, ''); 11248 if (!inNamespace || originalTypeEvent.includes(handlerKey)) { 11249 removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); 11250 } 11251 } 11252 }, 11253 trigger(element, event, args) { 11254 if (typeof event !== 'string' || !element) { 11255 return null; 11256 } 11257 const $ = index_js.getjQuery(); 11258 const typeEvent = getTypeEvent(event); 11259 const inNamespace = event !== typeEvent; 11260 let jQueryEvent = null; 11261 let bubbles = true; 11262 let nativeDispatch = true; 11263 let defaultPrevented = false; 11264 if (inNamespace && $) { 11265 jQueryEvent = $.Event(event, args); 11266 $(element).trigger(jQueryEvent); 11267 bubbles = !jQueryEvent.isPropagationStopped(); 11268 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); 11269 defaultPrevented = jQueryEvent.isDefaultPrevented(); 11270 } 11271 const evt = hydrateObj(new Event(event, { 11272 bubbles, 11273 cancelable: true 11274 }), args); 11275 if (defaultPrevented) { 11276 evt.preventDefault(); 11277 } 11278 if (nativeDispatch) { 11279 element.dispatchEvent(evt); 11280 } 11281 if (evt.defaultPrevented && jQueryEvent) { 11282 jQueryEvent.preventDefault(); 11283 } 11284 return evt; 11285 } 11286 }; 11287 function hydrateObj(obj, meta = {}) { 11288 for (const [key, value] of Object.entries(meta)) { 11289 try { 11290 obj[key] = value; 11291 } catch (_unused) { 11292 Object.defineProperty(obj, key, { 11293 configurable: true, 11294 get() { 11295 return value; 11296 } 11297 }); 11298 } 11299 } 11300 return obj; 11301 } 11302 11303 return EventHandler; 11304 11305})); 11306/*! 11307 * Bootstrap manipulator.js v5.3.8 (https://getbootstrap.com/) 11308 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11309 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11310 */ 11311(function (global, factory) { 11312 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 11313 typeof define === 'function' && define.amd ? define(factory) : 11314 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Manipulator = factory()); 11315})(this, (function () { 'use strict'; 11316 11317 /** 11318 * -------------------------------------------------------------------------- 11319 * Bootstrap dom/manipulator.js 11320 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11321 * -------------------------------------------------------------------------- 11322 */ 11323 11324 function normalizeData(value) { 11325 if (value === 'true') { 11326 return true; 11327 } 11328 if (value === 'false') { 11329 return false; 11330 } 11331 if (value === Number(value).toString()) { 11332 return Number(value); 11333 } 11334 if (value === '' || value === 'null') { 11335 return null; 11336 } 11337 if (typeof value !== 'string') { 11338 return value; 11339 } 11340 try { 11341 return JSON.parse(decodeURIComponent(value)); 11342 } catch (_unused) { 11343 return value; 11344 } 11345 } 11346 function normalizeDataKey(key) { 11347 return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); 11348 } 11349 const Manipulator = { 11350 setDataAttribute(element, key, value) { 11351 element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); 11352 }, 11353 removeDataAttribute(element, key) { 11354 element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); 11355 }, 11356 getDataAttributes(element) { 11357 if (!element) { 11358 return {}; 11359 } 11360 const attributes = {}; 11361 const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); 11362 for (const key of bsKeys) { 11363 let pureKey = key.replace(/^bs/, ''); 11364 pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1); 11365 attributes[pureKey] = normalizeData(element.dataset[key]); 11366 } 11367 return attributes; 11368 }, 11369 getDataAttribute(element, key) { 11370 return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); 11371 } 11372 }; 11373 11374 return Manipulator; 11375 11376})); 11377/*! 11378 * Bootstrap config.js v5.3.8 (https://getbootstrap.com/) 11379 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11380 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11381 */ 11382(function (global, factory) { 11383 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/manipulator.js'), require('./index.js')) : 11384 typeof define === 'function' && define.amd ? define(['../dom/manipulator', './index'], factory) : 11385 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Config = factory(global.Manipulator, global.Index)); 11386})(this, (function (Manipulator, index_js) { 'use strict'; 11387 11388 /** 11389 * -------------------------------------------------------------------------- 11390 * Bootstrap util/config.js 11391 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11392 * -------------------------------------------------------------------------- 11393 */ 11394 11395 11396 /** 11397 * Class definition 11398 */ 11399 11400 class Config { 11401 // Getters 11402 static get Default() { 11403 return {}; 11404 } 11405 static get DefaultType() { 11406 return {}; 11407 } 11408 static get NAME() { 11409 throw new Error('You have to implement the static method "NAME", for each component!'); 11410 } 11411 _getConfig(config) { 11412 config = this._mergeConfigObj(config); 11413 config = this._configAfterMerge(config); 11414 this._typeCheckConfig(config); 11415 return config; 11416 } 11417 _configAfterMerge(config) { 11418 return config; 11419 } 11420 _mergeConfigObj(config, element) { 11421 const jsonConfig = index_js.isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse 11422 11423 return { 11424 ...this.constructor.Default, 11425 ...(typeof jsonConfig === 'object' ? jsonConfig : {}), 11426 ...(index_js.isElement(element) ? Manipulator.getDataAttributes(element) : {}), 11427 ...(typeof config === 'object' ? config : {}) 11428 }; 11429 } 11430 _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { 11431 for (const [property, expectedTypes] of Object.entries(configTypes)) { 11432 const value = config[property]; 11433 const valueType = index_js.isElement(value) ? 'element' : index_js.toType(value); 11434 if (!new RegExp(expectedTypes).test(valueType)) { 11435 throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); 11436 } 11437 } 11438 } 11439 } 11440 11441 return Config; 11442 11443})); 11444/*! 11445 * Bootstrap base-component.js v5.3.8 (https://getbootstrap.com/) 11446 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11447 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11448 */ 11449(function (global, factory) { 11450 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./util/config.js'), require('./util/index.js')) : 11451 typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './util/config', './util/index'], factory) : 11452 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.EventHandler, global.Config, global.Index)); 11453})(this, (function (Data, EventHandler, Config, index_js) { 'use strict'; 11454 11455 /** 11456 * -------------------------------------------------------------------------- 11457 * Bootstrap base-component.js 11458 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11459 * -------------------------------------------------------------------------- 11460 */ 11461 11462 11463 /** 11464 * Constants 11465 */ 11466 11467 const VERSION = '5.3.8'; 11468 11469 /** 11470 * Class definition 11471 */ 11472 11473 class BaseComponent extends Config { 11474 constructor(element, config) { 11475 super(); 11476 element = index_js.getElement(element); 11477 if (!element) { 11478 return; 11479 } 11480 this._element = element; 11481 this._config = this._getConfig(config); 11482 Data.set(this._element, this.constructor.DATA_KEY, this); 11483 } 11484 11485 // Public 11486 dispose() { 11487 Data.remove(this._element, this.constructor.DATA_KEY); 11488 EventHandler.off(this._element, this.constructor.EVENT_KEY); 11489 for (const propertyName of Object.getOwnPropertyNames(this)) { 11490 this[propertyName] = null; 11491 } 11492 } 11493 11494 // Private 11495 _queueCallback(callback, element, isAnimated = true) { 11496 index_js.executeAfterTransition(callback, element, isAnimated); 11497 } 11498 _getConfig(config) { 11499 config = this._mergeConfigObj(config, this._element); 11500 config = this._configAfterMerge(config); 11501 this._typeCheckConfig(config); 11502 return config; 11503 } 11504 11505 // Static 11506 static getInstance(element) { 11507 return Data.get(index_js.getElement(element), this.DATA_KEY); 11508 } 11509 static getOrCreateInstance(element, config = {}) { 11510 return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); 11511 } 11512 static get VERSION() { 11513 return VERSION; 11514 } 11515 static get DATA_KEY() { 11516 return `bs.${this.NAME}`; 11517 } 11518 static get EVENT_KEY() { 11519 return `.${this.DATA_KEY}`; 11520 } 11521 static eventName(name) { 11522 return `${name}${this.EVENT_KEY}`; 11523 } 11524 } 11525 11526 return BaseComponent; 11527 11528})); 11529/*! 11530 * Bootstrap sanitizer.js v5.3.8 (https://getbootstrap.com/) 11531 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11532 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11533 */ 11534(function (global, factory) { 11535 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 11536 typeof define === 'function' && define.amd ? define(['exports'], factory) : 11537 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sanitizer = {})); 11538})(this, (function (exports) { 'use strict'; 11539 11540 /** 11541 * -------------------------------------------------------------------------- 11542 * Bootstrap util/sanitizer.js 11543 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11544 * -------------------------------------------------------------------------- 11545 */ 11546 11547 // js-docs-start allow-list 11548 const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 11549 const DefaultAllowlist = { 11550 // Global attributes allowed on any supplied element below. 11551 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 11552 a: ['target', 'href', 'title', 'rel'], 11553 area: [], 11554 b: [], 11555 br: [], 11556 col: [], 11557 code: [], 11558 dd: [], 11559 div: [], 11560 dl: [], 11561 dt: [], 11562 em: [], 11563 hr: [], 11564 h1: [], 11565 h2: [], 11566 h3: [], 11567 h4: [], 11568 h5: [], 11569 h6: [], 11570 i: [], 11571 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 11572 li: [], 11573 ol: [], 11574 p: [], 11575 pre: [], 11576 s: [], 11577 small: [], 11578 span: [], 11579 sub: [], 11580 sup: [], 11581 strong: [], 11582 u: [], 11583 ul: [] 11584 }; 11585 // js-docs-end allow-list 11586 11587 const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); 11588 11589 /** 11590 * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation 11591 * contexts. 11592 * 11593 * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 11594 */ 11595 const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; 11596 const allowedAttribute = (attribute, allowedAttributeList) => { 11597 const attributeName = attribute.nodeName.toLowerCase(); 11598 if (allowedAttributeList.includes(attributeName)) { 11599 if (uriAttributes.has(attributeName)) { 11600 return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); 11601 } 11602 return true; 11603 } 11604 11605 // Check if a regular expression validates the attribute. 11606 return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); 11607 }; 11608 function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { 11609 if (!unsafeHtml.length) { 11610 return unsafeHtml; 11611 } 11612 if (sanitizeFunction && typeof sanitizeFunction === 'function') { 11613 return sanitizeFunction(unsafeHtml); 11614 } 11615 const domParser = new window.DOMParser(); 11616 const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 11617 const elements = [].concat(...createdDocument.body.querySelectorAll('*')); 11618 for (const element of elements) { 11619 const elementName = element.nodeName.toLowerCase(); 11620 if (!Object.keys(allowList).includes(elementName)) { 11621 element.remove(); 11622 continue; 11623 } 11624 const attributeList = [].concat(...element.attributes); 11625 const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); 11626 for (const attribute of attributeList) { 11627 if (!allowedAttribute(attribute, allowedAttributes)) { 11628 element.removeAttribute(attribute.nodeName); 11629 } 11630 } 11631 } 11632 return createdDocument.body.innerHTML; 11633 } 11634 11635 exports.DefaultAllowlist = DefaultAllowlist; 11636 exports.sanitizeHtml = sanitizeHtml; 11637 11638 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 11639 11640})); 11641/*! 11642 * Bootstrap selector-engine.js v5.3.8 (https://getbootstrap.com/) 11643 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11644 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11645 */ 11646(function (global, factory) { 11647 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) : 11648 typeof define === 'function' && define.amd ? define(['../util/index'], factory) : 11649 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory(global.Index)); 11650})(this, (function (index_js) { 'use strict'; 11651 11652 /** 11653 * -------------------------------------------------------------------------- 11654 * Bootstrap dom/selector-engine.js 11655 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11656 * -------------------------------------------------------------------------- 11657 */ 11658 11659 const getSelector = element => { 11660 let selector = element.getAttribute('data-bs-target'); 11661 if (!selector || selector === '#') { 11662 let hrefAttribute = element.getAttribute('href'); 11663 11664 // The only valid content that could double as a selector are IDs or classes, 11665 // so everything starting with `#` or `.`. If a "real" URL is used as the selector, 11666 // `document.querySelector` will rightfully complain it is invalid. 11667 // See https://github.com/twbs/bootstrap/issues/32273 11668 if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) { 11669 return null; 11670 } 11671 11672 // Just in case some CMS puts out a full URL with the anchor appended 11673 if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { 11674 hrefAttribute = `#${hrefAttribute.split('#')[1]}`; 11675 } 11676 selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; 11677 } 11678 return selector ? selector.split(',').map(sel => index_js.parseSelector(sel)).join(',') : null; 11679 }; 11680 const SelectorEngine = { 11681 find(selector, element = document.documentElement) { 11682 return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); 11683 }, 11684 findOne(selector, element = document.documentElement) { 11685 return Element.prototype.querySelector.call(element, selector); 11686 }, 11687 children(element, selector) { 11688 return [].concat(...element.children).filter(child => child.matches(selector)); 11689 }, 11690 parents(element, selector) { 11691 const parents = []; 11692 let ancestor = element.parentNode.closest(selector); 11693 while (ancestor) { 11694 parents.push(ancestor); 11695 ancestor = ancestor.parentNode.closest(selector); 11696 } 11697 return parents; 11698 }, 11699 prev(element, selector) { 11700 let previous = element.previousElementSibling; 11701 while (previous) { 11702 if (previous.matches(selector)) { 11703 return [previous]; 11704 } 11705 previous = previous.previousElementSibling; 11706 } 11707 return []; 11708 }, 11709 // TODO: this is now unused; remove later along with prev() 11710 next(element, selector) { 11711 let next = element.nextElementSibling; 11712 while (next) { 11713 if (next.matches(selector)) { 11714 return [next]; 11715 } 11716 next = next.nextElementSibling; 11717 } 11718 return []; 11719 }, 11720 focusableChildren(element) { 11721 const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); 11722 return this.find(focusables, element).filter(el => !index_js.isDisabled(el) && index_js.isVisible(el)); 11723 }, 11724 getSelectorFromElement(element) { 11725 const selector = getSelector(element); 11726 if (selector) { 11727 return SelectorEngine.findOne(selector) ? selector : null; 11728 } 11729 return null; 11730 }, 11731 getElementFromSelector(element) { 11732 const selector = getSelector(element); 11733 return selector ? SelectorEngine.findOne(selector) : null; 11734 }, 11735 getMultipleElementsFromSelector(element) { 11736 const selector = getSelector(element); 11737 return selector ? SelectorEngine.find(selector) : []; 11738 } 11739 }; 11740 11741 return SelectorEngine; 11742 11743})); 11744/*! 11745 * Bootstrap template-factory.js v5.3.8 (https://getbootstrap.com/) 11746 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11747 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11748 */ 11749(function (global, factory) { 11750 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/selector-engine.js'), require('./config.js'), require('./sanitizer.js'), require('./index.js')) : 11751 typeof define === 'function' && define.amd ? define(['../dom/selector-engine', './config', './sanitizer', './index'], factory) : 11752 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.TemplateFactory = factory(global.SelectorEngine, global.Config, global.Sanitizer, global.Index)); 11753})(this, (function (SelectorEngine, Config, sanitizer_js, index_js) { 'use strict'; 11754 11755 /** 11756 * -------------------------------------------------------------------------- 11757 * Bootstrap util/template-factory.js 11758 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11759 * -------------------------------------------------------------------------- 11760 */ 11761 11762 11763 /** 11764 * Constants 11765 */ 11766 11767 const NAME = 'TemplateFactory'; 11768 const Default = { 11769 allowList: sanitizer_js.DefaultAllowlist, 11770 content: {}, 11771 // { selector : text , selector2 : text2 , } 11772 extraClass: '', 11773 html: false, 11774 sanitize: true, 11775 sanitizeFn: null, 11776 template: '<div></div>' 11777 }; 11778 const DefaultType = { 11779 allowList: 'object', 11780 content: 'object', 11781 extraClass: '(string|function)', 11782 html: 'boolean', 11783 sanitize: 'boolean', 11784 sanitizeFn: '(null|function)', 11785 template: 'string' 11786 }; 11787 const DefaultContentType = { 11788 entry: '(string|element|function|null)', 11789 selector: '(string|element)' 11790 }; 11791 11792 /** 11793 * Class definition 11794 */ 11795 11796 class TemplateFactory extends Config { 11797 constructor(config) { 11798 super(); 11799 this._config = this._getConfig(config); 11800 } 11801 11802 // Getters 11803 static get Default() { 11804 return Default; 11805 } 11806 static get DefaultType() { 11807 return DefaultType; 11808 } 11809 static get NAME() { 11810 return NAME; 11811 } 11812 11813 // Public 11814 getContent() { 11815 return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); 11816 } 11817 hasContent() { 11818 return this.getContent().length > 0; 11819 } 11820 changeContent(content) { 11821 this._checkContent(content); 11822 this._config.content = { 11823 ...this._config.content, 11824 ...content 11825 }; 11826 return this; 11827 } 11828 toHtml() { 11829 const templateWrapper = document.createElement('div'); 11830 templateWrapper.innerHTML = this._maybeSanitize(this._config.template); 11831 for (const [selector, text] of Object.entries(this._config.content)) { 11832 this._setContent(templateWrapper, text, selector); 11833 } 11834 const template = templateWrapper.children[0]; 11835 const extraClass = this._resolvePossibleFunction(this._config.extraClass); 11836 if (extraClass) { 11837 template.classList.add(...extraClass.split(' ')); 11838 } 11839 return template; 11840 } 11841 11842 // Private 11843 _typeCheckConfig(config) { 11844 super._typeCheckConfig(config); 11845 this._checkContent(config.content); 11846 } 11847 _checkContent(arg) { 11848 for (const [selector, content] of Object.entries(arg)) { 11849 super._typeCheckConfig({ 11850 selector, 11851 entry: content 11852 }, DefaultContentType); 11853 } 11854 } 11855 _setContent(template, content, selector) { 11856 const templateElement = SelectorEngine.findOne(selector, template); 11857 if (!templateElement) { 11858 return; 11859 } 11860 content = this._resolvePossibleFunction(content); 11861 if (!content) { 11862 templateElement.remove(); 11863 return; 11864 } 11865 if (index_js.isElement(content)) { 11866 this._putElementInTemplate(index_js.getElement(content), templateElement); 11867 return; 11868 } 11869 if (this._config.html) { 11870 templateElement.innerHTML = this._maybeSanitize(content); 11871 return; 11872 } 11873 templateElement.textContent = content; 11874 } 11875 _maybeSanitize(arg) { 11876 return this._config.sanitize ? sanitizer_js.sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; 11877 } 11878 _resolvePossibleFunction(arg) { 11879 return index_js.execute(arg, [undefined, this]); 11880 } 11881 _putElementInTemplate(element, templateElement) { 11882 if (this._config.html) { 11883 templateElement.innerHTML = ''; 11884 templateElement.append(element); 11885 return; 11886 } 11887 templateElement.textContent = element.textContent; 11888 } 11889 } 11890 11891 return TemplateFactory; 11892 11893})); 11894/*! 11895 * Bootstrap tooltip.js v5.3.8 (https://getbootstrap.com/) 11896 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 11897 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11898 */ 11899(function (global, factory) { 11900 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./util/index.js'), require('./util/sanitizer.js'), require('./util/template-factory.js')) : 11901 typeof define === 'function' && define.amd ? define(['@popperjs/core', './base-component', './dom/event-handler', './dom/manipulator', './util/index', './util/sanitizer', './util/template-factory'], factory) : 11902 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global["@popperjs/core"], global.BaseComponent, global.EventHandler, global.Manipulator, global.Index, global.Sanitizer, global.TemplateFactory)); 11903})(this, (function (Popper, BaseComponent, EventHandler, Manipulator, index_js, sanitizer_js, TemplateFactory) { 'use strict'; 11904 11905 function _interopNamespaceDefault(e) { 11906 const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); 11907 if (e) { 11908 for (const k in e) { 11909 if (k !== 'default') { 11910 const d = Object.getOwnPropertyDescriptor(e, k); 11911 Object.defineProperty(n, k, d.get ? d : { 11912 enumerable: true, 11913 get: () => e[k] 11914 }); 11915 } 11916 } 11917 } 11918 n.default = e; 11919 return Object.freeze(n); 11920 } 11921 11922 const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); 11923 11924 /** 11925 * -------------------------------------------------------------------------- 11926 * Bootstrap tooltip.js 11927 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 11928 * -------------------------------------------------------------------------- 11929 */ 11930 11931 11932 /** 11933 * Constants 11934 */ 11935 11936 const NAME = 'tooltip'; 11937 const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); 11938 const CLASS_NAME_FADE = 'fade'; 11939 const CLASS_NAME_MODAL = 'modal'; 11940 const CLASS_NAME_SHOW = 'show'; 11941 const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 11942 const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; 11943 const EVENT_MODAL_HIDE = 'hide.bs.modal'; 11944 const TRIGGER_HOVER = 'hover'; 11945 const TRIGGER_FOCUS = 'focus'; 11946 const TRIGGER_CLICK = 'click'; 11947 const TRIGGER_MANUAL = 'manual'; 11948 const EVENT_HIDE = 'hide'; 11949 const EVENT_HIDDEN = 'hidden'; 11950 const EVENT_SHOW = 'show'; 11951 const EVENT_SHOWN = 'shown'; 11952 const EVENT_INSERTED = 'inserted'; 11953 const EVENT_CLICK = 'click'; 11954 const EVENT_FOCUSIN = 'focusin'; 11955 const EVENT_FOCUSOUT = 'focusout'; 11956 const EVENT_MOUSEENTER = 'mouseenter'; 11957 const EVENT_MOUSELEAVE = 'mouseleave'; 11958 const AttachmentMap = { 11959 AUTO: 'auto', 11960 TOP: 'top', 11961 RIGHT: index_js.isRTL() ? 'left' : 'right', 11962 BOTTOM: 'bottom', 11963 LEFT: index_js.isRTL() ? 'right' : 'left' 11964 }; 11965 const Default = { 11966 allowList: sanitizer_js.DefaultAllowlist, 11967 animation: true, 11968 boundary: 'clippingParents', 11969 container: false, 11970 customClass: '', 11971 delay: 0, 11972 fallbackPlacements: ['top', 'right', 'bottom', 'left'], 11973 html: false, 11974 offset: [0, 6], 11975 placement: 'top', 11976 popperConfig: null, 11977 sanitize: true, 11978 sanitizeFn: null, 11979 selector: false, 11980 template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', 11981 title: '', 11982 trigger: 'hover focus' 11983 }; 11984 const DefaultType = { 11985 allowList: 'object', 11986 animation: 'boolean', 11987 boundary: '(string|element)', 11988 container: '(string|element|boolean)', 11989 customClass: '(string|function)', 11990 delay: '(number|object)', 11991 fallbackPlacements: 'array', 11992 html: 'boolean', 11993 offset: '(array|string|function)', 11994 placement: '(string|function)', 11995 popperConfig: '(null|object|function)', 11996 sanitize: 'boolean', 11997 sanitizeFn: '(null|function)', 11998 selector: '(string|boolean)', 11999 template: 'string', 12000 title: '(string|element|function)', 12001 trigger: 'string' 12002 }; 12003 12004 /** 12005 * Class definition 12006 */ 12007 12008 class Tooltip extends BaseComponent { 12009 constructor(element, config) { 12010 if (typeof Popper__namespace === 'undefined') { 12011 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org/docs/v2/)'); 12012 } 12013 super(element, config); 12014 12015 // Private 12016 this._isEnabled = true; 12017 this._timeout = 0; 12018 this._isHovered = null; 12019 this._activeTrigger = {}; 12020 this._popper = null; 12021 this._templateFactory = null; 12022 this._newContent = null; 12023 12024 // Protected 12025 this.tip = null; 12026 this._setListeners(); 12027 if (!this._config.selector) { 12028 this._fixTitle(); 12029 } 12030 } 12031 12032 // Getters 12033 static get Default() { 12034 return Default; 12035 } 12036 static get DefaultType() { 12037 return DefaultType; 12038 } 12039 static get NAME() { 12040 return NAME; 12041 } 12042 12043 // Public 12044 enable() { 12045 this._isEnabled = true; 12046 } 12047 disable() { 12048 this._isEnabled = false; 12049 } 12050 toggleEnabled() { 12051 this._isEnabled = !this._isEnabled; 12052 } 12053 toggle() { 12054 if (!this._isEnabled) { 12055 return; 12056 } 12057 if (this._isShown()) { 12058 this._leave(); 12059 return; 12060 } 12061 this._enter(); 12062 } 12063 dispose() { 12064 clearTimeout(this._timeout); 12065 EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); 12066 if (this._element.getAttribute('data-bs-original-title')) { 12067 this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); 12068 } 12069 this._disposePopper(); 12070 super.dispose(); 12071 } 12072 show() { 12073 if (this._element.style.display === 'none') { 12074 throw new Error('Please use show on visible elements'); 12075 } 12076 if (!(this._isWithContent() && this._isEnabled)) { 12077 return; 12078 } 12079 const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW)); 12080 const shadowRoot = index_js.findShadowRoot(this._element); 12081 const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); 12082 if (showEvent.defaultPrevented || !isInTheDom) { 12083 return; 12084 } 12085 12086 // TODO: v6 remove this or make it optional 12087 this._disposePopper(); 12088 const tip = this._getTipElement(); 12089 this._element.setAttribute('aria-describedby', tip.getAttribute('id')); 12090 const { 12091 container 12092 } = this._config; 12093 if (!this._element.ownerDocument.documentElement.contains(this.tip)) { 12094 container.append(tip); 12095 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); 12096 } 12097 this._popper = this._createPopper(tip); 12098 tip.classList.add(CLASS_NAME_SHOW); 12099 12100 // If this is a touch-enabled device we add extra 12101 // empty mouseover listeners to the body's immediate children; 12102 // only needed because of broken event delegation on iOS 12103 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 12104 if ('ontouchstart' in document.documentElement) { 12105 for (const element of [].concat(...document.body.children)) { 12106 EventHandler.on(element, 'mouseover', index_js.noop); 12107 } 12108 } 12109 const complete = () => { 12110 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN)); 12111 if (this._isHovered === false) { 12112 this._leave(); 12113 } 12114 this._isHovered = false; 12115 }; 12116 this._queueCallback(complete, this.tip, this._isAnimated()); 12117 } 12118 hide() { 12119 if (!this._isShown()) { 12120 return; 12121 } 12122 const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE)); 12123 if (hideEvent.defaultPrevented) { 12124 return; 12125 } 12126 const tip = this._getTipElement(); 12127 tip.classList.remove(CLASS_NAME_SHOW); 12128 12129 // If this is a touch-enabled device we remove the extra 12130 // empty mouseover listeners we added for iOS support 12131 if ('ontouchstart' in document.documentElement) { 12132 for (const element of [].concat(...document.body.children)) { 12133 EventHandler.off(element, 'mouseover', index_js.noop); 12134 } 12135 } 12136 this._activeTrigger[TRIGGER_CLICK] = false; 12137 this._activeTrigger[TRIGGER_FOCUS] = false; 12138 this._activeTrigger[TRIGGER_HOVER] = false; 12139 this._isHovered = null; // it is a trick to support manual triggering 12140 12141 const complete = () => { 12142 if (this._isWithActiveTrigger()) { 12143 return; 12144 } 12145 if (!this._isHovered) { 12146 this._disposePopper(); 12147 } 12148 this._element.removeAttribute('aria-describedby'); 12149 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN)); 12150 }; 12151 this._queueCallback(complete, this.tip, this._isAnimated()); 12152 } 12153 update() { 12154 if (this._popper) { 12155 this._popper.update(); 12156 } 12157 } 12158 12159 // Protected 12160 _isWithContent() { 12161 return Boolean(this._getTitle()); 12162 } 12163 _getTipElement() { 12164 if (!this.tip) { 12165 this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); 12166 } 12167 return this.tip; 12168 } 12169 _createTipElement(content) { 12170 const tip = this._getTemplateFactory(content).toHtml(); 12171 12172 // TODO: remove this check in v6 12173 if (!tip) { 12174 return null; 12175 } 12176 tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW); 12177 // TODO: v6 the following can be achieved with CSS only 12178 tip.classList.add(`bs-${this.constructor.NAME}-auto`); 12179 const tipId = index_js.getUID(this.constructor.NAME).toString(); 12180 tip.setAttribute('id', tipId); 12181 if (this._isAnimated()) { 12182 tip.classList.add(CLASS_NAME_FADE); 12183 } 12184 return tip; 12185 } 12186 setContent(content) { 12187 this._newContent = content; 12188 if (this._isShown()) { 12189 this._disposePopper(); 12190 this.show(); 12191 } 12192 } 12193 _getTemplateFactory(content) { 12194 if (this._templateFactory) { 12195 this._templateFactory.changeContent(content); 12196 } else { 12197 this._templateFactory = new TemplateFactory({ 12198 ...this._config, 12199 // the `content` var has to be after `this._config` 12200 // to override config.content in case of popover 12201 content, 12202 extraClass: this._resolvePossibleFunction(this._config.customClass) 12203 }); 12204 } 12205 return this._templateFactory; 12206 } 12207 _getContentForTemplate() { 12208 return { 12209 [SELECTOR_TOOLTIP_INNER]: this._getTitle() 12210 }; 12211 } 12212 _getTitle() { 12213 return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); 12214 } 12215 12216 // Private 12217 _initializeOnDelegatedTarget(event) { 12218 return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); 12219 } 12220 _isAnimated() { 12221 return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE); 12222 } 12223 _isShown() { 12224 return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW); 12225 } 12226 _createPopper(tip) { 12227 const placement = index_js.execute(this._config.placement, [this, tip, this._element]); 12228 const attachment = AttachmentMap[placement.toUpperCase()]; 12229 return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); 12230 } 12231 _getOffset() { 12232 const { 12233 offset 12234 } = this._config; 12235 if (typeof offset === 'string') { 12236 return offset.split(',').map(value => Number.parseInt(value, 10)); 12237 } 12238 if (typeof offset === 'function') { 12239 return popperData => offset(popperData, this._element); 12240 } 12241 return offset; 12242 } 12243 _resolvePossibleFunction(arg) { 12244 return index_js.execute(arg, [this._element, this._element]); 12245 } 12246 _getPopperConfig(attachment) { 12247 const defaultBsPopperConfig = { 12248 placement: attachment, 12249 modifiers: [{ 12250 name: 'flip', 12251 options: { 12252 fallbackPlacements: this._config.fallbackPlacements 12253 } 12254 }, { 12255 name: 'offset', 12256 options: { 12257 offset: this._getOffset() 12258 } 12259 }, { 12260 name: 'preventOverflow', 12261 options: { 12262 boundary: this._config.boundary 12263 } 12264 }, { 12265 name: 'arrow', 12266 options: { 12267 element: `.${this.constructor.NAME}-arrow` 12268 } 12269 }, { 12270 name: 'preSetPlacement', 12271 enabled: true, 12272 phase: 'beforeMain', 12273 fn: data => { 12274 // Pre-set Popper's placement attribute in order to read the arrow sizes properly. 12275 // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement 12276 this._getTipElement().setAttribute('data-popper-placement', data.state.placement); 12277 } 12278 }] 12279 }; 12280 return { 12281 ...defaultBsPopperConfig, 12282 ...index_js.execute(this._config.popperConfig, [undefined, defaultBsPopperConfig]) 12283 }; 12284 } 12285 _setListeners() { 12286 const triggers = this._config.trigger.split(' '); 12287 for (const trigger of triggers) { 12288 if (trigger === 'click') { 12289 EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => { 12290 const context = this._initializeOnDelegatedTarget(event); 12291 context._activeTrigger[TRIGGER_CLICK] = !(context._isShown() && context._activeTrigger[TRIGGER_CLICK]); 12292 context.toggle(); 12293 }); 12294 } else if (trigger !== TRIGGER_MANUAL) { 12295 const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN); 12296 const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT); 12297 EventHandler.on(this._element, eventIn, this._config.selector, event => { 12298 const context = this._initializeOnDelegatedTarget(event); 12299 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 12300 context._enter(); 12301 }); 12302 EventHandler.on(this._element, eventOut, this._config.selector, event => { 12303 const context = this._initializeOnDelegatedTarget(event); 12304 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); 12305 context._leave(); 12306 }); 12307 } 12308 } 12309 this._hideModalHandler = () => { 12310 if (this._element) { 12311 this.hide(); 12312 } 12313 }; 12314 EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); 12315 } 12316 _fixTitle() { 12317 const title = this._element.getAttribute('title'); 12318 if (!title) { 12319 return; 12320 } 12321 if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { 12322 this._element.setAttribute('aria-label', title); 12323 } 12324 this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility 12325 this._element.removeAttribute('title'); 12326 } 12327 _enter() { 12328 if (this._isShown() || this._isHovered) { 12329 this._isHovered = true; 12330 return; 12331 } 12332 this._isHovered = true; 12333 this._setTimeout(() => { 12334 if (this._isHovered) { 12335 this.show(); 12336 } 12337 }, this._config.delay.show); 12338 } 12339 _leave() { 12340 if (this._isWithActiveTrigger()) { 12341 return; 12342 } 12343 this._isHovered = false;
vendor: 5,127 bytes, lines 12344-12517
12344 this._setTimeout(() => { 12345 if (!this._isHovered) { 12346 this.hide(); 12347 } 12348 }, this._config.delay.hide); 12349 } 12350 _setTimeout(handler, timeout) { 12351 clearTimeout(this._timeout); 12352 this._timeout = setTimeout(handler, timeout); 12353 } 12354 _isWithActiveTrigger() { 12355 return Object.values(this._activeTrigger).includes(true); 12356 } 12357 _getConfig(config) { 12358 const dataAttributes = Manipulator.getDataAttributes(this._element); 12359 for (const dataAttribute of Object.keys(dataAttributes)) { 12360 if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { 12361 delete dataAttributes[dataAttribute]; 12362 } 12363 } 12364 config = { 12365 ...dataAttributes, 12366 ...(typeof config === 'object' && config ? config : {}) 12367 }; 12368 config = this._mergeConfigObj(config); 12369 config = this._configAfterMerge(config); 12370 this._typeCheckConfig(config); 12371 return config; 12372 } 12373 _configAfterMerge(config) { 12374 config.container = config.container === false ? document.body : index_js.getElement(config.container); 12375 if (typeof config.delay === 'number') { 12376 config.delay = { 12377 show: config.delay, 12378 hide: config.delay 12379 }; 12380 } 12381 if (typeof config.title === 'number') { 12382 config.title = config.title.toString(); 12383 } 12384 if (typeof config.content === 'number') { 12385 config.content = config.content.toString(); 12386 } 12387 return config; 12388 } 12389 _getDelegateConfig() { 12390 const config = {}; 12391 for (const [key, value] of Object.entries(this._config)) { 12392 if (this.constructor.Default[key] !== value) { 12393 config[key] = value; 12394 } 12395 } 12396 config.selector = false; 12397 config.trigger = 'manual'; 12398 12399 // In the future can be replaced with: 12400 // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) 12401 // `Object.fromEntries(keysWithDifferentValues)` 12402 return config; 12403 } 12404 _disposePopper() { 12405 if (this._popper) { 12406 this._popper.destroy(); 12407 this._popper = null; 12408 } 12409 if (this.tip) { 12410 this.tip.remove(); 12411 this.tip = null; 12412 } 12413 } 12414 12415 // Static 12416 static jQueryInterface(config) { 12417 return this.each(function () { 12418 const data = Tooltip.getOrCreateInstance(this, config); 12419 if (typeof config !== 'string') { 12420 return; 12421 } 12422 if (typeof data[config] === 'undefined') { 12423 throw new TypeError(`No method named "${config}"`); 12424 } 12425 data[config](); 12426 }); 12427 } 12428 } 12429 12430 /** 12431 * jQuery 12432 */ 12433 12434 index_js.defineJQueryPlugin(Tooltip); 12435 12436 return Tooltip; 12437 12438})); 12439/*! 12440 * Bootstrap popover.js v5.3.8 (https://getbootstrap.com/) 12441 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12442 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12443 */ 12444(function (global, factory) { 12445 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./tooltip.js'), require('./util/index.js')) : 12446 typeof define === 'function' && define.amd ? define(['./tooltip', './util/index'], factory) : 12447 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.Tooltip, global.Index)); 12448})(this, (function (Tooltip, index_js) { 'use strict'; 12449 12450 /** 12451 * -------------------------------------------------------------------------- 12452 * Bootstrap popover.js 12453 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12454 * -------------------------------------------------------------------------- 12455 */ 12456 12457 12458 /** 12459 * Constants 12460 */ 12461 12462 const NAME = 'popover'; 12463 const SELECTOR_TITLE = '.popover-header'; 12464 const SELECTOR_CONTENT = '.popover-body'; 12465 const Default = { 12466 ...Tooltip.Default, 12467 content: '', 12468 offset: [0, 8], 12469 placement: 'right', 12470 template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>', 12471 trigger: 'click' 12472 }; 12473 const DefaultType = { 12474 ...Tooltip.DefaultType, 12475 content: '(null|string|element|function)' 12476 }; 12477 12478 /** 12479 * Class definition 12480 */ 12481 12482 class Popover extends Tooltip { 12483 // Getters 12484 static get Default() { 12485 return Default; 12486 } 12487 static get DefaultType() { 12488 return DefaultType; 12489 } 12490 static get NAME() { 12491 return NAME; 12492 } 12493 12494 // Overrides 12495 _isWithContent() { 12496 return this._getTitle() || this._getContent(); 12497 } 12498 12499 // Private 12500 _getContentForTemplate() { 12501 return { 12502 [SELECTOR_TITLE]: this._getTitle(), 12503 [SELECTOR_CONTENT]: this._getContent() 12504 }; 12505 } 12506 _getContent() { 12507 return this._resolvePossibleFunction(this._config.content); 12508 } 12509 12510 // Static 12511 static jQueryInterface(config) { 12512 return this.each(function () { 12513 const data = Popover.getOrCreateInstance(this, config); 12514 if (typeof config !== 'string') { 12515 return; 12516 } 12517 if (typeof data[config] === 'undefined') {
12518 throw new TypeError(`No method named "${config}"`); 12519 } 12520 data[config](); 12521 }); 12522 } 12523 } 12524 12525 /** 12526 * jQuery 12527 */ 12528 12529 index_js.defineJQueryPlugin(Popover); 12530 12531 return Popover; 12532 12533})); 12534/*! 12535 * Bootstrap component-functions.js v5.3.8 (https://getbootstrap.com/) 12536 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12537 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12538 */ 12539(function (global, factory) { 12540 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('../dom/event-handler.js'), require('../dom/selector-engine.js'), require('./index.js')) : 12541 typeof define === 'function' && define.amd ? define(['exports', '../dom/event-handler', '../dom/selector-engine', './index'], factory) : 12542 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ComponentFunctions = {}, global.EventHandler, global.SelectorEngine, global.Index)); 12543})(this, (function (exports, EventHandler, SelectorEngine, index_js) { 'use strict'; 12544 12545 /** 12546 * -------------------------------------------------------------------------- 12547 * Bootstrap util/component-functions.js 12548 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12549 * -------------------------------------------------------------------------- 12550 */ 12551 12552 const enableDismissTrigger = (component, method = 'hide') => { 12553 const clickEvent = `click.dismiss${component.EVENT_KEY}`; 12554 const name = component.NAME; 12555 EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { 12556 if (['A', 'AREA'].includes(this.tagName)) { 12557 event.preventDefault(); 12558 } 12559 if (index_js.isDisabled(this)) { 12560 return; 12561 } 12562 const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); 12563 const instance = component.getOrCreateInstance(target); 12564 12565 // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method 12566 instance[method](); 12567 }); 12568 }; 12569 12570 exports.enableDismissTrigger = enableDismissTrigger; 12571 12572 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 12573 12574})); 12575/*! 12576 * Bootstrap alert.js v5.3.8 (https://getbootstrap.com/) 12577 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12578 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12579 */ 12580(function (global, factory) { 12581 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./util/component-functions.js'), require('./util/index.js')) : 12582 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/component-functions', './util/index'], factory) : 12583 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.BaseComponent, global.EventHandler, global.ComponentFunctions, global.Index)); 12584})(this, (function (BaseComponent, EventHandler, componentFunctions_js, index_js) { 'use strict'; 12585 12586 /** 12587 * -------------------------------------------------------------------------- 12588 * Bootstrap alert.js 12589 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12590 * -------------------------------------------------------------------------- 12591 */ 12592 12593 12594 /** 12595 * Constants 12596 */ 12597 12598 const NAME = 'alert'; 12599 const DATA_KEY = 'bs.alert'; 12600 const EVENT_KEY = `.${DATA_KEY}`; 12601 const EVENT_CLOSE = `close${EVENT_KEY}`; 12602 const EVENT_CLOSED = `closed${EVENT_KEY}`; 12603 const CLASS_NAME_FADE = 'fade';
12604 const CLASS_NAME_SHOW = 'show'; 12605 12606 /** 12607 * Class definition 12608 */ 12609 12610 class Alert extends BaseComponent { 12611 // Getters 12612 static get NAME() { 12613 return NAME; 12614 } 12615 12616 // Public 12617 close() { 12618 const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); 12619 if (closeEvent.defaultPrevented) { 12620 return; 12621 } 12622 this._element.classList.remove(CLASS_NAME_SHOW); 12623 const isAnimated = this._element.classList.contains(CLASS_NAME_FADE); 12624 this._queueCallback(() => this._destroyElement(), this._element, isAnimated); 12625 } 12626 12627 // Private 12628 _destroyElement() { 12629 this._element.remove(); 12630 EventHandler.trigger(this._element, EVENT_CLOSED); 12631 this.dispose(); 12632 } 12633 12634 // Static 12635 static jQueryInterface(config) { 12636 return this.each(function () { 12637 const data = Alert.getOrCreateInstance(this); 12638 if (typeof config !== 'string') { 12639 return; 12640 } 12641 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 12642 throw new TypeError(`No method named "${config}"`); 12643 } 12644 data[config](this); 12645 }); 12646 } 12647 } 12648 12649 /** 12650 * Data API implementation 12651 */ 12652 12653 componentFunctions_js.enableDismissTrigger(Alert, 'close'); 12654 12655 /** 12656 * jQuery 12657 */ 12658 12659 index_js.defineJQueryPlugin(Alert); 12660 12661 return Alert; 12662 12663})); 12664/*! 12665 * Bootstrap toast.js v5.3.8 (https://getbootstrap.com/) 12666 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12667 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12668 */ 12669(function (global, factory) { 12670 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./util/component-functions.js'), require('./util/index.js')) : 12671 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/component-functions', './util/index'], factory) : 12672 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.BaseComponent, global.EventHandler, global.ComponentFunctions, global.Index)); 12673})(this, (function (BaseComponent, EventHandler, componentFunctions_js, index_js) { 'use strict'; 12674 12675 /** 12676 * -------------------------------------------------------------------------- 12677 * Bootstrap toast.js 12678 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12679 * -------------------------------------------------------------------------- 12680 */ 12681 12682 12683 /** 12684 * Constants 12685 */ 12686 12687 const NAME = 'toast'; 12688 const DATA_KEY = 'bs.toast'; 12689 const EVENT_KEY = `.${DATA_KEY}`; 12690 const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; 12691 const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; 12692 const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; 12693 const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; 12694 const EVENT_HIDE = `hide${EVENT_KEY}`; 12695 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 12696 const EVENT_SHOW = `show${EVENT_KEY}`; 12697 const EVENT_SHOWN = `shown${EVENT_KEY}`; 12698 const CLASS_NAME_FADE = 'fade';
vendor: 4,104 bytes, lines 12699-12837
12699 const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility 12700 const CLASS_NAME_SHOW = 'show'; 12701 const CLASS_NAME_SHOWING = 'showing'; 12702 const DefaultType = { 12703 animation: 'boolean', 12704 autohide: 'boolean', 12705 delay: 'number' 12706 }; 12707 const Default = { 12708 animation: true, 12709 autohide: true, 12710 delay: 5000 12711 }; 12712 12713 /** 12714 * Class definition 12715 */ 12716 12717 class Toast extends BaseComponent { 12718 constructor(element, config) { 12719 super(element, config); 12720 this._timeout = null; 12721 this._hasMouseInteraction = false; 12722 this._hasKeyboardInteraction = false; 12723 this._setListeners(); 12724 } 12725 12726 // Getters 12727 static get Default() { 12728 return Default; 12729 } 12730 static get DefaultType() { 12731 return DefaultType; 12732 } 12733 static get NAME() { 12734 return NAME; 12735 } 12736 12737 // Public 12738 show() { 12739 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); 12740 if (showEvent.defaultPrevented) { 12741 return; 12742 } 12743 this._clearTimeout(); 12744 if (this._config.animation) { 12745 this._element.classList.add(CLASS_NAME_FADE); 12746 } 12747 const complete = () => { 12748 this._element.classList.remove(CLASS_NAME_SHOWING); 12749 EventHandler.trigger(this._element, EVENT_SHOWN); 12750 this._maybeScheduleHide(); 12751 }; 12752 this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated 12753 index_js.reflow(this._element); 12754 this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING); 12755 this._queueCallback(complete, this._element, this._config.animation); 12756 } 12757 hide() { 12758 if (!this.isShown()) { 12759 return; 12760 } 12761 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); 12762 if (hideEvent.defaultPrevented) { 12763 return; 12764 } 12765 const complete = () => { 12766 this._element.classList.add(CLASS_NAME_HIDE); // @deprecated 12767 this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW); 12768 EventHandler.trigger(this._element, EVENT_HIDDEN); 12769 }; 12770 this._element.classList.add(CLASS_NAME_SHOWING); 12771 this._queueCallback(complete, this._element, this._config.animation); 12772 } 12773 dispose() { 12774 this._clearTimeout(); 12775 if (this.isShown()) { 12776 this._element.classList.remove(CLASS_NAME_SHOW); 12777 } 12778 super.dispose(); 12779 } 12780 isShown() { 12781 return this._element.classList.contains(CLASS_NAME_SHOW); 12782 } 12783 12784 // Private 12785 _maybeScheduleHide() { 12786 if (!this._config.autohide) { 12787 return; 12788 } 12789 if (this._hasMouseInteraction || this._hasKeyboardInteraction) { 12790 return; 12791 } 12792 this._timeout = setTimeout(() => { 12793 this.hide(); 12794 }, this._config.delay); 12795 } 12796 _onInteraction(event, isInteracting) { 12797 switch (event.type) { 12798 case 'mouseover': 12799 case 'mouseout': 12800 { 12801 this._hasMouseInteraction = isInteracting; 12802 break; 12803 } 12804 case 'focusin': 12805 case 'focusout': 12806 { 12807 this._hasKeyboardInteraction = isInteracting; 12808 break; 12809 } 12810 } 12811 if (isInteracting) { 12812 this._clearTimeout(); 12813 return; 12814 } 12815 const nextElement = event.relatedTarget; 12816 if (this._element === nextElement || this._element.contains(nextElement)) { 12817 return; 12818 } 12819 this._maybeScheduleHide(); 12820 } 12821 _setListeners() { 12822 EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); 12823 EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); 12824 EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); 12825 EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); 12826 } 12827 _clearTimeout() { 12828 clearTimeout(this._timeout); 12829 this._timeout = null; 12830 } 12831 12832 // Static 12833 static jQueryInterface(config) { 12834 return this.each(function () { 12835 const data = Toast.getOrCreateInstance(this, config); 12836 if (typeof config === 'string') { 12837 if (typeof data[config] === 'undefined') {
12838 throw new TypeError(`No method named "${config}"`); 12839 } 12840 data[config](this); 12841 } 12842 }); 12843 } 12844 } 12845 12846 /** 12847 * Data API implementation 12848 */ 12849 12850 componentFunctions_js.enableDismissTrigger(Toast); 12851 12852 /** 12853 * jQuery 12854 */ 12855 12856 index_js.defineJQueryPlugin(Toast); 12857 12858 return Toast; 12859 12860})); 12861/*! 12862 * Bootstrap button.js v5.3.8 (https://getbootstrap.com/) 12863 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12864 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12865 */ 12866(function (global, factory) { 12867 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./util/index.js')) : 12868 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/index'], factory) : 12869 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.BaseComponent, global.EventHandler, global.Index)); 12870})(this, (function (BaseComponent, EventHandler, index_js) { 'use strict'; 12871 12872 /** 12873 * -------------------------------------------------------------------------- 12874 * Bootstrap button.js 12875 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12876 * -------------------------------------------------------------------------- 12877 */ 12878 12879 12880 /** 12881 * Constants 12882 */ 12883 12884 const NAME = 'button'; 12885 const DATA_KEY = 'bs.button'; 12886 const EVENT_KEY = `.${DATA_KEY}`; 12887 const DATA_API_KEY = '.data-api'; 12888 const CLASS_NAME_ACTIVE = 'active'; 12889 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]'; 12890 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 12891 12892 /** 12893 * Class definition 12894 */ 12895 12896 class Button extends BaseComponent { 12897 // Getters 12898 static get NAME() { 12899 return NAME; 12900 } 12901 12902 // Public 12903 toggle() { 12904 // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method 12905 this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE)); 12906 } 12907 12908 // Static 12909 static jQueryInterface(config) { 12910 return this.each(function () { 12911 const data = Button.getOrCreateInstance(this); 12912 if (config === 'toggle') { 12913 data[config](); 12914 } 12915 }); 12916 } 12917 } 12918 12919 /** 12920 * Data API implementation 12921 */ 12922 12923 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => { 12924 event.preventDefault(); 12925 const button = event.target.closest(SELECTOR_DATA_TOGGLE); 12926 const data = Button.getOrCreateInstance(button); 12927 data.toggle(); 12928 }); 12929 12930 /** 12931 * jQuery 12932 */ 12933 12934 index_js.defineJQueryPlugin(Button); 12935 12936 return Button; 12937 12938})); 12939/*! 12940 * Bootstrap collapse.js v5.3.8 (https://getbootstrap.com/) 12941 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 12942 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12943 */ 12944(function (global, factory) { 12945 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/index.js')) : 12946 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/index'], factory) : 12947 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Index)); 12948})(this, (function (BaseComponent, EventHandler, SelectorEngine, index_js) { 'use strict'; 12949 12950 /** 12951 * -------------------------------------------------------------------------- 12952 * Bootstrap collapse.js 12953 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 12954 * -------------------------------------------------------------------------- 12955 */ 12956 12957 12958 /** 12959 * Constants 12960 */ 12961 12962 const NAME = 'collapse'; 12963 const DATA_KEY = 'bs.collapse'; 12964 const EVENT_KEY = `.${DATA_KEY}`; 12965 const DATA_API_KEY = '.data-api'; 12966 const EVENT_SHOW = `show${EVENT_KEY}`; 12967 const EVENT_SHOWN = `shown${EVENT_KEY}`; 12968 const EVENT_HIDE = `hide${EVENT_KEY}`; 12969 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 12970 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 12971 const CLASS_NAME_SHOW = 'show'; 12972 const CLASS_NAME_COLLAPSE = 'collapse'; 12973 const CLASS_NAME_COLLAPSING = 'collapsing'; 12974 const CLASS_NAME_COLLAPSED = 'collapsed'; 12975 const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; 12976 const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; 12977 const WIDTH = 'width'; 12978 const HEIGHT = 'height';
vendor: 5,837 bytes, lines 12979-13148
12979 const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; 12980 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]'; 12981 const Default = { 12982 parent: null, 12983 toggle: true 12984 }; 12985 const DefaultType = { 12986 parent: '(null|element)', 12987 toggle: 'boolean' 12988 }; 12989 12990 /** 12991 * Class definition 12992 */ 12993 12994 class Collapse extends BaseComponent { 12995 constructor(element, config) { 12996 super(element, config); 12997 this._isTransitioning = false; 12998 this._triggerArray = []; 12999 const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE); 13000 for (const elem of toggleList) { 13001 const selector = SelectorEngine.getSelectorFromElement(elem); 13002 const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); 13003 if (selector !== null && filterElement.length) { 13004 this._triggerArray.push(elem); 13005 } 13006 } 13007 this._initializeChildren(); 13008 if (!this._config.parent) { 13009 this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); 13010 } 13011 if (this._config.toggle) { 13012 this.toggle(); 13013 } 13014 } 13015 13016 // Getters 13017 static get Default() { 13018 return Default; 13019 } 13020 static get DefaultType() { 13021 return DefaultType; 13022 } 13023 static get NAME() { 13024 return NAME; 13025 } 13026 13027 // Public 13028 toggle() { 13029 if (this._isShown()) { 13030 this.hide(); 13031 } else { 13032 this.show(); 13033 } 13034 } 13035 show() { 13036 if (this._isTransitioning || this._isShown()) { 13037 return; 13038 } 13039 let activeChildren = []; 13040 13041 // find active children 13042 if (this._config.parent) { 13043 activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { 13044 toggle: false 13045 })); 13046 } 13047 if (activeChildren.length && activeChildren[0]._isTransitioning) { 13048 return; 13049 } 13050 const startEvent = EventHandler.trigger(this._element, EVENT_SHOW); 13051 if (startEvent.defaultPrevented) { 13052 return; 13053 } 13054 for (const activeInstance of activeChildren) { 13055 activeInstance.hide(); 13056 } 13057 const dimension = this._getDimension(); 13058 this._element.classList.remove(CLASS_NAME_COLLAPSE); 13059 this._element.classList.add(CLASS_NAME_COLLAPSING); 13060 this._element.style[dimension] = 0; 13061 this._addAriaAndCollapsedClass(this._triggerArray, true); 13062 this._isTransitioning = true; 13063 const complete = () => { 13064 this._isTransitioning = false; 13065 this._element.classList.remove(CLASS_NAME_COLLAPSING); 13066 this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW); 13067 this._element.style[dimension] = ''; 13068 EventHandler.trigger(this._element, EVENT_SHOWN); 13069 }; 13070 const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 13071 const scrollSize = `scroll${capitalizedDimension}`; 13072 this._queueCallback(complete, this._element, true); 13073 this._element.style[dimension] = `${this._element[scrollSize]}px`; 13074 } 13075 hide() { 13076 if (this._isTransitioning || !this._isShown()) { 13077 return; 13078 } 13079 const startEvent = EventHandler.trigger(this._element, EVENT_HIDE); 13080 if (startEvent.defaultPrevented) { 13081 return; 13082 } 13083 const dimension = this._getDimension(); 13084 this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; 13085 index_js.reflow(this._element); 13086 this._element.classList.add(CLASS_NAME_COLLAPSING); 13087 this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW); 13088 for (const trigger of this._triggerArray) { 13089 const element = SelectorEngine.getElementFromSelector(trigger); 13090 if (element && !this._isShown(element)) { 13091 this._addAriaAndCollapsedClass([trigger], false); 13092 } 13093 } 13094 this._isTransitioning = true; 13095 const complete = () => { 13096 this._isTransitioning = false; 13097 this._element.classList.remove(CLASS_NAME_COLLAPSING); 13098 this._element.classList.add(CLASS_NAME_COLLAPSE); 13099 EventHandler.trigger(this._element, EVENT_HIDDEN); 13100 }; 13101 this._element.style[dimension] = ''; 13102 this._queueCallback(complete, this._element, true); 13103 } 13104 13105 // Private 13106 _isShown(element = this._element) { 13107 return element.classList.contains(CLASS_NAME_SHOW); 13108 } 13109 _configAfterMerge(config) { 13110 config.toggle = Boolean(config.toggle); // Coerce string values 13111 config.parent = index_js.getElement(config.parent); 13112 return config; 13113 } 13114 _getDimension() { 13115 return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; 13116 } 13117 _initializeChildren() { 13118 if (!this._config.parent) { 13119 return; 13120 } 13121 const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE); 13122 for (const element of children) { 13123 const selected = SelectorEngine.getElementFromSelector(element); 13124 if (selected) { 13125 this._addAriaAndCollapsedClass([element], this._isShown(selected)); 13126 } 13127 } 13128 } 13129 _getFirstLevelChildren(selector) { 13130 const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); 13131 // remove children if greater depth 13132 return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); 13133 } 13134 _addAriaAndCollapsedClass(triggerArray, isOpen) { 13135 if (!triggerArray.length) { 13136 return; 13137 } 13138 for (const element of triggerArray) { 13139 element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); 13140 element.setAttribute('aria-expanded', isOpen); 13141 } 13142 } 13143 13144 // Static 13145 static jQueryInterface(config) { 13146 const _config = {}; 13147 if (typeof config === 'string' && /show|hide/.test(config)) { 13148 _config.toggle = false;
vendor: 7,551 bytes, lines 13149-13339
13149 } 13150 return this.each(function () { 13151 const data = Collapse.getOrCreateInstance(this, _config); 13152 if (typeof config === 'string') { 13153 if (typeof data[config] === 'undefined') { 13154 throw new TypeError(`No method named "${config}"`); 13155 } 13156 data[config](); 13157 } 13158 }); 13159 } 13160 } 13161 13162 /** 13163 * Data API implementation 13164 */ 13165 13166 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 13167 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 13168 if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { 13169 event.preventDefault(); 13170 } 13171 for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { 13172 Collapse.getOrCreateInstance(element, { 13173 toggle: false 13174 }).toggle(); 13175 } 13176 }); 13177 13178 /** 13179 * jQuery 13180 */ 13181 13182 index_js.defineJQueryPlugin(Collapse); 13183 13184 return Collapse; 13185 13186})); 13187/*! 13188 * Bootstrap scrollbar.js v5.3.8 (https://getbootstrap.com/) 13189 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13190 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13191 */ 13192(function (global, factory) { 13193 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/manipulator.js'), require('../dom/selector-engine.js'), require('./index.js')) : 13194 typeof define === 'function' && define.amd ? define(['../dom/manipulator', '../dom/selector-engine', './index'], factory) : 13195 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Scrollbar = factory(global.Manipulator, global.SelectorEngine, global.Index)); 13196})(this, (function (Manipulator, SelectorEngine, index_js) { 'use strict'; 13197 13198 /** 13199 * -------------------------------------------------------------------------- 13200 * Bootstrap util/scrollBar.js 13201 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13202 * -------------------------------------------------------------------------- 13203 */ 13204 13205 13206 /** 13207 * Constants 13208 */ 13209 13210 const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 13211 const SELECTOR_STICKY_CONTENT = '.sticky-top'; 13212 const PROPERTY_PADDING = 'padding-right'; 13213 const PROPERTY_MARGIN = 'margin-right'; 13214 13215 /** 13216 * Class definition 13217 */ 13218 13219 class ScrollBarHelper { 13220 constructor() { 13221 this._element = document.body; 13222 } 13223 13224 // Public 13225 getWidth() { 13226 // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes 13227 const documentWidth = document.documentElement.clientWidth; 13228 return Math.abs(window.innerWidth - documentWidth); 13229 } 13230 hide() { 13231 const width = this.getWidth(); 13232 this._disableOverFlow(); 13233 // give padding to element to balance the hidden scrollbar width 13234 this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); 13235 // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth 13236 this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); 13237 this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); 13238 } 13239 reset() { 13240 this._resetElementAttributes(this._element, 'overflow'); 13241 this._resetElementAttributes(this._element, PROPERTY_PADDING); 13242 this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); 13243 this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); 13244 } 13245 isOverflowing() { 13246 return this.getWidth() > 0; 13247 } 13248 13249 // Private 13250 _disableOverFlow() { 13251 this._saveInitialAttribute(this._element, 'overflow'); 13252 this._element.style.overflow = 'hidden'; 13253 } 13254 _setElementAttributes(selector, styleProperty, callback) { 13255 const scrollbarWidth = this.getWidth(); 13256 const manipulationCallBack = element => { 13257 if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { 13258 return; 13259 } 13260 this._saveInitialAttribute(element, styleProperty); 13261 const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); 13262 element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); 13263 }; 13264 this._applyManipulationCallback(selector, manipulationCallBack); 13265 } 13266 _saveInitialAttribute(element, styleProperty) { 13267 const actualValue = element.style.getPropertyValue(styleProperty); 13268 if (actualValue) { 13269 Manipulator.setDataAttribute(element, styleProperty, actualValue); 13270 } 13271 } 13272 _resetElementAttributes(selector, styleProperty) { 13273 const manipulationCallBack = element => { 13274 const value = Manipulator.getDataAttribute(element, styleProperty); 13275 // We only want to remove the property if the value is `null`; the value can also be zero 13276 if (value === null) { 13277 element.style.removeProperty(styleProperty); 13278 return; 13279 } 13280 Manipulator.removeDataAttribute(element, styleProperty); 13281 element.style.setProperty(styleProperty, value); 13282 }; 13283 this._applyManipulationCallback(selector, manipulationCallBack); 13284 } 13285 _applyManipulationCallback(selector, callBack) { 13286 if (index_js.isElement(selector)) { 13287 callBack(selector); 13288 return; 13289 } 13290 for (const sel of SelectorEngine.find(selector, this._element)) { 13291 callBack(sel); 13292 } 13293 } 13294 } 13295 13296 return ScrollBarHelper; 13297 13298})); 13299/*! 13300 * Bootstrap tab.js v5.3.8 (https://getbootstrap.com/) 13301 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13302 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13303 */ 13304(function (global, factory) { 13305 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/index.js')) : 13306 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/index'], factory) : 13307 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Index)); 13308})(this, (function (BaseComponent, EventHandler, SelectorEngine, index_js) { 'use strict'; 13309 13310 /** 13311 * -------------------------------------------------------------------------- 13312 * Bootstrap tab.js 13313 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13314 * -------------------------------------------------------------------------- 13315 */ 13316 13317 13318 /** 13319 * Constants 13320 */ 13321 13322 const NAME = 'tab'; 13323 const DATA_KEY = 'bs.tab'; 13324 const EVENT_KEY = `.${DATA_KEY}`; 13325 const EVENT_HIDE = `hide${EVENT_KEY}`; 13326 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 13327 const EVENT_SHOW = `show${EVENT_KEY}`; 13328 const EVENT_SHOWN = `shown${EVENT_KEY}`; 13329 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}`; 13330 const EVENT_KEYDOWN = `keydown${EVENT_KEY}`; 13331 const EVENT_LOAD_DATA_API = `load${EVENT_KEY}`; 13332 const ARROW_LEFT_KEY = 'ArrowLeft'; 13333 const ARROW_RIGHT_KEY = 'ArrowRight'; 13334 const ARROW_UP_KEY = 'ArrowUp'; 13335 const ARROW_DOWN_KEY = 'ArrowDown'; 13336 const HOME_KEY = 'Home'; 13337 const END_KEY = 'End'; 13338 const CLASS_NAME_ACTIVE = 'active'; 13339 const CLASS_NAME_FADE = 'fade';
vendor: 6,274 bytes, lines 13340-13502
13340 const CLASS_NAME_SHOW = 'show'; 13341 const CLASS_DROPDOWN = 'dropdown'; 13342 const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 13343 const SELECTOR_DROPDOWN_MENU = '.dropdown-menu'; 13344 const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`; 13345 const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'; 13346 const SELECTOR_OUTER = '.nav-item, .list-group-item'; 13347 const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`; 13348 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6 13349 const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`; 13350 const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`; 13351 13352 /** 13353 * Class definition 13354 */ 13355 13356 class Tab extends BaseComponent { 13357 constructor(element) { 13358 super(element); 13359 this._parent = this._element.closest(SELECTOR_TAB_PANEL); 13360 if (!this._parent) { 13361 return; 13362 // TODO: should throw exception in v6 13363 // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`) 13364 } 13365 13366 // Set up initial aria attributes 13367 this._setInitialAttributes(this._parent, this._getChildren()); 13368 EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); 13369 } 13370 13371 // Getters 13372 static get NAME() { 13373 return NAME; 13374 } 13375 13376 // Public 13377 show() { 13378 // Shows this elem and deactivate the active sibling if exists 13379 const innerElem = this._element; 13380 if (this._elemIsActive(innerElem)) { 13381 return; 13382 } 13383 13384 // Search for active tab on same parent to deactivate it 13385 const active = this._getActiveElem(); 13386 const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE, { 13387 relatedTarget: innerElem 13388 }) : null; 13389 const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW, { 13390 relatedTarget: active 13391 }); 13392 if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) { 13393 return; 13394 } 13395 this._deactivate(active, innerElem); 13396 this._activate(innerElem, active); 13397 } 13398 13399 // Private 13400 _activate(element, relatedElem) { 13401 if (!element) { 13402 return; 13403 } 13404 element.classList.add(CLASS_NAME_ACTIVE); 13405 this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section 13406 13407 const complete = () => { 13408 if (element.getAttribute('role') !== 'tab') { 13409 element.classList.add(CLASS_NAME_SHOW); 13410 return; 13411 } 13412 element.removeAttribute('tabindex'); 13413 element.setAttribute('aria-selected', true); 13414 this._toggleDropDown(element, true); 13415 EventHandler.trigger(element, EVENT_SHOWN, { 13416 relatedTarget: relatedElem 13417 }); 13418 }; 13419 this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE)); 13420 } 13421 _deactivate(element, relatedElem) { 13422 if (!element) { 13423 return; 13424 } 13425 element.classList.remove(CLASS_NAME_ACTIVE); 13426 element.blur(); 13427 this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too 13428 13429 const complete = () => { 13430 if (element.getAttribute('role') !== 'tab') { 13431 element.classList.remove(CLASS_NAME_SHOW); 13432 return; 13433 } 13434 element.setAttribute('aria-selected', false); 13435 element.setAttribute('tabindex', '-1'); 13436 this._toggleDropDown(element, false); 13437 EventHandler.trigger(element, EVENT_HIDDEN, { 13438 relatedTarget: relatedElem 13439 }); 13440 }; 13441 this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE)); 13442 } 13443 _keydown(event) { 13444 if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) { 13445 return; 13446 } 13447 event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page 13448 event.preventDefault(); 13449 const children = this._getChildren().filter(element => !index_js.isDisabled(element)); 13450 let nextActiveElement; 13451 if ([HOME_KEY, END_KEY].includes(event.key)) { 13452 nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]; 13453 } else { 13454 const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key); 13455 nextActiveElement = index_js.getNextActiveElement(children, event.target, isNext, true); 13456 } 13457 if (nextActiveElement) { 13458 nextActiveElement.focus({ 13459 preventScroll: true 13460 }); 13461 Tab.getOrCreateInstance(nextActiveElement).show(); 13462 } 13463 } 13464 _getChildren() { 13465 // collection of inner elements 13466 return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent); 13467 } 13468 _getActiveElem() { 13469 return this._getChildren().find(child => this._elemIsActive(child)) || null; 13470 } 13471 _setInitialAttributes(parent, children) { 13472 this._setAttributeIfNotExists(parent, 'role', 'tablist'); 13473 for (const child of children) { 13474 this._setInitialAttributesOnChild(child); 13475 } 13476 } 13477 _setInitialAttributesOnChild(child) { 13478 child = this._getInnerElement(child); 13479 const isActive = this._elemIsActive(child); 13480 const outerElem = this._getOuterElement(child); 13481 child.setAttribute('aria-selected', isActive); 13482 if (outerElem !== child) { 13483 this._setAttributeIfNotExists(outerElem, 'role', 'presentation'); 13484 } 13485 if (!isActive) { 13486 child.setAttribute('tabindex', '-1'); 13487 } 13488 this._setAttributeIfNotExists(child, 'role', 'tab'); 13489 13490 // set attributes to the related panel too 13491 this._setInitialAttributesOnTargetPanel(child); 13492 } 13493 _setInitialAttributesOnTargetPanel(child) { 13494 const target = SelectorEngine.getElementFromSelector(child); 13495 if (!target) { 13496 return; 13497 } 13498 this._setAttributeIfNotExists(target, 'role', 'tabpanel'); 13499 if (child.id) { 13500 this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`); 13501 } 13502 }
vendor: 4,840 bytes, lines 13503-13663
13503 _toggleDropDown(element, open) { 13504 const outerElem = this._getOuterElement(element); 13505 if (!outerElem.classList.contains(CLASS_DROPDOWN)) { 13506 return; 13507 } 13508 const toggle = (selector, className) => { 13509 const element = SelectorEngine.findOne(selector, outerElem); 13510 if (element) { 13511 element.classList.toggle(className, open); 13512 } 13513 }; 13514 toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE); 13515 toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW); 13516 outerElem.setAttribute('aria-expanded', open); 13517 } 13518 _setAttributeIfNotExists(element, attribute, value) { 13519 if (!element.hasAttribute(attribute)) { 13520 element.setAttribute(attribute, value); 13521 } 13522 } 13523 _elemIsActive(elem) { 13524 return elem.classList.contains(CLASS_NAME_ACTIVE); 13525 } 13526 13527 // Try to get the inner element (usually the .nav-link) 13528 _getInnerElement(elem) { 13529 return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem); 13530 } 13531 13532 // Try to get the outer element (usually the .nav-item) 13533 _getOuterElement(elem) { 13534 return elem.closest(SELECTOR_OUTER) || elem; 13535 } 13536 13537 // Static 13538 static jQueryInterface(config) { 13539 return this.each(function () { 13540 const data = Tab.getOrCreateInstance(this); 13541 if (typeof config !== 'string') { 13542 return; 13543 } 13544 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 13545 throw new TypeError(`No method named "${config}"`); 13546 } 13547 data[config](); 13548 }); 13549 } 13550 } 13551 13552 /** 13553 * Data API implementation 13554 */ 13555 13556 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 13557 if (['A', 'AREA'].includes(this.tagName)) { 13558 event.preventDefault(); 13559 } 13560 if (index_js.isDisabled(this)) { 13561 return; 13562 } 13563 Tab.getOrCreateInstance(this).show(); 13564 }); 13565 13566 /** 13567 * Initialize on focus 13568 */ 13569 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 13570 for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) { 13571 Tab.getOrCreateInstance(element); 13572 } 13573 }); 13574 /** 13575 * jQuery 13576 */ 13577 13578 index_js.defineJQueryPlugin(Tab); 13579 13580 return Tab; 13581 13582})); 13583/*! 13584 * Bootstrap focustrap.js v5.3.8 (https://getbootstrap.com/) 13585 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13586 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13587 */ 13588(function (global, factory) { 13589 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/event-handler.js'), require('../dom/selector-engine.js'), require('./config.js')) : 13590 typeof define === 'function' && define.amd ? define(['../dom/event-handler', '../dom/selector-engine', './config'], factory) : 13591 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Focustrap = factory(global.EventHandler, global.SelectorEngine, global.Config)); 13592})(this, (function (EventHandler, SelectorEngine, Config) { 'use strict'; 13593 13594 /** 13595 * -------------------------------------------------------------------------- 13596 * Bootstrap util/focustrap.js 13597 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13598 * -------------------------------------------------------------------------- 13599 */ 13600 13601 13602 /** 13603 * Constants 13604 */ 13605 13606 const NAME = 'focustrap'; 13607 const DATA_KEY = 'bs.focustrap'; 13608 const EVENT_KEY = `.${DATA_KEY}`; 13609 const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; 13610 const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`; 13611 const TAB_KEY = 'Tab'; 13612 const TAB_NAV_FORWARD = 'forward'; 13613 const TAB_NAV_BACKWARD = 'backward'; 13614 const Default = { 13615 autofocus: true, 13616 trapElement: null // The element to trap focus inside of 13617 }; 13618 const DefaultType = { 13619 autofocus: 'boolean', 13620 trapElement: 'element' 13621 }; 13622 13623 /** 13624 * Class definition 13625 */ 13626 13627 class FocusTrap extends Config { 13628 constructor(config) { 13629 super(); 13630 this._config = this._getConfig(config); 13631 this._isActive = false; 13632 this._lastTabNavDirection = null; 13633 } 13634 13635 // Getters 13636 static get Default() { 13637 return Default; 13638 } 13639 static get DefaultType() { 13640 return DefaultType; 13641 } 13642 static get NAME() { 13643 return NAME; 13644 } 13645 13646 // Public 13647 activate() { 13648 if (this._isActive) { 13649 return; 13650 } 13651 if (this._config.autofocus) { 13652 this._config.trapElement.focus(); 13653 } 13654 EventHandler.off(document, EVENT_KEY); // guard against infinite focus loop 13655 EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event)); 13656 EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); 13657 this._isActive = true; 13658 } 13659 deactivate() { 13660 if (!this._isActive) { 13661 return; 13662 } 13663 this._isActive = false;
13664 EventHandler.off(document, EVENT_KEY); 13665 } 13666 13667 // Private 13668 _handleFocusin(event) { 13669 const { 13670 trapElement 13671 } = this._config; 13672 if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { 13673 return; 13674 } 13675 const elements = SelectorEngine.focusableChildren(trapElement); 13676 if (elements.length === 0) { 13677 trapElement.focus(); 13678 } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { 13679 elements[elements.length - 1].focus(); 13680 } else { 13681 elements[0].focus(); 13682 } 13683 } 13684 _handleKeydown(event) { 13685 if (event.key !== TAB_KEY) { 13686 return; 13687 } 13688 this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; 13689 } 13690 } 13691 13692 return FocusTrap; 13693 13694})); 13695/*! 13696 * Bootstrap backdrop.js v5.3.8 (https://getbootstrap.com/) 13697 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13698 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13699 */ 13700(function (global, factory) { 13701 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/event-handler.js'), require('./config.js'), require('./index.js')) : 13702 typeof define === 'function' && define.amd ? define(['../dom/event-handler', './config', './index'], factory) : 13703 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Backdrop = factory(global.EventHandler, global.Config, global.Index)); 13704})(this, (function (EventHandler, Config, index_js) { 'use strict'; 13705 13706 /** 13707 * -------------------------------------------------------------------------- 13708 * Bootstrap util/backdrop.js 13709 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13710 * -------------------------------------------------------------------------- 13711 */ 13712 13713 13714 /** 13715 * Constants 13716 */ 13717 13718 const NAME = 'backdrop'; 13719 const CLASS_NAME_FADE = 'fade';
13720 const CLASS_NAME_SHOW = 'show'; 13721 const EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`; 13722 const Default = { 13723 className: 'modal-backdrop', 13724 clickCallback: null, 13725 isAnimated: false, 13726 isVisible: true, 13727 // if false, we use the backdrop helper without adding any element to the dom 13728 rootElement: 'body' // give the choice to place backdrop under different elements 13729 }; 13730 const DefaultType = { 13731 className: 'string', 13732 clickCallback: '(function|null)', 13733 isAnimated: 'boolean', 13734 isVisible: 'boolean', 13735 rootElement: '(element|string)' 13736 }; 13737 13738 /** 13739 * Class definition 13740 */ 13741 13742 class Backdrop extends Config { 13743 constructor(config) { 13744 super(); 13745 this._config = this._getConfig(config); 13746 this._isAppended = false; 13747 this._element = null; 13748 } 13749 13750 // Getters 13751 static get Default() { 13752 return Default; 13753 } 13754 static get DefaultType() { 13755 return DefaultType; 13756 } 13757 static get NAME() { 13758 return NAME; 13759 } 13760 13761 // Public 13762 show(callback) { 13763 if (!this._config.isVisible) { 13764 index_js.execute(callback); 13765 return; 13766 } 13767 this._append(); 13768 const element = this._getElement(); 13769 if (this._config.isAnimated) { 13770 index_js.reflow(element); 13771 } 13772 element.classList.add(CLASS_NAME_SHOW); 13773 this._emulateAnimation(() => { 13774 index_js.execute(callback); 13775 }); 13776 } 13777 hide(callback) { 13778 if (!this._config.isVisible) { 13779 index_js.execute(callback); 13780 return; 13781 } 13782 this._getElement().classList.remove(CLASS_NAME_SHOW); 13783 this._emulateAnimation(() => { 13784 this.dispose(); 13785 index_js.execute(callback); 13786 }); 13787 } 13788 dispose() { 13789 if (!this._isAppended) { 13790 return; 13791 } 13792 EventHandler.off(this._element, EVENT_MOUSEDOWN); 13793 this._element.remove(); 13794 this._isAppended = false; 13795 } 13796 13797 // Private 13798 _getElement() { 13799 if (!this._element) { 13800 const backdrop = document.createElement('div'); 13801 backdrop.className = this._config.className; 13802 if (this._config.isAnimated) { 13803 backdrop.classList.add(CLASS_NAME_FADE); 13804 } 13805 this._element = backdrop; 13806 } 13807 return this._element; 13808 } 13809 _configAfterMerge(config) { 13810 // use getElement() with the default "body" to get a fresh Element on each instantiation 13811 config.rootElement = index_js.getElement(config.rootElement); 13812 return config; 13813 } 13814 _append() { 13815 if (this._isAppended) { 13816 return; 13817 } 13818 const element = this._getElement(); 13819 this._config.rootElement.append(element); 13820 EventHandler.on(element, EVENT_MOUSEDOWN, () => { 13821 index_js.execute(this._config.clickCallback); 13822 }); 13823 this._isAppended = true; 13824 } 13825 _emulateAnimation(callback) { 13826 index_js.executeAfterTransition(callback, this._getElement(), this._config.isAnimated); 13827 } 13828 } 13829 13830 return Backdrop; 13831 13832})); 13833/*! 13834 * Bootstrap scrollspy.js v5.3.8 (https://getbootstrap.com/) 13835 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 13836 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13837 */ 13838(function (global, factory) { 13839 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/index.js')) : 13840 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/index'], factory) : 13841 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Scrollspy = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Index)); 13842})(this, (function (BaseComponent, EventHandler, SelectorEngine, index_js) { 'use strict'; 13843 13844 /** 13845 * -------------------------------------------------------------------------- 13846 * Bootstrap scrollspy.js 13847 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 13848 * -------------------------------------------------------------------------- 13849 */ 13850 13851 13852 /** 13853 * Constants 13854 */ 13855 13856 const NAME = 'scrollspy'; 13857 const DATA_KEY = 'bs.scrollspy'; 13858 const EVENT_KEY = `.${DATA_KEY}`; 13859 const DATA_API_KEY = '.data-api'; 13860 const EVENT_ACTIVATE = `activate${EVENT_KEY}`; 13861 const EVENT_CLICK = `click${EVENT_KEY}`; 13862 const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
vendor: 8,876 bytes, lines 13863-14113
13863 const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 13864 const CLASS_NAME_ACTIVE = 'active'; 13865 const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; 13866 const SELECTOR_TARGET_LINKS = '[href]'; 13867 const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 13868 const SELECTOR_NAV_LINKS = '.nav-link'; 13869 const SELECTOR_NAV_ITEMS = '.nav-item'; 13870 const SELECTOR_LIST_ITEMS = '.list-group-item'; 13871 const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; 13872 const SELECTOR_DROPDOWN = '.dropdown'; 13873 const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 13874 const Default = { 13875 offset: null, 13876 // TODO: v6 @deprecated, keep it for backwards compatibility reasons 13877 rootMargin: '0px 0px -25%', 13878 smoothScroll: false, 13879 target: null, 13880 threshold: [0.1, 0.5, 1] 13881 }; 13882 const DefaultType = { 13883 offset: '(number|null)', 13884 // TODO v6 @deprecated, keep it for backwards compatibility reasons 13885 rootMargin: 'string', 13886 smoothScroll: 'boolean', 13887 target: 'element', 13888 threshold: 'array' 13889 }; 13890 13891 /** 13892 * Class definition 13893 */ 13894 13895 class ScrollSpy extends BaseComponent { 13896 constructor(element, config) { 13897 super(element, config); 13898 13899 // this._element is the observablesContainer and config.target the menu links wrapper 13900 this._targetLinks = new Map(); 13901 this._observableSections = new Map(); 13902 this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; 13903 this._activeTarget = null; 13904 this._observer = null; 13905 this._previousScrollData = { 13906 visibleEntryTop: 0, 13907 parentScrollTop: 0 13908 }; 13909 this.refresh(); // initialize 13910 } 13911 13912 // Getters 13913 static get Default() { 13914 return Default; 13915 } 13916 static get DefaultType() { 13917 return DefaultType; 13918 } 13919 static get NAME() { 13920 return NAME; 13921 } 13922 13923 // Public 13924 refresh() { 13925 this._initializeTargetsAndObservables(); 13926 this._maybeEnableSmoothScroll(); 13927 if (this._observer) { 13928 this._observer.disconnect(); 13929 } else { 13930 this._observer = this._getNewObserver(); 13931 } 13932 for (const section of this._observableSections.values()) { 13933 this._observer.observe(section); 13934 } 13935 } 13936 dispose() { 13937 this._observer.disconnect(); 13938 super.dispose(); 13939 } 13940 13941 // Private 13942 _configAfterMerge(config) { 13943 // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case 13944 config.target = index_js.getElement(config.target) || document.body; 13945 13946 // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only 13947 config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; 13948 if (typeof config.threshold === 'string') { 13949 config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); 13950 } 13951 return config; 13952 } 13953 _maybeEnableSmoothScroll() { 13954 if (!this._config.smoothScroll) { 13955 return; 13956 } 13957 13958 // unregister any previous listeners 13959 EventHandler.off(this._config.target, EVENT_CLICK); 13960 EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { 13961 const observableSection = this._observableSections.get(event.target.hash); 13962 if (observableSection) { 13963 event.preventDefault(); 13964 const root = this._rootElement || window; 13965 const height = observableSection.offsetTop - this._element.offsetTop; 13966 if (root.scrollTo) { 13967 root.scrollTo({ 13968 top: height, 13969 behavior: 'smooth' 13970 }); 13971 return; 13972 } 13973 13974 // Chrome 60 doesn't support `scrollTo` 13975 root.scrollTop = height; 13976 } 13977 }); 13978 } 13979 _getNewObserver() { 13980 const options = { 13981 root: this._rootElement, 13982 threshold: this._config.threshold, 13983 rootMargin: this._config.rootMargin 13984 }; 13985 return new IntersectionObserver(entries => this._observerCallback(entries), options); 13986 } 13987 13988 // The logic of selection 13989 _observerCallback(entries) { 13990 const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); 13991 const activate = entry => { 13992 this._previousScrollData.visibleEntryTop = entry.target.offsetTop; 13993 this._process(targetElement(entry)); 13994 }; 13995 const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; 13996 const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; 13997 this._previousScrollData.parentScrollTop = parentScrollTop; 13998 for (const entry of entries) { 13999 if (!entry.isIntersecting) { 14000 this._activeTarget = null; 14001 this._clearActiveClass(targetElement(entry)); 14002 continue; 14003 } 14004 const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; 14005 // if we are scrolling down, pick the bigger offsetTop 14006 if (userScrollsDown && entryIsLowerThanPrevious) { 14007 activate(entry); 14008 // if parent isn't scrolled, let's keep the first visible item, breaking the iteration 14009 if (!parentScrollTop) { 14010 return; 14011 } 14012 continue; 14013 } 14014 14015 // if we are scrolling up, pick the smallest offsetTop 14016 if (!userScrollsDown && !entryIsLowerThanPrevious) { 14017 activate(entry); 14018 } 14019 } 14020 } 14021 _initializeTargetsAndObservables() { 14022 this._targetLinks = new Map(); 14023 this._observableSections = new Map(); 14024 const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); 14025 for (const anchor of targetLinks) { 14026 // ensure that the anchor has an id and is not disabled 14027 if (!anchor.hash || index_js.isDisabled(anchor)) { 14028 continue; 14029 } 14030 const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); 14031 14032 // ensure that the observableSection exists & is visible 14033 if (index_js.isVisible(observableSection)) { 14034 this._targetLinks.set(decodeURI(anchor.hash), anchor); 14035 this._observableSections.set(anchor.hash, observableSection); 14036 } 14037 } 14038 } 14039 _process(target) { 14040 if (this._activeTarget === target) { 14041 return; 14042 } 14043 this._clearActiveClass(this._config.target); 14044 this._activeTarget = target; 14045 target.classList.add(CLASS_NAME_ACTIVE); 14046 this._activateParents(target); 14047 EventHandler.trigger(this._element, EVENT_ACTIVATE, { 14048 relatedTarget: target 14049 }); 14050 } 14051 _activateParents(target) { 14052 // Activate dropdown parents 14053 if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { 14054 SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE); 14055 return; 14056 } 14057 for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { 14058 // Set triggered links parents as active 14059 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 14060 for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) { 14061 item.classList.add(CLASS_NAME_ACTIVE); 14062 } 14063 } 14064 } 14065 _clearActiveClass(parent) { 14066 parent.classList.remove(CLASS_NAME_ACTIVE); 14067 const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE}`, parent); 14068 for (const node of activeNodes) { 14069 node.classList.remove(CLASS_NAME_ACTIVE); 14070 } 14071 } 14072 14073 // Static 14074 static jQueryInterface(config) { 14075 return this.each(function () { 14076 const data = ScrollSpy.getOrCreateInstance(this, config); 14077 if (typeof config !== 'string') { 14078 return; 14079 } 14080 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 14081 throw new TypeError(`No method named "${config}"`); 14082 } 14083 data[config](); 14084 }); 14085 } 14086 } 14087 14088 /** 14089 * Data API implementation 14090 */ 14091 14092 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 14093 for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) { 14094 ScrollSpy.getOrCreateInstance(spy); 14095 } 14096 }); 14097 14098 /** 14099 * jQuery 14100 */ 14101 14102 index_js.defineJQueryPlugin(ScrollSpy); 14103 14104 return ScrollSpy; 14105 14106})); 14107/*! 14108 * Bootstrap modal.js v5.3.8 (https://getbootstrap.com/) 14109 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14110 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14111 */ 14112(function (global, factory) { 14113 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/backdrop.js'), require('./util/component-functions.js'), require('./util/focustrap.js'), require('./util/index.js'), require('./util/scrollbar.
14113js')) : 14114 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/backdrop', './util/component-functions', './util/focustrap', './util/index', './util/scrollbar'], factory) : 14115 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Backdrop, global.ComponentFunctions, global.Focustrap, global.Index, global.Scrollbar)); 14116})(this, (function (BaseComponent, EventHandler, SelectorEngine, Backdrop, componentFunctions_js, FocusTrap, index_js, ScrollBarHelper) { 'use strict'; 14117 14118 /** 14119 * -------------------------------------------------------------------------- 14120 * Bootstrap modal.js 14121 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14122 * -------------------------------------------------------------------------- 14123 */ 14124 14125 14126 /** 14127 * Constants 14128 */ 14129 14130 const NAME = 'modal'; 14131 const DATA_KEY = 'bs.modal'; 14132 const EVENT_KEY = `.${DATA_KEY}`; 14133 const DATA_API_KEY = '.data-api'; 14134 const ESCAPE_KEY = 'Escape'; 14135 const EVENT_HIDE = `hide${EVENT_KEY}`; 14136 const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`; 14137 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 14138 const EVENT_SHOW = `show${EVENT_KEY}`; 14139 const EVENT_SHOWN = `shown${EVENT_KEY}`; 14140 const EVENT_RESIZE = `resize${EVENT_KEY}`; 14141 const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; 14142 const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`; 14143 const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`; 14144 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 14145 const CLASS_NAME_OPEN = 'modal-open'; 14146 const CLASS_NAME_FADE = 'fade';
vendor: 9,438 bytes, lines 14147-14432
14147 const CLASS_NAME_SHOW = 'show'; 14148 const CLASS_NAME_STATIC = 'modal-static'; 14149 const OPEN_SELECTOR = '.modal.show'; 14150 const SELECTOR_DIALOG = '.modal-dialog'; 14151 const SELECTOR_MODAL_BODY = '.modal-body'; 14152 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]'; 14153 const Default = { 14154 backdrop: true, 14155 focus: true, 14156 keyboard: true 14157 }; 14158 const DefaultType = { 14159 backdrop: '(boolean|string)', 14160 focus: 'boolean', 14161 keyboard: 'boolean' 14162 }; 14163 14164 /** 14165 * Class definition 14166 */ 14167 14168 class Modal extends BaseComponent { 14169 constructor(element, config) { 14170 super(element, config); 14171 this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); 14172 this._backdrop = this._initializeBackDrop(); 14173 this._focustrap = this._initializeFocusTrap(); 14174 this._isShown = false; 14175 this._isTransitioning = false; 14176 this._scrollBar = new ScrollBarHelper(); 14177 this._addEventListeners(); 14178 } 14179 14180 // Getters 14181 static get Default() { 14182 return Default; 14183 } 14184 static get DefaultType() { 14185 return DefaultType; 14186 } 14187 static get NAME() { 14188 return NAME; 14189 } 14190 14191 // Public 14192 toggle(relatedTarget) { 14193 return this._isShown ? this.hide() : this.show(relatedTarget); 14194 } 14195 show(relatedTarget) { 14196 if (this._isShown || this._isTransitioning) { 14197 return; 14198 } 14199 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { 14200 relatedTarget 14201 }); 14202 if (showEvent.defaultPrevented) { 14203 return; 14204 } 14205 this._isShown = true; 14206 this._isTransitioning = true; 14207 this._scrollBar.hide(); 14208 document.body.classList.add(CLASS_NAME_OPEN); 14209 this._adjustDialog(); 14210 this._backdrop.show(() => this._showElement(relatedTarget)); 14211 } 14212 hide() { 14213 if (!this._isShown || this._isTransitioning) { 14214 return; 14215 } 14216 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); 14217 if (hideEvent.defaultPrevented) { 14218 return; 14219 } 14220 this._isShown = false; 14221 this._isTransitioning = true; 14222 this._focustrap.deactivate(); 14223 this._element.classList.remove(CLASS_NAME_SHOW); 14224 this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); 14225 } 14226 dispose() { 14227 EventHandler.off(window, EVENT_KEY); 14228 EventHandler.off(this._dialog, EVENT_KEY); 14229 this._backdrop.dispose(); 14230 this._focustrap.deactivate(); 14231 super.dispose(); 14232 } 14233 handleUpdate() { 14234 this._adjustDialog(); 14235 } 14236 14237 // Private 14238 _initializeBackDrop() { 14239 return new Backdrop({ 14240 isVisible: Boolean(this._config.backdrop), 14241 // 'static' option will be translated to true, and booleans will keep their value, 14242 isAnimated: this._isAnimated() 14243 }); 14244 } 14245 _initializeFocusTrap() { 14246 return new FocusTrap({ 14247 trapElement: this._element 14248 }); 14249 } 14250 _showElement(relatedTarget) { 14251 // try to append dynamic modal 14252 if (!document.body.contains(this._element)) { 14253 document.body.append(this._element); 14254 } 14255 this._element.style.display = 'block'; 14256 this._element.removeAttribute('aria-hidden'); 14257 this._element.setAttribute('aria-modal', true); 14258 this._element.setAttribute('role', 'dialog'); 14259 this._element.scrollTop = 0; 14260 const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); 14261 if (modalBody) { 14262 modalBody.scrollTop = 0; 14263 } 14264 index_js.reflow(this._element); 14265 this._element.classList.add(CLASS_NAME_SHOW); 14266 const transitionComplete = () => { 14267 if (this._config.focus) { 14268 this._focustrap.activate(); 14269 } 14270 this._isTransitioning = false; 14271 EventHandler.trigger(this._element, EVENT_SHOWN, { 14272 relatedTarget 14273 }); 14274 }; 14275 this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); 14276 } 14277 _addEventListeners() { 14278 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { 14279 if (event.key !== ESCAPE_KEY) { 14280 return; 14281 } 14282 if (this._config.keyboard) { 14283 this.hide(); 14284 return; 14285 } 14286 this._triggerBackdropTransition(); 14287 }); 14288 EventHandler.on(window, EVENT_RESIZE, () => { 14289 if (this._isShown && !this._isTransitioning) { 14290 this._adjustDialog(); 14291 } 14292 }); 14293 EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { 14294 // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks 14295 EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { 14296 if (this._element !== event.target || this._element !== event2.target) { 14297 return; 14298 } 14299 if (this._config.backdrop === 'static') { 14300 this._triggerBackdropTransition(); 14301 return; 14302 } 14303 if (this._config.backdrop) { 14304 this.hide(); 14305 } 14306 }); 14307 }); 14308 } 14309 _hideModal() { 14310 this._element.style.display = 'none'; 14311 this._element.setAttribute('aria-hidden', true); 14312 this._element.removeAttribute('aria-modal'); 14313 this._element.removeAttribute('role'); 14314 this._isTransitioning = false; 14315 this._backdrop.hide(() => { 14316 document.body.classList.remove(CLASS_NAME_OPEN); 14317 this._resetAdjustments(); 14318 this._scrollBar.reset(); 14319 EventHandler.trigger(this._element, EVENT_HIDDEN); 14320 }); 14321 } 14322 _isAnimated() { 14323 return this._element.classList.contains(CLASS_NAME_FADE); 14324 } 14325 _triggerBackdropTransition() { 14326 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 14327 if (hideEvent.defaultPrevented) { 14328 return; 14329 } 14330 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 14331 const initialOverflowY = this._element.style.overflowY; 14332 // return if the following background transition hasn't yet completed 14333 if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { 14334 return; 14335 } 14336 if (!isModalOverflowing) { 14337 this._element.style.overflowY = 'hidden'; 14338 } 14339 this._element.classList.add(CLASS_NAME_STATIC); 14340 this._queueCallback(() => { 14341 this._element.classList.remove(CLASS_NAME_STATIC); 14342 this._queueCallback(() => { 14343 this._element.style.overflowY = initialOverflowY; 14344 }, this._dialog); 14345 }, this._dialog); 14346 this._element.focus(); 14347 } 14348 14349 /** 14350 * The following methods are used to handle overflowing modals 14351 */ 14352 14353 _adjustDialog() { 14354 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 14355 const scrollbarWidth = this._scrollBar.getWidth(); 14356 const isBodyOverflowing = scrollbarWidth > 0; 14357 if (isBodyOverflowing && !isModalOverflowing) { 14358 const property = index_js.isRTL() ? 'paddingLeft' : 'paddingRight'; 14359 this._element.style[property] = `${scrollbarWidth}px`; 14360 } 14361 if (!isBodyOverflowing && isModalOverflowing) { 14362 const property = index_js.isRTL() ? 'paddingRight' : 'paddingLeft'; 14363 this._element.style[property] = `${scrollbarWidth}px`; 14364 } 14365 } 14366 _resetAdjustments() { 14367 this._element.style.paddingLeft = ''; 14368 this._element.style.paddingRight = ''; 14369 } 14370 14371 // Static 14372 static jQueryInterface(config, relatedTarget) { 14373 return this.each(function () { 14374 const data = Modal.getOrCreateInstance(this, config); 14375 if (typeof config !== 'string') { 14376 return; 14377 } 14378 if (typeof data[config] === 'undefined') { 14379 throw new TypeError(`No method named "${config}"`); 14380 } 14381 data[config](relatedTarget); 14382 }); 14383 } 14384 } 14385 14386 /** 14387 * Data API implementation 14388 */ 14389 14390 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 14391 const target = SelectorEngine.getElementFromSelector(this); 14392 if (['A', 'AREA'].includes(this.tagName)) { 14393 event.preventDefault(); 14394 } 14395 EventHandler.one(target, EVENT_SHOW, showEvent => { 14396 if (showEvent.defaultPrevented) { 14397 // only register focus restorer if modal will actually get shown 14398 return; 14399 } 14400 EventHandler.one(target, EVENT_HIDDEN, () => { 14401 if (index_js.isVisible(this)) { 14402 this.focus(); 14403 } 14404 }); 14405 }); 14406 14407 // avoid conflict when clicking modal toggler while another one is open 14408 const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); 14409 if (alreadyOpen) { 14410 Modal.getInstance(alreadyOpen).hide(); 14411 } 14412 const data = Modal.getOrCreateInstance(target); 14413 data.toggle(this); 14414 }); 14415 componentFunctions_js.enableDismissTrigger(Modal); 14416 14417 /** 14418 * jQuery 14419 */ 14420 14421 index_js.defineJQueryPlugin(Modal); 14422 14423 return Modal; 14424 14425})); 14426/*! 14427 * Bootstrap offcanvas.js v5.3.8 (https://getbootstrap.com/) 14428 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14429 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14430 */ 14431(function (global, factory) { 14432 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/backdrop.js'), require('./util/component-functions.js'), require('./util/focustrap.js'), require('./util/index.js'), require('./util/scrollbar.
vendor: 6,007 bytes, lines 14432-14613
14432js')) : 14433 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/backdrop', './util/component-functions', './util/focustrap', './util/index', './util/scrollbar'], factory) : 14434 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Offcanvas = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Backdrop, global.ComponentFunctions, global.Focustrap, global.Index, global.Scrollbar)); 14435})(this, (function (BaseComponent, EventHandler, SelectorEngine, Backdrop, componentFunctions_js, FocusTrap, index_js, ScrollBarHelper) { 'use strict'; 14436 14437 /** 14438 * -------------------------------------------------------------------------- 14439 * Bootstrap offcanvas.js 14440 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14441 * -------------------------------------------------------------------------- 14442 */ 14443 14444 14445 /** 14446 * Constants 14447 */ 14448 14449 const NAME = 'offcanvas'; 14450 const DATA_KEY = 'bs.offcanvas'; 14451 const EVENT_KEY = `.${DATA_KEY}`; 14452 const DATA_API_KEY = '.data-api'; 14453 const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`; 14454 const ESCAPE_KEY = 'Escape'; 14455 const CLASS_NAME_SHOW = 'show'; 14456 const CLASS_NAME_SHOWING = 'showing'; 14457 const CLASS_NAME_HIDING = 'hiding'; 14458 const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; 14459 const OPEN_SELECTOR = '.offcanvas.show'; 14460 const EVENT_SHOW = `show${EVENT_KEY}`; 14461 const EVENT_SHOWN = `shown${EVENT_KEY}`; 14462 const EVENT_HIDE = `hide${EVENT_KEY}`; 14463 const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`; 14464 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 14465 const EVENT_RESIZE = `resize${EVENT_KEY}`; 14466 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 14467 const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`; 14468 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]'; 14469 const Default = { 14470 backdrop: true, 14471 keyboard: true, 14472 scroll: false 14473 }; 14474 const DefaultType = { 14475 backdrop: '(boolean|string)', 14476 keyboard: 'boolean', 14477 scroll: 'boolean' 14478 }; 14479 14480 /** 14481 * Class definition 14482 */ 14483 14484 class Offcanvas extends BaseComponent { 14485 constructor(element, config) { 14486 super(element, config); 14487 this._isShown = false; 14488 this._backdrop = this._initializeBackDrop(); 14489 this._focustrap = this._initializeFocusTrap(); 14490 this._addEventListeners(); 14491 } 14492 14493 // Getters 14494 static get Default() { 14495 return Default; 14496 } 14497 static get DefaultType() { 14498 return DefaultType; 14499 } 14500 static get NAME() { 14501 return NAME; 14502 } 14503 14504 // Public 14505 toggle(relatedTarget) { 14506 return this._isShown ? this.hide() : this.show(relatedTarget); 14507 } 14508 show(relatedTarget) { 14509 if (this._isShown) { 14510 return; 14511 } 14512 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { 14513 relatedTarget 14514 }); 14515 if (showEvent.defaultPrevented) { 14516 return; 14517 } 14518 this._isShown = true; 14519 this._backdrop.show(); 14520 if (!this._config.scroll) { 14521 new ScrollBarHelper().hide(); 14522 } 14523 this._element.setAttribute('aria-modal', true); 14524 this._element.setAttribute('role', 'dialog'); 14525 this._element.classList.add(CLASS_NAME_SHOWING); 14526 const completeCallBack = () => { 14527 if (!this._config.scroll || this._config.backdrop) { 14528 this._focustrap.activate(); 14529 } 14530 this._element.classList.add(CLASS_NAME_SHOW); 14531 this._element.classList.remove(CLASS_NAME_SHOWING); 14532 EventHandler.trigger(this._element, EVENT_SHOWN, { 14533 relatedTarget 14534 }); 14535 }; 14536 this._queueCallback(completeCallBack, this._element, true); 14537 } 14538 hide() { 14539 if (!this._isShown) { 14540 return; 14541 } 14542 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); 14543 if (hideEvent.defaultPrevented) { 14544 return; 14545 } 14546 this._focustrap.deactivate(); 14547 this._element.blur(); 14548 this._isShown = false; 14549 this._element.classList.add(CLASS_NAME_HIDING); 14550 this._backdrop.hide(); 14551 const completeCallback = () => { 14552 this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING); 14553 this._element.removeAttribute('aria-modal'); 14554 this._element.removeAttribute('role'); 14555 if (!this._config.scroll) { 14556 new ScrollBarHelper().reset(); 14557 } 14558 EventHandler.trigger(this._element, EVENT_HIDDEN); 14559 }; 14560 this._queueCallback(completeCallback, this._element, true); 14561 } 14562 dispose() { 14563 this._backdrop.dispose(); 14564 this._focustrap.deactivate(); 14565 super.dispose(); 14566 } 14567 14568 // Private 14569 _initializeBackDrop() { 14570 const clickCallback = () => { 14571 if (this._config.backdrop === 'static') { 14572 EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 14573 return; 14574 } 14575 this.hide(); 14576 }; 14577 14578 // 'static' option will be translated to true, and booleans will keep their value 14579 const isVisible = Boolean(this._config.backdrop); 14580 return new Backdrop({ 14581 className: CLASS_NAME_BACKDROP, 14582 isVisible, 14583 isAnimated: true, 14584 rootElement: this._element.parentNode, 14585 clickCallback: isVisible ? clickCallback : null 14586 }); 14587 } 14588 _initializeFocusTrap() { 14589 return new FocusTrap({ 14590 trapElement: this._element 14591 }); 14592 } 14593 _addEventListeners() { 14594 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { 14595 if (event.key !== ESCAPE_KEY) { 14596 return; 14597 } 14598 if (this._config.keyboard) { 14599 this.hide(); 14600 return; 14601 } 14602 EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 14603 }); 14604 } 14605 14606 // Static 14607 static jQueryInterface(config) { 14608 return this.each(function () { 14609 const data = Offcanvas.getOrCreateInstance(this, config); 14610 if (typeof config !== 'string') { 14611 return; 14612 } 14613 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
vendor: 31,225 bytes, lines 14614-15503
14614 throw new TypeError(`No method named "${config}"`); 14615 } 14616 data[config](this); 14617 }); 14618 } 14619 } 14620 14621 /** 14622 * Data API implementation 14623 */ 14624 14625 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 14626 const target = SelectorEngine.getElementFromSelector(this); 14627 if (['A', 'AREA'].includes(this.tagName)) { 14628 event.preventDefault(); 14629 } 14630 if (index_js.isDisabled(this)) { 14631 return; 14632 } 14633 EventHandler.one(target, EVENT_HIDDEN, () => { 14634 // focus on trigger when it is closed 14635 if (index_js.isVisible(this)) { 14636 this.focus(); 14637 } 14638 }); 14639 14640 // avoid conflict when clicking a toggler of an offcanvas, while another is open 14641 const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); 14642 if (alreadyOpen && alreadyOpen !== target) { 14643 Offcanvas.getInstance(alreadyOpen).hide(); 14644 } 14645 const data = Offcanvas.getOrCreateInstance(target); 14646 data.toggle(this); 14647 }); 14648 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 14649 for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { 14650 Offcanvas.getOrCreateInstance(selector).show(); 14651 } 14652 }); 14653 EventHandler.on(window, EVENT_RESIZE, () => { 14654 for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { 14655 if (getComputedStyle(element).position !== 'fixed') { 14656 Offcanvas.getOrCreateInstance(element).hide(); 14657 } 14658 } 14659 }); 14660 componentFunctions_js.enableDismissTrigger(Offcanvas); 14661 14662 /** 14663 * jQuery 14664 */ 14665 14666 index_js.defineJQueryPlugin(Offcanvas); 14667 14668 return Offcanvas; 14669 14670})); 14671/*! 14672 * Bootstrap swipe.js v5.3.8 (https://getbootstrap.com/) 14673 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14674 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14675 */ 14676(function (global, factory) { 14677 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/event-handler.js'), require('./config.js'), require('./index.js')) : 14678 typeof define === 'function' && define.amd ? define(['../dom/event-handler', './config', './index'], factory) : 14679 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Swipe = factory(global.EventHandler, global.Config, global.Index)); 14680})(this, (function (EventHandler, Config, index_js) { 'use strict'; 14681 14682 /** 14683 * -------------------------------------------------------------------------- 14684 * Bootstrap util/swipe.js 14685 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14686 * -------------------------------------------------------------------------- 14687 */ 14688 14689 14690 /** 14691 * Constants 14692 */ 14693 14694 const NAME = 'swipe'; 14695 const EVENT_KEY = '.bs.swipe'; 14696 const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`; 14697 const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`; 14698 const EVENT_TOUCHEND = `touchend${EVENT_KEY}`; 14699 const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`; 14700 const EVENT_POINTERUP = `pointerup${EVENT_KEY}`; 14701 const POINTER_TYPE_TOUCH = 'touch'; 14702 const POINTER_TYPE_PEN = 'pen'; 14703 const CLASS_NAME_POINTER_EVENT = 'pointer-event'; 14704 const SWIPE_THRESHOLD = 40; 14705 const Default = { 14706 endCallback: null, 14707 leftCallback: null, 14708 rightCallback: null 14709 }; 14710 const DefaultType = { 14711 endCallback: '(function|null)', 14712 leftCallback: '(function|null)', 14713 rightCallback: '(function|null)' 14714 }; 14715 14716 /** 14717 * Class definition 14718 */ 14719 14720 class Swipe extends Config { 14721 constructor(element, config) { 14722 super(); 14723 this._element = element; 14724 if (!element || !Swipe.isSupported()) { 14725 return; 14726 } 14727 this._config = this._getConfig(config); 14728 this._deltaX = 0; 14729 this._supportPointerEvents = Boolean(window.PointerEvent); 14730 this._initEvents(); 14731 } 14732 14733 // Getters 14734 static get Default() { 14735 return Default; 14736 } 14737 static get DefaultType() { 14738 return DefaultType; 14739 } 14740 static get NAME() { 14741 return NAME; 14742 } 14743 14744 // Public 14745 dispose() { 14746 EventHandler.off(this._element, EVENT_KEY); 14747 } 14748 14749 // Private 14750 _start(event) { 14751 if (!this._supportPointerEvents) { 14752 this._deltaX = event.touches[0].clientX; 14753 return; 14754 } 14755 if (this._eventIsPointerPenTouch(event)) { 14756 this._deltaX = event.clientX; 14757 } 14758 } 14759 _end(event) { 14760 if (this._eventIsPointerPenTouch(event)) { 14761 this._deltaX = event.clientX - this._deltaX; 14762 } 14763 this._handleSwipe(); 14764 index_js.execute(this._config.endCallback); 14765 } 14766 _move(event) { 14767 this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; 14768 } 14769 _handleSwipe() { 14770 const absDeltaX = Math.abs(this._deltaX); 14771 if (absDeltaX <= SWIPE_THRESHOLD) { 14772 return; 14773 } 14774 const direction = absDeltaX / this._deltaX; 14775 this._deltaX = 0; 14776 if (!direction) { 14777 return; 14778 } 14779 index_js.execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); 14780 } 14781 _initEvents() { 14782 if (this._supportPointerEvents) { 14783 EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); 14784 EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); 14785 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 14786 } else { 14787 EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); 14788 EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); 14789 EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); 14790 } 14791 } 14792 _eventIsPointerPenTouch(event) { 14793 return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); 14794 } 14795 14796 // Static 14797 static isSupported() { 14798 return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 14799 } 14800 } 14801 14802 return Swipe; 14803 14804})); 14805/*! 14806 * Bootstrap carousel.js v5.3.8 (https://getbootstrap.com/) 14807 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 14808 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14809 */ 14810(function (global, factory) { 14811 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./util/index.js'), require('./util/swipe.js')) : 14812 typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './util/index', './util/swipe'], factory) : 14813 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.BaseComponent, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Index, global.Swipe)); 14814})(this, (function (BaseComponent, EventHandler, Manipulator, SelectorEngine, index_js, Swipe) { 'use strict'; 14815 14816 /** 14817 * -------------------------------------------------------------------------- 14818 * Bootstrap carousel.js 14819 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 14820 * -------------------------------------------------------------------------- 14821 */ 14822 14823 14824 /** 14825 * Constants 14826 */ 14827 14828 const NAME = 'carousel'; 14829 const DATA_KEY = 'bs.carousel'; 14830 const EVENT_KEY = `.${DATA_KEY}`; 14831 const DATA_API_KEY = '.data-api'; 14832 const ARROW_LEFT_KEY = 'ArrowLeft'; 14833 const ARROW_RIGHT_KEY = 'ArrowRight'; 14834 const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 14835 14836 const ORDER_NEXT = 'next'; 14837 const ORDER_PREV = 'prev'; 14838 const DIRECTION_LEFT = 'left'; 14839 const DIRECTION_RIGHT = 'right'; 14840 const EVENT_SLIDE = `slide${EVENT_KEY}`; 14841 const EVENT_SLID = `slid${EVENT_KEY}`; 14842 const EVENT_KEYDOWN = `keydown${EVENT_KEY}`; 14843 const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`; 14844 const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`; 14845 const EVENT_DRAG_START = `dragstart${EVENT_KEY}`; 14846 const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`; 14847 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 14848 const CLASS_NAME_CAROUSEL = 'carousel'; 14849 const CLASS_NAME_ACTIVE = 'active'; 14850 const CLASS_NAME_SLIDE = 'slide'; 14851 const CLASS_NAME_END = 'carousel-item-end'; 14852 const CLASS_NAME_START = 'carousel-item-start'; 14853 const CLASS_NAME_NEXT = 'carousel-item-next'; 14854 const CLASS_NAME_PREV = 'carousel-item-prev'; 14855 const SELECTOR_ACTIVE = '.active'; 14856 const SELECTOR_ITEM = '.carousel-item'; 14857 const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; 14858 const SELECTOR_ITEM_IMG = '.carousel-item img'; 14859 const SELECTOR_INDICATORS = '.carousel-indicators'; 14860 const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; 14861 const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; 14862 const KEY_TO_DIRECTION = { 14863 [ARROW_LEFT_KEY]: DIRECTION_RIGHT, 14864 [ARROW_RIGHT_KEY]: DIRECTION_LEFT 14865 }; 14866 const Default = { 14867 interval: 5000, 14868 keyboard: true, 14869 pause: 'hover', 14870 ride: false, 14871 touch: true, 14872 wrap: true 14873 }; 14874 const DefaultType = { 14875 interval: '(number|boolean)', 14876 // TODO:v6 remove boolean support 14877 keyboard: 'boolean', 14878 pause: '(string|boolean)', 14879 ride: '(boolean|string)', 14880 touch: 'boolean', 14881 wrap: 'boolean' 14882 }; 14883 14884 /** 14885 * Class definition 14886 */ 14887 14888 class Carousel extends BaseComponent { 14889 constructor(element, config) { 14890 super(element, config); 14891 this._interval = null; 14892 this._activeElement = null; 14893 this._isSliding = false; 14894 this.touchTimeout = null; 14895 this._swipeHelper = null; 14896 this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); 14897 this._addEventListeners(); 14898 if (this._config.ride === CLASS_NAME_CAROUSEL) { 14899 this.cycle(); 14900 } 14901 } 14902 14903 // Getters 14904 static get Default() { 14905 return Default; 14906 } 14907 static get DefaultType() { 14908 return DefaultType; 14909 } 14910 static get NAME() { 14911 return NAME; 14912 } 14913 14914 // Public 14915 next() { 14916 this._slide(ORDER_NEXT); 14917 } 14918 nextWhenVisible() { 14919 // FIXME TODO use `document.visibilityState` 14920 // Don't call next when the page isn't visible 14921 // or the carousel or its parent isn't visible 14922 if (!document.hidden && index_js.isVisible(this._element)) { 14923 this.next(); 14924 } 14925 } 14926 prev() { 14927 this._slide(ORDER_PREV); 14928 } 14929 pause() { 14930 if (this._isSliding) { 14931 index_js.triggerTransitionEnd(this._element); 14932 } 14933 this._clearInterval(); 14934 } 14935 cycle() { 14936 this._clearInterval(); 14937 this._updateInterval(); 14938 this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); 14939 } 14940 _maybeEnableCycle() { 14941 if (!this._config.ride) { 14942 return; 14943 } 14944 if (this._isSliding) { 14945 EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); 14946 return; 14947 } 14948 this.cycle(); 14949 } 14950 to(index) { 14951 const items = this._getItems(); 14952 if (index > items.length - 1 || index < 0) { 14953 return; 14954 } 14955 if (this._isSliding) { 14956 EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); 14957 return; 14958 } 14959 const activeIndex = this._getItemIndex(this._getActive()); 14960 if (activeIndex === index) { 14961 return; 14962 } 14963 const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; 14964 this._slide(order, items[index]); 14965 } 14966 dispose() { 14967 if (this._swipeHelper) { 14968 this._swipeHelper.dispose(); 14969 } 14970 super.dispose(); 14971 } 14972 14973 // Private 14974 _configAfterMerge(config) { 14975 config.defaultInterval = config.interval; 14976 return config; 14977 } 14978 _addEventListeners() { 14979 if (this._config.keyboard) { 14980 EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); 14981 } 14982 if (this._config.pause === 'hover') { 14983 EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause()); 14984 EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle()); 14985 } 14986 if (this._config.touch && Swipe.isSupported()) { 14987 this._addTouchEventListeners(); 14988 } 14989 } 14990 _addTouchEventListeners() { 14991 for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { 14992 EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); 14993 } 14994 const endCallBack = () => { 14995 if (this._config.pause !== 'hover') { 14996 return; 14997 } 14998 14999 // If it's a touch-enabled device, mouseenter/leave are fired as 15000 // part of the mouse compatibility events on first tap - the carousel 15001 // would stop cycling until user tapped out of it; 15002 // here, we listen for touchend, explicitly pause the carousel 15003 // (as if it's the second time we tap on it, mouseenter compat event 15004 // is NOT fired) and after a timeout (to allow for mouse compatibility 15005 // events to fire) we explicitly restart cycling 15006 15007 this.pause(); 15008 if (this.touchTimeout) { 15009 clearTimeout(this.touchTimeout); 15010 } 15011 this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); 15012 }; 15013 const swipeConfig = { 15014 leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), 15015 rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), 15016 endCallback: endCallBack 15017 }; 15018 this._swipeHelper = new Swipe(this._element, swipeConfig); 15019 } 15020 _keydown(event) { 15021 if (/input|textarea/i.test(event.target.tagName)) { 15022 return; 15023 } 15024 const direction = KEY_TO_DIRECTION[event.key]; 15025 if (direction) { 15026 event.preventDefault(); 15027 this._slide(this._directionToOrder(direction)); 15028 } 15029 } 15030 _getItemIndex(element) { 15031 return this._getItems().indexOf(element); 15032 } 15033 _setActiveIndicatorElement(index) { 15034 if (!this._indicatorsElement) { 15035 return; 15036 } 15037 const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); 15038 activeIndicator.classList.remove(CLASS_NAME_ACTIVE); 15039 activeIndicator.removeAttribute('aria-current'); 15040 const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); 15041 if (newActiveIndicator) { 15042 newActiveIndicator.classList.add(CLASS_NAME_ACTIVE); 15043 newActiveIndicator.setAttribute('aria-current', 'true'); 15044 } 15045 } 15046 _updateInterval() { 15047 const element = this._activeElement || this._getActive(); 15048 if (!element) { 15049 return; 15050 } 15051 const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); 15052 this._config.interval = elementInterval || this._config.defaultInterval; 15053 } 15054 _slide(order, element = null) { 15055 if (this._isSliding) { 15056 return; 15057 } 15058 const activeElement = this._getActive(); 15059 const isNext = order === ORDER_NEXT; 15060 const nextElement = element || index_js.getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); 15061 if (nextElement === activeElement) { 15062 return; 15063 } 15064 const nextElementIndex = this._getItemIndex(nextElement); 15065 const triggerEvent = eventName => { 15066 return EventHandler.trigger(this._element, eventName, { 15067 relatedTarget: nextElement, 15068 direction: this._orderToDirection(order), 15069 from: this._getItemIndex(activeElement), 15070 to: nextElementIndex 15071 }); 15072 }; 15073 const slideEvent = triggerEvent(EVENT_SLIDE); 15074 if (slideEvent.defaultPrevented) { 15075 return; 15076 } 15077 if (!activeElement || !nextElement) { 15078 // Some weirdness is happening, so we bail 15079 // TODO: change tests that use empty divs to avoid this check 15080 return; 15081 } 15082 const isCycling = Boolean(this._interval); 15083 this.pause(); 15084 this._isSliding = true; 15085 this._setActiveIndicatorElement(nextElementIndex); 15086 this._activeElement = nextElement; 15087 const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; 15088 const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; 15089 nextElement.classList.add(orderClassName); 15090 index_js.reflow(nextElement); 15091 activeElement.classList.add(directionalClassName); 15092 nextElement.classList.add(directionalClassName); 15093 const completeCallBack = () => { 15094 nextElement.classList.remove(directionalClassName, orderClassName); 15095 nextElement.classList.add(CLASS_NAME_ACTIVE); 15096 activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName); 15097 this._isSliding = false; 15098 triggerEvent(EVENT_SLID); 15099 }; 15100 this._queueCallback(completeCallBack, activeElement, this._isAnimated()); 15101 if (isCycling) { 15102 this.cycle(); 15103 } 15104 } 15105 _isAnimated() { 15106 return this._element.classList.contains(CLASS_NAME_SLIDE); 15107 } 15108 _getActive() { 15109 return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); 15110 } 15111 _getItems() { 15112 return SelectorEngine.find(SELECTOR_ITEM, this._element); 15113 } 15114 _clearInterval() { 15115 if (this._interval) { 15116 clearInterval(this._interval); 15117 this._interval = null; 15118 } 15119 } 15120 _directionToOrder(direction) { 15121 if (index_js.isRTL()) { 15122 return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; 15123 } 15124 return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; 15125 } 15126 _orderToDirection(order) { 15127 if (index_js.isRTL()) { 15128 return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; 15129 } 15130 return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; 15131 } 15132 15133 // Static 15134 static jQueryInterface(config) { 15135 return this.each(function () { 15136 const data = Carousel.getOrCreateInstance(this, config); 15137 if (typeof config === 'number') { 15138 data.to(config); 15139 return; 15140 } 15141 if (typeof config === 'string') { 15142 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 15143 throw new TypeError(`No method named "${config}"`); 15144 } 15145 data[config](); 15146 } 15147 }); 15148 } 15149 } 15150 15151 /** 15152 * Data API implementation 15153 */ 15154 15155 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) { 15156 const target = SelectorEngine.getElementFromSelector(this); 15157 if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { 15158 return; 15159 } 15160 event.preventDefault(); 15161 const carousel = Carousel.getOrCreateInstance(target); 15162 const slideIndex = this.getAttribute('data-bs-slide-to'); 15163 if (slideIndex) { 15164 carousel.to(slideIndex); 15165 carousel._maybeEnableCycle(); 15166 return; 15167 } 15168 if (Manipulator.getDataAttribute(this, 'slide') === 'next') { 15169 carousel.next(); 15170 carousel._maybeEnableCycle(); 15171 return; 15172 } 15173 carousel.prev(); 15174 carousel._maybeEnableCycle(); 15175 }); 15176 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 15177 const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); 15178 for (const carousel of carousels) { 15179 Carousel.getOrCreateInstance(carousel); 15180 } 15181 }); 15182 15183 /** 15184 * jQuery 15185 */ 15186 15187 index_js.defineJQueryPlugin(Carousel); 15188 15189 return Carousel; 15190 15191})); 15192/*! 15193 * Bootstrap dropdown.js v5.3.8 (https://getbootstrap.com/) 15194 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 15195 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 15196 */ 15197(function (global, factory) { 15198 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./util/index.js')) : 15199 typeof define === 'function' && define.amd ? define(['@popperjs/core', './base-component', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './util/index'], factory) : 15200 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global["@popperjs/core"], global.BaseComponent, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Index)); 15201})(this, (function (Popper, BaseComponent, EventHandler, Manipulator, SelectorEngine, index_js) { 'use strict'; 15202 15203 function _interopNamespaceDefault(e) { 15204 const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); 15205 if (e) { 15206 for (const k in e) { 15207 if (k !== 'default') { 15208 const d = Object.getOwnPropertyDescriptor(e, k); 15209 Object.defineProperty(n, k, d.get ? d : { 15210 enumerable: true, 15211 get: () => e[k] 15212 }); 15213 } 15214 } 15215 } 15216 n.default = e; 15217 return Object.freeze(n); 15218 } 15219 15220 const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); 15221 15222 /** 15223 * -------------------------------------------------------------------------- 15224 * Bootstrap dropdown.js 15225 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 15226 * -------------------------------------------------------------------------- 15227 */ 15228 15229 15230 /** 15231 * Constants 15232 */ 15233 15234 const NAME = 'dropdown'; 15235 const DATA_KEY = 'bs.dropdown'; 15236 const EVENT_KEY = `.${DATA_KEY}`; 15237 const DATA_API_KEY = '.data-api'; 15238 const ESCAPE_KEY = 'Escape'; 15239 const TAB_KEY = 'Tab'; 15240 const ARROW_UP_KEY = 'ArrowUp'; 15241 const ARROW_DOWN_KEY = 'ArrowDown'; 15242 const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button 15243 15244 const EVENT_HIDE = `hide${EVENT_KEY}`; 15245 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 15246 const EVENT_SHOW = `show${EVENT_KEY}`; 15247 const EVENT_SHOWN = `shown${EVENT_KEY}`; 15248 const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 15249 const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`; 15250 const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`; 15251 const CLASS_NAME_SHOW = 'show'; 15252 const CLASS_NAME_DROPUP = 'dropup'; 15253 const CLASS_NAME_DROPEND = 'dropend'; 15254 const CLASS_NAME_DROPSTART = 'dropstart'; 15255 const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; 15256 const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; 15257 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; 15258 const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`; 15259 const SELECTOR_MENU = '.dropdown-menu'; 15260 const SELECTOR_NAVBAR = '.navbar'; 15261 const SELECTOR_NAVBAR_NAV = '.navbar-nav'; 15262 const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 15263 const PLACEMENT_TOP = index_js.isRTL() ? 'top-end' : 'top-start'; 15264 const PLACEMENT_TOPEND = index_js.isRTL() ? 'top-start' : 'top-end'; 15265 const PLACEMENT_BOTTOM = index_js.isRTL() ? 'bottom-end' : 'bottom-start'; 15266 const PLACEMENT_BOTTOMEND = index_js.isRTL() ? 'bottom-start' : 'bottom-end'; 15267 const PLACEMENT_RIGHT = index_js.isRTL() ? 'left-start' : 'right-start'; 15268 const PLACEMENT_LEFT = index_js.isRTL() ? 'right-start' : 'left-start'; 15269 const PLACEMENT_TOPCENTER = 'top'; 15270 const PLACEMENT_BOTTOMCENTER = 'bottom'; 15271 const Default = { 15272 autoClose: true, 15273 boundary: 'clippingParents', 15274 display: 'dynamic', 15275 offset: [0, 2], 15276 popperConfig: null, 15277 reference: 'toggle' 15278 }; 15279 const DefaultType = { 15280 autoClose: '(boolean|string)', 15281 boundary: '(string|element)', 15282 display: 'string', 15283 offset: '(array|string|function)', 15284 popperConfig: '(null|object|function)', 15285 reference: '(string|element|object)' 15286 }; 15287 15288 /** 15289 * Class definition 15290 */ 15291 15292 class Dropdown extends BaseComponent { 15293 constructor(element, config) { 15294 super(element, config); 15295 this._popper = null; 15296 this._parent = this._element.parentNode; // dropdown wrapper 15297 // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ 15298 this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); 15299 this._inNavbar = this._detectNavbar(); 15300 } 15301 15302 // Getters 15303 static get Default() { 15304 return Default; 15305 } 15306 static get DefaultType() { 15307 return DefaultType; 15308 } 15309 static get NAME() { 15310 return NAME; 15311 } 15312 15313 // Public 15314 toggle() { 15315 return this._isShown() ? this.hide() : this.show(); 15316 } 15317 show() { 15318 if (index_js.isDisabled(this._element) || this._isShown()) { 15319 return; 15320 } 15321 const relatedTarget = { 15322 relatedTarget: this._element 15323 }; 15324 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget); 15325 if (showEvent.defaultPrevented) { 15326 return; 15327 } 15328 this._createPopper(); 15329 15330 // If this is a touch-enabled device we add extra 15331 // empty mouseover listeners to the body's immediate children; 15332 // only needed because of broken event delegation on iOS 15333 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 15334 if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { 15335 for (const element of [].concat(...document.body.children)) { 15336 EventHandler.on(element, 'mouseover', index_js.noop); 15337 } 15338 } 15339 this._element.focus(); 15340 this._element.setAttribute('aria-expanded', true); 15341 this._menu.classList.add(CLASS_NAME_SHOW); 15342 this._element.classList.add(CLASS_NAME_SHOW); 15343 EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget); 15344 } 15345 hide() { 15346 if (index_js.isDisabled(this._element) || !this._isShown()) { 15347 return; 15348 } 15349 const relatedTarget = { 15350 relatedTarget: this._element 15351 }; 15352 this._completeHide(relatedTarget); 15353 } 15354 dispose() { 15355 if (this._popper) { 15356 this._popper.destroy(); 15357 } 15358 super.dispose(); 15359 } 15360 update() { 15361 this._inNavbar = this._detectNavbar(); 15362 if (this._popper) { 15363 this._popper.update(); 15364 } 15365 } 15366 15367 // Private 15368 _completeHide(relatedTarget) { 15369 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget); 15370 if (hideEvent.defaultPrevented) { 15371 return; 15372 } 15373 15374 // If this is a touch-enabled device we remove the extra 15375 // empty mouseover listeners we added for iOS support 15376 if ('ontouchstart' in document.documentElement) { 15377 for (const element of [].concat(...document.body.children)) { 15378 EventHandler.off(element, 'mouseover', index_js.noop); 15379 } 15380 } 15381 if (this._popper) { 15382 this._popper.destroy(); 15383 } 15384 this._menu.classList.remove(CLASS_NAME_SHOW); 15385 this._element.classList.remove(CLASS_NAME_SHOW); 15386 this._element.setAttribute('aria-expanded', 'false'); 15387 Manipulator.removeDataAttribute(this._menu, 'popper'); 15388 EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget); 15389 } 15390 _getConfig(config) { 15391 config = super._getConfig(config); 15392 if (typeof config.reference === 'object' && !index_js.isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { 15393 // Popper virtual elements require a getBoundingClientRect method 15394 throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); 15395 } 15396 return config; 15397 } 15398 _createPopper() { 15399 if (typeof Popper__namespace === 'undefined') { 15400 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org/docs/v2/)'); 15401 } 15402 let referenceElement = this._element; 15403 if (this._config.reference === 'parent') { 15404 referenceElement = this._parent; 15405 } else if (index_js.isElement(this._config.reference)) { 15406 referenceElement = index_js.getElement(this._config.reference); 15407 } else if (typeof this._config.reference === 'object') { 15408 referenceElement = this._config.reference; 15409 } 15410 const popperConfig = this._getPopperConfig(); 15411 this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig); 15412 } 15413 _isShown() { 15414 return this._menu.classList.contains(CLASS_NAME_SHOW); 15415 } 15416 _getPlacement() { 15417 const parentDropdown = this._parent; 15418 if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { 15419 return PLACEMENT_RIGHT; 15420 } 15421 if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { 15422 return PLACEMENT_LEFT; 15423 } 15424 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { 15425 return PLACEMENT_TOPCENTER; 15426 } 15427 if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { 15428 return PLACEMENT_BOTTOMCENTER; 15429 } 15430 15431 // We need to trim the value because custom properties can also include spaces 15432 const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; 15433 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { 15434 return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; 15435 } 15436 return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; 15437 } 15438 _detectNavbar() { 15439 return this._element.closest(SELECTOR_NAVBAR) !== null; 15440 } 15441 _getOffset() { 15442 const { 15443 offset 15444 } = this._config; 15445 if (typeof offset === 'string') { 15446 return offset.split(',').map(value => Number.parseInt(value, 10)); 15447 } 15448 if (typeof offset === 'function') { 15449 return popperData => offset(popperData, this._element); 15450 } 15451 return offset; 15452 } 15453 _getPopperConfig() { 15454 const defaultBsPopperConfig = { 15455 placement: this._getPlacement(), 15456 modifiers: [{ 15457 name: 'preventOverflow', 15458 options: { 15459 boundary: this._config.boundary 15460 } 15461 }, { 15462 name: 'offset', 15463 options: { 15464 offset: this._getOffset() 15465 } 15466 }] 15467 }; 15468 15469 // Disable Popper if we have a static display or Dropdown is in Navbar 15470 if (this._inNavbar || this._config.display === 'static') { 15471 Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove 15472 defaultBsPopperConfig.modifiers = [{ 15473 name: 'applyStyles', 15474 enabled: false 15475 }]; 15476 } 15477 return { 15478 ...defaultBsPopperConfig, 15479 ...index_js.execute(this._config.popperConfig, [undefined, defaultBsPopperConfig]) 15480 }; 15481 } 15482 _selectMenuItem({ 15483 key, 15484 target 15485 }) { 15486 const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => index_js.isVisible(element)); 15487 if (!items.length) { 15488 return; 15489 } 15490 15491 // if target isn't included in items (e.g. when expanding the dropdown) 15492 // allow cycling to get the last item in case key equals ARROW_UP_KEY 15493 index_js.getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus(); 15494 } 15495 15496 // Static 15497 static jQueryInterface(config) { 15498 return this.each(function () { 15499 const data = Dropdown.getOrCreateInstance(this, config); 15500 if (typeof config !== 'string') { 15501 return; 15502 } 15503 if (typeof data[config] === 'undefined') {
vendor: 1,596 bytes, lines 15504-15541
15504 throw new TypeError(`No method named "${config}"`); 15505 } 15506 data[config](); 15507 }); 15508 } 15509 static clearMenus(event) { 15510 if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) { 15511 return; 15512 } 15513 const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); 15514 for (const toggle of openToggles) { 15515 const context = Dropdown.getInstance(toggle); 15516 if (!context || context._config.autoClose === false) { 15517 continue; 15518 } 15519 const composedPath = event.composedPath(); 15520 const isMenuTarget = composedPath.includes(context._menu); 15521 if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { 15522 continue; 15523 } 15524 15525 // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu 15526 if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) { 15527 continue; 15528 } 15529 const relatedTarget = { 15530 relatedTarget: context._element 15531 }; 15532 if (event.type === 'click') { 15533 relatedTarget.clickEvent = event; 15534 } 15535 context._completeHide(relatedTarget); 15536 } 15537 } 15538 static dataApiKeydownHandler(event) { 15539 // If not an UP | DOWN | ESCAPE key => not a dropdown command 15540 // If input/textarea && if key is other than ESCAPE => not a dropdown command 15541
15542 const isInput = /input|textarea/i.test(event.target.tagName); 15543 const isEscapeEvent = event.key === ESCAPE_KEY; 15544 const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key); 15545 if (!isUpOrDownEvent && !isEscapeEvent) { 15546 return; 15547 } 15548 if (isInput && !isEscapeEvent) { 15549 return; 15550 } 15551 event.preventDefault(); 15552 15553 // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ 15554 const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode); 15555 const instance = Dropdown.getOrCreateInstance(getToggleButton); 15556 if (isUpOrDownEvent) { 15557 event.stopPropagation(); 15558 instance.show(); 15559 instance._selectMenuItem(event); 15560 return; 15561 } 15562 if (instance._isShown()) { 15563 // else is escape and we check if it is shown 15564 event.stopPropagation(); 15565 instance.hide(); 15566 getToggleButton.focus(); 15567 } 15568 } 15569 } 15570 15571 /** 15572 * Data API implementation 15573 */ 15574 15575 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler); 15576 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); 15577 EventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus); 15578 EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); 15579 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 15580 event.preventDefault(); 15581 Dropdown.getOrCreateInstance(this).toggle(); 15582 }); 15583 15584 /** 15585 * jQuery 15586 */ 15587 15588 index_js.defineJQueryPlugin(Dropdown); 15589 15590 return Dropdown; 15591 15592})); 15593window['globalThis'] = window['bootstrap']._originalGlobalThis; 15594window['bootstrap']._originalGlobalThis = null; 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails 15624 15625 15626 15627 15628import "@hotwired/turbo-rails" 15629import "controllers" 15630 15631import "trix" 15632import "@rails/actiontext" 15633 15634import "custom/story_copy_link" 15635import "custom/show_modal_alert" 15636import "custom/adjust_user_feebbacks" 15637import "custom/google_analytics" 15638import "custom/open_mobile_app";
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.