vendor: 4,203 bytes, lines 1-137
1/*! 2 * jQuery JavaScript Library v3.5.1 3 * https://jquery.com/ 4 * 5 * Includes Sizzle.js 6 * https://sizzlejs.com/ 7 * 8 * Copyright JS Foundation and other contributors 9 * Released under the MIT license 10 * https://jquery.org/license 11 * 12 * Date: 2020-05-04T22:49Z 13 */ 14( function( global, factory ) { 15 16 "use strict"; 17 18 if ( typeof module === "object" && typeof module.exports === "object" ) { 19 20 // For CommonJS and CommonJS-like environments where a proper `window` 21 // is present, execute the factory and get jQuery. 22 // For environments that do not have a `window` with a `document` 23 // (such as Node.js), expose a factory as module.exports. 24 // This accentuates the need for the creation of a real `window`. 25 // e.g. var jQuery = require("jquery")(window); 26 // See ticket #14549 for more info. 27 module.exports = global.document ? 28 factory( global, true ) : 29 function( w ) { 30 if ( !w.document ) { 31 throw new Error( "jQuery requires a window with a document" ); 32 } 33 return factory( w ); 34 }; 35 } else { 36 factory( global ); 37 } 38 39// Pass this if window is not defined yet 40} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 41 42// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 43// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 44// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 45// enough that all such attempts are guarded in a try block. 46 "use strict"; 47 48 var arr = []; 49 50 var getProto = Object.getPrototypeOf; 51 52 var slice = arr.slice; 53 54 var flat = arr.flat ? function( array ) { 55 return arr.flat.call( array ); 56 } : function( array ) { 57 return arr.concat.apply( [], array ); 58 }; 59 60 61 var push = arr.push; 62 63 var indexOf = arr.indexOf; 64 65 var class2type = {}; 66 67 var toString = class2type.toString; 68 69 var hasOwn = class2type.hasOwnProperty; 70 71 var fnToString = hasOwn.toString; 72 73 var ObjectFunctionString = fnToString.call( Object ); 74 75 var support = {}; 76 77 var isFunction = function isFunction( obj ) { 78 79 // Support: Chrome <=57, Firefox <=52 80 // In some browsers, typeof returns "function" for HTML <object> elements 81 // (i.e., `typeof document.createElement( "object" ) === "function"`). 82 // We don't want to classify *any* DOM node as a function. 83 return typeof obj === "function" && typeof obj.nodeType !== "number"; 84 }; 85 86 87 var isWindow = function isWindow( obj ) { 88 return obj != null && obj === obj.window; 89 }; 90 91 92 var document = window.document; 93 94 95 96 var preservedScriptAttributes = { 97 type: true, 98 src: true, 99 nonce: true, 100 noModule: true 101 }; 102 103 function DOMEval( code, node, doc ) { 104 doc = doc || document; 105 106 var i, val, 107 script = doc.createElement( "script" ); 108 109 script.text = code; 110 if ( node ) { 111 for ( i in preservedScriptAttributes ) { 112 113 // Support: Firefox 64+, Edge 18+ 114 // Some browsers don't support the "nonce" property on scripts. 115 // On the other hand, just using `getAttribute` is not enough as 116 // the `nonce` attribute is reset to an empty string whenever it 117 // becomes browsing-context connected. 118 // See https://github.com/whatwg/html/issues/2369 119 // See https://html.spec.whatwg.org/#nonce-attributes 120 // The `node.getAttribute` check was added for the sake of 121 // `jQuery.globalEval` so that it can fake a nonce-containing node 122 // via an object. 123 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 124 if ( val ) { 125 script.setAttribute( i, val ); 126 } 127 } 128 } 129 doc.head.appendChild( script ).parentNode.removeChild( script ); 130 } 131 132 133 function toType( obj ) { 134 if ( obj == null ) { 135 return obj + ""; 136 } 137
vendor: 4,621 bytes, lines 138-290
138 // Support: Android <=2.3 only (functionish RegExp) 139 return typeof obj === "object" || typeof obj === "function" ? 140 class2type[ toString.call( obj ) ] || "object" : 141 typeof obj; 142 } 143 /* global Symbol */ 144// Defining this global in .eslintrc.json would create a danger of using the global 145// unguarded in another place, it seems safer to define global only for this module 146 147 148 149 var 150 version = "3.5.1", 151 152 // Define a local copy of jQuery 153 jQuery = function( selector, context ) { 154 155 // The jQuery object is actually just the init constructor 'enhanced' 156 // Need init if jQuery is called (just allow error to be thrown if not included) 157 return new jQuery.fn.init( selector, context ); 158 }; 159 160 jQuery.fn = jQuery.prototype = { 161 162 // The current version of jQuery being used 163 jquery: version, 164 165 constructor: jQuery, 166 167 // The default length of a jQuery object is 0 168 length: 0, 169 170 toArray: function() { 171 return slice.call( this ); 172 }, 173 174 // Get the Nth element in the matched element set OR 175 // Get the whole matched element set as a clean array 176 get: function( num ) { 177 178 // Return all the elements in a clean array 179 if ( num == null ) { 180 return slice.call( this ); 181 } 182 183 // Return just the one element from the set 184 return num < 0 ? this[ num + this.length ] : this[ num ]; 185 }, 186 187 // Take an array of elements and push it onto the stack 188 // (returning the new matched element set) 189 pushStack: function( elems ) { 190 191 // Build a new jQuery matched element set 192 var ret = jQuery.merge( this.constructor(), elems ); 193 194 // Add the old object onto the stack (as a reference) 195 ret.prevObject = this; 196 197 // Return the newly-formed element set 198 return ret; 199 }, 200 201 // Execute a callback for every element in the matched set. 202 each: function( callback ) { 203 return jQuery.each( this, callback ); 204 }, 205 206 map: function( callback ) { 207 return this.pushStack( jQuery.map( this, function( elem, i ) { 208 return callback.call( elem, i, elem ); 209 } ) ); 210 }, 211 212 slice: function() { 213 return this.pushStack( slice.apply( this, arguments ) ); 214 }, 215 216 first: function() { 217 return this.eq( 0 ); 218 }, 219 220 last: function() { 221 return this.eq( -1 ); 222 }, 223 224 even: function() { 225 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 226 return ( i + 1 ) % 2; 227 } ) ); 228 }, 229 230 odd: function() { 231 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 232 return i % 2; 233 } ) ); 234 }, 235 236 eq: function( i ) { 237 var len = this.length, 238 j = +i + ( i < 0 ? len : 0 ); 239 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 240 }, 241 242 end: function() { 243 return this.prevObject || this.constructor(); 244 }, 245 246 // For internal use only. 247 // Behaves like an Array's method, not like a jQuery method. 248 push: push, 249 sort: arr.sort, 250 splice: arr.splice 251 }; 252 253 jQuery.extend = jQuery.fn.extend = function() { 254 var options, name, src, copy, copyIsArray, clone, 255 target = arguments[ 0 ] || {}, 256 i = 1, 257 length = arguments.length, 258 deep = false; 259 260 // Handle a deep copy situation 261 if ( typeof target === "boolean" ) { 262 deep = target; 263 264 // Skip the boolean and the target 265 target = arguments[ i ] || {}; 266 i++; 267 } 268 269 // Handle case when target is a string or something (possible in deep copy) 270 if ( typeof target !== "object" && !isFunction( target ) ) { 271 target = {}; 272 } 273 274 // Extend jQuery itself if only one argument is passed 275 if ( i === length ) { 276 target = this; 277 i--; 278 } 279 280 for ( ; i < length; i++ ) { 281 282 // Only deal with non-null/undefined values 283 if ( ( options = arguments[ i ] ) != null ) { 284 285 // Extend the base object 286 for ( name in options ) { 287 copy = options[ name ]; 288 289 // Prevent Object.prototype pollution 290 // Prevent never-ending loop
vendor: 5,588 bytes, lines 291-465
291 if ( name === "__proto__" || target === copy ) { 292 continue; 293 } 294 295 // Recurse if we're merging plain objects or arrays 296 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 297 ( copyIsArray = Array.isArray( copy ) ) ) ) { 298 src = target[ name ]; 299 300 // Ensure proper type for the source value 301 if ( copyIsArray && !Array.isArray( src ) ) { 302 clone = []; 303 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 304 clone = {}; 305 } else { 306 clone = src; 307 } 308 copyIsArray = false; 309 310 // Never move original objects, clone them 311 target[ name ] = jQuery.extend( deep, clone, copy ); 312 313 // Don't bring in undefined values 314 } else if ( copy !== undefined ) { 315 target[ name ] = copy; 316 } 317 } 318 } 319 } 320 321 // Return the modified object 322 return target; 323 }; 324 325 jQuery.extend( { 326 327 // Unique for each copy of jQuery on the page 328 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 329 330 // Assume jQuery is ready without the ready module 331 isReady: true, 332 333 error: function( msg ) { 334 throw new Error( msg ); 335 }, 336 337 noop: function() {}, 338 339 isPlainObject: function( obj ) { 340 var proto, Ctor; 341 342 // Detect obvious negatives 343 // Use toString instead of jQuery.type to catch host objects 344 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 345 return false; 346 } 347 348 proto = getProto( obj ); 349 350 // Objects with no prototype (e.g., `Object.create( null )`) are plain 351 if ( !proto ) { 352 return true; 353 } 354 355 // Objects with prototype are plain iff they were constructed by a global Object function 356 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 357 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 358 }, 359 360 isEmptyObject: function( obj ) { 361 var name; 362 363 for ( name in obj ) { 364 return false; 365 } 366 return true; 367 }, 368 369 // Evaluates a script in a provided context; falls back to the global one 370 // if not specified. 371 globalEval: function( code, options, doc ) { 372 DOMEval( code, { nonce: options && options.nonce }, doc ); 373 }, 374 375 each: function( obj, callback ) { 376 var length, i = 0; 377 378 if ( isArrayLike( obj ) ) { 379 length = obj.length; 380 for ( ; i < length; i++ ) { 381 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 382 break; 383 } 384 } 385 } else { 386 for ( i in obj ) { 387 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 388 break; 389 } 390 } 391 } 392 393 return obj; 394 }, 395 396 // results is for internal usage only 397 makeArray: function( arr, results ) { 398 var ret = results || []; 399 400 if ( arr != null ) { 401 if ( isArrayLike( Object( arr ) ) ) { 402 jQuery.merge( ret, 403 typeof arr === "string" ? 404 [ arr ] : arr 405 ); 406 } else { 407 push.call( ret, arr ); 408 } 409 } 410 411 return ret; 412 }, 413 414 inArray: function( elem, arr, i ) { 415 return arr == null ? -1 : indexOf.call( arr, elem, i ); 416 }, 417 418 // Support: Android <=4.0 only, PhantomJS 1 only 419 // push.apply(_, arraylike) throws on ancient WebKit 420 merge: function( first, second ) { 421 var len = +second.length, 422 j = 0, 423 i = first.length; 424 425 for ( ; j < len; j++ ) { 426 first[ i++ ] = second[ j ]; 427 } 428 429 first.length = i; 430 431 return first; 432 }, 433 434 grep: function( elems, callback, invert ) { 435 var callbackInverse, 436 matches = [], 437 i = 0, 438 length = elems.length, 439 callbackExpect = !invert; 440 441 // Go through the array, only saving the items 442 // that pass the validator function 443 for ( ; i < length; i++ ) { 444 callbackInverse = !callback( elems[ i ], i ); 445 if ( callbackInverse !== callbackExpect ) { 446 matches.push( elems[ i ] ); 447 } 448 } 449 450 return matches; 451 }, 452 453 // arg is for internal usage only 454 map: function( elems, callback, arg ) { 455 var length, value, 456 i = 0, 457 ret = []; 458 459 // Go through the array, translating each of the items to their new values 460 if ( isArrayLike( elems ) ) { 461 length = elems.length; 462 for ( ; i < length; i++ ) { 463 value = callback( elems[ i ], i, arg ); 464 465 if ( value != null ) {
vendor: 20,078 bytes, lines 466-938
466 ret.push( value ); 467 } 468 } 469 470 // Go through every key on the object, 471 } else { 472 for ( i in elems ) { 473 value = callback( elems[ i ], i, arg ); 474 475 if ( value != null ) { 476 ret.push( value ); 477 } 478 } 479 } 480 481 // Flatten any nested arrays 482 return flat( ret ); 483 }, 484 485 // A global GUID counter for objects 486 guid: 1, 487 488 // jQuery.support is not used in Core but other projects attach their 489 // properties to it so it needs to exist. 490 support: support 491 } ); 492 493 if ( typeof Symbol === "function" ) { 494 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 495 } 496 497// Populate the class2type map 498 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 499 function( _i, name ) { 500 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 501 } ); 502 503 function isArrayLike( obj ) { 504 505 // Support: real iOS 8.2 only (not reproducible in simulator) 506 // `in` check used to prevent JIT error (gh-2145) 507 // hasOwn isn't used here due to false negatives 508 // regarding Nodelist length in IE 509 var length = !!obj && "length" in obj && obj.length, 510 type = toType( obj ); 511 512 if ( isFunction( obj ) || isWindow( obj ) ) { 513 return false; 514 } 515 516 return type === "array" || length === 0 || 517 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 518 } 519 var Sizzle = 520 /*! 521 * Sizzle CSS Selector Engine v2.3.5 522 * https://sizzlejs.com/ 523 * 524 * Copyright JS Foundation and other contributors 525 * Released under the MIT license 526 * https://js.foundation/ 527 * 528 * Date: 2020-03-14 529 */ 530 ( function( window ) { 531 var i, 532 support, 533 Expr, 534 getText, 535 isXML, 536 tokenize, 537 compile, 538 select, 539 outermostContext, 540 sortInput, 541 hasDuplicate, 542 543 // Local document vars 544 setDocument, 545 document, 546 docElem, 547 documentIsHTML, 548 rbuggyQSA, 549 rbuggyMatches, 550 matches, 551 contains, 552 553 // Instance-specific data 554 expando = "sizzle" + 1 * new Date(), 555 preferredDoc = window.document, 556 dirruns = 0, 557 done = 0, 558 classCache = createCache(), 559 tokenCache = createCache(), 560 compilerCache = createCache(), 561 nonnativeSelectorCache = createCache(), 562 sortOrder = function( a, b ) { 563 if ( a === b ) { 564 hasDuplicate = true; 565 } 566 return 0; 567 }, 568 569 // Instance methods 570 hasOwn = ( {} ).hasOwnProperty, 571 arr = [], 572 pop = arr.pop, 573 pushNative = arr.push, 574 push = arr.push, 575 slice = arr.slice, 576 577 // Use a stripped-down indexOf as it's faster than native 578 // https://jsperf.com/thor-indexof-vs-for/5 579 indexOf = function( list, elem ) { 580 var i = 0, 581 len = list.length; 582 for ( ; i < len; i++ ) { 583 if ( list[ i ] === elem ) { 584 return i; 585 } 586 } 587 return -1; 588 }, 589 590 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 591 "ismap|loop|multiple|open|readonly|required|scoped", 592 593 // Regular expressions 594 595 // http://www.w3.org/TR/css3-selectors/#whitespace 596 whitespace = "[\\x20\\t\\r\\n\\f]", 597 598 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 599 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 600 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 601 602 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 603 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 604 605 // Operator (capture 2) 606 "*([*^$|!~]?=)" + whitespace + 607 608 // "Attribute values must be CSS identifiers [capture 5] 609 // or strings [capture 3 or capture 4]" 610 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 611 whitespace + "*\\]", 612 613 pseudos = ":(" + identifier + ")(?:\\((" + 614 615 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 616 // 1. quoted (capture 3; capture 4 or capture 5) 617 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 618 619 // 2. simple (capture 6) 620 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 621 622 // 3. anything else (capture 2) 623 ".*" + 624 ")\\)|)", 625 626 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 627 rwhitespace = new RegExp( whitespace + "+", "g" ), 628 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 629 whitespace + "+$", "g" ), 630 631 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 632 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 633 "*" ), 634 rdescend = new RegExp( whitespace + "|>" ), 635 636 rpseudo = new RegExp( pseudos ), 637 ridentifier = new RegExp( "^" + identifier + "$" ), 638 639 matchExpr = { 640 "ID": new RegExp( "^#(" + identifier + ")" ), 641 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 642 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 643 "ATTR": new RegExp( "^" + attributes ), 644 "PSEUDO": new RegExp( "^" + pseudos ), 645 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 646 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 647 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 648 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 649 650 // For use in libraries implementing .is() 651 // We use this for POS matching in `select` 652 "needsContext": new RegExp( "^" + whitespace + 653 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 654 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 655 }, 656 657 rhtml = /HTML$/i, 658 rinputs = /^(?:input|select|textarea|button)$/i, 659 rheader = /^h\d$/i, 660 661 rnative = /^[^{]+\{\s*\[native \w/, 662 663 // Easily-parseable/retrievable ID or TAG or CLASS selectors 664 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 665 666 rsibling = /[+~]/, 667 668 // CSS escapes 669 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 670 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 671 funescape = function( escape, nonHex ) { 672 var high = "0x" + escape.slice( 1 ) - 0x10000; 673 674 return nonHex ? 675 676 // Strip the backslash prefix from a non-hex escape sequence 677 nonHex : 678 679 // Replace a hexadecimal escape sequence with the encoded Unicode code point 680 // Support: IE <=11+ 681 // For values outside the Basic Multilingual Plane (BMP), manually construct a 682 // surrogate pair 683 high < 0 ? 684 String.fromCharCode( high + 0x10000 ) : 685 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 686 }, 687 688 // CSS string/identifier serialization 689 // https://drafts.csswg.org/cssom/#common-serializing-idioms 690 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 691 fcssescape = function( ch, asCodePoint ) { 692 if ( asCodePoint ) { 693 694 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 695 if ( ch === "\0" ) { 696 return "\uFFFD"; 697 } 698 699 // Control characters and (dependent upon position) numbers get escaped as code points 700 return ch.slice( 0, -1 ) + "\\" + 701 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 702 } 703 704 // Other potentially-special ASCII characters get backslash-escaped 705 return "\\" + ch; 706 }, 707 708 // Used for iframes 709 // See setDocument() 710 // Removing the function wrapper causes a "Permission Denied" 711 // error in IE 712 unloadHandler = function() { 713 setDocument(); 714 }, 715 716 inDisabledFieldset = addCombinator( 717 function( elem ) { 718 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 719 }, 720 { dir: "parentNode", next: "legend" } 721 ); 722 723// Optimize for push.apply( _, NodeList ) 724 try { 725 push.apply( 726 ( arr = slice.call( preferredDoc.childNodes ) ), 727 preferredDoc.childNodes 728 ); 729 730 // Support: Android<4.0 731 // Detect silently failing push.apply 732 // eslint-disable-next-line no-unused-expressions 733 arr[ preferredDoc.childNodes.length ].nodeType; 734 } catch ( e ) { 735 push = { apply: arr.length ? 736 737 // Leverage slice if possible 738 function( target, els ) { 739 pushNative.apply( target, slice.call( els ) ); 740 } : 741 742 // Support: IE<9 743 // Otherwise append directly 744 function( target, els ) { 745 var j = target.length, 746 i = 0; 747 748 // Can't trust NodeList.length 749 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 750 target.length = j - 1; 751 } 752 }; 753 } 754 755 function Sizzle( selector, context, results, seed ) { 756 var m, i, elem, nid, match, groups, newSelector, 757 newContext = context && context.ownerDocument, 758 759 // nodeType defaults to 9, since context defaults to document 760 nodeType = context ? context.nodeType : 9; 761 762 results = results || []; 763 764 // Return early from calls with invalid selector or context 765 if ( typeof selector !== "string" || !selector || 766 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 767 768 return results; 769 } 770 771 // Try to shortcut find operations (as opposed to filters) in HTML documents 772 if ( !seed ) { 773 setDocument( context ); 774 context = context || document; 775 776 if ( documentIsHTML ) { 777 778 // If the selector is sufficiently simple, try using a "get*By*" DOM method 779 // (excepting DocumentFragment context, where the methods don't exist) 780 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 781 782 // ID selector 783 if ( ( m = match[ 1 ] ) ) { 784 785 // Document context 786 if ( nodeType === 9 ) { 787 if ( ( elem = context.getElementById( m ) ) ) { 788 789 // Support: IE, Opera, Webkit 790 // TODO: identify versions 791 // getElementById can match elements by name instead of ID 792 if ( elem.id === m ) { 793 results.push( elem ); 794 return results; 795 } 796 } else { 797 return results; 798 } 799 800 // Element context 801 } else { 802 803 // Support: IE, Opera, Webkit 804 // TODO: identify versions 805 // getElementById can match elements by name instead of ID 806 if ( newContext && ( elem = newContext.getElementById( m ) ) && 807 contains( context, elem ) && 808 elem.id === m ) { 809 810 results.push( elem ); 811 return results; 812 } 813 } 814 815 // Type selector 816 } else if ( match[ 2 ] ) { 817 push.apply( results, context.getElementsByTagName( selector ) ); 818 return results; 819 820 // Class selector 821 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 822 context.getElementsByClassName ) { 823 824 push.apply( results, context.getElementsByClassName( m ) ); 825 return results; 826 } 827 } 828 829 // Take advantage of querySelectorAll 830 if ( support.qsa && 831 !nonnativeSelectorCache[ selector + " " ] && 832 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 833 834 // Support: IE 8 only 835 // Exclude object elements 836 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 837 838 newSelector = selector; 839 newContext = context; 840 841 // qSA considers elements outside a scoping root when evaluating child or 842 // descendant combinators, which is not what we want. 843 // In such cases, we work around the behavior by prefixing every selector in the 844 // list with an ID selector referencing the scope context. 845 // The technique has to be used as well when a leading combinator is used 846 // as such selectors are not recognized by querySelectorAll. 847 // Thanks to Andrew Dupont for this technique. 848 if ( nodeType === 1 && 849 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 850 851 // Expand context for sibling selectors 852 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 853 context; 854 855 // We can use :scope instead of the ID hack if the browser 856 // supports it & if we're not changing the context. 857 if ( newContext !== context || !support.scope ) { 858 859 // Capture the context ID, setting it first if necessary 860 if ( ( nid = context.getAttribute( "id" ) ) ) { 861 nid = nid.replace( rcssescape, fcssescape ); 862 } else { 863 context.setAttribute( "id", ( nid = expando ) ); 864 } 865 } 866 867 // Prefix every selector in the list 868 groups = tokenize( selector ); 869 i = groups.length; 870 while ( i-- ) { 871 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 872 toSelector( groups[ i ] ); 873 } 874 newSelector = groups.join( "," ); 875 } 876 877 try { 878 push.apply( results, 879 newContext.querySelectorAll( newSelector ) 880 ); 881 return results; 882 } catch ( qsaError ) { 883 nonnativeSelectorCache( selector, true ); 884 } finally { 885 if ( nid === expando ) { 886 context.removeAttribute( "id" ); 887 } 888 } 889 } 890 } 891 } 892 893 // All others 894 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 895 } 896 897 /** 898 * Create key-value caches of limited size 899 * @returns {function(string, object)} Returns the Object data after storing it on itself with 900 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 901 * deleting the oldest entry 902 */ 903 function createCache() { 904 var keys = []; 905 906 function cache( key, value ) { 907 908 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 909 if ( keys.push( key + " " ) > Expr.cacheLength ) { 910 911 // Only keep the most recent entries 912 delete cache[ keys.shift() ]; 913 } 914 return ( cache[ key + " " ] = value ); 915 } 916 return cache; 917 } 918 919 /** 920 * Mark a function for special use by Sizzle 921 * @param {Function} fn The function to mark 922 */ 923 function markFunction( fn ) { 924 fn[ expando ] = true; 925 return fn; 926 } 927 928 /** 929 * Support testing using an element 930 * @param {Function} fn Passed the created element and returns a boolean result 931 */ 932 function assert( fn ) { 933 var el = document.createElement( "fieldset" ); 934 935 try { 936 return !!fn( el ); 937 } catch ( e ) { 938 return false;
vendor: 4,414 bytes, lines 939-1046
939 } finally { 940 941 // Remove from its parent by default 942 if ( el.parentNode ) { 943 el.parentNode.removeChild( el ); 944 } 945 946 // release memory in IE 947 el = null; 948 } 949 } 950 951 /** 952 * Adds the same handler for all of the specified attrs 953 * @param {String} attrs Pipe-separated list of attributes 954 * @param {Function} handler The method that will be applied 955 */ 956 function addHandle( attrs, handler ) { 957 var arr = attrs.split( "|" ), 958 i = arr.length; 959 960 while ( i-- ) { 961 Expr.attrHandle[ arr[ i ] ] = handler; 962 } 963 } 964 965 /** 966 * Checks document order of two siblings 967 * @param {Element} a 968 * @param {Element} b 969 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 970 */ 971 function siblingCheck( a, b ) { 972 var cur = b && a, 973 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 974 a.sourceIndex - b.sourceIndex; 975 976 // Use IE sourceIndex if available on both nodes 977 if ( diff ) { 978 return diff; 979 } 980 981 // Check if b follows a 982 if ( cur ) { 983 while ( ( cur = cur.nextSibling ) ) { 984 if ( cur === b ) { 985 return -1; 986 } 987 } 988 } 989 990 return a ? 1 : -1; 991 } 992 993 /** 994 * Returns a function to use in pseudos for input types 995 * @param {String} type 996 */ 997 function createInputPseudo( type ) { 998 return function( elem ) { 999 var name = elem.nodeName.toLowerCase(); 1000 return name === "input" && elem.type === type; 1001 }; 1002 } 1003 1004 /** 1005 * Returns a function to use in pseudos for buttons 1006 * @param {String} type 1007 */ 1008 function createButtonPseudo( type ) { 1009 return function( elem ) { 1010 var name = elem.nodeName.toLowerCase(); 1011 return ( name === "input" || name === "button" ) && elem.type === type; 1012 }; 1013 } 1014 1015 /** 1016 * Returns a function to use in pseudos for :enabled/:disabled 1017 * @param {Boolean} disabled true for :disabled; false for :enabled 1018 */ 1019 function createDisabledPseudo( disabled ) { 1020 1021 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 1022 return function( elem ) { 1023 1024 // Only certain elements can match :enabled or :disabled 1025 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 1026 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 1027 if ( "form" in elem ) { 1028 1029 // Check for inherited disabledness on relevant non-disabled elements: 1030 // * listed form-associated elements in a disabled fieldset 1031 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 1032 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 1033 // * option elements in a disabled optgroup 1034 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 1035 // All such elements have a "form" property. 1036 if ( elem.parentNode && elem.disabled === false ) { 1037 1038 // Option elements defer to a parent optgroup if present 1039 if ( "label" in elem ) { 1040 if ( "label" in elem.parentNode ) { 1041 return elem.parentNode.disabled === disabled; 1042 } else { 1043 return elem.disabled === disabled; 1044 } 1045 } 1046
vendor: 32,601 bytes, lines 1047-1747
1047 // Support: IE 6 - 11 1048 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 1049 return elem.isDisabled === disabled || 1050 1051 // Where there is no isDisabled, check manually 1052 /* jshint -W018 */ 1053 elem.isDisabled !== !disabled && 1054 inDisabledFieldset( elem ) === disabled; 1055 } 1056 1057 return elem.disabled === disabled; 1058 1059 // Try to winnow out elements that can't be disabled before trusting the disabled property. 1060 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 1061 // even exist on them, let alone have a boolean value. 1062 } else if ( "label" in elem ) { 1063 return elem.disabled === disabled; 1064 } 1065 1066 // Remaining elements are neither :enabled nor :disabled 1067 return false; 1068 }; 1069 } 1070 1071 /** 1072 * Returns a function to use in pseudos for positionals 1073 * @param {Function} fn 1074 */ 1075 function createPositionalPseudo( fn ) { 1076 return markFunction( function( argument ) { 1077 argument = +argument; 1078 return markFunction( function( seed, matches ) { 1079 var j, 1080 matchIndexes = fn( [], seed.length, argument ), 1081 i = matchIndexes.length; 1082 1083 // Match elements found at the specified indexes 1084 while ( i-- ) { 1085 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 1086 seed[ j ] = !( matches[ j ] = seed[ j ] ); 1087 } 1088 } 1089 } ); 1090 } ); 1091 } 1092 1093 /** 1094 * Checks a node for validity as a Sizzle context 1095 * @param {Element|Object=} context 1096 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1097 */ 1098 function testContext( context ) { 1099 return context && typeof context.getElementsByTagName !== "undefined" && context; 1100 } 1101 1102// Expose support vars for convenience 1103 support = Sizzle.support = {}; 1104 1105 /** 1106 * Detects XML nodes 1107 * @param {Element|Object} elem An element or a document 1108 * @returns {Boolean} True iff elem is a non-HTML XML node 1109 */ 1110 isXML = Sizzle.isXML = function( elem ) { 1111 var namespace = elem.namespaceURI, 1112 docElem = ( elem.ownerDocument || elem ).documentElement; 1113 1114 // Support: IE <=8 1115 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 1116 // https://bugs.jquery.com/ticket/4833 1117 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 1118 }; 1119 1120 /** 1121 * Sets document-related variables once based on the current document 1122 * @param {Element|Object} [doc] An element or document object to use to set the document 1123 * @returns {Object} Returns the current document 1124 */ 1125 setDocument = Sizzle.setDocument = function( node ) { 1126 var hasCompare, subWindow, 1127 doc = node ? node.ownerDocument || node : preferredDoc; 1128 1129 // Return early if doc is invalid or already selected 1130 // Support: IE 11+, Edge 17 - 18+ 1131 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1132 // two documents; shallow comparisons work. 1133 // eslint-disable-next-line eqeqeq 1134 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 1135 return document; 1136 } 1137 1138 // Update global variables 1139 document = doc; 1140 docElem = document.documentElement; 1141 documentIsHTML = !isXML( document ); 1142 1143 // Support: IE 9 - 11+, Edge 12 - 18+ 1144 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1145 // Support: IE 11+, Edge 17 - 18+ 1146 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1147 // two documents; shallow comparisons work. 1148 // eslint-disable-next-line eqeqeq 1149 if ( preferredDoc != document && 1150 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 1151 1152 // Support: IE 11, Edge 1153 if ( subWindow.addEventListener ) { 1154 subWindow.addEventListener( "unload", unloadHandler, false ); 1155 1156 // Support: IE 9 - 10 only 1157 } else if ( subWindow.attachEvent ) { 1158 subWindow.attachEvent( "onunload", unloadHandler ); 1159 } 1160 } 1161 1162 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 1163 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 1164 // IE/Edge & older browsers don't support the :scope pseudo-class. 1165 // Support: Safari 6.0 only 1166 // Safari 6.0 supports :scope but it's an alias of :root there. 1167 support.scope = assert( function( el ) { 1168 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 1169 return typeof el.querySelectorAll !== "undefined" && 1170 !el.querySelectorAll( ":scope fieldset div" ).length; 1171 } ); 1172 1173 /* Attributes 1174 ---------------------------------------------------------------------- */ 1175 1176 // Support: IE<8 1177 // Verify that getAttribute really returns attributes and not properties 1178 // (excepting IE8 booleans) 1179 support.attributes = assert( function( el ) { 1180 el.className = "i"; 1181 return !el.getAttribute( "className" ); 1182 } ); 1183 1184 /* getElement(s)By* 1185 ---------------------------------------------------------------------- */ 1186 1187 // Check if getElementsByTagName("*") returns only elements 1188 support.getElementsByTagName = assert( function( el ) { 1189 el.appendChild( document.createComment( "" ) ); 1190 return !el.getElementsByTagName( "*" ).length; 1191 } ); 1192 1193 // Support: IE<9 1194 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1195 1196 // Support: IE<10 1197 // Check if getElementById returns elements by name 1198 // The broken getElementById methods don't pick up programmatically-set names, 1199 // so use a roundabout getElementsByName test 1200 support.getById = assert( function( el ) { 1201 docElem.appendChild( el ).id = expando; 1202 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1203 } ); 1204 1205 // ID filter and find 1206 if ( support.getById ) { 1207 Expr.filter[ "ID" ] = function( id ) { 1208 var attrId = id.replace( runescape, funescape ); 1209 return function( elem ) { 1210 return elem.getAttribute( "id" ) === attrId; 1211 }; 1212 }; 1213 Expr.find[ "ID" ] = function( id, context ) { 1214 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1215 var elem = context.getElementById( id ); 1216 return elem ? [ elem ] : []; 1217 } 1218 }; 1219 } else { 1220 Expr.filter[ "ID" ] = function( id ) { 1221 var attrId = id.replace( runescape, funescape ); 1222 return function( elem ) { 1223 var node = typeof elem.getAttributeNode !== "undefined" && 1224 elem.getAttributeNode( "id" ); 1225 return node && node.value === attrId; 1226 }; 1227 }; 1228 1229 // Support: IE 6 - 7 only 1230 // getElementById is not reliable as a find shortcut 1231 Expr.find[ "ID" ] = function( id, context ) { 1232 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1233 var node, i, elems, 1234 elem = context.getElementById( id ); 1235 1236 if ( elem ) { 1237 1238 // Verify the id attribute 1239 node = elem.getAttributeNode( "id" ); 1240 if ( node && node.value === id ) { 1241 return [ elem ]; 1242 } 1243 1244 // Fall back on getElementsByName 1245 elems = context.getElementsByName( id ); 1246 i = 0; 1247 while ( ( elem = elems[ i++ ] ) ) { 1248 node = elem.getAttributeNode( "id" ); 1249 if ( node && node.value === id ) { 1250 return [ elem ]; 1251 } 1252 } 1253 } 1254 1255 return []; 1256 } 1257 }; 1258 } 1259 1260 // Tag 1261 Expr.find[ "TAG" ] = support.getElementsByTagName ? 1262 function( tag, context ) { 1263 if ( typeof context.getElementsByTagName !== "undefined" ) { 1264 return context.getElementsByTagName( tag ); 1265 1266 // DocumentFragment nodes don't have gEBTN 1267 } else if ( support.qsa ) { 1268 return context.querySelectorAll( tag ); 1269 } 1270 } : 1271 1272 function( tag, context ) { 1273 var elem, 1274 tmp = [], 1275 i = 0, 1276 1277 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1278 results = context.getElementsByTagName( tag ); 1279 1280 // Filter out possible comments 1281 if ( tag === "*" ) { 1282 while ( ( elem = results[ i++ ] ) ) { 1283 if ( elem.nodeType === 1 ) { 1284 tmp.push( elem ); 1285 } 1286 } 1287 1288 return tmp; 1289 } 1290 return results; 1291 }; 1292 1293 // Class 1294 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 1295 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1296 return context.getElementsByClassName( className ); 1297 } 1298 }; 1299 1300 /* QSA/matchesSelector 1301 ---------------------------------------------------------------------- */ 1302 1303 // QSA and matchesSelector support 1304 1305 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1306 rbuggyMatches = []; 1307 1308 // qSa(:focus) reports false when true (Chrome 21) 1309 // We allow this because of a bug in IE8/9 that throws an error 1310 // whenever `document.activeElement` is accessed on an iframe 1311 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1312 // See https://bugs.jquery.com/ticket/13378 1313 rbuggyQSA = []; 1314 1315 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 1316 1317 // Build QSA regex 1318 // Regex strategy adopted from Diego Perini 1319 assert( function( el ) { 1320 1321 var input; 1322 1323 // Select is set to empty string on purpose 1324 // This is to test IE's treatment of not explicitly 1325 // setting a boolean content attribute, 1326 // since its presence should be enough 1327 // https://bugs.jquery.com/ticket/12359 1328 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 1329 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1330 "<option selected=''></option></select>"; 1331 1332 // Support: IE8, Opera 11-12.16 1333 // Nothing should be selected when empty strings follow ^= or $= or *= 1334 // The test attribute must be unknown in Opera but "safe" for WinRT 1335 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1336 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 1337 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1338 } 1339 1340 // Support: IE8 1341 // Boolean attributes and "value" are not treated correctly 1342 if ( !el.querySelectorAll( "[selected]" ).length ) { 1343 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1344 } 1345 1346 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1347 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1348 rbuggyQSA.push( "~=" ); 1349 } 1350 1351 // Support: IE 11+, Edge 15 - 18+ 1352 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 1353 // Adding a temporary attribute to the document before the selection works 1354 // around the issue. 1355 // Interestingly, IE 10 & older don't seem to have the issue. 1356 input = document.createElement( "input" ); 1357 input.setAttribute( "name", "" ); 1358 el.appendChild( input ); 1359 if ( !el.querySelectorAll( "[name='']" ).length ) { 1360 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 1361 whitespace + "*(?:''|\"\")" ); 1362 } 1363 1364 // Webkit/Opera - :checked should return selected option elements 1365 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1366 // IE8 throws error here and will not see later tests 1367 if ( !el.querySelectorAll( ":checked" ).length ) { 1368 rbuggyQSA.push( ":checked" ); 1369 } 1370 1371 // Support: Safari 8+, iOS 8+ 1372 // https://bugs.webkit.org/show_bug.cgi?id=136851 1373 // In-page `selector#id sibling-combinator selector` fails 1374 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 1375 rbuggyQSA.push( ".#.+[+~]" ); 1376 } 1377 1378 // Support: Firefox <=3.6 - 5 only 1379 // Old Firefox doesn't throw on a badly-escaped identifier. 1380 el.querySelectorAll( "\\\f" ); 1381 rbuggyQSA.push( "[\\r\\n\\f]" ); 1382 } ); 1383 1384 assert( function( el ) { 1385 el.innerHTML = "<a href='' disabled='disabled'></a>" + 1386 "<select disabled='disabled'><option/></select>"; 1387 1388 // Support: Windows 8 Native Apps 1389 // The type and name attributes are restricted during .innerHTML assignment 1390 var input = document.createElement( "input" ); 1391 input.setAttribute( "type", "hidden" ); 1392 el.appendChild( input ).setAttribute( "name", "D" ); 1393 1394 // Support: IE8 1395 // Enforce case-sensitivity of name attribute 1396 if ( el.querySelectorAll( "[name=d]" ).length ) { 1397 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1398 } 1399 1400 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1401 // IE8 throws error here and will not see later tests 1402 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 1403 rbuggyQSA.push( ":enabled", ":disabled" ); 1404 } 1405 1406 // Support: IE9-11+ 1407 // IE's :disabled selector does not pick up the children of disabled fieldsets 1408 docElem.appendChild( el ).disabled = true; 1409 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 1410 rbuggyQSA.push( ":enabled", ":disabled" ); 1411 } 1412 1413 // Support: Opera 10 - 11 only 1414 // Opera 10-11 does not throw on post-comma invalid pseudos 1415 el.querySelectorAll( "*,:x" ); 1416 rbuggyQSA.push( ",.*:" ); 1417 } ); 1418 } 1419 1420 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 1421 docElem.webkitMatchesSelector || 1422 docElem.mozMatchesSelector || 1423 docElem.oMatchesSelector || 1424 docElem.msMatchesSelector ) ) ) ) { 1425 1426 assert( function( el ) { 1427 1428 // Check to see if it's possible to do matchesSelector 1429 // on a disconnected node (IE 9) 1430 support.disconnectedMatch = matches.call( el, "*" ); 1431 1432 // This should fail with an exception 1433 // Gecko does not error, returns false instead 1434 matches.call( el, "[s!='']:x" ); 1435 rbuggyMatches.push( "!=", pseudos ); 1436 } ); 1437 } 1438 1439 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 1440 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 1441 1442 /* Contains 1443 ---------------------------------------------------------------------- */ 1444 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1445 1446 // Element contains another 1447 // Purposefully self-exclusive 1448 // As in, an element does not contain itself 1449 contains = hasCompare || rnative.test( docElem.contains ) ? 1450 function( a, b ) { 1451 var adown = a.nodeType === 9 ? a.documentElement : a, 1452 bup = b && b.parentNode; 1453 return a === bup || !!( bup && bup.nodeType === 1 && ( 1454 adown.contains ? 1455 adown.contains( bup ) : 1456 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1457 ) ); 1458 } : 1459 function( a, b ) { 1460 if ( b ) { 1461 while ( ( b = b.parentNode ) ) { 1462 if ( b === a ) { 1463 return true; 1464 } 1465 } 1466 } 1467 return false; 1468 }; 1469 1470 /* Sorting 1471 ---------------------------------------------------------------------- */ 1472 1473 // Document order sorting 1474 sortOrder = hasCompare ? 1475 function( a, b ) { 1476 1477 // Flag for duplicate removal 1478 if ( a === b ) { 1479 hasDuplicate = true; 1480 return 0; 1481 } 1482 1483 // Sort on method existence if only one input has compareDocumentPosition 1484 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1485 if ( compare ) { 1486 return compare; 1487 } 1488 1489 // Calculate position if both inputs belong to the same document 1490 // Support: IE 11+, Edge 17 - 18+ 1491 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1492 // two documents; shallow comparisons work. 1493 // eslint-disable-next-line eqeqeq 1494 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 1495 a.compareDocumentPosition( b ) : 1496 1497 // Otherwise we know they are disconnected 1498 1; 1499 1500 // Disconnected nodes 1501 if ( compare & 1 || 1502 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 1503 1504 // Choose the first element that is related to our preferred document 1505 // Support: IE 11+, Edge 17 - 18+ 1506 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1507 // two documents; shallow comparisons work. 1508 // eslint-disable-next-line eqeqeq 1509 if ( a == document || a.ownerDocument == preferredDoc && 1510 contains( preferredDoc, a ) ) { 1511 return -1; 1512 } 1513 1514 // Support: IE 11+, Edge 17 - 18+ 1515 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1516 // two documents; shallow comparisons work. 1517 // eslint-disable-next-line eqeqeq 1518 if ( b == document || b.ownerDocument == preferredDoc && 1519 contains( preferredDoc, b ) ) { 1520 return 1; 1521 } 1522 1523 // Maintain original order 1524 return sortInput ? 1525 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1526 0; 1527 } 1528 1529 return compare & 4 ? -1 : 1; 1530 } : 1531 function( a, b ) { 1532 1533 // Exit early if the nodes are identical 1534 if ( a === b ) { 1535 hasDuplicate = true; 1536 return 0; 1537 } 1538 1539 var cur, 1540 i = 0, 1541 aup = a.parentNode, 1542 bup = b.parentNode, 1543 ap = [ a ], 1544 bp = [ b ]; 1545 1546 // Parentless nodes are either documents or disconnected 1547 if ( !aup || !bup ) { 1548 1549 // Support: IE 11+, Edge 17 - 18+ 1550 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1551 // two documents; shallow comparisons work. 1552 /* eslint-disable eqeqeq */ 1553 return a == document ? -1 : 1554 b == document ? 1 : 1555 /* eslint-enable eqeqeq */ 1556 aup ? -1 : 1557 bup ? 1 : 1558 sortInput ? 1559 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1560 0; 1561 1562 // If the nodes are siblings, we can do a quick check 1563 } else if ( aup === bup ) { 1564 return siblingCheck( a, b ); 1565 } 1566 1567 // Otherwise we need full lists of their ancestors for comparison 1568 cur = a; 1569 while ( ( cur = cur.parentNode ) ) { 1570 ap.unshift( cur ); 1571 } 1572 cur = b; 1573 while ( ( cur = cur.parentNode ) ) { 1574 bp.unshift( cur ); 1575 } 1576 1577 // Walk down the tree looking for a discrepancy 1578 while ( ap[ i ] === bp[ i ] ) { 1579 i++; 1580 } 1581 1582 return i ? 1583 1584 // Do a sibling check if the nodes have a common ancestor 1585 siblingCheck( ap[ i ], bp[ i ] ) : 1586 1587 // Otherwise nodes in our document sort first 1588 // Support: IE 11+, Edge 17 - 18+ 1589 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1590 // two documents; shallow comparisons work. 1591 /* eslint-disable eqeqeq */ 1592 ap[ i ] == preferredDoc ? -1 : 1593 bp[ i ] == preferredDoc ? 1 : 1594 /* eslint-enable eqeqeq */ 1595 0; 1596 }; 1597 1598 return document; 1599 }; 1600 1601 Sizzle.matches = function( expr, elements ) { 1602 return Sizzle( expr, null, null, elements ); 1603 }; 1604 1605 Sizzle.matchesSelector = function( elem, expr ) { 1606 setDocument( elem ); 1607 1608 if ( support.matchesSelector && documentIsHTML && 1609 !nonnativeSelectorCache[ expr + " " ] && 1610 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1611 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1612 1613 try { 1614 var ret = matches.call( elem, expr ); 1615 1616 // IE 9's matchesSelector returns false on disconnected nodes 1617 if ( ret || support.disconnectedMatch || 1618 1619 // As well, disconnected nodes are said to be in a document 1620 // fragment in IE 9 1621 elem.document && elem.document.nodeType !== 11 ) { 1622 return ret; 1623 } 1624 } catch ( e ) { 1625 nonnativeSelectorCache( expr, true ); 1626 } 1627 } 1628 1629 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1630 }; 1631 1632 Sizzle.contains = function( context, elem ) { 1633 1634 // Set document vars if needed 1635 // Support: IE 11+, Edge 17 - 18+ 1636 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1637 // two documents; shallow comparisons work. 1638 // eslint-disable-next-line eqeqeq 1639 if ( ( context.ownerDocument || context ) != document ) { 1640 setDocument( context ); 1641 } 1642 return contains( context, elem ); 1643 }; 1644 1645 Sizzle.attr = function( elem, name ) { 1646 1647 // Set document vars if needed 1648 // Support: IE 11+, Edge 17 - 18+ 1649 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 1650 // two documents; shallow comparisons work. 1651 // eslint-disable-next-line eqeqeq 1652 if ( ( elem.ownerDocument || elem ) != document ) { 1653 setDocument( elem ); 1654 } 1655 1656 var fn = Expr.attrHandle[ name.toLowerCase() ], 1657 1658 // Don't get fooled by Object.prototype properties (jQuery #13807) 1659 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1660 fn( elem, name, !documentIsHTML ) : 1661 undefined; 1662 1663 return val !== undefined ? 1664 val : 1665 support.attributes || !documentIsHTML ? 1666 elem.getAttribute( name ) : 1667 ( val = elem.getAttributeNode( name ) ) && val.specified ? 1668 val.value : 1669 null; 1670 }; 1671 1672 Sizzle.escape = function( sel ) { 1673 return ( sel + "" ).replace( rcssescape, fcssescape ); 1674 }; 1675 1676 Sizzle.error = function( msg ) { 1677 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1678 }; 1679 1680 /** 1681 * Document sorting and removing duplicates 1682 * @param {ArrayLike} results 1683 */ 1684 Sizzle.uniqueSort = function( results ) { 1685 var elem, 1686 duplicates = [], 1687 j = 0, 1688 i = 0; 1689 1690 // Unless we *know* we can detect duplicates, assume their presence 1691 hasDuplicate = !support.detectDuplicates; 1692 sortInput = !support.sortStable && results.slice( 0 ); 1693 results.sort( sortOrder ); 1694 1695 if ( hasDuplicate ) { 1696 while ( ( elem = results[ i++ ] ) ) { 1697 if ( elem === results[ i ] ) { 1698 j = duplicates.push( i ); 1699 } 1700 } 1701 while ( j-- ) { 1702 results.splice( duplicates[ j ], 1 ); 1703 } 1704 } 1705 1706 // Clear input after sorting to release objects 1707 // See https://github.com/jquery/sizzle/pull/225 1708 sortInput = null; 1709 1710 return results; 1711 }; 1712 1713 /** 1714 * Utility function for retrieving the text value of an array of DOM nodes 1715 * @param {Array|Element} elem 1716 */ 1717 getText = Sizzle.getText = function( elem ) { 1718 var node, 1719 ret = "", 1720 i = 0, 1721 nodeType = elem.nodeType; 1722 1723 if ( !nodeType ) { 1724 1725 // If no nodeType, this is expected to be an array 1726 while ( ( node = elem[ i++ ] ) ) { 1727 1728 // Do not traverse comment nodes 1729 ret += getText( node ); 1730 } 1731 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1732 1733 // Use textContent for elements 1734 // innerText usage removed for consistency of new lines (jQuery #11153) 1735 if ( typeof elem.textContent === "string" ) { 1736 return elem.textContent; 1737 } else { 1738 1739 // Traverse its children 1740 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1741 ret += getText( elem ); 1742 } 1743 } 1744 } else if ( nodeType === 3 || nodeType === 4 ) { 1745 return elem.nodeValue; 1746 } 1747
vendor: 13,229 bytes, lines 1748-2022
1748 // Do not include comment or processing instruction nodes 1749 1750 return ret; 1751 }; 1752 1753 Expr = Sizzle.selectors = { 1754 1755 // Can be adjusted by the user 1756 cacheLength: 50, 1757 1758 createPseudo: markFunction, 1759 1760 match: matchExpr, 1761 1762 attrHandle: {}, 1763 1764 find: {}, 1765 1766 relative: { 1767 ">": { dir: "parentNode", first: true }, 1768 " ": { dir: "parentNode" }, 1769 "+": { dir: "previousSibling", first: true }, 1770 "~": { dir: "previousSibling" } 1771 }, 1772 1773 preFilter: { 1774 "ATTR": function( match ) { 1775 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 1776 1777 // Move the given value to match[3] whether quoted or unquoted 1778 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 1779 match[ 5 ] || "" ).replace( runescape, funescape ); 1780 1781 if ( match[ 2 ] === "~=" ) { 1782 match[ 3 ] = " " + match[ 3 ] + " "; 1783 } 1784 1785 return match.slice( 0, 4 ); 1786 }, 1787 1788 "CHILD": function( match ) { 1789 1790 /* matches from matchExpr["CHILD"] 1791 1 type (only|nth|...) 1792 2 what (child|of-type) 1793 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1794 4 xn-component of xn+y argument ([+-]?\d*n|) 1795 5 sign of xn-component 1796 6 x of xn-component 1797 7 sign of y-component 1798 8 y of y-component 1799 */ 1800 match[ 1 ] = match[ 1 ].toLowerCase(); 1801 1802 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 1803 1804 // nth-* requires argument 1805 if ( !match[ 3 ] ) { 1806 Sizzle.error( match[ 0 ] ); 1807 } 1808 1809 // numeric x and y parameters for Expr.filter.CHILD 1810 // remember that false/true cast respectively to 0/1 1811 match[ 4 ] = +( match[ 4 ] ? 1812 match[ 5 ] + ( match[ 6 ] || 1 ) : 1813 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 1814 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 1815 1816 // other types prohibit arguments 1817 } else if ( match[ 3 ] ) { 1818 Sizzle.error( match[ 0 ] ); 1819 } 1820 1821 return match; 1822 }, 1823 1824 "PSEUDO": function( match ) { 1825 var excess, 1826 unquoted = !match[ 6 ] && match[ 2 ]; 1827 1828 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 1829 return null; 1830 } 1831 1832 // Accept quoted arguments as-is 1833 if ( match[ 3 ] ) { 1834 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 1835 1836 // Strip excess characters from unquoted arguments 1837 } else if ( unquoted && rpseudo.test( unquoted ) && 1838 1839 // Get excess from tokenize (recursively) 1840 ( excess = tokenize( unquoted, true ) ) && 1841 1842 // advance to the next closing parenthesis 1843 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 1844 1845 // excess is a negative index 1846 match[ 0 ] = match[ 0 ].slice( 0, excess ); 1847 match[ 2 ] = unquoted.slice( 0, excess ); 1848 } 1849 1850 // Return only captures needed by the pseudo filter method (type and argument) 1851 return match.slice( 0, 3 ); 1852 } 1853 }, 1854 1855 filter: { 1856 1857 "TAG": function( nodeNameSelector ) { 1858 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1859 return nodeNameSelector === "*" ? 1860 function() { 1861 return true; 1862 } : 1863 function( elem ) { 1864 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1865 }; 1866 }, 1867 1868 "CLASS": function( className ) { 1869 var pattern = classCache[ className + " " ]; 1870 1871 return pattern || 1872 ( pattern = new RegExp( "(^|" + whitespace + 1873 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 1874 className, function( elem ) { 1875 return pattern.test( 1876 typeof elem.className === "string" && elem.className || 1877 typeof elem.getAttribute !== "undefined" && 1878 elem.getAttribute( "class" ) || 1879 "" 1880 ); 1881 } ); 1882 }, 1883 1884 "ATTR": function( name, operator, check ) { 1885 return function( elem ) { 1886 var result = Sizzle.attr( elem, name ); 1887 1888 if ( result == null ) { 1889 return operator === "!="; 1890 } 1891 if ( !operator ) { 1892 return true; 1893 } 1894 1895 result += ""; 1896 1897 /* eslint-disable max-len */ 1898 1899 return operator === "=" ? result === check : 1900 operator === "!=" ? result !== check : 1901 operator === "^=" ? check && result.indexOf( check ) === 0 : 1902 operator === "*=" ? check && result.indexOf( check ) > -1 : 1903 operator === "$=" ? check && result.slice( -check.length ) === check : 1904 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1905 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1906 false; 1907 /* eslint-enable max-len */ 1908 1909 }; 1910 }, 1911 1912 "CHILD": function( type, what, _argument, first, last ) { 1913 var simple = type.slice( 0, 3 ) !== "nth", 1914 forward = type.slice( -4 ) !== "last", 1915 ofType = what === "of-type"; 1916 1917 return first === 1 && last === 0 ? 1918 1919 // Shortcut for :nth-*(n) 1920 function( elem ) { 1921 return !!elem.parentNode; 1922 } : 1923 1924 function( elem, _context, xml ) { 1925 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1926 dir = simple !== forward ? "nextSibling" : "previousSibling", 1927 parent = elem.parentNode, 1928 name = ofType && elem.nodeName.toLowerCase(), 1929 useCache = !xml && !ofType, 1930 diff = false; 1931 1932 if ( parent ) { 1933 1934 // :(first|last|only)-(child|of-type) 1935 if ( simple ) { 1936 while ( dir ) { 1937 node = elem; 1938 while ( ( node = node[ dir ] ) ) { 1939 if ( ofType ? 1940 node.nodeName.toLowerCase() === name : 1941 node.nodeType === 1 ) { 1942 1943 return false; 1944 } 1945 } 1946 1947 // Reverse direction for :only-* (if we haven't yet done so) 1948 start = dir = type === "only" && !start && "nextSibling"; 1949 } 1950 return true; 1951 } 1952 1953 start = [ forward ? parent.firstChild : parent.lastChild ]; 1954 1955 // non-xml :nth-child(...) stores cache data on `parent` 1956 if ( forward && useCache ) { 1957 1958 // Seek `elem` from a previously-cached index 1959 1960 // ...in a gzip-friendly way 1961 node = parent; 1962 outerCache = node[ expando ] || ( node[ expando ] = {} ); 1963 1964 // Support: IE <9 only 1965 // Defend against cloned attroperties (jQuery gh-1709) 1966 uniqueCache = outerCache[ node.uniqueID ] || 1967 ( outerCache[ node.uniqueID ] = {} ); 1968 1969 cache = uniqueCache[ type ] || []; 1970 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1971 diff = nodeIndex && cache[ 2 ]; 1972 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1973 1974 while ( ( node = ++nodeIndex && node && node[ dir ] || 1975 1976 // Fallback to seeking `elem` from the start 1977 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 1978 1979 // When found, cache indexes on `parent` and break 1980 if ( node.nodeType === 1 && ++diff && node === elem ) { 1981 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1982 break; 1983 } 1984 } 1985 1986 } else { 1987 1988 // Use previously-cached element index if available 1989 if ( useCache ) { 1990 1991 // ...in a gzip-friendly way 1992 node = elem; 1993 outerCache = node[ expando ] || ( node[ expando ] = {} ); 1994 1995 // Support: IE <9 only 1996 // Defend against cloned attroperties (jQuery gh-1709) 1997 uniqueCache = outerCache[ node.uniqueID ] || 1998 ( outerCache[ node.uniqueID ] = {} ); 1999 2000 cache = uniqueCache[ type ] || []; 2001 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 2002 diff = nodeIndex; 2003 } 2004 2005 // xml :nth-child(...) 2006 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 2007 if ( diff === false ) { 2008 2009 // Use the same loop as above to seek `elem` from the start 2010 while ( ( node = ++nodeIndex && node && node[ dir ] || 2011 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 2012 2013 if ( ( ofType ? 2014 node.nodeName.toLowerCase() === name : 2015 node.nodeType === 1 ) && 2016 ++diff ) { 2017 2018 // Cache the index of each encountered element 2019 if ( useCache ) { 2020 outerCache = node[ expando ] || 2021 ( node[ expando ] = {} ); 2022
vendor: 14,491 bytes, lines 2023-2338
2023 // Support: IE <9 only 2024 // Defend against cloned attroperties (jQuery gh-1709) 2025 uniqueCache = outerCache[ node.uniqueID ] || 2026 ( outerCache[ node.uniqueID ] = {} ); 2027 2028 uniqueCache[ type ] = [ dirruns, diff ]; 2029 } 2030 2031 if ( node === elem ) { 2032 break; 2033 } 2034 } 2035 } 2036 } 2037 } 2038 2039 // Incorporate the offset, then check against cycle size 2040 diff -= last; 2041 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 2042 } 2043 }; 2044 }, 2045 2046 "PSEUDO": function( pseudo, argument ) { 2047 2048 // pseudo-class names are case-insensitive 2049 // http://www.w3.org/TR/selectors/#pseudo-classes 2050 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 2051 // Remember that setFilters inherits from pseudos 2052 var args, 2053 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 2054 Sizzle.error( "unsupported pseudo: " + pseudo ); 2055 2056 // The user may use createPseudo to indicate that 2057 // arguments are needed to create the filter function 2058 // just as Sizzle does 2059 if ( fn[ expando ] ) { 2060 return fn( argument ); 2061 } 2062 2063 // But maintain support for old signatures 2064 if ( fn.length > 1 ) { 2065 args = [ pseudo, pseudo, "", argument ]; 2066 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 2067 markFunction( function( seed, matches ) { 2068 var idx, 2069 matched = fn( seed, argument ), 2070 i = matched.length; 2071 while ( i-- ) { 2072 idx = indexOf( seed, matched[ i ] ); 2073 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 2074 } 2075 } ) : 2076 function( elem ) { 2077 return fn( elem, 0, args ); 2078 }; 2079 } 2080 2081 return fn; 2082 } 2083 }, 2084 2085 pseudos: { 2086 2087 // Potentially complex pseudos 2088 "not": markFunction( function( selector ) { 2089 2090 // Trim the selector passed to compile 2091 // to avoid treating leading and trailing 2092 // spaces as combinators 2093 var input = [], 2094 results = [], 2095 matcher = compile( selector.replace( rtrim, "$1" ) ); 2096 2097 return matcher[ expando ] ? 2098 markFunction( function( seed, matches, _context, xml ) { 2099 var elem, 2100 unmatched = matcher( seed, null, xml, [] ), 2101 i = seed.length; 2102 2103 // Match elements unmatched by `matcher` 2104 while ( i-- ) { 2105 if ( ( elem = unmatched[ i ] ) ) { 2106 seed[ i ] = !( matches[ i ] = elem ); 2107 } 2108 } 2109 } ) : 2110 function( elem, _context, xml ) { 2111 input[ 0 ] = elem; 2112 matcher( input, null, xml, results ); 2113 2114 // Don't keep the element (issue #299) 2115 input[ 0 ] = null; 2116 return !results.pop(); 2117 }; 2118 } ), 2119 2120 "has": markFunction( function( selector ) { 2121 return function( elem ) { 2122 return Sizzle( selector, elem ).length > 0; 2123 }; 2124 } ), 2125 2126 "contains": markFunction( function( text ) { 2127 text = text.replace( runescape, funescape ); 2128 return function( elem ) { 2129 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 2130 }; 2131 } ), 2132 2133 // "Whether an element is represented by a :lang() selector 2134 // is based solely on the element's language value 2135 // being equal to the identifier C, 2136 // or beginning with the identifier C immediately followed by "-". 2137 // The matching of C against the element's language value is performed case-insensitively. 2138 // The identifier C does not have to be a valid language name." 2139 // http://www.w3.org/TR/selectors/#lang-pseudo 2140 "lang": markFunction( function( lang ) { 2141 2142 // lang value must be a valid identifier 2143 if ( !ridentifier.test( lang || "" ) ) { 2144 Sizzle.error( "unsupported lang: " + lang ); 2145 } 2146 lang = lang.replace( runescape, funescape ).toLowerCase(); 2147 return function( elem ) { 2148 var elemLang; 2149 do { 2150 if ( ( elemLang = documentIsHTML ? 2151 elem.lang : 2152 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 2153 2154 elemLang = elemLang.toLowerCase(); 2155 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 2156 } 2157 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 2158 return false; 2159 }; 2160 } ), 2161 2162 // Miscellaneous 2163 "target": function( elem ) { 2164 var hash = window.location && window.location.hash; 2165 return hash && hash.slice( 1 ) === elem.id; 2166 }, 2167 2168 "root": function( elem ) { 2169 return elem === docElem; 2170 }, 2171 2172 "focus": function( elem ) { 2173 return elem === document.activeElement && 2174 ( !document.hasFocus || document.hasFocus() ) && 2175 !!( elem.type || elem.href || ~elem.tabIndex ); 2176 }, 2177 2178 // Boolean properties 2179 "enabled": createDisabledPseudo( false ), 2180 "disabled": createDisabledPseudo( true ), 2181 2182 "checked": function( elem ) { 2183 2184 // In CSS3, :checked should return both checked and selected elements 2185 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 2186 var nodeName = elem.nodeName.toLowerCase(); 2187 return ( nodeName === "input" && !!elem.checked ) || 2188 ( nodeName === "option" && !!elem.selected ); 2189 }, 2190 2191 "selected": function( elem ) { 2192 2193 // Accessing this property makes selected-by-default 2194 // options in Safari work properly 2195 if ( elem.parentNode ) { 2196 // eslint-disable-next-line no-unused-expressions 2197 elem.parentNode.selectedIndex; 2198 } 2199 2200 return elem.selected === true; 2201 }, 2202 2203 // Contents 2204 "empty": function( elem ) { 2205 2206 // http://www.w3.org/TR/selectors/#empty-pseudo 2207 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 2208 // but not by others (comment: 8; processing instruction: 7; etc.) 2209 // nodeType < 6 works because attributes (2) do not appear as children 2210 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2211 if ( elem.nodeType < 6 ) { 2212 return false; 2213 } 2214 } 2215 return true; 2216 }, 2217 2218 "parent": function( elem ) { 2219 return !Expr.pseudos[ "empty" ]( elem ); 2220 }, 2221 2222 // Element/input types 2223 "header": function( elem ) { 2224 return rheader.test( elem.nodeName ); 2225 }, 2226 2227 "input": function( elem ) { 2228 return rinputs.test( elem.nodeName ); 2229 }, 2230 2231 "button": function( elem ) { 2232 var name = elem.nodeName.toLowerCase(); 2233 return name === "input" && elem.type === "button" || name === "button"; 2234 }, 2235 2236 "text": function( elem ) { 2237 var attr; 2238 return elem.nodeName.toLowerCase() === "input" && 2239 elem.type === "text" && 2240 2241 // Support: IE<8 2242 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 2243 ( ( attr = elem.getAttribute( "type" ) ) == null || 2244 attr.toLowerCase() === "text" ); 2245 }, 2246 2247 // Position-in-collection 2248 "first": createPositionalPseudo( function() { 2249 return [ 0 ]; 2250 } ), 2251 2252 "last": createPositionalPseudo( function( _matchIndexes, length ) { 2253 return [ length - 1 ]; 2254 } ), 2255 2256 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 2257 return [ argument < 0 ? argument + length : argument ]; 2258 } ), 2259 2260 "even": createPositionalPseudo( function( matchIndexes, length ) { 2261 var i = 0; 2262 for ( ; i < length; i += 2 ) { 2263 matchIndexes.push( i ); 2264 } 2265 return matchIndexes; 2266 } ), 2267 2268 "odd": createPositionalPseudo( function( matchIndexes, length ) { 2269 var i = 1; 2270 for ( ; i < length; i += 2 ) { 2271 matchIndexes.push( i ); 2272 } 2273 return matchIndexes; 2274 } ), 2275 2276 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 2277 var i = argument < 0 ? 2278 argument + length : 2279 argument > length ? 2280 length : 2281 argument; 2282 for ( ; --i >= 0; ) { 2283 matchIndexes.push( i ); 2284 } 2285 return matchIndexes; 2286 } ), 2287 2288 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 2289 var i = argument < 0 ? argument + length : argument; 2290 for ( ; ++i < length; ) { 2291 matchIndexes.push( i ); 2292 } 2293 return matchIndexes; 2294 } ) 2295 } 2296 }; 2297 2298 Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 2299 2300// Add button/input type pseudos 2301 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2302 Expr.pseudos[ i ] = createInputPseudo( i ); 2303 } 2304 for ( i in { submit: true, reset: true } ) { 2305 Expr.pseudos[ i ] = createButtonPseudo( i ); 2306 } 2307 2308// Easy API for creating new setFilters 2309 function setFilters() {} 2310 setFilters.prototype = Expr.filters = Expr.pseudos; 2311 Expr.setFilters = new setFilters(); 2312 2313 tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2314 var matched, match, tokens, type, 2315 soFar, groups, preFilters, 2316 cached = tokenCache[ selector + " " ]; 2317 2318 if ( cached ) { 2319 return parseOnly ? 0 : cached.slice( 0 ); 2320 } 2321 2322 soFar = selector; 2323 groups = []; 2324 preFilters = Expr.preFilter; 2325 2326 while ( soFar ) { 2327 2328 // Comma and first run 2329 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 2330 if ( match ) { 2331 2332 // Don't consume trailing commas as valid 2333 soFar = soFar.slice( match[ 0 ].length ) || soFar; 2334 } 2335 groups.push( ( tokens = [] ) ); 2336 } 2337 2338 matched = false;
vendor: 5,359 bytes, lines 2339-2456
2339 2340 // Combinators 2341 if ( ( match = rcombinators.exec( soFar ) ) ) { 2342 matched = match.shift(); 2343 tokens.push( { 2344 value: matched, 2345 2346 // Cast descendant combinators to space 2347 type: match[ 0 ].replace( rtrim, " " ) 2348 } ); 2349 soFar = soFar.slice( matched.length ); 2350 } 2351 2352 // Filters 2353 for ( type in Expr.filter ) { 2354 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 2355 ( match = preFilters[ type ]( match ) ) ) ) { 2356 matched = match.shift(); 2357 tokens.push( { 2358 value: matched, 2359 type: type, 2360 matches: match 2361 } ); 2362 soFar = soFar.slice( matched.length ); 2363 } 2364 } 2365 2366 if ( !matched ) { 2367 break; 2368 } 2369 } 2370 2371 // Return the length of the invalid excess 2372 // if we're just parsing 2373 // Otherwise, throw an error or return tokens 2374 return parseOnly ? 2375 soFar.length : 2376 soFar ? 2377 Sizzle.error( selector ) : 2378 2379 // Cache the tokens 2380 tokenCache( selector, groups ).slice( 0 ); 2381 }; 2382 2383 function toSelector( tokens ) { 2384 var i = 0, 2385 len = tokens.length, 2386 selector = ""; 2387 for ( ; i < len; i++ ) { 2388 selector += tokens[ i ].value; 2389 } 2390 return selector; 2391 } 2392 2393 function addCombinator( matcher, combinator, base ) { 2394 var dir = combinator.dir, 2395 skip = combinator.next, 2396 key = skip || dir, 2397 checkNonElements = base && key === "parentNode", 2398 doneName = done++; 2399 2400 return combinator.first ? 2401 2402 // Check against closest ancestor/preceding element 2403 function( elem, context, xml ) { 2404 while ( ( elem = elem[ dir ] ) ) { 2405 if ( elem.nodeType === 1 || checkNonElements ) { 2406 return matcher( elem, context, xml ); 2407 } 2408 } 2409 return false; 2410 } : 2411 2412 // Check against all ancestor/preceding elements 2413 function( elem, context, xml ) { 2414 var oldCache, uniqueCache, outerCache, 2415 newCache = [ dirruns, doneName ]; 2416 2417 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2418 if ( xml ) { 2419 while ( ( elem = elem[ dir ] ) ) { 2420 if ( elem.nodeType === 1 || checkNonElements ) { 2421 if ( matcher( elem, context, xml ) ) { 2422 return true; 2423 } 2424 } 2425 } 2426 } else { 2427 while ( ( elem = elem[ dir ] ) ) { 2428 if ( elem.nodeType === 1 || checkNonElements ) { 2429 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 2430 2431 // Support: IE <9 only 2432 // Defend against cloned attroperties (jQuery gh-1709) 2433 uniqueCache = outerCache[ elem.uniqueID ] || 2434 ( outerCache[ elem.uniqueID ] = {} ); 2435 2436 if ( skip && skip === elem.nodeName.toLowerCase() ) { 2437 elem = elem[ dir ] || elem; 2438 } else if ( ( oldCache = uniqueCache[ key ] ) && 2439 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2440 2441 // Assign to newCache so results back-propagate to previous elements 2442 return ( newCache[ 2 ] = oldCache[ 2 ] ); 2443 } else { 2444 2445 // Reuse newcache so results back-propagate to previous elements 2446 uniqueCache[ key ] = newCache; 2447 2448 // A match means we're done; a fail means we have to keep checking 2449 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 2450 return true; 2451 } 2452 } 2453 } 2454 } 2455 } 2456 return false;
vendor: 8,930 bytes, lines 2457-2653
2457 }; 2458 } 2459 2460 function elementMatcher( matchers ) { 2461 return matchers.length > 1 ? 2462 function( elem, context, xml ) { 2463 var i = matchers.length; 2464 while ( i-- ) { 2465 if ( !matchers[ i ]( elem, context, xml ) ) { 2466 return false; 2467 } 2468 } 2469 return true; 2470 } : 2471 matchers[ 0 ]; 2472 } 2473 2474 function multipleContexts( selector, contexts, results ) { 2475 var i = 0, 2476 len = contexts.length; 2477 for ( ; i < len; i++ ) { 2478 Sizzle( selector, contexts[ i ], results ); 2479 } 2480 return results; 2481 } 2482 2483 function condense( unmatched, map, filter, context, xml ) { 2484 var elem, 2485 newUnmatched = [], 2486 i = 0, 2487 len = unmatched.length, 2488 mapped = map != null; 2489 2490 for ( ; i < len; i++ ) { 2491 if ( ( elem = unmatched[ i ] ) ) { 2492 if ( !filter || filter( elem, context, xml ) ) { 2493 newUnmatched.push( elem ); 2494 if ( mapped ) { 2495 map.push( i ); 2496 } 2497 } 2498 } 2499 } 2500 2501 return newUnmatched; 2502 } 2503 2504 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2505 if ( postFilter && !postFilter[ expando ] ) { 2506 postFilter = setMatcher( postFilter ); 2507 } 2508 if ( postFinder && !postFinder[ expando ] ) { 2509 postFinder = setMatcher( postFinder, postSelector ); 2510 } 2511 return markFunction( function( seed, results, context, xml ) { 2512 var temp, i, elem, 2513 preMap = [], 2514 postMap = [], 2515 preexisting = results.length, 2516 2517 // Get initial elements from seed or context 2518 elems = seed || multipleContexts( 2519 selector || "*", 2520 context.nodeType ? [ context ] : context, 2521 [] 2522 ), 2523 2524 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2525 matcherIn = preFilter && ( seed || !selector ) ? 2526 condense( elems, preMap, preFilter, context, xml ) : 2527 elems, 2528 2529 matcherOut = matcher ? 2530 2531 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2532 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2533 2534 // ...intermediate processing is necessary 2535 [] : 2536 2537 // ...otherwise use results directly 2538 results : 2539 matcherIn; 2540 2541 // Find primary matches 2542 if ( matcher ) { 2543 matcher( matcherIn, matcherOut, context, xml ); 2544 } 2545 2546 // Apply postFilter 2547 if ( postFilter ) { 2548 temp = condense( matcherOut, postMap ); 2549 postFilter( temp, [], context, xml ); 2550 2551 // Un-match failing elements by moving them back to matcherIn 2552 i = temp.length; 2553 while ( i-- ) { 2554 if ( ( elem = temp[ i ] ) ) { 2555 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 2556 } 2557 } 2558 } 2559 2560 if ( seed ) { 2561 if ( postFinder || preFilter ) { 2562 if ( postFinder ) { 2563 2564 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2565 temp = []; 2566 i = matcherOut.length; 2567 while ( i-- ) { 2568 if ( ( elem = matcherOut[ i ] ) ) { 2569 2570 // Restore matcherIn since elem is not yet a final match 2571 temp.push( ( matcherIn[ i ] = elem ) ); 2572 } 2573 } 2574 postFinder( null, ( matcherOut = [] ), temp, xml ); 2575 } 2576 2577 // Move matched elements from seed to results to keep them synchronized 2578 i = matcherOut.length; 2579 while ( i-- ) { 2580 if ( ( elem = matcherOut[ i ] ) && 2581 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 2582 2583 seed[ temp ] = !( results[ temp ] = elem ); 2584 } 2585 } 2586 } 2587 2588 // Add elements to results, through postFinder if defined 2589 } else { 2590 matcherOut = condense( 2591 matcherOut === results ? 2592 matcherOut.splice( preexisting, matcherOut.length ) : 2593 matcherOut 2594 ); 2595 if ( postFinder ) { 2596 postFinder( null, results, matcherOut, xml ); 2597 } else { 2598 push.apply( results, matcherOut ); 2599 } 2600 } 2601 } ); 2602 } 2603 2604 function matcherFromTokens( tokens ) { 2605 var checkContext, matcher, j, 2606 len = tokens.length, 2607 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 2608 implicitRelative = leadingRelative || Expr.relative[ " " ], 2609 i = leadingRelative ? 1 : 0, 2610 2611 // The foundational matcher ensures that elements are reachable from top-level context(s) 2612 matchContext = addCombinator( function( elem ) { 2613 return elem === checkContext; 2614 }, implicitRelative, true ), 2615 matchAnyContext = addCombinator( function( elem ) { 2616 return indexOf( checkContext, elem ) > -1; 2617 }, implicitRelative, true ), 2618 matchers = [ function( elem, context, xml ) { 2619 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2620 ( checkContext = context ).nodeType ? 2621 matchContext( elem, context, xml ) : 2622 matchAnyContext( elem, context, xml ) ); 2623 2624 // Avoid hanging onto element (issue #299) 2625 checkContext = null; 2626 return ret; 2627 } ]; 2628 2629 for ( ; i < len; i++ ) { 2630 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 2631 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 2632 } else { 2633 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 2634 2635 // Return special upon seeing a positional matcher 2636 if ( matcher[ expando ] ) { 2637 2638 // Find the next relative operator (if any) for proper handling 2639 j = ++i; 2640 for ( ; j < len; j++ ) { 2641 if ( Expr.relative[ tokens[ j ].type ] ) { 2642 break; 2643 } 2644 } 2645 return setMatcher( 2646 i > 1 && elementMatcher( matchers ), 2647 i > 1 && toSelector( 2648 2649 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2650 tokens 2651 .slice( 0, i - 1 ) 2652 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 2653 ).replace( rtrim, "$1" ),
vendor: 10,913 bytes, lines 2654-2878
2654 matcher, 2655 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2656 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 2657 j < len && toSelector( tokens ) 2658 ); 2659 } 2660 matchers.push( matcher ); 2661 } 2662 } 2663 2664 return elementMatcher( matchers ); 2665 } 2666 2667 function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2668 var bySet = setMatchers.length > 0, 2669 byElement = elementMatchers.length > 0, 2670 superMatcher = function( seed, context, xml, results, outermost ) { 2671 var elem, j, matcher, 2672 matchedCount = 0, 2673 i = "0", 2674 unmatched = seed && [], 2675 setMatched = [], 2676 contextBackup = outermostContext, 2677 2678 // We must always have either seed elements or outermost context 2679 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 2680 2681 // Use integer dirruns iff this is the outermost matcher 2682 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 2683 len = elems.length; 2684 2685 if ( outermost ) { 2686 2687 // Support: IE 11+, Edge 17 - 18+ 2688 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2689 // two documents; shallow comparisons work. 2690 // eslint-disable-next-line eqeqeq 2691 outermostContext = context == document || context || outermost; 2692 } 2693 2694 // Add elements passing elementMatchers directly to results 2695 // Support: IE<9, Safari 2696 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2697 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 2698 if ( byElement && elem ) { 2699 j = 0; 2700 2701 // Support: IE 11+, Edge 17 - 18+ 2702 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2703 // two documents; shallow comparisons work. 2704 // eslint-disable-next-line eqeqeq 2705 if ( !context && elem.ownerDocument != document ) { 2706 setDocument( elem ); 2707 xml = !documentIsHTML; 2708 } 2709 while ( ( matcher = elementMatchers[ j++ ] ) ) { 2710 if ( matcher( elem, context || document, xml ) ) { 2711 results.push( elem ); 2712 break; 2713 } 2714 } 2715 if ( outermost ) { 2716 dirruns = dirrunsUnique; 2717 } 2718 } 2719 2720 // Track unmatched elements for set filters 2721 if ( bySet ) { 2722 2723 // They will have gone through all possible matchers 2724 if ( ( elem = !matcher && elem ) ) { 2725 matchedCount--; 2726 } 2727 2728 // Lengthen the array for every element, matched or not 2729 if ( seed ) { 2730 unmatched.push( elem ); 2731 } 2732 } 2733 } 2734 2735 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2736 // makes the latter nonnegative. 2737 matchedCount += i; 2738 2739 // Apply set filters to unmatched elements 2740 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2741 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2742 // no element matchers and no seed. 2743 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2744 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2745 // numerically zero. 2746 if ( bySet && i !== matchedCount ) { 2747 j = 0; 2748 while ( ( matcher = setMatchers[ j++ ] ) ) { 2749 matcher( unmatched, setMatched, context, xml ); 2750 } 2751 2752 if ( seed ) { 2753 2754 // Reintegrate element matches to eliminate the need for sorting 2755 if ( matchedCount > 0 ) { 2756 while ( i-- ) { 2757 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 2758 setMatched[ i ] = pop.call( results ); 2759 } 2760 } 2761 } 2762 2763 // Discard index placeholder values to get only actual matches 2764 setMatched = condense( setMatched ); 2765 } 2766 2767 // Add matches to results 2768 push.apply( results, setMatched ); 2769 2770 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2771 if ( outermost && !seed && setMatched.length > 0 && 2772 ( matchedCount + setMatchers.length ) > 1 ) { 2773 2774 Sizzle.uniqueSort( results ); 2775 } 2776 } 2777 2778 // Override manipulation of globals by nested matchers 2779 if ( outermost ) { 2780 dirruns = dirrunsUnique; 2781 outermostContext = contextBackup; 2782 } 2783 2784 return unmatched; 2785 }; 2786 2787 return bySet ? 2788 markFunction( superMatcher ) : 2789 superMatcher; 2790 } 2791 2792 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2793 var i, 2794 setMatchers = [], 2795 elementMatchers = [], 2796 cached = compilerCache[ selector + " " ]; 2797 2798 if ( !cached ) { 2799 2800 // Generate a function of recursive functions that can be used to check each element 2801 if ( !match ) { 2802 match = tokenize( selector ); 2803 } 2804 i = match.length; 2805 while ( i-- ) { 2806 cached = matcherFromTokens( match[ i ] ); 2807 if ( cached[ expando ] ) { 2808 setMatchers.push( cached ); 2809 } else { 2810 elementMatchers.push( cached ); 2811 } 2812 } 2813 2814 // Cache the compiled function 2815 cached = compilerCache( 2816 selector, 2817 matcherFromGroupMatchers( elementMatchers, setMatchers ) 2818 ); 2819 2820 // Save selector and tokenization 2821 cached.selector = selector; 2822 } 2823 return cached; 2824 }; 2825 2826 /** 2827 * A low-level selection function that works with Sizzle's compiled 2828 * selector functions 2829 * @param {String|Function} selector A selector or a pre-compiled 2830 * selector function built with Sizzle.compile 2831 * @param {Element} context 2832 * @param {Array} [results] 2833 * @param {Array} [seed] A set of elements to match against 2834 */ 2835 select = Sizzle.select = function( selector, context, results, seed ) { 2836 var i, tokens, token, type, find, 2837 compiled = typeof selector === "function" && selector, 2838 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 2839 2840 results = results || []; 2841 2842 // Try to minimize operations if there is only one selector in the list and no seed 2843 // (the latter of which guarantees us context) 2844 if ( match.length === 1 ) { 2845 2846 // Reduce context if the leading compound selector is an ID 2847 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 2848 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 2849 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 2850 2851 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 2852 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 2853 if ( !context ) { 2854 return results; 2855 2856 // Precompiled matchers will still verify ancestry, so step up a level 2857 } else if ( compiled ) { 2858 context = context.parentNode; 2859 } 2860 2861 selector = selector.slice( tokens.shift().value.length ); 2862 } 2863 2864 // Fetch a seed set for right-to-left matching 2865 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 2866 while ( i-- ) { 2867 token = tokens[ i ]; 2868 2869 // Abort if we hit a combinator 2870 if ( Expr.relative[ ( type = token.type ) ] ) { 2871 break; 2872 } 2873 if ( ( find = Expr.find[ type ] ) ) { 2874 2875 // Search, expanding context for leading sibling combinators 2876 if ( ( seed = find( 2877 token.matches[ 0 ].replace( runescape, funescape ), 2878 rsibling.test( tokens[ 0 ].type ) && testC
vendor: 6,676 bytes, lines 2878-3082
2878ontext( context.parentNode ) || 2879 context 2880 ) ) ) { 2881 2882 // If seed is empty or no tokens remain, we can return early 2883 tokens.splice( i, 1 ); 2884 selector = seed.length && toSelector( tokens ); 2885 if ( !selector ) { 2886 push.apply( results, seed ); 2887 return results; 2888 } 2889 2890 break; 2891 } 2892 } 2893 } 2894 } 2895 2896 // Compile and execute a filtering function if one is not provided 2897 // Provide `match` to avoid retokenization if we modified the selector above 2898 ( compiled || compile( selector, match ) )( 2899 seed, 2900 context, 2901 !documentIsHTML, 2902 results, 2903 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2904 ); 2905 return results; 2906 }; 2907 2908// One-time assignments 2909 2910// Sort stability 2911 support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 2912 2913// Support: Chrome 14-35+ 2914// Always assume duplicates if they aren't passed to the comparison function 2915 support.detectDuplicates = !!hasDuplicate; 2916 2917// Initialize against the default document 2918 setDocument(); 2919 2920// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2921// Detached nodes confoundingly follow *each other* 2922 support.sortDetached = assert( function( el ) { 2923 2924 // Should return 1, but returns 4 (following) 2925 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 2926 } ); 2927 2928// Support: IE<8 2929// Prevent attribute/property "interpolation" 2930// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2931 if ( !assert( function( el ) { 2932 el.innerHTML = "<a href='#'></a>"; 2933 return el.firstChild.getAttribute( "href" ) === "#"; 2934 } ) ) { 2935 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2936 if ( !isXML ) { 2937 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2938 } 2939 } ); 2940 } 2941 2942// Support: IE<9 2943// Use defaultValue in place of getAttribute("value") 2944 if ( !support.attributes || !assert( function( el ) { 2945 el.innerHTML = "<input/>"; 2946 el.firstChild.setAttribute( "value", "" ); 2947 return el.firstChild.getAttribute( "value" ) === ""; 2948 } ) ) { 2949 addHandle( "value", function( elem, _name, isXML ) { 2950 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2951 return elem.defaultValue; 2952 } 2953 } ); 2954 } 2955 2956// Support: IE<9 2957// Use getAttributeNode to fetch booleans when getAttribute lies 2958 if ( !assert( function( el ) { 2959 return el.getAttribute( "disabled" ) == null; 2960 } ) ) { 2961 addHandle( booleans, function( elem, name, isXML ) { 2962 var val; 2963 if ( !isXML ) { 2964 return elem[ name ] === true ? name.toLowerCase() : 2965 ( val = elem.getAttributeNode( name ) ) && val.specified ? 2966 val.value : 2967 null; 2968 } 2969 } ); 2970 } 2971 2972 return Sizzle; 2973 2974 } )( window ); 2975 2976 2977 2978 jQuery.find = Sizzle; 2979 jQuery.expr = Sizzle.selectors; 2980 2981// Deprecated 2982 jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2983 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2984 jQuery.text = Sizzle.getText; 2985 jQuery.isXMLDoc = Sizzle.isXML; 2986 jQuery.contains = Sizzle.contains; 2987 jQuery.escapeSelector = Sizzle.escape; 2988 2989 2990 2991 2992 var dir = function( elem, dir, until ) { 2993 var matched = [], 2994 truncate = until !== undefined; 2995 2996 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2997 if ( elem.nodeType === 1 ) { 2998 if ( truncate && jQuery( elem ).is( until ) ) { 2999 break; 3000 } 3001 matched.push( elem ); 3002 } 3003 } 3004 return matched; 3005 }; 3006 3007 3008 var siblings = function( n, elem ) { 3009 var matched = []; 3010 3011 for ( ; n; n = n.nextSibling ) { 3012 if ( n.nodeType === 1 && n !== elem ) { 3013 matched.push( n ); 3014 } 3015 } 3016 3017 return matched; 3018 }; 3019 3020 3021 var rneedsContext = jQuery.expr.match.needsContext; 3022 3023 3024 3025 function nodeName( elem, name ) { 3026 3027 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 3028 3029 }; 3030 var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 3031 3032 3033 3034// Implement the identical functionality for filter and not 3035 function winnow( elements, qualifier, not ) { 3036 if ( isFunction( qualifier ) ) { 3037 return jQuery.grep( elements, function( elem, i ) { 3038 return !!qualifier.call( elem, i, elem ) !== not; 3039 } ); 3040 } 3041 3042 // Single element 3043 if ( qualifier.nodeType ) { 3044 return jQuery.grep( elements, function( elem ) { 3045 return ( elem === qualifier ) !== not; 3046 } ); 3047 } 3048 3049 // Arraylike of elements (jQuery, arguments, Array) 3050 if ( typeof qualifier !== "string" ) { 3051 return jQuery.grep( elements, function( elem ) { 3052 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 3053 } ); 3054 } 3055 3056 // Filtered directly for both simple and complex selectors 3057 return jQuery.filter( qualifier, elements, not ); 3058 } 3059 3060 jQuery.filter = function( expr, elems, not ) { 3061 var elem = elems[ 0 ]; 3062 3063 if ( not ) { 3064 expr = ":not(" + expr + ")"; 3065 } 3066 3067 if ( elems.length === 1 && elem.nodeType === 1 ) { 3068 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 3069 } 3070 3071 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 3072 return elem.nodeType === 1; 3073 } ) ); 3074 }; 3075 3076 jQuery.fn.extend( { 3077 find: function( selector ) { 3078 var i, ret, 3079 len = this.length, 3080 self = this; 3081 3082 if ( typeof selector !== "string" ) {
vendor: 6,677 bytes, lines 3083-3269
3083 return this.pushStack( jQuery( selector ).filter( function() { 3084 for ( i = 0; i < len; i++ ) { 3085 if ( jQuery.contains( self[ i ], this ) ) { 3086 return true; 3087 } 3088 } 3089 } ) ); 3090 } 3091 3092 ret = this.pushStack( [] ); 3093 3094 for ( i = 0; i < len; i++ ) { 3095 jQuery.find( selector, self[ i ], ret ); 3096 } 3097 3098 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 3099 }, 3100 filter: function( selector ) { 3101 return this.pushStack( winnow( this, selector || [], false ) ); 3102 }, 3103 not: function( selector ) { 3104 return this.pushStack( winnow( this, selector || [], true ) ); 3105 }, 3106 is: function( selector ) { 3107 return !!winnow( 3108 this, 3109 3110 // If this is a positional/relative selector, check membership in the returned set 3111 // so $("p:first").is("p:last") won't return true for a doc with two "p". 3112 typeof selector === "string" && rneedsContext.test( selector ) ? 3113 jQuery( selector ) : 3114 selector || [], 3115 false 3116 ).length; 3117 } 3118 } ); 3119 3120 3121// Initialize a jQuery object 3122 3123 3124// A central reference to the root jQuery(document) 3125 var rootjQuery, 3126 3127 // A simple way to check for HTML strings 3128 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 3129 // Strict HTML recognition (#11290: must start with <) 3130 // Shortcut simple #id case for speed 3131 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 3132 3133 init = jQuery.fn.init = function( selector, context, root ) { 3134 var match, elem; 3135 3136 // HANDLE: $(""), $(null), $(undefined), $(false) 3137 if ( !selector ) { 3138 return this; 3139 } 3140 3141 // Method init() accepts an alternate rootjQuery 3142 // so migrate can support jQuery.sub (gh-2101) 3143 root = root || rootjQuery; 3144 3145 // Handle HTML strings 3146 if ( typeof selector === "string" ) { 3147 if ( selector[ 0 ] === "<" && 3148 selector[ selector.length - 1 ] === ">" && 3149 selector.length >= 3 ) { 3150 3151 // Assume that strings that start and end with <> are HTML and skip the regex check 3152 match = [ null, selector, null ]; 3153 3154 } else { 3155 match = rquickExpr.exec( selector ); 3156 } 3157 3158 // Match html or make sure no context is specified for #id 3159 if ( match && ( match[ 1 ] || !context ) ) { 3160 3161 // HANDLE: $(html) -> $(array) 3162 if ( match[ 1 ] ) { 3163 context = context instanceof jQuery ? context[ 0 ] : context; 3164 3165 // Option to run scripts is true for back-compat 3166 // Intentionally let the error be thrown if parseHTML is not present 3167 jQuery.merge( this, jQuery.parseHTML( 3168 match[ 1 ], 3169 context && context.nodeType ? context.ownerDocument || context : document, 3170 true 3171 ) ); 3172 3173 // HANDLE: $(html, props) 3174 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 3175 for ( match in context ) { 3176 3177 // Properties of context are called as methods if possible 3178 if ( isFunction( this[ match ] ) ) { 3179 this[ match ]( context[ match ] ); 3180 3181 // ...and otherwise set as attributes 3182 } else { 3183 this.attr( match, context[ match ] ); 3184 } 3185 } 3186 } 3187 3188 return this; 3189 3190 // HANDLE: $(#id) 3191 } else { 3192 elem = document.getElementById( match[ 2 ] ); 3193 3194 if ( elem ) { 3195 3196 // Inject the element directly into the jQuery object 3197 this[ 0 ] = elem; 3198 this.length = 1; 3199 } 3200 return this; 3201 } 3202 3203 // HANDLE: $(expr, $(...)) 3204 } else if ( !context || context.jquery ) { 3205 return ( context || root ).find( selector ); 3206 3207 // HANDLE: $(expr, context) 3208 // (which is just equivalent to: $(context).find(expr) 3209 } else { 3210 return this.constructor( context ).find( selector ); 3211 } 3212 3213 // HANDLE: $(DOMElement) 3214 } else if ( selector.nodeType ) { 3215 this[ 0 ] = selector; 3216 this.length = 1; 3217 return this; 3218 3219 // HANDLE: $(function) 3220 // Shortcut for document ready 3221 } else if ( isFunction( selector ) ) { 3222 return root.ready !== undefined ? 3223 root.ready( selector ) : 3224 3225 // Execute immediately if ready is not present 3226 selector( jQuery ); 3227 } 3228 3229 return jQuery.makeArray( selector, this ); 3230 }; 3231 3232// Give the init function the jQuery prototype for later instantiation 3233 init.prototype = jQuery.fn; 3234 3235// Initialize central reference 3236 rootjQuery = jQuery( document ); 3237 3238 3239 var rparentsprev = /^(?:parents|prev(?:Until|All))/, 3240 3241 // Methods guaranteed to produce a unique set when starting from a unique set 3242 guaranteedUnique = { 3243 children: true, 3244 contents: true, 3245 next: true, 3246 prev: true 3247 }; 3248 3249 jQuery.fn.extend( { 3250 has: function( target ) { 3251 var targets = jQuery( target, this ), 3252 l = targets.length; 3253 3254 return this.filter( function() { 3255 var i = 0; 3256 for ( ; i < l; i++ ) { 3257 if ( jQuery.contains( this, targets[ i ] ) ) { 3258 return true; 3259 } 3260 } 3261 } ); 3262 }, 3263 3264 closest: function( selectors, context ) { 3265 var cur, 3266 i = 0, 3267 l = this.length, 3268 matched = [], 3269 targets = typeof selectors !== "string" && jQuery(
vendor: 4,293 bytes, lines 3269-3393
3269selectors ); 3270 3271 // Positional selectors never match, since there's no _selection_ context 3272 if ( !rneedsContext.test( selectors ) ) { 3273 for ( ; i < l; i++ ) { 3274 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 3275 3276 // Always skip document fragments 3277 if ( cur.nodeType < 11 && ( targets ? 3278 targets.index( cur ) > -1 : 3279 3280 // Don't pass non-elements to Sizzle 3281 cur.nodeType === 1 && 3282 jQuery.find.matchesSelector( cur, selectors ) ) ) { 3283 3284 matched.push( cur ); 3285 break; 3286 } 3287 } 3288 } 3289 } 3290 3291 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3292 }, 3293 3294 // Determine the position of an element within the set 3295 index: function( elem ) { 3296 3297 // No argument, return index in parent 3298 if ( !elem ) { 3299 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3300 } 3301 3302 // Index in selector 3303 if ( typeof elem === "string" ) { 3304 return indexOf.call( jQuery( elem ), this[ 0 ] ); 3305 } 3306 3307 // Locate the position of the desired element 3308 return indexOf.call( this, 3309 3310 // If it receives a jQuery object, the first element is used 3311 elem.jquery ? elem[ 0 ] : elem 3312 ); 3313 }, 3314 3315 add: function( selector, context ) { 3316 return this.pushStack( 3317 jQuery.uniqueSort( 3318 jQuery.merge( this.get(), jQuery( selector, context ) ) 3319 ) 3320 ); 3321 }, 3322 3323 addBack: function( selector ) { 3324 return this.add( selector == null ? 3325 this.prevObject : this.prevObject.filter( selector ) 3326 ); 3327 } 3328 } ); 3329 3330 function sibling( cur, dir ) { 3331 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 3332 return cur; 3333 } 3334 3335 jQuery.each( { 3336 parent: function( elem ) { 3337 var parent = elem.parentNode; 3338 return parent && parent.nodeType !== 11 ? parent : null; 3339 }, 3340 parents: function( elem ) { 3341 return dir( elem, "parentNode" ); 3342 }, 3343 parentsUntil: function( elem, _i, until ) { 3344 return dir( elem, "parentNode", until ); 3345 }, 3346 next: function( elem ) { 3347 return sibling( elem, "nextSibling" ); 3348 }, 3349 prev: function( elem ) { 3350 return sibling( elem, "previousSibling" ); 3351 }, 3352 nextAll: function( elem ) { 3353 return dir( elem, "nextSibling" ); 3354 }, 3355 prevAll: function( elem ) { 3356 return dir( elem, "previousSibling" ); 3357 }, 3358 nextUntil: function( elem, _i, until ) { 3359 return dir( elem, "nextSibling", until ); 3360 }, 3361 prevUntil: function( elem, _i, until ) { 3362 return dir( elem, "previousSibling", until ); 3363 }, 3364 siblings: function( elem ) { 3365 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3366 }, 3367 children: function( elem ) { 3368 return siblings( elem.firstChild ); 3369 }, 3370 contents: function( elem ) { 3371 if ( elem.contentDocument != null && 3372 3373 // Support: IE 11+ 3374 // <object> elements with no `data` attribute has an object 3375 // `contentDocument` with a `null` prototype. 3376 getProto( elem.contentDocument ) ) { 3377 3378 return elem.contentDocument; 3379 } 3380 3381 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 3382 // Treat the template element as a regular one in browsers that 3383 // don't support it. 3384 if ( nodeName( elem, "template" ) ) { 3385 elem = elem.content || elem; 3386 } 3387 3388 return jQuery.merge( [], elem.childNodes ); 3389 } 3390 }, function( name, fn ) { 3391 jQuery.fn[ name ] = function( until, selector ) { 3392 var matched = jQuery.map( this, fn, until ); 3393
vendor: 35,395 bytes, lines 3394-4325
3394 if ( name.slice( -5 ) !== "Until" ) { 3395 selector = until; 3396 } 3397 3398 if ( selector && typeof selector === "string" ) { 3399 matched = jQuery.filter( selector, matched ); 3400 } 3401 3402 if ( this.length > 1 ) { 3403 3404 // Remove duplicates 3405 if ( !guaranteedUnique[ name ] ) { 3406 jQuery.uniqueSort( matched ); 3407 } 3408 3409 // Reverse order for parents* and prev-derivatives 3410 if ( rparentsprev.test( name ) ) { 3411 matched.reverse(); 3412 } 3413 } 3414 3415 return this.pushStack( matched ); 3416 }; 3417 } ); 3418 var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 3419 3420 3421 3422// Convert String-formatted options into Object-formatted ones 3423 function createOptions( options ) { 3424 var object = {}; 3425 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 3426 object[ flag ] = true; 3427 } ); 3428 return object; 3429 } 3430 3431 /* 3432 * Create a callback list using the following parameters: 3433 * 3434 * options: an optional list of space-separated options that will change how 3435 * the callback list behaves or a more traditional option object 3436 * 3437 * By default a callback list will act like an event callback list and can be 3438 * "fired" multiple times. 3439 * 3440 * Possible options: 3441 * 3442 * once: will ensure the callback list can only be fired once (like a Deferred) 3443 * 3444 * memory: will keep track of previous values and will call any callback added 3445 * after the list has been fired right away with the latest "memorized" 3446 * values (like a Deferred) 3447 * 3448 * unique: will ensure a callback can only be added once (no duplicate in the list) 3449 * 3450 * stopOnFalse: interrupt callings when a callback returns false 3451 * 3452 */ 3453 jQuery.Callbacks = function( options ) { 3454 3455 // Convert options from String-formatted to Object-formatted if needed 3456 // (we check in cache first) 3457 options = typeof options === "string" ? 3458 createOptions( options ) : 3459 jQuery.extend( {}, options ); 3460 3461 var // Flag to know if list is currently firing 3462 firing, 3463 3464 // Last fire value for non-forgettable lists 3465 memory, 3466 3467 // Flag to know if list was already fired 3468 fired, 3469 3470 // Flag to prevent firing 3471 locked, 3472 3473 // Actual callback list 3474 list = [], 3475 3476 // Queue of execution data for repeatable lists 3477 queue = [], 3478 3479 // Index of currently firing callback (modified by add/remove as needed) 3480 firingIndex = -1, 3481 3482 // Fire callbacks 3483 fire = function() { 3484 3485 // Enforce single-firing 3486 locked = locked || options.once; 3487 3488 // Execute callbacks for all pending executions, 3489 // respecting firingIndex overrides and runtime changes 3490 fired = firing = true; 3491 for ( ; queue.length; firingIndex = -1 ) { 3492 memory = queue.shift(); 3493 while ( ++firingIndex < list.length ) { 3494 3495 // Run callback and check for early termination 3496 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3497 options.stopOnFalse ) { 3498 3499 // Jump to end and forget the data so .add doesn't re-fire 3500 firingIndex = list.length; 3501 memory = false; 3502 } 3503 } 3504 } 3505 3506 // Forget the data if we're done with it 3507 if ( !options.memory ) { 3508 memory = false; 3509 } 3510 3511 firing = false; 3512 3513 // Clean up if we're done firing for good 3514 if ( locked ) { 3515 3516 // Keep an empty list if we have data for future add calls 3517 if ( memory ) { 3518 list = []; 3519 3520 // Otherwise, this object is spent 3521 } else { 3522 list = ""; 3523 } 3524 } 3525 }, 3526 3527 // Actual Callbacks object 3528 self = { 3529 3530 // Add a callback or a collection of callbacks to the list 3531 add: function() { 3532 if ( list ) { 3533 3534 // If we have memory from a past run, we should fire after adding 3535 if ( memory && !firing ) { 3536 firingIndex = list.length - 1; 3537 queue.push( memory ); 3538 } 3539 3540 ( function add( args ) { 3541 jQuery.each( args, function( _, arg ) { 3542 if ( isFunction( arg ) ) { 3543 if ( !options.unique || !self.has( arg ) ) { 3544 list.push( arg ); 3545 } 3546 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 3547 3548 // Inspect recursively 3549 add( arg ); 3550 } 3551 } ); 3552 } )( arguments ); 3553 3554 if ( memory && !firing ) { 3555 fire(); 3556 } 3557 } 3558 return this; 3559 }, 3560 3561 // Remove a callback from the list 3562 remove: function() { 3563 jQuery.each( arguments, function( _, arg ) { 3564 var index; 3565 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3566 list.splice( index, 1 ); 3567 3568 // Handle firing indexes 3569 if ( index <= firingIndex ) { 3570 firingIndex--; 3571 } 3572 } 3573 } ); 3574 return this; 3575 }, 3576 3577 // Check if a given callback is in the list. 3578 // If no argument is given, return whether or not list has callbacks attached. 3579 has: function( fn ) { 3580 return fn ? 3581 jQuery.inArray( fn, list ) > -1 : 3582 list.length > 0; 3583 }, 3584 3585 // Remove all callbacks from the list 3586 empty: function() { 3587 if ( list ) { 3588 list = []; 3589 } 3590 return this; 3591 }, 3592 3593 // Disable .fire and .add 3594 // Abort any current/pending executions 3595 // Clear all callbacks and values 3596 disable: function() { 3597 locked = queue = []; 3598 list = memory = ""; 3599 return this; 3600 }, 3601 disabled: function() { 3602 return !list; 3603 }, 3604 3605 // Disable .fire 3606 // Also disable .add unless we have memory (since it would have no effect) 3607 // Abort any pending executions 3608 lock: function() { 3609 locked = queue = []; 3610 if ( !memory && !firing ) { 3611 list = memory = ""; 3612 } 3613 return this; 3614 }, 3615 locked: function() { 3616 return !!locked; 3617 }, 3618 3619 // Call all callbacks with the given context and arguments 3620 fireWith: function( context, args ) { 3621 if ( !locked ) { 3622 args = args || []; 3623 args = [ context, args.slice ? args.slice() : args ]; 3624 queue.push( args ); 3625 if ( !firing ) { 3626 fire(); 3627 } 3628 } 3629 return this; 3630 }, 3631 3632 // Call all the callbacks with the given arguments 3633 fire: function() { 3634 self.fireWith( this, arguments ); 3635 return this; 3636 }, 3637 3638 // To know if the callbacks have already been called at least once 3639 fired: function() { 3640 return !!fired; 3641 } 3642 }; 3643 3644 return self; 3645 }; 3646 3647 3648 function Identity( v ) { 3649 return v; 3650 } 3651 function Thrower( ex ) { 3652 throw ex; 3653 } 3654 3655 function adoptValue( value, resolve, reject, noValue ) { 3656 var method; 3657 3658 try { 3659 3660 // Check for promise aspect first to privilege synchronous behavior 3661 if ( value && isFunction( ( method = value.promise ) ) ) { 3662 method.call( value ).done( resolve ).fail( reject ); 3663 3664 // Other thenables 3665 } else if ( value && isFunction( ( method = value.then ) ) ) { 3666 method.call( value, resolve, reject ); 3667 3668 // Other non-thenables 3669 } else { 3670 3671 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 3672 // * false: [ value ].slice( 0 ) => resolve( value ) 3673 // * true: [ value ].slice( 1 ) => resolve() 3674 resolve.apply( undefined, [ value ].slice( noValue ) ); 3675 } 3676 3677 // For Promises/A+, convert exceptions into rejections 3678 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 3679 // Deferred#then to conditionally suppress rejection. 3680 } catch ( value ) { 3681 3682 // Support: Android 4.0 only 3683 // Strict mode functions invoked without .call/.apply get global-object context 3684 reject.apply( undefined, [ value ] ); 3685 } 3686 } 3687 3688 jQuery.extend( { 3689 3690 Deferred: function( func ) { 3691 var tuples = [ 3692 3693 // action, add listener, callbacks, 3694 // ... .then handlers, argument index, [final state] 3695 [ "notify", "progress", jQuery.Callbacks( "memory" ), 3696 jQuery.Callbacks( "memory" ), 2 ], 3697 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 3698 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 3699 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 3700 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 3701 ], 3702 state = "pending", 3703 promise = { 3704 state: function() { 3705 return state; 3706 }, 3707 always: function() { 3708 deferred.done( arguments ).fail( arguments ); 3709 return this; 3710 }, 3711 "catch": function( fn ) { 3712 return promise.then( null, fn ); 3713 }, 3714 3715 // Keep pipe for back-compat 3716 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 3717 var fns = arguments; 3718 3719 return jQuery.Deferred( function( newDefer ) { 3720 jQuery.each( tuples, function( _i, tuple ) { 3721 3722 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 3723 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 3724 3725 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 3726 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 3727 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 3728 deferred[ tuple[ 1 ] ]( function() { 3729 var returned = fn && fn.apply( this, arguments ); 3730 if ( returned && isFunction( returned.promise ) ) { 3731 returned.promise() 3732 .progress( newDefer.notify ) 3733 .done( newDefer.resolve ) 3734 .fail( newDefer.reject ); 3735 } else { 3736 newDefer[ tuple[ 0 ] + "With" ]( 3737 this, 3738 fn ? [ returned ] : arguments 3739 ); 3740 } 3741 } ); 3742 } ); 3743 fns = null; 3744 } ).promise(); 3745 }, 3746 then: function( onFulfilled, onRejected, onProgress ) { 3747 var maxDepth = 0; 3748 function resolve( depth, deferred, handler, special ) { 3749 return function() { 3750 var that = this, 3751 args = arguments, 3752 mightThrow = function() { 3753 var returned, then; 3754 3755 // Support: Promises/A+ section 2.3.3.3.3 3756 // https://promisesaplus.com/#point-59 3757 // Ignore double-resolution attempts 3758 if ( depth < maxDepth ) { 3759 return; 3760 } 3761 3762 returned = handler.apply( that, args ); 3763 3764 // Support: Promises/A+ section 2.3.1 3765 // https://promisesaplus.com/#point-48 3766 if ( returned === deferred.promise() ) { 3767 throw new TypeError( "Thenable self-resolution" ); 3768 } 3769 3770 // Support: Promises/A+ sections 2.3.3.1, 3.5 3771 // https://promisesaplus.com/#point-54 3772 // https://promisesaplus.com/#point-75 3773 // Retrieve `then` only once 3774 then = returned && 3775 3776 // Support: Promises/A+ section 2.3.4 3777 // https://promisesaplus.com/#point-64 3778 // Only check objects and functions for thenability 3779 ( typeof returned === "object" || 3780 typeof returned === "function" ) && 3781 returned.then; 3782 3783 // Handle a returned thenable 3784 if ( isFunction( then ) ) { 3785 3786 // Special processors (notify) just wait for resolution 3787 if ( special ) { 3788 then.call( 3789 returned, 3790 resolve( maxDepth, deferred, Identity, special ), 3791 resolve( maxDepth, deferred, Thrower, special ) 3792 ); 3793 3794 // Normal processors (resolve) also hook into progress 3795 } else { 3796 3797 // ...and disregard older resolution values 3798 maxDepth++; 3799 3800 then.call( 3801 returned, 3802 resolve( maxDepth, deferred, Identity, special ), 3803 resolve( maxDepth, deferred, Thrower, special ), 3804 resolve( maxDepth, deferred, Identity, 3805 deferred.notifyWith ) 3806 ); 3807 } 3808 3809 // Handle all other returned values 3810 } else { 3811 3812 // Only substitute handlers pass on context 3813 // and multiple values (non-spec behavior) 3814 if ( handler !== Identity ) { 3815 that = undefined; 3816 args = [ returned ]; 3817 } 3818 3819 // Process the value(s) 3820 // Default process is resolve 3821 ( special || deferred.resolveWith )( that, args ); 3822 } 3823 }, 3824 3825 // Only normal processors (resolve) catch and reject exceptions 3826 process = special ? 3827 mightThrow : 3828 function() { 3829 try { 3830 mightThrow(); 3831 } catch ( e ) { 3832 3833 if ( jQuery.Deferred.exceptionHook ) { 3834 jQuery.Deferred.exceptionHook( e, 3835 process.stackTrace ); 3836 } 3837 3838 // Support: Promises/A+ section 2.3.3.3.4.1 3839 // https://promisesaplus.com/#point-61 3840 // Ignore post-resolution exceptions 3841 if ( depth + 1 >= maxDepth ) { 3842 3843 // Only substitute handlers pass on context 3844 // and multiple values (non-spec behavior) 3845 if ( handler !== Thrower ) { 3846 that = undefined; 3847 args = [ e ]; 3848 } 3849 3850 deferred.rejectWith( that, args ); 3851 } 3852 } 3853 }; 3854 3855 // Support: Promises/A+ section 2.3.3.3.1 3856 // https://promisesaplus.com/#point-57 3857 // Re-resolve promises immediately to dodge false rejection from 3858 // subsequent errors 3859 if ( depth ) { 3860 process(); 3861 } else { 3862 3863 // Call an optional hook to record the stack, in case of exception 3864 // since it's otherwise lost when execution goes async 3865 if ( jQuery.Deferred.getStackHook ) { 3866 process.stackTrace = jQuery.Deferred.getStackHook(); 3867 } 3868 window.setTimeout( process ); 3869 } 3870 }; 3871 } 3872 3873 return jQuery.Deferred( function( newDefer ) { 3874 3875 // progress_handlers.add( ... ) 3876 tuples[ 0 ][ 3 ].add( 3877 resolve( 3878 0, 3879 newDefer, 3880 isFunction( onProgress ) ? 3881 onProgress : 3882 Identity, 3883 newDefer.notifyWith 3884 ) 3885 ); 3886 3887 // fulfilled_handlers.add( ... ) 3888 tuples[ 1 ][ 3 ].add( 3889 resolve( 3890 0, 3891 newDefer, 3892 isFunction( onFulfilled ) ? 3893 onFulfilled : 3894 Identity 3895 ) 3896 ); 3897 3898 // rejected_handlers.add( ... ) 3899 tuples[ 2 ][ 3 ].add( 3900 resolve( 3901 0, 3902 newDefer, 3903 isFunction( onRejected ) ? 3904 onRejected : 3905 Thrower 3906 ) 3907 ); 3908 } ).promise(); 3909 }, 3910 3911 // Get a promise for this deferred 3912 // If obj is provided, the promise aspect is added to the object 3913 promise: function( obj ) { 3914 return obj != null ? jQuery.extend( obj, promise ) : promise; 3915 } 3916 }, 3917 deferred = {}; 3918 3919 // Add list-specific methods 3920 jQuery.each( tuples, function( i, tuple ) { 3921 var list = tuple[ 2 ], 3922 stateString = tuple[ 5 ]; 3923 3924 // promise.progress = list.add 3925 // promise.done = list.add 3926 // promise.fail = list.add 3927 promise[ tuple[ 1 ] ] = list.add; 3928 3929 // Handle state 3930 if ( stateString ) { 3931 list.add( 3932 function() { 3933 3934 // state = "resolved" (i.e., fulfilled) 3935 // state = "rejected" 3936 state = stateString; 3937 }, 3938 3939 // rejected_callbacks.disable 3940 // fulfilled_callbacks.disable 3941 tuples[ 3 - i ][ 2 ].disable, 3942 3943 // rejected_handlers.disable 3944 // fulfilled_handlers.disable 3945 tuples[ 3 - i ][ 3 ].disable, 3946 3947 // progress_callbacks.lock 3948 tuples[ 0 ][ 2 ].lock, 3949 3950 // progress_handlers.lock 3951 tuples[ 0 ][ 3 ].lock 3952 ); 3953 } 3954 3955 // progress_handlers.fire 3956 // fulfilled_handlers.fire 3957 // rejected_handlers.fire 3958 list.add( tuple[ 3 ].fire ); 3959 3960 // deferred.notify = function() { deferred.notifyWith(...) } 3961 // deferred.resolve = function() { deferred.resolveWith(...) } 3962 // deferred.reject = function() { deferred.rejectWith(...) } 3963 deferred[ tuple[ 0 ] ] = function() { 3964 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 3965 return this; 3966 }; 3967 3968 // deferred.notifyWith = list.fireWith 3969 // deferred.resolveWith = list.fireWith 3970 // deferred.rejectWith = list.fireWith 3971 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3972 } ); 3973 3974 // Make the deferred a promise 3975 promise.promise( deferred ); 3976 3977 // Call given func if any 3978 if ( func ) { 3979 func.call( deferred, deferred ); 3980 } 3981 3982 // All done! 3983 return deferred; 3984 }, 3985 3986 // Deferred helper 3987 when: function( singleValue ) { 3988 var 3989 3990 // count of uncompleted subordinates 3991 remaining = arguments.length, 3992 3993 // count of unprocessed arguments 3994 i = remaining, 3995 3996 // subordinate fulfillment data 3997 resolveContexts = Array( i ), 3998 resolveValues = slice.call( arguments ), 3999 4000 // the master Deferred 4001 master = jQuery.Deferred(), 4002 4003 // subordinate callback factory 4004 updateFunc = function( i ) { 4005 return function( value ) { 4006 resolveContexts[ i ] = this; 4007 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 4008 if ( !( --remaining ) ) { 4009 master.resolveWith( resolveContexts, resolveValues ); 4010 } 4011 }; 4012 }; 4013 4014 // Single- and empty arguments are adopted like Promise.resolve 4015 if ( remaining <= 1 ) { 4016 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 4017 !remaining ); 4018 4019 // Use .then() to unwrap secondary thenables (cf. gh-3000) 4020 if ( master.state() === "pending" || 4021 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 4022 4023 return master.then(); 4024 } 4025 } 4026 4027 // Multiple arguments are aggregated like Promise.all array elements 4028 while ( i-- ) { 4029 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 4030 } 4031 4032 return master.promise(); 4033 } 4034 } ); 4035 4036 4037// These usually indicate a programmer mistake during development, 4038// warn about them ASAP rather than swallowing them by default. 4039 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 4040 4041 jQuery.Deferred.exceptionHook = function( error, stack ) { 4042 4043 // Support: IE 8 - 9 only 4044 // Console exists when dev tools are open, which can happen at any time 4045 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 4046 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 4047 } 4048 }; 4049 4050 4051 4052 4053 jQuery.readyException = function( error ) { 4054 window.setTimeout( function() { 4055 throw error; 4056 } ); 4057 }; 4058 4059 4060 4061 4062// The deferred used on DOM ready 4063 var readyList = jQuery.Deferred(); 4064 4065 jQuery.fn.ready = function( fn ) { 4066 4067 readyList 4068 .then( fn ) 4069 4070 // Wrap jQuery.readyException in a function so that the lookup 4071 // happens at the time of error handling instead of callback 4072 // registration. 4073 .catch( function( error ) { 4074 jQuery.readyException( error ); 4075 } ); 4076 4077 return this; 4078 }; 4079 4080 jQuery.extend( { 4081 4082 // Is the DOM ready to be used? Set to true once it occurs. 4083 isReady: false, 4084 4085 // A counter to track how many items to wait for before 4086 // the ready event fires. See #6781 4087 readyWait: 1, 4088 4089 // Handle when the DOM is ready 4090 ready: function( wait ) { 4091 4092 // Abort if there are pending holds or we're already ready 4093 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 4094 return; 4095 } 4096 4097 // Remember that the DOM is ready 4098 jQuery.isReady = true; 4099 4100 // If a normal DOM Ready event fired, decrement, and wait if need be 4101 if ( wait !== true && --jQuery.readyWait > 0 ) { 4102 return; 4103 } 4104 4105 // If there are functions bound, to execute 4106 readyList.resolveWith( document, [ jQuery ] ); 4107 } 4108 } ); 4109 4110 jQuery.ready.then = readyList.then; 4111 4112// The ready event handler and self cleanup method 4113 function completed() { 4114 document.removeEventListener( "DOMContentLoaded", completed ); 4115 window.removeEventListener( "load", completed ); 4116 jQuery.ready(); 4117 } 4118 4119// Catch cases where $(document).ready() is called 4120// after the browser event has already occurred. 4121// Support: IE <=9 - 10 only 4122// Older IE sometimes signals "interactive" too soon 4123 if ( document.readyState === "complete" || 4124 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 4125 4126 // Handle it asynchronously to allow scripts the opportunity to delay ready 4127 window.setTimeout( jQuery.ready ); 4128 4129 } else { 4130 4131 // Use the handy event callback 4132 document.addEventListener( "DOMContentLoaded", completed ); 4133 4134 // A fallback to window.onload, that will always work 4135 window.addEventListener( "load", completed ); 4136 } 4137 4138 4139 4140 4141// Multifunctional method to get and set values of a collection 4142// The value/s can optionally be executed if it's a function 4143 var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 4144 var i = 0, 4145 len = elems.length, 4146 bulk = key == null; 4147 4148 // Sets many values 4149 if ( toType( key ) === "object" ) { 4150 chainable = true; 4151 for ( i in key ) { 4152 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 4153 } 4154 4155 // Sets one value 4156 } else if ( value !== undefined ) { 4157 chainable = true; 4158 4159 if ( !isFunction( value ) ) { 4160 raw = true; 4161 } 4162 4163 if ( bulk ) { 4164 4165 // Bulk operations run against the entire set 4166 if ( raw ) { 4167 fn.call( elems, value ); 4168 fn = null; 4169 4170 // ...except when executing function values 4171 } else { 4172 bulk = fn; 4173 fn = function( elem, _key, value ) { 4174 return bulk.call( jQuery( elem ), value ); 4175 }; 4176 } 4177 } 4178 4179 if ( fn ) { 4180 for ( ; i < len; i++ ) { 4181 fn( 4182 elems[ i ], key, raw ? 4183 value : 4184 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 4185 ); 4186 } 4187 } 4188 } 4189 4190 if ( chainable ) { 4191 return elems; 4192 } 4193 4194 // Gets 4195 if ( bulk ) { 4196 return fn.call( elems ); 4197 } 4198 4199 return len ? fn( elems[ 0 ], key ) : emptyGet; 4200 }; 4201 4202 4203// Matches dashed string for camelizing 4204 var rmsPrefix = /^-ms-/, 4205 rdashAlpha = /-([a-z])/g; 4206 4207// Used by camelCase as callback to replace() 4208 function fcamelCase( _all, letter ) { 4209 return letter.toUpperCase(); 4210 } 4211 4212// Convert dashed to camelCase; used by the css and data modules 4213// Support: IE <=9 - 11, Edge 12 - 15 4214// Microsoft forgot to hump their vendor prefix (#9572) 4215 function camelCase( string ) { 4216 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 4217 } 4218 var acceptData = function( owner ) { 4219 4220 // Accepts only: 4221 // - Node 4222 // - Node.ELEMENT_NODE 4223 // - Node.DOCUMENT_NODE 4224 // - Object 4225 // - Any 4226 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 4227 }; 4228 4229 4230 4231 4232 function Data() { 4233 this.expando = jQuery.expando + Data.uid++; 4234 } 4235 4236 Data.uid = 1; 4237 4238 Data.prototype = { 4239 4240 cache: function( owner ) { 4241 4242 // Check if the owner object already has a cache 4243 var value = owner[ this.expando ]; 4244 4245 // If not, create one 4246 if ( !value ) { 4247 value = {}; 4248 4249 // We can accept data for non-element nodes in modern browsers, 4250 // but we should not, see #8335. 4251 // Always return an empty object. 4252 if ( acceptData( owner ) ) { 4253 4254 // If it is a node unlikely to be stringify-ed or looped over 4255 // use plain assignment 4256 if ( owner.nodeType ) { 4257 owner[ this.expando ] = value; 4258 4259 // Otherwise secure it in a non-enumerable property 4260 // configurable must be true to allow the property to be 4261 // deleted when data is removed 4262 } else { 4263 Object.defineProperty( owner, this.expando, { 4264 value: value, 4265 configurable: true 4266 } ); 4267 } 4268 } 4269 } 4270 4271 return value; 4272 }, 4273 set: function( owner, data, value ) { 4274 var prop, 4275 cache = this.cache( owner ); 4276 4277 // Handle: [ owner, key, value ] args 4278 // Always use camelCase key (gh-2257) 4279 if ( typeof data === "string" ) { 4280 cache[ camelCase( data ) ] = value; 4281 4282 // Handle: [ owner, { properties } ] args 4283 } else { 4284 4285 // Copy the properties one-by-one to the cache object 4286 for ( prop in data ) { 4287 cache[ camelCase( prop ) ] = data[ prop ]; 4288 } 4289 } 4290 return cache; 4291 }, 4292 get: function( owner, key ) { 4293 return key === undefined ? 4294 this.cache( owner ) : 4295 4296 // Always use camelCase key (gh-2257) 4297 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 4298 }, 4299 access: function( owner, key, value ) { 4300 4301 // In cases where either: 4302 // 4303 // 1. No key was specified 4304 // 2. A string key was specified, but no value provided 4305 // 4306 // Take the "read" path and allow the get method to determine 4307 // which value to return, respectively either: 4308 // 4309 // 1. The entire cache object 4310 // 2. The data stored at the key 4311 // 4312 if ( key === undefined || 4313 ( ( key && typeof key === "string" ) && value === undefined ) ) { 4314 4315 return this.get( owner, key ); 4316 } 4317 4318 // When the key is not a string, or both a key and value 4319 // are specified, set or extend (existing objects) with either: 4320 // 4321 // 1. An object of properties 4322 // 2. A key and value 4323 // 4324 this.set( owner, key, value ); 4325
vendor: 9,776 bytes, lines 4326-4616
4326 // Since the "set" path can have two possible entry points 4327 // return the expected data based on which path was taken[*] 4328 return value !== undefined ? value : key; 4329 }, 4330 remove: function( owner, key ) { 4331 var i, 4332 cache = owner[ this.expando ]; 4333 4334 if ( cache === undefined ) { 4335 return; 4336 } 4337 4338 if ( key !== undefined ) { 4339 4340 // Support array or space separated string of keys 4341 if ( Array.isArray( key ) ) { 4342 4343 // If key is an array of keys... 4344 // We always set camelCase keys, so remove that. 4345 key = key.map( camelCase ); 4346 } else { 4347 key = camelCase( key ); 4348 4349 // If a key with the spaces exists, use it. 4350 // Otherwise, create an array by matching non-whitespace 4351 key = key in cache ? 4352 [ key ] : 4353 ( key.match( rnothtmlwhite ) || [] ); 4354 } 4355 4356 i = key.length; 4357 4358 while ( i-- ) { 4359 delete cache[ key[ i ] ]; 4360 } 4361 } 4362 4363 // Remove the expando if there's no more data 4364 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 4365 4366 // Support: Chrome <=35 - 45 4367 // Webkit & Blink performance suffers when deleting properties 4368 // from DOM nodes, so set to undefined instead 4369 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 4370 if ( owner.nodeType ) { 4371 owner[ this.expando ] = undefined; 4372 } else { 4373 delete owner[ this.expando ]; 4374 } 4375 } 4376 }, 4377 hasData: function( owner ) { 4378 var cache = owner[ this.expando ]; 4379 return cache !== undefined && !jQuery.isEmptyObject( cache ); 4380 } 4381 }; 4382 var dataPriv = new Data(); 4383 4384 var dataUser = new Data(); 4385 4386 4387 4388// Implementation Summary 4389// 4390// 1. Enforce API surface and semantic compatibility with 1.9.x branch 4391// 2. Improve the module's maintainability by reducing the storage 4392// paths to a single mechanism. 4393// 3. Use the same single mechanism to support "private" and "user" data. 4394// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 4395// 5. Avoid exposing implementation details on user objects (eg. expando properties) 4396// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 4397 4398 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 4399 rmultiDash = /[A-Z]/g; 4400 4401 function getData( data ) { 4402 if ( data === "true" ) { 4403 return true; 4404 } 4405 4406 if ( data === "false" ) { 4407 return false; 4408 } 4409 4410 if ( data === "null" ) { 4411 return null; 4412 } 4413 4414 // Only convert to a number if it doesn't change the string 4415 if ( data === +data + "" ) { 4416 return +data; 4417 } 4418 4419 if ( rbrace.test( data ) ) { 4420 return JSON.parse( data ); 4421 } 4422 4423 return data; 4424 } 4425 4426 function dataAttr( elem, key, data ) { 4427 var name; 4428 4429 // If nothing was found internally, try to fetch any 4430 // data from the HTML5 data-* attribute 4431 if ( data === undefined && elem.nodeType === 1 ) { 4432 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 4433 data = elem.getAttribute( name ); 4434 4435 if ( typeof data === "string" ) { 4436 try { 4437 data = getData( data ); 4438 } catch ( e ) {} 4439 4440 // Make sure we set the data so it isn't changed later 4441 dataUser.set( elem, key, data ); 4442 } else { 4443 data = undefined; 4444 } 4445 } 4446 return data; 4447 } 4448 4449 jQuery.extend( { 4450 hasData: function( elem ) { 4451 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 4452 }, 4453 4454 data: function( elem, name, data ) { 4455 return dataUser.access( elem, name, data ); 4456 }, 4457 4458 removeData: function( elem, name ) { 4459 dataUser.remove( elem, name ); 4460 }, 4461 4462 // TODO: Now that all calls to _data and _removeData have been replaced 4463 // with direct calls to dataPriv methods, these can be deprecated. 4464 _data: function( elem, name, data ) { 4465 return dataPriv.access( elem, name, data ); 4466 }, 4467 4468 _removeData: function( elem, name ) { 4469 dataPriv.remove( elem, name ); 4470 } 4471 } ); 4472 4473 jQuery.fn.extend( { 4474 data: function( key, value ) { 4475 var i, name, data, 4476 elem = this[ 0 ], 4477 attrs = elem && elem.attributes; 4478 4479 // Gets all values 4480 if ( key === undefined ) { 4481 if ( this.length ) { 4482 data = dataUser.get( elem ); 4483 4484 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 4485 i = attrs.length; 4486 while ( i-- ) { 4487 4488 // Support: IE 11 only 4489 // The attrs elements can be null (#14894) 4490 if ( attrs[ i ] ) { 4491 name = attrs[ i ].name; 4492 if ( name.indexOf( "data-" ) === 0 ) { 4493 name = camelCase( name.slice( 5 ) ); 4494 dataAttr( elem, name, data[ name ] ); 4495 } 4496 } 4497 } 4498 dataPriv.set( elem, "hasDataAttrs", true ); 4499 } 4500 } 4501 4502 return data; 4503 } 4504 4505 // Sets multiple values 4506 if ( typeof key === "object" ) { 4507 return this.each( function() { 4508 dataUser.set( this, key ); 4509 } ); 4510 } 4511 4512 return access( this, function( value ) { 4513 var data; 4514 4515 // The calling jQuery object (element matches) is not empty 4516 // (and therefore has an element appears at this[ 0 ]) and the 4517 // `value` parameter was not undefined. An empty jQuery object 4518 // will result in `undefined` for elem = this[ 0 ] which will 4519 // throw an exception if an attempt to read a data cache is made. 4520 if ( elem && value === undefined ) { 4521 4522 // Attempt to get data from the cache 4523 // The key will always be camelCased in Data 4524 data = dataUser.get( elem, key ); 4525 if ( data !== undefined ) { 4526 return data; 4527 } 4528 4529 // Attempt to "discover" the data in 4530 // HTML5 custom data-* attrs 4531 data = dataAttr( elem, key ); 4532 if ( data !== undefined ) { 4533 return data; 4534 } 4535 4536 // We tried really hard, but the data doesn't exist. 4537 return; 4538 } 4539 4540 // Set the data... 4541 this.each( function() { 4542 4543 // We always store the camelCased key 4544 dataUser.set( this, key, value ); 4545 } ); 4546 }, null, value, arguments.length > 1, null, true ); 4547 }, 4548 4549 removeData: function( key ) { 4550 return this.each( function() { 4551 dataUser.remove( this, key ); 4552 } ); 4553 } 4554 } ); 4555 4556 4557 jQuery.extend( { 4558 queue: function( elem, type, data ) { 4559 var queue; 4560 4561 if ( elem ) { 4562 type = ( type || "fx" ) + "queue"; 4563 queue = dataPriv.get( elem, type ); 4564 4565 // Speed up dequeue by getting out quickly if this is just a lookup 4566 if ( data ) { 4567 if ( !queue || Array.isArray( data ) ) { 4568 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 4569 } else { 4570 queue.push( data ); 4571 } 4572 } 4573 return queue || []; 4574 } 4575 }, 4576 4577 dequeue: function( elem, type ) { 4578 type = type || "fx"; 4579 4580 var queue = jQuery.queue( elem, type ), 4581 startLength = queue.length, 4582 fn = queue.shift(), 4583 hooks = jQuery._queueHooks( elem, type ), 4584 next = function() { 4585 jQuery.dequeue( elem, type ); 4586 }; 4587 4588 // If the fx queue is dequeued, always remove the progress sentinel 4589 if ( fn === "inprogress" ) { 4590 fn = queue.shift(); 4591 startLength--; 4592 } 4593 4594 if ( fn ) { 4595 4596 // Add a progress sentinel to prevent the fx queue from being 4597 // automatically dequeued 4598 if ( type === "fx" ) { 4599 queue.unshift( "inprogress" ); 4600 } 4601 4602 // Clear up the last queue stop function 4603 delete hooks.stop; 4604 fn.call( elem, next, hooks ); 4605 } 4606 4607 if ( !startLength && hooks ) { 4608 hooks.empty.fire(); 4609 } 4610 }, 4611 4612 // Not public - generate a queueHooks object, or return the current one 4613 _queueHooks: function( elem, type ) { 4614 var key = type + "queueHooks"; 4615 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 4616 empty: jQuery.Callbacks( "once memory" ).add( function() {
vendor: 14,054 bytes, lines 4617-5039
4617 dataPriv.remove( elem, [ type + "queue", key ] ); 4618 } ) 4619 } ); 4620 } 4621 } ); 4622 4623 jQuery.fn.extend( { 4624 queue: function( type, data ) { 4625 var setter = 2; 4626 4627 if ( typeof type !== "string" ) { 4628 data = type; 4629 type = "fx"; 4630 setter--; 4631 } 4632 4633 if ( arguments.length < setter ) { 4634 return jQuery.queue( this[ 0 ], type ); 4635 } 4636 4637 return data === undefined ? 4638 this : 4639 this.each( function() { 4640 var queue = jQuery.queue( this, type, data ); 4641 4642 // Ensure a hooks for this queue 4643 jQuery._queueHooks( this, type ); 4644 4645 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4646 jQuery.dequeue( this, type ); 4647 } 4648 } ); 4649 }, 4650 dequeue: function( type ) { 4651 return this.each( function() { 4652 jQuery.dequeue( this, type ); 4653 } ); 4654 }, 4655 clearQueue: function( type ) { 4656 return this.queue( type || "fx", [] ); 4657 }, 4658 4659 // Get a promise resolved when queues of a certain type 4660 // are emptied (fx is the type by default) 4661 promise: function( type, obj ) { 4662 var tmp, 4663 count = 1, 4664 defer = jQuery.Deferred(), 4665 elements = this, 4666 i = this.length, 4667 resolve = function() { 4668 if ( !( --count ) ) { 4669 defer.resolveWith( elements, [ elements ] ); 4670 } 4671 }; 4672 4673 if ( typeof type !== "string" ) { 4674 obj = type; 4675 type = undefined; 4676 } 4677 type = type || "fx"; 4678 4679 while ( i-- ) { 4680 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 4681 if ( tmp && tmp.empty ) { 4682 count++; 4683 tmp.empty.add( resolve ); 4684 } 4685 } 4686 resolve(); 4687 return defer.promise( obj ); 4688 } 4689 } ); 4690 var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4691 4692 var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4693 4694 4695 var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4696 4697 var documentElement = document.documentElement; 4698 4699 4700 4701 var isAttached = function( elem ) { 4702 return jQuery.contains( elem.ownerDocument, elem ); 4703 }, 4704 composed = { composed: true }; 4705 4706 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 4707 // Check attachment across shadow DOM boundaries when possible (gh-3504) 4708 // Support: iOS 10.0-10.2 only 4709 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 4710 // leading to errors. We need to check for `getRootNode`. 4711 if ( documentElement.getRootNode ) { 4712 isAttached = function( elem ) { 4713 return jQuery.contains( elem.ownerDocument, elem ) || 4714 elem.getRootNode( composed ) === elem.ownerDocument; 4715 }; 4716 } 4717 var isHiddenWithinTree = function( elem, el ) { 4718 4719 // isHiddenWithinTree might be called from jQuery#filter function; 4720 // in that case, element will be second argument 4721 elem = el || elem; 4722 4723 // Inline style trumps all 4724 return elem.style.display === "none" || 4725 elem.style.display === "" && 4726 4727 // Otherwise, check computed style 4728 // Support: Firefox <=43 - 45 4729 // Disconnected elements can have computed display: none, so first confirm that elem is 4730 // in the document. 4731 isAttached( elem ) && 4732 4733 jQuery.css( elem, "display" ) === "none"; 4734 }; 4735 4736 4737 4738 function adjustCSS( elem, prop, valueParts, tween ) { 4739 var adjusted, scale, 4740 maxIterations = 20, 4741 currentValue = tween ? 4742 function() { 4743 return tween.cur(); 4744 } : 4745 function() { 4746 return jQuery.css( elem, prop, "" ); 4747 }, 4748 initial = currentValue(), 4749 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4750 4751 // Starting value computation is required for potential unit mismatches 4752 initialInUnit = elem.nodeType && 4753 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4754 rcssNum.exec( jQuery.css( elem, prop ) ); 4755 4756 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4757 4758 // Support: Firefox <=54 4759 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 4760 initial = initial / 2; 4761 4762 // Trust units reported by jQuery.css 4763 unit = unit || initialInUnit[ 3 ]; 4764 4765 // Iteratively approximate from a nonzero starting point 4766 initialInUnit = +initial || 1; 4767 4768 while ( maxIterations-- ) { 4769 4770 // Evaluate and update our best guess (doubling guesses that zero out). 4771 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 4772 jQuery.style( elem, prop, initialInUnit + unit ); 4773 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 4774 maxIterations = 0; 4775 } 4776 initialInUnit = initialInUnit / scale; 4777 4778 } 4779 4780 initialInUnit = initialInUnit * 2; 4781 jQuery.style( elem, prop, initialInUnit + unit ); 4782 4783 // Make sure we update the tween properties later on 4784 valueParts = valueParts || []; 4785 } 4786 4787 if ( valueParts ) { 4788 initialInUnit = +initialInUnit || +initial || 0; 4789 4790 // Apply relative offset (+=/-=) if specified 4791 adjusted = valueParts[ 1 ] ? 4792 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4793 +valueParts[ 2 ]; 4794 if ( tween ) { 4795 tween.unit = unit; 4796 tween.start = initialInUnit; 4797 tween.end = adjusted; 4798 } 4799 } 4800 return adjusted; 4801 } 4802 4803 4804 var defaultDisplayMap = {}; 4805 4806 function getDefaultDisplay( elem ) { 4807 var temp, 4808 doc = elem.ownerDocument, 4809 nodeName = elem.nodeName, 4810 display = defaultDisplayMap[ nodeName ]; 4811 4812 if ( display ) { 4813 return display; 4814 } 4815 4816 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 4817 display = jQuery.css( temp, "display" ); 4818 4819 temp.parentNode.removeChild( temp ); 4820 4821 if ( display === "none" ) { 4822 display = "block"; 4823 } 4824 defaultDisplayMap[ nodeName ] = display; 4825 4826 return display; 4827 } 4828 4829 function showHide( elements, show ) { 4830 var display, elem, 4831 values = [], 4832 index = 0, 4833 length = elements.length; 4834 4835 // Determine new display value for elements that need to change 4836 for ( ; index < length; index++ ) { 4837 elem = elements[ index ]; 4838 if ( !elem.style ) { 4839 continue; 4840 } 4841 4842 display = elem.style.display; 4843 if ( show ) { 4844 4845 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 4846 // check is required in this first loop unless we have a nonempty display value (either 4847 // inline or about-to-be-restored) 4848 if ( display === "none" ) { 4849 values[ index ] = dataPriv.get( elem, "display" ) || null; 4850 if ( !values[ index ] ) { 4851 elem.style.display = ""; 4852 } 4853 } 4854 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 4855 values[ index ] = getDefaultDisplay( elem ); 4856 } 4857 } else { 4858 if ( display !== "none" ) { 4859 values[ index ] = "none"; 4860 4861 // Remember what we're overwriting 4862 dataPriv.set( elem, "display", display ); 4863 } 4864 } 4865 } 4866 4867 // Set the display of the elements in a second loop to avoid constant reflow 4868 for ( index = 0; index < length; index++ ) { 4869 if ( values[ index ] != null ) { 4870 elements[ index ].style.display = values[ index ]; 4871 } 4872 } 4873 4874 return elements; 4875 } 4876 4877 jQuery.fn.extend( { 4878 show: function() { 4879 return showHide( this, true ); 4880 }, 4881 hide: function() { 4882 return showHide( this ); 4883 }, 4884 toggle: function( state ) { 4885 if ( typeof state === "boolean" ) { 4886 return state ? this.show() : this.hide(); 4887 } 4888 4889 return this.each( function() { 4890 if ( isHiddenWithinTree( this ) ) { 4891 jQuery( this ).show(); 4892 } else { 4893 jQuery( this ).hide(); 4894 } 4895 } ); 4896 } 4897 } ); 4898 var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4899 4900 var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 4901 4902 var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 4903 4904 4905 4906 ( function() { 4907 var fragment = document.createDocumentFragment(), 4908 div = fragment.appendChild( document.createElement( "div" ) ), 4909 input = document.createElement( "input" ); 4910 4911 // Support: Android 4.0 - 4.3 only 4912 // Check state lost if the name is set (#11217) 4913 // Support: Windows Web Apps (WWA) 4914 // `name` and `type` must use .setAttribute for WWA (#14901) 4915 input.setAttribute( "type", "radio" ); 4916 input.setAttribute( "checked", "checked" ); 4917 input.setAttribute( "name", "t" ); 4918 4919 div.appendChild( input ); 4920 4921 // Support: Android <=4.1 only 4922 // Older WebKit doesn't clone checked state correctly in fragments 4923 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4924 4925 // Support: IE <=11 only 4926 // Make sure textarea (and checkbox) defaultValue is properly cloned 4927 div.innerHTML = "<textarea>x</textarea>"; 4928 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4929 4930 // Support: IE <=9 only 4931 // IE <=9 replaces <option> tags with their contents when inserted outside of 4932 // the select element. 4933 div.innerHTML = "<option></option>"; 4934 support.option = !!div.lastChild; 4935 } )(); 4936 4937 4938// We have to close these tags to support XHTML (#13200) 4939 var wrapMap = { 4940 4941 // XHTML parsers do not magically insert elements in the 4942 // same way that tag soup parsers do. So we cannot shorten 4943 // this by omitting <tbody> or other required elements. 4944 thead: [ 1, "<table>", "</table>" ], 4945 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4946 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4947 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4948 4949 _default: [ 0, "", "" ] 4950 }; 4951 4952 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4953 wrapMap.th = wrapMap.td; 4954 4955// Support: IE <=9 only 4956 if ( !support.option ) { 4957 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 4958 } 4959 4960 4961 function getAll( context, tag ) { 4962 4963 // Support: IE <=9 - 11 only 4964 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 4965 var ret; 4966 4967 if ( typeof context.getElementsByTagName !== "undefined" ) { 4968 ret = context.getElementsByTagName( tag || "*" ); 4969 4970 } else if ( typeof context.querySelectorAll !== "undefined" ) { 4971 ret = context.querySelectorAll( tag || "*" ); 4972 4973 } else { 4974 ret = []; 4975 } 4976 4977 if ( tag === undefined || tag && nodeName( context, tag ) ) { 4978 return jQuery.merge( [ context ], ret ); 4979 } 4980 4981 return ret; 4982 } 4983 4984 4985// Mark scripts as having already been evaluated 4986 function setGlobalEval( elems, refElements ) { 4987 var i = 0, 4988 l = elems.length; 4989 4990 for ( ; i < l; i++ ) { 4991 dataPriv.set( 4992 elems[ i ], 4993 "globalEval", 4994 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 4995 ); 4996 } 4997 } 4998 4999 5000 var rhtml = /<|&#?\w+;/; 5001 5002 function buildFragment( elems, context, scripts, selection, ignored ) { 5003 var elem, tmp, tag, wrap, attached, j, 5004 fragment = context.createDocumentFragment(), 5005 nodes = [], 5006 i = 0, 5007 l = elems.length; 5008 5009 for ( ; i < l; i++ ) { 5010 elem = elems[ i ]; 5011 5012 if ( elem || elem === 0 ) { 5013 5014 // Add nodes directly 5015 if ( toType( elem ) === "object" ) { 5016 5017 // Support: Android <=4.0 only, PhantomJS 1 only 5018 // push.apply(_, arraylike) throws on ancient WebKit 5019 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 5020 5021 // Convert non-html into a text node 5022 } else if ( !rhtml.test( elem ) ) { 5023 nodes.push( context.createTextNode( elem ) ); 5024 5025 // Convert html into DOM nodes 5026 } else { 5027 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 5028 5029 // Deserialize a standard representation 5030 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 5031 wrap = wrapMap[ tag ] || wrapMap._default; 5032 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 5033 5034 // Descend through wrappers to the right content 5035 j = wrap[ 0 ]; 5036 while ( j-- ) { 5037 tmp = tmp.lastChild; 5038 } 5039
vendor: 9,610 bytes, lines 5040-5318
5040 // Support: Android <=4.0 only, PhantomJS 1 only 5041 // push.apply(_, arraylike) throws on ancient WebKit 5042 jQuery.merge( nodes, tmp.childNodes ); 5043 5044 // Remember the top-level container 5045 tmp = fragment.firstChild; 5046 5047 // Ensure the created nodes are orphaned (#12392) 5048 tmp.textContent = ""; 5049 } 5050 } 5051 } 5052 5053 // Remove wrapper from fragment 5054 fragment.textContent = ""; 5055 5056 i = 0; 5057 while ( ( elem = nodes[ i++ ] ) ) { 5058 5059 // Skip elements already in the context collection (trac-4087) 5060 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 5061 if ( ignored ) { 5062 ignored.push( elem ); 5063 } 5064 continue; 5065 } 5066 5067 attached = isAttached( elem ); 5068 5069 // Append to fragment 5070 tmp = getAll( fragment.appendChild( elem ), "script" ); 5071 5072 // Preserve script evaluation history 5073 if ( attached ) { 5074 setGlobalEval( tmp ); 5075 } 5076 5077 // Capture executables 5078 if ( scripts ) { 5079 j = 0; 5080 while ( ( elem = tmp[ j++ ] ) ) { 5081 if ( rscriptType.test( elem.type || "" ) ) { 5082 scripts.push( elem ); 5083 } 5084 } 5085 } 5086 } 5087 5088 return fragment; 5089 } 5090 5091 5092 var 5093 rkeyEvent = /^key/, 5094 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 5095 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 5096 5097 function returnTrue() { 5098 return true; 5099 } 5100 5101 function returnFalse() { 5102 return false; 5103 } 5104 5105// Support: IE <=9 - 11+ 5106// focus() and blur() are asynchronous, except when they are no-op. 5107// So expect focus to be synchronous when the element is already active, 5108// and blur to be synchronous when the element is not already active. 5109// (focus and blur are always synchronous in other supported browsers, 5110// this just defines when we can count on it). 5111 function expectSync( elem, type ) { 5112 return ( elem === safeActiveElement() ) === ( type === "focus" ); 5113 } 5114 5115// Support: IE <=9 only 5116// Accessing document.activeElement can throw unexpectedly 5117// https://bugs.jquery.com/ticket/13393 5118 function safeActiveElement() { 5119 try { 5120 return document.activeElement; 5121 } catch ( err ) { } 5122 } 5123 5124 function on( elem, types, selector, data, fn, one ) { 5125 var origFn, type; 5126 5127 // Types can be a map of types/handlers 5128 if ( typeof types === "object" ) { 5129 5130 // ( types-Object, selector, data ) 5131 if ( typeof selector !== "string" ) { 5132 5133 // ( types-Object, data ) 5134 data = data || selector; 5135 selector = undefined; 5136 } 5137 for ( type in types ) { 5138 on( elem, type, selector, data, types[ type ], one ); 5139 } 5140 return elem; 5141 } 5142 5143 if ( data == null && fn == null ) { 5144 5145 // ( types, fn ) 5146 fn = selector; 5147 data = selector = undefined; 5148 } else if ( fn == null ) { 5149 if ( typeof selector === "string" ) { 5150 5151 // ( types, selector, fn ) 5152 fn = data; 5153 data = undefined; 5154 } else { 5155 5156 // ( types, data, fn ) 5157 fn = data; 5158 data = selector; 5159 selector = undefined; 5160 } 5161 } 5162 if ( fn === false ) { 5163 fn = returnFalse; 5164 } else if ( !fn ) { 5165 return elem; 5166 } 5167 5168 if ( one === 1 ) { 5169 origFn = fn; 5170 fn = function( event ) { 5171 5172 // Can use an empty set, since event contains the info 5173 jQuery().off( event ); 5174 return origFn.apply( this, arguments ); 5175 }; 5176 5177 // Use same guid so caller can remove using origFn 5178 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 5179 } 5180 return elem.each( function() { 5181 jQuery.event.add( this, types, fn, data, selector ); 5182 } ); 5183 } 5184 5185 /* 5186 * Helper functions for managing events -- not part of the public interface. 5187 * Props to Dean Edwards' addEvent library for many of the ideas. 5188 */ 5189 jQuery.event = { 5190 5191 global: {}, 5192 5193 add: function( elem, types, handler, data, selector ) { 5194 5195 var handleObjIn, eventHandle, tmp, 5196 events, t, handleObj, 5197 special, handlers, type, namespaces, origType, 5198 elemData = dataPriv.get( elem ); 5199 5200 // Only attach events to objects that accept data 5201 if ( !acceptData( elem ) ) { 5202 return; 5203 } 5204 5205 // Caller can pass in an object of custom data in lieu of the handler 5206 if ( handler.handler ) { 5207 handleObjIn = handler; 5208 handler = handleObjIn.handler; 5209 selector = handleObjIn.selector; 5210 } 5211 5212 // Ensure that invalid selectors throw exceptions at attach time 5213 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 5214 if ( selector ) { 5215 jQuery.find.matchesSelector( documentElement, selector ); 5216 } 5217 5218 // Make sure that the handler has a unique ID, used to find/remove it later 5219 if ( !handler.guid ) { 5220 handler.guid = jQuery.guid++; 5221 } 5222 5223 // Init the element's event structure and main handler, if this is the first 5224 if ( !( events = elemData.events ) ) { 5225 events = elemData.events = Object.create( null ); 5226 } 5227 if ( !( eventHandle = elemData.handle ) ) { 5228 eventHandle = elemData.handle = function( e ) { 5229 5230 // Discard the second event of a jQuery.event.trigger() and 5231 // when an event is called after a page has unloaded 5232 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 5233 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 5234 }; 5235 } 5236 5237 // Handle multiple events separated by a space 5238 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 5239 t = types.length; 5240 while ( t-- ) { 5241 tmp = rtypenamespace.exec( types[ t ] ) || []; 5242 type = origType = tmp[ 1 ]; 5243 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 5244 5245 // There *must* be a type, no attaching namespace-only handlers 5246 if ( !type ) { 5247 continue; 5248 } 5249 5250 // If event changes its type, use the special event handlers for the changed type 5251 special = jQuery.event.special[ type ] || {}; 5252 5253 // If selector defined, determine special event api type, otherwise given type 5254 type = ( selector ? special.delegateType : special.bindType ) || type; 5255 5256 // Update special based on newly reset type 5257 special = jQuery.event.special[ type ] || {}; 5258 5259 // handleObj is passed to all event handlers 5260 handleObj = jQuery.extend( { 5261 type: type, 5262 origType: origType, 5263 data: data, 5264 handler: handler, 5265 guid: handler.guid, 5266 selector: selector, 5267 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 5268 namespace: namespaces.join( "." ) 5269 }, handleObjIn ); 5270 5271 // Init the event handler queue if we're the first 5272 if ( !( handlers = events[ type ] ) ) { 5273 handlers = events[ type ] = []; 5274 handlers.delegateCount = 0; 5275 5276 // Only use addEventListener if the special events handler returns false 5277 if ( !special.setup || 5278 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 5279 5280 if ( elem.addEventListener ) { 5281 elem.addEventListener( type, eventHandle ); 5282 } 5283 } 5284 } 5285 5286 if ( special.add ) { 5287 special.add.call( elem, handleObj ); 5288 5289 if ( !handleObj.handler.guid ) { 5290 handleObj.handler.guid = handler.guid; 5291 } 5292 } 5293 5294 // Add to the element's handler list, delegates in front 5295 if ( selector ) { 5296 handlers.splice( handlers.delegateCount++, 0, handleObj ); 5297 } else { 5298 handlers.push( handleObj ); 5299 } 5300 5301 // Keep track of which events have ever been used, for event optimization 5302 jQuery.event.global[ type ] = true; 5303 } 5304 5305 }, 5306 5307 // Detach an event or set of events from an element 5308 remove: function( elem, types, handler, selector, mappedTypes ) { 5309 5310 var j, origCount, tmp, 5311 events, t, handleObj, 5312 special, handlers, type, namespaces, origType, 5313 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 5314 5315 if ( !elemData || !( events = elemData.events ) ) { 5316 return; 5317 } 5318
vendor: 4,497 bytes, lines 5319-5422
5319 // Once for each type.namespace in types; type may be omitted 5320 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 5321 t = types.length; 5322 while ( t-- ) { 5323 tmp = rtypenamespace.exec( types[ t ] ) || []; 5324 type = origType = tmp[ 1 ]; 5325 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 5326 5327 // Unbind all events (on this namespace, if provided) for the element 5328 if ( !type ) { 5329 for ( type in events ) { 5330 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 5331 } 5332 continue; 5333 } 5334 5335 special = jQuery.event.special[ type ] || {}; 5336 type = ( selector ? special.delegateType : special.bindType ) || type; 5337 handlers = events[ type ] || []; 5338 tmp = tmp[ 2 ] && 5339 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 5340 5341 // Remove matching events 5342 origCount = j = handlers.length; 5343 while ( j-- ) { 5344 handleObj = handlers[ j ]; 5345 5346 if ( ( mappedTypes || origType === handleObj.origType ) && 5347 ( !handler || handler.guid === handleObj.guid ) && 5348 ( !tmp || tmp.test( handleObj.namespace ) ) && 5349 ( !selector || selector === handleObj.selector || 5350 selector === "**" && handleObj.selector ) ) { 5351 handlers.splice( j, 1 ); 5352 5353 if ( handleObj.selector ) { 5354 handlers.delegateCount--; 5355 } 5356 if ( special.remove ) { 5357 special.remove.call( elem, handleObj ); 5358 } 5359 } 5360 } 5361 5362 // Remove generic event handler if we removed something and no more handlers exist 5363 // (avoids potential for endless recursion during removal of special event handlers) 5364 if ( origCount && !handlers.length ) { 5365 if ( !special.teardown || 5366 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5367 5368 jQuery.removeEvent( elem, type, elemData.handle ); 5369 } 5370 5371 delete events[ type ]; 5372 } 5373 } 5374 5375 // Remove data and the expando if it's no longer used 5376 if ( jQuery.isEmptyObject( events ) ) { 5377 dataPriv.remove( elem, "handle events" ); 5378 } 5379 }, 5380 5381 dispatch: function( nativeEvent ) { 5382 5383 var i, j, ret, matched, handleObj, handlerQueue, 5384 args = new Array( arguments.length ), 5385 5386 // Make a writable jQuery.Event from the native event object 5387 event = jQuery.event.fix( nativeEvent ), 5388 5389 handlers = ( 5390 dataPriv.get( this, "events" ) || Object.create( null ) 5391 )[ event.type ] || [], 5392 special = jQuery.event.special[ event.type ] || {}; 5393 5394 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5395 args[ 0 ] = event; 5396 5397 for ( i = 1; i < arguments.length; i++ ) { 5398 args[ i ] = arguments[ i ]; 5399 } 5400 5401 event.delegateTarget = this; 5402 5403 // Call the preDispatch hook for the mapped type, and let it bail if desired 5404 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 5405 return; 5406 } 5407 5408 // Determine handlers 5409 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 5410 5411 // Run delegates first; they may want to stop propagation beneath us 5412 i = 0; 5413 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 5414 event.currentTarget = matched.elem; 5415 5416 j = 0; 5417 while ( ( handleObj = matched.handlers[ j++ ] ) && 5418 !event.isImmediatePropagationStopped() ) { 5419 5420 // If the event is namespaced, then each handler is only invoked if it is 5421 // specially universal or its namespaces are a superset of the event's. 5422 if ( !event.rnamespace || handleObj.namespace === false ||
vendor: 11,072 bytes, lines 5423-5679
5423 event.rnamespace.test( handleObj.namespace ) ) { 5424 5425 event.handleObj = handleObj; 5426 event.data = handleObj.data; 5427 5428 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 5429 handleObj.handler ).apply( matched.elem, args ); 5430 5431 if ( ret !== undefined ) { 5432 if ( ( event.result = ret ) === false ) { 5433 event.preventDefault(); 5434 event.stopPropagation(); 5435 } 5436 } 5437 } 5438 } 5439 } 5440 5441 // Call the postDispatch hook for the mapped type 5442 if ( special.postDispatch ) { 5443 special.postDispatch.call( this, event ); 5444 } 5445 5446 return event.result; 5447 }, 5448 5449 handlers: function( event, handlers ) { 5450 var i, handleObj, sel, matchedHandlers, matchedSelectors, 5451 handlerQueue = [], 5452 delegateCount = handlers.delegateCount, 5453 cur = event.target; 5454 5455 // Find delegate handlers 5456 if ( delegateCount && 5457 5458 // Support: IE <=9 5459 // Black-hole SVG <use> instance trees (trac-13180) 5460 cur.nodeType && 5461 5462 // Support: Firefox <=42 5463 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 5464 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 5465 // Support: IE 11 only 5466 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 5467 !( event.type === "click" && event.button >= 1 ) ) { 5468 5469 for ( ; cur !== this; cur = cur.parentNode || this ) { 5470 5471 // Don't check non-elements (#13208) 5472 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 5473 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 5474 matchedHandlers = []; 5475 matchedSelectors = {}; 5476 for ( i = 0; i < delegateCount; i++ ) { 5477 handleObj = handlers[ i ]; 5478 5479 // Don't conflict with Object.prototype properties (#13203) 5480 sel = handleObj.selector + " "; 5481 5482 if ( matchedSelectors[ sel ] === undefined ) { 5483 matchedSelectors[ sel ] = handleObj.needsContext ? 5484 jQuery( sel, this ).index( cur ) > -1 : 5485 jQuery.find( sel, this, null, [ cur ] ).length; 5486 } 5487 if ( matchedSelectors[ sel ] ) { 5488 matchedHandlers.push( handleObj ); 5489 } 5490 } 5491 if ( matchedHandlers.length ) { 5492 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 5493 } 5494 } 5495 } 5496 } 5497 5498 // Add the remaining (directly-bound) handlers 5499 cur = this; 5500 if ( delegateCount < handlers.length ) { 5501 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 5502 } 5503 5504 return handlerQueue; 5505 }, 5506 5507 addProp: function( name, hook ) { 5508 Object.defineProperty( jQuery.Event.prototype, name, { 5509 enumerable: true, 5510 configurable: true, 5511 5512 get: isFunction( hook ) ? 5513 function() { 5514 if ( this.originalEvent ) { 5515 return hook( this.originalEvent ); 5516 } 5517 } : 5518 function() { 5519 if ( this.originalEvent ) { 5520 return this.originalEvent[ name ]; 5521 } 5522 }, 5523 5524 set: function( value ) { 5525 Object.defineProperty( this, name, { 5526 enumerable: true, 5527 configurable: true, 5528 writable: true, 5529 value: value 5530 } ); 5531 } 5532 } ); 5533 }, 5534 5535 fix: function( originalEvent ) { 5536 return originalEvent[ jQuery.expando ] ? 5537 originalEvent : 5538 new jQuery.Event( originalEvent ); 5539 }, 5540 5541 special: { 5542 load: { 5543 5544 // Prevent triggered image.load events from bubbling to window.load 5545 noBubble: true 5546 }, 5547 click: { 5548 5549 // Utilize native event to ensure correct state for checkable inputs 5550 setup: function( data ) { 5551 5552 // For mutual compressibility with _default, replace `this` access with a local var. 5553 // `|| data` is dead code meant only to preserve the variable through minification. 5554 var el = this || data; 5555 5556 // Claim the first handler 5557 if ( rcheckableType.test( el.type ) && 5558 el.click && nodeName( el, "input" ) ) { 5559 5560 // dataPriv.set( el, "click", ... ) 5561 leverageNative( el, "click", returnTrue ); 5562 } 5563 5564 // Return false to allow normal processing in the caller 5565 return false; 5566 }, 5567 trigger: function( data ) { 5568 5569 // For mutual compressibility with _default, replace `this` access with a local var. 5570 // `|| data` is dead code meant only to preserve the variable through minification. 5571 var el = this || data; 5572 5573 // Force setup before triggering a click 5574 if ( rcheckableType.test( el.type ) && 5575 el.click && nodeName( el, "input" ) ) { 5576 5577 leverageNative( el, "click" ); 5578 } 5579 5580 // Return non-false to allow normal event-path propagation 5581 return true; 5582 }, 5583 5584 // For cross-browser consistency, suppress native .click() on links 5585 // Also prevent it if we're currently inside a leveraged native-event stack 5586 _default: function( event ) { 5587 var target = event.target; 5588 return rcheckableType.test( target.type ) && 5589 target.click && nodeName( target, "input" ) && 5590 dataPriv.get( target, "click" ) || 5591 nodeName( target, "a" ); 5592 } 5593 }, 5594 5595 beforeunload: { 5596 postDispatch: function( event ) { 5597 5598 // Support: Firefox 20+ 5599 // Firefox doesn't alert if the returnValue field is not set. 5600 if ( event.result !== undefined && event.originalEvent ) { 5601 event.originalEvent.returnValue = event.result; 5602 } 5603 } 5604 } 5605 } 5606 }; 5607 5608// Ensure the presence of an event listener that handles manually-triggered 5609// synthetic events by interrupting progress until reinvoked in response to 5610// *native* events that it fires directly, ensuring that state changes have 5611// already occurred before other listeners are invoked. 5612 function leverageNative( el, type, expectSync ) { 5613 5614 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 5615 if ( !expectSync ) { 5616 if ( dataPriv.get( el, type ) === undefined ) { 5617 jQuery.event.add( el, type, returnTrue ); 5618 } 5619 return; 5620 } 5621 5622 // Register the controller as a special universal handler for all event namespaces 5623 dataPriv.set( el, type, false ); 5624 jQuery.event.add( el, type, { 5625 namespace: false, 5626 handler: function( event ) { 5627 var notAsync, result, 5628 saved = dataPriv.get( this, type ); 5629 5630 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 5631 5632 // Interrupt processing of the outer synthetic .trigger()ed event 5633 // Saved data should be false in such cases, but might be a leftover capture object 5634 // from an async native handler (gh-4350) 5635 if ( !saved.length ) { 5636 5637 // Store arguments for use when handling the inner native event 5638 // There will always be at least one argument (an event object), so this array 5639 // will not be confused with a leftover capture object. 5640 saved = slice.call( arguments ); 5641 dataPriv.set( this, type, saved ); 5642 5643 // Trigger the native event and capture its result 5644 // Support: IE <=9 - 11+ 5645 // focus() and blur() are asynchronous 5646 notAsync = expectSync( this, type ); 5647 this[ type ](); 5648 result = dataPriv.get( this, type ); 5649 if ( saved !== result || notAsync ) { 5650 dataPriv.set( this, type, false ); 5651 } else { 5652 result = {}; 5653 } 5654 if ( saved !== result ) { 5655 5656 // Cancel the outer synthetic event 5657 event.stopImmediatePropagation(); 5658 event.preventDefault(); 5659 return result.value; 5660 } 5661 5662 // If this is an inner synthetic event for an event with a bubbling surrogate 5663 // (focus or blur), assume that the surrogate already propagated from triggering the 5664 // native event and prevent that from happening again here. 5665 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 5666 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 5667 // less bad than duplication. 5668 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 5669 event.stopPropagation(); 5670 } 5671 5672 // If this is a native event triggered above, everything is now in order 5673 // Fire an inner synthetic event with the original arguments 5674 } else if ( saved.length ) { 5675 5676 // ...and capture the result 5677 dataPriv.set( this, type, { 5678 value: jQuery.event.trigger( 5679
vendor: 5,702 bytes, lines 5680-5866
5680 // Support: IE <=9 - 11+ 5681 // Extend with the prototype to reset the above stopImmediatePropagation() 5682 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 5683 saved.slice( 1 ), 5684 this 5685 ) 5686 } ); 5687 5688 // Abort handling of the native event 5689 event.stopImmediatePropagation(); 5690 } 5691 } 5692 } ); 5693 } 5694 5695 jQuery.removeEvent = function( elem, type, handle ) { 5696 5697 // This "if" is needed for plain objects 5698 if ( elem.removeEventListener ) { 5699 elem.removeEventListener( type, handle ); 5700 } 5701 }; 5702 5703 jQuery.Event = function( src, props ) { 5704 5705 // Allow instantiation without the 'new' keyword 5706 if ( !( this instanceof jQuery.Event ) ) { 5707 return new jQuery.Event( src, props ); 5708 } 5709 5710 // Event object 5711 if ( src && src.type ) { 5712 this.originalEvent = src; 5713 this.type = src.type; 5714 5715 // Events bubbling up the document may have been marked as prevented 5716 // by a handler lower down the tree; reflect the correct value. 5717 this.isDefaultPrevented = src.defaultPrevented || 5718 src.defaultPrevented === undefined && 5719 5720 // Support: Android <=2.3 only 5721 src.returnValue === false ? 5722 returnTrue : 5723 returnFalse; 5724 5725 // Create target properties 5726 // Support: Safari <=6 - 7 only 5727 // Target should not be a text node (#504, #13143) 5728 this.target = ( src.target && src.target.nodeType === 3 ) ? 5729 src.target.parentNode : 5730 src.target; 5731 5732 this.currentTarget = src.currentTarget; 5733 this.relatedTarget = src.relatedTarget; 5734 5735 // Event type 5736 } else { 5737 this.type = src; 5738 } 5739 5740 // Put explicitly provided properties onto the event object 5741 if ( props ) { 5742 jQuery.extend( this, props ); 5743 } 5744 5745 // Create a timestamp if incoming event doesn't have one 5746 this.timeStamp = src && src.timeStamp || Date.now(); 5747 5748 // Mark it as fixed 5749 this[ jQuery.expando ] = true; 5750 }; 5751 5752// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5753// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5754 jQuery.Event.prototype = { 5755 constructor: jQuery.Event, 5756 isDefaultPrevented: returnFalse, 5757 isPropagationStopped: returnFalse, 5758 isImmediatePropagationStopped: returnFalse, 5759 isSimulated: false, 5760 5761 preventDefault: function() { 5762 var e = this.originalEvent; 5763 5764 this.isDefaultPrevented = returnTrue; 5765 5766 if ( e && !this.isSimulated ) { 5767 e.preventDefault(); 5768 } 5769 }, 5770 stopPropagation: function() { 5771 var e = this.originalEvent; 5772 5773 this.isPropagationStopped = returnTrue; 5774 5775 if ( e && !this.isSimulated ) { 5776 e.stopPropagation(); 5777 } 5778 }, 5779 stopImmediatePropagation: function() { 5780 var e = this.originalEvent; 5781 5782 this.isImmediatePropagationStopped = returnTrue; 5783 5784 if ( e && !this.isSimulated ) { 5785 e.stopImmediatePropagation(); 5786 } 5787 5788 this.stopPropagation(); 5789 } 5790 }; 5791 5792// Includes all common event props including KeyEvent and MouseEvent specific props 5793 jQuery.each( { 5794 altKey: true, 5795 bubbles: true, 5796 cancelable: true, 5797 changedTouches: true, 5798 ctrlKey: true, 5799 detail: true, 5800 eventPhase: true, 5801 metaKey: true, 5802 pageX: true, 5803 pageY: true, 5804 shiftKey: true, 5805 view: true, 5806 "char": true, 5807 code: true, 5808 charCode: true, 5809 key: true, 5810 keyCode: true, 5811 button: true, 5812 buttons: true, 5813 clientX: true, 5814 clientY: true, 5815 offsetX: true, 5816 offsetY: true, 5817 pointerId: true, 5818 pointerType: true, 5819 screenX: true, 5820 screenY: true, 5821 targetTouches: true, 5822 toElement: true, 5823 touches: true, 5824 5825 which: function( event ) { 5826 var button = event.button; 5827 5828 // Add which for key events 5829 if ( event.which == null && rkeyEvent.test( event.type ) ) { 5830 return event.charCode != null ? event.charCode : event.keyCode; 5831 } 5832 5833 // Add which for click: 1 === left; 2 === middle; 3 === right 5834 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 5835 if ( button & 1 ) { 5836 return 1; 5837 } 5838 5839 if ( button & 2 ) { 5840 return 3; 5841 } 5842 5843 if ( button & 4 ) { 5844 return 2; 5845 } 5846 5847 return 0; 5848 } 5849 5850 return event.which; 5851 } 5852 }, jQuery.event.addProp ); 5853 5854 jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 5855 jQuery.event.special[ type ] = { 5856 5857 // Utilize native event if possible so blur/focus sequence is correct 5858 setup: function() { 5859 5860 // Claim the first handler 5861 // dataPriv.set( this, "focus", ... ) 5862 // dataPriv.set( this, "blur", ... ) 5863 leverageNative( this, type, expectSync ); 5864 5865 // Return false to allow normal processing in the caller 5866 return false;
vendor: 4,646 bytes, lines 5867-6003
5867 }, 5868 trigger: function() { 5869 5870 // Force setup before trigger 5871 leverageNative( this, type ); 5872 5873 // Return non-false to allow normal event-path propagation 5874 return true; 5875 }, 5876 5877 delegateType: delegateType 5878 }; 5879 } ); 5880 5881// Create mouseenter/leave events using mouseover/out and event-time checks 5882// so that event delegation works in jQuery. 5883// Do the same for pointerenter/pointerleave and pointerover/pointerout 5884// 5885// Support: Safari 7 only 5886// Safari sends mouseenter too often; see: 5887// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 5888// for the description of the bug (it existed in older Chrome versions as well). 5889 jQuery.each( { 5890 mouseenter: "mouseover", 5891 mouseleave: "mouseout", 5892 pointerenter: "pointerover", 5893 pointerleave: "pointerout" 5894 }, function( orig, fix ) { 5895 jQuery.event.special[ orig ] = { 5896 delegateType: fix, 5897 bindType: fix, 5898 5899 handle: function( event ) { 5900 var ret, 5901 target = this, 5902 related = event.relatedTarget, 5903 handleObj = event.handleObj; 5904 5905 // For mouseenter/leave call the handler if related is outside the target. 5906 // NB: No relatedTarget if the mouse left/entered the browser window 5907 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5908 event.type = handleObj.origType; 5909 ret = handleObj.handler.apply( this, arguments ); 5910 event.type = fix; 5911 } 5912 return ret; 5913 } 5914 }; 5915 } ); 5916 5917 jQuery.fn.extend( { 5918 5919 on: function( types, selector, data, fn ) { 5920 return on( this, types, selector, data, fn ); 5921 }, 5922 one: function( types, selector, data, fn ) { 5923 return on( this, types, selector, data, fn, 1 ); 5924 }, 5925 off: function( types, selector, fn ) { 5926 var handleObj, type; 5927 if ( types && types.preventDefault && types.handleObj ) { 5928 5929 // ( event ) dispatched jQuery.Event 5930 handleObj = types.handleObj; 5931 jQuery( types.delegateTarget ).off( 5932 handleObj.namespace ? 5933 handleObj.origType + "." + handleObj.namespace : 5934 handleObj.origType, 5935 handleObj.selector, 5936 handleObj.handler 5937 ); 5938 return this; 5939 } 5940 if ( typeof types === "object" ) { 5941 5942 // ( types-object [, selector] ) 5943 for ( type in types ) { 5944 this.off( type, selector, types[ type ] ); 5945 } 5946 return this; 5947 } 5948 if ( selector === false || typeof selector === "function" ) { 5949 5950 // ( types [, fn] ) 5951 fn = selector; 5952 selector = undefined; 5953 } 5954 if ( fn === false ) { 5955 fn = returnFalse; 5956 } 5957 return this.each( function() { 5958 jQuery.event.remove( this, types, fn, selector ); 5959 } ); 5960 } 5961 } ); 5962 5963 5964 var 5965 5966 // Support: IE <=10 - 11, Edge 12 - 13 only 5967 // In IE/Edge using regex groups here causes severe slowdowns. 5968 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5969 rnoInnerhtml = /<script|<style|<link/i, 5970 5971 // checked="checked" or checked 5972 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5973 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 5974 5975// Prefer a tbody over its parent table for containing new rows 5976 function manipulationTarget( elem, content ) { 5977 if ( nodeName( elem, "table" ) && 5978 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 5979 5980 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 5981 } 5982 5983 return elem; 5984 } 5985 5986// Replace/restore the type attribute of script elements for safe DOM manipulation 5987 function disableScript( elem ) { 5988 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 5989 return elem; 5990 } 5991 function restoreScript( elem ) { 5992 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 5993 elem.type = elem.type.slice( 5 ); 5994 } else { 5995 elem.removeAttribute( "type" ); 5996 } 5997 5998 return elem; 5999 } 6000 6001 function cloneCopyEvent( src, dest ) { 6002 var i, l, type, pdataOld, udataOld, udataCur, events; 6003
vendor: 8,599 bytes, lines 6004-6232
6004 if ( dest.nodeType !== 1 ) { 6005 return; 6006 } 6007 6008 // 1. Copy private data: events, handlers, etc. 6009 if ( dataPriv.hasData( src ) ) { 6010 pdataOld = dataPriv.get( src ); 6011 events = pdataOld.events; 6012 6013 if ( events ) { 6014 dataPriv.remove( dest, "handle events" ); 6015 6016 for ( type in events ) { 6017 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 6018 jQuery.event.add( dest, type, events[ type ][ i ] ); 6019 } 6020 } 6021 } 6022 } 6023 6024 // 2. Copy user data 6025 if ( dataUser.hasData( src ) ) { 6026 udataOld = dataUser.access( src ); 6027 udataCur = jQuery.extend( {}, udataOld ); 6028 6029 dataUser.set( dest, udataCur ); 6030 } 6031 } 6032 6033// Fix IE bugs, see support tests 6034 function fixInput( src, dest ) { 6035 var nodeName = dest.nodeName.toLowerCase(); 6036 6037 // Fails to persist the checked state of a cloned checkbox or radio button. 6038 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 6039 dest.checked = src.checked; 6040 6041 // Fails to return the selected option to the default selected state when cloning options 6042 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6043 dest.defaultValue = src.defaultValue; 6044 } 6045 } 6046 6047 function domManip( collection, args, callback, ignored ) { 6048 6049 // Flatten any nested arrays 6050 args = flat( args ); 6051 6052 var fragment, first, scripts, hasScripts, node, doc, 6053 i = 0, 6054 l = collection.length, 6055 iNoClone = l - 1, 6056 value = args[ 0 ], 6057 valueIsFunction = isFunction( value ); 6058 6059 // We can't cloneNode fragments that contain checked, in WebKit 6060 if ( valueIsFunction || 6061 ( l > 1 && typeof value === "string" && 6062 !support.checkClone && rchecked.test( value ) ) ) { 6063 return collection.each( function( index ) { 6064 var self = collection.eq( index ); 6065 if ( valueIsFunction ) { 6066 args[ 0 ] = value.call( this, index, self.html() ); 6067 } 6068 domManip( self, args, callback, ignored ); 6069 } ); 6070 } 6071 6072 if ( l ) { 6073 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 6074 first = fragment.firstChild; 6075 6076 if ( fragment.childNodes.length === 1 ) { 6077 fragment = first; 6078 } 6079 6080 // Require either new content or an interest in ignored elements to invoke the callback 6081 if ( first || ignored ) { 6082 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 6083 hasScripts = scripts.length; 6084 6085 // Use the original fragment for the last item 6086 // instead of the first because it can end up 6087 // being emptied incorrectly in certain situations (#8070). 6088 for ( ; i < l; i++ ) { 6089 node = fragment; 6090 6091 if ( i !== iNoClone ) { 6092 node = jQuery.clone( node, true, true ); 6093 6094 // Keep references to cloned scripts for later restoration 6095 if ( hasScripts ) { 6096 6097 // Support: Android <=4.0 only, PhantomJS 1 only 6098 // push.apply(_, arraylike) throws on ancient WebKit 6099 jQuery.merge( scripts, getAll( node, "script" ) ); 6100 } 6101 } 6102 6103 callback.call( collection[ i ], node, i ); 6104 } 6105 6106 if ( hasScripts ) { 6107 doc = scripts[ scripts.length - 1 ].ownerDocument; 6108 6109 // Reenable scripts 6110 jQuery.map( scripts, restoreScript ); 6111 6112 // Evaluate executable scripts on first document insertion 6113 for ( i = 0; i < hasScripts; i++ ) { 6114 node = scripts[ i ]; 6115 if ( rscriptType.test( node.type || "" ) && 6116 !dataPriv.access( node, "globalEval" ) && 6117 jQuery.contains( doc, node ) ) { 6118 6119 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 6120 6121 // Optional AJAX dependency, but won't run scripts if not present 6122 if ( jQuery._evalUrl && !node.noModule ) { 6123 jQuery._evalUrl( node.src, { 6124 nonce: node.nonce || node.getAttribute( "nonce" ) 6125 }, doc ); 6126 } 6127 } else { 6128 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 6129 } 6130 } 6131 } 6132 } 6133 } 6134 } 6135 6136 return collection; 6137 } 6138 6139 function remove( elem, selector, keepData ) { 6140 var node, 6141 nodes = selector ? jQuery.filter( selector, elem ) : elem, 6142 i = 0; 6143 6144 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 6145 if ( !keepData && node.nodeType === 1 ) { 6146 jQuery.cleanData( getAll( node ) ); 6147 } 6148 6149 if ( node.parentNode ) { 6150 if ( keepData && isAttached( node ) ) { 6151 setGlobalEval( getAll( node, "script" ) ); 6152 } 6153 node.parentNode.removeChild( node ); 6154 } 6155 } 6156 6157 return elem; 6158 } 6159 6160 jQuery.extend( { 6161 htmlPrefilter: function( html ) { 6162 return html; 6163 }, 6164 6165 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 6166 var i, l, srcElements, destElements, 6167 clone = elem.cloneNode( true ), 6168 inPage = isAttached( elem ); 6169 6170 // Fix IE cloning issues 6171 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 6172 !jQuery.isXMLDoc( elem ) ) { 6173 6174 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 6175 destElements = getAll( clone ); 6176 srcElements = getAll( elem ); 6177 6178 for ( i = 0, l = srcElements.length; i < l; i++ ) { 6179 fixInput( srcElements[ i ], destElements[ i ] ); 6180 } 6181 } 6182 6183 // Copy the events from the original to the clone 6184 if ( dataAndEvents ) { 6185 if ( deepDataAndEvents ) { 6186 srcElements = srcElements || getAll( elem ); 6187 destElements = destElements || getAll( clone ); 6188 6189 for ( i = 0, l = srcElements.length; i < l; i++ ) { 6190 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 6191 } 6192 } else { 6193 cloneCopyEvent( elem, clone ); 6194 } 6195 } 6196 6197 // Preserve script evaluation history 6198 destElements = getAll( clone, "script" ); 6199 if ( destElements.length > 0 ) { 6200 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 6201 } 6202 6203 // Return the cloned set 6204 return clone; 6205 }, 6206 6207 cleanData: function( elems ) { 6208 var data, elem, type, 6209 special = jQuery.event.special, 6210 i = 0; 6211 6212 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 6213 if ( acceptData( elem ) ) { 6214 if ( ( data = elem[ dataPriv.expando ] ) ) { 6215 if ( data.events ) { 6216 for ( type in data.events ) { 6217 if ( special[ type ] ) { 6218 jQuery.event.remove( elem, type ); 6219 6220 // This is a shortcut to avoid jQuery.event.remove's overhead 6221 } else { 6222 jQuery.removeEvent( elem, type, data.handle ); 6223 } 6224 } 6225 } 6226 6227 // Support: Chrome <=35 - 45+ 6228 // Assign undefined instead of using delete, see Data#remove 6229 elem[ dataPriv.expando ] = undefined; 6230 } 6231 if ( elem[ dataUser.expando ] ) { 6232
vendor: 5,129 bytes, lines 6233-6383
6233 // Support: Chrome <=35 - 45+ 6234 // Assign undefined instead of using delete, see Data#remove 6235 elem[ dataUser.expando ] = undefined; 6236 } 6237 } 6238 } 6239 } 6240 } ); 6241 6242 jQuery.fn.extend( { 6243 detach: function( selector ) { 6244 return remove( this, selector, true ); 6245 }, 6246 6247 remove: function( selector ) { 6248 return remove( this, selector ); 6249 }, 6250 6251 text: function( value ) { 6252 return access( this, function( value ) { 6253 return value === undefined ? 6254 jQuery.text( this ) : 6255 this.empty().each( function() { 6256 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6257 this.textContent = value; 6258 } 6259 } ); 6260 }, null, value, arguments.length ); 6261 }, 6262 6263 append: function() { 6264 return domManip( this, arguments, function( elem ) { 6265 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6266 var target = manipulationTarget( this, elem ); 6267 target.appendChild( elem ); 6268 } 6269 } ); 6270 }, 6271 6272 prepend: function() { 6273 return domManip( this, arguments, function( elem ) { 6274 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6275 var target = manipulationTarget( this, elem ); 6276 target.insertBefore( elem, target.firstChild ); 6277 } 6278 } ); 6279 }, 6280 6281 before: function() { 6282 return domManip( this, arguments, function( elem ) { 6283 if ( this.parentNode ) { 6284 this.parentNode.insertBefore( elem, this ); 6285 } 6286 } ); 6287 }, 6288 6289 after: function() { 6290 return domManip( this, arguments, function( elem ) { 6291 if ( this.parentNode ) { 6292 this.parentNode.insertBefore( elem, this.nextSibling ); 6293 } 6294 } ); 6295 }, 6296 6297 empty: function() { 6298 var elem, 6299 i = 0; 6300 6301 for ( ; ( elem = this[ i ] ) != null; i++ ) { 6302 if ( elem.nodeType === 1 ) { 6303 6304 // Prevent memory leaks 6305 jQuery.cleanData( getAll( elem, false ) ); 6306 6307 // Remove any remaining nodes 6308 elem.textContent = ""; 6309 } 6310 } 6311 6312 return this; 6313 }, 6314 6315 clone: function( dataAndEvents, deepDataAndEvents ) { 6316 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6317 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6318 6319 return this.map( function() { 6320 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 6321 } ); 6322 }, 6323 6324 html: function( value ) { 6325 return access( this, function( value ) { 6326 var elem = this[ 0 ] || {}, 6327 i = 0, 6328 l = this.length; 6329 6330 if ( value === undefined && elem.nodeType === 1 ) { 6331 return elem.innerHTML; 6332 } 6333 6334 // See if we can take a shortcut and just use innerHTML 6335 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 6336 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 6337 6338 value = jQuery.htmlPrefilter( value ); 6339 6340 try { 6341 for ( ; i < l; i++ ) { 6342 elem = this[ i ] || {}; 6343 6344 // Remove element nodes and prevent memory leaks 6345 if ( elem.nodeType === 1 ) { 6346 jQuery.cleanData( getAll( elem, false ) ); 6347 elem.innerHTML = value; 6348 } 6349 } 6350 6351 elem = 0; 6352 6353 // If using innerHTML throws an exception, use the fallback method 6354 } catch ( e ) {} 6355 } 6356 6357 if ( elem ) { 6358 this.empty().append( value ); 6359 } 6360 }, null, value, arguments.length ); 6361 }, 6362 6363 replaceWith: function() { 6364 var ignored = []; 6365 6366 // Make the changes, replacing each non-ignored context element with the new content 6367 return domManip( this, arguments, function( elem ) { 6368 var parent = this.parentNode; 6369 6370 if ( jQuery.inArray( this, ignored ) < 0 ) { 6371 jQuery.cleanData( getAll( this ) ); 6372 if ( parent ) { 6373 parent.replaceChild( elem, this ); 6374 } 6375 } 6376 6377 // Force callback invocation 6378 }, ignored ); 6379 } 6380 } ); 6381 6382 jQuery.each( { 6383 appendTo: "append",
vendor: 14,475 bytes, lines 6384-6784
6384 prependTo: "prepend", 6385 insertBefore: "before", 6386 insertAfter: "after", 6387 replaceAll: "replaceWith" 6388 }, function( name, original ) { 6389 jQuery.fn[ name ] = function( selector ) { 6390 var elems, 6391 ret = [], 6392 insert = jQuery( selector ), 6393 last = insert.length - 1, 6394 i = 0; 6395 6396 for ( ; i <= last; i++ ) { 6397 elems = i === last ? this : this.clone( true ); 6398 jQuery( insert[ i ] )[ original ]( elems ); 6399 6400 // Support: Android <=4.0 only, PhantomJS 1 only 6401 // .get() because push.apply(_, arraylike) throws on ancient WebKit 6402 push.apply( ret, elems.get() ); 6403 } 6404 6405 return this.pushStack( ret ); 6406 }; 6407 } ); 6408 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 6409 6410 var getStyles = function( elem ) { 6411 6412 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 6413 // IE throws on elements created in popups 6414 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6415 var view = elem.ownerDocument.defaultView; 6416 6417 if ( !view || !view.opener ) { 6418 view = window; 6419 } 6420 6421 return view.getComputedStyle( elem ); 6422 }; 6423 6424 var swap = function( elem, options, callback ) { 6425 var ret, name, 6426 old = {}; 6427 6428 // Remember the old values, and insert the new ones 6429 for ( name in options ) { 6430 old[ name ] = elem.style[ name ]; 6431 elem.style[ name ] = options[ name ]; 6432 } 6433 6434 ret = callback.call( elem ); 6435 6436 // Revert the old values 6437 for ( name in options ) { 6438 elem.style[ name ] = old[ name ]; 6439 } 6440 6441 return ret; 6442 }; 6443 6444 6445 var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 6446 6447 6448 6449 ( function() { 6450 6451 // Executing both pixelPosition & boxSizingReliable tests require only one layout 6452 // so they're executed at the same time to save the second computation. 6453 function computeStyleTests() { 6454 6455 // This is a singleton, we need to execute it only once 6456 if ( !div ) { 6457 return; 6458 } 6459 6460 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 6461 "margin-top:1px;padding:0;border:0"; 6462 div.style.cssText = 6463 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 6464 "margin:auto;border:1px;padding:1px;" + 6465 "width:60%;top:1%"; 6466 documentElement.appendChild( container ).appendChild( div ); 6467 6468 var divStyle = window.getComputedStyle( div ); 6469 pixelPositionVal = divStyle.top !== "1%"; 6470 6471 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 6472 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 6473 6474 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 6475 // Some styles come back with percentage values, even though they shouldn't 6476 div.style.right = "60%"; 6477 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 6478 6479 // Support: IE 9 - 11 only 6480 // Detect misreporting of content dimensions for box-sizing:border-box elements 6481 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 6482 6483 // Support: IE 9 only 6484 // Detect overflow:scroll screwiness (gh-3699) 6485 // Support: Chrome <=64 6486 // Don't get tricked when zoom affects offsetWidth (gh-4029) 6487 div.style.position = "absolute"; 6488 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 6489 6490 documentElement.removeChild( container ); 6491 6492 // Nullify the div so it wouldn't be stored in the memory and 6493 // it will also be a sign that checks already performed 6494 div = null; 6495 } 6496 6497 function roundPixelMeasures( measure ) { 6498 return Math.round( parseFloat( measure ) ); 6499 } 6500 6501 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 6502 reliableTrDimensionsVal, reliableMarginLeftVal, 6503 container = document.createElement( "div" ), 6504 div = document.createElement( "div" ); 6505 6506 // Finish early in limited (non-browser) environments 6507 if ( !div.style ) { 6508 return; 6509 } 6510 6511 // Support: IE <=9 - 11 only 6512 // Style of cloned element affects source element cloned (#8908) 6513 div.style.backgroundClip = "content-box"; 6514 div.cloneNode( true ).style.backgroundClip = ""; 6515 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6516 6517 jQuery.extend( support, { 6518 boxSizingReliable: function() { 6519 computeStyleTests(); 6520 return boxSizingReliableVal; 6521 }, 6522 pixelBoxStyles: function() { 6523 computeStyleTests(); 6524 return pixelBoxStylesVal; 6525 }, 6526 pixelPosition: function() { 6527 computeStyleTests(); 6528 return pixelPositionVal; 6529 }, 6530 reliableMarginLeft: function() { 6531 computeStyleTests(); 6532 return reliableMarginLeftVal; 6533 }, 6534 scrollboxSize: function() { 6535 computeStyleTests(); 6536 return scrollboxSizeVal; 6537 }, 6538 6539 // Support: IE 9 - 11+, Edge 15 - 18+ 6540 // IE/Edge misreport `getComputedStyle` of table rows with width/height 6541 // set in CSS while `offset*` properties report correct values. 6542 // Behavior in IE 9 is more subtle than in newer versions & it passes 6543 // some versions of this test; make sure not to make it pass there! 6544 reliableTrDimensions: function() { 6545 var table, tr, trChild, trStyle; 6546 if ( reliableTrDimensionsVal == null ) { 6547 table = document.createElement( "table" ); 6548 tr = document.createElement( "tr" ); 6549 trChild = document.createElement( "div" ); 6550 6551 table.style.cssText = "position:absolute;left:-11111px"; 6552 tr.style.height = "1px"; 6553 trChild.style.height = "9px"; 6554 6555 documentElement 6556 .appendChild( table ) 6557 .appendChild( tr ) 6558 .appendChild( trChild ); 6559 6560 trStyle = window.getComputedStyle( tr ); 6561 reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; 6562 6563 documentElement.removeChild( table ); 6564 } 6565 return reliableTrDimensionsVal; 6566 } 6567 } ); 6568 } )(); 6569 6570 6571 function curCSS( elem, name, computed ) { 6572 var width, minWidth, maxWidth, ret, 6573 6574 // Support: Firefox 51+ 6575 // Retrieving style before computed somehow 6576 // fixes an issue with getting wrong values 6577 // on detached elements 6578 style = elem.style; 6579 6580 computed = computed || getStyles( elem ); 6581 6582 // getPropertyValue is needed for: 6583 // .css('filter') (IE 9 only, #12537) 6584 // .css('--customProperty) (#3144) 6585 if ( computed ) { 6586 ret = computed.getPropertyValue( name ) || computed[ name ]; 6587 6588 if ( ret === "" && !isAttached( elem ) ) { 6589 ret = jQuery.style( elem, name ); 6590 } 6591 6592 // A tribute to the "awesome hack by Dean Edwards" 6593 // Android Browser returns percentage for some values, 6594 // but width seems to be reliably pixels. 6595 // This is against the CSSOM draft spec: 6596 // https://drafts.csswg.org/cssom/#resolved-values 6597 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 6598 6599 // Remember the original values 6600 width = style.width; 6601 minWidth = style.minWidth; 6602 maxWidth = style.maxWidth; 6603 6604 // Put in the new values to get a computed value out 6605 style.minWidth = style.maxWidth = style.width = ret; 6606 ret = computed.width; 6607 6608 // Revert the changed values 6609 style.width = width; 6610 style.minWidth = minWidth; 6611 style.maxWidth = maxWidth; 6612 } 6613 } 6614 6615 return ret !== undefined ? 6616 6617 // Support: IE <=9 - 11 only 6618 // IE returns zIndex value as an integer. 6619 ret + "" : 6620 ret; 6621 } 6622 6623 6624 function addGetHookIf( conditionFn, hookFn ) { 6625 6626 // Define the hook, we'll check on the first run if it's really needed. 6627 return { 6628 get: function() { 6629 if ( conditionFn() ) { 6630 6631 // Hook not needed (or it's not possible to use it due 6632 // to missing dependency), remove it. 6633 delete this.get; 6634 return; 6635 } 6636 6637 // Hook needed; redefine it so that the support test is not executed again. 6638 return ( this.get = hookFn ).apply( this, arguments ); 6639 } 6640 }; 6641 } 6642 6643 6644 var cssPrefixes = [ "Webkit", "Moz", "ms" ], 6645 emptyStyle = document.createElement( "div" ).style, 6646 vendorProps = {}; 6647 6648// Return a vendor-prefixed property or undefined 6649 function vendorPropName( name ) { 6650 6651 // Check for vendor prefixed names 6652 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 6653 i = cssPrefixes.length; 6654 6655 while ( i-- ) { 6656 name = cssPrefixes[ i ] + capName; 6657 if ( name in emptyStyle ) { 6658 return name; 6659 } 6660 } 6661 } 6662 6663// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 6664 function finalPropName( name ) { 6665 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 6666 6667 if ( final ) { 6668 return final; 6669 } 6670 if ( name in emptyStyle ) { 6671 return name; 6672 } 6673 return vendorProps[ name ] = vendorPropName( name ) || name; 6674 } 6675 6676 6677 var 6678 6679 // Swappable if display is none or starts with table 6680 // except "table", "table-cell", or "table-caption" 6681 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 6682 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6683 rcustomProp = /^--/, 6684 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6685 cssNormalTransform = { 6686 letterSpacing: "0", 6687 fontWeight: "400" 6688 }; 6689 6690 function setPositiveNumber( _elem, value, subtract ) { 6691 6692 // Any relative (+/-) values have already been 6693 // normalized at this point 6694 var matches = rcssNum.exec( value ); 6695 return matches ? 6696 6697 // Guard against undefined "subtract", e.g., when used as in cssHooks 6698 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 6699 value; 6700 } 6701 6702 function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 6703 var i = dimension === "width" ? 1 : 0, 6704 extra = 0, 6705 delta = 0; 6706 6707 // Adjustment may not be necessary 6708 if ( box === ( isBorderBox ? "border" : "content" ) ) { 6709 return 0; 6710 } 6711 6712 for ( ; i < 4; i += 2 ) { 6713 6714 // Both box models exclude margin 6715 if ( box === "margin" ) { 6716 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 6717 } 6718 6719 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 6720 if ( !isBorderBox ) { 6721 6722 // Add padding 6723 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6724 6725 // For "border" or "margin", add border 6726 if ( box !== "padding" ) { 6727 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6728 6729 // But still keep track of it otherwise 6730 } else { 6731 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6732 } 6733 6734 // If we get here with a border-box (content + padding + border), we're seeking "content" or 6735 // "padding" or "margin" 6736 } else { 6737 6738 // For "content", subtract padding 6739 if ( box === "content" ) { 6740 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6741 } 6742 6743 // For "content" or "padding", subtract border 6744 if ( box !== "margin" ) { 6745 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6746 } 6747 } 6748 } 6749 6750 // Account for positive content-box scroll gutter when requested by providing computedVal 6751 if ( !isBorderBox && computedVal >= 0 ) { 6752 6753 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 6754 // Assuming integer scroll gutter, subtract the rest and round down 6755 delta += Math.max( 0, Math.ceil( 6756 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 6757 computedVal - 6758 delta - 6759 extra - 6760 0.5 6761 6762 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 6763 // Use an explicit zero to avoid NaN (gh-3964) 6764 ) ) || 0; 6765 } 6766 6767 return delta; 6768 } 6769 6770 function getWidthOrHeight( elem, dimension, extra ) { 6771 6772 // Start with computed style 6773 var styles = getStyles( elem ), 6774 6775 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 6776 // Fake content-box until we know it's needed to know the true value. 6777 boxSizingNeeded = !support.boxSizingReliable() || extra, 6778 isBorderBox = boxSizingNeeded && 6779 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6780 valueIsBorderBox = isBorderBox, 6781 6782 val = curCSS( elem, dimension, styles ), 6783 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 6784
vendor: 6,163 bytes, lines 6785-6944
6785 // Support: Firefox <=54 6786 // Return a confounding non-pixel value or feign ignorance, as appropriate. 6787 if ( rnumnonpx.test( val ) ) { 6788 if ( !extra ) { 6789 return val; 6790 } 6791 val = "auto"; 6792 } 6793 6794 6795 // Support: IE 9 - 11 only 6796 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 6797 // In those cases, the computed value can be trusted to be border-box. 6798 if ( ( !support.boxSizingReliable() && isBorderBox || 6799 6800 // Support: IE 10 - 11+, Edge 15 - 18+ 6801 // IE/Edge misreport `getComputedStyle` of table rows with width/height 6802 // set in CSS while `offset*` properties report correct values. 6803 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 6804 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 6805 6806 // Fall back to offsetWidth/offsetHeight when value is "auto" 6807 // This happens for inline elements with no explicit setting (gh-3571) 6808 val === "auto" || 6809 6810 // Support: Android <=4.1 - 4.3 only 6811 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 6812 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 6813 6814 // Make sure the element is visible & connected 6815 elem.getClientRects().length ) { 6816 6817 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 6818 6819 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 6820 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 6821 // retrieved value as a content box dimension. 6822 valueIsBorderBox = offsetProp in elem; 6823 if ( valueIsBorderBox ) { 6824 val = elem[ offsetProp ]; 6825 } 6826 } 6827 6828 // Normalize "" and auto 6829 val = parseFloat( val ) || 0; 6830 6831 // Adjust for the element's box model 6832 return ( val + 6833 boxModelAdjustment( 6834 elem, 6835 dimension, 6836 extra || ( isBorderBox ? "border" : "content" ), 6837 valueIsBorderBox, 6838 styles, 6839 6840 // Provide the current computed size to request scroll gutter calculation (gh-3589) 6841 val 6842 ) 6843 ) + "px"; 6844 } 6845 6846 jQuery.extend( { 6847 6848 // Add in style property hooks for overriding the default 6849 // behavior of getting and setting a style property 6850 cssHooks: { 6851 opacity: { 6852 get: function( elem, computed ) { 6853 if ( computed ) { 6854 6855 // We should always get a number back from opacity 6856 var ret = curCSS( elem, "opacity" ); 6857 return ret === "" ? "1" : ret; 6858 } 6859 } 6860 } 6861 }, 6862 6863 // Don't automatically add "px" to these possibly-unitless properties 6864 cssNumber: { 6865 "animationIterationCount": true, 6866 "columnCount": true, 6867 "fillOpacity": true, 6868 "flexGrow": true, 6869 "flexShrink": true, 6870 "fontWeight": true, 6871 "gridArea": true, 6872 "gridColumn": true, 6873 "gridColumnEnd": true, 6874 "gridColumnStart": true, 6875 "gridRow": true, 6876 "gridRowEnd": true, 6877 "gridRowStart": true, 6878 "lineHeight": true, 6879 "opacity": true, 6880 "order": true, 6881 "orphans": true, 6882 "widows": true, 6883 "zIndex": true, 6884 "zoom": true 6885 }, 6886 6887 // Add in properties whose names you wish to fix before 6888 // setting or getting the value 6889 cssProps: {}, 6890 6891 // Get and set the style property on a DOM Node 6892 style: function( elem, name, value, extra ) { 6893 6894 // Don't set styles on text and comment nodes 6895 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6896 return; 6897 } 6898 6899 // Make sure that we're working with the right name 6900 var ret, type, hooks, 6901 origName = camelCase( name ), 6902 isCustomProp = rcustomProp.test( name ), 6903 style = elem.style; 6904 6905 // Make sure that we're working with the right name. We don't 6906 // want to query the value if it is a CSS custom property 6907 // since they are user-defined. 6908 if ( !isCustomProp ) { 6909 name = finalPropName( origName ); 6910 } 6911 6912 // Gets hook for the prefixed version, then unprefixed version 6913 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6914 6915 // Check if we're setting a value 6916 if ( value !== undefined ) { 6917 type = typeof value; 6918 6919 // Convert "+=" or "-=" to relative numbers (#7345) 6920 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 6921 value = adjustCSS( elem, name, ret ); 6922 6923 // Fixes bug #9237 6924 type = "number"; 6925 } 6926 6927 // Make sure that null and NaN values aren't set (#7116) 6928 if ( value == null || value !== value ) { 6929 return; 6930 } 6931 6932 // If a number was passed in, add the unit (except for certain CSS properties) 6933 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 6934 // "px" to a few hardcoded values. 6935 if ( type === "number" && !isCustomProp ) { 6936 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 6937 } 6938 6939 // background-* props affect original clone's values 6940 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 6941 style[ name ] = "inherit"; 6942 } 6943 6944 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 15,960 bytes, lines 6945-7389
6945 if ( !hooks || !( "set" in hooks ) || 6946 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 6947 6948 if ( isCustomProp ) { 6949 style.setProperty( name, value ); 6950 } else { 6951 style[ name ] = value; 6952 } 6953 } 6954 6955 } else { 6956 6957 // If a hook was provided get the non-computed value from there 6958 if ( hooks && "get" in hooks && 6959 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 6960 6961 return ret; 6962 } 6963 6964 // Otherwise just get the value from the style object 6965 return style[ name ]; 6966 } 6967 }, 6968 6969 css: function( elem, name, extra, styles ) { 6970 var val, num, hooks, 6971 origName = camelCase( name ), 6972 isCustomProp = rcustomProp.test( name ); 6973 6974 // Make sure that we're working with the right name. We don't 6975 // want to modify the value if it is a CSS custom property 6976 // since they are user-defined. 6977 if ( !isCustomProp ) { 6978 name = finalPropName( origName ); 6979 } 6980 6981 // Try prefixed name followed by the unprefixed name 6982 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6983 6984 // If a hook was provided get the computed value from there 6985 if ( hooks && "get" in hooks ) { 6986 val = hooks.get( elem, true, extra ); 6987 } 6988 6989 // Otherwise, if a way to get the computed value exists, use that 6990 if ( val === undefined ) { 6991 val = curCSS( elem, name, styles ); 6992 } 6993 6994 // Convert "normal" to computed value 6995 if ( val === "normal" && name in cssNormalTransform ) { 6996 val = cssNormalTransform[ name ]; 6997 } 6998 6999 // Make numeric if forced or a qualifier was provided and val looks numeric 7000 if ( extra === "" || extra ) { 7001 num = parseFloat( val ); 7002 return extra === true || isFinite( num ) ? num || 0 : val; 7003 } 7004 7005 return val; 7006 } 7007 } ); 7008 7009 jQuery.each( [ "height", "width" ], function( _i, dimension ) { 7010 jQuery.cssHooks[ dimension ] = { 7011 get: function( elem, computed, extra ) { 7012 if ( computed ) { 7013 7014 // Certain elements can have dimension info if we invisibly show them 7015 // but it must have a current display style that would benefit 7016 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 7017 7018 // Support: Safari 8+ 7019 // Table columns in Safari have non-zero offsetWidth & zero 7020 // getBoundingClientRect().width unless display is changed. 7021 // Support: IE <=11 only 7022 // Running getBoundingClientRect on a disconnected node 7023 // in IE throws an error. 7024 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 7025 swap( elem, cssShow, function() { 7026 return getWidthOrHeight( elem, dimension, extra ); 7027 } ) : 7028 getWidthOrHeight( elem, dimension, extra ); 7029 } 7030 }, 7031 7032 set: function( elem, value, extra ) { 7033 var matches, 7034 styles = getStyles( elem ), 7035 7036 // Only read styles.position if the test has a chance to fail 7037 // to avoid forcing a reflow. 7038 scrollboxSizeBuggy = !support.scrollboxSize() && 7039 styles.position === "absolute", 7040 7041 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 7042 boxSizingNeeded = scrollboxSizeBuggy || extra, 7043 isBorderBox = boxSizingNeeded && 7044 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 7045 subtract = extra ? 7046 boxModelAdjustment( 7047 elem, 7048 dimension, 7049 extra, 7050 isBorderBox, 7051 styles 7052 ) : 7053 0; 7054 7055 // Account for unreliable border-box dimensions by comparing offset* to computed and 7056 // faking a content-box to get border and padding (gh-3699) 7057 if ( isBorderBox && scrollboxSizeBuggy ) { 7058 subtract -= Math.ceil( 7059 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 7060 parseFloat( styles[ dimension ] ) - 7061 boxModelAdjustment( elem, dimension, "border", false, styles ) - 7062 0.5 7063 ); 7064 } 7065 7066 // Convert to pixels if value adjustment is needed 7067 if ( subtract && ( matches = rcssNum.exec( value ) ) && 7068 ( matches[ 3 ] || "px" ) !== "px" ) { 7069 7070 elem.style[ dimension ] = value; 7071 value = jQuery.css( elem, dimension ); 7072 } 7073 7074 return setPositiveNumber( elem, value, subtract ); 7075 } 7076 }; 7077 } ); 7078 7079 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 7080 function( elem, computed ) { 7081 if ( computed ) { 7082 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 7083 elem.getBoundingClientRect().left - 7084 swap( elem, { marginLeft: 0 }, function() { 7085 return elem.getBoundingClientRect().left; 7086 } ) 7087 ) + "px"; 7088 } 7089 } 7090 ); 7091 7092// These hooks are used by animate to expand properties 7093 jQuery.each( { 7094 margin: "", 7095 padding: "", 7096 border: "Width" 7097 }, function( prefix, suffix ) { 7098 jQuery.cssHooks[ prefix + suffix ] = { 7099 expand: function( value ) { 7100 var i = 0, 7101 expanded = {}, 7102 7103 // Assumes a single number if not a string 7104 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 7105 7106 for ( ; i < 4; i++ ) { 7107 expanded[ prefix + cssExpand[ i ] + suffix ] = 7108 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 7109 } 7110 7111 return expanded; 7112 } 7113 }; 7114 7115 if ( prefix !== "margin" ) { 7116 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 7117 } 7118 } ); 7119 7120 jQuery.fn.extend( { 7121 css: function( name, value ) { 7122 return access( this, function( elem, name, value ) { 7123 var styles, len, 7124 map = {}, 7125 i = 0; 7126 7127 if ( Array.isArray( name ) ) { 7128 styles = getStyles( elem ); 7129 len = name.length; 7130 7131 for ( ; i < len; i++ ) { 7132 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 7133 } 7134 7135 return map; 7136 } 7137 7138 return value !== undefined ? 7139 jQuery.style( elem, name, value ) : 7140 jQuery.css( elem, name ); 7141 }, name, value, arguments.length > 1 ); 7142 } 7143 } ); 7144 7145 7146 function Tween( elem, options, prop, end, easing ) { 7147 return new Tween.prototype.init( elem, options, prop, end, easing ); 7148 } 7149 jQuery.Tween = Tween; 7150 7151 Tween.prototype = { 7152 constructor: Tween, 7153 init: function( elem, options, prop, end, easing, unit ) { 7154 this.elem = elem; 7155 this.prop = prop; 7156 this.easing = easing || jQuery.easing._default; 7157 this.options = options; 7158 this.start = this.now = this.cur(); 7159 this.end = end; 7160 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 7161 }, 7162 cur: function() { 7163 var hooks = Tween.propHooks[ this.prop ]; 7164 7165 return hooks && hooks.get ? 7166 hooks.get( this ) : 7167 Tween.propHooks._default.get( this ); 7168 }, 7169 run: function( percent ) { 7170 var eased, 7171 hooks = Tween.propHooks[ this.prop ]; 7172 7173 if ( this.options.duration ) { 7174 this.pos = eased = jQuery.easing[ this.easing ]( 7175 percent, this.options.duration * percent, 0, 1, this.options.duration 7176 ); 7177 } else { 7178 this.pos = eased = percent; 7179 } 7180 this.now = ( this.end - this.start ) * eased + this.start; 7181 7182 if ( this.options.step ) { 7183 this.options.step.call( this.elem, this.now, this ); 7184 } 7185 7186 if ( hooks && hooks.set ) { 7187 hooks.set( this ); 7188 } else { 7189 Tween.propHooks._default.set( this ); 7190 } 7191 return this; 7192 } 7193 }; 7194 7195 Tween.prototype.init.prototype = Tween.prototype; 7196 7197 Tween.propHooks = { 7198 _default: { 7199 get: function( tween ) { 7200 var result; 7201 7202 // Use a property on the element directly when it is not a DOM element, 7203 // or when there is no matching style property that exists. 7204 if ( tween.elem.nodeType !== 1 || 7205 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 7206 return tween.elem[ tween.prop ]; 7207 } 7208 7209 // Passing an empty string as a 3rd parameter to .css will automatically 7210 // attempt a parseFloat and fallback to a string if the parse fails. 7211 // Simple values such as "10px" are parsed to Float; 7212 // complex values such as "rotate(1rad)" are returned as-is. 7213 result = jQuery.css( tween.elem, tween.prop, "" ); 7214 7215 // Empty strings, null, undefined and "auto" are converted to 0. 7216 return !result || result === "auto" ? 0 : result; 7217 }, 7218 set: function( tween ) { 7219 7220 // Use step hook for back compat. 7221 // Use cssHook if its there. 7222 // Use .style if available and use plain properties where available. 7223 if ( jQuery.fx.step[ tween.prop ] ) { 7224 jQuery.fx.step[ tween.prop ]( tween ); 7225 } else if ( tween.elem.nodeType === 1 && ( 7226 jQuery.cssHooks[ tween.prop ] || 7227 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 7228 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 7229 } else { 7230 tween.elem[ tween.prop ] = tween.now; 7231 } 7232 } 7233 } 7234 }; 7235 7236// Support: IE <=9 only 7237// Panic based approach to setting things on disconnected nodes 7238 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 7239 set: function( tween ) { 7240 if ( tween.elem.nodeType && tween.elem.parentNode ) { 7241 tween.elem[ tween.prop ] = tween.now; 7242 } 7243 } 7244 }; 7245 7246 jQuery.easing = { 7247 linear: function( p ) { 7248 return p; 7249 }, 7250 swing: function( p ) { 7251 return 0.5 - Math.cos( p * Math.PI ) / 2; 7252 }, 7253 _default: "swing" 7254 }; 7255 7256 jQuery.fx = Tween.prototype.init; 7257 7258// Back compat <1.8 extension point 7259 jQuery.fx.step = {}; 7260 7261 7262 7263 7264 var 7265 fxNow, inProgress, 7266 rfxtypes = /^(?:toggle|show|hide)$/, 7267 rrun = /queueHooks$/; 7268 7269 function schedule() { 7270 if ( inProgress ) { 7271 if ( document.hidden === false && window.requestAnimationFrame ) { 7272 window.requestAnimationFrame( schedule ); 7273 } else { 7274 window.setTimeout( schedule, jQuery.fx.interval ); 7275 } 7276 7277 jQuery.fx.tick(); 7278 } 7279 } 7280 7281// Animations created synchronously will run synchronously 7282 function createFxNow() { 7283 window.setTimeout( function() { 7284 fxNow = undefined; 7285 } ); 7286 return ( fxNow = Date.now() ); 7287 } 7288 7289// Generate parameters to create a standard animation 7290 function genFx( type, includeWidth ) { 7291 var which, 7292 i = 0, 7293 attrs = { height: type }; 7294 7295 // If we include width, step value is 1 to do all cssExpand values, 7296 // otherwise step value is 2 to skip over Left and Right 7297 includeWidth = includeWidth ? 1 : 0; 7298 for ( ; i < 4; i += 2 - includeWidth ) { 7299 which = cssExpand[ i ]; 7300 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 7301 } 7302 7303 if ( includeWidth ) { 7304 attrs.opacity = attrs.width = type; 7305 } 7306 7307 return attrs; 7308 } 7309 7310 function createTween( value, prop, animation ) { 7311 var tween, 7312 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 7313 index = 0, 7314 length = collection.length; 7315 for ( ; index < length; index++ ) { 7316 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 7317 7318 // We're done with this property 7319 return tween; 7320 } 7321 } 7322 } 7323 7324 function defaultPrefilter( elem, props, opts ) { 7325 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 7326 isBox = "width" in props || "height" in props, 7327 anim = this, 7328 orig = {}, 7329 style = elem.style, 7330 hidden = elem.nodeType && isHiddenWithinTree( elem ), 7331 dataShow = dataPriv.get( elem, "fxshow" ); 7332 7333 // Queue-skipping animations hijack the fx hooks 7334 if ( !opts.queue ) { 7335 hooks = jQuery._queueHooks( elem, "fx" ); 7336 if ( hooks.unqueued == null ) { 7337 hooks.unqueued = 0; 7338 oldfire = hooks.empty.fire; 7339 hooks.empty.fire = function() { 7340 if ( !hooks.unqueued ) { 7341 oldfire(); 7342 } 7343 }; 7344 } 7345 hooks.unqueued++; 7346 7347 anim.always( function() { 7348 7349 // Ensure the complete handler is called before this completes 7350 anim.always( function() { 7351 hooks.unqueued--; 7352 if ( !jQuery.queue( elem, "fx" ).length ) { 7353 hooks.empty.fire(); 7354 } 7355 } ); 7356 } ); 7357 } 7358 7359 // Detect show/hide animations 7360 for ( prop in props ) { 7361 value = props[ prop ]; 7362 if ( rfxtypes.test( value ) ) { 7363 delete props[ prop ]; 7364 toggle = toggle || value === "toggle"; 7365 if ( value === ( hidden ? "hide" : "show" ) ) { 7366 7367 // Pretend to be hidden if this is a "show" and 7368 // there is still data from a stopped show/hide 7369 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 7370 hidden = true; 7371 7372 // Ignore all other no-op show/hide data 7373 } else { 7374 continue; 7375 } 7376 } 7377 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 7378 } 7379 } 7380 7381 // Bail out if this is a no-op like .hide().hide() 7382 propTween = !jQuery.isEmptyObject( props ); 7383 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 7384 return; 7385 } 7386 7387 // Restrict "overflow" and "display" styles during box animations 7388 if ( isBox && elem.nodeType === 1 ) { 7389
vendor: 5,766 bytes, lines 7390-7545
7390 // Support: IE <=9 - 11, Edge 12 - 15 7391 // Record all 3 overflow attributes because IE does not infer the shorthand 7392 // from identically-valued overflowX and overflowY and Edge just mirrors 7393 // the overflowX value there. 7394 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 7395 7396 // Identify a display type, preferring old show/hide data over the CSS cascade 7397 restoreDisplay = dataShow && dataShow.display; 7398 if ( restoreDisplay == null ) { 7399 restoreDisplay = dataPriv.get( elem, "display" ); 7400 } 7401 display = jQuery.css( elem, "display" ); 7402 if ( display === "none" ) { 7403 if ( restoreDisplay ) { 7404 display = restoreDisplay; 7405 } else { 7406 7407 // Get nonempty value(s) by temporarily forcing visibility 7408 showHide( [ elem ], true ); 7409 restoreDisplay = elem.style.display || restoreDisplay; 7410 display = jQuery.css( elem, "display" ); 7411 showHide( [ elem ] ); 7412 } 7413 } 7414 7415 // Animate inline elements as inline-block 7416 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 7417 if ( jQuery.css( elem, "float" ) === "none" ) { 7418 7419 // Restore the original display value at the end of pure show/hide animations 7420 if ( !propTween ) { 7421 anim.done( function() { 7422 style.display = restoreDisplay; 7423 } ); 7424 if ( restoreDisplay == null ) { 7425 display = style.display; 7426 restoreDisplay = display === "none" ? "" : display; 7427 } 7428 } 7429 style.display = "inline-block"; 7430 } 7431 } 7432 } 7433 7434 if ( opts.overflow ) { 7435 style.overflow = "hidden"; 7436 anim.always( function() { 7437 style.overflow = opts.overflow[ 0 ]; 7438 style.overflowX = opts.overflow[ 1 ]; 7439 style.overflowY = opts.overflow[ 2 ]; 7440 } ); 7441 } 7442 7443 // Implement show/hide animations 7444 propTween = false; 7445 for ( prop in orig ) { 7446 7447 // General show/hide setup for this element animation 7448 if ( !propTween ) { 7449 if ( dataShow ) { 7450 if ( "hidden" in dataShow ) { 7451 hidden = dataShow.hidden; 7452 } 7453 } else { 7454 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 7455 } 7456 7457 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 7458 if ( toggle ) { 7459 dataShow.hidden = !hidden; 7460 } 7461 7462 // Show elements before animating them 7463 if ( hidden ) { 7464 showHide( [ elem ], true ); 7465 } 7466 7467 /* eslint-disable no-loop-func */ 7468 7469 anim.done( function() { 7470 7471 /* eslint-enable no-loop-func */ 7472 7473 // The final step of a "hide" animation is actually hiding the element 7474 if ( !hidden ) { 7475 showHide( [ elem ] ); 7476 } 7477 dataPriv.remove( elem, "fxshow" ); 7478 for ( prop in orig ) { 7479 jQuery.style( elem, prop, orig[ prop ] ); 7480 } 7481 } ); 7482 } 7483 7484 // Per-property setup 7485 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 7486 if ( !( prop in dataShow ) ) { 7487 dataShow[ prop ] = propTween.start; 7488 if ( hidden ) { 7489 propTween.end = propTween.start; 7490 propTween.start = 0; 7491 } 7492 } 7493 } 7494 } 7495 7496 function propFilter( props, specialEasing ) { 7497 var index, name, easing, value, hooks; 7498 7499 // camelCase, specialEasing and expand cssHook pass 7500 for ( index in props ) { 7501 name = camelCase( index ); 7502 easing = specialEasing[ name ]; 7503 value = props[ index ]; 7504 if ( Array.isArray( value ) ) { 7505 easing = value[ 1 ]; 7506 value = props[ index ] = value[ 0 ]; 7507 } 7508 7509 if ( index !== name ) { 7510 props[ name ] = value; 7511 delete props[ index ]; 7512 } 7513 7514 hooks = jQuery.cssHooks[ name ]; 7515 if ( hooks && "expand" in hooks ) { 7516 value = hooks.expand( value ); 7517 delete props[ name ]; 7518 7519 // Not quite $.extend, this won't overwrite existing keys. 7520 // Reusing 'index' because we have the correct "name" 7521 for ( index in value ) { 7522 if ( !( index in props ) ) { 7523 props[ index ] = value[ index ]; 7524 specialEasing[ index ] = easing; 7525 } 7526 } 7527 } else { 7528 specialEasing[ name ] = easing; 7529 } 7530 } 7531 } 7532 7533 function Animation( elem, properties, options ) { 7534 var result, 7535 stopped, 7536 index = 0, 7537 length = Animation.prefilters.length, 7538 deferred = jQuery.Deferred().always( function() { 7539 7540 // Don't match elem in the :animated selector 7541 delete tick.elem; 7542 } ), 7543 tick = function() { 7544 if ( stopped ) { 7545 return false;
vendor: 20,459 bytes, lines 7546-8161
7546 } 7547 var currentTime = fxNow || createFxNow(), 7548 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 7549 7550 // Support: Android 2.3 only 7551 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 7552 temp = remaining / animation.duration || 0, 7553 percent = 1 - temp, 7554 index = 0, 7555 length = animation.tweens.length; 7556 7557 for ( ; index < length; index++ ) { 7558 animation.tweens[ index ].run( percent ); 7559 } 7560 7561 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 7562 7563 // If there's more to do, yield 7564 if ( percent < 1 && length ) { 7565 return remaining; 7566 } 7567 7568 // If this was an empty animation, synthesize a final progress notification 7569 if ( !length ) { 7570 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7571 } 7572 7573 // Resolve the animation and report its conclusion 7574 deferred.resolveWith( elem, [ animation ] ); 7575 return false; 7576 }, 7577 animation = deferred.promise( { 7578 elem: elem, 7579 props: jQuery.extend( {}, properties ), 7580 opts: jQuery.extend( true, { 7581 specialEasing: {}, 7582 easing: jQuery.easing._default 7583 }, options ), 7584 originalProperties: properties, 7585 originalOptions: options, 7586 startTime: fxNow || createFxNow(), 7587 duration: options.duration, 7588 tweens: [], 7589 createTween: function( prop, end ) { 7590 var tween = jQuery.Tween( elem, animation.opts, prop, end, 7591 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 7592 animation.tweens.push( tween ); 7593 return tween; 7594 }, 7595 stop: function( gotoEnd ) { 7596 var index = 0, 7597 7598 // If we are going to the end, we want to run all the tweens 7599 // otherwise we skip this part 7600 length = gotoEnd ? animation.tweens.length : 0; 7601 if ( stopped ) { 7602 return this; 7603 } 7604 stopped = true; 7605 for ( ; index < length; index++ ) { 7606 animation.tweens[ index ].run( 1 ); 7607 } 7608 7609 // Resolve when we played the last frame; otherwise, reject 7610 if ( gotoEnd ) { 7611 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7612 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 7613 } else { 7614 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 7615 } 7616 return this; 7617 } 7618 } ), 7619 props = animation.props; 7620 7621 propFilter( props, animation.opts.specialEasing ); 7622 7623 for ( ; index < length; index++ ) { 7624 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 7625 if ( result ) { 7626 if ( isFunction( result.stop ) ) { 7627 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 7628 result.stop.bind( result ); 7629 } 7630 return result; 7631 } 7632 } 7633 7634 jQuery.map( props, createTween, animation ); 7635 7636 if ( isFunction( animation.opts.start ) ) { 7637 animation.opts.start.call( elem, animation ); 7638 } 7639 7640 // Attach callbacks from options 7641 animation 7642 .progress( animation.opts.progress ) 7643 .done( animation.opts.done, animation.opts.complete ) 7644 .fail( animation.opts.fail ) 7645 .always( animation.opts.always ); 7646 7647 jQuery.fx.timer( 7648 jQuery.extend( tick, { 7649 elem: elem, 7650 anim: animation, 7651 queue: animation.opts.queue 7652 } ) 7653 ); 7654 7655 return animation; 7656 } 7657 7658 jQuery.Animation = jQuery.extend( Animation, { 7659 7660 tweeners: { 7661 "*": [ function( prop, value ) { 7662 var tween = this.createTween( prop, value ); 7663 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 7664 return tween; 7665 } ] 7666 }, 7667 7668 tweener: function( props, callback ) { 7669 if ( isFunction( props ) ) { 7670 callback = props; 7671 props = [ "*" ]; 7672 } else { 7673 props = props.match( rnothtmlwhite ); 7674 } 7675 7676 var prop, 7677 index = 0, 7678 length = props.length; 7679 7680 for ( ; index < length; index++ ) { 7681 prop = props[ index ]; 7682 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 7683 Animation.tweeners[ prop ].unshift( callback ); 7684 } 7685 }, 7686 7687 prefilters: [ defaultPrefilter ], 7688 7689 prefilter: function( callback, prepend ) { 7690 if ( prepend ) { 7691 Animation.prefilters.unshift( callback ); 7692 } else { 7693 Animation.prefilters.push( callback ); 7694 } 7695 } 7696 } ); 7697 7698 jQuery.speed = function( speed, easing, fn ) { 7699 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 7700 complete: fn || !fn && easing || 7701 isFunction( speed ) && speed, 7702 duration: speed, 7703 easing: fn && easing || easing && !isFunction( easing ) && easing 7704 }; 7705 7706 // Go to the end state if fx are off 7707 if ( jQuery.fx.off ) { 7708 opt.duration = 0; 7709 7710 } else { 7711 if ( typeof opt.duration !== "number" ) { 7712 if ( opt.duration in jQuery.fx.speeds ) { 7713 opt.duration = jQuery.fx.speeds[ opt.duration ]; 7714 7715 } else { 7716 opt.duration = jQuery.fx.speeds._default; 7717 } 7718 } 7719 } 7720 7721 // Normalize opt.queue - true/undefined/null -> "fx" 7722 if ( opt.queue == null || opt.queue === true ) { 7723 opt.queue = "fx"; 7724 } 7725 7726 // Queueing 7727 opt.old = opt.complete; 7728 7729 opt.complete = function() { 7730 if ( isFunction( opt.old ) ) { 7731 opt.old.call( this ); 7732 } 7733 7734 if ( opt.queue ) { 7735 jQuery.dequeue( this, opt.queue ); 7736 } 7737 }; 7738 7739 return opt; 7740 }; 7741 7742 jQuery.fn.extend( { 7743 fadeTo: function( speed, to, easing, callback ) { 7744 7745 // Show any hidden elements after setting opacity to 0 7746 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 7747 7748 // Animate to the value specified 7749 .end().animate( { opacity: to }, speed, easing, callback ); 7750 }, 7751 animate: function( prop, speed, easing, callback ) { 7752 var empty = jQuery.isEmptyObject( prop ), 7753 optall = jQuery.speed( speed, easing, callback ), 7754 doAnimation = function() { 7755 7756 // Operate on a copy of prop so per-property easing won't be lost 7757 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 7758 7759 // Empty animations, or finishing resolves immediately 7760 if ( empty || dataPriv.get( this, "finish" ) ) { 7761 anim.stop( true ); 7762 } 7763 }; 7764 doAnimation.finish = doAnimation; 7765 7766 return empty || optall.queue === false ? 7767 this.each( doAnimation ) : 7768 this.queue( optall.queue, doAnimation ); 7769 }, 7770 stop: function( type, clearQueue, gotoEnd ) { 7771 var stopQueue = function( hooks ) { 7772 var stop = hooks.stop; 7773 delete hooks.stop; 7774 stop( gotoEnd ); 7775 }; 7776 7777 if ( typeof type !== "string" ) { 7778 gotoEnd = clearQueue; 7779 clearQueue = type; 7780 type = undefined; 7781 } 7782 if ( clearQueue ) { 7783 this.queue( type || "fx", [] ); 7784 } 7785 7786 return this.each( function() { 7787 var dequeue = true, 7788 index = type != null && type + "queueHooks", 7789 timers = jQuery.timers, 7790 data = dataPriv.get( this ); 7791 7792 if ( index ) { 7793 if ( data[ index ] && data[ index ].stop ) { 7794 stopQueue( data[ index ] ); 7795 } 7796 } else { 7797 for ( index in data ) { 7798 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 7799 stopQueue( data[ index ] ); 7800 } 7801 } 7802 } 7803 7804 for ( index = timers.length; index--; ) { 7805 if ( timers[ index ].elem === this && 7806 ( type == null || timers[ index ].queue === type ) ) { 7807 7808 timers[ index ].anim.stop( gotoEnd ); 7809 dequeue = false; 7810 timers.splice( index, 1 ); 7811 } 7812 } 7813 7814 // Start the next in the queue if the last step wasn't forced. 7815 // Timers currently will call their complete callbacks, which 7816 // will dequeue but only if they were gotoEnd. 7817 if ( dequeue || !gotoEnd ) { 7818 jQuery.dequeue( this, type ); 7819 } 7820 } ); 7821 }, 7822 finish: function( type ) { 7823 if ( type !== false ) { 7824 type = type || "fx"; 7825 } 7826 return this.each( function() { 7827 var index, 7828 data = dataPriv.get( this ), 7829 queue = data[ type + "queue" ], 7830 hooks = data[ type + "queueHooks" ], 7831 timers = jQuery.timers, 7832 length = queue ? queue.length : 0; 7833 7834 // Enable finishing flag on private data 7835 data.finish = true; 7836 7837 // Empty the queue first 7838 jQuery.queue( this, type, [] ); 7839 7840 if ( hooks && hooks.stop ) { 7841 hooks.stop.call( this, true ); 7842 } 7843 7844 // Look for any active animations, and finish them 7845 for ( index = timers.length; index--; ) { 7846 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 7847 timers[ index ].anim.stop( true ); 7848 timers.splice( index, 1 ); 7849 } 7850 } 7851 7852 // Look for any animations in the old queue and finish them 7853 for ( index = 0; index < length; index++ ) { 7854 if ( queue[ index ] && queue[ index ].finish ) { 7855 queue[ index ].finish.call( this ); 7856 } 7857 } 7858 7859 // Turn off finishing flag 7860 delete data.finish; 7861 } ); 7862 } 7863 } ); 7864 7865 jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 7866 var cssFn = jQuery.fn[ name ]; 7867 jQuery.fn[ name ] = function( speed, easing, callback ) { 7868 return speed == null || typeof speed === "boolean" ? 7869 cssFn.apply( this, arguments ) : 7870 this.animate( genFx( name, true ), speed, easing, callback ); 7871 }; 7872 } ); 7873 7874// Generate shortcuts for custom animations 7875 jQuery.each( { 7876 slideDown: genFx( "show" ), 7877 slideUp: genFx( "hide" ), 7878 slideToggle: genFx( "toggle" ), 7879 fadeIn: { opacity: "show" }, 7880 fadeOut: { opacity: "hide" }, 7881 fadeToggle: { opacity: "toggle" } 7882 }, function( name, props ) { 7883 jQuery.fn[ name ] = function( speed, easing, callback ) { 7884 return this.animate( props, speed, easing, callback ); 7885 }; 7886 } ); 7887 7888 jQuery.timers = []; 7889 jQuery.fx.tick = function() { 7890 var timer, 7891 i = 0, 7892 timers = jQuery.timers; 7893 7894 fxNow = Date.now(); 7895 7896 for ( ; i < timers.length; i++ ) { 7897 timer = timers[ i ]; 7898 7899 // Run the timer and safely remove it when done (allowing for external removal) 7900 if ( !timer() && timers[ i ] === timer ) { 7901 timers.splice( i--, 1 ); 7902 } 7903 } 7904 7905 if ( !timers.length ) { 7906 jQuery.fx.stop(); 7907 } 7908 fxNow = undefined; 7909 }; 7910 7911 jQuery.fx.timer = function( timer ) { 7912 jQuery.timers.push( timer ); 7913 jQuery.fx.start(); 7914 }; 7915 7916 jQuery.fx.interval = 13; 7917 jQuery.fx.start = function() { 7918 if ( inProgress ) { 7919 return; 7920 } 7921 7922 inProgress = true; 7923 schedule(); 7924 }; 7925 7926 jQuery.fx.stop = function() { 7927 inProgress = null; 7928 }; 7929 7930 jQuery.fx.speeds = { 7931 slow: 600, 7932 fast: 200, 7933 7934 // Default speed 7935 _default: 400 7936 }; 7937 7938 7939// Based off of the plugin by Clint Helfers, with permission. 7940// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 7941 jQuery.fn.delay = function( time, type ) { 7942 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 7943 type = type || "fx"; 7944 7945 return this.queue( type, function( next, hooks ) { 7946 var timeout = window.setTimeout( next, time ); 7947 hooks.stop = function() { 7948 window.clearTimeout( timeout ); 7949 }; 7950 } ); 7951 }; 7952 7953 7954 ( function() { 7955 var input = document.createElement( "input" ), 7956 select = document.createElement( "select" ), 7957 opt = select.appendChild( document.createElement( "option" ) ); 7958 7959 input.type = "checkbox"; 7960 7961 // Support: Android <=4.3 only 7962 // Default value for a checkbox should be "on" 7963 support.checkOn = input.value !== ""; 7964 7965 // Support: IE <=11 only 7966 // Must access selectedIndex to make default options select 7967 support.optSelected = opt.selected; 7968 7969 // Support: IE <=11 only 7970 // An input loses its value after becoming a radio 7971 input = document.createElement( "input" ); 7972 input.value = "t"; 7973 input.type = "radio"; 7974 support.radioValue = input.value === "t"; 7975 } )(); 7976 7977 7978 var boolHook, 7979 attrHandle = jQuery.expr.attrHandle; 7980 7981 jQuery.fn.extend( { 7982 attr: function( name, value ) { 7983 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 7984 }, 7985 7986 removeAttr: function( name ) { 7987 return this.each( function() { 7988 jQuery.removeAttr( this, name ); 7989 } ); 7990 } 7991 } ); 7992 7993 jQuery.extend( { 7994 attr: function( elem, name, value ) { 7995 var ret, hooks, 7996 nType = elem.nodeType; 7997 7998 // Don't get/set attributes on text, comment and attribute nodes 7999 if ( nType === 3 || nType === 8 || nType === 2 ) { 8000 return; 8001 } 8002 8003 // Fallback to prop when attributes are not supported 8004 if ( typeof elem.getAttribute === "undefined" ) { 8005 return jQuery.prop( elem, name, value ); 8006 } 8007 8008 // Attribute hooks are determined by the lowercase version 8009 // Grab necessary hook if one is defined 8010 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8011 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 8012 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 8013 } 8014 8015 if ( value !== undefined ) { 8016 if ( value === null ) { 8017 jQuery.removeAttr( elem, name ); 8018 return; 8019 } 8020 8021 if ( hooks && "set" in hooks && 8022 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8023 return ret; 8024 } 8025 8026 elem.setAttribute( name, value + "" ); 8027 return value; 8028 } 8029 8030 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8031 return ret; 8032 } 8033 8034 ret = jQuery.find.attr( elem, name ); 8035 8036 // Non-existent attributes return null, we normalize to undefined 8037 return ret == null ? undefined : ret; 8038 }, 8039 8040 attrHooks: { 8041 type: { 8042 set: function( elem, value ) { 8043 if ( !support.radioValue && value === "radio" && 8044 nodeName( elem, "input" ) ) { 8045 var val = elem.value; 8046 elem.setAttribute( "type", value ); 8047 if ( val ) { 8048 elem.value = val; 8049 } 8050 return value; 8051 } 8052 } 8053 } 8054 }, 8055 8056 removeAttr: function( elem, value ) { 8057 var name, 8058 i = 0, 8059 8060 // Attribute names can contain non-HTML whitespace characters 8061 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 8062 attrNames = value && value.match( rnothtmlwhite ); 8063 8064 if ( attrNames && elem.nodeType === 1 ) { 8065 while ( ( name = attrNames[ i++ ] ) ) { 8066 elem.removeAttribute( name ); 8067 } 8068 } 8069 } 8070 } ); 8071 8072// Hooks for boolean attributes 8073 boolHook = { 8074 set: function( elem, value, name ) { 8075 if ( value === false ) { 8076 8077 // Remove boolean attributes when set to false 8078 jQuery.removeAttr( elem, name ); 8079 } else { 8080 elem.setAttribute( name, name ); 8081 } 8082 return name; 8083 } 8084 }; 8085 8086 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 8087 var getter = attrHandle[ name ] || jQuery.find.attr; 8088 8089 attrHandle[ name ] = function( elem, name, isXML ) { 8090 var ret, handle, 8091 lowercaseName = name.toLowerCase(); 8092 8093 if ( !isXML ) { 8094 8095 // Avoid an infinite loop by temporarily removing this function from the getter 8096 handle = attrHandle[ lowercaseName ]; 8097 attrHandle[ lowercaseName ] = ret; 8098 ret = getter( elem, name, isXML ) != null ? 8099 lowercaseName : 8100 null; 8101 attrHandle[ lowercaseName ] = handle; 8102 } 8103 return ret; 8104 }; 8105 } ); 8106 8107 8108 8109 8110 var rfocusable = /^(?:input|select|textarea|button)$/i, 8111 rclickable = /^(?:a|area)$/i; 8112 8113 jQuery.fn.extend( { 8114 prop: function( name, value ) { 8115 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 8116 }, 8117 8118 removeProp: function( name ) { 8119 return this.each( function() { 8120 delete this[ jQuery.propFix[ name ] || name ]; 8121 } ); 8122 } 8123 } ); 8124 8125 jQuery.extend( { 8126 prop: function( elem, name, value ) { 8127 var ret, hooks, 8128 nType = elem.nodeType; 8129 8130 // Don't get/set properties on text, comment and attribute nodes 8131 if ( nType === 3 || nType === 8 || nType === 2 ) { 8132 return; 8133 } 8134 8135 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8136 8137 // Fix name and attach hooks 8138 name = jQuery.propFix[ name ] || name; 8139 hooks = jQuery.propHooks[ name ]; 8140 } 8141 8142 if ( value !== undefined ) { 8143 if ( hooks && "set" in hooks && 8144 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8145 return ret; 8146 } 8147 8148 return ( elem[ name ] = value ); 8149 } 8150 8151 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8152 return ret; 8153 } 8154 8155 return elem[ name ]; 8156 }, 8157 8158 propHooks: { 8159 tabIndex: { 8160 get: function( elem ) { 8161
vendor: 16,418 bytes, lines 8162-8650
8162 // Support: IE <=9 - 11 only 8163 // elem.tabIndex doesn't always return the 8164 // correct value when it hasn't been explicitly set 8165 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 8166 // Use proper attribute retrieval(#12072) 8167 var tabindex = jQuery.find.attr( elem, "tabindex" ); 8168 8169 if ( tabindex ) { 8170 return parseInt( tabindex, 10 ); 8171 } 8172 8173 if ( 8174 rfocusable.test( elem.nodeName ) || 8175 rclickable.test( elem.nodeName ) && 8176 elem.href 8177 ) { 8178 return 0; 8179 } 8180 8181 return -1; 8182 } 8183 } 8184 }, 8185 8186 propFix: { 8187 "for": "htmlFor", 8188 "class": "className" 8189 } 8190 } ); 8191 8192// Support: IE <=11 only 8193// Accessing the selectedIndex property 8194// forces the browser to respect setting selected 8195// on the option 8196// The getter ensures a default option is selected 8197// when in an optgroup 8198// eslint rule "no-unused-expressions" is disabled for this code 8199// since it considers such accessions noop 8200 if ( !support.optSelected ) { 8201 jQuery.propHooks.selected = { 8202 get: function( elem ) { 8203 8204 /* eslint no-unused-expressions: "off" */ 8205 8206 var parent = elem.parentNode; 8207 if ( parent && parent.parentNode ) { 8208 parent.parentNode.selectedIndex; 8209 } 8210 return null; 8211 }, 8212 set: function( elem ) { 8213 8214 /* eslint no-unused-expressions: "off" */ 8215 8216 var parent = elem.parentNode; 8217 if ( parent ) { 8218 parent.selectedIndex; 8219 8220 if ( parent.parentNode ) { 8221 parent.parentNode.selectedIndex; 8222 } 8223 } 8224 } 8225 }; 8226 } 8227 8228 jQuery.each( [ 8229 "tabIndex", 8230 "readOnly", 8231 "maxLength", 8232 "cellSpacing", 8233 "cellPadding", 8234 "rowSpan", 8235 "colSpan", 8236 "useMap", 8237 "frameBorder", 8238 "contentEditable" 8239 ], function() { 8240 jQuery.propFix[ this.toLowerCase() ] = this; 8241 } ); 8242 8243 8244 8245 8246 // Strip and collapse whitespace according to HTML spec 8247 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 8248 function stripAndCollapse( value ) { 8249 var tokens = value.match( rnothtmlwhite ) || []; 8250 return tokens.join( " " ); 8251 } 8252 8253 8254 function getClass( elem ) { 8255 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 8256 } 8257 8258 function classesToArray( value ) { 8259 if ( Array.isArray( value ) ) { 8260 return value; 8261 } 8262 if ( typeof value === "string" ) { 8263 return value.match( rnothtmlwhite ) || []; 8264 } 8265 return []; 8266 } 8267 8268 jQuery.fn.extend( { 8269 addClass: function( value ) { 8270 var classes, elem, cur, curValue, clazz, j, finalValue, 8271 i = 0; 8272 8273 if ( isFunction( value ) ) { 8274 return this.each( function( j ) { 8275 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 8276 } ); 8277 } 8278 8279 classes = classesToArray( value ); 8280 8281 if ( classes.length ) { 8282 while ( ( elem = this[ i++ ] ) ) { 8283 curValue = getClass( elem ); 8284 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8285 8286 if ( cur ) { 8287 j = 0; 8288 while ( ( clazz = classes[ j++ ] ) ) { 8289 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 8290 cur += clazz + " "; 8291 } 8292 } 8293 8294 // Only assign if different to avoid unneeded rendering. 8295 finalValue = stripAndCollapse( cur ); 8296 if ( curValue !== finalValue ) { 8297 elem.setAttribute( "class", finalValue ); 8298 } 8299 } 8300 } 8301 } 8302 8303 return this; 8304 }, 8305 8306 removeClass: function( value ) { 8307 var classes, elem, cur, curValue, clazz, j, finalValue, 8308 i = 0; 8309 8310 if ( isFunction( value ) ) { 8311 return this.each( function( j ) { 8312 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 8313 } ); 8314 } 8315 8316 if ( !arguments.length ) { 8317 return this.attr( "class", "" ); 8318 } 8319 8320 classes = classesToArray( value ); 8321 8322 if ( classes.length ) { 8323 while ( ( elem = this[ i++ ] ) ) { 8324 curValue = getClass( elem ); 8325 8326 // This expression is here for better compressibility (see addClass) 8327 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 8328 8329 if ( cur ) { 8330 j = 0; 8331 while ( ( clazz = classes[ j++ ] ) ) { 8332 8333 // Remove *all* instances 8334 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 8335 cur = cur.replace( " " + clazz + " ", " " ); 8336 } 8337 } 8338 8339 // Only assign if different to avoid unneeded rendering. 8340 finalValue = stripAndCollapse( cur ); 8341 if ( curValue !== finalValue ) { 8342 elem.setAttribute( "class", finalValue ); 8343 } 8344 } 8345 } 8346 } 8347 8348 return this; 8349 }, 8350 8351 toggleClass: function( value, stateVal ) { 8352 var type = typeof value, 8353 isValidValue = type === "string" || Array.isArray( value ); 8354 8355 if ( typeof stateVal === "boolean" && isValidValue ) { 8356 return stateVal ? this.addClass( value ) : this.removeClass( value ); 8357 } 8358 8359 if ( isFunction( value ) ) { 8360 return this.each( function( i ) { 8361 jQuery( this ).toggleClass( 8362 value.call( this, i, getClass( this ), stateVal ), 8363 stateVal 8364 ); 8365 } ); 8366 } 8367 8368 return this.each( function() { 8369 var className, i, self, classNames; 8370 8371 if ( isValidValue ) { 8372 8373 // Toggle individual class names 8374 i = 0; 8375 self = jQuery( this ); 8376 classNames = classesToArray( value ); 8377 8378 while ( ( className = classNames[ i++ ] ) ) { 8379 8380 // Check each className given, space separated list 8381 if ( self.hasClass( className ) ) { 8382 self.removeClass( className ); 8383 } else { 8384 self.addClass( className ); 8385 } 8386 } 8387 8388 // Toggle whole class name 8389 } else if ( value === undefined || type === "boolean" ) { 8390 className = getClass( this ); 8391 if ( className ) { 8392 8393 // Store className if set 8394 dataPriv.set( this, "__className__", className ); 8395 } 8396 8397 // If the element has a class name or if we're passed `false`, 8398 // then remove the whole classname (if there was one, the above saved it). 8399 // Otherwise bring back whatever was previously saved (if anything), 8400 // falling back to the empty string if nothing was stored. 8401 if ( this.setAttribute ) { 8402 this.setAttribute( "class", 8403 className || value === false ? 8404 "" : 8405 dataPriv.get( this, "__className__" ) || "" 8406 ); 8407 } 8408 } 8409 } ); 8410 }, 8411 8412 hasClass: function( selector ) { 8413 var className, elem, 8414 i = 0; 8415 8416 className = " " + selector + " "; 8417 while ( ( elem = this[ i++ ] ) ) { 8418 if ( elem.nodeType === 1 && 8419 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 8420 return true; 8421 } 8422 } 8423 8424 return false; 8425 } 8426 } ); 8427 8428 8429 8430 8431 var rreturn = /\r/g; 8432 8433 jQuery.fn.extend( { 8434 val: function( value ) { 8435 var hooks, ret, valueIsFunction, 8436 elem = this[ 0 ]; 8437 8438 if ( !arguments.length ) { 8439 if ( elem ) { 8440 hooks = jQuery.valHooks[ elem.type ] || 8441 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 8442 8443 if ( hooks && 8444 "get" in hooks && 8445 ( ret = hooks.get( elem, "value" ) ) !== undefined 8446 ) { 8447 return ret; 8448 } 8449 8450 ret = elem.value; 8451 8452 // Handle most common string cases 8453 if ( typeof ret === "string" ) { 8454 return ret.replace( rreturn, "" ); 8455 } 8456 8457 // Handle cases where value is null/undef or number 8458 return ret == null ? "" : ret; 8459 } 8460 8461 return; 8462 } 8463 8464 valueIsFunction = isFunction( value ); 8465 8466 return this.each( function( i ) { 8467 var val; 8468 8469 if ( this.nodeType !== 1 ) { 8470 return; 8471 } 8472 8473 if ( valueIsFunction ) { 8474 val = value.call( this, i, jQuery( this ).val() ); 8475 } else { 8476 val = value; 8477 } 8478 8479 // Treat null/undefined as ""; convert numbers to string 8480 if ( val == null ) { 8481 val = ""; 8482 8483 } else if ( typeof val === "number" ) { 8484 val += ""; 8485 8486 } else if ( Array.isArray( val ) ) { 8487 val = jQuery.map( val, function( value ) { 8488 return value == null ? "" : value + ""; 8489 } ); 8490 } 8491 8492 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 8493 8494 // If set returns undefined, fall back to normal setting 8495 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 8496 this.value = val; 8497 } 8498 } ); 8499 } 8500 } ); 8501 8502 jQuery.extend( { 8503 valHooks: { 8504 option: { 8505 get: function( elem ) { 8506 8507 var val = jQuery.find.attr( elem, "value" ); 8508 return val != null ? 8509 val : 8510 8511 // Support: IE <=10 - 11 only 8512 // option.text throws exceptions (#14686, #14858) 8513 // Strip and collapse whitespace 8514 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8515 stripAndCollapse( jQuery.text( elem ) ); 8516 } 8517 }, 8518 select: { 8519 get: function( elem ) { 8520 var value, option, i, 8521 options = elem.options, 8522 index = elem.selectedIndex, 8523 one = elem.type === "select-one", 8524 values = one ? null : [], 8525 max = one ? index + 1 : options.length; 8526 8527 if ( index < 0 ) { 8528 i = max; 8529 8530 } else { 8531 i = one ? index : 0; 8532 } 8533 8534 // Loop through all the selected options 8535 for ( ; i < max; i++ ) { 8536 option = options[ i ]; 8537 8538 // Support: IE <=9 only 8539 // IE8-9 doesn't update selected after form reset (#2551) 8540 if ( ( option.selected || i === index ) && 8541 8542 // Don't return options that are disabled or in a disabled optgroup 8543 !option.disabled && 8544 ( !option.parentNode.disabled || 8545 !nodeName( option.parentNode, "optgroup" ) ) ) { 8546 8547 // Get the specific value for the option 8548 value = jQuery( option ).val(); 8549 8550 // We don't need an array for one selects 8551 if ( one ) { 8552 return value; 8553 } 8554 8555 // Multi-Selects return an array 8556 values.push( value ); 8557 } 8558 } 8559 8560 return values; 8561 }, 8562 8563 set: function( elem, value ) { 8564 var optionSet, option, 8565 options = elem.options, 8566 values = jQuery.makeArray( value ), 8567 i = options.length; 8568 8569 while ( i-- ) { 8570 option = options[ i ]; 8571 8572 /* eslint-disable no-cond-assign */ 8573 8574 if ( option.selected = 8575 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 8576 ) { 8577 optionSet = true; 8578 } 8579 8580 /* eslint-enable no-cond-assign */ 8581 } 8582 8583 // Force browsers to behave consistently when non-matching value is set 8584 if ( !optionSet ) { 8585 elem.selectedIndex = -1; 8586 } 8587 return values; 8588 } 8589 } 8590 } 8591 } ); 8592 8593// Radios and checkboxes getter/setter 8594 jQuery.each( [ "radio", "checkbox" ], function() { 8595 jQuery.valHooks[ this ] = { 8596 set: function( elem, value ) { 8597 if ( Array.isArray( value ) ) { 8598 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 8599 } 8600 } 8601 }; 8602 if ( !support.checkOn ) { 8603 jQuery.valHooks[ this ].get = function( elem ) { 8604 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 8605 }; 8606 } 8607 } ); 8608 8609 8610 8611 8612// Return jQuery for attributes-only inclusion 8613 8614 8615 support.focusin = "onfocusin" in window; 8616 8617 8618 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 8619 stopPropagationCallback = function( e ) { 8620 e.stopPropagation(); 8621 }; 8622 8623 jQuery.extend( jQuery.event, { 8624 8625 trigger: function( event, data, elem, onlyHandlers ) { 8626 8627 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 8628 eventPath = [ elem || document ], 8629 type = hasOwn.call( event, "type" ) ? event.type : event, 8630 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 8631 8632 cur = lastElement = tmp = elem = elem || document; 8633 8634 // Don't do events on text and comment nodes 8635 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 8636 return; 8637 } 8638 8639 // focus/blur morphs to focusin/out; ensure we're not firing them right now 8640 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 8641 return; 8642 } 8643 8644 if ( type.indexOf( "." ) > -1 ) { 8645 8646 // Namespaced trigger; create a regexp to match event type in handle() 8647 namespaces = type.split( "." ); 8648 type = namespaces.shift(); 8649 namespaces.sort(); 8650 }
vendor: 5,833 bytes, lines 8651-8806
8651 ontype = type.indexOf( ":" ) < 0 && "on" + type; 8652 8653 // Caller can pass in a jQuery.Event object, Object, or just an event type string 8654 event = event[ jQuery.expando ] ? 8655 event : 8656 new jQuery.Event( type, typeof event === "object" && event ); 8657 8658 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 8659 event.isTrigger = onlyHandlers ? 2 : 3; 8660 event.namespace = namespaces.join( "." ); 8661 event.rnamespace = event.namespace ? 8662 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 8663 null; 8664 8665 // Clean up the event in case it is being reused 8666 event.result = undefined; 8667 if ( !event.target ) { 8668 event.target = elem; 8669 } 8670 8671 // Clone any incoming data and prepend the event, creating the handler arg list 8672 data = data == null ? 8673 [ event ] : 8674 jQuery.makeArray( data, [ event ] ); 8675 8676 // Allow special events to draw outside the lines 8677 special = jQuery.event.special[ type ] || {}; 8678 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 8679 return; 8680 } 8681 8682 // Determine event propagation path in advance, per W3C events spec (#9951) 8683 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 8684 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 8685 8686 bubbleType = special.delegateType || type; 8687 if ( !rfocusMorph.test( bubbleType + type ) ) { 8688 cur = cur.parentNode; 8689 } 8690 for ( ; cur; cur = cur.parentNode ) { 8691 eventPath.push( cur ); 8692 tmp = cur; 8693 } 8694 8695 // Only add window if we got to document (e.g., not plain obj or detached DOM) 8696 if ( tmp === ( elem.ownerDocument || document ) ) { 8697 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 8698 } 8699 } 8700 8701 // Fire handlers on the event path 8702 i = 0; 8703 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 8704 lastElement = cur; 8705 event.type = i > 1 ? 8706 bubbleType : 8707 special.bindType || type; 8708 8709 // jQuery handler 8710 handle = ( 8711 dataPriv.get( cur, "events" ) || Object.create( null ) 8712 )[ event.type ] && 8713 dataPriv.get( cur, "handle" ); 8714 if ( handle ) { 8715 handle.apply( cur, data ); 8716 } 8717 8718 // Native handler 8719 handle = ontype && cur[ ontype ]; 8720 if ( handle && handle.apply && acceptData( cur ) ) { 8721 event.result = handle.apply( cur, data ); 8722 if ( event.result === false ) { 8723 event.preventDefault(); 8724 } 8725 } 8726 } 8727 event.type = type; 8728 8729 // If nobody prevented the default action, do it now 8730 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 8731 8732 if ( ( !special._default || 8733 special._default.apply( eventPath.pop(), data ) === false ) && 8734 acceptData( elem ) ) { 8735 8736 // Call a native DOM method on the target with the same name as the event. 8737 // Don't do default actions on window, that's where global variables be (#6170) 8738 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 8739 8740 // Don't re-trigger an onFOO event when we call its FOO() method 8741 tmp = elem[ ontype ]; 8742 8743 if ( tmp ) { 8744 elem[ ontype ] = null; 8745 } 8746 8747 // Prevent re-triggering of the same event, since we already bubbled it above 8748 jQuery.event.triggered = type; 8749 8750 if ( event.isPropagationStopped() ) { 8751 lastElement.addEventListener( type, stopPropagationCallback ); 8752 } 8753 8754 elem[ type ](); 8755 8756 if ( event.isPropagationStopped() ) { 8757 lastElement.removeEventListener( type, stopPropagationCallback ); 8758 } 8759 8760 jQuery.event.triggered = undefined; 8761 8762 if ( tmp ) { 8763 elem[ ontype ] = tmp; 8764 } 8765 } 8766 } 8767 } 8768 8769 return event.result; 8770 }, 8771 8772 // Piggyback on a donor event to simulate a different one 8773 // Used only for `focus(in | out)` events 8774 simulate: function( type, elem, event ) { 8775 var e = jQuery.extend( 8776 new jQuery.Event(), 8777 event, 8778 { 8779 type: type, 8780 isSimulated: true 8781 } 8782 ); 8783 8784 jQuery.event.trigger( e, null, elem ); 8785 } 8786 8787 } ); 8788 8789 jQuery.fn.extend( { 8790 8791 trigger: function( type, data ) { 8792 return this.each( function() { 8793 jQuery.event.trigger( type, data, this ); 8794 } ); 8795 }, 8796 triggerHandler: function( type, data ) { 8797 var elem = this[ 0 ]; 8798 if ( elem ) { 8799 return jQuery.event.trigger( type, data, elem, true ); 8800 } 8801 } 8802 } ); 8803 8804 8805// Support: Firefox <=44 8806// Firefox doesn't have focus(in | out) events
vendor: 5,764 bytes, lines 8807-8978
8807// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 8808// 8809// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 8810// focus(in | out) events fire after focus & blur events, 8811// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 8812// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 8813 if ( !support.focusin ) { 8814 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 8815 8816 // Attach a single capturing handler on the document while someone wants focusin/focusout 8817 var handler = function( event ) { 8818 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 8819 }; 8820 8821 jQuery.event.special[ fix ] = { 8822 setup: function() { 8823 8824 // Handle: regular nodes (via `this.ownerDocument`), window 8825 // (via `this.document`) & document (via `this`). 8826 var doc = this.ownerDocument || this.document || this, 8827 attaches = dataPriv.access( doc, fix ); 8828 8829 if ( !attaches ) { 8830 doc.addEventListener( orig, handler, true ); 8831 } 8832 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 8833 }, 8834 teardown: function() { 8835 var doc = this.ownerDocument || this.document || this, 8836 attaches = dataPriv.access( doc, fix ) - 1; 8837 8838 if ( !attaches ) { 8839 doc.removeEventListener( orig, handler, true ); 8840 dataPriv.remove( doc, fix ); 8841 8842 } else { 8843 dataPriv.access( doc, fix, attaches ); 8844 } 8845 } 8846 }; 8847 } ); 8848 } 8849 var location = window.location; 8850 8851 var nonce = { guid: Date.now() }; 8852 8853 var rquery = ( /\?/ ); 8854 8855 8856 8857// Cross-browser xml parsing 8858 jQuery.parseXML = function( data ) { 8859 var xml; 8860 if ( !data || typeof data !== "string" ) { 8861 return null; 8862 } 8863 8864 // Support: IE 9 - 11 only 8865 // IE throws on parseFromString with invalid input. 8866 try { 8867 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 8868 } catch ( e ) { 8869 xml = undefined; 8870 } 8871 8872 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 8873 jQuery.error( "Invalid XML: " + data ); 8874 } 8875 return xml; 8876 }; 8877 8878 8879 var 8880 rbracket = /\[\]$/, 8881 rCRLF = /\r?\n/g, 8882 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8883 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8884 8885 function buildParams( prefix, obj, traditional, add ) { 8886 var name; 8887 8888 if ( Array.isArray( obj ) ) { 8889 8890 // Serialize array item. 8891 jQuery.each( obj, function( i, v ) { 8892 if ( traditional || rbracket.test( prefix ) ) { 8893 8894 // Treat each array item as a scalar. 8895 add( prefix, v ); 8896 8897 } else { 8898 8899 // Item is non-scalar (array or object), encode its numeric index. 8900 buildParams( 8901 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 8902 v, 8903 traditional, 8904 add 8905 ); 8906 } 8907 } ); 8908 8909 } else if ( !traditional && toType( obj ) === "object" ) { 8910 8911 // Serialize object item. 8912 for ( name in obj ) { 8913 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8914 } 8915 8916 } else { 8917 8918 // Serialize scalar item. 8919 add( prefix, obj ); 8920 } 8921 } 8922 8923// Serialize an array of form elements or a set of 8924// key/values into a query string 8925 jQuery.param = function( a, traditional ) { 8926 var prefix, 8927 s = [], 8928 add = function( key, valueOrFunction ) { 8929 8930 // If value is a function, invoke it and use its return value 8931 var value = isFunction( valueOrFunction ) ? 8932 valueOrFunction() : 8933 valueOrFunction; 8934 8935 s[ s.length ] = encodeURIComponent( key ) + "=" + 8936 encodeURIComponent( value == null ? "" : value ); 8937 }; 8938 8939 if ( a == null ) { 8940 return ""; 8941 } 8942 8943 // If an array was passed in, assume that it is an array of form elements. 8944 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 8945 8946 // Serialize the form elements 8947 jQuery.each( a, function() { 8948 add( this.name, this.value ); 8949 } ); 8950 8951 } else { 8952 8953 // If traditional, encode the "old" way (the way 1.3.2 or older 8954 // did it), otherwise encode params recursively. 8955 for ( prefix in a ) { 8956 buildParams( prefix, a[ prefix ], traditional, add ); 8957 } 8958 } 8959 8960 // Return the resulting serialization 8961 return s.join( "&" ); 8962 }; 8963 8964 jQuery.fn.extend( { 8965 serialize: function() { 8966 return jQuery.param( this.serializeArray() ); 8967 }, 8968 serializeArray: function() { 8969 return this.map( function() { 8970 8971 // Can add propHook for "elements" to filter or add form elements 8972 var elements = jQuery.prop( this, "elements" ); 8973 return elements ? jQuery.makeArray( elements ) : this; 8974 } ) 8975 .filter( function() { 8976 var type = this.type; 8977 8978 // Use .is( ":disabled" ) so that fieldset[disabled] w
vendor: 4,204 bytes, lines 8978-9088
8978orks 8979 return this.name && !jQuery( this ).is( ":disabled" ) && 8980 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 8981 ( this.checked || !rcheckableType.test( type ) ); 8982 } ) 8983 .map( function( _i, elem ) { 8984 var val = jQuery( this ).val(); 8985 8986 if ( val == null ) { 8987 return null; 8988 } 8989 8990 if ( Array.isArray( val ) ) { 8991 return jQuery.map( val, function( val ) { 8992 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8993 } ); 8994 } 8995 8996 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8997 } ).get(); 8998 } 8999 } ); 9000 9001 9002 var 9003 r20 = /%20/g, 9004 rhash = /#.*$/, 9005 rantiCache = /([?&])_=[^&]*/, 9006 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 9007 9008 // #7653, #8125, #8152: local protocol detection 9009 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 9010 rnoContent = /^(?:GET|HEAD)$/, 9011 rprotocol = /^\/\//, 9012 9013 /* Prefilters 9014 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 9015 * 2) These are called: 9016 * - BEFORE asking for a transport 9017 * - AFTER param serialization (s.data is a string if s.processData is true) 9018 * 3) key is the dataType 9019 * 4) the catchall symbol "*" can be used 9020 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 9021 */ 9022 prefilters = {}, 9023 9024 /* Transports bindings 9025 * 1) key is the dataType 9026 * 2) the catchall symbol "*" can be used 9027 * 3) selection will start with transport dataType and THEN go to "*" if needed 9028 */ 9029 transports = {}, 9030 9031 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 9032 allTypes = "*/".concat( "*" ), 9033 9034 // Anchor tag for parsing the document origin 9035 originAnchor = document.createElement( "a" ); 9036 originAnchor.href = location.href; 9037 9038// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 9039 function addToPrefiltersOrTransports( structure ) { 9040 9041 // dataTypeExpression is optional and defaults to "*" 9042 return function( dataTypeExpression, func ) { 9043 9044 if ( typeof dataTypeExpression !== "string" ) { 9045 func = dataTypeExpression; 9046 dataTypeExpression = "*"; 9047 } 9048 9049 var dataType, 9050 i = 0, 9051 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 9052 9053 if ( isFunction( func ) ) { 9054 9055 // For each dataType in the dataTypeExpression 9056 while ( ( dataType = dataTypes[ i++ ] ) ) { 9057 9058 // Prepend if requested 9059 if ( dataType[ 0 ] === "+" ) { 9060 dataType = dataType.slice( 1 ) || "*"; 9061 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 9062 9063 // Otherwise append 9064 } else { 9065 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 9066 } 9067 } 9068 } 9069 }; 9070 } 9071 9072// Base inspection function for prefilters and transports 9073 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 9074 9075 var inspected = {}, 9076 seekingTransport = ( structure === transports ); 9077 9078 function inspect( dataType ) { 9079 var selected; 9080 inspected[ dataType ] = true; 9081 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 9082 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 9083 if ( typeof dataTypeOrTransport === "string" && 9084 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 9085 9086 options.dataTypes.unshift( dataTypeOrTransport ); 9087 inspect( dataTypeOrTransport ); 9088 return false;
vendor: 15,305 bytes, lines 9089-9526
9089 } else if ( seekingTransport ) { 9090 return !( selected = dataTypeOrTransport ); 9091 } 9092 } ); 9093 return selected; 9094 } 9095 9096 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 9097 } 9098 9099// A special extend for ajax options 9100// that takes "flat" options (not to be deep extended) 9101// Fixes #9887 9102 function ajaxExtend( target, src ) { 9103 var key, deep, 9104 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 9105 9106 for ( key in src ) { 9107 if ( src[ key ] !== undefined ) { 9108 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 9109 } 9110 } 9111 if ( deep ) { 9112 jQuery.extend( true, target, deep ); 9113 } 9114 9115 return target; 9116 } 9117 9118 /* Handles responses to an ajax request: 9119 * - finds the right dataType (mediates between content-type and expected dataType) 9120 * - returns the corresponding response 9121 */ 9122 function ajaxHandleResponses( s, jqXHR, responses ) { 9123 9124 var ct, type, finalDataType, firstDataType, 9125 contents = s.contents, 9126 dataTypes = s.dataTypes; 9127 9128 // Remove auto dataType and get content-type in the process 9129 while ( dataTypes[ 0 ] === "*" ) { 9130 dataTypes.shift(); 9131 if ( ct === undefined ) { 9132 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 9133 } 9134 } 9135 9136 // Check if we're dealing with a known content-type 9137 if ( ct ) { 9138 for ( type in contents ) { 9139 if ( contents[ type ] && contents[ type ].test( ct ) ) { 9140 dataTypes.unshift( type ); 9141 break; 9142 } 9143 } 9144 } 9145 9146 // Check to see if we have a response for the expected dataType 9147 if ( dataTypes[ 0 ] in responses ) { 9148 finalDataType = dataTypes[ 0 ]; 9149 } else { 9150 9151 // Try convertible dataTypes 9152 for ( type in responses ) { 9153 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 9154 finalDataType = type; 9155 break; 9156 } 9157 if ( !firstDataType ) { 9158 firstDataType = type; 9159 } 9160 } 9161 9162 // Or just use first one 9163 finalDataType = finalDataType || firstDataType; 9164 } 9165 9166 // If we found a dataType 9167 // We add the dataType to the list if needed 9168 // and return the corresponding response 9169 if ( finalDataType ) { 9170 if ( finalDataType !== dataTypes[ 0 ] ) { 9171 dataTypes.unshift( finalDataType ); 9172 } 9173 return responses[ finalDataType ]; 9174 } 9175 } 9176 9177 /* Chain conversions given the request and the original response 9178 * Also sets the responseXXX fields on the jqXHR instance 9179 */ 9180 function ajaxConvert( s, response, jqXHR, isSuccess ) { 9181 var conv2, current, conv, tmp, prev, 9182 converters = {}, 9183 9184 // Work with a copy of dataTypes in case we need to modify it for conversion 9185 dataTypes = s.dataTypes.slice(); 9186 9187 // Create converters map with lowercased keys 9188 if ( dataTypes[ 1 ] ) { 9189 for ( conv in s.converters ) { 9190 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 9191 } 9192 } 9193 9194 current = dataTypes.shift(); 9195 9196 // Convert to each sequential dataType 9197 while ( current ) { 9198 9199 if ( s.responseFields[ current ] ) { 9200 jqXHR[ s.responseFields[ current ] ] = response; 9201 } 9202 9203 // Apply the dataFilter if provided 9204 if ( !prev && isSuccess && s.dataFilter ) { 9205 response = s.dataFilter( response, s.dataType ); 9206 } 9207 9208 prev = current; 9209 current = dataTypes.shift(); 9210 9211 if ( current ) { 9212 9213 // There's only work to do if current dataType is non-auto 9214 if ( current === "*" ) { 9215 9216 current = prev; 9217 9218 // Convert response if prev dataType is non-auto and differs from current 9219 } else if ( prev !== "*" && prev !== current ) { 9220 9221 // Seek a direct converter 9222 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 9223 9224 // If none found, seek a pair 9225 if ( !conv ) { 9226 for ( conv2 in converters ) { 9227 9228 // If conv2 outputs current 9229 tmp = conv2.split( " " ); 9230 if ( tmp[ 1 ] === current ) { 9231 9232 // If prev can be converted to accepted input 9233 conv = converters[ prev + " " + tmp[ 0 ] ] || 9234 converters[ "* " + tmp[ 0 ] ]; 9235 if ( conv ) { 9236 9237 // Condense equivalence converters 9238 if ( conv === true ) { 9239 conv = converters[ conv2 ]; 9240 9241 // Otherwise, insert the intermediate dataType 9242 } else if ( converters[ conv2 ] !== true ) { 9243 current = tmp[ 0 ]; 9244 dataTypes.unshift( tmp[ 1 ] ); 9245 } 9246 break; 9247 } 9248 } 9249 } 9250 } 9251 9252 // Apply converter (if not an equivalence) 9253 if ( conv !== true ) { 9254 9255 // Unless errors are allowed to bubble, catch and return them 9256 if ( conv && s.throws ) { 9257 response = conv( response ); 9258 } else { 9259 try { 9260 response = conv( response ); 9261 } catch ( e ) { 9262 return { 9263 state: "parsererror", 9264 error: conv ? e : "No conversion from " + prev + " to " + current 9265 }; 9266 } 9267 } 9268 } 9269 } 9270 } 9271 } 9272 9273 return { state: "success", data: response }; 9274 } 9275 9276 jQuery.extend( { 9277 9278 // Counter for holding the number of active queries 9279 active: 0, 9280 9281 // Last-Modified header cache for next request 9282 lastModified: {}, 9283 etag: {}, 9284 9285 ajaxSettings: { 9286 url: location.href, 9287 type: "GET", 9288 isLocal: rlocalProtocol.test( location.protocol ), 9289 global: true, 9290 processData: true, 9291 async: true, 9292 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9293 9294 /* 9295 timeout: 0, 9296 data: null, 9297 dataType: null, 9298 username: null, 9299 password: null, 9300 cache: null, 9301 throws: false, 9302 traditional: false, 9303 headers: {}, 9304 */ 9305 9306 accepts: { 9307 "*": allTypes, 9308 text: "text/plain", 9309 html: "text/html", 9310 xml: "application/xml, text/xml", 9311 json: "application/json, text/javascript" 9312 }, 9313 9314 contents: { 9315 xml: /\bxml\b/, 9316 html: /\bhtml/, 9317 json: /\bjson\b/ 9318 }, 9319 9320 responseFields: { 9321 xml: "responseXML", 9322 text: "responseText", 9323 json: "responseJSON" 9324 }, 9325 9326 // Data converters 9327 // Keys separate source (or catchall "*") and destination types with a single space 9328 converters: { 9329 9330 // Convert anything to text 9331 "* text": String, 9332 9333 // Text to html (true = no transformation) 9334 "text html": true, 9335 9336 // Evaluate text as a json expression 9337 "text json": JSON.parse, 9338 9339 // Parse text as xml 9340 "text xml": jQuery.parseXML 9341 }, 9342 9343 // For options that shouldn't be deep extended: 9344 // you can add your own custom options here if 9345 // and when you create one that shouldn't be 9346 // deep extended (see ajaxExtend) 9347 flatOptions: { 9348 url: true, 9349 context: true 9350 } 9351 }, 9352 9353 // Creates a full fledged settings object into target 9354 // with both ajaxSettings and settings fields. 9355 // If target is omitted, writes into ajaxSettings. 9356 ajaxSetup: function( target, settings ) { 9357 return settings ? 9358 9359 // Building a settings object 9360 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 9361 9362 // Extending ajaxSettings 9363 ajaxExtend( jQuery.ajaxSettings, target ); 9364 }, 9365 9366 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 9367 ajaxTransport: addToPrefiltersOrTransports( transports ), 9368 9369 // Main method 9370 ajax: function( url, options ) { 9371 9372 // If url is an object, simulate pre-1.5 signature 9373 if ( typeof url === "object" ) { 9374 options = url; 9375 url = undefined; 9376 } 9377 9378 // Force options to be an object 9379 options = options || {}; 9380 9381 var transport, 9382 9383 // URL without anti-cache param 9384 cacheURL, 9385 9386 // Response headers 9387 responseHeadersString, 9388 responseHeaders, 9389 9390 // timeout handle 9391 timeoutTimer, 9392 9393 // Url cleanup var 9394 urlAnchor, 9395 9396 // Request state (becomes false upon send and true upon completion) 9397 completed, 9398 9399 // To know if global events are to be dispatched 9400 fireGlobals, 9401 9402 // Loop variable 9403 i, 9404 9405 // uncached part of the url 9406 uncached, 9407 9408 // Create the final options object 9409 s = jQuery.ajaxSetup( {}, options ), 9410 9411 // Callbacks context 9412 callbackContext = s.context || s, 9413 9414 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9415 globalEventContext = s.context && 9416 ( callbackContext.nodeType || callbackContext.jquery ) ? 9417 jQuery( callbackContext ) : 9418 jQuery.event, 9419 9420 // Deferreds 9421 deferred = jQuery.Deferred(), 9422 completeDeferred = jQuery.Callbacks( "once memory" ), 9423 9424 // Status-dependent callbacks 9425 statusCode = s.statusCode || {}, 9426 9427 // Headers (they are sent all at once) 9428 requestHeaders = {}, 9429 requestHeadersNames = {}, 9430 9431 // Default abort message 9432 strAbort = "canceled", 9433 9434 // Fake xhr 9435 jqXHR = { 9436 readyState: 0, 9437 9438 // Builds headers hashtable if needed 9439 getResponseHeader: function( key ) { 9440 var match; 9441 if ( completed ) { 9442 if ( !responseHeaders ) { 9443 responseHeaders = {}; 9444 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 9445 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 9446 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 9447 .concat( match[ 2 ] ); 9448 } 9449 } 9450 match = responseHeaders[ key.toLowerCase() + " " ]; 9451 } 9452 return match == null ? null : match.join( ", " ); 9453 }, 9454 9455 // Raw string 9456 getAllResponseHeaders: function() { 9457 return completed ? responseHeadersString : null; 9458 }, 9459 9460 // Caches the header 9461 setRequestHeader: function( name, value ) { 9462 if ( completed == null ) { 9463 name = requestHeadersNames[ name.toLowerCase() ] = 9464 requestHeadersNames[ name.toLowerCase() ] || name; 9465 requestHeaders[ name ] = value; 9466 } 9467 return this; 9468 }, 9469 9470 // Overrides response content-type header 9471 overrideMimeType: function( type ) { 9472 if ( completed == null ) { 9473 s.mimeType = type; 9474 } 9475 return this; 9476 }, 9477 9478 // Status-dependent callbacks 9479 statusCode: function( map ) { 9480 var code; 9481 if ( map ) { 9482 if ( completed ) { 9483 9484 // Execute the appropriate callbacks 9485 jqXHR.always( map[ jqXHR.status ] ); 9486 } else { 9487 9488 // Lazy-add the new callbacks in a way that preserves old ones 9489 for ( code in map ) { 9490 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 9491 } 9492 } 9493 } 9494 return this; 9495 }, 9496 9497 // Cancel the request 9498 abort: function( statusText ) { 9499 var finalText = statusText || strAbort; 9500 if ( transport ) { 9501 transport.abort( finalText ); 9502 } 9503 done( 0, finalText ); 9504 return this; 9505 } 9506 }; 9507 9508 // Attach deferreds 9509 deferred.promise( jqXHR ); 9510 9511 // Add protocol if not provided (prefilters might expect it) 9512 // Handle falsy url in the settings object (#10093: consistency with old signature) 9513 // We also use the url parameter if available 9514 s.url = ( ( url || s.url || location.href ) + "" ) 9515 .replace( rprotocol, location.protocol + "//" ); 9516 9517 // Alias method option to type as per ticket #12004 9518 s.type = options.method || options.type || s.method || s.type; 9519 9520 // Extract dataTypes list 9521 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 9522 9523 // A cross-domain request is in order when the origin doesn't match the current origin. 9524 if ( s.crossDomain == null ) { 9525 urlAnchor = document.createElement( "a" ); 9526
vendor: 32,436 bytes, lines 9527-10424
9527 // Support: IE <=8 - 11, Edge 12 - 15 9528 // IE throws exception on accessing the href property if url is malformed, 9529 // e.g. http://example.com:80x/ 9530 try { 9531 urlAnchor.href = s.url; 9532 9533 // Support: IE <=8 - 11 only 9534 // Anchor's host property isn't correctly set when s.url is relative 9535 urlAnchor.href = urlAnchor.href; 9536 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 9537 urlAnchor.protocol + "//" + urlAnchor.host; 9538 } catch ( e ) { 9539 9540 // If there is an error parsing the URL, assume it is crossDomain, 9541 // it can be rejected by the transport if it is invalid 9542 s.crossDomain = true; 9543 } 9544 } 9545 9546 // Convert data if not already a string 9547 if ( s.data && s.processData && typeof s.data !== "string" ) { 9548 s.data = jQuery.param( s.data, s.traditional ); 9549 } 9550 9551 // Apply prefilters 9552 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 9553 9554 // If request was aborted inside a prefilter, stop there 9555 if ( completed ) { 9556 return jqXHR; 9557 } 9558 9559 // We can fire global events as of now if asked to 9560 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 9561 fireGlobals = jQuery.event && s.global; 9562 9563 // Watch for a new set of requests 9564 if ( fireGlobals && jQuery.active++ === 0 ) { 9565 jQuery.event.trigger( "ajaxStart" ); 9566 } 9567 9568 // Uppercase the type 9569 s.type = s.type.toUpperCase(); 9570 9571 // Determine if request has content 9572 s.hasContent = !rnoContent.test( s.type ); 9573 9574 // Save the URL in case we're toying with the If-Modified-Since 9575 // and/or If-None-Match header later on 9576 // Remove hash to simplify url manipulation 9577 cacheURL = s.url.replace( rhash, "" ); 9578 9579 // More options handling for requests with no content 9580 if ( !s.hasContent ) { 9581 9582 // Remember the hash so we can put it back 9583 uncached = s.url.slice( cacheURL.length ); 9584 9585 // If data is available and should be processed, append data to url 9586 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 9587 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 9588 9589 // #9682: remove data so that it's not used in an eventual retry 9590 delete s.data; 9591 } 9592 9593 // Add or update anti-cache param if needed 9594 if ( s.cache === false ) { 9595 cacheURL = cacheURL.replace( rantiCache, "$1" ); 9596 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 9597 uncached; 9598 } 9599 9600 // Put hash and anti-cache on the URL that will be requested (gh-1732) 9601 s.url = cacheURL + uncached; 9602 9603 // Change '%20' to '+' if this is encoded form body content (gh-2658) 9604 } else if ( s.data && s.processData && 9605 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 9606 s.data = s.data.replace( r20, "+" ); 9607 } 9608 9609 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9610 if ( s.ifModified ) { 9611 if ( jQuery.lastModified[ cacheURL ] ) { 9612 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 9613 } 9614 if ( jQuery.etag[ cacheURL ] ) { 9615 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 9616 } 9617 } 9618 9619 // Set the correct header, if data is being sent 9620 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 9621 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 9622 } 9623 9624 // Set the Accepts header for the server, depending on the dataType 9625 jqXHR.setRequestHeader( 9626 "Accept", 9627 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 9628 s.accepts[ s.dataTypes[ 0 ] ] + 9629 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 9630 s.accepts[ "*" ] 9631 ); 9632 9633 // Check for headers option 9634 for ( i in s.headers ) { 9635 jqXHR.setRequestHeader( i, s.headers[ i ] ); 9636 } 9637 9638 // Allow custom headers/mimetypes and early abort 9639 if ( s.beforeSend && 9640 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 9641 9642 // Abort if not done already and return 9643 return jqXHR.abort(); 9644 } 9645 9646 // Aborting is no longer a cancellation 9647 strAbort = "abort"; 9648 9649 // Install callbacks on deferreds 9650 completeDeferred.add( s.complete ); 9651 jqXHR.done( s.success ); 9652 jqXHR.fail( s.error ); 9653 9654 // Get transport 9655 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 9656 9657 // If no transport, we auto-abort 9658 if ( !transport ) { 9659 done( -1, "No Transport" ); 9660 } else { 9661 jqXHR.readyState = 1; 9662 9663 // Send global event 9664 if ( fireGlobals ) { 9665 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 9666 } 9667 9668 // If request was aborted inside ajaxSend, stop there 9669 if ( completed ) { 9670 return jqXHR; 9671 } 9672 9673 // Timeout 9674 if ( s.async && s.timeout > 0 ) { 9675 timeoutTimer = window.setTimeout( function() { 9676 jqXHR.abort( "timeout" ); 9677 }, s.timeout ); 9678 } 9679 9680 try { 9681 completed = false; 9682 transport.send( requestHeaders, done ); 9683 } catch ( e ) { 9684 9685 // Rethrow post-completion exceptions 9686 if ( completed ) { 9687 throw e; 9688 } 9689 9690 // Propagate others as results 9691 done( -1, e ); 9692 } 9693 } 9694 9695 // Callback for when everything is done 9696 function done( status, nativeStatusText, responses, headers ) { 9697 var isSuccess, success, error, response, modified, 9698 statusText = nativeStatusText; 9699 9700 // Ignore repeat invocations 9701 if ( completed ) { 9702 return; 9703 } 9704 9705 completed = true; 9706 9707 // Clear timeout if it exists 9708 if ( timeoutTimer ) { 9709 window.clearTimeout( timeoutTimer ); 9710 } 9711 9712 // Dereference transport for early garbage collection 9713 // (no matter how long the jqXHR object will be used) 9714 transport = undefined; 9715 9716 // Cache response headers 9717 responseHeadersString = headers || ""; 9718 9719 // Set readyState 9720 jqXHR.readyState = status > 0 ? 4 : 0; 9721 9722 // Determine if successful 9723 isSuccess = status >= 200 && status < 300 || status === 304; 9724 9725 // Get response data 9726 if ( responses ) { 9727 response = ajaxHandleResponses( s, jqXHR, responses ); 9728 } 9729 9730 // Use a noop converter for missing script 9731 if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { 9732 s.converters[ "text script" ] = function() {}; 9733 } 9734 9735 // Convert no matter what (that way responseXXX fields are always set) 9736 response = ajaxConvert( s, response, jqXHR, isSuccess ); 9737 9738 // If successful, handle type chaining 9739 if ( isSuccess ) { 9740 9741 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9742 if ( s.ifModified ) { 9743 modified = jqXHR.getResponseHeader( "Last-Modified" ); 9744 if ( modified ) { 9745 jQuery.lastModified[ cacheURL ] = modified; 9746 } 9747 modified = jqXHR.getResponseHeader( "etag" ); 9748 if ( modified ) { 9749 jQuery.etag[ cacheURL ] = modified; 9750 } 9751 } 9752 9753 // if no content 9754 if ( status === 204 || s.type === "HEAD" ) { 9755 statusText = "nocontent"; 9756 9757 // if not modified 9758 } else if ( status === 304 ) { 9759 statusText = "notmodified"; 9760 9761 // If we have data, let's convert it 9762 } else { 9763 statusText = response.state; 9764 success = response.data; 9765 error = response.error; 9766 isSuccess = !error; 9767 } 9768 } else { 9769 9770 // Extract error from statusText and normalize for non-aborts 9771 error = statusText; 9772 if ( status || !statusText ) { 9773 statusText = "error"; 9774 if ( status < 0 ) { 9775 status = 0; 9776 } 9777 } 9778 } 9779 9780 // Set data for the fake xhr object 9781 jqXHR.status = status; 9782 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 9783 9784 // Success/Error 9785 if ( isSuccess ) { 9786 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 9787 } else { 9788 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 9789 } 9790 9791 // Status-dependent callbacks 9792 jqXHR.statusCode( statusCode ); 9793 statusCode = undefined; 9794 9795 if ( fireGlobals ) { 9796 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 9797 [ jqXHR, s, isSuccess ? success : error ] ); 9798 } 9799 9800 // Complete 9801 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 9802 9803 if ( fireGlobals ) { 9804 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 9805 9806 // Handle the global AJAX counter 9807 if ( !( --jQuery.active ) ) { 9808 jQuery.event.trigger( "ajaxStop" ); 9809 } 9810 } 9811 } 9812 9813 return jqXHR; 9814 }, 9815 9816 getJSON: function( url, data, callback ) { 9817 return jQuery.get( url, data, callback, "json" ); 9818 }, 9819 9820 getScript: function( url, callback ) { 9821 return jQuery.get( url, undefined, callback, "script" ); 9822 } 9823 } ); 9824 9825 jQuery.each( [ "get", "post" ], function( _i, method ) { 9826 jQuery[ method ] = function( url, data, callback, type ) { 9827 9828 // Shift arguments if data argument was omitted 9829 if ( isFunction( data ) ) { 9830 type = type || callback; 9831 callback = data; 9832 data = undefined; 9833 } 9834 9835 // The url can be an options object (which then must have .url) 9836 return jQuery.ajax( jQuery.extend( { 9837 url: url, 9838 type: method, 9839 dataType: type, 9840 data: data, 9841 success: callback 9842 }, jQuery.isPlainObject( url ) && url ) ); 9843 }; 9844 } ); 9845 9846 jQuery.ajaxPrefilter( function( s ) { 9847 var i; 9848 for ( i in s.headers ) { 9849 if ( i.toLowerCase() === "content-type" ) { 9850 s.contentType = s.headers[ i ] || ""; 9851 } 9852 } 9853 } ); 9854 9855 9856 jQuery._evalUrl = function( url, options, doc ) { 9857 return jQuery.ajax( { 9858 url: url, 9859 9860 // Make this explicit, since user can override this through ajaxSetup (#11264) 9861 type: "GET", 9862 dataType: "script", 9863 cache: true, 9864 async: false, 9865 global: false, 9866 9867 // Only evaluate the response if it is successful (gh-4126) 9868 // dataFilter is not invoked for failure responses, so using it instead 9869 // of the default converter is kludgy but it works. 9870 converters: { 9871 "text script": function() {} 9872 }, 9873 dataFilter: function( response ) { 9874 jQuery.globalEval( response, options, doc ); 9875 } 9876 } ); 9877 }; 9878 9879 9880 jQuery.fn.extend( { 9881 wrapAll: function( html ) { 9882 var wrap; 9883 9884 if ( this[ 0 ] ) { 9885 if ( isFunction( html ) ) { 9886 html = html.call( this[ 0 ] ); 9887 } 9888 9889 // The elements to wrap the target around 9890 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 9891 9892 if ( this[ 0 ].parentNode ) { 9893 wrap.insertBefore( this[ 0 ] ); 9894 } 9895 9896 wrap.map( function() { 9897 var elem = this; 9898 9899 while ( elem.firstElementChild ) { 9900 elem = elem.firstElementChild; 9901 } 9902 9903 return elem; 9904 } ).append( this ); 9905 } 9906 9907 return this; 9908 }, 9909 9910 wrapInner: function( html ) { 9911 if ( isFunction( html ) ) { 9912 return this.each( function( i ) { 9913 jQuery( this ).wrapInner( html.call( this, i ) ); 9914 } ); 9915 } 9916 9917 return this.each( function() { 9918 var self = jQuery( this ), 9919 contents = self.contents(); 9920 9921 if ( contents.length ) { 9922 contents.wrapAll( html ); 9923 9924 } else { 9925 self.append( html ); 9926 } 9927 } ); 9928 }, 9929 9930 wrap: function( html ) { 9931 var htmlIsFunction = isFunction( html ); 9932 9933 return this.each( function( i ) { 9934 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 9935 } ); 9936 }, 9937 9938 unwrap: function( selector ) { 9939 this.parent( selector ).not( "body" ).each( function() { 9940 jQuery( this ).replaceWith( this.childNodes ); 9941 } ); 9942 return this; 9943 } 9944 } ); 9945 9946 9947 jQuery.expr.pseudos.hidden = function( elem ) { 9948 return !jQuery.expr.pseudos.visible( elem ); 9949 }; 9950 jQuery.expr.pseudos.visible = function( elem ) { 9951 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 9952 }; 9953 9954 9955 9956 9957 jQuery.ajaxSettings.xhr = function() { 9958 try { 9959 return new window.XMLHttpRequest(); 9960 } catch ( e ) {} 9961 }; 9962 9963 var xhrSuccessStatus = { 9964 9965 // File protocol always yields status code 0, assume 200 9966 0: 200, 9967 9968 // Support: IE <=9 only 9969 // #1450: sometimes IE returns 1223 when it should be 204 9970 1223: 204 9971 }, 9972 xhrSupported = jQuery.ajaxSettings.xhr(); 9973 9974 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 9975 support.ajax = xhrSupported = !!xhrSupported; 9976 9977 jQuery.ajaxTransport( function( options ) { 9978 var callback, errorCallback; 9979 9980 // Cross domain only allowed if supported through XMLHttpRequest 9981 if ( support.cors || xhrSupported && !options.crossDomain ) { 9982 return { 9983 send: function( headers, complete ) { 9984 var i, 9985 xhr = options.xhr(); 9986 9987 xhr.open( 9988 options.type, 9989 options.url, 9990 options.async, 9991 options.username, 9992 options.password 9993 ); 9994 9995 // Apply custom fields if provided 9996 if ( options.xhrFields ) { 9997 for ( i in options.xhrFields ) { 9998 xhr[ i ] = options.xhrFields[ i ]; 9999 } 10000 } 10001 10002 // Override mime type if needed 10003 if ( options.mimeType && xhr.overrideMimeType ) { 10004 xhr.overrideMimeType( options.mimeType ); 10005 } 10006 10007 // X-Requested-With header 10008 // For cross-domain requests, seeing as conditions for a preflight are 10009 // akin to a jigsaw puzzle, we simply never set it to be sure. 10010 // (it can always be set on a per-request basis or even using ajaxSetup) 10011 // For same-domain requests, won't change header if already provided. 10012 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 10013 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 10014 } 10015 10016 // Set headers 10017 for ( i in headers ) { 10018 xhr.setRequestHeader( i, headers[ i ] ); 10019 } 10020 10021 // Callback 10022 callback = function( type ) { 10023 return function() { 10024 if ( callback ) { 10025 callback = errorCallback = xhr.onload = 10026 xhr.onerror = xhr.onabort = xhr.ontimeout = 10027 xhr.onreadystatechange = null; 10028 10029 if ( type === "abort" ) { 10030 xhr.abort(); 10031 } else if ( type === "error" ) { 10032 10033 // Support: IE <=9 only 10034 // On a manual native abort, IE9 throws 10035 // errors on any property access that is not readyState 10036 if ( typeof xhr.status !== "number" ) { 10037 complete( 0, "error" ); 10038 } else { 10039 complete( 10040 10041 // File: protocol always yields status 0; see #8605, #14207 10042 xhr.status, 10043 xhr.statusText 10044 ); 10045 } 10046 } else { 10047 complete( 10048 xhrSuccessStatus[ xhr.status ] || xhr.status, 10049 xhr.statusText, 10050 10051 // Support: IE <=9 only 10052 // IE9 has no XHR2 but throws on binary (trac-11426) 10053 // For XHR2 non-text, let the caller handle it (gh-2498) 10054 ( xhr.responseType || "text" ) !== "text" || 10055 typeof xhr.responseText !== "string" ? 10056 { binary: xhr.response } : 10057 { text: xhr.responseText }, 10058 xhr.getAllResponseHeaders() 10059 ); 10060 } 10061 } 10062 }; 10063 }; 10064 10065 // Listen to events 10066 xhr.onload = callback(); 10067 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 10068 10069 // Support: IE 9 only 10070 // Use onreadystatechange to replace onabort 10071 // to handle uncaught aborts 10072 if ( xhr.onabort !== undefined ) { 10073 xhr.onabort = errorCallback; 10074 } else { 10075 xhr.onreadystatechange = function() { 10076 10077 // Check readyState before timeout as it changes 10078 if ( xhr.readyState === 4 ) { 10079 10080 // Allow onerror to be called first, 10081 // but that will not handle a native abort 10082 // Also, save errorCallback to a variable 10083 // as xhr.onerror cannot be accessed 10084 window.setTimeout( function() { 10085 if ( callback ) { 10086 errorCallback(); 10087 } 10088 } ); 10089 } 10090 }; 10091 } 10092 10093 // Create the abort callback 10094 callback = callback( "abort" ); 10095 10096 try { 10097 10098 // Do send the request (this may raise an exception) 10099 xhr.send( options.hasContent && options.data || null ); 10100 } catch ( e ) { 10101 10102 // #14683: Only rethrow if this hasn't been notified as an error yet 10103 if ( callback ) { 10104 throw e; 10105 } 10106 } 10107 }, 10108 10109 abort: function() { 10110 if ( callback ) { 10111 callback(); 10112 } 10113 } 10114 }; 10115 } 10116 } ); 10117 10118 10119 10120 10121// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 10122 jQuery.ajaxPrefilter( function( s ) { 10123 if ( s.crossDomain ) { 10124 s.contents.script = false; 10125 } 10126 } ); 10127 10128// Install script dataType 10129 jQuery.ajaxSetup( { 10130 accepts: { 10131 script: "text/javascript, application/javascript, " + 10132 "application/ecmascript, application/x-ecmascript" 10133 }, 10134 contents: { 10135 script: /\b(?:java|ecma)script\b/ 10136 }, 10137 converters: { 10138 "text script": function( text ) { 10139 jQuery.globalEval( text ); 10140 return text; 10141 } 10142 } 10143 } ); 10144 10145// Handle cache's special case and crossDomain 10146 jQuery.ajaxPrefilter( "script", function( s ) { 10147 if ( s.cache === undefined ) { 10148 s.cache = false; 10149 } 10150 if ( s.crossDomain ) { 10151 s.type = "GET"; 10152 } 10153 } ); 10154 10155// Bind script tag hack transport 10156 jQuery.ajaxTransport( "script", function( s ) { 10157 10158 // This transport only deals with cross domain or forced-by-attrs requests 10159 if ( s.crossDomain || s.scriptAttrs ) { 10160 var script, callback; 10161 return { 10162 send: function( _, complete ) { 10163 script = jQuery( "<script>" ) 10164 .attr( s.scriptAttrs || {} ) 10165 .prop( { charset: s.scriptCharset, src: s.url } ) 10166 .on( "load error", callback = function( evt ) { 10167 script.remove(); 10168 callback = null; 10169 if ( evt ) { 10170 complete( evt.type === "error" ? 404 : 200, evt.type ); 10171 } 10172 } ); 10173 10174 // Use native DOM manipulation to avoid our domManip AJAX trickery 10175 document.head.appendChild( script[ 0 ] ); 10176 }, 10177 abort: function() { 10178 if ( callback ) { 10179 callback(); 10180 } 10181 } 10182 }; 10183 } 10184 } ); 10185 10186 10187 10188 10189 var oldCallbacks = [], 10190 rjsonp = /(=)\?(?=&|$)|\?\?/; 10191 10192// Default jsonp settings 10193 jQuery.ajaxSetup( { 10194 jsonp: "callback", 10195 jsonpCallback: function() { 10196 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 10197 this[ callback ] = true; 10198 return callback; 10199 } 10200 } ); 10201 10202// Detect, normalize options and install callbacks for jsonp requests 10203 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 10204 10205 var callbackName, overwritten, responseContainer, 10206 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 10207 "url" : 10208 typeof s.data === "string" && 10209 ( s.contentType || "" ) 10210 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 10211 rjsonp.test( s.data ) && "data" 10212 ); 10213 10214 // Handle iff the expected data type is "jsonp" or we have a parameter to set 10215 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 10216 10217 // Get callback name, remembering preexisting value associated with it 10218 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 10219 s.jsonpCallback() : 10220 s.jsonpCallback; 10221 10222 // Insert callback into url or form data 10223 if ( jsonProp ) { 10224 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 10225 } else if ( s.jsonp !== false ) { 10226 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 10227 } 10228 10229 // Use data converter to retrieve json after script execution 10230 s.converters[ "script json" ] = function() { 10231 if ( !responseContainer ) { 10232 jQuery.error( callbackName + " was not called" ); 10233 } 10234 return responseContainer[ 0 ]; 10235 }; 10236 10237 // Force json dataType 10238 s.dataTypes[ 0 ] = "json"; 10239 10240 // Install callback 10241 overwritten = window[ callbackName ]; 10242 window[ callbackName ] = function() { 10243 responseContainer = arguments; 10244 }; 10245 10246 // Clean-up function (fires after converters) 10247 jqXHR.always( function() { 10248 10249 // If previous value didn't exist - remove it 10250 if ( overwritten === undefined ) { 10251 jQuery( window ).removeProp( callbackName ); 10252 10253 // Otherwise restore preexisting value 10254 } else { 10255 window[ callbackName ] = overwritten; 10256 } 10257 10258 // Save back as free 10259 if ( s[ callbackName ] ) { 10260 10261 // Make sure that re-using the options doesn't screw things around 10262 s.jsonpCallback = originalSettings.jsonpCallback; 10263 10264 // Save the callback name for future use 10265 oldCallbacks.push( callbackName ); 10266 } 10267 10268 // Call if it was a function and we have a response 10269 if ( responseContainer && isFunction( overwritten ) ) { 10270 overwritten( responseContainer[ 0 ] ); 10271 } 10272 10273 responseContainer = overwritten = undefined; 10274 } ); 10275 10276 // Delegate to script 10277 return "script"; 10278 } 10279 } ); 10280 10281 10282 10283 10284// Support: Safari 8 only 10285// In Safari 8 documents created via document.implementation.createHTMLDocument 10286// collapse sibling forms: the second one becomes a child of the first one. 10287// Because of that, this security measure has to be disabled in Safari 8. 10288// https://bugs.webkit.org/show_bug.cgi?id=137337 10289 support.createHTMLDocument = ( function() { 10290 var body = document.implementation.createHTMLDocument( "" ).body; 10291 body.innerHTML = "<form></form><form></form>"; 10292 return body.childNodes.length === 2; 10293 } )(); 10294 10295 10296// Argument "data" should be string of html 10297// context (optional): If specified, the fragment will be created in this context, 10298// defaults to document 10299// keepScripts (optional): If true, will include scripts passed in the html string 10300 jQuery.parseHTML = function( data, context, keepScripts ) { 10301 if ( typeof data !== "string" ) { 10302 return []; 10303 } 10304 if ( typeof context === "boolean" ) { 10305 keepScripts = context; 10306 context = false; 10307 } 10308 10309 var base, parsed, scripts; 10310 10311 if ( !context ) { 10312 10313 // Stop scripts or inline event handlers from being executed immediately 10314 // by using document.implementation 10315 if ( support.createHTMLDocument ) { 10316 context = document.implementation.createHTMLDocument( "" ); 10317 10318 // Set the base href for the created document 10319 // so any parsed elements with URLs 10320 // are based on the document's URL (gh-2965) 10321 base = context.createElement( "base" ); 10322 base.href = document.location.href; 10323 context.head.appendChild( base ); 10324 } else { 10325 context = document; 10326 } 10327 } 10328 10329 parsed = rsingleTag.exec( data ); 10330 scripts = !keepScripts && []; 10331 10332 // Single tag 10333 if ( parsed ) { 10334 return [ context.createElement( parsed[ 1 ] ) ]; 10335 } 10336 10337 parsed = buildFragment( [ data ], context, scripts ); 10338 10339 if ( scripts && scripts.length ) { 10340 jQuery( scripts ).remove(); 10341 } 10342 10343 return jQuery.merge( [], parsed.childNodes ); 10344 }; 10345 10346 10347 /** 10348 * Load a url into a page 10349 */ 10350 jQuery.fn.load = function( url, params, callback ) { 10351 var selector, type, response, 10352 self = this, 10353 off = url.indexOf( " " ); 10354 10355 if ( off > -1 ) { 10356 selector = stripAndCollapse( url.slice( off ) ); 10357 url = url.slice( 0, off ); 10358 } 10359 10360 // If it's a function 10361 if ( isFunction( params ) ) { 10362 10363 // We assume that it's the callback 10364 callback = params; 10365 params = undefined; 10366 10367 // Otherwise, build a param string 10368 } else if ( params && typeof params === "object" ) { 10369 type = "POST"; 10370 } 10371 10372 // If we have elements to modify, make the request 10373 if ( self.length > 0 ) { 10374 jQuery.ajax( { 10375 url: url, 10376 10377 // If "type" variable is undefined, then "GET" method will be used. 10378 // Make value of this field explicit since 10379 // user can override it through ajaxSetup method 10380 type: type || "GET", 10381 dataType: "html", 10382 data: params 10383 } ).done( function( responseText ) { 10384 10385 // Save response for use in complete callback 10386 response = arguments; 10387 10388 self.html( selector ? 10389 10390 // If a selector was specified, locate the right elements in a dummy div 10391 // Exclude scripts to avoid IE 'Permission Denied' errors 10392 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 10393 10394 // Otherwise use the full result 10395 responseText ); 10396 10397 // If the request succeeds, this function gets "data", "status", "jqXHR" 10398 // but they are ignored because response was set above. 10399 // If it fails, this function gets "jqXHR", "status", "error" 10400 } ).always( callback && function( jqXHR, status ) { 10401 self.each( function() { 10402 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 10403 } ); 10404 } ); 10405 } 10406 10407 return this; 10408 }; 10409 10410 10411 10412 10413 jQuery.expr.pseudos.animated = function( elem ) { 10414 return jQuery.grep( jQuery.timers, function( fn ) { 10415 return elem === fn.elem; 10416 } ).length; 10417 }; 10418 10419 10420 10421 10422 jQuery.offset = { 10423 setOffset: function( elem, options, i ) { 10424 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft,
vendor: 4,683 bytes, lines 10424-10548
10424calculatePosition, 10425 position = jQuery.css( elem, "position" ), 10426 curElem = jQuery( elem ), 10427 props = {}; 10428 10429 // Set position first, in-case top/left are set even on static elem 10430 if ( position === "static" ) { 10431 elem.style.position = "relative"; 10432 } 10433 10434 curOffset = curElem.offset(); 10435 curCSSTop = jQuery.css( elem, "top" ); 10436 curCSSLeft = jQuery.css( elem, "left" ); 10437 calculatePosition = ( position === "absolute" || position === "fixed" ) && 10438 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 10439 10440 // Need to be able to calculate position if either 10441 // top or left is auto and position is either absolute or fixed 10442 if ( calculatePosition ) { 10443 curPosition = curElem.position(); 10444 curTop = curPosition.top; 10445 curLeft = curPosition.left; 10446 10447 } else { 10448 curTop = parseFloat( curCSSTop ) || 0; 10449 curLeft = parseFloat( curCSSLeft ) || 0; 10450 } 10451 10452 if ( isFunction( options ) ) { 10453 10454 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10455 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 10456 } 10457 10458 if ( options.top != null ) { 10459 props.top = ( options.top - curOffset.top ) + curTop; 10460 } 10461 if ( options.left != null ) { 10462 props.left = ( options.left - curOffset.left ) + curLeft; 10463 } 10464 10465 if ( "using" in options ) { 10466 options.using.call( elem, props ); 10467 10468 } else { 10469 if ( typeof props.top === "number" ) { 10470 props.top += "px"; 10471 } 10472 if ( typeof props.left === "number" ) { 10473 props.left += "px"; 10474 } 10475 curElem.css( props ); 10476 } 10477 } 10478 }; 10479 10480 jQuery.fn.extend( { 10481 10482 // offset() relates an element's border box to the document origin 10483 offset: function( options ) { 10484 10485 // Preserve chaining for setter 10486 if ( arguments.length ) { 10487 return options === undefined ? 10488 this : 10489 this.each( function( i ) { 10490 jQuery.offset.setOffset( this, options, i ); 10491 } ); 10492 } 10493 10494 var rect, win, 10495 elem = this[ 0 ]; 10496 10497 if ( !elem ) { 10498 return; 10499 } 10500 10501 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 10502 // Support: IE <=11 only 10503 // Running getBoundingClientRect on a 10504 // disconnected node in IE throws an error 10505 if ( !elem.getClientRects().length ) { 10506 return { top: 0, left: 0 }; 10507 } 10508 10509 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 10510 rect = elem.getBoundingClientRect(); 10511 win = elem.ownerDocument.defaultView; 10512 return { 10513 top: rect.top + win.pageYOffset, 10514 left: rect.left + win.pageXOffset 10515 }; 10516 }, 10517 10518 // position() relates an element's margin box to its offset parent's padding box 10519 // This corresponds to the behavior of CSS absolute positioning 10520 position: function() { 10521 if ( !this[ 0 ] ) { 10522 return; 10523 } 10524 10525 var offsetParent, offset, doc, 10526 elem = this[ 0 ], 10527 parentOffset = { top: 0, left: 0 }; 10528 10529 // position:fixed elements are offset from the viewport, which itself always has zero offset 10530 if ( jQuery.css( elem, "position" ) === "fixed" ) { 10531 10532 // Assume position:fixed implies availability of getBoundingClientRect 10533 offset = elem.getBoundingClientRect(); 10534 10535 } else { 10536 offset = this.offset(); 10537 10538 // Account for the *real* offset parent, which can be the document or its root element 10539 // when a statically positioned element is identified 10540 doc = elem.ownerDocument; 10541 offsetParent = elem.offsetParent || doc.documentElement; 10542 while ( offsetParent && 10543 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 10544 jQuery.css( offsetParent, "position" ) === "static" ) { 10545 10546 offsetParent = offsetParent.parentNode; 10547 } 10548 if ( offsetParent && offsetParent !== elem && offsetParent.
vendor: 4,681 bytes, lines 10548-10657
10548nodeType === 1 ) { 10549 10550 // Incorporate borders into its offset, since they are outside its content origin 10551 parentOffset = jQuery( offsetParent ).offset(); 10552 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 10553 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 10554 } 10555 } 10556 10557 // Subtract parent offsets and element margins 10558 return { 10559 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 10560 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 10561 }; 10562 }, 10563 10564 // This method will return documentElement in the following cases: 10565 // 1) For the element inside the iframe without offsetParent, this method will return 10566 // documentElement of the parent window 10567 // 2) For the hidden or detached element 10568 // 3) For body or html element, i.e. in case of the html node - it will return itself 10569 // 10570 // but those exceptions were never presented as a real life use-cases 10571 // and might be considered as more preferable results. 10572 // 10573 // This logic, however, is not guaranteed and can change at any point in the future 10574 offsetParent: function() { 10575 return this.map( function() { 10576 var offsetParent = this.offsetParent; 10577 10578 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 10579 offsetParent = offsetParent.offsetParent; 10580 } 10581 10582 return offsetParent || documentElement; 10583 } ); 10584 } 10585 } ); 10586 10587// Create scrollLeft and scrollTop methods 10588 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 10589 var top = "pageYOffset" === prop; 10590 10591 jQuery.fn[ method ] = function( val ) { 10592 return access( this, function( elem, method, val ) { 10593 10594 // Coalesce documents and windows 10595 var win; 10596 if ( isWindow( elem ) ) { 10597 win = elem; 10598 } else if ( elem.nodeType === 9 ) { 10599 win = elem.defaultView; 10600 } 10601 10602 if ( val === undefined ) { 10603 return win ? win[ prop ] : elem[ method ]; 10604 } 10605 10606 if ( win ) { 10607 win.scrollTo( 10608 !top ? val : win.pageXOffset, 10609 top ? val : win.pageYOffset 10610 ); 10611 10612 } else { 10613 elem[ method ] = val; 10614 } 10615 }, method, val, arguments.length ); 10616 }; 10617 } ); 10618 10619// Support: Safari <=7 - 9.1, Chrome <=37 - 49 10620// Add the top/left cssHooks using jQuery.fn.position 10621// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10622// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 10623// getComputedStyle returns percent when specified for top/left/bottom/right; 10624// rather than make the css module depend on the offset module, just check for it here 10625 jQuery.each( [ "top", "left" ], function( _i, prop ) { 10626 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 10627 function( elem, computed ) { 10628 if ( computed ) { 10629 computed = curCSS( elem, prop ); 10630 10631 // If curCSS returns percentage, fallback to offset 10632 return rnumnonpx.test( computed ) ? 10633 jQuery( elem ).position()[ prop ] + "px" : 10634 computed; 10635 } 10636 } 10637 ); 10638 } ); 10639 10640 10641// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10642 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 10643 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 10644 function( defaultExtra, funcName ) { 10645 10646 // Margin is only for outerHeight, outerWidth 10647 jQuery.fn[ funcName ] = function( margin, value ) { 10648 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 10649 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 10650 10651 return access( this, function( elem, type, value ) { 10652 var doc; 10653 10654 if ( isWindow( elem ) ) { 10655 10656 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 10657 return funcName.indexOf( "outer" ) === 0 ?
vendor: 5,135 bytes, lines 10658-10813
10658 elem[ "inner" + name ] : 10659 elem.document.documentElement[ "client" + name ]; 10660 } 10661 10662 // Get document width or height 10663 if ( elem.nodeType === 9 ) { 10664 doc = elem.documentElement; 10665 10666 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10667 // whichever is greatest 10668 return Math.max( 10669 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 10670 elem.body[ "offset" + name ], doc[ "offset" + name ], 10671 doc[ "client" + name ] 10672 ); 10673 } 10674 10675 return value === undefined ? 10676 10677 // Get width or height on the element, requesting but not forcing parseFloat 10678 jQuery.css( elem, type, extra ) : 10679 10680 // Set width or height on the element 10681 jQuery.style( elem, type, value, extra ); 10682 }, type, chainable ? margin : undefined, chainable ); 10683 }; 10684 } ); 10685 } ); 10686 10687 10688 jQuery.each( [ 10689 "ajaxStart", 10690 "ajaxStop", 10691 "ajaxComplete", 10692 "ajaxError", 10693 "ajaxSuccess", 10694 "ajaxSend" 10695 ], function( _i, type ) { 10696 jQuery.fn[ type ] = function( fn ) { 10697 return this.on( type, fn ); 10698 }; 10699 } ); 10700 10701 10702 10703 10704 jQuery.fn.extend( { 10705 10706 bind: function( types, data, fn ) { 10707 return this.on( types, null, data, fn ); 10708 }, 10709 unbind: function( types, fn ) { 10710 return this.off( types, null, fn ); 10711 }, 10712 10713 delegate: function( selector, types, data, fn ) { 10714 return this.on( types, selector, data, fn ); 10715 }, 10716 undelegate: function( selector, types, fn ) { 10717 10718 // ( namespace ) or ( selector, types [, fn] ) 10719 return arguments.length === 1 ? 10720 this.off( selector, "**" ) : 10721 this.off( types, selector || "**", fn ); 10722 }, 10723 10724 hover: function( fnOver, fnOut ) { 10725 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 10726 } 10727 } ); 10728 10729 jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 10730 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 10731 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 10732 function( _i, name ) { 10733 10734 // Handle event binding 10735 jQuery.fn[ name ] = function( data, fn ) { 10736 return arguments.length > 0 ? 10737 this.on( name, null, data, fn ) : 10738 this.trigger( name ); 10739 }; 10740 } ); 10741 10742 10743 10744 10745// Support: Android <=4.0 only 10746// Make sure we trim BOM and NBSP 10747 var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 10748 10749// Bind a function to a context, optionally partially applying any 10750// arguments. 10751// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 10752// However, it is not slated for removal any time soon 10753 jQuery.proxy = function( fn, context ) { 10754 var tmp, args, proxy; 10755 10756 if ( typeof context === "string" ) { 10757 tmp = fn[ context ]; 10758 context = fn; 10759 fn = tmp; 10760 } 10761 10762 // Quick check to determine if target is callable, in the spec 10763 // this throws a TypeError, but we will just return undefined. 10764 if ( !isFunction( fn ) ) { 10765 return undefined; 10766 } 10767 10768 // Simulated bind 10769 args = slice.call( arguments, 2 ); 10770 proxy = function() { 10771 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 10772 }; 10773 10774 // Set the guid of unique handler to the same of original handler, so it can be removed 10775 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 10776 10777 return proxy; 10778 }; 10779 10780 jQuery.holdReady = function( hold ) { 10781 if ( hold ) { 10782 jQuery.readyWait++; 10783 } else { 10784 jQuery.ready( true ); 10785 } 10786 }; 10787 jQuery.isArray = Array.isArray; 10788 jQuery.parseJSON = JSON.parse; 10789 jQuery.nodeName = nodeName; 10790 jQuery.isFunction = isFunction; 10791 jQuery.isWindow = isWindow; 10792 jQuery.camelCase = camelCase; 10793 jQuery.type = toType; 10794 10795 jQuery.now = Date.now; 10796 10797 jQuery.isNumeric = function( obj ) { 10798 10799 // As of jQuery 3.0, isNumeric is limited to 10800 // strings and numbers (primitives or objects) 10801 // that can be coerced to finite numbers (gh-2662) 10802 var type = jQuery.type( obj ); 10803 return ( type === "number" || type === "string" ) && 10804 10805 // parseFloat NaNs numeric-cast false positives ("") 10806 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 10807 // subtraction forces infinities to NaN 10808 !isNaN( obj - parseFloat( obj ) ); 10809 }; 10810 10811 jQuery.trim = function( text ) { 10812 return text == null ? 10813 "" :
10814 ( text + "" ).replace( rtrim, "" ); 10815 }; 10816 10817 10818 10819// Register as a named AMD module, since jQuery can be concatenated with other 10820// files that may use define, but not via a proper concatenation script that 10821// understands anonymous AMD modules. A named AMD is safest and most robust 10822// way to register. Lowercase jquery is used because AMD module names are 10823// derived from file names, and jQuery is normally delivered in a lowercase 10824// file name. Do this after creating the global so that if an AMD module wants 10825// to call noConflict to hide this version of jQuery, it will work. 10826 10827// Note that for maximum portability, libraries that are not jQuery should 10828// declare themselves as anonymous modules, and avoid setting a global if an 10829// AMD loader is present. jQuery is a special case. For more information, see 10830// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10831 10832 if ( typeof define === "function" && define.amd ) { 10833 define( "jquery", [], function() { 10834 return jQuery; 10835 } ); 10836 } 10837 10838 10839 10840 10841 var 10842 10843 // Map over jQuery in case of overwrite 10844 _jQuery = window.jQuery, 10845 10846 // Map over the $ in case of overwrite 10847 _$ = window.$; 10848 10849 jQuery.noConflict = function( deep ) { 10850 if ( window.$ === jQuery ) { 10851 window.$ = _$; 10852 } 10853 10854 if ( deep && window.jQuery === jQuery ) { 10855 window.jQuery = _jQuery; 10856 } 10857 10858 return jQuery; 10859 }; 10860 10861// Expose jQuery and $ identifiers, even in AMD 10862// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 10863// and CommonJS for browser emulators (#13566) 10864 if ( typeof noGlobal === "undefined" ) { 10865 window.jQuery = window.$ = jQuery; 10866 } 10867 10868 10869 10870 10871 return jQuery; 10872} ); 10873 10874/******/ (function() { // webpackBootstrap 10875/******/ var __webpack_modules__ = ({ 10876 10877/***/ 7090: 10878/***/ (function(module) { 10879 10880(function(window, factory) { 10881 var lazySizes = factory(window, window.document, Date); 10882 window.lazySizes = lazySizes; 10883 if( true
vendor: 19,841 bytes, lines 10883-11693
10883 && module.exports){ 10884 module.exports = lazySizes; 10885 } 10886}(typeof window != 'undefined' ? 10887 window : {}, 10888/** 10889 * import("./types/global") 10890 * @typedef { import("./types/lazysizes-config").LazySizesConfigPartial } LazySizesConfigPartial 10891 */ 10892function l(window, document, Date) { // Pass in the window Date function also for SSR because the Date class can be lost 10893 'use strict'; 10894 /*jshint eqnull:true */ 10895 10896 var lazysizes, 10897 /** 10898 * @type { LazySizesConfigPartial } 10899 */ 10900 lazySizesCfg; 10901 10902 (function(){ 10903 var prop; 10904 10905 var lazySizesDefaults = { 10906 lazyClass: 'lazyload', 10907 loadedClass: 'lazyloaded', 10908 loadingClass: 'lazyloading', 10909 preloadClass: 'lazypreload', 10910 errorClass: 'lazyerror', 10911 //strictClass: 'lazystrict', 10912 autosizesClass: 'lazyautosizes', 10913 fastLoadedClass: 'ls-is-cached', 10914 iframeLoadMode: 0, 10915 srcAttr: 'data-src', 10916 srcsetAttr: 'data-srcset', 10917 sizesAttr: 'data-sizes', 10918 //preloadAfterLoad: false, 10919 minSize: 40, 10920 customMedia: {}, 10921 init: true, 10922 expFactor: 1.5, 10923 hFac: 0.8, 10924 loadMode: 2, 10925 loadHidden: true, 10926 ricTimeout: 0, 10927 throttleDelay: 125, 10928 }; 10929 10930 lazySizesCfg = window.lazySizesConfig || window.lazysizesConfig || {}; 10931 10932 for(prop in lazySizesDefaults){ 10933 if(!(prop in lazySizesCfg)){ 10934 lazySizesCfg[prop] = lazySizesDefaults[prop]; 10935 } 10936 } 10937 })(); 10938 10939 if (!document || !document.getElementsByClassName) { 10940 return { 10941 init: function () {}, 10942 /** 10943 * @type { LazySizesConfigPartial } 10944 */ 10945 cfg: lazySizesCfg, 10946 /** 10947 * @type { true } 10948 */ 10949 noSupport: true, 10950 }; 10951 } 10952 10953 var docElem = document.documentElement; 10954 10955 var supportPicture = window.HTMLPictureElement; 10956 10957 var _addEventListener = 'addEventListener'; 10958 10959 var _getAttribute = 'getAttribute'; 10960 10961 /** 10962 * Update to bind to window because 'this' becomes null during SSR 10963 * builds. 10964 */ 10965 var addEventListener = window[_addEventListener].bind(window); 10966 10967 var setTimeout = window.setTimeout; 10968 10969 var requestAnimationFrame = window.requestAnimationFrame || setTimeout; 10970 10971 var requestIdleCallback = window.requestIdleCallback; 10972 10973 var regPicture = /^picture$/i; 10974 10975 var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded']; 10976 10977 var regClassCache = {}; 10978 10979 var forEach = Array.prototype.forEach; 10980 10981 /** 10982 * @param ele {Element} 10983 * @param cls {string} 10984 */ 10985 var hasClass = function(ele, cls) { 10986 if(!regClassCache[cls]){ 10987 regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)'); 10988 } 10989 return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls]; 10990 }; 10991 10992 /** 10993 * @param ele {Element} 10994 * @param cls {string} 10995 */ 10996 var addClass = function(ele, cls) { 10997 if (!hasClass(ele, cls)){ 10998 ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls); 10999 } 11000 }; 11001 11002 /** 11003 * @param ele {Element} 11004 * @param cls {string} 11005 */ 11006 var removeClass = function(ele, cls) { 11007 var reg; 11008 if ((reg = hasClass(ele,cls))) { 11009 ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' ')); 11010 } 11011 }; 11012 11013 var addRemoveLoadEvents = function(dom, fn, add){ 11014 var action = add ? _addEventListener : 'removeEventListener'; 11015 if(add){ 11016 addRemoveLoadEvents(dom, fn); 11017 } 11018 loadEvents.forEach(function(evt){ 11019 dom[action](evt, fn); 11020 }); 11021 }; 11022 11023 /** 11024 * @param elem { Element } 11025 * @param name { string } 11026 * @param detail { any } 11027 * @param noBubbles { boolean } 11028 * @param noCancelable { boolean } 11029 * @returns { CustomEvent } 11030 */ 11031 var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){ 11032 var event = document.createEvent('Event'); 11033 11034 if(!detail){ 11035 detail = {}; 11036 } 11037 11038 detail.instance = lazysizes; 11039 11040 event.initEvent(name, !noBubbles, !noCancelable); 11041 11042 event.detail = detail; 11043 11044 elem.dispatchEvent(event); 11045 return event; 11046 }; 11047 11048 var updatePolyfill = function (el, full){ 11049 var polyfill; 11050 if( !supportPicture && ( polyfill = (window.picturefill || lazySizesCfg.pf) ) ){ 11051 if(full && full.src && !el[_getAttribute]('srcset')){ 11052 el.setAttribute('srcset', full.src); 11053 } 11054 polyfill({reevaluate: true, elements: [el]}); 11055 } else if(full && full.src){ 11056 el.src = full.src; 11057 } 11058 }; 11059 11060 var getCSS = function (elem, style){ 11061 return (getComputedStyle(elem, null) || {})[style]; 11062 }; 11063 11064 /** 11065 * 11066 * @param elem { Element } 11067 * @param parent { Element } 11068 * @param [width] {number} 11069 * @returns {number} 11070 */ 11071 var getWidth = function(elem, parent, width){ 11072 width = width || elem.offsetWidth; 11073 11074 while(width < lazySizesCfg.minSize && parent && !elem._lazysizesWidth){ 11075 width = parent.offsetWidth; 11076 parent = parent.parentNode; 11077 } 11078 11079 return width; 11080 }; 11081 11082 var rAF = (function(){ 11083 var running, waiting; 11084 var firstFns = []; 11085 var secondFns = []; 11086 var fns = firstFns; 11087 11088 var run = function(){ 11089 var runFns = fns; 11090 11091 fns = firstFns.length ? secondFns : firstFns; 11092 11093 running = true; 11094 waiting = false; 11095 11096 while(runFns.length){ 11097 runFns.shift()(); 11098 } 11099 11100 running = false; 11101 }; 11102 11103 var rafBatch = function(fn, queue){ 11104 if(running && !queue){ 11105 fn.apply(this, arguments); 11106 } else { 11107 fns.push(fn); 11108 11109 if(!waiting){ 11110 waiting = true; 11111 (document.hidden ? setTimeout : requestAnimationFrame)(run); 11112 } 11113 } 11114 }; 11115 11116 rafBatch._lsFlush = run; 11117 11118 return rafBatch; 11119 })(); 11120 11121 var rAFIt = function(fn, simple){ 11122 return simple ? 11123 function() { 11124 rAF(fn); 11125 } : 11126 function(){ 11127 var that = this; 11128 var args = arguments; 11129 rAF(function(){ 11130 fn.apply(that, args); 11131 }); 11132 } 11133 ; 11134 }; 11135 11136 var throttle = function(fn){ 11137 var running; 11138 var lastTime = 0; 11139 var gDelay = lazySizesCfg.throttleDelay; 11140 var rICTimeout = lazySizesCfg.ricTimeout; 11141 var run = function(){ 11142 running = false; 11143 lastTime = Date.now(); 11144 fn(); 11145 }; 11146 var idleCallback = requestIdleCallback && rICTimeout > 49 ? 11147 function(){ 11148 requestIdleCallback(run, {timeout: rICTimeout}); 11149 11150 if(rICTimeout !== lazySizesCfg.ricTimeout){ 11151 rICTimeout = lazySizesCfg.ricTimeout; 11152 } 11153 } : 11154 rAFIt(function(){ 11155 setTimeout(run); 11156 }, true) 11157 ; 11158 11159 return function(isPriority){ 11160 var delay; 11161 11162 if((isPriority = isPriority === true)){ 11163 rICTimeout = 33; 11164 } 11165 11166 if(running){ 11167 return; 11168 } 11169 11170 running = true; 11171 11172 delay = gDelay - (Date.now() - lastTime); 11173 11174 if(delay < 0){ 11175 delay = 0; 11176 } 11177 11178 if(isPriority || delay < 9){ 11179 idleCallback(); 11180 } else { 11181 setTimeout(idleCallback, delay); 11182 } 11183 }; 11184 }; 11185 11186 //based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html 11187 var debounce = function(func) { 11188 var timeout, timestamp; 11189 var wait = 99; 11190 var run = function(){ 11191 timeout = null; 11192 func(); 11193 }; 11194 var later = function() { 11195 var last = Date.now() - timestamp; 11196 11197 if (last < wait) { 11198 setTimeout(later, wait - last); 11199 } else { 11200 (requestIdleCallback || run)(run); 11201 } 11202 }; 11203 11204 return function() { 11205 timestamp = Date.now(); 11206 11207 if (!timeout) { 11208 timeout = setTimeout(later, wait); 11209 } 11210 }; 11211 }; 11212 11213 var loader = (function(){ 11214 var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started; 11215 11216 var eLvW, elvH, eLtop, eLleft, eLright, eLbottom, isBodyHidden; 11217 11218 var regImg = /^img$/i; 11219 var regIframe = /^iframe$/i; 11220 11221 var supportScroll = ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent)); 11222 11223 var shrinkExpand = 0; 11224 var currentExpand = 0; 11225 11226 var isLoading = 0; 11227 var lowRuns = -1; 11228 11229 var resetPreloading = function(e){ 11230 isLoading--; 11231 if(!e || isLoading < 0 || !e.target){ 11232 isLoading = 0; 11233 } 11234 }; 11235 11236 var isVisible = function (elem) { 11237 if (isBodyHidden == null) { 11238 isBodyHidden = getCSS(document.body, 'visibility') == 'hidden'; 11239 } 11240 11241 return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden'); 11242 }; 11243 11244 var isNestedVisible = function(elem, elemExpand){ 11245 var outerRect; 11246 var parent = elem; 11247 var visible = isVisible(elem); 11248 11249 eLtop -= elemExpand; 11250 eLbottom += elemExpand; 11251 eLleft -= elemExpand; 11252 eLright += elemExpand; 11253 11254 while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){ 11255 visible = ((getCSS(parent, 'opacity') || 1) > 0); 11256 11257 if(visible && getCSS(parent, 'overflow') != 'visible'){ 11258 outerRect = parent.getBoundingClientRect(); 11259 visible = eLright > outerRect.left && 11260 eLleft < outerRect.right && 11261 eLbottom > outerRect.top - 1 && 11262 eLtop < outerRect.bottom + 1 11263 ; 11264 } 11265 } 11266 11267 return visible; 11268 }; 11269 11270 var checkElements = function() { 11271 var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal, 11272 beforeExpandVal, defaultExpand, preloadExpand, hFac; 11273 var lazyloadElems = lazysizes.elements; 11274 11275 if((loadMode = lazySizesCfg.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){ 11276 11277 i = 0; 11278 11279 lowRuns++; 11280 11281 for(; i < eLlen; i++){ 11282 11283 if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;} 11284 11285 if(!supportScroll || (lazysizes.prematureUnveil && lazysizes.prematureUnveil(lazyloadElems[i]))){unveilElement(lazyloadElems[i]);continue;} 11286 11287 if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){ 11288 elemExpand = currentExpand; 11289 } 11290 11291 if (!defaultExpand) { 11292 defaultExpand = (!lazySizesCfg.expand || lazySizesCfg.expand < 1) ? 11293 docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370 : 11294 lazySizesCfg.expand; 11295 11296 lazysizes._defEx = defaultExpand; 11297 11298 preloadExpand = defaultExpand * lazySizesCfg.expFactor; 11299 hFac = lazySizesCfg.hFac; 11300 isBodyHidden = null; 11301 11302 if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){ 11303 currentExpand = preloadExpand; 11304 lowRuns = 0; 11305 } else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){ 11306 currentExpand = defaultExpand; 11307 } else { 11308 currentExpand = shrinkExpand; 11309 } 11310 } 11311 11312 if(beforeExpandVal !== elemExpand){ 11313 eLvW = innerWidth + (elemExpand * hFac); 11314 elvH = innerHeight + elemExpand; 11315 elemNegativeExpand = elemExpand * -1; 11316 beforeExpandVal = elemExpand; 11317 } 11318 11319 rect = lazyloadElems[i].getBoundingClientRect(); 11320 11321 if ((eLbottom = rect.bottom) >= elemNegativeExpand && 11322 (eLtop = rect.top) <= elvH && 11323 (eLright = rect.right) >= elemNegativeExpand * hFac && 11324 (eLleft = rect.left) <= eLvW && 11325 (eLbottom || eLright || eLleft || eLtop) && 11326 (lazySizesCfg.loadHidden || isVisible(lazyloadElems[i])) && 11327 ((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){ 11328 unveilElement(lazyloadElems[i]); 11329 loadedSomething = true; 11330 if(isLoading > 9){break;} 11331 } else if(!loadedSomething && isCompleted && !autoLoadElem && 11332 isLoading < 4 && lowRuns < 4 && loadMode > 2 && 11333 (preloadElems[0] || lazySizesCfg.preloadAfterLoad) && 11334 (preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr) != 'auto')))){ 11335 autoLoadElem = preloadElems[0] || lazyloadElems[i]; 11336 } 11337 } 11338 11339 if(autoLoadElem && !loadedSomething){ 11340 unveilElement(autoLoadElem); 11341 } 11342 } 11343 }; 11344 11345 var throttledCheckElements = throttle(checkElements); 11346 11347 var switchLoadingClass = function(e){ 11348 var elem = e.target; 11349 11350 if (elem._lazyCache) { 11351 delete elem._lazyCache; 11352 return; 11353 } 11354 11355 resetPreloading(e); 11356 addClass(elem, lazySizesCfg.loadedClass); 11357 removeClass(elem, lazySizesCfg.loadingClass); 11358 addRemoveLoadEvents(elem, rafSwitchLoadingClass); 11359 triggerEvent(elem, 'lazyloaded'); 11360 }; 11361 var rafedSwitchLoadingClass = rAFIt(switchLoadingClass); 11362 var rafSwitchLoadingClass = function(e){ 11363 rafedSwitchLoadingClass({target: e.target}); 11364 }; 11365 11366 var changeIframeSrc = function(elem, src){ 11367 var loadMode = elem.getAttribute('data-load-mode') || lazySizesCfg.iframeLoadMode; 11368 11369 // loadMode can be also a string! 11370 if (loadMode == 0) { 11371 elem.contentWindow.location.replace(src); 11372 } else if (loadMode == 1) { 11373 elem.src = src; 11374 } 11375 }; 11376 11377 var handleSources = function(source){ 11378 var customMedia; 11379 11380 var sourceSrcset = source[_getAttribute](lazySizesCfg.srcsetAttr); 11381 11382 if( (customMedia = lazySizesCfg.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){ 11383 source.setAttribute('media', customMedia); 11384 } 11385 11386 if(sourceSrcset){ 11387 source.setAttribute('srcset', sourceSrcset); 11388 } 11389 }; 11390 11391 var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){ 11392 var src, srcset, parent, isPicture, event, firesLoad; 11393 11394 if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){ 11395 11396 if(sizes){ 11397 if(isAuto){ 11398 addClass(elem, lazySizesCfg.autosizesClass); 11399 } else { 11400 elem.setAttribute('sizes', sizes); 11401 } 11402 } 11403 11404 srcset = elem[_getAttribute](lazySizesCfg.srcsetAttr); 11405 src = elem[_getAttribute](lazySizesCfg.srcAttr); 11406 11407 if(isImg) { 11408 parent = elem.parentNode; 11409 isPicture = parent && regPicture.test(parent.nodeName || ''); 11410 } 11411 11412 firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture)); 11413 11414 event = {target: elem}; 11415 11416 addClass(elem, lazySizesCfg.loadingClass); 11417 11418 if(firesLoad){ 11419 clearTimeout(resetPreloadingTimer); 11420 resetPreloadingTimer = setTimeout(resetPreloading, 2500); 11421 addRemoveLoadEvents(elem, rafSwitchLoadingClass, true); 11422 } 11423 11424 if(isPicture){ 11425 forEach.call(parent.getElementsByTagName('source'), handleSources); 11426 } 11427 11428 if(srcset){ 11429 elem.setAttribute('srcset', srcset); 11430 } else if(src && !isPicture){ 11431 if(regIframe.test(elem.nodeName)){ 11432 changeIframeSrc(elem, src); 11433 } else { 11434 elem.src = src; 11435 } 11436 } 11437 11438 if(isImg && (srcset || isPicture)){ 11439 updatePolyfill(elem, {src: src}); 11440 } 11441 } 11442 11443 if(elem._lazyRace){ 11444 delete elem._lazyRace; 11445 } 11446 removeClass(elem, lazySizesCfg.lazyClass); 11447 11448 rAF(function(){ 11449 // Part of this can be removed as soon as this fix is older: https://bugs.chromium.org/p/chromium/issues/detail?id=7731 (2015) 11450 var isLoaded = elem.complete && elem.naturalWidth > 1; 11451 11452 if( !firesLoad || isLoaded){ 11453 if (isLoaded) { 11454 addClass(elem, lazySizesCfg.fastLoadedClass); 11455 } 11456 switchLoadingClass(event); 11457 elem._lazyCache = true; 11458 setTimeout(function(){ 11459 if ('_lazyCache' in elem) { 11460 delete elem._lazyCache; 11461 } 11462 }, 9); 11463 } 11464 if (elem.loading == 'lazy') { 11465 isLoading--; 11466 } 11467 }, true); 11468 }); 11469 11470 /** 11471 * 11472 * @param elem { Element } 11473 */ 11474 var unveilElement = function (elem){ 11475 if (elem._lazyRace) {return;} 11476 var detail; 11477 11478 var isImg = regImg.test(elem.nodeName); 11479 11480 //allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw") 11481 var sizes = isImg && (elem[_getAttribute](lazySizesCfg.sizesAttr) || elem[_getAttribute]('sizes')); 11482 var isAuto = sizes == 'auto'; 11483 11484 if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesCfg.errorClass) && hasClass(elem, lazySizesCfg.lazyClass)){return;} 11485 11486 detail = triggerEvent(elem, 'lazyunveilread').detail; 11487 11488 if(isAuto){ 11489 autoSizer.updateElem(elem, true, elem.offsetWidth); 11490 } 11491 11492 elem._lazyRace = true; 11493 isLoading++; 11494 11495 lazyUnveil(elem, detail, isAuto, sizes, isImg); 11496 }; 11497 11498 var afterScroll = debounce(function(){ 11499 lazySizesCfg.loadMode = 3; 11500 throttledCheckElements(); 11501 }); 11502 11503 var altLoadmodeScrollListner = function(){ 11504 if(lazySizesCfg.loadMode == 3){ 11505 lazySizesCfg.loadMode = 2; 11506 } 11507 afterScroll(); 11508 }; 11509 11510 var onload = function(){ 11511 if(isCompleted){return;} 11512 if(Date.now() - started < 999){ 11513 setTimeout(onload, 999); 11514 return; 11515 } 11516 11517 11518 isCompleted = true; 11519 11520 lazySizesCfg.loadMode = 3; 11521 11522 throttledCheckElements(); 11523 11524 addEventListener('scroll', altLoadmodeScrollListner, true); 11525 }; 11526 11527 return { 11528 _: function(){ 11529 started = Date.now(); 11530 11531 lazysizes.elements = document.getElementsByClassName(lazySizesCfg.lazyClass); 11532 preloadElems = document.getElementsByClassName(lazySizesCfg.lazyClass + ' ' + lazySizesCfg.preloadClass); 11533 11534 addEventListener('scroll', throttledCheckElements, true); 11535 11536 addEventListener('resize', throttledCheckElements, true); 11537 11538 addEventListener('pageshow', function (e) { 11539 if (e.persisted) { 11540 var loadingElements = document.querySelectorAll('.' + lazySizesCfg.loadingClass); 11541 11542 if (loadingElements.length && loadingElements.forEach) { 11543 requestAnimationFrame(function () { 11544 loadingElements.forEach( function (img) { 11545 if (img.complete) { 11546 unveilElement(img); 11547 } 11548 }); 11549 }); 11550 } 11551 } 11552 }); 11553 11554 if(window.MutationObserver){ 11555 new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} ); 11556 } else { 11557 docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true); 11558 docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true); 11559 setInterval(throttledCheckElements, 999); 11560 } 11561 11562 addEventListener('hashchange', throttledCheckElements, true); 11563 11564 //, 'fullscreenchange' 11565 ['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend'].forEach(function(name){ 11566 document[_addEventListener](name, throttledCheckElements, true); 11567 }); 11568 11569 if((/d$|^c/.test(document.readyState))){ 11570 onload(); 11571 } else { 11572 addEventListener('load', onload); 11573 document[_addEventListener]('DOMContentLoaded', throttledCheckElements); 11574 setTimeout(onload, 20000); 11575 } 11576 11577 if(lazysizes.elements.length){ 11578 checkElements(); 11579 rAF._lsFlush(); 11580 } else { 11581 throttledCheckElements(); 11582 } 11583 }, 11584 checkElems: throttledCheckElements, 11585 unveil: unveilElement, 11586 _aLSL: altLoadmodeScrollListner, 11587 }; 11588 })(); 11589 11590 11591 var autoSizer = (function(){ 11592 var autosizesElems; 11593 11594 var sizeElement = rAFIt(function(elem, parent, event, width){ 11595 var sources, i, len; 11596 elem._lazysizesWidth = width; 11597 width += 'px'; 11598 11599 elem.setAttribute('sizes', width); 11600 11601 if(regPicture.test(parent.nodeName || '')){ 11602 sources = parent.getElementsByTagName('source'); 11603 for(i = 0, len = sources.length; i < len; i++){ 11604 sources[i].setAttribute('sizes', width); 11605 } 11606 } 11607 11608 if(!event.detail.dataAttr){ 11609 updatePolyfill(elem, event.detail); 11610 } 11611 }); 11612 /** 11613 * 11614 * @param elem {Element} 11615 * @param dataAttr 11616 * @param [width] { number } 11617 */ 11618 var getSizeElement = function (elem, dataAttr, width){ 11619 var event; 11620 var parent = elem.parentNode; 11621 11622 if(parent){ 11623 width = getWidth(elem, parent, width); 11624 event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr}); 11625 11626 if(!event.defaultPrevented){ 11627 width = event.detail.width; 11628 11629 if(width && width !== elem._lazysizesWidth){ 11630 sizeElement(elem, parent, event, width); 11631 } 11632 } 11633 } 11634 }; 11635 11636 var updateElementsSizes = function(){ 11637 var i; 11638 var len = autosizesElems.length; 11639 if(len){ 11640 i = 0; 11641 11642 for(; i < len; i++){ 11643 getSizeElement(autosizesElems[i]); 11644 } 11645 } 11646 }; 11647 11648 var debouncedUpdateElementsSizes = debounce(updateElementsSizes); 11649 11650 return { 11651 _: function(){ 11652 autosizesElems = document.getElementsByClassName(lazySizesCfg.autosizesClass); 11653 addEventListener('resize', debouncedUpdateElementsSizes); 11654 }, 11655 checkElems: debouncedUpdateElementsSizes, 11656 updateElem: getSizeElement 11657 }; 11658 })(); 11659 11660 var init = function(){ 11661 if(!init.i && document.getElementsByClassName){ 11662 init.i = true; 11663 autoSizer._(); 11664 loader._(); 11665 } 11666 }; 11667 11668 setTimeout(function(){ 11669 if(lazySizesCfg.init){ 11670 init(); 11671 } 11672 }); 11673 11674 lazysizes = { 11675 /** 11676 * @type { LazySizesConfigPartial } 11677 */ 11678 cfg: lazySizesCfg, 11679 autoSizer: autoSizer, 11680 loader: loader, 11681 init: init, 11682 uP: updatePolyfill, 11683 aC: addClass, 11684 rC: removeClass, 11685 hC: hasClass, 11686 fire: triggerEvent, 11687 gW: getWidth, 11688 rAF: rAF, 11689 }; 11690 11691 return lazysizes; 11692} 11693));
11694 11695 11696/***/ }), 11697 11698/***/ 5222: 11699/***/ (function(module, exports, __webpack_require__) { 11700 11701var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 11702This lazySizes extension adds better support for print. 11703In case the user starts to print lazysizes will load all images. 11704*/ 11705(function(window, factory) { 11706 var globalInstall = function(){ 11707 factory(window.lazySizes); 11708 window.removeEventListener('lazyunveilread', globalInstall, true); 11709 }; 11710 11711 factory = factory.bind(null, window, window.document); 11712 11713 if( true && module.exports){ 11714 factory(__webpack_require__(7090)); 11715 } else if (true) { 11716 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(7090)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 11717 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 11718 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 11719 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 11720 } else {} 11721}(window, function(window, document, lazySizes) { 11722 /*jshint eqnull:true */ 11723 'use strict'; 11724 var config, elements, onprint, printMedia; 11725 // see also: http://tjvantoll.com/2012/06/15/detecting-print-requests-with-javascript/ 11726 if(window.addEventListener){ 11727 config = lazySizes && lazySizes.cfg; 11728 elements = config.lazyClass || 'lazyload'; 11729 onprint = function(){ 11730 var i, len; 11731 if(typeof elements == 'string'){ 11732 elements = document.getElementsByClassName(elements); 11733 } 11734 11735 if(lazySizes){ 11736 for(i = 0, len = elements.length; i < len; i++){ 11737 lazySizes.loader.unveil(elements[i]); 11738 } 11739 } 11740 }; 11741 11742 addEventListener('beforeprint', onprint, false); 11743 11744 if(!('onbeforeprint' in window) && window.matchMedia && (printMedia = matchMedia('print')) && printMedia.addListener){ 11745 printMedia.addListener(function(){ 11746 if(printMedia.matches){ 11747 onprint(); 11748 } 11749 }); 11750 } 11751 } 11752})); 11753 11754 11755/***/ }) 11756 11757/******/ }); 11758/************************************************************************/ 11759/******/ // The module cache 11760/******/ var __webpack_module_cache__ = {}; 11761/******/ 11762/******/ // The require function 11763/******/ function __webpack_require__(moduleId) { 11764/******/ // Check if module is in cache 11765/******/ var cachedModule = __webpack_module_cache__[moduleId]; 11766/******/ if (cachedModule !== undefined) { 11767/******/ return cachedModule.exports; 11768/******/ } 11769/******/ // Create a new module (and put it into the cache) 11770/******/ var module = __webpack_module_cache__[moduleId] = { 11771/******/ // no module.id needed 11772/******/ // no module.loaded needed 11773/******/ exports: {} 11774/******/ }; 11775/******/ 11776/******/ // Execute the module function 11777/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 11778/******/ 11779/******/ // Return the exports of the module 11780/******/ return module.exports; 11781/******/ } 11782/******/ 11783/************************************************************************/ 11784/******/ /* webpack/runtime/compat get default export */ 11785/******/ !function() { 11786/******/ // getDefaultExport function for compatibility with non-harmony modules 11787/******/ __webpack_require__.n = function(module) {
vendor: 16,384 bytes, lines 11788-11820
11788/******/ var getter = module && module.__esModule ? 11789/******/ function() { return module['default']; } : 11790/******/ function() { return module; }; 11791/******/ __webpack_require__.d(getter, { a: getter }); 11792/******/ return getter; 11793/******/ }; 11794/******/ }(); 11795/******/ 11796/******/ /* webpack/runtime/define property getters */ 11797/******/ !function() { 11798/******/ // define getter functions for harmony exports 11799/******/ __webpack_require__.d = function(exports, definition) { 11800/******/ for(var key in definition) { 11801/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 11802/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 11803/******/ } 11804/******/ } 11805/******/ }; 11806/******/ }(); 11807/******/ 11808/******/ /* webpack/runtime/hasOwnProperty shorthand */ 11809/******/ !function() { 11810/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 11811/******/ }(); 11812/******/ 11813/************************************************************************/ 11814var __webpack_exports__ = {}; 11815// This entry need to be wrapped in an IIFE because it need to be in strict mode. 11816!function() { 11817"use strict"; 11818 11819;// CONCATENATED MODULE: ./node_modules/@lottiefiles/dotlottie-web/dist/index.js 11820function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},a=class{constructor(){r(this,`_lastHandleId`,0),r(this,`_lastImmediate`,null)}requestAnimationFrame(e){return this._lastHandleId>=2**53-1&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{e(Date.now())}),this._lastHandleId}cancelAnimationFrame(e){this._lastImmediate&&clearImmediate(this._lastImmediate)}},o=class{constructor(){r(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new i:new a}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}};const s=typeof window<`u`&&window.document!==void 0,c=new Uint8Array([80,75,3,4]),l=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],u=`0.70.0`,d=`@lottiefiles/dotlottie-web`;let f;const p=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&p.decode();let m=null;function h(){return(m===null||m.byteLength===0)&&(m=new Uint8Array(f.memory.buffer)),m}function g(e,t){return e>>>=0,p.decode(h().subarray(e,e+t))}function _(e){let t=f.__externref_table_alloc_command_export();return f.__wbindgen_export_3.set(t,e),t}function ee(e,t){try{return e.apply(this,t)}catch(e){let t=_(e);f.__wbindgen_exn_store_command_export(t)}}let v=0;const y=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},b=typeof y.encodeInto==`function`?function(e,t){return y.encodeInto(e,t)}:function(e,t){let n=y.encode(e);return t.set(n),{read:e.length,written:n.length}};function x(e,t,n){if(n===void 0){let n=y.encode(e),r=t(n.length,1)>>>0;return h().subarray(r,r+n.length).set(n),v=n.length,r}let r=e.length,i=t(r,1)>>>0,a=h(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=h().subarray(i+o,i+r),a=b(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return v=o,i}let S=null;function C(){return(S===null||S.buffer.detached===!0||S.buffer.detached===void 0&&S.buffer!==f.memory.buffer)&&(S=new DataView(f.memory.buffer)),S}function w(e){return e==null}let T=null;function te(){return(T===null||T.byteLength===0)&&(T=new Float32Array(f.memory.buffer)),T}function ne(e,t){let n=t(e.length*4,4)>>>0;return te().set(e,n/4),v=e.length,n}function E(e,t){let n=t(e.length*1,1)>>>0;return h().set(e,n/1),v=e.length,n}function D(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=_(e[t]);C().setUint32(n+4*t,r,!0)}return v=e.length,n}function O(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v,i=E(t,f.__wbindgen_malloc_command_export),a=v;return f.register_font(n,r,i,a)!==0}const k=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),A=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>f.__wbg_dotlottieplayerwasm_free(e>>>0,1));var j=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,A.unregister(this),e}free(){let e=this.__destroy_into_raw();f.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return f.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return f.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=f.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],g(n[0],n[1])}finally{f.__wbindgen_free_command_export(e,t,1)}}loop_count(){return f.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return f.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;f.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return f.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}has_segment(){return f.dotlottieplayerwasm_has_segment(this.__wbg_ptr)!==0}is_complete(){return f.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return f.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return f.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return f.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return f.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return f.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return f.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=f.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=g(e[0],e[1]).slice(),f.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}clear_marker(){f.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){f.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return f.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=g(r[0],r[1]).slice(),f.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return f.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){f.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v,i=x(t,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),a=v;return f.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return f.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return f.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return f.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return f.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=g(r[0],r[1]).slice(),f.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=f.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],g(n[0],n[1])}finally{f.__wbindgen_free_command_export(e,t,1)}}get_transform(){return f.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}request_frame(){return f.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}segment_start(){return f.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v,i=x(t,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),a=v;return f.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=ne(e,f.__wbindgen_malloc_command_export),n=v;return f.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return f.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return f.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){f.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return f.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=f.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=g(e[0],e[1]).slice(),f.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return f.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return f.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e,t,n){let r=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_load_animation(this.__wbg_ptr,r,i,t,n)!==0}loop_animation(){return f.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_color_slot(e,t,n,r){let i=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),a=v;return f.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){f.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;f.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=f.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],g(n[0],n[1])}finally{f.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v;return f.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}background_color(){return f.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}get_layer_bounds(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_pixel_buffer(){return f.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}segment_duration(){return f.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}sm_current_state(){let e,t;try{let n=f.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],g(n[0],n[1])}finally{f.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=f.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=g(e[0],e[1]).slice(),f.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=g(r[0],r[1]).slice(),f.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return f.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return f.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){f.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e,t,n){let r=E(e,f.__wbindgen_malloc_command_export),i=v;return f.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,r,i,t,n)!==0}sm_get_string_input(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=g(r[0],r[1]).slice(),f.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v,i=x(t,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),a=v;return f.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}set_background_color(e){return f.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)!==0}sm_get_boolean_input(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v,r=f.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){f.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){f.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){f.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v;return f.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v;return f.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){f.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){f.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}clear_background_color(){return f.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)!==0}load_animation_from_id(e,t,n){let r=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,r,i,t,n)!==0}sm_poll_internal_event(){return f.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return f.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){f.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v;return f.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_state_machine_load_from_id(t
11820his.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){f.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){return this.__wbg_ptr=f.dotlottieplayerwasm_new()>>>0,A.register(this,this.__wbg_ptr,this),this}mode(){return f.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return f.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}seek(e){return f.dotlottieplayerwasm_seek(this.__wbg_ptr,e)!==0}stop(){return f.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(){return f.dotlottieplayerwasm_tick(this.__wbg_ptr)!==0}clear(){f.dotlottieplayerwasm_clear(this.__wbg_ptr)}pause(){return f.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return f.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return f.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return f.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return f.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}resize(e,t){return f.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)!==0}markers(){return f.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return f.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(){return f.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)!==0}autoplay(){return f.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return f.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){f.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){f.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=D(t,f.__wbindgen_malloc_command_export),r=v;return f.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=f.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=g(e[0],e[1]).slice(),f.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}intersect(e,t,n){let r=x(n,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;return f.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,r,i)!==0}is_loaded(){return f.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return f.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),r=v,i=E(t,f.__wbindgen_malloc_command_export),a=v;return f.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return f.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){f.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=x(e,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),n=v;return f.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=f.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],g(n[0],n[1])}finally{f.__wbindgen_free_command_export(e,t,1)}}};async function M(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function N(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(g(e,t))}finally{f.__wbindgen_free_command_export(n,r,1)}},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return Error()},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)}
11820,e.wbg.__wbg_now_807e54c39636c349=function(){return Date.now()},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return ee(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=x(n,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),i=v;C().setInt32(e+4,i,!0),C().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=f.__wbindgen_export_3,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return f.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=w(r)?0:x(r,f.__wbindgen_malloc_command_export,f.__wbindgen_realloc_command_export),a=v;C().setInt32(e+4,a,!0),C().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return g(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(g(e,t))},e}function P(e,t){return f=e.exports,F.__wbindgen_wasm_module=t,S=null,T=null,m=null,f.__wbindgen_start(),f}async function F(e){if(f!==void 0)return f;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0)throw Error(`WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().`);let t=N();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await M(await e,t);return P(n,r)}var I=class{constructor(){r(this,`_eventListeners`,new Map)}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),n.size===0&&this._eventListeners.delete(e)):this._eventListeners.delete(e))}dispatch(e){this._eventListeners.get(e.type)?.forEach(t=>t(e))}removeAllEventListeners(){this._eventListeners.clear()}},L=class e{static _initializeObserver(){e._observer||(e._observer=new IntersectionObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);n&&(t.isIntersecting?n.unfreeze():n.freeze())})},{threshold:0}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,n),e._observer?.observe(t))}static unobserve(t){e._observer?.unobserve(t),e._observedCanvases.delete(t),e._observedCanvases.size===0&&(e._observer?.disconnect(),e._observer=null)}};r(L,`_observer`,null),r(L,`_observedCanvases`,new Map);var R=class e{static _initializeObserver(){e._observer||(e._observer=new ResizeObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);if(!n)return;let[r,i]=n;clearTimeout(i);let a=setTimeout(()=>{r.resize()},100);e._observedCanvases.set(t.target,[r,a])})}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,[n,0]),e._observer?.observe(t))}static unobserve(t){let n=e._observedCanvases.get(t);if(n){let e=n[1];e&&clearTimeout(e)}e._observer?.unobserve(t),e._observedCanvases.delete(t),!e._observedCanvases.size&&e._observer&&(e._observer.disconnect(),e._observer=null)}};r(R,`_observer`,null),r(R,`_observedCanvases`,new Map);function re(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function z(e){if(!re(e))return 0;let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,parseInt(t,16)}function B(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,c.byteLength));for(let e=0;e<c.length;e+=1)if(c[e]!==t[e])return!1;return!0}function V(e){return l.every(t=>Object.hasOwn(e,t))}function H(e){if(typeof e==`string`)try{return V(JSON.parse(e))}catch{return!1}else return V(e)}function U(){return 1+((s?window.devicePixelRatio:1)-1)*.75}function W(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>n||t.right<0||t.left>r)}function G(e){let t=e.target;if(t instanceof HTMLCanvasElement){let n=t.getBoundingClientRect();if(n.width===0||n.height===0||t.width===0||t.height===0)return null;let r=t.width/n.width,i=t.height/n.height,a=(e.clientX-n.left)*r,o=(e.clientY-n.top)*i;return!Number.isFinite(a)||!Number.isFinite(o)||Number.isNaN(a)||Number.isNaN(o)?null:{x:a,y:o}}return null}function K(e){let t=e.replace(`OpenUrl: `,``),n=t.indexOf(` | Target: `),r,i;
11820n===-1?(r=t,i=`_blank`):(r=t.substring(0,n),i=t.substring(n+11)),window.open(r,i)}function q(e,t,n){let r=null,i=t;return{load(){return r||(r=e({module_or_path:i}).then(()=>void 0).catch(async t=>{console.warn(`Primary WASM load failed from ${i}: ${t.message}`),console.warn(`Attempting to load WASM from backup URL: ${n}`);try{await e({module_or_path:n})}catch(e){throw console.error(`Primary WASM URL failed: ${t.message}`),console.error(`Backup WASM URL failed: ${e.message}`),r=null,Error(`WASM loading failed from all sources.`)}})),r},setWasmUrl(e){e!==i&&(i=e,r=null)}}}const J=q(F,`https://cdn.jsdelivr.net/npm/${d}@${u}/dist/dotlottie-player.wasm`,`https://unpkg.com/${d}@${u}/dist/dotlottie-player.wasm`),Y=e=>{switch(e){case`reverse`:return k.Reverse;case`bounce`:return k.Bounce;case`reverse-bounce`:return k.ReverseBounce;default:return k.Forward}},ie=e=>{switch(e){case k.Reverse:return`reverse`;case k.Bounce:return`bounce`;case k.ReverseBounce:return`reverse-bounce`;default:return`forward`}},X=e=>{switch(e){case`contain`:return`contain`;case`cover`:return`cover`;case`fill`:return`fill`;case`fit-height`:return`fit-height`;case`fit-width`:return`fit-width`;case`none`:return`none`;default:return`contain`}};var ae=class{constructor(e){r(this,`_canvas`,null),r(this,`_pendingLoad`,null),r(this,`_context`,null),r(this,`_eventManager`,void 0),r(this,`_animationFrameId`,null),r(this,`_frameManager`,void 0),r(this,`_dotLottieCore`,null),r(this,`_stateMachineId`,``),r(this,`_stateMachineConfig`,null),r(this,`_isStateMachineRunning`,!1),r(this,`_renderConfig`,{}),r(this,`_isFrozen`,!1),r(this,`_backgroundColor`,null),r(this,`_boundOnClick`,null),r(this,`_boundOnPointerUp`,null),r(this,`_boundOnPointerDown`,null),r(this,`_boundOnPointerMove`,null),r(this,`_boundOnPointerEnter`,null),r(this,`_boundOnPointerLeave`,null),r(this,`_bufferMismatchCount`,0),r(this,`_lastExpectedBufferSize`,0),r(this,`_marker`,``),this._canvas=e.canvas??null,this._eventManager=new I,this._frameManager=new o,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||U(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(Y(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2&&this._dotLottieCore.set_segment(e.segment[0],e.segment[1]),this._marker=e.marker??``,this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._stateMachineId=e.stateMachineId??``,this._stateMachineConfig=e.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:`ready`}),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return J.load()}_createCore(){return new j}_onCoreCreated(){}_drainPlayerEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.poll_event())!=null;){let t=e;switch(t.type){case`Load`:setTimeout(()=>this._eventManager.dispatch({type:`load`}),0);break;case`LoadError`:setTimeout(()=>this._eventManager.dispatch({type:`loadError`,error:Error(`failed to load`)}),0);break;case`Play`:setTimeout(()=>this._eventManager.dispatch({type:`play`}),0);break;case`Pause`:setTimeout(()=>this._eventManager.dispatch({type:`pause`}),0);break;case`Stop`:setTimeout(()=>this._eventManager.dispatch({type:`stop`}),0);break;case`Frame`:setTimeout(()=>this._eventManager.dispatch({type:`frame`,currentFrame:t.frameNo??0}),0);break;case`Render`:setTimeout(()=>this._eventManager.dispatch({type:`render`,currentFrame:t.frameNo??0}),0);break;case`Loop`:setTimeout(()=>this._eventManager.dispatch({type:`loop`,loopCount:t.loopCount??0}),0);break;case`Complete`:setTimeout(()=>this._eventManager.dispatch({type:`complete`}),0);break;default:break}}}_drainSmEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.sm_poll_event())!=null;){let t=e;switch(t.type){case`Start`:setTimeout(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()},0);break;case`Stop`:setTimeout(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()},0);break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:t.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:t.name??``,newValue:t.
11820newValue,oldValue:t.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:t.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:t.previousState??``,toState:t.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:t.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:t.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:t.message??``});break;default:break}}let t;for(;(t=this._dotLottieCore.sm_poll_internal_event())!=null;){let e=t;if(e.type===`Message`){let t=e.message??``;s&&t.startsWith(`OpenUrl: `)?K(t):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:t})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return B(n)?n:new TextDecoder().decode(n)}_loadFromData(e){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}let t=this._canvas.width,n=this._canvas.height,r=!1;if(typeof e==`string`){if(!H(e)){this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(e,t,n)}else if(e instanceof ArrayBuffer){if(!B(e)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}r=this._dotLottieCore.load_dotlottie_data(new Uint8Array(e),t,n)}else if(typeof e==`object`){if(!H(e)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(JSON.stringify(e),t,n)}else{this._dispatchError(`Unsupported data type for animation data. Expected: 11821 - string (Lottie JSON), 11822 - ArrayBuffer (dotLottie), 11823 - object (Lottie JSON). 11824 Received: ${typeof e}`);return}r?(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),s&&this.resize(),this._drainPlayerEvents(),this._marker&&this._dotLottieCore.set_marker(this._marker),setTimeout(()=>{this._eventManager.dispatch({type:`frame`,currentFrame:this.currentFrame})},0),this._dotLottieCore.render(),this._drainPlayerEvents(),this._draw(),this._stateMachineId?this.stateMachineLoad(this._stateMachineId)&&this.stateMachineStart()&&this._startAnimationLoop():this._dotLottieCore.is_playing()&&this._startAnimationLoop(),s&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(L.observe(this._canvas,this),W(this._canvas)||this.freeze()),this._renderConfig.autoResize&&R.observe(this._canvas,this))):this._drainPlayerEvents()}_loadFromSrc(e){this._fetchData(e).then(e=>this._loadFromData(e)).catch(t=>this._dispatchError(`Failed to load animation data from URL: ${e}. ${t}`))}get buffer(){return this._dotLottieCore?this._dotLottieCore.get_pixel_buffer():null}get activeAnimationId(){return this._dotLottieCore?.animation_id()??void 0}get activeThemeId(){return this._dotLottieCore?.theme_id()??void 0}get layout(){if(this._dotLottieCore)return{align:[this._dotLottieCore.layout_align_x(),this._dotLottieCore.layout_align_y()],fit:X(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??``}get manifest(){try{let e=this._dotLottieCore?.manifest_string();if(this._dotLottieCore===null||!e)return null;let t=JSON.parse(e);return Object.keys(t).length===0?null:t}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){if(!(!this._dotLottieCore||!this._dotLottieCore.has_segment()))return[this._dotLottieCore.segment_start(),this._dotLottieCore.segment_end()]}get loop(){return this._dotLottieCore?.loop_animation()??!1}get mode(){return this._dotLottieCore?ie(this._dotLottieCore.mode()):`forward`}get isFrozen(){return this._isFrozen}get isStateMachineRunning(){return this._isStateMachineRunning}get backgroundColor(){return this._backgroundColor??``}get autoplay(){return this._dotLottieCore?.autoplay()??!1}get useFrameInterpolation(){return this._dotLottieCore?.use_frame_interpolation()??!1}get speed(){return this._dotLottieCore?.speed()??0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return this._dotLottieCore?.is_loaded()??!1}get isPlaying(){return this._dotLottieCore?.is_playing()??!1}get isPaused(){return this._dotLottieCore?.is_paused()??!1}get isStopped(){return this._dotLottieCore?.is_stopped()??!1}get currentFrame(){return this._dotLottieCore?Math.round(this._dotLottieCore.current_frame()*100)/100:0}get loopCount(){return this._dotLottieCore?.current_loop_count()??0}get totalFrames(){return this._dotLottieCore?.total_frames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segment_duration()??0}get canvas(){return this._canvas}load(e){this._dotLottieCore!==null&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(Y(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2?this._dotLottieCore.set_segment(e.segment[0],e.segment[1]):this._dotLottieCore.clear_segment(),this._marker=e.marker??``,this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),e.data?this._canvas?this._loadFromData(e.data):this._pe
11824ndingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),this.setBackgroundColor(e.backgroundColor??``))}_draw(){if(!(this._dotLottieCore===null||this._canvas===null)&&(!this._context&&`getContext`in this._canvas&&typeof this._canvas.getContext==`function`&&(typeof HTMLCanvasElement<`u`&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext(`2d`)),this._context)){let e=this._dotLottieCore.get_pixel_buffer(),t=this._canvas.width*this._canvas.height*4;if(e.byteLength!==t){this._lastExpectedBufferSize===t?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=t),this._bufferMismatchCount===10&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${t} bytes for canvas ${this._canvas.width}x${this._canvas.height}, but got ${e.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`);return}this._bufferMismatchCount=0,this._lastExpectedBufferSize=t;let n=null,r=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);typeof ImageData>`u`?(n=this._context.createImageData(this._canvas.width,this._canvas.height),n.data.set(r)):n=new ImageData(r,this._canvas.width,this._canvas.height),this._context.putImageData(n,0,0)}}_cleanupCanvas(){this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&(L.unobserve(this._canvas),R.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(L.observe(this._canvas,this),W(this._canvas)||this.freeze()),this._renderConfig.autoResize&&R.observe(this._canvas,this),this._isStateMachineRunning&&this._setupStateMachineListeners()),this._canvas&&this._dotLottieCore&&this.isLoaded&&this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}_setupRendererOnCanvas(){this._context=null}_stopAnimationLoop(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null)}_startAnimationLoop(){this._animationFrameId===null&&this._dotLottieCore&&!this._isFrozen&&(this._dotLottieCore.is_playing()||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this)))}_animationLoop(){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(!this._dotLottieCore.is_playing()&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{let e=this._isStateMachineRunning?this._dotLottieCore.sm_tick():this._dotLottieCore.tick();this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),e&&this._draw(),this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this))}catch(e){console.error(`Error in animation frame:`,e),this._eventManager.dispatch({type:`renderError`,error:e}),e instanceof WebAssembly.RuntimeError&&this.destroy()}}play(){if(this._dotLottieCore===null||!this.isLoaded)return;this._stopAnimationLoop();let e=this._dotLottieCore.play();this._drainPlayerEvents(),(e||this._dotLottieCore.is_playing())&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!W(this._canvas)&&this.freeze()}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(this._dotLottieCore===null)return;let e=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),e&&(this._eventManager.dispatch({type:`frame`,currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(e){if(this._dotLottieCore!==null&&this._dotLottieCore.seek(e)){let e=this._dotLottieCore.render();this._drainPlayerEvents(),e&&this._draw()}}setSpeed(e){this._dotLottieCore!==null&&this._dotLottieCore.set_speed(e)}setBackgroundColor(e){this._dotLottieCore!==null&&(s&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=e:this._dotLottieCore.set_background_color(z(e)),this._backgroundColor=e)}setLoop(e){this._dotLottieCore!==null&&this._dotLottieCore.set_loop(e)}setLoopCount(e){this._dotLottieCore!==null&&this._dotLottieCore.set_loop_count(e)}setUseFrameInterpolation(e){this._dotLottieCore!==null&&this._dotLottieCore.set_use_frame_interpolation(e)}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._dotLottieCore?.free(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:`destroy`}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners()}freeze(){this._animationFrameId!==null&&(this._stopAnimationLoop(),this._isFrozen=!0,this._eventManager.dispatch({type:`freeze`}))}unfreeze(){this._animationFrameId===null&&(this._isFrozen=!1,this._eventManager.dispatch({type:`unfreeze`}),this._startAnimationLoop())}resize(){if(!(!this._dotLottieCore||!this.isLoaded||!this._canvas)){if(s&&this._canvas instanceof HTMLCanvasElement){let e=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:t,width:n}=this._canvas.getBoundingClientRect();t!==0&&n!==0&&(this._canvas.width=n*e,this._canvas.height=t*e)}this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}}setCanvas(e){if(!(!e||this._canvas===e)&&(this._canvas&&this._cleanupCanvas(),this._canvas=e,this._initializeCanvas(),this._pendingLoad)){let e=this._pe
vendor: 5,391 bytes, line 11824
11824ndingLoad;this._pendingLoad=null,e.data?this._loadFromData(e.data):e.src&&this._loadFromSrc(e.src)}}setTransform(e){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.set_transform(new Float32Array(e));return t&&this._dotLottieCore.render()&&this._draw(),t}getTransform(){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_transform();return Array.from(e)}setSegment(e,t){this._dotLottieCore!==null&&this._dotLottieCore.set_segment(e,t)}setMode(e){this._dotLottieCore!==null&&this._dotLottieCore.set_mode(Y(e))}setRenderConfig(e){let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:t||U(),freezeOnOffscreen:n??!0,...r!==void 0&&{quality:r}},r!==void 0&&this._dotLottieCore&&this._dotLottieCore.set_quality(r),s&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?R.observe(this._canvas,this):R.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(L.observe(this._canvas,this),W(this._canvas)||this.freeze()):(L.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(e){this._dotLottieCore===null||this._dotLottieCore.animation_id()===e||!this._canvas||(this._dotLottieCore.load_animation_from_id(e,this._canvas.width,this._canvas.height)?(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),this.resize(),this._drainPlayerEvents(),this._dotLottieCore.render(),this._draw()):this._dispatchError(`Failed to load animation with id: ${e}`))}setMarker(e){this._dotLottieCore!==null&&(this._marker=e,this._dotLottieCore.set_marker(e))}markers(){let e=this._dotLottieCore?.markers();return e&&Array.isArray(e)?e:[]}setTheme(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.set_theme(e);return t&&(this._dotLottieCore.render(),this._draw()),t}resetTheme(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_theme();return e&&(this._dotLottieCore.render(),this._draw()),e}setThemeData(e){if(this._dotLottieCore===null)return!1;let t=typeof e==`string`?e:JSON.stringify(e),n=this._dotLottieCore.set_theme_data(t);return n&&(this._dotLottieCore.render(),this._draw()),n}setSlots(e){this._dotLottieCore!==null&&this._dotLottieCore.set_slots_str(JSON.stringify(e))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`t`in e[0]&&`s`in e[0]}getSlotIds(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.get_slot_ids();return Array.isArray(e)?e:[]}getSlotType(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_type(e);if(t)return t}getSlot(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_str(e);if(t)try{return JSON.parse(t)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._isKeyframeArray(t),r=JSON.stringify({a:n?1:0,k:t}),i=this._dotLottieCore.set_slot_str(e,r);return this._dotLottieCore.render(),this._draw(),i}setScalarSlot(e,t){if(this._dotLottieCore===null)return!1;let n=typeof t!=`number`,r=JSON.stringify({a:n?1:0,k:t}),i=this._dotLottieCore.set_slot_str(e,r);return this._dotLottieCore.render(),this._draw(),i}setVectorSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._isKeyframeArray(t),r=JSON.stringify({a:n?1:0,k:t}),i=this._dotLottieCore.set_slot_str(e,r);return this._dotLottieCore.render(),this._draw(),i}setGradientSlot(e,t,n){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(t),i=JSON.stringify({k:{a:r?1:0,k:t},p:n}),a=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),a}setTextSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._dotLottieCore.get_slot_str(e),r=t;if(n){let e=JSON.parse(n);if(e&&`k`in e&&Array.isArray(e.k)){let n=e.k[0];`s`in n&&typeof n.s==`object`&&(r={...n.s,...t})}}let i=JSON.stringify({a:0,k:[{t:0,s:r}]}),a=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),a}resetSlot(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_slot(e);return this._dotLottieCore.render(),this._draw(),t}clearSlot(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.clear_slot(e);return this._dotLottieCore.render(),this._draw(),t}resetSlots(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),e}clearSlots(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),e}setLayout(e){this._dotLottieCore!==null&&this._dotLottieCore.set_layout(e.fit??`contain`,e.align?.[0]??.5,e.align?.[1]??.5)}setViewport(e,t,n,r){return this._dotLottieCore===null?!1:this._dotLottieCore.set_viewport(e,t,n,r)}static setWasmUrl(e){J.setWasmUrl(e)}static async registerFont(e,t){try{await J.load();let n;if(typeof t==`string`){let e=await fetch(t);if(!e.ok)return console.error(`Failed to fetch font from URL: ${t}. Status: ${e.status}`),!1;n=new Uint8Array(await e.arrayBuffer())}else n=t instanceof Uint8Array?t:new Uint8Array(t);let r=O(e,n);return r||console.error(`Failed to register font "${e}". Font data may be invalid.`),r}catch(t){return console.error(`Error registering font "${e}
11824":`,t),!1}}animationSize(){let e=this._dotLottieCore?.animation_size();return{width:e?.[0]??0,height:e?.[1]??0}}getLayerBoundingBox(e){let t=this._dotLottieCore?.get_layer_bounds(e);if(t&&t.length===8)return Array.from(t)}static transformThemeToLottieSlots(e,t){return``}stateMachineLoad(e){return this._dotLottieCore?this._dotLottieCore.state_machine_load_from_id(e):!1}stateMachineLoadData(e){return this._dotLottieCore?this._dotLottieCore.state_machine_load(e):!1}stateMachineSetConfig(e){this._stateMachineConfig=e}stateMachineStart(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),e&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),e}stateMachineStop(){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.sm_stop();return this._drainSmEvents(),e&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.is_playing()||this._stopAnimationLoop()),e}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??``}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??``}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??``}stateMachineOverrideState(e,t=!1){return this._dotLottieCore?.sm_override_current_state(e,t)??!1}stateMachineGet(e){return this._dotLottieCore?.get_state_machine(e)??``}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_framework_setup();return Array.isArray(e)?e:[]}stateMachineSetBooleanInput(e,t){return this._dotLottieCore?.sm_set_boolean_input(e,t)??!1}stateMachineSetNumericInput(e,t){return this._dotLottieCore?.sm_set_numeric_input(e,t)??!1}stateMachineSetStringInput(e,t){return this._dotLottieCore?.sm_set_string_input(e,t)??!1}stateMachineGetBooleanInput(e){return this._dotLottieCore?.sm_get_boolean_input(e)??void 0}stateMachineGetNumericInput(e){return this._dotLottieCore?.sm_get_numeric_input(e)??void 0}stateMachineGetStringInput(e){return this._dotLottieCore?.sm_get_string_input(e)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_get_inputs();return Array.isArray(e)?e:[]}stateMachineFireEvent(e){this._dotLottieCore?.sm_fire(e)}stateMachinePostClickEvent(e,t){this._dotLottieCore?.sm_post_click(e,t)}stateMachinePostPointerUpEvent(e,t){this._dotLottieCore?.sm_post_pointer_up(e,t)}stateMachinePostPointerDownEvent(e,t){this._dotLottieCore?.sm_post_pointer_down(e,t)}stateMachinePostPointerMoveEvent(e,t){this._dotLottieCore?.sm_post_pointer_move(e,t)}stateMachinePostPointerEnterEvent(e,t){this._dotLottieCore?.sm_post_pointer_enter(e,t)}stateMachinePostPointerExitEvent(e,t){this._dotLottieCore?.sm_post_pointer_exit(e,t)}_onClick(e){let t=G(e);t&&this.stateMachinePostClickEvent(t.x,t.y)}_onPointerUp(e){let t=G(e);t&&this.stateMachinePostPointerUpEvent(t.x,t.y)}_onPointerDown(e){let t=G(e);t&&this.stateMachinePostPointerDownEvent(t.x,t.y)}_onPointerMove(e){let t=G(e);t&&this.stateMachinePostPointerMoveEvent(t.x,t.y)}_onPointerEnter(e){let t=G(e);t&&this.stateMachinePostPointerEnterEvent(t.x,t.y)}_onPointerLeave(e){let t=G(e);t&&this.stateMachinePostPointerExitEvent(t.x,t.y)}_setupStateMachineListeners(){if(s&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let e=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),e.includes(`Click`)&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener(`click`,this._boundOnClick)),e.includes(`PointerUp`)&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener(`pointerup`,this._boundOnPointerUp)),e.includes(`PointerDown`)&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener(`pointerdown`,this._boundOnPointerDown)),e.includes(`PointerMove`)&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener(`pointermove`,this._boundOnPointerMove)),e.includes(`PointerEnter`)&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener(`pointerenter`,this._boundOnPointerEnter)),e.includes(`PointerExit`)&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener(`pointerleave`,this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){s&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener(`click`,this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener(`pointerup`,this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener(`pointerdown`,this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener(`pointermove`,this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener(`pointerenter`,this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener(`pointerleave`,this._boundOnPointerLeave),this._boundOnPointerLeave=null))}},oe=class{constructor(){if(typeof Worker>`u`)throw Error(`Worker is not supported in this environment.`);let e=new Blob([new Uint8Array([34,117,115,101,32,115,116,114,105,99,116,34,59,40,40,41,61,62,123,118,97,114,32,111,116,61,79,98,106,101,99,116,46,100,
11824101,102,105,110,101,80,114,111,112,101,114,116,121,59,118,97,114,32,115,116,61,40,110,44,116,44,101,41,61,62,116,32,105,110,32,110,63,111,116,40,110,44,116,44,123,101,110,117,109,101,114,97,98,108,101,58,33,48,44,99,111,110,102,105,103,117,114,97,98,108,101,58,33,48,44,119,114,105,116,97,98,108,101,58,33,48,44,118,97,108,117,101,58,101,125,41,58,110,91,116,93,61,101,59,118,97,114,32,108,61,40,110,44,116,44,101,41,61,62,115,116,40,110,44,116,121,112,101,111,102,32,116,33,61,34,115,121,109,98,111,108,34,63,116,43,34,34,58,116,44,101,41,59,118,97,114,32,70,61,99,108,97,115,115,123,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,125,44,79,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,108,97,115,116,72,97,110,100,108,101,73,100,34,44,48,41,59,108,40,116,104,105,115,44,34,95,108,97,115,116,73,109,109,101,100,105,97,116,101,34,44,110,117,108,108,41,125,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,62,61,78,117,109,98,101,114,46,77,65,88,95,83,65,70,69,95,73,78,84,69,71,69,82,38,38,40,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,61,48,41,44,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,43,61,49,44,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,61,115,101,116,73,109,109,101,100,105,97,116,101,40,40,41,61,62,123,116,40,68,97,116,101,46,110,111,119,40,41,41,125,41,44,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,38,38,99,108,101,97,114,73,109,109,101,100,105,97,116,101,40,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,41,125,125,44,82,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,115,116,114,97,116,101,103,121,34,41,59,116,104,105,115,46,95,115,116,114,97,116,101,103,121,61,116,121,112,101,111,102,32,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,61,61,34,102,117,110,99,116,105,111,110,34,63,110,101,119,32,70,58,110,101,119,32,79,125,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,115,116,114,97,116,101,103,121,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,116,104,105,115,46,95,115,116,114,97,116,101,103,121,46,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,125,59,118,97,114,32,102,61,116,121,112,101,111,102,32,119,105,110,100,111,119,60,34,117,34,38,38,116,121,112,101,111,102,32,119,105,110,100,111,119,46,100,111,99,117,109,101,110,116,60,34,117,34,59,118,97,114,32,84,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,91,56,48,44,55,53,44,51,44,52,93,41,44,72,61,91,34,118,34,44,34,105,112,34,44,34,111,112,34,44,34,108,97,121,101,114,115,34,44,34,102,114,34,44,34,119,34,44,34,104,34,93,44,122,61,34,48,46,55,48,46,48,34,44,68,61,34,64,108,111,116,116,105,101,102,105,108,101,115,47,100,111,116,108,111,116,116,105,101,45,119,101,98,34,44,74,61,46,55,53,44,106,61,52,59,118,97,114,32,111,44,89,61,116,121,112,101,111,102,32,84,101,120,116,68,101,99,111,100,101,114,60,34,117,34,63,110,101,119,32,84,101,120,116,68,101,99,111,100,101,114,40,34,117,116,102,45,56,34,44,123,105,103,110,111,114,101,66,79,77,58,33,48,44,102,97,116,97,108,58,33,48,125,41,58,123,100,101,99,111,100,101,58,40,41,61,62,123,116,104,114,111,119,32,69,114,114,111,114,40,34,84,101,120,116,68,101,99,111,100,101,114,32,110,111,116,32,97,118,97,105,108,97,98,108,101,34,41,125,125,59,116,121,112,101,111,102,32,84,101,120,116,68,101,99,111,100,101,114,60,34,117,34,38,38,89,46,100,101,99,111,100,101,40,41,59,118,97,114,32,67,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,120,40,41,123,114,101,116,117,114,110,40,67,61,61,61,110,117,108,108,124,124,67,46,98,121,116,101,76,101,110,103,116,104,61,61,
1182461,48,41,38,38,40,67,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,67,125,102,117,110,99,116,105,111,110,32,117,40,110,44,116,41,123,114,101,116,117,114,110,32,110,61,110,62,62,62,48,44,89,46,100,101,99,111,100,101,40,120,40,41,46,115,117,98,97,114,114,97,121,40,110,44,110,43,116,41,41,125,102,117,110,99,116,105,111,110,32,88,40,110,41,123,108,101,116,32,116,61,111,46,95,95,101,120,116,101,114,110,114,101,102,95,116,97,98,108,101,95,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,41,59,114,101,116,117,114,110,32,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,112,111,114,116,95,51,46,115,101,116,40,116,44,110,41,44,116,125,102,117,110,99,116,105,111,110,32,105,116,40,110,44,116,41,123,116,114,121,123,114,101,116,117,114,110,32,110,46,97,112,112,108,121,40,116,104,105,115,44,116,41,125,99,97,116,99,104,40,101,41,123,108,101,116,32,114,61,88,40,101,41,59,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,110,95,115,116,111,114,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,114,41,125,125,118,97,114,32,99,61,48,44,80,61,116,121,112,101,111,102,32,84,101,120,116,69,110,99,111,100,101,114,60,34,117,34,63,110,101,119,32,84,101,120,116,69,110,99,111,100,101,114,40,34,117,116,102,45,56,34,41,58,123,101,110,99,111,100,101,58,40,41,61,62,123,116,104,114,111,119,32,69,114,114,111,114,40,34,84,101,120,116,69,110,99,111,100,101,114,32,110,111,116,32,97,118,97,105,108,97,98,108,101,34,41,125,125,44,97,116,61,116,121,112,101,111,102,32,80,46,101,110,99,111,100,101,73,110,116,111,61,61,34,102,117,110,99,116,105,111,110,34,63,102,117,110,99,116,105,111,110,40,110,44,116,41,123,114,101,116,117,114,110,32,80,46,101,110,99,111,100,101,73,110,116,111,40,110,44,116,41,125,58,102,117,110,99,116,105,111,110,40,110,44,116,41,123,108,101,116,32,101,61,80,46,101,110,99,111,100,101,40,110,41,59,114,101,116,117,114,110,32,116,46,115,101,116,40,101,41,44,123,114,101,97,100,58,110,46,108,101,110,103,116,104,44,119,114,105,116,116,101,110,58,101,46,108,101,110,103,116,104,125,125,59,102,117,110,99,116,105,111,110,32,100,40,110,44,116,44,101,41,123,105,102,40,101,61,61,61,118,111,105,100,32,48,41,123,108,101,116,32,112,61,80,46,101,110,99,111,100,101,40,110,41,44,103,61,116,40,112,46,108,101,110,103,116,104,44,49,41,62,62,62,48,59,114,101,116,117,114,110,32,120,40,41,46,115,117,98,97,114,114,97,121,40,103,44,103,43,112,46,108,101,110,103,116,104,41,46,115,101,116,40,112,41,44,99,61,112,46,108,101,110,103,116,104,44,103,125,108,101,116,32,114,61,110,46,108,101,110,103,116,104,44,115,61,116,40,114,44,49,41,62,62,62,48,44,105,61,120,40,41,44,95,61,48,59,102,111,114,40,59,95,60,114,59,95,43,43,41,123,108,101,116,32,112,61,110,46,99,104,97,114,67,111,100,101,65,116,40,95,41,59,105,102,40,112,62,49,50,55,41,98,114,101,97,107,59,105,91,115,43,95,93,61,112,125,105,102,40,95,33,61,61,114,41,123,95,33,61,61,48,38,38,40,110,61,110,46,115,108,105,99,101,40,95,41,41,44,115,61,101,40,115,44,114,44,114,61,95,43,110,46,108,101,110,103,116,104,42,51,44,49,41,62,62,62,48,59,108,101,116,32,112,61,120,40,41,46,115,117,98,97,114,114,97,121,40,115,43,95,44,115,43,114,41,44,103,61,97,116,40,110,44,112,41,59,95,43,61,103,46,119,114,105,116,116,101,110,44,115,61,101,40,115,44,114,44,95,44,49,41,62,62,62,48,125,114,101,116,117,114,110,32,99,61,95,44,115,125,118,97,114,32,121,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,76,40,41,123,114,101,116,117,114,110,40,121,61,61,61,110,117,108,108,124,124,121,46,98,117,102,102,101,114,46,100,101,116,97,99,104,101,100,61,61,61,33,48,124,124,121,46,98,117,102,102,101,114,46,100,101,116,97,99,104,101,100,61,61,61,118,111,105,100,32,48,38,38,121,46,98,117,102,102,101,114,33,61,61,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,38,38,40,121,61,110,101,119,32,68,97,116,97,86,105,101,119,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,121,125,102,117,110,99,116,105,111,110,32,95,116,40,110,41,123,114,101,116,117,114,110,32,110,61,61,110,117,108,108,125,118,97,114,32,73,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,99,116,40,41,123,114,101,116,117,114,110,40,73,61,61,61,110,117,108,108,124,124,73,46,98,121,116,101,76,101,110,103,116,104,61,61,
1182461,48,41,38,38,40,73,61,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,73,125,102,117,110,99,116,105,111,110,32,100,116,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,52,44,52,41,62,62,62,48,59,114,101,116,117,114,110,32,99,116,40,41,46,115,101,116,40,110,44,101,47,52,41,44,99,61,110,46,108,101,110,103,116,104,44,101,125,102,117,110,99,116,105,111,110,32,66,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,49,44,49,41,62,62,62,48,59,114,101,116,117,114,110,32,120,40,41,46,115,101,116,40,110,44,101,47,49,41,44,99,61,110,46,108,101,110,103,116,104,44,101,125,102,117,110,99,116,105,111,110,32,108,116,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,52,44,52,41,62,62,62,48,59,102,111,114,40,108,101,116,32,114,61,48,59,114,60,110,46,108,101,110,103,116,104,59,114,43,43,41,123,108,101,116,32,115,61,88,40,110,91,114,93,41,59,76,40,41,46,115,101,116,85,105,110,116,51,50,40,101,43,52,42,114,44,115,44,33,48,41,125,114,101,116,117,114,110,32,99,61,110,46,108,101,110,103,116,104,44,101,125,102,117,110,99,116,105,111,110,32,90,40,110,44,116,41,123,108,101,116,32,101,61,100,40,110,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,66,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,114,101,103,105,115,116,101,114,95,102,111,110,116,40,101,44,114,44,115,44,105,41,33,61,61,48,125,118,97,114,32,118,61,79,98,106,101,99,116,46,102,114,101,101,122,101,40,123,70,111,114,119,97,114,100,58,48,44,48,58,34,70,111,114,119,97,114,100,34,44,82,101,118,101,114,115,101,58,49,44,49,58,34,82,101,118,101,114,115,101,34,44,66,111,117,110,99,101,58,50,44,50,58,34,66,111,117,110,99,101,34,44,82,101,118,101,114,115,101,66,111,
11824117,110,99,101,58,51,44,51,58,34,82,101,118,101,114,115,101,66,111,117,110,99,101,34,125,41,44,75,61,116,121,112,101,111,102,32,70,105,110,97,108,105,122,97,116,105,111,110,82,101,103,105,115,116,114,121,62,34,117,34,63,123,114,101,103,105,115,116,101,114,58,40,41,61,62,123,125,44,117,110,114,101,103,105,115,116,101,114,58,40,41,61,62,123,125,125,58,110,101,119,32,70,105,110,97,108,105,122,97,116,105,111,110,82,101,103,105,115,116,114,121,40,110,61,62,111,46,95,95,119,98,103,95,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,102,114,101,101,40,110,62,62,62,48,44,49,41,41,44,107,61,99,108,97,115,115,123,95,95,100,101,115,116,114,111,121,95,105,110,116,111,95,114,97,119,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,95,119,98,103,95,112,116,114,59,114,101,116,117,114,110,32,116,104,105,115,46,95,95,119,98,103,95,112,116,114,61,48,44,75,46,117,110,114,101,103,105,115,116,101,114,40,116,104,105,115,41,44,116,125,102,114,101,101,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,95,100,101,115,116,114,111,121,95,105,110,116,111,95,114,97,119,40,41,59,111,46,95,95,119,98,103,95,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,102,114,101,101,40,116,44,48,41,125,99,108,101,97,114,95,115,108,111,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,105,115,95,112,108,97,121,105,110,103,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,112,108,97,121,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,115,116,111,112,112,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,115,116,111,112,112,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,108,97,121,111,117,116,95,102,105,116,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,102,105,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,117,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,108,111,111,112,95,99,111,117,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,112,111,108,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,111,108,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,114,101,115,101,116,95,115,108,111,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,101,116,95,108,97,121,111,117,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,
11824100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,97,121,111,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,115,101,116,95,109,97,114,107,101,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,99,108,101,97,114,95,115,108,111,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,108,111,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,104,97,115,95,115,101,103,109,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,104,97,115,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,99,111,109,112,108,101,116,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,99,111,109,112,108,101,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,116,119,101,101,110,105,110,103,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,116,119,101,101,110,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,114,101,115,101,116,95,115,108,111,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,115,108,111,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,114,101,115,101,116,95,116,104,101,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,116,104,101,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,103,109,101,110,116,95,101,110,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,101,110,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,113,117,97,108,105,116,121,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,115,101,116,95,115,101,103,109,101,110,116,40,116,44,101,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,33,61,61,48,125,115,116,97,116,105,99,32,117,110,108,111,97,100,95,102,111,110,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,117,110,108,111,97,100,95,102,111,110,116,40,101,44,114,41,33,61,61,48,125,97,110,105,109,97,116,105,111,110,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,
11824111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,110,105,109,97,116,105,111,110,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,117,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,99,108,101,97,114,95,109,97,114,107,101,114,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,101,109,105,116,95,111,110,95,108,111,111,112,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,101,109,105,116,95,111,110,95,108,111,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,103,101,116,95,115,108,111,116,95,105,100,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,105,100,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,117,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,109,97,114,107,101,114,95,110,97,109,101,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,114,107,101,114,95,110,97,109,101,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,97,117,116,111,112,108,97,121,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,97,117,116,111,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,108,111,116,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,101,116,95,118,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,118,105,101,119,112,111,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,44,114,44,115,41,33,61,61,48,125,116,111,116,97,108,95,102,114,97,109,101,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,111,116,97,108,95,102,114,97,109,101,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,99,108,101,97,114,95,115,101,103,109,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,
11824111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,99,117,114,114,101,110,116,95,102,114,97,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,117,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,103,101,116,95,115,108,111,116,115,95,115,116,114,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,115,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,117,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,103,101,116,95,116,114,97,110,115,102,111,114,109,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,116,114,97,110,115,102,111,114,109,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,114,101,113,117,101,115,116,95,102,114,97,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,113,117,101,115,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,103,109,101,110,116,95,115,116,97,114,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,115,116,97,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,115,108,111,116,115,95,115,116,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,108,111,116,115,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,101,116,95,116,101,120,116,95,115,108,111,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,12
118240,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,101,120,116,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,101,116,95,116,114,97,110,115,102,111,114,109,40,116,41,123,108,101,116,32,101,61,100,116,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,114,97,110,115,102,111,114,109,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,109,95,103,101,116,95,105,110,112,117,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,105,110,112,117,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,112,111,108,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,108,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,117,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,99,111,108,111,114,95,115,108,111,116,40,116,44,101,44,114,44,115,41,123,108,101,116,32,105,61,100,40,116,44,111,46,95,95,119,98,105,110,
11824100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,99,111,108,111,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,105,44,95,44,101,44,114,44,115,41,33,61,61,48,125,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,109,95,114,101,115,101,116,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,114,101,115,101,116,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,117,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,115,101,116,95,115,99,97,108,97,114,95,115,108,111,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,99,97,108,97,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,101,116,95,118,101,99,116,111,114,95,115,108,111,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,118,101,99,116,111,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,
11824100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,117,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,117,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,117,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,115,101,116,95,112,111,115,105,116,105,111,110,95,115,108,111,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,112,111,115,105,116,105,111,110,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,
11824111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,116,44,101,44,114,41,123,108,101,116,32,115,61,66,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,117,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,41,123,114,101,116,117,114,110,32,111,46,100,
11824111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,59,114,101,116,117,114,110,32,115,61,61,61,49,54,55,55,55,50,49,53,63,118,111,105,100,32,48,58,115,33,61,61,48,125,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,59,114,101,116,117,114,110,32,115,61,61,61,52,50,57,52,57,54,55,50,57,55,63,118,111,105,100,32,48,58,115,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,116,97,116,101,95,109,97,99,104,105,110,
11824101,95,117,110,108,111,97,100,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,117,110,108,111,97,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,99,108,101,97,114,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,114,101,115,101,116,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,
11824116,101,114,112,111,108,97,116,105,111,110,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,110,101,119,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,95,119,98,103,95,112,116,114,61,116,62,62,62,48,44,75,46,114,101,103,105,115,116,101,114,40,116,104,105,115,44,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,104,105,115,41,44,116,104,105,115,125,109,111,100,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,111,100,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,112,108,97,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,101,107,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,101,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,115,116,111,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,116,105,99,107,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,99,108,101,97,114,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,112,97,117,115,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,97,117,115,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,112,101,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,112,101,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,119,105,100,116,104,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,119,105,100,116,104,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,104,101,105,103,104,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,104,101,105,103,104,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,114,101,110,100,101,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,110,100,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,114,101,115,105,122,101,40,116,44,101,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,105,122,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,33,61,61,48,125,109,97,114,107,101,114,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,114,107,101,114,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,102,105,114,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,
11824111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,102,105,114,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,109,95,115,116,111,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,109,95,116,105,99,107,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,116,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,97,117,116,111,112,108,97,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,117,116,111,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,100,117,114,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,108,111,111,112,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,111,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,101,116,95,109,111,100,101,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,109,111,100,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,109,95,115,116,97,114,116,40,116,44,101,41,123,108,101,116,32,114,61,108,116,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,97,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,114,44,115,41,33,61,61,48,125,116,104,101,109,101,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,104,101,109,101,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,117,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,105,110,116,101,114,115,101,99,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,114,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,110,116,101,114,115,101,99,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,44,115,44,105,41,33,61,61,48,125,105,115,95,108,111,97,100,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,108,111,97,100,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,112,97,117,115,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,112,97,117,115,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,108,111,97,100,95,102,111,110,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,12
118240,112,111,114,116,41,44,115,61,99,44,105,61,66,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,102,111,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,101,116,95,102,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,115,101,116,95,115,112,101,101,100,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,112,101,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,101,116,95,116,104,101,109,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,104,101,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,109,95,115,116,97,116,117,115,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,97,116,117,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,117,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,125,59,97,115,121,110,99,32,102,117,110,99,116,105,111,110,32,112,116,40,110,44,116,41,123,105,102,40,116,121,112,101,111,102,32,82,101,115,112,111,110,115,101,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,82,101,115,112,111,110,115,101,41,123,105,102,40,116,121,112,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,61,61,34,102,117,110,99,116,105,111,110,34,41,116,114,121,123,114,101,116,117,114,110,32,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,40,110,44,116,41,125,99,97,116,99,104,40,114,41,123,105,102,40,110,46,104,101,97,100,101,114,115,46,103,101,116,40,34,67,111,110,116,101,110,116,45,84,121,112,101,34,41,33,61,34,97,112,112,108,105,99,97,116,105,111,110,47,119,97,115,109,34,41,99,111,110,115,111,108,101,46,119,97,114,110,40,34,96,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,96,32,102,97,105,108,101,100,32,98,101,99,97,117,115,101,32,121,111,117,114,32,115,101,114,118,101,114,32,100,111,101,115,32,110,111,116,32,115,101,114,118,101,32,87,97,115,109,32,119,105,116,104,32,96,97,112,112,108,105,99,97,116,105,111,110,47,119,97,115,109,96,32,77,73,77,69,32,116,121,112,101,46,32,70,97,108,108,105,110,103,32,98,97,99,107,32,116,111,32,96,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,96,32,119,104,105,99,104,32,105,115,32,115,108,111,119,101,114,46,32,79,114,105,103,105,110,97,108,32,101,114,114,111,114,58,92,110,34,44,114,41,59,101,108,115,101,32,116,104,114,111,119,32,114,125,108,101,116,32,101,61,97,119,97,105,116,32,110,46,97,114,114,97,121,66,117,102,102,101,114,40,41,59,114,101,116,117,114,110,32,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,40,101,44,116,41,125,101,108,115,101,123,108,101,116,32,101,61,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,
11824115,116,97,110,116,105,97,116,101,40,110,44,116,41,59,114,101,116,117,114,110,32,101,32,105,110,115,116,97,110,99,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,73,110,115,116,97,110,99,101,63,123,105,110,115,116,97,110,99,101,58,101,44,109,111,100,117,108,101,58,110,125,58,101,125,125,102,117,110,99,116,105,111,110,32,104,116,40,41,123,108,101,116,32,110,61,123,125,59,114,101,116,117,114,110,32,110,46,119,98,103,61,123,125,44,110,46,119,98,103,46,95,95,119,98,103,95,98,117,102,102,101,114,95,54,48,57,99,99,51,101,101,101,53,49,101,100,49,53,56,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,116,46,98,117,102,102,101,114,125,44,110,46,119,98,103,46,95,95,119,98,103,95,101,114,114,111,114,95,55,53,51,52,98,56,101,57,97,51,54,102,49,97,98,52,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,108,101,116,32,114,44,115,59,116,114,121,123,114,61,116,44,115,61,101,44,99,111,110,115,111,108,101,46,101,114,114,111,114,40,117,40,116,44,101,41,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,114,44,115,44,49,41,125,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,95,52,48,53,101,50,50,102,51,57,48,53,55,54,99,101,50,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,110,101,119,32,79,98,106,101,99,116,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,95,55,56,102,101,98,49,48,56,98,54,52,55,50,55,49,51,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,110,101,119,32,65,114,114,97,121,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,95,56,97,54,102,50,51,56,97,54,101,99,101,56,54,101,97,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,110,101,119,32,69,114,114,111,114,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,119,105,116,104,98,121,116,101,111,102,102,115,101,116,97,110,100,108,101,110,103,116,104,95,100,57,55,101,54,51,55,101,98,101,49,52,53,97,57,97,61,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,114,101,116,117,114,110,32,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,116,44,101,62,62,62,48,44,114,62,62,62,48,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,119,105,116,104,108,101,110,103,116,104,95,53,97,53,101,102,101,51,49,51,99,102,100,53,57,102,49,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,116,62,62,62,48,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,111,119,95,56,48,55,101,53,52,99,51,57,54,51,54,99,51,52,57,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,68,97,116,101,46,110,111,119,40,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,112,117,115,104,95,55,51,55,99,102,99,56,99,49,52,51,50,99,50,99,54,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,114,101,116,117,114,110,32,116,46,112,117,115,104,40,101,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,115,101,116,95,98,98,56,99,101,99,102,54,97,54,50,98,57,102,52,54,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,105,116,40,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,114,101,116,117,114,110,32,82,101,102,108,101,99,116,46,115,101,116,40,116,44,101,44,114,41,125,44,97,114,103,117,109,101,110,116,115,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,115,101,116,105,110,100,101,120,95,52,101,55,51,97,102,100,99,100,57,98,98,57,53,99,100,61,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,116,91,101,62,62,62,48,93,61,114,125,44,110,46,119,98,103,46,95,95,119,98,103,95,115,116,97,99,107,95,48,101,100,55,53,100,54,56,53,55,53,98,48,102,51,99,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,108,101,116,32,114,61,101,46,115,116,97,99,107,44,115,61,100,40,114,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,76,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,49,44,105,44,33,48,41,44,76,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,48,44,115,44,33,48,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,
11824100,103,101,110,95,105,110,105,116,95,101,120,116,101,114,110,114,101,102,95,116,97,98,108,101,61,102,117,110,99,116,105,111,110,40,41,123,108,101,116,32,116,61,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,112,111,114,116,95,51,44,101,61,116,46,103,114,111,119,40,52,41,59,116,46,115,101,116,40,48,44,118,111,105,100,32,48,41,44,116,46,115,101,116,40,101,43,48,44,118,111,105,100,32,48,41,44,116,46,115,101,116,40,101,43,49,44,110,117,108,108,41,44,116,46,115,101,116,40,101,43,50,44,33,48,41,44,116,46,115,101,116,40,101,43,51,44,33,49,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,109,101,109,111,114,121,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,109,101,109,111,114,121,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,110,117,109,98,101,114,95,110,101,119,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,116,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,115,116,114,105,110,103,95,103,101,116,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,108,101,116,32,114,61,101,44,115,61,116,121,112,101,111,102,32,114,61,61,34,115,116,114,105,110,103,34,63,114,58,118,111,105,100,32,48,59,118,97,114,32,105,61,95,116,40,115,41,63,48,58,100,40,115,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,76,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,49,44,95,44,33,48,41,44,76,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,48,44,105,44,33,48,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,115,116,114,105,110,103,95,110,101,119,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,114,101,116,117,114,110,32,117,40,116,44,101,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,116,104,114,111,119,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,117,40,116,44,101,41,41,125,44,110,125,102,117,110,99,116,105,111,110,32,117,116,40,110,44,116,41,123,114,101,116,117,114,110,32,111,61,110,46,101,120,112,111,114,116,115,44,81,46,95,95,119,98,105,110,100,103,101,110,95,119,97,115,109,95,109,111,100,117,108,101,61,116,44,121,61,110,117,108,108,44,73,61,110,117,108,108,44,67,61,110,117,108,108,44,111,46,95,95,119,98,105,110,100,103,101,110,95,115,116,97,114,116,40,41,44,111,125,97,115,121,110,99,32,102,117,110,99,116,105,111,110,32,81,40,110,41,123,105,102,40,111,33,61,61,118,111,105,100,32,48,41,114,101,116,117,114,110,32,111,59,105,102,40,116,121,112,101,111,102,32,110,60,34,117,34,38,38,40,79,98,106,101,99,116,46,103,101,116,80,114,111,116,111,116,121,112,101,79,102,40,110,41,61,61,61,79,98,106,101,99,116,46,112,114,111,116,111,116,121,112,101,63,123,109,111,100,117,108,101,95,111,
11824114,95,112,97,116,104,58,110,125,61,110,58,99,111,110,115,111,108,101,46,119,97,114,110,40,34,117,115,105,110,103,32,100,101,112,114,101,99,97,116,101,100,32,112,97,114,97,109,101,116,101,114,115,32,102,111,114,32,116,104,101,32,105,110,105,116,105,97,108,105,122,97,116,105,111,110,32,102,117,110,99,116,105,111,110,59,32,112,97,115,115,32,97,32,115,105,110,103,108,101,32,111,98,106,101,99,116,32,105,110,115,116,101,97,100,34,41,41,44,116,121,112,101,111,102,32,110,62,34,117,34,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,87,65,83,77,32,109,111,100,117,108,101,32,85,82,76,32,109,117,115,116,32,98,101,32,112,114,111,118,105,100,101,100,32,118,105,97,32,68,111,116,76,111,116,116,105,101,87,97,115,109,76,111,97,100,101,114,32,111,114,32,115,101,116,87,97,115,109,85,114,108,40,41,46,34,41,59,108,101,116,32,116,61,104,116,40,41,59,40,116,121,112,101,111,102,32,110,61,61,34,115,116,114,105,110,103,34,124,124,116,121,112,101,111,102,32,82,101,113,117,101,115,116,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,82,101,113,117,101,115,116,124,124,116,121,112,101,111,102,32,85,82,76,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,85,82,76,41,38,38,40,110,61,102,101,116,99,104,40,110,41,41,59,108,101,116,123,105,110,115,116,97,110,99,101,58,101,44,109,111,100,117,108,101,58,114,125,61,97,119,97,105,116,32,112,116,40,97,119,97,105,116,32,110,44,116,41,59,114,101,116,117,114,110,32,117,116,40,101,44,114,41,125,118,97,114,32,113,61,81,59,118,97,114,32,65,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,34,44,110,101,119,32,77,97,112,41,125,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,108,101,116,32,114,61,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,41,59,114,124,124,40,114,61,110,101,119,32,83,101,116,44,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,115,101,116,40,116,44,114,41,41,44,114,46,97,100,100,40,101,41,125,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,108,101,116,32,114,61,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,41,59,114,38,38,40,101,63,40,114,46,100,101,108,101,116,101,40,101,41,44,114,46,115,105,122,101,61,61,61,48,38,38,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,100,101,108,101,116,101,40,116,41,41,58,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,100,101,108,101,116,101,40,116,41,41,125,100,105,115,112,97,116,99,104,40,116,41,123,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,46,116,121,112,101,41,63,46,102,111,114,69,97,99,104,40,114,61,62,114,40,116,41,41,125,114,101,109,111,118,101,65,108,108,69,118,101,110,116,76,105,115,116,101,110,101,114,115,40,41,123,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,99,108,101,97,114,40,41,125,125,59,118,97,114,32,109,61,99,108,97,115,115,32,109,123,115,116,97,116,105,99,32,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,123,105,102,40,109,46,95,111,98,115,101,114,118,101,114,41,114,101,116,117,114,110,59,108,101,116,32,116,61,101,61,62,123,101,46,102,111,114,69,97,99,104,40,114,61,62,123,108,101,116,32,115,61,109,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,114,46,116,97,114,103,101,116,41,59,115,38,38,40,114,46,105,115,73,110,116,101,114,115,101,99,116,105,110,103,63,115,46,117,110,102,114,101,101,122,101,40,41,58,115,46,102,114,101,101,122,101,40,41,41,125,41,125,59,109,46,95,111,98,115,101,114,118,101,114,61,110,101,119,32,73,110,116,101,114,115,101,99,116,105,111,110,79,98,115,101,114,118,101,114,40,116,44,123,116,104,114,101,115,104,111,108,100,58,48,125,41,125,115,116,97,116,105,99,32,111,98,115,101,114,118,101,40,116,44,101,41,123,109,46,95,105,110,
11824105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,44,33,109,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,104,97,115,40,116,41,38,38,40,109,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,116,44,101,41,44,109,46,95,111,98,115,101,114,118,101,114,63,46,111,98,115,101,114,118,101,40,116,41,41,125,115,116,97,116,105,99,32,117,110,111,98,115,101,114,118,101,40,116,41,123,109,46,95,111,98,115,101,114,118,101,114,63,46,117,110,111,98,115,101,114,118,101,40,116,41,44,109,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,100,101,108,101,116,101,40,116,41,44,109,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,105,122,101,61,61,61,48,38,38,40,109,46,95,111,98,115,101,114,118,101,114,63,46,100,105,115,99,111,110,110,101,99,116,40,41,44,109,46,95,111,98,115,101,114,118,101,114,61,110,117,108,108,41,125,125,59,108,40,109,44,34,95,111,98,115,101,114,118,101,114,34,44,110,117,108,108,41,44,108,40,109,44,34,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,34,44,110,101,119,32,77,97,112,41,59,118,97,114,32,119,61,109,59,118,97,114,32,104,61,99,108,97,115,115,32,104,123,115,116,97,116,105,99,32,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,123,105,102,40,104,46,95,111,98,115,101,114,118,101,114,41,114,101,116,117,114,110,59,108,101,116,32,116,61,101,61,62,123,101,46,102,111,114,69,97,99,104,40,114,61,62,123,108,101,116,32,115,61,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,114,46,116,97,114,103,101,116,41,59,105,102,40,33,115,41,114,101,116,117,114,110,59,108,101,116,91,105,44,95,93,61,115,59,99,108,101,97,114,84,105,109,101,111,117,116,40,95,41,59,108,101,116,32,112,61,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,105,46,114,101,115,105,122,101,40,41,125,44,49,48,48,41,59,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,114,46,116,97,114,103,101,116,44,91,105,44,112,93,41,125,41,125,59,104,46,95,111,98,115,101,114,118,101,114,61,110,101,119,32,82,101,115,105,122,101,79,98,115,101,114,118,101,114,40,116,41,125,115,116,97,116,105,99,32,111,98,115,101,114,118,101,40,116,44,101,41,123,104,46,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,44,33,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,104,97,115,40,116,41,38,38,40,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,116,44,91,101,44,48,93,41,44,104,46,95,111,98,115,101,114,118,101,114,63,46,111,98,115,101,114,118,101,40,116,41,41,125,115,116,97,116,105,99,32,117,110,111,98,115,101,114,118,101,40,116,41,123,108,101,116,32,101,61,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,116,41,59,105,102,40,101,41,123,108,101,116,32,114,61,101,91,49,93,59,114,38,38,99,108,101,97,114,84,105,109,101,111,117,116,40,114,41,125,104,46,95,111,98,115,101,114,118,101,114,63,46,117,110,111,98,115,101,114,118,101,40,116,41,44,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,100,101,108,101,116,101,40,116,41,44,33,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,105,122,101,38,38,104,46,95,111,98,115,101,114,118,101,114,38,38,40,104,46,95,111,98,115,101,114,118,101,114,46,100,105,115,99,111,110,110,101,99,116,40,41,44,104,46,95,111,98,115,101,114,118,101,114,61,110,117,108,108,41,125,125,59,108,40,104,44,34,95,111,98,115,101,114,118,101,114,34,44,110,117,108,108,41,44,108,40,104,44,34,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,34,44,110,101,119,32,77,97,112,41,59,118,97,114,32,98,61,104,59,102,117,110,99,116,105,111,110,32,109,116,40,110,41,123,114,101,116,117,114,110,47,94,35,40,91,92,100,97,45,102,93,123,54,125,124,91,92,100,97,45,102,93,123,56,125,41,36,47,105,117,46,116,101,115,116,40,110,41,125,102,117,110,99,116,105,111,110,32,101,116,40,110,41,123,105,102,40,33,109,116,40,110,41,41,114,101,116,117,114,110,32,48,59,108,101,116,32,116,61,110,46,114,101,112,108,97,99,101,40,34,35,34,44,34,34,41,59,114,101,116,117,114,110,32,116,61,116,46,108,101,110,103,116,104,61,61,
1182461,54,63,96,36,123,116,125,102,102,96,58,116,44,112,97,114,115,101,73,110,116,40,116,44,49,54,41,125,102,117,110,99,116,105,111,110,32,36,40,110,41,123,105,102,40,110,46,98,121,116,101,76,101,110,103,116,104,60,52,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,110,46,115,108,105,99,101,40,48,44,84,46,98,121,116,101,76,101,110,103,116,104,41,41,59,102,111,114,40,108,101,116,32,101,61,48,59,101,60,84,46,108,101,110,103,116,104,59,101,43,61,49,41,105,102,40,84,91,101,93,33,61,61,116,91,101,93,41,114,101,116,117,114,110,33,49,59,114,101,116,117,114,110,33,48,125,102,117,110,99,116,105,111,110,32,116,116,40,110,41,123,114,101,116,117,114,110,32,72,46,101,118,101,114,121,40,116,61,62,79,98,106,101,99,116,46,104,97,115,79,119,110,40,110,44,116,41,41,125,102,117,110,99,116,105,111,110,32,86,40,110,41,123,105,102,40,116,121,112,101,111,102,32,110,61,61,34,115,116,114,105,110,103,34,41,116,114,121,123,114,101,116,117,114,110,32,116,116,40,74,83,79,78,46,112,97,114,115,101,40,110,41,41,125,99,97,116,99,104,123,114,101,116,117,114,110,33,49,125,101,108,115,101,32,114,101,116,117,114,110,32,116,116,40,110,41,125,102,117,110,99,116,105,111,110,32,78,40,41,123,114,101,116,117,114,110,32,49,43,40,40,102,63,119,105,110,100,111,119,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,49,41,45,49,41,42,74,125,102,117,110,99,116,105,111,110,32,83,40,110,41,123,108,101,116,32,116,61,110,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,44,101,61,119,105,110,100,111,119,46,105,110,110,101,114,72,101,105,103,104,116,124,124,100,111,99,117,109,101,110,116,46,100,111,99,117,109,101,110,116,69,108,101,109,101,110,116,46,99,108,105,101,110,116,72,101,105,103,104,116,44,114,61,119,105,110,100,111,119,46,105,110,110,101,114,87,105,100,116,104,124,124,100,111,99,117,109,101,110,116,46,100,111,99,117,109,101,110,116,69,108,101,109,101,110,116,46,99,108,105,101,110,116,87,105,100,116,104,59,114,101,116,117,114,110,33,40,116,46,98,111,116,116,111,109,60,48,124,124,116,46,116,111,112,62,101,124,124,116,46,114,105,103,104,116,60,48,124,124,116,46,108,101,102,116,62,114,41,125,102,117,110,99,116,105,111,110,32,69,40,110,41,123,108,101,116,32,116,61,110,46,116,97,114,103,101,116,59,105,102,40,116,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,41,123,108,101,116,32,101,61,116,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,59,105,102,40,101,46,119,105,100,116,104,61,61,61,48,124,124,101,46,104,101,105,103,104,116,61,61,61,48,124,124,116,46,119,105,100,116,104,61,61,61,48,124,124,116,46,104,101,105,103,104,116,61,61,61,48,41,114,101,116,117,114,110,32,110,117,108,108,59,108,101,116,32,114,61,116,46,119,105,100,116,104,47,101,46,119,105,100,116,104,44,115,61,116,46,104,101,105,103,104,116,47,101,46,104,101,105,103,104,116,44,105,61,40,110,46,99,108,105,101,110,116,88,45,101,46,108,101,102,116,41,42,114,44,95,61,40,110,46,99,108,105,101,110,116,89,45,101,46,116,111,112,41,42,115,59,114,101,116,117,114,110,33,78,117,109,98,101,114,46,105,115,70,105,110,105,116,101,40,105,41,124,124,33,78,117,109,98,101,114,46,105,115,70,105,110,105,116,101,40,95,41,124,124,78,117,109,98,101,114,46,105,115,78,97,78,40,105,41,124,124,78,117,109,98,101,114,46,105,115,78,97,78,40,95,41,63,110,117,108,108,58,123,120,58,105,44,121,58,95,125,125,114,101,116,117,114,110,32,110,117,108,108,125,102,117,110,99,116,105,111,110,32,110,116,40,110,41,123,108,101,116,32,116,61,110,46,114,101,112,108,97,99,101,40,34,79,112,101,110,85,114,108,58,32,34,44,34,34,41,44,101,61,116,46,105,110,100,101,120,79,102,40,34,32,124,32,84,97,114,103,101,116,58,32,34,41,44,114,44,115,59,101,61,61,61,45,49,63,40,114,61,116,44,115,61,34,95,98,108,97,110,107,34,41,58,40,114,61,116,46,115,117,98,115,116,114,105,110,103,40,48,44,101,41,44,115,61,116,46,115,117,98,115,116,114,105,110,103,40,101,43,49,49,41,41,44,119,105,110,100,111,119,46,111,112,101,110,40,114,44,115,41,125,102,117,110,99,116,105,111,110,32,114,116,40,110,44,116,44,101,41,123,108,101,116,32,114,61,110,117,108,108,44,115,61,116,59,114,101,116,117,114,110,123,108,111,97,100,40,41,123,114,101,116,117,114,110,32,114,124,124,40,114,61,110,40,123,109,111,100,117,108,101,95,111,
11824114,95,112,97,116,104,58,115,125,41,46,116,104,101,110,40,40,41,61,62,123,125,41,46,99,97,116,99,104,40,97,115,121,110,99,32,105,61,62,123,99,111,110,115,111,108,101,46,119,97,114,110,40,96,80,114,105,109,97,114,121,32,87,65,83,77,32,108,111,97,100,32,102,97,105,108,101,100,32,102,114,111,109,32,36,123,115,125,58,32,36,123,105,46,109,101,115,115,97,103,101,125,96,41,44,99,111,110,115,111,108,101,46,119,97,114,110,40,96,65,116,116,101,109,112,116,105,110,103,32,116,111,32,108,111,97,100,32,87,65,83,77,32,102,114,111,109,32,98,97,99,107,117,112,32,85,82,76,58,32,36,123,101,125,96,41,59,116,114,121,123,97,119,97,105,116,32,110,40,123,109,111,100,117,108,101,95,111,114,95,112,97,116,104,58,101,125,41,125,99,97,116,99,104,40,95,41,123,116,104,114,111,119,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,80,114,105,109,97,114,121,32,87,65,83,77,32,85,82,76,32,102,97,105,108,101,100,58,32,36,123,105,46,109,101,115,115,97,103,101,125,96,41,44,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,66,97,99,107,117,112,32,87,65,83,77,32,85,82,76,32,102,97,105,108,101,100,58,32,36,123,95,46,109,101,115,115,97,103,101,125,96,41,44,114,61,110,117,108,108,44,110,101,119,32,69,114,114,111,114,40,34,87,65,83,77,32,108,111,97,100,105,110,103,32,102,97,105,108,101,100,32,102,114,111,109,32,97,108,108,32,115,111,117,114,99,101,115,46,34,41,125,125,41,41,44,114,125,44,115,101,116,87,97,115,109,85,114,108,40,105,41,123,105,33,61,61,115,38,38,40,115,61,105,44,114,61,110,117,108,108,41,125,125,125,118,97,114,32,85,61,114,116,40,113,44,96,104,116,116,112,115,58,47,47,99,100,110,46,106,115,100,101,108,105,118,114,46,110,101,116,47,110,112,109,47,36,123,68,125,64,36,123,122,125,47,100,105,115,116,47,100,111,116,108,111,116,116,105,101,45,112,108,97,121,101,114,46,119,97,115,109,96,44,96,104,116,116,112,115,58,47,47,117,110,112,107,103,46,99,111,109,47,36,123,68,125,64,36,123,122,125,47,100,105,115,116,47,100,111,116,108,111,116,116,105,101,45,112,108,97,121,101,114,46,119,97,115,109,96,41,44,87,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,34,114,101,118,101,114,115,101,34,58,114,101,116,117,114,110,32,118,46,82,101,118,101,114,115,101,59,99,97,115,101,34,98,111,117,110,99,101,34,58,114,101,116,117,114,110,32,118,46,66,111,117,110,99,101,59,99,97,115,101,34,114,101,118,101,114,115,101,45,98,111,117,110,99,101,34,58,114,101,116,117,114,110,32,118,46,82,101,118,101,114,115,101,66,111,
11824117,110,99,101,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,32,118,46,70,111,114,119,97,114,100,125,125,44,102,116,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,32,118,46,82,101,118,101,114,115,101,58,114,101,116,117,114,110,34,114,101,118,101,114,115,101,34,59,99,97,115,101,32,118,46,66,111,117,110,99,101,58,114,101,116,117,114,110,34,98,111,117,110,99,101,34,59,99,97,115,101,32,118,46,82,101,118,101,114,115,101,66,111,117,110,99,101,58,114,101,116,117,114,110,34,114,101,118,101,114,115,101,45,98,111,117,110,99,101,34,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,34,102,111,114,119,97,114,100,34,125,125,44,103,116,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,34,99,111,110,116,97,105,110,34,58,114,101,116,117,114,110,34,99,111,110,116,97,105,110,34,59,99,97,115,101,34,99,111,118,101,114,34,58,114,101,116,117,114,110,34,99,111,118,101,114,34,59,99,97,115,101,34,102,105,108,108,34,58,114,101,116,117,114,110,34,102,105,108,108,34,59,99,97,115,101,34,102,105,116,45,104,101,105,103,104,116,34,58,114,101,116,117,114,110,34,102,105,116,45,104,101,105,103,104,116,34,59,99,97,115,101,34,102,105,116,45,119,105,100,116,104,34,58,114,101,116,117,114,110,34,102,105,116,45,119,105,100,116,104,34,59,99,97,115,101,34,110,111,110,101,34,58,114,101,116,117,114,110,34,110,111,110,101,34,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,34,99,111,110,116,97,105,110,34,125,125,44,77,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,116,41,123,108,40,116,104,105,115,44,34,95,99,97,110,118,97,115,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,112,101,110,100,105,110,103,76,111,97,100,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,99,111,110,116,101,120,116,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,101,118,101,110,116,77,97,110,97,103,101,114,34,41,59,108,40,116,104,105,115,44,34,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,102,114,97,109,101,77,97,110,97,103,101,114,34,41,59,108,40,116,104,105,115,44,34,95,100,111,116,76,111,116,116,105,101,67,111,114,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,34,44,34,34,41,59,108,40,116,104,105,115,44,34,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,34,44,33,49,41,59,108,40,116,104,105,115,44,34,95,114,101,110,100,101,114,67,111,110,102,105,103,34,44,123,125,41,59,108,40,116,104,105,115,44,34,95,105,115,70,114,111,122,101,110,34,44,33,49,41,59,108,40,116,104,105,115,44,34,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,67,108,105,99,107,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,34,44,48,41,59,108,40,116,104,105,115,44,34,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,34,44,48,41,59,108,40,116,104,105,115,44,34,95,109,97,114,107,101,114,34,44,34,34,41,59,116,104,105,115,46,95,99,97,110,118,97,115,61,116,46,99,97,110,118,97,115,63,63,110,117,108,108,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,61,110,101,119,32,65,44,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,61,110,101,119,32,82,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,61,123,46,46,46,116,46,114,101,110,100,101,114,67,111,110,102,105,103,44,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,116,46,114,101,110,100,101,114,67,111,110,102,105,103,63,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,78,40,41,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,116,46,114,101,110,100,101,114,67,111,110,102,105,103,63,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,63,63,33,48,125,44,116,104,105,115,46,95,105,110,
11824105,116,87,97,115,109,40,41,46,116,104,101,110,40,40,41,61,62,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,116,104,105,115,46,95,99,114,101,97,116,101,67,111,114,101,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,97,117,116,111,112,108,97,121,40,116,46,97,117,116,111,112,108,97,121,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,46,108,111,111,112,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,46,108,111,111,112,67,111,117,110,116,63,63,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,87,40,116,46,109,111,100,101,63,63,34,102,111,114,119,97,114,100,34,41,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,46,115,112,101,101,100,63,63,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,63,63,33,48,41,44,116,46,115,101,103,109,101,110,116,38,38,116,46,115,101,103,109,101,110,116,46,108,101,110,103,116,104,61,61,61,50,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,46,115,101,103,109,101,110,116,91,48,93,44,116,46,115,101,103,109,101,110,116,91,49,93,41,44,116,104,105,115,46,95,109,97,114,107,101,114,61,116,46,109,97,114,107,101,114,63,63,34,34,44,116,104,105,115,46,95,109,97,114,107,101,114,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,108,97,121,111,117,116,63,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,61,116,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,63,63,34,34,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,61,116,46,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,63,110,117,108,108,44,116,104,105,115,46,95,111,110,67,111,114,101,67,114,101,97,116,101,100,40,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,97,100,121,34,125,41,44,116,46,100,97,116,97,63,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,46,100,97,116,97,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,100,97,116,97,58,116,46,100,97,116,97,125,58,116,46,115,114,99,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,116,46,115,114,99,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,115,114,99,58,116,46,115,114,99,125,41,44,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,38,38,116,104,105,115,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,41,125,41,46,99,97,116,99,104,40,101,61,62,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,34,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,73,110,105,116,105,97,108,105,122,97,116,105,111,110,32,102,97,105,108,101,100,58,34,44,101,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,119,97,115,109,32,109,111,100,117,108,101,58,32,36,123,101,125,96,41,125,41,125,41,125,97,115,121,110,99,32,95,105,110,
11824105,116,87,97,115,109,40,41,123,114,101,116,117,114,110,32,85,46,108,111,97,100,40,41,125,95,99,114,101,97,116,101,67,111,114,101,40,41,123,114,101,116,117,114,110,32,110,101,119,32,107,125,95,111,110,67,111,114,101,67,114,101,97,116,101,100,40,41,123,125,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,59,102,111,114,40,59,40,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,111,108,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,116,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,101,61,116,59,115,119,105,116,99,104,40,101,46,116,121,112,101,41,123,99,97,115,101,34,76,111,97,100,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,76,111,97,100,69,114,114,111,114,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,34,102,97,105,108,101,100,32,116,111,32,108,111,97,100,34,41,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,80,108,97,121,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,112,108,97,121,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,80,97,117,115,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,112,97,117,115,101,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,111,112,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,70,114,97,109,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,102,114,97,109,101,78,111,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,82,101,110,100,101,114,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,110,100,101,114,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,102,114,97,109,101,78,111,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,76,111,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,111,112,34,44,108,111,111,112,67,111,117,110,116,58,101,46,108,111,111,112,67,111,117,110,116,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,67,111,109,112,108,101,116,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,99,111,109,112,108,101,116,101,34,125,41,44,48,41,59,98,114,101,97,107,59,100,101,102,97,117,108,116,58,98,114,101,97,107,125,125,125,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,59,102,111,114,40,59,40,116,61,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,46,115,109,95,112,111,108,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,116,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,114,61,116,59,115,119,105,116,99,104,40,114,46,116,121,112,101,41,123,99,97,115,101,34,83,116,97,114,116,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,48,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,125,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,125,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,125,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,125,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,67,117,115,116,111,109,69,118,101,110,116,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,101,118,101,110,116,78,97,109,101,58,114,46,109,101,115,115,97,103,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,66,111,111,108,101,97,110,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,66,111,
11824111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,78,117,109,101,114,105,99,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,114,105,110,103,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,73,110,112,117,116,70,105,114,101,100,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,84,114,97,110,115,105,116,105,111,110,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,102,114,111,109,83,116,97,116,101,58,114,46,112,114,101,118,105,111,117,115,83,116,97,116,101,63,63,34,34,44,116,111,83,116,97,116,101,58,114,46,110,101,119,83,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,97,116,101,69,110,116,101,114,101,100,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,115,116,97,116,101,58,114,46,115,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,97,116,101,69,120,105,116,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,34,44,115,116,97,116,101,58,114,46,115,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,69,114,114,111,114,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,101,114,114,111,114,58,114,46,109,101,115,115,97,103,101,63,63,34,34,125,41,59,98,114,101,97,107,59,100,101,102,97,117,108,116,58,98,114,101,97,107,125,125,108,101,116,32,101,59,102,111,114,40,59,40,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,101,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,114,61,101,59,105,102,40,114,46,116,121,112,101,61,61,61,34,77,101,115,115,97,103,101,34,41,123,108,101,116,32,115,61,114,46,109,101,115,115,97,103,101,63,63,34,34,59,102,38,38,115,46,115,116,97,114,116,115,87,105,116,104,40,34,79,112,101,110,85,114,108,58,32,34,41,63,110,116,40,115,41,58,116,
11824104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,44,109,101,115,115,97,103,101,58,115,125,41,125,125,125,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,116,41,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,116,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,116,41,125,41,125,97,115,121,110,99,32,95,102,101,116,99,104,68,97,116,97,40,116,41,123,108,101,116,32,101,61,97,119,97,105,116,32,102,101,116,99,104,40,116,41,59,105,102,40,33,101,46,111,107,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,102,101,116,99,104,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,32,102,114,111,109,32,85,82,76,58,32,36,123,116,125,46,32,36,123,101,46,115,116,97,116,117,115,125,58,32,36,123,101,46,115,116,97,116,117,115,84,101,120,116,125,96,41,59,108,101,116,32,114,61,97,119,97,105,116,32,101,46,97,114,114,97,121,66,117,102,102,101,114,40,41,59,114,101,116,117,114,110,32,36,40,114,41,63,114,58,110,101,119,32,84,101,120,116,68,101,99,111,100,101,114,40,41,46,100,101,99,111,100,101,40,114,41,125,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,105,102,40,33,116,104,105,115,46,95,99,97,110,118,97,115,41,123,99,111,110,115,111,108,101,46,119,97,114,110,40,34,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,67,97,110,110,111,116,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,119,105,116,104,111,117,116,32,99,97,110,118,97,115,46,32,67,97,108,108,32,115,101,116,67,97,110,118,97,115,40,41,32,102,105,114,115,116,46,34,41,59,114,101,116,117,114,110,125,108,101,116,32,101,61,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,114,61,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,44,115,61,33,49,59,105,102,40,116,121,112,101,111,102,32,116,61,61,34,115,116,114,105,110,103,34,41,123,105,102,40,33,86,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,76,111,116,116,105,101,32,74,83,79,78,32,115,116,114,105,110,103,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,115,116,114,105,110,103,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,76,111,116,116,105,101,32,74,83,79,78,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,44,101,44,114,41,125,101,108,115,101,32,105,102,40,116,32,105,110,115,116,97,110,99,101,111,102,32,65,114,114,97,121,66,117,102,102,101,114,41,123,105,102,40,33,36,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,100,111,116,76,111,116,116,105,101,32,65,114,114,97,121,66,117,102,102,101,114,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,65,114,114,97,121,66,117,102,102,101,114,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,100,111,116,76,111,116,116,105,101,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,116,41,44,101,44,114,41,125,101,108,115,101,32,105,102,40,116,121,112,101,111,102,32,116,61,61,34,111,98,106,101,99,116,34,41,123,105,102,40,33,86,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,76,111,116,116,105,101,32,74,83,79,78,32,111,98,106,101,99,116,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,76,111,116,116,105,101,32,74,83,79,78,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,44,101,44,114,41,125,101,108,115,101,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,85,110,115,117,112,112,111,114,116,101,100,32,100,97,116,97,32,116,121,112,101,32,102,111,114,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,46,32,69,120,112,101,99,116,101,100,58,10,32,32,32,32,32,32,32,32,32,32,45,32,115,116,114,105,110,103,32,40,76,111,116,116,105,101,32,74,83,79,78,41,44,10,32,32,32,32,32,32,32,32,32,32,45,32,65,114,114,97,121,66,117,102,102,101,114,32,40,100,111,116,76,111,116,116,105,101,41,44,10,32,32,32,32,32,32,32,32,32,32,45,32,111,98,106,101,99,116,32,40,76,111,116,116,105,101,32,74,83,79,78,41,46,10,32,32,32,32,32,32,32,32,32,32,82,101,99,101,105,118,101,100,58,32,36,123,116,121,112,101,111,102,32,116,125,96,41,59,114,101,116,117,114,110,125,115,63,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,41,44,102,38,38,116,104,105,115,46,114,101,115,105,122,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,109,97,114,107,101,114,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,44,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,116,104,105,115,46,99,117,114,114,101,110,116,70,114,97,109,101,125,41,125,44,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,63,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,41,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,38,38,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,38,38,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,40,119,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,38,38,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,41,41,58,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,125,95,108,111,97,100,70,114,111,109,83,114,99,40,116,41,123,116,104,105,115,46,95,102,101,116,99,104,68,97,116,97,40,116,41,46,116,104,101,110,40,101,61,62,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,101,41,41,46,99,97,116,99,104,40,101,61,62,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,32,102,114,111,109,32,85,82,76,58,32,36,123,116,125,46,32,36,123,101,125,96,41,41,125,103,101,116,32,98,117,102,102,101,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,58,110,117,108,108,125,103,101,116,32,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,97,110,105,109,97,116,105,111,110,95,105,100,40,41,63,63,118,111,105,100,32,48,125,103,101,116,32,97,99,116,105,118,101,84,104,101,109,101,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,116,104,101,109,101,95,105,100,40,41,63,63,118,111,105,100,32,48,125,103,101,116,32,108,97,121,111,117,116,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,123,97,108,105,103,110,58,91,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,41,93,44,102,105,116,58,103,116,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,102,105,116,40,41,41,125,125,103,101,116,32,109,97,114,107,101,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,41,63,63,34,34,125,103,101,116,32,109,97,110,105,102,101,115,116,40,41,123,116,114,121,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,41,59,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,33,116,41,114,101,116,117,114,110,32,110,117,108,108,59,108,101,116,32,101,61,74,83,79,78,46,112,97,114,115,101,40,116,41,59,114,101,116,117,114,110,32,79,98,106,101,99,116,46,107,101,121,115,40,101,41,46,108,101,110,103,116,104,61,61,61,48,63,110,117,108,108,58,101,125,99,97,116,99,104,123,114,101,116,117,114,110,32,110,117,108,108,125,125,103,101,116,32,114,101,110,100,101,114,67,111,110,102,105,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,125,103,101,116,32,115,101,103,109,101,110,116,40,41,123,105,102,40,33,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,124,124,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,104,97,115,95,115,101,103,109,101,110,116,40,41,41,41,114,101,116,117,114,110,91,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,103,109,101,110,116,95,115,116,97,114,116,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,103,109,101,110,116,95,101,110,100,40,41,93,125,103,101,116,32,108,111,111,112,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,41,63,63,33,49,125,103,101,116,32,109,111,100,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,102,116,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,109,111,100,101,40,41,41,58,34,102,111,114,119,97,114,100,34,125,103,101,116,32,105,115,70,114,111,122,101,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,105,115,70,114,111,122,101,110,125,103,101,116,32,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,125,103,101,116,32,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,63,63,34,34,125,103,101,116,32,97,117,116,111,112,108,97,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,63,46,97,117,116,111,112,108,97,121,40,41,63,63,33,49,125,103,101,116,32,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,41,63,63,33,49,125,103,101,116,32,115,112,101,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,112,101,101,100,40,41,63,63,48,125,103,101,116,32,105,115,82,101,97,100,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,125,103,101,116,32,105,115,76,111,97,100,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,108,111,97,100,101,100,40,41,63,63,33,49,125,103,101,116,32,105,115,80,108,97,121,105,110,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,108,97,121,105,110,103,40,41,63,63,33,49,125,103,101,116,32,105,115,80,97,117,115,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,97,117,115,101,100,40,41,63,63,33,49,125,103,101,116,32,105,115,83,116,111,112,112,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,115,116,111,112,112,101,100,40,41,63,63,33,49,125,103,101,116,32,99,117,114,114,101,110,116,70,114,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,77,97,116,104,46,114,111,117,110,100,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,117,114,114,101,110,116,95,102,114,97,109,101,40,41,42,49,48,48,41,47,49,48,48,58,48,125,103,101,116,32,108,111,111,112,67,111,117,110,116,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,63,63,48,125,103,101,116,32,116,111,116,97,108,70,114,97,109,101,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,116,111,116,97,108,95,102,114,97,109,101,115,40,41,63,63,48,125,103,101,116,32,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,100,117,114,97,116,105,111,110,40,41,63,63,48,125,103,101,116,32,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,41,63,63,48,125,103,101,116,32,99,97,110,118,97,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,99,97,110,118,97,115,125,108,111,97,100,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,97,117,116,111,112,108,97,121,40,116,46,97,117,116,111,112,108,97,121,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,46,108,111,111,112,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,46,108,111,111,112,67,111,117,110,116,63,63,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,87,40,116,46,109,111,100,101,63,63,34,102,111,114,119,97,114,100,34,41,41,44,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,46,115,112,101,101,100,63,63,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,63,63,33,48,41,44,116,46,115,101,103,109,101,110,116,38,38,116,46,115,101,103,109,101,110,116,46,108,101,110,103,116,104,61,61,61,50,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,46,115,101,103,109,101,110,116,91,48,93,44,116,46,115,101,103,109,101,110,116,91,49,93,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,101,103,109,101,110,116,40,41,44,116,104,105,115,46,95,109,97,114,107,101,114,61,116,46,109,97,114,107,101,114,63,63,34,34,44,116,104,105,115,46,95,109,97,114,107,101,114,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,109,97,114,107,101,114,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,108,97,121,111,117,116,63,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,44,116,46,100,97,116,97,63,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,46,100,97,116,97,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,100,97,116,97,58,116,46,100,97,116,97,125,58,116,46,115,114,99,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,116,46,115,114,99,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,115,114,99,58,116,46,115,114,99,125,41,44,116,104,105,115,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,63,63,34,34,41,41,125,95,100,114,97,119,40,41,123,105,102,40,33,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,116,104,105,115,46,95,99,97,110,118,97,115,61,61,61,110,117,108,108,41,38,38,40,33,116,104,105,115,46,95,99,111,110,116,101,120,116,38,38,34,103,101,116,67,111,110,116,101,120,116,34,105,110,32,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,121,112,101,111,102,32,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,67,111,110,116,101,120,116,61,61,34,102,117,110,99,116,105,111,110,34,38,38,40,116,121,112,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,60,34,117,34,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,124,124,116,121,112,101,111,102,32,79,102,102,115,99,114,101,101,110,67,97,110,118,97,115,60,34,117,34,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,79,102,102,115,99,114,101,101,110,67,97,110,118,97,115,41,38,38,40,116,104,105,115,46,95,99,111,110,116,101,120,116,61,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,67,111,110,116,101,120,116,40,34,50,100,34,41,41,44,116,104,105,115,46,95,99,111,110,116,101,120,116,41,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,44,101,61,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,42,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,42,106,59,105,102,40,116,46,98,121,116,101,76,101,110,103,116,104,33,61,61,101,41,123,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,61,61,101,63,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,43,61,49,58,40,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,49,44,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,101,41,44,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,61,61,49,48,38,38,99,111,110,115,111,108,101,46,119,97,114,110,40,96,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,80,101,114,115,105,115,116,101,110,116,32,98,117,102,102,101,114,32,115,105,122,101,32,109,105,115,109,97,116,99,104,32,100,101,116,101,99,116,101,100,46,32,69,120,112,101,99,116,101,100,32,36,123,101,125,32,98,121,116,101,115,32,102,111,114,32,99,97,110,118,97,115,32,36,123,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,125,120,36,123,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,125,44,32,98,117,116,32,103,111,116,32,36,123,116,46,98,121,116,101,76,101,110,103,116,104,125,32,98,121,116,101,115,46,32,84,104,105,115,32,109,97,121,32,105,110,
11824100,105,99,97,116,101,32,97,32,87,65,83,77,32,109,101,109,111,114,121,32,97,108,108,111,99,97,116,105,111,110,32,105,115,115,117,101,32,111,114,32,105,110,118,97,108,105,100,32,99,97,110,118,97,115,32,100,105,109,101,110,115,105,111,110,115,46,96,41,59,114,101,116,117,114,110,125,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,48,44,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,101,59,108,101,116,32,114,61,110,117,108,108,44,115,61,110,101,119,32,85,105,110,116,56,67,108,97,109,112,101,100,65,114,114,97,121,40,116,46,98,117,102,102,101,114,44,116,46,98,121,116,101,79,102,102,115,101,116,44,116,46,98,121,116,101,76,101,110,103,116,104,41,59,116,121,112,101,111,102,32,73,109,97,103,101,68,97,116,97,62,34,117,34,63,40,114,61,116,104,105,115,46,95,99,111,110,116,101,120,116,46,99,114,101,97,116,101,73,109,97,103,101,68,97,116,97,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,44,114,46,100,97,116,97,46,115,101,116,40,115,41,41,58,114,61,110,101,119,32,73,109,97,103,101,68,97,116,97,40,115,44,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,44,116,104,105,115,46,95,99,111,110,116,101,120,116,46,112,117,116,73,109,97,103,101,68,97,116,97,40,114,44,48,44,48,41,125,125,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,99,97,110,118,97,115,38,38,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,119,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,98,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,41,125,95,105,110,105,116,105,97,108,105,122,101,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,115,101,116,117,112,82,101,110,100,101,114,101,114,79,110,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,40,119,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,38,38,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,38,38,116,104,105,115,46,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,105,122,101,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,95,115,101,116,117,112,82,101,110,100,101,114,101,114,79,110,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,99,111,110,116,101,120,116,61,110,117,108,108,125,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,41,44,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,110,117,108,108,41,125,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,38,38,33,116,104,105,115,46,95,105,115,70,114,111,122,101,110,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,41,38,38,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,76,111,111,112,46,98,105,110,100,40,116,104,105,115,41,41,41,125,95,97,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,114,101,116,117,114,110,125,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,38,38,33,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,114,101,116,117,114,110,125,116,114,121,123,108,101,116,32,116,61,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,116,105,99,107,40,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,116,105,99,107,40,41,59,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,63,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,58,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,38,38,116,104,105,115,46,95,100,114,97,119,40,41,44,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,76,111,111,112,46,98,105,110,100,40,116,104,105,115,41,41,125,99,97,116,99,104,40,116,41,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,34,69,114,114,111,114,32,105,110,32,97,110,105,109,97,116,105,111,110,32,102,114,97,109,101,58,34,44,116,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,110,100,101,114,69,114,114,111,114,34,44,101,114,114,111,114,58,116,125,41,44,116,32,105,110,115,116,97,110,99,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,82,117,110,116,105,109,101,69,114,114,111,114,38,38,116,104,105,115,46,100,101,115,116,114,111,121,40,41,125,125,112,108,97,121,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,33,116,104,105,115,46,105,115,76,111,97,100,101,100,41,114,101,116,117,114,110,59,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,108,97,121,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,40,116,124,124,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,41,38,38,40,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,33,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,38,38,116,104,105,115,46,102,114,101,101,122,101,40,41,125,112,97,117,115,101,40,41,123,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,97,117,115,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,125,115,116,111,112,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,111,112,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,38,38,40,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,116,104,105,115,46,99,117,114,114,101,110,116,70,114,97,109,101,125,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,115,101,116,70,114,97,109,101,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,101,107,40,116,41,41,123,108,101,116,32,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,114,38,38,116,104,105,115,46,95,100,114,97,119,40,41,125,125,115,101,116,83,112,101,101,100,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,41,125,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,63,116,104,105,115,46,95,99,97,110,118,97,115,46,115,116,121,108,101,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,61,116,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,101,116,40,116,41,41,44,116,104,105,115,46,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,61,116,41,125,115,101,116,76,111,111,112,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,41,125,115,101,116,76,111,111,112,67,111,117,110,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,41,125,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,41,125,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,125,114,101,109,111,118,101,69,118,101,110,116,76,
11824105,115,116,101,110,101,114,40,116,44,101,41,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,125,100,101,115,116,114,111,121,40,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,102,114,101,101,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,110,117,108,108,44,116,104,105,115,46,95,99,111,110,116,101,120,116,61,110,117,108,108,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,100,101,115,116,114,111,121,34,125,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,114,101,109,111,118,101,65,108,108,69,118,101,110,116,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,125,102,114,101,101,122,101,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,48,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,101,101,122,101,34,125,41,41,125,117,110,102,114,101,101,122,101,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,117,110,102,114,101,101,122,101,34,125,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,125,114,101,115,105,122,101,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,124,124,33,116,104,105,115,46,105,115,76,111,97,100,101,100,124,124,33,116,104,105,115,46,95,99,97,110,118,97,115,41,114,101,116,117,114,110,59,105,102,40,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,41,123,108,101,116,32,101,61,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,119,105,110,100,111,119,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,49,44,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,61,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,59,114,33,61,61,48,38,38,115,33,61,61,48,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,61,115,42,101,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,61,114,42,101,41,125,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,105,122,101,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,115,101,116,67,97,110,118,97,115,40,116,41,123,105,102,40,33,40,33,116,124,124,116,104,105,115,46,95,99,97,110,118,97,115,61,61,61,116,41,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,99,97,110,118,97,115,61,116,44,116,104,105,115,46,95,105,110,
11824105,116,105,97,108,105,122,101,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,41,41,123,108,101,116,32,101,61,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,59,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,110,117,108,108,44,101,46,100,97,116,97,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,101,46,100,97,116,97,41,58,101,46,115,114,99,38,38,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,101,46,115,114,99,41,125,125,115,101,116,84,114,97,110,115,102,111,114,109,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,114,97,110,115,102,111,114,109,40,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,116,41,41,59,114,101,116,117,114,110,32,101,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,38,38,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,103,101,116,84,114,97,110,115,102,111,114,109,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,116,114,97,110,115,102,111,114,109,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,102,114,111,109,40,116,41,125,115,101,116,83,101,103,109,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,44,101,41,125,115,101,116,77,111,100,101,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,87,40,116,41,41,125,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,40,116,41,123,108,101,116,123,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,101,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,114,44,113,117,97,108,105,116,121,58,115,44,46,46,46,105,125,61,116,59,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,61,123,46,46,46,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,44,46,46,46,105,44,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,101,124,124,78,40,41,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,114,63,63,33,48,44,46,46,46,115,33,61,61,118,111,105,100,32,48,38,38,123,113,117,97,108,105,116,121,58,115,125,125,44,115,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,115,41,44,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,63,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,58,98,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,63,40,119,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,58,40,119,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,38,38,116,104,105,115,46,117,110,102,114,101,101,122,101,40,41,41,41,125,108,111,97,100,65,110,105,109,97,116,105,111,110,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,97,110,105,109,97,116,105,111,110,95,105,100,40,41,61,61,61,116,124,124,33,116,104,105,115,46,95,99,97,110,118,97,115,41,114,101,116,117,114,110,59,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,44,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,63,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,41,44,116,104,105,115,46,114,101,115,105,122,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,58,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,119,105,116,104,32,105,100,58,32,36,123,116,125,96,41,125,115,101,116,77,97,114,107,101,114,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,109,97,114,107,101,114,61,116,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,41,41,125,109,97,114,107,101,114,115,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,109,97,114,107,101,114,115,40,41,59,114,101,116,117,114,110,32,116,38,38,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,101,116,84,104,101,109,101,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,104,101,109,101,40,116,41,59,114,101,116,117,114,110,32,101,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,101,125,114,101,115,101,116,84,104,101,109,101,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,116,104,101,109,101,40,41,59,114,101,116,117,114,110,32,116,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,116,125,115,101,116,84,104,101,109,101,68,97,116,97,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,121,112,101,111,102,32,116,61,61,34,115,116,114,105,110,103,34,63,116,58,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,44,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,101,41,59,114,101,116,117,114,110,32,114,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,114,125,115,101,116,83,108,111,116,115,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,115,95,115,116,114,40,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,116,41,123,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,38,38,116,46,108,101,110,103,116,104,62,48,38,38,116,121,112,101,111,102,32,116,91,48,93,61,61,34,111,98,106,101,99,116,34,38,38,116,91,48,93,33,61,61,110,117,108,108,38,38,34,116,34,105,110,32,116,91,48,93,38,38,34,115,34,105,110,32,116,91,48,93,125,103,101,116,83,108,111,116,73,100,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,105,100,115,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,103,101,116,83,108,111,116,84,121,112,101,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,41,59,105,102,40,101,41,114,101,116,117,114,110,32,101,125,103,101,116,83,108,111,116,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,59,105,102,40,101,41,116,114,121,123,114,101,116,117,114,110,32,74,83,79,78,46,112,97,114,115,101,40,101,41,125,99,97,116,99,104,123,114,101,116,117,114,110,125,125,103,101,116,83,108,111,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,123,125,59,116,114,121,123,114,101,116,117,114,110,32,74,83,79,78,46,112,97,114,115,101,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,115,95,115,116,114,40,41,41,125,99,97,116,99,104,123,114,101,116,117,114,110,123,125,125,125,115,101,116,67,111,108,111,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,115,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,114,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,83,99,97,108,97,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,115,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,116,121,112,101,111,102,32,101,33,61,34,110,117,109,98,101,114,34,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,86,101,99,116,111,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,115,61,74,83,79,78,46,115,116,114,105,110,
11824103,105,102,121,40,123,97,58,114,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,40,116,44,101,44,114,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,115,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,105,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,107,58,123,97,58,115,63,49,58,48,44,107,58,101,125,44,112,58,114,125,41,44,95,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,105,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,95,125,115,101,116,84,101,120,116,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,44,115,61,101,59,105,102,40,114,41,123,108,101,116,32,112,61,74,83,79,78,46,112,97,114,115,101,40,114,41,59,105,102,40,112,38,38,34,107,34,105,110,32,112,38,38,65,114,114,97,121,46,105,115,65,114,114,97,121,40,112,46,107,41,41,123,108,101,116,32,103,61,112,46,107,91,48,93,59,34,115,34,105,110,32,103,38,38,116,121,112,101,111,102,32,103,46,115,61,61,34,111,98,106,101,99,116,34,38,38,40,115,61,123,46,46,46,103,46,115,44,46,46,46,101,125,41,125,125,108,101,116,32,105,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,48,44,107,58,91,123,116,58,48,44,115,125,93,125,41,44,95,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,105,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,95,125,114,101,115,101,116,83,108,111,116,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,115,108,111,116,40,116,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,99,108,101,97,114,83,108,111,116,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,108,111,116,40,116,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,114,101,115,101,116,83,108,111,116,115,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,115,108,111,116,115,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,125,99,108,101,97,114,83,108,111,116,115,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,108,111,116,115,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,125,115,101,116,76,97,121,111,117,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,125,115,101,116,86,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,63,33,49,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,118,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,125,115,116,97,116,105,99,32,115,101,116,87,97,115,109,85,114,108,40,116,41,123,85,46,115,101,116,87,97,115,109,85,114,108,40,116,41,125,115,116,97,116,105,99,32,97,115,121,110,99,32,114,101,103,105,115,116,101,114,70,111,110,116,40,116,44,101,41,123,116,114,121,123,97,119,97,105,116,32,85,46,108,111,97,100,40,41,59,108,101,116,32,114,59,105,102,40,116,121,112,101,111,102,32,101,61,61,34,115,116,114,105,110,103,34,41,123,108,101,116,32,105,61,97,119,97,105,116,32,102,101,116,99,104,40,101,41,59,105,102,40,33,105,46,111,107,41,114,101,116,117,114,110,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,102,101,116,99,104,32,102,111,110,116,32,102,114,111,109,32,85,82,76,58,32,36,123,101,125,46,32,83,116,97,116,117,115,58,32,36,123,105,46,115,116,97,116,117,115,125,96,41,44,33,49,59,114,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,97,119,97,105,116,32,105,46,97,114,114,97,121,66,117,102,102,101,114,40,41,41,125,101,108,115,101,32,101,32,105,110,115,116,97,110,99,101,111,102,32,85,105,110,116,56,65,114,114,97,121,63,114,61,101,58,114,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,101,41,59,108,101,116,32,115,61,90,40,116,44,114,41,59,114,101,116,117,114,110,32,115,124,124,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,114,101,103,105,115,116,101,114,32,102,111,110,116,32,34,36,123,116,125,34,46,32,70,111,110,116,32,100,97,116,97,32,109,97,121,32,98,101,32,105,110,118,97,108,105,100,46,96,41,44,115,125,99,97,116,99,104,40,114,41,123,114,101,116,117,114,110,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,69,114,114,111,114,32,114,101,103,105,115,116,101,114,105,110,103,32,102,111,110,116,32,34,36,123,116,125,34,58,96,44,114,41,44,33,49,125,125,97,110,105,109,97,116,105,111,110,83,105,122,101,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,41,59,114,101,116,117,114,110,123,119,105,100,116,104,58,116,63,46,91,48,93,63,63,48,44,104,101,105,103,104,116,58,116,63,46,91,49,93,63,63,48,125,125,103,101,116,76,97,121,101,114,66,111,117,110,100,105,110,103,66,111,120,40,116,41,123,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,41,59,105,102,40,101,38,38,101,46,108,101,110,103,116,104,61,61,61,56,41,114,101,116,117,114,110,32,65,114,114,97,121,46,102,114,111,109,40,101,41,125,115,116,97,116,105,99,32,116,114,97,110,115,102,111,114,109,84,104,101,109,101,84,111,76,111,116,116,105,101,83,108,111,116,115,40,116,44,101,41,123,114,101,116,117,114,110,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,41,58,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,41,58,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,40,116,41,123,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,61,116,125,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,115,116,97,114,116,40,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,46,111,112,101,110,85,114,108,80,111,108,105,99,121,63,46,114,101,113,117,105,114,101,85,115,101,114,73,110,116,101,114,97,99,116,105,111,110,63,63,33,48,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,46,111,112,101,110,85,114,108,80,111,108,105,99,121,63,46,119,104,105,116,101,108,105,115,116,63,63,91,93,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,44,116,38,38,40,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,48,44,116,104,105,115,46,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,125,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,115,116,111,112,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,44,116,38,38,40,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,116,97,116,117,115,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,40,116,44,101,61,33,49,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,
11824101,71,101,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,103,101,116,95,105,110,112,117,116,115,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,102,105,114,101,40,116,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,
11824111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,44,101,41,125,95,111,110,67,108,105,99,107,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,85,112,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,68,111,119,110,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,77,111,118,101,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,69,110,116,101,114,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,76,101,97,118,101,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,123,105,102,40,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,41,123,108,101,116,32,116,61,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,59,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,46,105,110,99,108,117,100,101,115,40,34,67,108,105,99,107,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,61,116,104,105,115,46,95,111,110,67,108,105,99,107,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,99,108,105,99,107,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,85,112,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,
11824116,101,114,85,112,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,85,112,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,117,112,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,68,111,119,110,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,68,111,119,110,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,100,111,119,110,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,77,111,118,101,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,77,111,118,101,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,109,111,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,69,110,116,101,114,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,69,110,116,101,114,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,101,110,116,101,114,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,69,120,105,116,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,76,101,97,118,101,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,108,101,97,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,41,41,125,125,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,123,102,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,99,108,105,99,107,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,117,112,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,100,111,119,110,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,
11824116,101,114,68,111,119,110,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,109,111,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,101,110,116,101,114,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,108,101,97,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,61,110,117,108,108,41,41,125,125,59,118,97,114,32,97,61,110,101,119,32,77,97,112,44,118,116,61,123,114,101,97,100,121,58,110,61,62,116,61,62,123,108,101,116,32,101,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,97,100,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,44,99,111,109,112,108,101,116,101,58,110,61,62,116,61,62,123,108,101,116,32,101,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,67,111,109,112,108,101,116,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,44,108,111,97,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,97,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,108,111,97,100,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,97,100,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,114,101,110,100,101,114,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,110,100,101,114,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,108,111,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,112,108,97,121,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,80,108,97,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,
11824125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,112,97,117,115,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,80,97,117,115,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,102,114,97,109,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,70,114,97,109,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,114,101,110,100,101,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,110,100,101,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,102,114,101,101,122,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,70,114,101,101,122,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,117,110,102,114,101,101,122,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,85,110,102,114,101,101,122,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,100,101,115,116,114,111,121,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,68,101,115,116,114,111,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,
11824101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,66,111,
11824111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,125,44,71,61,123,115,101,116,84,114,97,110,115,102,111,114,109,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,84,114,97,110,115,102,111,114,109,40,110,46,112,97,114,97,109,115,46,116,114,97,110,115,102,111,114,109,41,125,44,103,101,116,84,114,97,110,115,102,111,114,109,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,84,114,97,110,115,102,111,114,109,40,41,125,44,103,101,116,68,111,116,76,111,116,116,105,101,73,110,115,116,97,110,99,101,83,116,97,116,101,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,123,115,116,97,116,101,58,123,108,111,111,112,67,111,117,110,116,58,101,46,108,111,111,112,67,111,117,110,116,44,105,115,76,111,97,100,101,100,58,101,46,105,115,76,111,97,100,101,100,44,105,115,80,97,117,115,101,100,58,101,46,105,115,80,97,117,115,101,100,44,105,115,80,108,97,121,105,110,
11824103,58,101,46,105,115,80,108,97,121,105,110,103,44,105,115,83,116,111,112,112,101,100,58,101,46,105,115,83,116,111,112,112,101,100,44,105,115,70,114,111,122,101,110,58,101,46,105,115,70,114,111,122,101,110,44,108,111,111,112,58,101,46,108,111,111,112,44,109,111,100,101,58,101,46,109,111,100,101,44,115,112,101,101,100,58,101,46,115,112,101,101,100,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,99,117,114,114,101,110,116,70,114,97,109,101,44,116,111,116,97,108,70,114,97,109,101,115,58,101,46,116,111,116,97,108,70,114,97,109,101,115,44,100,117,114,97,116,105,111,110,58,101,46,100,117,114,97,116,105,111,110,44,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,58,101,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,44,114,101,110,100,101,114,67,111,110,102,105,103,58,101,46,114,101,110,100,101,114,67,111,110,102,105,103,44,109,97,114,107,101,114,58,101,46,109,97,114,107,101,114,44,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,58,101,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,44,109,97,114,107,101,114,115,58,101,46,109,97,114,107,101,114,115,40,41,44,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,58,101,46,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,44,97,99,116,105,118,101,84,104,101,109,101,73,100,58,101,46,97,99,116,105,118,101,84,104,101,109,101,73,100,44,97,117,116,111,112,108,97,121,58,101,46,97,117,116,111,112,108,97,121,44,115,101,103,109,101,110,116,58,101,46,115,101,103,109,101,110,116,44,108,97,121,111,117,116,58,101,46,108,97,121,111,117,116,44,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,58,101,46,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,44,105,115,82,101,97,100,121,58,101,46,105,115,82,101,97,100,121,44,109,97,110,105,102,101,115,116,58,101,46,109,97,110,105,102,101,115,116,125,125,125,44,115,101,116,76,97,121,111,117,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,97,121,111,117,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,97,121,111,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,
11824101,76,111,97,100,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,68,97,116,97,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,
11824101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,
11824101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,
11824115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,44,114,61,110,46,112,97,114,97,109,115,46,105,109,109,101,100,105,97,116,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,40,101,41,125,44,99,114,101,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,115,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,59,105,102,40,97,46,104,97,115,40,116,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,97,108,114,101,97,100,121,32,101,120,105,115,116,115,46,96,41,59,108,101,116,32,105,61,110,101,119,32,77,40,101,41,59,114,101,116,117,114,110,32,105,46,99,97,110,118,97,115,38,38,40,105,46,99,97,110,118,97,115,46,104,101,105,103,104,116,61,115,44,105,46,99,97,110,118,97,115,46,119,105,100,116,104,61,114,41,44,97,46,115,101,116,40,116,44,105,41,44,91,34,99,111,109,112,108,101,116,101,34,44,34,102,114,97,109,101,34,44,34,108,111,97,100,34,44,34,108,111,97,100,69,114,114,111,114,34,44,34,114,101,110,100,101,114,69,114,114,111,114,34,44,34,108,111,111,112,34,44,34,112,97,117,115,101,34,44,34,112,108,97,121,34,44,34,115,116,111,112,34,44,34,100,101,115,116,114,111,121,34,44,34,102,114,101,101,122,101,34,44,34,117,110,102,114,101,101,122,101,34,44,34,114,101,110,100,101,114,34,44,34,114,101,97,100,121,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,34,115,116,97,116,101,77,97,99,104,105,110,
11824101,83,116,97,116,101,69,120,105,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,93,46,102,111,114,69,97,99,104,40,112,61,62,123,105,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,112,44,118,116,91,112,93,40,116,41,41,125,41,44,123,105,110,115,116,97,110,99,101,73,100,58,116,125,125,44,100,101,115,116,114,111,121,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,101,38,38,40,101,46,100,101,115,116,114,111,121,40,41,44,97,46,100,101,108,101,116,101,40,116,41,41,125,44,102,114,101,101,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,102,114,101,101,122,101,40,41,125,44,108,111,97,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,108,111,97,100,40,101,41,125,44,108,111,97,100,65,110,105,109,97,116,105,111,110,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,97,110,105,109,97,116,105,111,110,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,108,111,97,100,65,110,105,109,97,116,105,111,110,40,101,41,125,44,115,101,116,84,104,101,109,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,116,104,101,109,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,101,116,84,104,101,109,101,40,101,41,125,44,115,101,116,84,104,101,109,101,68,97,116,97,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,116,104,101,109,101,68,97,116,97,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,101,116,84,104,101,109,101,68,97,116,97,40,101,41,125,44,112,97,117,115,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,
11824115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,112,97,117,115,101,40,41,125,44,112,108,97,121,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,112,108,97,121,40,41,125,44,114,101,103,105,115,116,101,114,70,111,110,116,58,97,115,121,110,99,32,110,61,62,123,108,101,116,123,102,111,110,116,78,97,109,101,58,116,44,102,111,110,116,83,111,117,114,99,101,58,101,125,61,110,46,112,97,114,97,109,115,59,114,101,116,117,114,110,32,77,46,114,101,103,105,115,116,101,114,70,111,110,116,40,116,44,101,41,125,44,114,101,115,105,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,114,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,115,46,99,97,110,118,97,115,38,38,40,115,46,99,97,110,118,97,115,46,104,101,105,103,104,116,61,114,44,115,46,99,97,110,118,97,115,46,119,105,100,116,104,61,101,41,44,115,46,114,101,115,105,122,101,40,41,125,44,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,101,41,125,44,115,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,115,101,116,83,108,111,116,115,40,110,46,112,97,114,97,109,115,46,115,108,111,116,115,41,125,44,103,101,116,83,108,111,116,73,100,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,73,100,115,40,41,125,44,103,101,116,83,108,111,116,84,121,112,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,84,121,112,101,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,103,101,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,
11824115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,103,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,115,40,41,125,44,115,101,116,67,111,108,111,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,67,111,108,111,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,83,99,97,108,97,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,83,99,97,108,97,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,86,101,99,116,111,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,86,101,99,116,111,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,110,46,112,97,114,97,109,115,46,99,111,108,111,114,83,116,111,112,67,111,117,110,116,41,125,44,115,101,116,84,101,120,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,84,101,120,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,114,101,115,101,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,
11824115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,114,101,115,101,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,99,108,101,97,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,99,108,101,97,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,114,101,115,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,114,101,115,101,116,83,108,111,116,115,40,41,125,44,99,108,101,97,114,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,99,108,101,97,114,83,108,111,116,115,40,41,125,44,115,101,116,70,114,97,109,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,102,114,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,70,114,97,109,101,40,101,41,125,44,115,101,116,77,111,100,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,109,111,100,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,77,111,100,101,40,101,41,125,44,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,114,101,110,100,101,114,67,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,40,101,41,125,44,115,101,116,83,101,103,109,101,110,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,101,103,109,101,110,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,83,101,103,109,101,110,116,40,101,91,48,93,44,101,91,49,93,41,125,44,115,101,116,83,112,101,101,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,
11824115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,112,101,101,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,83,112,101,101,100,40,101,41,125,44,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,101,41,125,44,115,101,116,87,97,115,109,85,114,108,58,110,61,62,123,77,46,115,101,116,87,97,115,109,85,114,108,40,110,46,112,97,114,97,109,115,46,117,114,108,41,125,44,115,116,111,112,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,115,116,111,112,40,41,125,44,117,110,102,114,101,101,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,117,110,102,114,101,101,122,101,40,41,125,44,115,101,116,86,105,101,119,112,111,114,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,105,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,44,95,61,97,46,103,101,116,40,116,41,59,105,102,40,33,95,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,95,46,115,101,116,86,105,101,119,112,111,114,116,40,101,44,114,44,115,44,105,41,125,44,97,110,105,109,97,116,105,111,110,83,105,122,101,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,108,101,116,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,61,101,46,97,110,105,109,97,116,105,111,110,83,105,122,101,40,41,59,114,101,116,117,114,110,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,125,44,115,101,116,77,97,114,107,101,114,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,109,97,114,107,101,114,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,77,97,114,107,101,114,40,101,41,125,44,115,101,116,76,
vendor: 14,031 bytes, line 11824
11824111,111,112,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,111,111,112,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,111,111,112,40,101,41,125,44,115,101,116,76,111,111,112,67,111,117,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,111,111,112,67,111,117,110,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,111,111,112,67,111,117,110,116,40,101,41,125,125,59,102,117,110,99,116,105,111,110,32,119,116,40,110,41,123,108,101,116,32,116,61,110,46,109,101,116,104,111,100,59,105,102,40,79,98,106,101,99,116,46,104,97,115,79,119,110,40,71,44,116,41,38,38,116,121,112,101,111,102,32,71,91,116,93,61,61,34,102,117,110,99,116,105,111,110,34,41,114,101,116,117,114,110,32,71,91,116,93,40,110,41,59,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,77,101,116,104,111,100,32,36,123,83,116,114,105,110,103,40,116,41,125,32,105,115,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,32,105,110,32,99,111,109,109,97,110,100,115,46,96,41,125,115,101,108,102,46,111,110,109,101,115,115,97,103,101,61,97,115,121,110,99,32,110,61,62,123,116,114,121,123,108,101,116,32,116,61,97,119,97,105,116,32,119,116,40,110,46,100,97,116,97,41,44,101,61,123,105,100,58,110,46,100,97,116,97,46,105,100,44,109,101,116,104,111,100,58,110,46,100,97,116,97,46,109,101,116,104,111,100,44,114,101,115,117,108,116,58,116,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,99,97,116,99,104,40,116,41,123,108,101,116,32,101,61,123,105,100,58,110,46,100,97,116,97,46,105,100,44,109,101,116,104,111,100,58,110,46,100,97,116,97,46,109,101,116,104,111,100,44,101,114,114,111,114,58,116,46,109,101,115,115,97,103,101,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,125,59,118,97,114,32,98,116,61,34,34,44,74,116,61,98,116,59,125,41,40,41,59,10])],{type:`application/javascript`}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}},se=class{constructor(){r(this,`_workers`,new Map),r(this,`_animationWorkerMap`,new Map)}getWorker(e){return this._workers.has(e)||this._workers.set(e,new oe),this._workers.get(e)}assignAnimationToWorker(e,t){this._animationWorkerMap.set(e,t)}unassignAnimationFromWorker(e){this._animationWorkerMap.delete(e)}sendMessage(e,t,n){this.getWorker(e).postMessage(t,n||[])}broadcastMessage(e,t){this._workers.forEach(n=>{n.postMessage(e,t||[])})}terminateWorker(e){let t=this._workers.get(e);t&&(t.terminate(),this._workers.delete(e))}};function Z(e,t){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement){let{height:n,width:r}=e.getBoundingClientRect();if(n!==0&&r!==0)return{width:r*t,height:n*t}}return{width:e.width,height:e.height}}function Q(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}var dist_$=class e{constructor(t){if(r(this,`_eventManager`,new I),r(this,`_id`,void 0),r(this,`_worker`,void 0),r(this,`_canvas`,void 0),r(this,`_dotLottieInstanceState`,{loopCount:0,markers:[],autoplay:!1,backgroundColor:``,currentFrame:0,duration:0,loop:!1,mode:`forward`,segment:[0,0],segmentDuration:0,speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:U()},activeAnimationId:``,activeThemeId:``,layout:void 0,marker:``,isReady:!1,manifest:null}),r(this,`_created`,!1),r(this,`_boundOnClick`,null),r(this,`_boundOnPointerUp`,null),r(this,`_boundOnPointerDown`,null),r(this,`_boundOnPointerMove`,null),r(this,`_boundOnPointerEnter`,null),r(this,`_boundOnPointerLeave`,null),r(this,`_pendingConfig`,null),t.canvas){let e=typeof HTMLCanvasElement<`u`&&t.canvas instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&t.canvas instanceof OffscreenCanvas;if(!e&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`)}this._canvas=t.canvas??null,this._id=`dotlottie-${Q()}`;let n=t.workerId||`defaultWorker`;this._worker=e._workerManager.getWorker(n),e._workerManager.assignAnimationToWorker(this._id,n),e._wasmUrl&&this._sendMessage(`setWasmUrl`,{url:e._wasmUrl});let i={...t,renderConfig:{...t.renderConfig,devicePixelRatio:t.renderConfig?.devicePixelRatio||U(),freezeOnOffscreen:t.renderConfig?.freezeOnOffscreen??!0}};this._pendingConfig=i,this._canvas&&(this._create(i),this._pendingConfig=null),this._worker.addEventListener(`message`,this._handleWorkerEvent.bind(this))}async _handleWorkerEvent(e){let t=e.data;if(!t.id&&(t.method===`onLoad`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&(L.observe(this._canvas,this),W(this._canvas)||await this.freeze()),this._dotLottieInstanceState.renderConfig.autoResize&&R.observe(this._canvas,this))),t.method===`onComplete`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onDestroy`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onUnfreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(t.result.event)),t.method===`onFrame`&&t.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=t.result.event.currentFrame,this._eventManager.dispatch(t.result.event)),t.method===`onRender`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onFreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPause`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPlay`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoadError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onRenderError`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onReady`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStart`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._setupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._cleanupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineTransition`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateEntered`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateExit`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineCustomEvent`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineBooleanInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineNumericInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStringInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInputFired`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInternalMessage`&&t.result.instanceId===this._id)){await this._updateDotLottieInstanceState();let e=t.result.event;e.message.startsWith(`OpenUrl: `)&&K(e.message)}}async _create(e){if(!this._canvas)return;let t;t=this._canvas instanceof HTMLCanvasElement?this._canvas.transferControlToOffscreen():this._canvas;let{instanceId:n}=await this._sendMessage(`create`,{instanceId:this._id,config:{...e,canvas:t},...Z(this._canvas,e.renderConfig?.devicePixelRatio||U())},[t]);if(n!==this._id)throw Error(`Instance ID mismatch`);this._created=!0,await this._updateDotLottieInstanceState()}get loopCount(){return this._dotLottieInstanceState.loopCount}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get segmentDuration(){return this._dotLottieInstanceState.segmentDuration}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}async setCanvas(e){let t=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas;if(!t&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`);if(this._canvas!==e){if(this._created&&this._canvas!==null)throw Error(`Cannot change canvas after worker instance is already created with a different canvas.`);this._canvas=e,!this._created&&this._pendingConfig&&(await this._create(this._pendingConfig),this._pendingConfig=null)}}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage(`play`,{instanceId:this._id}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&!W(this._canvas)&&await this.freeze())}async pause(){this._created&&(await this._sendMessage(`pause`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async stop(){this._created&&(await this._sendMessage(`stop`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSpeed(e){this._created&&(await this._sendMessage(`setSpeed`,{instanceId:this._id,speed:e}),await this._updateDotLottieInstanceState())}async setMode(e){this._created&&(await this._sendMessage(`setMode`,{instanceId:this._id,mode:e}),await this._updateDotLottieInstanceState())}async setFrame(e){this._created&&(await this._sendMessage(`setFrame`,{frame:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSegment(e,t){this._created&&(await this._sendMessage(`setSegment`,{instanceId:this._id,segment:[e,t]}),await this._updateDotLottieInstanceState())}async setRenderConfig(e){if(!this._created)return;let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;await this._sendMessage(`setRenderConfig`,{instanceId:this._id,renderConfig:{...this._dotLottieInstanceState.renderConfig,...i,devicePixelRatio:t||U(),freezeOnOffscreen:n??!0,...r!==void 0&&{quality:r}}}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.autoResize?R.observe(this._canvas,this):R.unobserve(this._canvas),this._dotLottieInstanceState.renderConfig.freezeOnOffscreen?(L.observe(this._canvas,this),W(this._canvas)||await this.freeze()):(L.unobserve(this._canvas),this._dotLottieInstanceState.isFrozen&&await this.unfreeze()))}async setUseFrameInterpolation(e){this._created&&(await this._sendMessage(`setUseFrameInterpolation`,{instanceId:this._id,useFrameInterpolation:e}),await this._updateDotLottieInstanceState())}async setTheme(e){if(!this._created)return!1;let t=this._sendMessage(`setTheme`,{instanceId:this._id,themeId:e});return await this._updateDotLottieInstanceState(),t}
11824async load(e){if(!this._created){this._pendingConfig&&(this._pendingConfig={...this._pendingConfig,...e});return}await this._sendMessage(`load`,{config:e,instanceId:this._id}),await this._updateDotLottieInstanceState()}async setLoop(e){this._created&&(await this._sendMessage(`setLoop`,{instanceId:this._id,loop:e}),await this._updateDotLottieInstanceState())}async setLoopCount(e){this._created&&(await this._sendMessage(`setLoopCount`,{instanceId:this._id,loopCount:e}),await this._updateDotLottieInstanceState())}async resize(){if(!this._created||!this._canvas)return;let{height:e,width:t}=Z(this._canvas,this._dotLottieInstanceState.renderConfig.devicePixelRatio||U());await this._sendMessage(`resize`,{height:e,instanceId:this._id,width:t}),await this._updateDotLottieInstanceState()}async destroy(){this._created&&(this._created=!1,await this._sendMessage(`destroy`,{instanceId:this._id}),this._cleanupStateMachineListeners(),e._workerManager.unassignAnimationFromWorker(this._id),this._eventManager.removeAllEventListeners(),s&&this._canvas instanceof HTMLCanvasElement&&(L.unobserve(this._canvas),R.unobserve(this._canvas)))}async freeze(){this._created&&(await this._sendMessage(`freeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async unfreeze(){this._created&&(await this._sendMessage(`unfreeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setBackgroundColor(e){this._created&&(await this._sendMessage(`setBackgroundColor`,{instanceId:this._id,backgroundColor:e}),await this._updateDotLottieInstanceState())}async loadAnimation(e){this._created&&(await this._sendMessage(`loadAnimation`,{animationId:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setLayout(e){this._created&&(await this._sendMessage(`setLayout`,{instanceId:this._id,layout:e}),await this._updateDotLottieInstanceState())}async setSlots(e){this._created&&await this._sendMessage(`setSlots`,{instanceId:this._id,slots:e})}async getSlotIds(){return this._created?this._sendMessage(`getSlotIds`,{instanceId:this._id}):[]}async getSlotType(e){if(this._created)return this._sendMessage(`getSlotType`,{instanceId:this._id,slotId:e})}async getSlot(e){if(this._created)return this._sendMessage(`getSlot`,{instanceId:this._id,slotId:e})}async getSlots(){return this._created?this._sendMessage(`getSlots`,{instanceId:this._id}):{}}async setColorSlot(e,t){return this._created?this._sendMessage(`setColorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setScalarSlot(e,t){return this._created?this._sendMessage(`setScalarSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setVectorSlot(e,t){return this._created?this._sendMessage(`setVectorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setGradientSlot(e,t,n){return this._created?this._sendMessage(`setGradientSlot`,{instanceId:this._id,slotId:e,value:t,colorStopCount:n}):!1}async setTextSlot(e,t){return this._created?this._sendMessage(`setTextSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async resetSlot(e){return this._created?this._sendMessage(`resetSlot`,{instanceId:this._id,slotId:e}):!1}async clearSlot(e){return this._created?this._sendMessage(`clearSlot`,{instanceId:this._id,slotId:e}):!1}async resetSlots(){return this._created?this._sendMessage(`resetSlots`,{instanceId:this._id}):!1}async clearSlots(){return this._created?this._sendMessage(`clearSlots`,{instanceId:this._id}):!1}async _updateDotLottieInstanceState(){this._created&&(this._dotLottieInstanceState=(await this._sendMessage(`getDotLottieInstanceState`,{instanceId:this._id})).state)}markers(){return this._dotLottieInstanceState.markers}async setMarker(e){this._created&&(await this._sendMessage(`setMarker`,{instanceId:this._id,marker:e}),await this._updateDotLottieInstanceState())}async setThemeData(e){if(!this._created)return!1;let t=await this._sendMessage(`setThemeData`,{instanceId:this._id,themeData:e});return await this._updateDotLottieInstanceState(),t}async setViewport(e,t,n,r){return this._created?this._sendMessage(`setViewport`,{x:e,y:t,width:n,height:r,instanceId:this._id}):!1}async animationSize(){return this._created?this._sendMessage(`animationSize`,{instanceId:this._id}):{height:0,width:0}}async setTransform(e){return this._created?this._sendMessage(`setTransform`,{instanceId:this._id,transform:e}):!1}async getTransform(){if(this._created)return this._sendMessage(`getTransform`,{instanceId:this._id})}async _sendMessage(e,t,n){let r={id:`dotlottie-request-${Q()}`,method:e,params:t};return this._worker.postMessage(r,n||[]),new Promise((t,n)=>{let i=a=>{let o=a.data;o.id===r.id&&(this._worker.removeEventListener(`message`,i),o.error?n(Error(`Failed to execute method ${e}: ${o.error}`)):t(o.result))};this._worker.addEventListener(`message`,i)})}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}static setWasmUrl(t){e._wasmUrl=t}static async registerFont(t,n){try{let r=Q();return e._workerManager.broadcastMessage({id:r,method:`registerFont`,params:{fontName:t,fontSource:n}}),!0}catch(e){return console.error(`Error broadcasting registerFont for "${t}":`,e),!1}}async stateMachineLoad(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoad`,{instanceId:this._id,stateMachineId:e});return await this._updateDotLottieInstanceState(),t}async stateMachineLoadData(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoadData`,{instanceId:this._id,stateMachineData:e});return await this._updateDotLottieInstanceState(),t}
vendor: 4,631 bytes, line 11824
11824async stateMachineStart(){if(!this._created)return!1;let e=await this._sendMessage(`stateMachineStart`,{instanceId:this._id});return e&&(this._setupStateMachineListeners(),await this._updateDotLottieInstanceState()),e}async stateMachineStop(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage(`stateMachineStop`,{instanceId:this._id})):!1}async stateMachineSetNumericInput(e,t){return this._created?this._sendMessage(`stateMachineSetNumericInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetBooleanInput(e,t){return this._created?this._sendMessage(`stateMachineSetBooleanInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetConfig(e){this._created&&this._sendMessage(`stateMachineSetConfig`,{instanceId:this._id,config:e})}async stateMachineSetStringInput(e,t){return this._created?this._sendMessage(`stateMachineSetStringInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineGetNumericInput(e){if(this._created)return this._sendMessage(`stateMachineGetNumericInput`,{instanceId:this._id,name:e})}async stateMachineGetBooleanInput(e){if(this._created)return this._sendMessage(`stateMachineGetBooleanInput`,{instanceId:this._id,name:e})}async stateMachineGetStringInput(e){if(this._created)return this._sendMessage(`stateMachineGetStringInput`,{instanceId:this._id,name:e})}async stateMachineGetInputs(){if(this._created)return this._sendMessage(`stateMachineGetInputs`,{instanceId:this._id})}async stateMachineFireEvent(e){this._created&&this._sendMessage(`stateMachineFireEvent`,{instanceId:this._id,name:e})}async stateMachineGetStatus(){return this._created?this._sendMessage(`stateMachineGetStatus`,{instanceId:this._id}):``}async stateMachineGetCurrentState(){return this._created?this._sendMessage(`stateMachineGetCurrentState`,{instanceId:this._id}):``}async stateMachineGetActiveId(){return this._created?this._sendMessage(`stateMachineGetActiveId`,{instanceId:this._id}):``}async stateMachineOverrideState(e,t=!1){return this._created?this._sendMessage(`stateMachineOverrideState`,{instanceId:this._id,state:e,immediate:t}):!1}async stateMachineGet(e){return this._created?this._sendMessage(`stateMachineGet`,{instanceId:this._id,stateMachineId:e}):``}async stateMachineGetListeners(){return this._created?this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id}):[]}async stateMachinePostClickEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerUpEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerDownEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerMoveEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerEnterEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerExitEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:e,y:t})}_onClick(e){let t=G(e);t&&this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerUp(e){let t=G(e);t&&this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerDown(e){let t=G(e);t&&this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerMove(e){let t=G(e);t&&this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerEnter(e){let t=G(e);t&&this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerLeave(e){let t=G(e);t&&this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:t.x,y:t.y})}async _setupStateMachineListeners(){if(s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let e=await this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id});if(e.length===0)return;this._cleanupStateMachineListeners(),e.includes(`Click`)&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener(`click`,this._boundOnClick)),e.includes(`PointerUp`)&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener(`pointerup`,this._boundOnPointerUp)),e.includes(`PointerDown`)&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener(`pointerdown`,this._boundOnPointerDown)),e.
11824includes(`PointerMove`)&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener(`pointermove`,this._boundOnPointerMove)),e.includes(`PointerEnter`)&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener(`pointerenter`,this._boundOnPointerEnter)),e.includes(`PointerExit`)&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener(`pointerleave`,this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){s&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener(`click`,this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener(`pointerup`,this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener(`pointerdown`,this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener(`pointermove`,this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener(`pointerenter`,this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener(`pointerleave`,this._boundOnPointerLeave),this._boundOnPointerLeave=null))}};r(dist_$,`_workerManager`,new se),r(dist_$,`_wasmUrl`,``); 11825//# sourceMappingURL=index.js.map 11826;// CONCATENATED MODULE: ./src/modules/components/staticLogo/staticLogo.early.js 11827 11828 11829const canvases = [ 11830 { 11831 element: document.getElementById('staticLogo--dma'), 11832 lottieSrc: 'lottie/logo-animation-dma.lottie', 11833 }, 11834 { 11835 element: document.getElementById('staticLogo--kjm'), 11836 lottieSrc: 'lottie/logo-animation-kjm.lottie', 11837 } 11838]; 11839 11840const firstCanvas = canvases.find(c => c.element); 11841 11842if (firstCanvas) { 11843 const assets = firstCanvas.element.getAttribute('data-assets'); 11844 const wasmUrl = assets + 'lottie/dotlottie-player.wasm'; 11845 11846 ae.setWasmUrl(wasmUrl); 11847 11848 canvases.forEach(canvasObj => { 11849 const canvas = canvasObj.element; 11850 if (!canvas) { 11851 return; 11852 } 11853 11854 if (!canvasObj.lottieSrc) { 11855 document.body.classList.add('show-fallback-logo'); 11856 11857 return; 11858 } 11859 11860 const playCountKey = 'dma_logo_animation_plays'; 11861 const playCount = parseInt(localStorage.getItem(playCountKey) || '0', 10); 11862 11863 if (playCount >= 3) { 11864 document.body.classList.add('show-fallback-logo'); 11865 11866 return; 11867 } 11868 11869 const lottieSrc = assets + canvasObj.lottieSrc; 11870 11871 let isLoaded = false; 11872 11873 const dotLottie = new ae({ 11874 autoplay: true, 11875 canvas: canvas, 11876 src: lottieSrc 11877 }); 11878 11879 const timeoutId = setTimeout(() => { 11880 if (!isLoaded) { 11881 dotLottie.destroy(); 11882 document.body.classList.add('show-fallback-logo'); 11883 } 11884 }, 2000); 11885 11886 dotLottie.addEventListener('loadError', () => { 11887 isLoaded = true; 11888 clearTimeout(timeoutId); 11889 document.body.classList.add('show-fallback-logo'); 11890 }); 11891 11892 dotLottie.addEventListener('ready', () => { 11893 isLoaded = true; 11894 clearTimeout(timeoutId); 11895 document.body.classList.add('show-animated-logo'); 11896 11897 const currentCount = parseInt(localStorage.getItem(playCountKey) || '0', 10); 11898 localStorage.setItem(playCountKey, (currentCount + 1).toString()); 11899 }); 11900 }); 11901} 11902 11903// EXTERNAL MODULE: ./node_modules/lazysizes/lazysizes.js 11904var lazysizes = __webpack_require__(7090); 11905var lazysizes_default = /*#__PURE__*/__webpack_require__.n(lazysizes); 11906// EXTERNAL MODULE: ./node_modules/lazysizes/plugins/print/ls.print.js 11907var ls_print = __webpack_require__(5222); 11908;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/js/earlyLoaded/lazyload/lazyload.early.js 11909 11910 11911 11912lazysizes_default().init(); 11913console.log('lazyloading initialised immediate'); 11914 11915;// CONCATENATED MODULE: external "$" 11916var external_$_namespaceObject = $; 11917var external_$_default = /*#__PURE__*/__webpack_require__.n(external_$_namespaceObject); 11918;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/js/earlyLoaded/scriptUnblocker/scriptUnblocker.early.js 11919 11920 11921function unblockScript(names) {
11922 names.forEach(function(name) { 11923 // die Variable "sitepackage_base_js_path" wird vom Backend mit einem <script> via TypoScript bereitgestellt 11924 let path = sitepackage_base_js_path; // jshint ignore:line 11925 11926 // change path if typo3 generated site 11927 if (external_$_default()('head meta[content="isFractal"]').length > 0) { 11928 path='frontend/js/'; 11929 } 11930 11931 // only load the scripts once!!! 11932 if(external_$_default()('script[src="' + path + name + '.js"]').length > 0) { 11933 return; 11934 } 11935 11936 let script = document.createElement('script'); 11937 script.src = path + name + '.js'; 11938 document.head.appendChild(script); 11939 }); 11940} 11941 11942/** 11943 * Init on DOM ready 11944 */ 11945external_$_default().when((external_$_default()).ready).then(() => { 11946 // todo: if dependency on jquery causes problems remove jquery 11947 const contentObjects = { 11948 '.f-form': ['form'], 11949 '[data-parsley-validate]': ['formOptions'], 11950 '.f-form--ajax-submit': ['formOptions'], 11951 '.f-field[data-condition]': ['formOptions'], 11952 '.f-form--floating-labels': ['formOptions'], 11953 '.f-form--save-data': ['formOptions'], 11954 '.js-datepicker': ['datepicker'], 11955 '.tx_solr': ['solr'], 11956 '.headerSearchSolr': ['solr'], 11957 '.m-tab': ['tabs'], 11958 '.imageComparisonSlider': ['imageComparisonSlider'], 11959 '.counterTeaser': ['counterTeaser'], 11960 '.figure[data-lightbox]': ['lightBox'], 11961 '.coPopup': ['lightBox'], 11962 '.js-open-popupFilter': ['lightBox'], 11963 '.shopBasketTeaser': ['lightBox'], 11964 // '.locationMap': ['vendors~locationMap~simpleMap', 'locationMap'], 11965 '.mapOsmSimple': ['simpleMap'], 11966 '.thumbnailSlider': ['sliderComponents'], 11967 '.m-stage': ['sliderComponents'], 11968 '.gallery--slider': ['sliderComponents'], 11969 '.m-slider': ['sliderComponents'], 11970 '.video': ['video'], 11971 '.iframe': ['iframe'], 11972 '.coWwt3_shop_step_nav, [data-cart-counter]': ['shopComponents'], 11973 '.shopBasket': ['shopComponents'], 11974 '.orderPanel': ['shopComponents'], 11975 '.miniOrderPanel': ['shopComponents'], 11976 }; 11977 11978 for (const [key, value] of Object.entries(contentObjects)) { 11979 if (external_$_default()(key).length > 0) { 11980 unblockScript(value); 11981 } 11982 } 11983}); 11984 11985;// CONCATENATED MODULE: ./src/js/_imports/earlyLoaded.js 11986 11987 11988 11989 11990}(); 11991/******/ })() 11992; 11993/******/ (function() { // webpackBootstrap 11994/******/ "use strict"; 11995var __webpack_exports__ = {}; 11996 11997;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/js/core/config.core.js 11998// Keep in sync with breakpoints in sass/_variables.scss 11999const breakpoints = { 12000 base: 0, 12001 12002 mobile: 320, 12003 phablet: 540, 12004 12005 tablet: 740, 12006 12007 desktop: 980, 12008 mainNavigation: 980, 12009 wide: 1200, 12010 12011 slider: 1280, 12012 extraordinary: 1400 12013}; 12014 12015// Keep in sync with transitions in sass/_variables.scss 12016const speed = { 12017 instant: 5, 12018 fast: 100, 12019 normal: 300, 12020 slow: 700, 12021 sluggish: 1200 12022}; 12023 12024// todo @skm: ist this the right place for this? copied from gf-023... 12025if ("ontouchstart" in document.documentElement) { 12026 var root = document.getElementsByTagName( 'html' )[0]; // '0' to assign the first (and only `HTML` tag) 12027 root.className += ' touch-device'; 12028} 12029 12030window.addEventListener('beforeprint', () => { 12031 window.scrollTo(0, 0); 12032}); 12033 12034;// CONCATENATED MODULE: ./src/js/_imports/core.js 12035 12036 12037 12038 12039 12040/******/ })() 12041; 12042/******/ (function() { // webpackBootstrap 12043/******/ var __webpack_modules__ = ({ 12044 12045/***/ 1453: 12046/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 12047 12048/* provided dependency */ var $ = __webpack_require__(3336); 12049let spinner = '<span class="spinner__wrapper"><span class="spinner">Wird geladen</span></span>'; 12050 12051function removeLoader() { 12052 $(this).removeClass('loading').find('.spinner__wrapper').remove(); 12053} 12054 12055function addLoader() { 12056 $(this).append(spinner).addClass('loading'); 12057} 12058 12059$.when($.ready).then(() => { 12060 const $ajaxButtons = $('button.ajax'); 12061 12062 $ajaxButtons.each(function (evt, el) { 12063 $(el).on('click', addLoader); 12064 $(el).on('button:removeLoader', removeLoader); 12065 12066 $(el).parents('form').on('field:error', function() { 12067 removeLoader(); 12068 }); 12069 }); 12070}); 12071 12072 12073/***/ }), 12074 12075/***/ 5732:
12076/***/ (function(__unused_webpack_module, exports) { 12077 12078/* 12079 * Leaflet.markercluster 1.5.3+master.e5124b2, 12080 * Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps. 12081 * https://github.com/Leaflet/Leaflet.markercluster 12082 * (c) 2012-2017, Dave Leaver, smartrak 12083 */ 12084(function (global, factory) { 12085 true ? factory(exports) : 12086 0
vendor: 80,602 bytes, lines 12086-14794
12086; 12087}(this, function (exports) { 'use strict'; 12088 12089 /* 12090 * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within 12091 */ 12092 12093 var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({ 12094 12095 options: { 12096 maxClusterRadius: 80, //A cluster will cover at most this many pixels from its center 12097 iconCreateFunction: null, 12098 clusterPane: L.Marker.prototype.options.pane, 12099 12100 spiderfyOnEveryZoom: false, 12101 spiderfyOnMaxZoom: true, 12102 showCoverageOnHover: true, 12103 zoomToBoundsOnClick: true, 12104 singleMarkerMode: false, 12105 12106 disableClusteringAtZoom: null, 12107 12108 // Setting this to false prevents the removal of any clusters outside of the viewpoint, which 12109 // is the default behaviour for performance reasons. 12110 removeOutsideVisibleBounds: true, 12111 12112 // Set to false to disable all animations (zoom and spiderfy). 12113 // If false, option animateAddingMarkers below has no effect. 12114 // If L.DomUtil.TRANSITION is falsy, this option has no effect. 12115 animate: true, 12116 12117 //Whether to animate adding markers after adding the MarkerClusterGroup to the map 12118 // If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains. 12119 animateAddingMarkers: false, 12120 12121 // Make it possible to provide custom function to calculate spiderfy shape positions 12122 spiderfyShapePositions: null, 12123 12124 //Increase to increase the distance away that spiderfied markers appear from the center 12125 spiderfyDistanceMultiplier: 1, 12126 12127 // Make it possible to specify a polyline options on a spider leg 12128 spiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 }, 12129 12130 // When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts 12131 chunkedLoading: false, 12132 chunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback) 12133 chunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser 12134 chunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator) 12135 12136 //Options to pass to the L.Polygon constructor 12137 polygonOptions: {} 12138 }, 12139 12140 initialize: function (options) { 12141 L.Util.setOptions(this, options); 12142 if (!this.options.iconCreateFunction) { 12143 this.options.iconCreateFunction = this._defaultIconCreateFunction; 12144 } 12145 12146 this._featureGroup = L.featureGroup(); 12147 this._featureGroup.addEventParent(this); 12148 12149 this._nonPointGroup = L.featureGroup(); 12150 this._nonPointGroup.addEventParent(this); 12151 12152 this._inZoomAnimation = 0; 12153 this._needsClustering = []; 12154 this._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of 12155 //The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move 12156 this._currentShownBounds = null; 12157 12158 this._queue = []; 12159 12160 this._childMarkerEventHandlers = { 12161 'dragstart': this._childMarkerDragStart, 12162 'move': this._childMarkerMoved, 12163 'dragend': this._childMarkerDragEnd, 12164 }; 12165 12166 // Hook the appropriate animation methods. 12167 var animate = L.DomUtil.TRANSITION && this.options.animate; 12168 L.extend(this, animate ? this._withAnimation : this._noAnimation); 12169 // Remember which MarkerCluster class to instantiate (animated or not). 12170 this._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated; 12171 }, 12172 12173 addLayer: function (layer) { 12174 12175 if (layer instanceof L.LayerGroup) { 12176 return this.addLayers([layer]); 12177 } 12178 12179 //Don't cluster non point data 12180 if (!layer.getLatLng) { 12181 this._nonPointGroup.addLayer(layer); 12182 this.fire('layeradd', { layer: layer }); 12183 return this; 12184 } 12185 12186 if (!this._map) { 12187 this._needsClustering.push(layer); 12188 this.fire('layeradd', { layer: layer }); 12189 return this; 12190 } 12191 12192 if (this.hasLayer(layer)) { 12193 return this; 12194 } 12195 12196 12197 //If we have already clustered we'll need to add this one to a cluster 12198 12199 if (this._unspiderfy) { 12200 this._unspiderfy(); 12201 } 12202 12203 this._addLayer(layer, this._maxZoom); 12204 this.fire('layeradd', { layer: layer }); 12205 12206 // Refresh bounds and weighted positions. 12207 this._topClusterLevel._recalculateBounds(); 12208 12209 this._refreshClustersIcons(); 12210 12211 //Work out what is visible 12212 var visibleLayer = layer, 12213 currentZoom = this._zoom; 12214 if (layer.__parent) { 12215 while (visibleLayer.__parent._zoom >= currentZoom) { 12216 visibleLayer = visibleLayer.__parent; 12217 } 12218 } 12219 12220 if (this._currentShownBounds.contains(visibleLayer.getLatLng())) { 12221 if (this.options.animateAddingMarkers) { 12222 this._animationAddLayer(layer, visibleLayer); 12223 } else { 12224 this._animationAddLayerNonAnimated(layer, visibleLayer); 12225 } 12226 } 12227 return this; 12228 }, 12229 12230 removeLayer: function (layer) { 12231 12232 if (layer instanceof L.LayerGroup) { 12233 return this.removeLayers([layer]); 12234 } 12235 12236 //Non point layers 12237 if (!layer.getLatLng) { 12238 this._nonPointGroup.removeLayer(layer); 12239 this.fire('layerremove', { layer: layer }); 12240 return this; 12241 } 12242 12243 if (!this._map) { 12244 if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) { 12245 this._needsRemoving.push({ layer: layer, latlng: layer._latlng }); 12246 } 12247 this.fire('layerremove', { layer: layer }); 12248 return this; 12249 } 12250 12251 if (!layer.__parent) { 12252 return this; 12253 } 12254 12255 if (this._unspiderfy) { 12256 this._unspiderfy(); 12257 this._unspiderfyLayer(layer); 12258 } 12259 12260 //Remove the marker from clusters 12261 this._removeLayer(layer, true); 12262 this.fire('layerremove', { layer: layer }); 12263 12264 // Refresh bounds and weighted positions. 12265 this._topClusterLevel._recalculateBounds(); 12266 12267 this._refreshClustersIcons(); 12268 12269 layer.off(this._childMarkerEventHandlers, this); 12270 12271 if (this._featureGroup.hasLayer(layer)) { 12272 this._featureGroup.removeLayer(layer); 12273 if (layer.clusterShow) { 12274 layer.clusterShow(); 12275 } 12276 } 12277 12278 return this; 12279 }, 12280 12281 //Takes an array of markers and adds them in bulk 12282 addLayers: function (layersArray, skipLayerAddEvent) { 12283 if (!L.Util.isArray(layersArray)) { 12284 return this.addLayer(layersArray); 12285 } 12286 12287 var fg = this._featureGroup, 12288 npg = this._nonPointGroup, 12289 chunked = this.options.chunkedLoading, 12290 chunkInterval = this.options.chunkInterval, 12291 chunkProgress = this.options.chunkProgress, 12292 l = layersArray.length, 12293 offset = 0, 12294 originalArray = true, 12295 m; 12296 12297 if (this._map) { 12298 var started = (new Date()).getTime(); 12299 var process = L.bind(function () { 12300 var start = (new Date()).getTime(); 12301 12302 // Make sure to unspiderfy before starting to add some layers 12303 if (this._map && this._unspiderfy) { 12304 this._unspiderfy(); 12305 } 12306 12307 for (; offset < l; offset++) { 12308 if (chunked && offset % 200 === 0) { 12309 // every couple hundred markers, instrument the time elapsed since processing started: 12310 var elapsed = (new Date()).getTime() - start; 12311 if (elapsed > chunkInterval) { 12312 break; // been working too hard, time to take a break :-) 12313 } 12314 } 12315 12316 m = layersArray[offset]; 12317 12318 // Group of layers, append children to layersArray and skip. 12319 // Side effects: 12320 // - Total increases, so chunkProgress ratio jumps backward. 12321 // - Groups are not included in this group, only their non-group child layers (hasLayer). 12322 // Changing array length while looping does not affect performance in current browsers: 12323 // http://jsperf.com/for-loop-changing-length/6 12324 if (m instanceof L.LayerGroup) { 12325 if (originalArray) { 12326 layersArray = layersArray.slice(); 12327 originalArray = false; 12328 } 12329 this._extractNonGroupLayers(m, layersArray); 12330 l = layersArray.length; 12331 continue; 12332 } 12333 12334 //Not point data, can't be clustered 12335 if (!m.getLatLng) { 12336 npg.addLayer(m); 12337 if (!skipLayerAddEvent) { 12338 this.fire('layeradd', { layer: m }); 12339 } 12340 continue; 12341 } 12342 12343 if (this.hasLayer(m)) { 12344 continue; 12345 } 12346 12347 this._addLayer(m, this._maxZoom); 12348 if (!skipLayerAddEvent) { 12349 this.fire('layeradd', { layer: m }); 12350 } 12351 12352 //If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will 12353 if (m.__parent) { 12354 if (m.__parent.getChildCount() === 2) { 12355 var markers = m.__parent.getAllChildMarkers(), 12356 otherMarker = markers[0] === m ? markers[1] : markers[0]; 12357 fg.removeLayer(otherMarker); 12358 } 12359 } 12360 } 12361 12362 if (chunkProgress) { 12363 // report progress and time elapsed: 12364 chunkProgress(offset, l, (new Date()).getTime() - started); 12365 } 12366 12367 // Completed processing all markers. 12368 if (offset === l) { 12369 12370 // Refresh bounds and weighted positions. 12371 this._topClusterLevel._recalculateBounds(); 12372 12373 this._refreshClustersIcons(); 12374 12375 this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds); 12376 } else { 12377 setTimeout(process, this.options.chunkDelay); 12378 } 12379 }, this); 12380 12381 process(); 12382 } else { 12383 var needsClustering = this._needsClustering; 12384 12385 for (; offset < l; offset++) { 12386 m = layersArray[offset]; 12387 12388 // Group of layers, append children to layersArray and skip. 12389 if (m instanceof L.LayerGroup) { 12390 if (originalArray) { 12391 layersArray = layersArray.slice(); 12392 originalArray = false; 12393 } 12394 this._extractNonGroupLayers(m, layersArray); 12395 l = layersArray.length; 12396 continue; 12397 } 12398 12399 //Not point data, can't be clustered 12400 if (!m.getLatLng) { 12401 npg.addLayer(m); 12402 continue; 12403 } 12404 12405 if (this.hasLayer(m)) { 12406 continue; 12407 } 12408 12409 needsClustering.push(m); 12410 } 12411 } 12412 return this; 12413 }, 12414 12415 //Takes an array of markers and removes them in bulk 12416 removeLayers: function (layersArray) { 12417 var i, m, 12418 l = layersArray.length, 12419 fg = this._featureGroup, 12420 npg = this._nonPointGroup, 12421 originalArray = true; 12422 12423 if (!this._map) { 12424 for (i = 0; i < l; i++) { 12425 m = layersArray[i]; 12426 12427 // Group of layers, append children to layersArray and skip. 12428 if (m instanceof L.LayerGroup) { 12429 if (originalArray) { 12430 layersArray = layersArray.slice(); 12431 originalArray = false; 12432 } 12433 this._extractNonGroupLayers(m, layersArray); 12434 l = layersArray.length; 12435 continue; 12436 } 12437 12438 this._arraySplice(this._needsClustering, m); 12439 npg.removeLayer(m); 12440 if (this.hasLayer(m)) { 12441 this._needsRemoving.push({ layer: m, latlng: m._latlng }); 12442 } 12443 this.fire('layerremove', { layer: m }); 12444 } 12445 return this; 12446 } 12447 12448 if (this._unspiderfy) { 12449 this._unspiderfy(); 12450 12451 // Work on a copy of the array, so that next loop is not affected. 12452 var layersArray2 = layersArray.slice(), 12453 l2 = l; 12454 for (i = 0; i < l2; i++) { 12455 m = layersArray2[i]; 12456 12457 // Group of layers, append children to layersArray and skip. 12458 if (m instanceof L.LayerGroup) { 12459 this._extractNonGroupLayers(m, layersArray2); 12460 l2 = layersArray2.length; 12461 continue; 12462 } 12463 12464 this._unspiderfyLayer(m); 12465 } 12466 } 12467 12468 for (i = 0; i < l; i++) { 12469 m = layersArray[i]; 12470 12471 // Group of layers, append children to layersArray and skip. 12472 if (m instanceof L.LayerGroup) { 12473 if (originalArray) { 12474 layersArray = layersArray.slice(); 12475 originalArray = false; 12476 } 12477 this._extractNonGroupLayers(m, layersArray); 12478 l = layersArray.length; 12479 continue; 12480 } 12481 12482 if (!m.__parent) { 12483 npg.removeLayer(m); 12484 this.fire('layerremove', { layer: m }); 12485 continue; 12486 } 12487 12488 this._removeLayer(m, true, true); 12489 this.fire('layerremove', { layer: m }); 12490 12491 if (fg.hasLayer(m)) { 12492 fg.removeLayer(m); 12493 if (m.clusterShow) { 12494 m.clusterShow(); 12495 } 12496 } 12497 } 12498 12499 // Refresh bounds and weighted positions. 12500 this._topClusterLevel._recalculateBounds(); 12501 12502 this._refreshClustersIcons(); 12503 12504 //Fix up the clusters and markers on the map 12505 this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds); 12506 12507 return this; 12508 }, 12509 12510 //Removes all layers from the MarkerClusterGroup 12511 clearLayers: function () { 12512 //Need our own special implementation as the LayerGroup one doesn't work for us 12513 12514 //If we aren't on the map (yet), blow away the markers we know of 12515 if (!this._map) { 12516 this._needsClustering = []; 12517 this._needsRemoving = []; 12518 delete this._gridClusters; 12519 delete this._gridUnclustered; 12520 } 12521 12522 if (this._noanimationUnspiderfy) { 12523 this._noanimationUnspiderfy(); 12524 } 12525 12526 //Remove all the visible layers 12527 this._featureGroup.clearLayers(); 12528 this._nonPointGroup.clearLayers(); 12529 12530 this.eachLayer(function (marker) { 12531 marker.off(this._childMarkerEventHandlers, this); 12532 delete marker.__parent; 12533 }, this); 12534 12535 if (this._map) { 12536 //Reset _topClusterLevel and the DistanceGrids 12537 this._generateInitialClusters(); 12538 } 12539 12540 return this; 12541 }, 12542 12543 //Override FeatureGroup.getBounds as it doesn't work 12544 getBounds: function () { 12545 var bounds = new L.LatLngBounds(); 12546 12547 if (this._topClusterLevel) { 12548 bounds.extend(this._topClusterLevel._bounds); 12549 } 12550 12551 for (var i = this._needsClustering.length - 1; i >= 0; i--) { 12552 bounds.extend(this._needsClustering[i].getLatLng()); 12553 } 12554 12555 bounds.extend(this._nonPointGroup.getBounds()); 12556 12557 return bounds; 12558 }, 12559 12560 //Overrides LayerGroup.eachLayer 12561 eachLayer: function (method, context) { 12562 var markers = this._needsClustering.slice(), 12563 needsRemoving = this._needsRemoving, 12564 thisNeedsRemoving, i, j; 12565 12566 if (this._topClusterLevel) { 12567 this._topClusterLevel.getAllChildMarkers(markers); 12568 } 12569 12570 for (i = markers.length - 1; i >= 0; i--) { 12571 thisNeedsRemoving = true; 12572 12573 for (j = needsRemoving.length - 1; j >= 0; j--) { 12574 if (needsRemoving[j].layer === markers[i]) { 12575 thisNeedsRemoving = false; 12576 break; 12577 } 12578 } 12579 12580 if (thisNeedsRemoving) { 12581 method.call(context, markers[i]); 12582 } 12583 } 12584 12585 this._nonPointGroup.eachLayer(method, context); 12586 }, 12587 12588 //Overrides LayerGroup.getLayers 12589 getLayers: function () { 12590 var layers = []; 12591 this.eachLayer(function (l) { 12592 layers.push(l); 12593 }); 12594 return layers; 12595 }, 12596 12597 //Overrides LayerGroup.getLayer, WARNING: Really bad performance 12598 getLayer: function (id) { 12599 var result = null; 12600 12601 id = parseInt(id, 10); 12602 12603 this.eachLayer(function (l) { 12604 if (L.stamp(l) === id) { 12605 result = l; 12606 } 12607 }); 12608 12609 return result; 12610 }, 12611 12612 //Returns true if the given layer is in this MarkerClusterGroup 12613 hasLayer: function (layer) { 12614 if (!layer) { 12615 return false; 12616 } 12617 12618 var i, anArray = this._needsClustering; 12619 12620 for (i = anArray.length - 1; i >= 0; i--) { 12621 if (anArray[i] === layer) { 12622 return true; 12623 } 12624 } 12625 12626 anArray = this._needsRemoving; 12627 for (i = anArray.length - 1; i >= 0; i--) { 12628 if (anArray[i].layer === layer) { 12629 return false; 12630 } 12631 } 12632 12633 return !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer); 12634 }, 12635 12636 //Zoom down to show the given layer (spiderfying if necessary) then calls the callback 12637 zoomToShowLayer: function (layer, callback) { 12638 12639 var map = this._map; 12640 12641 if (typeof callback !== 'function') { 12642 callback = function () {}; 12643 } 12644 12645 var showMarker = function () { 12646 // Assumes that map.hasLayer checks for direct appearance on map, not recursively calling 12647 // hasLayer on Layer Groups that are on map (typically not calling this MarkerClusterGroup.hasLayer, which would always return true) 12648 if ((map.hasLayer(layer) || map.hasLayer(layer.__parent)) && !this._inZoomAnimation) { 12649 this._map.off('moveend', showMarker, this); 12650 this.off('animationend', showMarker, this); 12651 12652 if (map.hasLayer(layer)) { 12653 callback(); 12654 } else if (layer.__parent._icon) { 12655 this.once('spiderfied', callback, this); 12656 layer.__parent.spiderfy(); 12657 } 12658 } 12659 }; 12660 12661 if (layer._icon && this._map.getBounds().contains(layer.getLatLng())) { 12662 //Layer is visible ond on screen, immediate return 12663 callback(); 12664 } else if (layer.__parent._zoom < Math.round(this._map._zoom)) { 12665 //Layer should be visible at this zoom level. It must not be on screen so just pan over to it 12666 this._map.on('moveend', showMarker, this); 12667 this._map.panTo(layer.getLatLng()); 12668 } else { 12669 this._map.on('moveend', showMarker, this); 12670 this.on('animationend', showMarker, this); 12671 layer.__parent.zoomToBounds(); 12672 } 12673 }, 12674 12675 //Overrides FeatureGroup.onAdd 12676 onAdd: function (map) { 12677 this._map = map; 12678 var i, l, layer; 12679 12680 if (!isFinite(this._map.getMaxZoom())) { 12681 throw "Map has no maxZoom specified"; 12682 } 12683 12684 this._featureGroup.addTo(map); 12685 this._nonPointGroup.addTo(map); 12686 12687 if (!this._gridClusters) { 12688 this._generateInitialClusters(); 12689 } 12690 12691 this._maxLat = map.options.crs.projection.MAX_LATITUDE; 12692 12693 //Restore all the positions as they are in the MCG before removing them 12694 for (i = 0, l = this._needsRemoving.length; i < l; i++) { 12695 layer = this._needsRemoving[i]; 12696 layer.newlatlng = layer.layer._latlng; 12697 layer.layer._latlng = layer.latlng; 12698 } 12699 //Remove them, then restore their new positions 12700 for (i = 0, l = this._needsRemoving.length; i < l; i++) { 12701 layer = this._needsRemoving[i]; 12702 this._removeLayer(layer.layer, true); 12703 layer.layer._latlng = layer.newlatlng; 12704 } 12705 this._needsRemoving = []; 12706 12707 //Remember the current zoom level and bounds 12708 this._zoom = Math.round(this._map._zoom); 12709 this._currentShownBounds = this._getExpandedVisibleBounds(); 12710 12711 this._map.on('zoomend', this._zoomEnd, this); 12712 this._map.on('moveend', this._moveEnd, this); 12713 12714 if (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely 12715 this._spiderfierOnAdd(); 12716 } 12717 12718 this._bindEvents(); 12719 12720 //Actually add our markers to the map: 12721 l = this._needsClustering; 12722 this._needsClustering = []; 12723 this.addLayers(l, true); 12724 }, 12725 12726 //Overrides FeatureGroup.onRemove 12727 onRemove: function (map) { 12728 map.off('zoomend', this._zoomEnd, this); 12729 map.off('moveend', this._moveEnd, this); 12730 12731 this._unbindEvents(); 12732 12733 //In case we are in a cluster animation 12734 this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', ''); 12735 12736 if (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely 12737 this._spiderfierOnRemove(); 12738 } 12739 12740 delete this._maxLat; 12741 12742 //Clean up all the layers we added to the map 12743 this._hideCoverage(); 12744 this._featureGroup.remove(); 12745 this._nonPointGroup.remove(); 12746 12747 this._featureGroup.clearLayers(); 12748 12749 this._map = null; 12750 }, 12751 12752 getVisibleParent: function (marker) { 12753 var vMarker = marker; 12754 while (vMarker && !vMarker._icon) { 12755 vMarker = vMarker.__parent; 12756 } 12757 return vMarker || null; 12758 }, 12759 12760 //Remove the given object from the given array 12761 _arraySplice: function (anArray, obj) { 12762 for (var i = anArray.length - 1; i >= 0; i--) { 12763 if (anArray[i] === obj) { 12764 anArray.splice(i, 1); 12765 return true; 12766 } 12767 } 12768 }, 12769 12770 /** 12771 * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom. 12772 * @param marker to be removed from _gridUnclustered. 12773 * @param z integer bottom start zoom level (included) 12774 * @private 12775 */ 12776 _removeFromGridUnclustered: function (marker, z) { 12777 var map = this._map, 12778 gridUnclustered = this._gridUnclustered, 12779 minZoom = Math.floor(this._map.getMinZoom()); 12780 12781 for (; z >= minZoom; z--) { 12782 if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) { 12783 break; 12784 } 12785 } 12786 }, 12787 12788 _childMarkerDragStart: function (e) { 12789 e.target.__dragStart = e.target._latlng; 12790 }, 12791 12792 _childMarkerMoved: function (e) { 12793 if (!this._ignoreMove && !e.target.__dragStart) { 12794 var isPopupOpen = e.target._popup && e.target._popup.isOpen(); 12795 12796 this._moveChild(e.target, e.oldLatLng, e.latlng); 12797 12798 if (isPopupOpen) { 12799 e.target.openPopup(); 12800 } 12801 } 12802 }, 12803 12804 _moveChild: function (layer, from, to) { 12805 layer._latlng = from; 12806 this.removeLayer(layer); 12807 12808 layer._latlng = to; 12809 this.addLayer(layer); 12810 }, 12811 12812 _childMarkerDragEnd: function (e) { 12813 var dragStart = e.target.__dragStart; 12814 delete e.target.__dragStart; 12815 if (dragStart) { 12816 this._moveChild(e.target, dragStart, e.target._latlng); 12817 } 12818 }, 12819 12820 12821 //Internal function for removing a marker from everything. 12822 //dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions) 12823 _removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) { 12824 var gridClusters = this._gridClusters, 12825 gridUnclustered = this._gridUnclustered, 12826 fg = this._featureGroup, 12827 map = this._map, 12828 minZoom = Math.floor(this._map.getMinZoom()); 12829 12830 //Remove the marker from distance clusters it might be in 12831 if (removeFromDistanceGrid) { 12832 this._removeFromGridUnclustered(marker, this._maxZoom); 12833 } 12834 12835 //Work our way up the clusters removing them as we go if required 12836 var cluster = marker.__parent, 12837 markers = cluster._markers, 12838 otherMarker; 12839 12840 //Remove the marker from the immediate parents marker list 12841 this._arraySplice(markers, marker); 12842 12843 while (cluster) { 12844 cluster._childCount--; 12845 cluster._boundsNeedUpdate = true; 12846 12847 if (cluster._zoom < minZoom) { 12848 //Top level, do nothing 12849 break; 12850 } else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required 12851 //We need to push the other marker up to the parent 12852 otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0]; 12853 12854 //Update distance grid 12855 gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom)); 12856 gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom)); 12857 12858 //Move otherMarker up to parent 12859 this._arraySplice(cluster.__parent._childClusters, cluster); 12860 cluster.__parent._markers.push(otherMarker); 12861 otherMarker.__parent = cluster.__parent; 12862 12863 if (cluster._icon) { 12864 //Cluster is currently on the map, need to put the marker on the map instead 12865 fg.removeLayer(cluster); 12866 if (!dontUpdateMap) { 12867 fg.addLayer(otherMarker); 12868 } 12869 } 12870 } else { 12871 cluster._iconNeedsUpdate = true; 12872 } 12873 12874 cluster = cluster.__parent; 12875 } 12876 12877 delete marker.__parent; 12878 }, 12879 12880 _isOrIsParent: function (el, oel) { 12881 while (oel) { 12882 if (el === oel) { 12883 return true; 12884 } 12885 oel = oel.parentNode; 12886 } 12887 return false; 12888 }, 12889 12890 //Override L.Evented.fire 12891 fire: function (type, data, propagate) { 12892 if (data && data.layer instanceof L.MarkerCluster) { 12893 //Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget) 12894 if (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) { 12895 return; 12896 } 12897 type = 'cluster' + type; 12898 } 12899 12900 L.FeatureGroup.prototype.fire.call(this, type, data, propagate); 12901 }, 12902 12903 //Override L.Evented.listens 12904 listens: function (type, propagate) { 12905 return L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate); 12906 }, 12907 12908 //Default functionality 12909 _defaultIconCreateFunction: function (cluster) { 12910 var childCount = cluster.getChildCount(); 12911 12912 var c = ' marker-cluster-'; 12913 if (childCount < 10) { 12914 c += 'small'; 12915 } else if (childCount < 100) { 12916 c += 'medium'; 12917 } else { 12918 c += 'large'; 12919 } 12920 12921 return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) }); 12922 }, 12923 12924 _bindEvents: function () { 12925 var map = this._map, 12926 spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom, 12927 showCoverageOnHover = this.options.showCoverageOnHover, 12928 zoomToBoundsOnClick = this.options.zoomToBoundsOnClick, 12929 spiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom; 12930 12931 //Zoom on cluster click or spiderfy if we are at the lowest level 12932 if (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) { 12933 this.on('clusterclick clusterkeypress', this._zoomOrSpiderfy, this); 12934 } 12935 12936 //Show convex hull (boundary) polygon on mouse over 12937 if (showCoverageOnHover) { 12938 this.on('clustermouseover', this._showCoverage, this); 12939 this.on('clustermouseout', this._hideCoverage, this); 12940 map.on('zoomend', this._hideCoverage, this); 12941 } 12942 }, 12943 12944 _zoomOrSpiderfy: function (e) { 12945 var cluster = e.layer, 12946 bottomCluster = cluster; 12947 12948 if (e.type === 'clusterkeypress' && e.originalEvent && e.originalEvent.keyCode !== 13) { 12949 return; 12950 } 12951 12952 while (bottomCluster._childClusters.length === 1) { 12953 bottomCluster = bottomCluster._childClusters[0]; 12954 } 12955 12956 if (bottomCluster._zoom === this._maxZoom && 12957 bottomCluster._childCount === cluster._childCount && 12958 this.options.spiderfyOnMaxZoom) { 12959 12960 // All child markers are contained in a single cluster from this._maxZoom to this cluster. 12961 cluster.spiderfy(); 12962 } else if (this.options.zoomToBoundsOnClick) { 12963 cluster.zoomToBounds(); 12964 } 12965 12966 if (this.options.spiderfyOnEveryZoom) { 12967 cluster.spiderfy(); 12968 } 12969 12970 // Focus the map again for keyboard users. 12971 if (e.originalEvent && e.originalEvent.keyCode === 13) { 12972 this._map._container.focus(); 12973 } 12974 }, 12975 12976 _showCoverage: function (e) { 12977 var map = this._map; 12978 if (this._inZoomAnimation) { 12979 return; 12980 } 12981 if (this._shownPolygon) { 12982 map.removeLayer(this._shownPolygon); 12983 } 12984 if (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) { 12985 this._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions); 12986 map.addLayer(this._shownPolygon); 12987 } 12988 }, 12989 12990 _hideCoverage: function () { 12991 if (this._shownPolygon) { 12992 this._map.removeLayer(this._shownPolygon); 12993 this._shownPolygon = null; 12994 } 12995 }, 12996 12997 _unbindEvents: function () { 12998 var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom, 12999 showCoverageOnHover = this.options.showCoverageOnHover, 13000 zoomToBoundsOnClick = this.options.zoomToBoundsOnClick, 13001 spiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom, 13002 map = this._map; 13003 13004 if (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) { 13005 this.off('clusterclick clusterkeypress', this._zoomOrSpiderfy, this); 13006 } 13007 if (showCoverageOnHover) { 13008 this.off('clustermouseover', this._showCoverage, this); 13009 this.off('clustermouseout', this._hideCoverage, this); 13010 map.off('zoomend', this._hideCoverage, this); 13011 } 13012 }, 13013 13014 _zoomEnd: function () { 13015 if (!this._map) { //May have been removed from the map by a zoomEnd handler 13016 return; 13017 } 13018 this._mergeSplitClusters(); 13019 13020 this._zoom = Math.round(this._map._zoom); 13021 this._currentShownBounds = this._getExpandedVisibleBounds(); 13022 }, 13023 13024 _moveEnd: function () { 13025 if (this._inZoomAnimation) { 13026 return; 13027 } 13028 13029 var newBounds = this._getExpandedVisibleBounds(); 13030 13031 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds); 13032 this._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds); 13033 13034 this._currentShownBounds = newBounds; 13035 return; 13036 }, 13037 13038 _generateInitialClusters: function () { 13039 var maxZoom = Math.ceil(this._map.getMaxZoom()), 13040 minZoom = Math.floor(this._map.getMinZoom()), 13041 radius = this.options.maxClusterRadius, 13042 radiusFn = radius; 13043 13044 //If we just set maxClusterRadius to a single number, we need to create 13045 //a simple function to return that number. Otherwise, we just have to 13046 //use the function we've passed in. 13047 if (typeof radius !== "function") { 13048 radiusFn = function () { return radius; }; 13049 } 13050 13051 if (this.options.disableClusteringAtZoom !== null) { 13052 maxZoom = this.options.disableClusteringAtZoom - 1; 13053 } 13054 this._maxZoom = maxZoom; 13055 this._gridClusters = {}; 13056 this._gridUnclustered = {}; 13057 13058 //Set up DistanceGrids for each zoom 13059 for (var zoom = maxZoom; zoom >= minZoom; zoom--) { 13060 this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom)); 13061 this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom)); 13062 } 13063 13064 // Instantiate the appropriate L.MarkerCluster class (animated or not). 13065 this._topClusterLevel = new this._markerCluster(this, minZoom - 1); 13066 }, 13067 13068 //Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom) 13069 _addLayer: function (layer, zoom) { 13070 var gridClusters = this._gridClusters, 13071 gridUnclustered = this._gridUnclustered, 13072 minZoom = Math.floor(this._map.getMinZoom()), 13073 markerPoint, z; 13074 13075 if (this.options.singleMarkerMode) { 13076 this._overrideMarkerIcon(layer); 13077 } 13078 13079 layer.on(this._childMarkerEventHandlers, this); 13080 13081 //Find the lowest zoom level to slot this one in 13082 for (; zoom >= minZoom; zoom--) { 13083 markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position 13084 13085 //Try find a cluster close by 13086 var closest = gridClusters[zoom].getNearObject(markerPoint); 13087 if (closest) { 13088 closest._addChild(layer); 13089 layer.__parent = closest; 13090 return; 13091 } 13092 13093 //Try find a marker close by to form a new cluster with 13094 closest = gridUnclustered[zoom].getNearObject(markerPoint); 13095 if (closest) { 13096 var parent = closest.__parent; 13097 if (parent) { 13098 this._removeLayer(closest, false); 13099 } 13100 13101 //Create new cluster with these 2 in it 13102 13103 var newCluster = new this._markerCluster(this, zoom, closest, layer); 13104 gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom)); 13105 closest.__parent = newCluster; 13106 layer.__parent = newCluster; 13107 13108 //First create any new intermediate parent clusters that don't exist 13109 var lastParent = newCluster; 13110 for (z = zoom - 1; z > parent._zoom; z--) { 13111 lastParent = new this._markerCluster(this, z, lastParent); 13112 gridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z)); 13113 } 13114 parent._addChild(lastParent); 13115 13116 //Remove closest from this zoom level and any above that it is in, replace with newCluster 13117 this._removeFromGridUnclustered(closest, zoom); 13118 13119 return; 13120 } 13121 13122 //Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards 13123 gridUnclustered[zoom].addObject(layer, markerPoint); 13124 } 13125 13126 //Didn't get in anything, add us to the top 13127 this._topClusterLevel._addChild(layer); 13128 layer.__parent = this._topClusterLevel; 13129 return; 13130 }, 13131 13132 /** 13133 * Refreshes the icon of all "dirty" visible clusters. 13134 * Non-visible "dirty" clusters will be updated when they are added to the map. 13135 * @private 13136 */ 13137 _refreshClustersIcons: function () { 13138 this._featureGroup.eachLayer(function (c) { 13139 if (c instanceof L.MarkerCluster && c._iconNeedsUpdate) { 13140 c._updateIcon(); 13141 } 13142 }); 13143 }, 13144 13145 //Enqueue code to fire after the marker expand/contract has happened 13146 _enqueue: function (fn) { 13147 this._queue.push(fn); 13148 if (!this._queueTimeout) { 13149 this._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300); 13150 } 13151 }, 13152 _processQueue: function () { 13153 for (var i = 0; i < this._queue.length; i++) { 13154 this._queue[i].call(this); 13155 } 13156 this._queue.length = 0; 13157 clearTimeout(this._queueTimeout); 13158 this._queueTimeout = null; 13159 }, 13160 13161 //Merge and split any existing clusters that are too big or small 13162 _mergeSplitClusters: function () { 13163 var mapZoom = Math.round(this._map._zoom); 13164 13165 //In case we are starting to split before the animation finished 13166 this._processQueue(); 13167 13168 if (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split 13169 this._animationStart(); 13170 //Remove clusters now off screen 13171 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds()); 13172 13173 this._animationZoomIn(this._zoom, mapZoom); 13174 13175 } else if (this._zoom > mapZoom) { //Zoom out, merge 13176 this._animationStart(); 13177 13178 this._animationZoomOut(this._zoom, mapZoom); 13179 } else { 13180 this._moveEnd(); 13181 } 13182 }, 13183 13184 //Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan) 13185 _getExpandedVisibleBounds: function () { 13186 if (!this.options.removeOutsideVisibleBounds) { 13187 return this._mapBoundsInfinite; 13188 } else if (L.Browser.mobile) { 13189 return this._checkBoundsMaxLat(this._map.getBounds()); 13190 } 13191 13192 return this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor. 13193 }, 13194 13195 /** 13196 * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude 13197 * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas). 13198 * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without 13199 * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit, 13200 * making the user think that MCG "eats" them and never displays them again. 13201 * @param bounds L.LatLngBounds 13202 * @returns {L.LatLngBounds} 13203 * @private 13204 */ 13205 _checkBoundsMaxLat: function (bounds) { 13206 var maxLat = this._maxLat; 13207 13208 if (maxLat !== undefined) { 13209 if (bounds.getNorth() >= maxLat) { 13210 bounds._northEast.lat = Infinity; 13211 } 13212 if (bounds.getSouth() <= -maxLat) { 13213 bounds._southWest.lat = -Infinity; 13214 } 13215 } 13216 13217 return bounds; 13218 }, 13219 13220 //Shared animation code 13221 _animationAddLayerNonAnimated: function (layer, newCluster) { 13222 if (newCluster === layer) { 13223 this._featureGroup.addLayer(layer); 13224 } else if (newCluster._childCount === 2) { 13225 newCluster._addToMap(); 13226 13227 var markers = newCluster.getAllChildMarkers(); 13228 this._featureGroup.removeLayer(markers[0]); 13229 this._featureGroup.removeLayer(markers[1]); 13230 } else { 13231 newCluster._updateIcon(); 13232 } 13233 }, 13234 13235 /** 13236 * Extracts individual (i.e. non-group) layers from a Layer Group. 13237 * @param group to extract layers from. 13238 * @param output {Array} in which to store the extracted layers. 13239 * @returns {*|Array} 13240 * @private 13241 */ 13242 _extractNonGroupLayers: function (group, output) { 13243 var layers = group.getLayers(), 13244 i = 0, 13245 layer; 13246 13247 output = output || []; 13248 13249 for (; i < layers.length; i++) { 13250 layer = layers[i]; 13251 13252 if (layer instanceof L.LayerGroup) { 13253 this._extractNonGroupLayers(layer, output); 13254 continue; 13255 } 13256 13257 output.push(layer); 13258 } 13259 13260 return output; 13261 }, 13262 13263 /** 13264 * Implements the singleMarkerMode option. 13265 * @param layer Marker to re-style using the Clusters iconCreateFunction. 13266 * @returns {L.Icon} The newly created icon. 13267 * @private 13268 */ 13269 _overrideMarkerIcon: function (layer) { 13270 var icon = layer.options.icon = this.options.iconCreateFunction({ 13271 getChildCount: function () { 13272 return 1; 13273 }, 13274 getAllChildMarkers: function () { 13275 return [layer]; 13276 } 13277 }); 13278 13279 return icon; 13280 } 13281 }); 13282 13283 // Constant bounds used in case option "removeOutsideVisibleBounds" is set to false. 13284 L.MarkerClusterGroup.include({ 13285 _mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity)) 13286 }); 13287 13288 L.MarkerClusterGroup.include({ 13289 _noAnimation: { 13290 //Non Animated versions of everything 13291 _animationStart: function () { 13292 //Do nothing... 13293 }, 13294 _animationZoomIn: function (previousZoomLevel, newZoomLevel) { 13295 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel); 13296 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); 13297 13298 //We didn't actually animate, but we use this event to mean "clustering animations have finished" 13299 this.fire('animationend'); 13300 }, 13301 _animationZoomOut: function (previousZoomLevel, newZoomLevel) { 13302 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel); 13303 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); 13304 13305 //We didn't actually animate, but we use this event to mean "clustering animations have finished" 13306 this.fire('animationend'); 13307 }, 13308 _animationAddLayer: function (layer, newCluster) { 13309 this._animationAddLayerNonAnimated(layer, newCluster); 13310 } 13311 }, 13312 13313 _withAnimation: { 13314 //Animated versions here 13315 _animationStart: function () { 13316 this._map._mapPane.className += ' leaflet-cluster-anim'; 13317 this._inZoomAnimation++; 13318 }, 13319 13320 _animationZoomIn: function (previousZoomLevel, newZoomLevel) { 13321 var bounds = this._getExpandedVisibleBounds(), 13322 fg = this._featureGroup, 13323 minZoom = Math.floor(this._map.getMinZoom()), 13324 i; 13325 13326 this._ignoreMove = true; 13327 13328 //Add all children of current clusters to map and remove those clusters from map 13329 this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) { 13330 var startPos = c._latlng, 13331 markers = c._markers, 13332 m; 13333 13334 if (!bounds.contains(startPos)) { 13335 startPos = null; 13336 } 13337 13338 if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us 13339 fg.removeLayer(c); 13340 c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds); 13341 } else { 13342 //Fade out old cluster 13343 c.clusterHide(); 13344 c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds); 13345 } 13346 13347 //Remove all markers that aren't visible any more 13348 //TODO: Do we actually need to do this on the higher levels too? 13349 for (i = markers.length - 1; i >= 0; i--) { 13350 m = markers[i]; 13351 if (!bounds.contains(m._latlng)) { 13352 fg.removeLayer(m); 13353 } 13354 } 13355 13356 }); 13357 13358 this._forceLayout(); 13359 13360 //Update opacities 13361 this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel); 13362 //TODO Maybe? Update markers in _recursivelyBecomeVisible 13363 fg.eachLayer(function (n) { 13364 if (!(n instanceof L.MarkerCluster) && n._icon) { 13365 n.clusterShow(); 13366 } 13367 }); 13368 13369 //update the positions of the just added clusters/markers 13370 this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) { 13371 c._recursivelyRestoreChildPositions(newZoomLevel); 13372 }); 13373 13374 this._ignoreMove = false; 13375 13376 //Remove the old clusters and close the zoom animation 13377 this._enqueue(function () { 13378 //update the positions of the just added clusters/markers 13379 this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) { 13380 fg.removeLayer(c); 13381 c.clusterShow(); 13382 }); 13383 13384 this._animationEnd(); 13385 }); 13386 }, 13387 13388 _animationZoomOut: function (previousZoomLevel, newZoomLevel) { 13389 this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel); 13390 13391 //Need to add markers for those that weren't on the map before but are now 13392 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); 13393 //Remove markers that were on the map before but won't be now 13394 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds()); 13395 }, 13396 13397 _animationAddLayer: function (layer, newCluster) { 13398 var me = this, 13399 fg = this._featureGroup; 13400 13401 fg.addLayer(layer); 13402 if (newCluster !== layer) { 13403 if (newCluster._childCount > 2) { //Was already a cluster 13404 13405 newCluster._updateIcon(); 13406 this._forceLayout(); 13407 this._animationStart(); 13408 13409 layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng())); 13410 layer.clusterHide(); 13411 13412 this._enqueue(function () { 13413 fg.removeLayer(layer); 13414 layer.clusterShow(); 13415 13416 me._animationEnd(); 13417 }); 13418 13419 } else { //Just became a cluster 13420 this._forceLayout(); 13421 13422 me._animationStart(); 13423 me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom); 13424 } 13425 } 13426 } 13427 }, 13428 13429 // Private methods for animated versions. 13430 _animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) { 13431 var bounds = this._getExpandedVisibleBounds(), 13432 minZoom = Math.floor(this._map.getMinZoom()); 13433 13434 //Animate all of the markers in the clusters to move to their cluster center point 13435 cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel); 13436 13437 var me = this; 13438 13439 //Update the opacity (If we immediately set it they won't animate) 13440 this._forceLayout(); 13441 cluster._recursivelyBecomeVisible(bounds, newZoomLevel); 13442 13443 //TODO: Maybe use the transition timing stuff to make this more reliable 13444 //When the animations are done, tidy up 13445 this._enqueue(function () { 13446 13447 //This cluster stopped being a cluster before the timeout fired 13448 if (cluster._childCount === 1) { 13449 var m = cluster._markers[0]; 13450 //If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it 13451 this._ignoreMove = true; 13452 m.setLatLng(m.getLatLng()); 13453 this._ignoreMove = false; 13454 if (m.clusterShow) { 13455 m.clusterShow(); 13456 } 13457 } else { 13458 cluster._recursively(bounds, newZoomLevel, minZoom, function (c) { 13459 c._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1); 13460 }); 13461 } 13462 me._animationEnd(); 13463 }); 13464 }, 13465 13466 _animationEnd: function () { 13467 if (this._map) { 13468 this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', ''); 13469 } 13470 this._inZoomAnimation--; 13471 this.fire('animationend'); 13472 }, 13473 13474 //Force a browser layout of stuff in the map 13475 // Should apply the current opacity and location to all elements so we can update them again for an animation 13476 _forceLayout: function () { 13477 //In my testing this works, infact offsetWidth of any element seems to work. 13478 //Could loop all this._layers and do this for each _icon if it stops working 13479 13480 L.Util.falseFn(document.body.offsetWidth); 13481 } 13482 }); 13483 13484 L.markerClusterGroup = function (options) { 13485 return new L.MarkerClusterGroup(options); 13486 }; 13487 13488 var MarkerCluster = L.MarkerCluster = L.Marker.extend({ 13489 options: L.Icon.prototype.options, 13490 13491 initialize: function (group, zoom, a, b) { 13492 13493 L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0), 13494 { icon: this, pane: group.options.clusterPane }); 13495 13496 this._group = group; 13497 this._zoom = zoom; 13498 13499 this._markers = []; 13500 this._childClusters = []; 13501 this._childCount = 0; 13502 this._iconNeedsUpdate = true; 13503 this._boundsNeedUpdate = true; 13504 13505 this._bounds = new L.LatLngBounds(); 13506 13507 if (a) { 13508 this._addChild(a); 13509 } 13510 if (b) { 13511 this._addChild(b); 13512 } 13513 }, 13514 13515 //Recursively retrieve all child markers of this cluster 13516 getAllChildMarkers: function (storageArray, ignoreDraggedMarker) { 13517 storageArray = storageArray || []; 13518 13519 for (var i = this._childClusters.length - 1; i >= 0; i--) { 13520 this._childClusters[i].getAllChildMarkers(storageArray, ignoreDraggedMarker); 13521 } 13522 13523 for (var j = this._markers.length - 1; j >= 0; j--) { 13524 if (ignoreDraggedMarker && this._markers[j].__dragStart) { 13525 continue; 13526 } 13527 storageArray.push(this._markers[j]); 13528 } 13529 13530 return storageArray; 13531 }, 13532 13533 //Returns the count of how many child markers we have 13534 getChildCount: function () { 13535 return this._childCount; 13536 }, 13537 13538 //Zoom to the minimum of showing all of the child markers, or the extents of this cluster 13539 zoomToBounds: function (fitBoundsOptions) { 13540 var childClusters = this._childClusters.slice(), 13541 map = this._group._map, 13542 boundsZoom = map.getBoundsZoom(this._bounds), 13543 zoom = this._zoom + 1, 13544 mapZoom = map.getZoom(), 13545 i; 13546 13547 //calculate how far we need to zoom down to see all of the markers 13548 while (childClusters.length > 0 && boundsZoom > zoom) { 13549 zoom++; 13550 var newClusters = []; 13551 for (i = 0; i < childClusters.length; i++) { 13552 newClusters = newClusters.concat(childClusters[i]._childClusters); 13553 } 13554 childClusters = newClusters; 13555 } 13556 13557 if (boundsZoom > zoom) { 13558 this._group._map.setView(this._latlng, zoom); 13559 } else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead 13560 this._group._map.setView(this._latlng, mapZoom + 1); 13561 } else { 13562 this._group._map.fitBounds(this._bounds, fitBoundsOptions); 13563 } 13564 }, 13565 13566 getBounds: function () { 13567 var bounds = new L.LatLngBounds(); 13568 bounds.extend(this._bounds); 13569 return bounds; 13570 }, 13571 13572 _updateIcon: function () { 13573 this._iconNeedsUpdate = true; 13574 if (this._icon) { 13575 this.setIcon(this); 13576 } 13577 }, 13578 13579 //Cludge for Icon, we pretend to be an icon for performance 13580 createIcon: function () { 13581 if (this._iconNeedsUpdate) { 13582 this._iconObj = this._group.options.iconCreateFunction(this); 13583 this._iconNeedsUpdate = false; 13584 } 13585 return this._iconObj.createIcon(); 13586 }, 13587 createShadow: function () { 13588 return this._iconObj.createShadow(); 13589 }, 13590 13591 13592 _addChild: function (new1, isNotificationFromChild) { 13593 13594 this._iconNeedsUpdate = true; 13595 13596 this._boundsNeedUpdate = true; 13597 this._setClusterCenter(new1); 13598 13599 if (new1 instanceof L.MarkerCluster) { 13600 if (!isNotificationFromChild) { 13601 this._childClusters.push(new1); 13602 new1.__parent = this; 13603 } 13604 this._childCount += new1._childCount; 13605 } else { 13606 if (!isNotificationFromChild) { 13607 this._markers.push(new1); 13608 } 13609 this._childCount++; 13610 } 13611 13612 if (this.__parent) { 13613 this.__parent._addChild(new1, true); 13614 } 13615 }, 13616 13617 /** 13618 * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position. 13619 * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet. 13620 * @private 13621 */ 13622 _setClusterCenter: function (child) { 13623 if (!this._cLatLng) { 13624 // when clustering, take position of the first point as the cluster center 13625 this._cLatLng = child._cLatLng || child._latlng; 13626 } 13627 }, 13628 13629 /** 13630 * Assigns impossible bounding values so that the next extend entirely determines the new bounds. 13631 * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class. 13632 * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended. 13633 * @private 13634 */ 13635 _resetBounds: function () { 13636 var bounds = this._bounds; 13637 13638 if (bounds._southWest) { 13639 bounds._southWest.lat = Infinity; 13640 bounds._southWest.lng = Infinity; 13641 } 13642 if (bounds._northEast) { 13643 bounds._northEast.lat = -Infinity; 13644 bounds._northEast.lng = -Infinity; 13645 } 13646 }, 13647 13648 _recalculateBounds: function () { 13649 var markers = this._markers, 13650 childClusters = this._childClusters, 13651 latSum = 0, 13652 lngSum = 0, 13653 totalCount = this._childCount, 13654 i, child, childLatLng, childCount; 13655 13656 // Case where all markers are removed from the map and we are left with just an empty _topClusterLevel. 13657 if (totalCount === 0) { 13658 return; 13659 } 13660 13661 // Reset rather than creating a new object, for performance. 13662 this._resetBounds(); 13663 13664 // Child markers. 13665 for (i = 0; i < markers.length; i++) { 13666 childLatLng = markers[i]._latlng; 13667 13668 this._bounds.extend(childLatLng); 13669 13670 latSum += childLatLng.lat; 13671 lngSum += childLatLng.lng; 13672 } 13673 13674 // Child clusters. 13675 for (i = 0; i < childClusters.length; i++) { 13676 child = childClusters[i]; 13677 13678 // Re-compute child bounds and weighted position first if necessary. 13679 if (child._boundsNeedUpdate) { 13680 child._recalculateBounds(); 13681 } 13682 13683 this._bounds.extend(child._bounds); 13684 13685 childLatLng = child._wLatLng; 13686 childCount = child._childCount; 13687 13688 latSum += childLatLng.lat * childCount; 13689 lngSum += childLatLng.lng * childCount; 13690 } 13691 13692 this._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount); 13693 13694 // Reset dirty flag. 13695 this._boundsNeedUpdate = false; 13696 }, 13697 13698 //Set our markers position as given and add it to the map 13699 _addToMap: function (startPos) { 13700 if (startPos) { 13701 this._backupLatlng = this._latlng; 13702 this.setLatLng(startPos); 13703 } 13704 this._group._featureGroup.addLayer(this); 13705 }, 13706 13707 _recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) { 13708 this._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1, 13709 function (c) { 13710 var markers = c._markers, 13711 i, m; 13712 for (i = markers.length - 1; i >= 0; i--) { 13713 m = markers[i]; 13714 13715 //Only do it if the icon is still on the map 13716 if (m._icon) { 13717 m._setPos(center); 13718 m.clusterHide(); 13719 } 13720 } 13721 }, 13722 function (c) { 13723 var childClusters = c._childClusters, 13724 j, cm; 13725 for (j = childClusters.length - 1; j >= 0; j--) { 13726 cm = childClusters[j]; 13727 if (cm._icon) { 13728 cm._setPos(center); 13729 cm.clusterHide(); 13730 } 13731 } 13732 } 13733 ); 13734 }, 13735 13736 _recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) { 13737 this._recursively(bounds, newZoomLevel, mapMinZoom, 13738 function (c) { 13739 c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel); 13740 13741 //TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be. 13742 //As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate 13743 if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) { 13744 c.clusterShow(); 13745 c._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds 13746 } else { 13747 c.clusterHide(); 13748 } 13749 13750 c._addToMap(); 13751 } 13752 ); 13753 }, 13754 13755 _recursivelyBecomeVisible: function (bounds, zoomLevel) { 13756 this._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) { 13757 c.clusterShow(); 13758 }); 13759 }, 13760 13761 _recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) { 13762 this._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel, 13763 function (c) { 13764 if (zoomLevel === c._zoom) { 13765 return; 13766 } 13767 13768 //Add our child markers at startPos (so they can be animated out) 13769 for (var i = c._markers.length - 1; i >= 0; i--) { 13770 var nm = c._markers[i]; 13771 13772 if (!bounds.contains(nm._latlng)) { 13773 continue; 13774 } 13775 13776 if (startPos) { 13777 nm._backupLatlng = nm.getLatLng(); 13778 13779 nm.setLatLng(startPos); 13780 if (nm.clusterHide) { 13781 nm.clusterHide(); 13782 } 13783 } 13784 13785 c._group._featureGroup.addLayer(nm); 13786 } 13787 }, 13788 function (c) { 13789 c._addToMap(startPos); 13790 } 13791 ); 13792 }, 13793 13794 _recursivelyRestoreChildPositions: function (zoomLevel) { 13795 //Fix positions of child markers 13796 for (var i = this._markers.length - 1; i >= 0; i--) { 13797 var nm = this._markers[i]; 13798 if (nm._backupLatlng) { 13799 nm.setLatLng(nm._backupLatlng); 13800 delete nm._backupLatlng; 13801 } 13802 } 13803 13804 if (zoomLevel - 1 === this._zoom) { 13805 //Reposition child clusters 13806 for (var j = this._childClusters.length - 1; j >= 0; j--) { 13807 this._childClusters[j]._restorePosition(); 13808 } 13809 } else { 13810 for (var k = this._childClusters.length - 1; k >= 0; k--) { 13811 this._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel); 13812 } 13813 } 13814 }, 13815 13816 _restorePosition: function () { 13817 if (this._backupLatlng) { 13818 this.setLatLng(this._backupLatlng); 13819 delete this._backupLatlng; 13820 } 13821 }, 13822 13823 //exceptBounds: If set, don't remove any markers/clusters in it 13824 _recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) { 13825 var m, i; 13826 this._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1, 13827 function (c) { 13828 //Remove markers at every level 13829 for (i = c._markers.length - 1; i >= 0; i--) { 13830 m = c._markers[i]; 13831 if (!exceptBounds || !exceptBounds.contains(m._latlng)) { 13832 c._group._featureGroup.removeLayer(m); 13833 if (m.clusterShow) { 13834 m.clusterShow(); 13835 } 13836 } 13837 } 13838 }, 13839 function (c) { 13840 //Remove child clusters at just the bottom level 13841 for (i = c._childClusters.length - 1; i >= 0; i--) { 13842 m = c._childClusters[i]; 13843 if (!exceptBounds || !exceptBounds.contains(m._latlng)) { 13844 c._group._featureGroup.removeLayer(m); 13845 if (m.clusterShow) { 13846 m.clusterShow(); 13847 } 13848 } 13849 } 13850 } 13851 ); 13852 }, 13853 13854 //Run the given functions recursively to this and child clusters 13855 // boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to 13856 // zoomLevelToStart: zoom level to start running functions (inclusive) 13857 // zoomLevelToStop: zoom level to stop running functions (inclusive) 13858 // runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level 13859 // runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level 13860 _recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) { 13861 var childClusters = this._childClusters, 13862 zoom = this._zoom, 13863 i, c; 13864 13865 if (zoomLevelToStart <= zoom) { 13866 if (runAtEveryLevel) { 13867 runAtEveryLevel(this); 13868 } 13869 if (runAtBottomLevel && zoom === zoomLevelToStop) { 13870 runAtBottomLevel(this); 13871 } 13872 } 13873 13874 if (zoom < zoomLevelToStart || zoom < zoomLevelToStop) { 13875 for (i = childClusters.length - 1; i >= 0; i--) { 13876 c = childClusters[i]; 13877 if (c._boundsNeedUpdate) { 13878 c._recalculateBounds(); 13879 } 13880 if (boundsToApplyTo.intersects(c._bounds)) { 13881 c._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel); 13882 } 13883 } 13884 } 13885 }, 13886 13887 //Returns true if we are the parent of only one cluster and that cluster is the same as us 13888 _isSingleParent: function () { 13889 //Don't need to check this._markers as the rest won't work if there are any 13890 return this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount; 13891 } 13892 }); 13893 13894 /* 13895 * Extends L.Marker to include two extra methods: clusterHide and clusterShow. 13896 * 13897 * They work as setOpacity(0) and setOpacity(1) respectively, but 13898 * don't overwrite the options.opacity 13899 * 13900 */ 13901 13902 L.Marker.include({ 13903 clusterHide: function () { 13904 var backup = this.options.opacity; 13905 this.setOpacity(0); 13906 this.options.opacity = backup; 13907 return this; 13908 }, 13909 13910 clusterShow: function () { 13911 return this.setOpacity(this.options.opacity); 13912 } 13913 }); 13914 13915 L.DistanceGrid = function (cellSize) { 13916 this._cellSize = cellSize; 13917 this._sqCellSize = cellSize * cellSize; 13918 this._grid = {}; 13919 this._objectPoint = { }; 13920 }; 13921 13922 L.DistanceGrid.prototype = { 13923 13924 addObject: function (obj, point) { 13925 var x = this._getCoord(point.x), 13926 y = this._getCoord(point.y), 13927 grid = this._grid, 13928 row = grid[y] = grid[y] || {}, 13929 cell = row[x] = row[x] || [], 13930 stamp = L.Util.stamp(obj); 13931 13932 this._objectPoint[stamp] = point; 13933 13934 cell.push(obj); 13935 }, 13936 13937 updateObject: function (obj, point) { 13938 this.removeObject(obj); 13939 this.addObject(obj, point); 13940 }, 13941 13942 //Returns true if the object was found 13943 removeObject: function (obj, point) { 13944 var x = this._getCoord(point.x), 13945 y = this._getCoord(point.y), 13946 grid = this._grid, 13947 row = grid[y] = grid[y] || {}, 13948 cell = row[x] = row[x] || [], 13949 i, len; 13950 13951 delete this._objectPoint[L.Util.stamp(obj)]; 13952 13953 for (i = 0, len = cell.length; i < len; i++) { 13954 if (cell[i] === obj) { 13955 13956 cell.splice(i, 1); 13957 13958 if (len === 1) { 13959 delete row[x]; 13960 } 13961 13962 return true; 13963 } 13964 } 13965 13966 }, 13967 13968 eachObject: function (fn, context) { 13969 var i, j, k, len, row, cell, removed, 13970 grid = this._grid; 13971 13972 for (i in grid) { 13973 row = grid[i]; 13974 13975 for (j in row) { 13976 cell = row[j]; 13977 13978 for (k = 0, len = cell.length; k < len; k++) { 13979 removed = fn.call(context, cell[k]); 13980 if (removed) { 13981 k--; 13982 len--; 13983 } 13984 } 13985 } 13986 } 13987 }, 13988 13989 getNearObject: function (point) { 13990 var x = this._getCoord(point.x), 13991 y = this._getCoord(point.y), 13992 i, j, k, row, cell, len, obj, dist, 13993 objectPoint = this._objectPoint, 13994 closestDistSq = this._sqCellSize, 13995 closest = null; 13996 13997 for (i = y - 1; i <= y + 1; i++) { 13998 row = this._grid[i]; 13999 if (row) { 14000 14001 for (j = x - 1; j <= x + 1; j++) { 14002 cell = row[j]; 14003 if (cell) { 14004 14005 for (k = 0, len = cell.length; k < len; k++) { 14006 obj = cell[k]; 14007 dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point); 14008 if (dist < closestDistSq || 14009 dist <= closestDistSq && closest === null) { 14010 closestDistSq = dist; 14011 closest = obj; 14012 } 14013 } 14014 } 14015 } 14016 } 14017 } 14018 return closest; 14019 }, 14020 14021 _getCoord: function (x) { 14022 var coord = Math.floor(x / this._cellSize); 14023 return isFinite(coord) ? coord : x; 14024 }, 14025 14026 _sqDist: function (p, p2) { 14027 var dx = p2.x - p.x, 14028 dy = p2.y - p.y; 14029 return dx * dx + dy * dy; 14030 } 14031 }; 14032 14033 /* Copyright (c) 2012 the authors listed at the following URL, and/or 14034 the authors of referenced articles or incorporated external code: 14035 http://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256 14036 14037 Permission is hereby granted, free of charge, to any person obtaining 14038 a copy of this software and associated documentation files (the 14039 "Software"), to deal in the Software without restriction, including 14040 without limitation the rights to use, copy, modify, merge, publish, 14041 distribute, sublicense, and/or sell copies of the Software, and to 14042 permit persons to whom the Software is furnished to do so, subject to 14043 the following conditions: 14044 14045 The above copyright notice and this permission notice shall be 14046 included in all copies or substantial portions of the Software. 14047 14048 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14049 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14050 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14051 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 14052 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 14053 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14054 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14055 14056 Retrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434 14057 */ 14058 14059 (function () { 14060 L.QuickHull = { 14061 14062 /* 14063 * @param {Object} cpt a point to be measured from the baseline 14064 * @param {Array} bl the baseline, as represented by a two-element 14065 * array of latlng objects. 14066 * @returns {Number} an approximate distance measure 14067 */ 14068 getDistant: function (cpt, bl) { 14069 var vY = bl[1].lat - bl[0].lat, 14070 vX = bl[0].lng - bl[1].lng; 14071 return (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng)); 14072 }, 14073 14074 /* 14075 * @param {Array} baseLine a two-element array of latlng objects 14076 * representing the baseline to project from 14077 * @param {Array} latLngs an array of latlng objects 14078 * @returns {Object} the maximum point and all new points to stay 14079 * in consideration for the hull. 14080 */ 14081 findMostDistantPointFromBaseLine: function (baseLine, latLngs) { 14082 var maxD = 0, 14083 maxPt = null, 14084 newPoints = [], 14085 i, pt, d; 14086 14087 for (i = latLngs.length - 1; i >= 0; i--) { 14088 pt = latLngs[i]; 14089 d = this.getDistant(pt, baseLine); 14090 14091 if (d > 0) { 14092 newPoints.push(pt); 14093 } else { 14094 continue; 14095 } 14096 14097 if (d > maxD) { 14098 maxD = d; 14099 maxPt = pt; 14100 } 14101 } 14102 14103 return { maxPoint: maxPt, newPoints: newPoints }; 14104 }, 14105 14106 14107 /* 14108 * Given a baseline, compute the convex hull of latLngs as an array 14109 * of latLngs. 14110 * 14111 * @param {Array} latLngs 14112 * @returns {Array} 14113 */ 14114 buildConvexHull: function (baseLine, latLngs) { 14115 var convexHullBaseLines = [], 14116 t = this.findMostDistantPointFromBaseLine(baseLine, latLngs); 14117 14118 if (t.maxPoint) { // if there is still a point "outside" the base line 14119 convexHullBaseLines = 14120 convexHullBaseLines.concat( 14121 this.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints) 14122 ); 14123 convexHullBaseLines = 14124 convexHullBaseLines.concat( 14125 this.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints) 14126 ); 14127 return convexHullBaseLines; 14128 } else { // if there is no more point "outside" the base line, the current base line is part of the convex hull 14129 return [baseLine[0]]; 14130 } 14131 }, 14132 14133 /* 14134 * Given an array of latlngs, compute a convex hull as an array 14135 * of latlngs 14136 * 14137 * @param {Array} latLngs 14138 * @returns {Array} 14139 */ 14140 getConvexHull: function (latLngs) { 14141 // find first baseline 14142 var maxLat = false, minLat = false, 14143 maxLng = false, minLng = false, 14144 maxLatPt = null, minLatPt = null, 14145 maxLngPt = null, minLngPt = null, 14146 maxPt = null, minPt = null, 14147 i; 14148 14149 for (i = latLngs.length - 1; i >= 0; i--) { 14150 var pt = latLngs[i]; 14151 if (maxLat === false || pt.lat > maxLat) { 14152 maxLatPt = pt; 14153 maxLat = pt.lat; 14154 } 14155 if (minLat === false || pt.lat < minLat) { 14156 minLatPt = pt; 14157 minLat = pt.lat; 14158 } 14159 if (maxLng === false || pt.lng > maxLng) { 14160 maxLngPt = pt; 14161 maxLng = pt.lng; 14162 } 14163 if (minLng === false || pt.lng < minLng) { 14164 minLngPt = pt; 14165 minLng = pt.lng; 14166 } 14167 } 14168 14169 if (minLat !== maxLat) { 14170 minPt = minLatPt; 14171 maxPt = maxLatPt; 14172 } else { 14173 minPt = minLngPt; 14174 maxPt = maxLngPt; 14175 } 14176 14177 var ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs), 14178 this.buildConvexHull([maxPt, minPt], latLngs)); 14179 return ch; 14180 } 14181 }; 14182 }()); 14183 14184 L.MarkerCluster.include({ 14185 getConvexHull: function () { 14186 var childMarkers = this.getAllChildMarkers(), 14187 points = [], 14188 p, i; 14189 14190 for (i = childMarkers.length - 1; i >= 0; i--) { 14191 p = childMarkers[i].getLatLng(); 14192 points.push(p); 14193 } 14194 14195 return L.QuickHull.getConvexHull(points); 14196 } 14197 }); 14198 14199 //This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet 14200 //Huge thanks to jawj for implementing it first to make my job easy :-) 14201 14202 L.MarkerCluster.include({ 14203 14204 _2PI: Math.PI * 2, 14205 _circleFootSeparation: 25, //related to circumference of circle 14206 _circleStartAngle: 0, 14207 14208 _spiralFootSeparation: 28, //related to size of spiral (experiment!) 14209 _spiralLengthStart: 11, 14210 _spiralLengthFactor: 5, 14211 14212 _circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards. 14213 // 0 -> always spiral; Infinity -> always circle 14214 14215 spiderfy: function () { 14216 if (this._group._spiderfied === this || this._group._inZoomAnimation) { 14217 return; 14218 } 14219 14220 var childMarkers = this.getAllChildMarkers(null, true), 14221 group = this._group, 14222 map = group._map, 14223 center = map.latLngToLayerPoint(this._latlng), 14224 positions; 14225 14226 this._group._unspiderfy(); 14227 this._group._spiderfied = this; 14228 14229 //TODO Maybe: childMarkers order by distance to center 14230 14231 if (this._group.options.spiderfyShapePositions) { 14232 positions = this._group.options.spiderfyShapePositions(childMarkers.length, center); 14233 } else if (childMarkers.length >= this._circleSpiralSwitchover) { 14234 positions = this._generatePointsSpiral(childMarkers.length, center); 14235 } else { 14236 center.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons. 14237 positions = this._generatePointsCircle(childMarkers.length, center); 14238 } 14239 14240 this._animationSpiderfy(childMarkers, positions); 14241 }, 14242 14243 unspiderfy: function (zoomDetails) { 14244 /// <param Name="zoomDetails">Argument from zoomanim if being called in a zoom animation or null otherwise</param> 14245 if (this._group._inZoomAnimation) { 14246 return; 14247 } 14248 this._animationUnspiderfy(zoomDetails); 14249 14250 this._group._spiderfied = null; 14251 }, 14252 14253 _generatePointsCircle: function (count, centerPt) { 14254 var circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count), 14255 legLength = circumference / this._2PI, //radius from circumference 14256 angleStep = this._2PI / count, 14257 res = [], 14258 i, angle; 14259 14260 legLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon. 14261 14262 res.length = count; 14263 14264 for (i = 0; i < count; i++) { // Clockwise, like spiral. 14265 angle = this._circleStartAngle + i * angleStep; 14266 res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round(); 14267 } 14268 14269 return res; 14270 }, 14271 14272 _generatePointsSpiral: function (count, centerPt) { 14273 var spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier, 14274 legLength = spiderfyDistanceMultiplier * this._spiralLengthStart, 14275 separation = spiderfyDistanceMultiplier * this._spiralFootSeparation, 14276 lengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI, 14277 angle = 0, 14278 res = [], 14279 i; 14280 14281 res.length = count; 14282 14283 // Higher index, closer position to cluster center. 14284 for (i = count; i >= 0; i--) { 14285 // Skip the first position, so that we are already farther from center and we avoid 14286 // being under the default cluster icon (especially important for Circle Markers). 14287 if (i < count) { 14288 res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round(); 14289 } 14290 angle += separation / legLength + i * 0.0005; 14291 legLength += lengthFactor / angle; 14292 } 14293 return res; 14294 }, 14295 14296 _noanimationUnspiderfy: function () { 14297 var group = this._group, 14298 map = group._map, 14299 fg = group._featureGroup, 14300 childMarkers = this.getAllChildMarkers(null, true), 14301 m, i; 14302 14303 group._ignoreMove = true; 14304 14305 this.setOpacity(1); 14306 for (i = childMarkers.length - 1; i >= 0; i--) { 14307 m = childMarkers[i]; 14308 14309 fg.removeLayer(m); 14310 14311 if (m._preSpiderfyLatlng) { 14312 m.setLatLng(m._preSpiderfyLatlng); 14313 delete m._preSpiderfyLatlng; 14314 } 14315 if (m.setZIndexOffset) { 14316 m.setZIndexOffset(0); 14317 } 14318 14319 if (m._spiderLeg) { 14320 map.removeLayer(m._spiderLeg); 14321 delete m._spiderLeg; 14322 } 14323 } 14324 14325 group.fire('unspiderfied', { 14326 cluster: this, 14327 markers: childMarkers 14328 }); 14329 group._ignoreMove = false; 14330 group._spiderfied = null; 14331 } 14332 }); 14333 14334 //Non Animated versions of everything 14335 L.MarkerClusterNonAnimated = L.MarkerCluster.extend({ 14336 _animationSpiderfy: function (childMarkers, positions) { 14337 var group = this._group, 14338 map = group._map, 14339 fg = group._featureGroup, 14340 legOptions = this._group.options.spiderLegPolylineOptions, 14341 i, m, leg, newPos; 14342 14343 group._ignoreMove = true; 14344 14345 // Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition. 14346 // The reverse order trick no longer improves performance on modern browsers. 14347 for (i = 0; i < childMarkers.length; i++) { 14348 newPos = map.layerPointToLatLng(positions[i]); 14349 m = childMarkers[i]; 14350 14351 // Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it. 14352 leg = new L.Polyline([this._latlng, newPos], legOptions); 14353 map.addLayer(leg); 14354 m._spiderLeg = leg; 14355 14356 // Now add the marker. 14357 m._preSpiderfyLatlng = m._latlng; 14358 m.setLatLng(newPos); 14359 if (m.setZIndexOffset) { 14360 m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING 14361 } 14362 14363 fg.addLayer(m); 14364 } 14365 this.setOpacity(0.3); 14366 14367 group._ignoreMove = false; 14368 group.fire('spiderfied', { 14369 cluster: this, 14370 markers: childMarkers 14371 }); 14372 }, 14373 14374 _animationUnspiderfy: function () { 14375 this._noanimationUnspiderfy(); 14376 } 14377 }); 14378 14379 //Animated versions here 14380 L.MarkerCluster.include({ 14381 14382 _animationSpiderfy: function (childMarkers, positions) { 14383 var me = this, 14384 group = this._group, 14385 map = group._map, 14386 fg = group._featureGroup, 14387 thisLayerLatLng = this._latlng, 14388 thisLayerPos = map.latLngToLayerPoint(thisLayerLatLng), 14389 svg = L.Path.SVG, 14390 legOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation. 14391 finalLegOpacity = legOptions.opacity, 14392 i, m, leg, legPath, legLength, newPos; 14393 14394 if (finalLegOpacity === undefined) { 14395 finalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity; 14396 } 14397 14398 if (svg) { 14399 // If the initial opacity of the spider leg is not 0 then it appears before the animation starts. 14400 legOptions.opacity = 0; 14401 14402 // Add the class for CSS transitions. 14403 legOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg'; 14404 } else { 14405 // Make sure we have a defined opacity. 14406 legOptions.opacity = finalLegOpacity; 14407 } 14408 14409 group._ignoreMove = true; 14410 14411 // Add markers and spider legs to map, hidden at our center point. 14412 // Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition. 14413 // The reverse order trick no longer improves performance on modern browsers. 14414 for (i = 0; i < childMarkers.length; i++) { 14415 m = childMarkers[i]; 14416 14417 newPos = map.layerPointToLatLng(positions[i]); 14418 14419 // Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it. 14420 leg = new L.Polyline([thisLayerLatLng, newPos], legOptions); 14421 map.addLayer(leg); 14422 m._spiderLeg = leg; 14423 14424 // Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/ 14425 // In our case the transition property is declared in the CSS file. 14426 if (svg) { 14427 legPath = leg._path; 14428 legLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox. 14429 legPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated. 14430 legPath.style.strokeDashoffset = legLength; 14431 } 14432 14433 // If it is a marker, add it now and we'll animate it out 14434 if (m.setZIndexOffset) { 14435 m.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING 14436 } 14437 if (m.clusterHide) { 14438 m.clusterHide(); 14439 } 14440 14441 // Vectors just get immediately added 14442 fg.addLayer(m); 14443 14444 if (m._setPos) { 14445 m._setPos(thisLayerPos); 14446 } 14447 } 14448 14449 group._forceLayout(); 14450 group._animationStart(); 14451 14452 // Reveal markers and spider legs. 14453 for (i = childMarkers.length - 1; i >= 0; i--) { 14454 newPos = map.layerPointToLatLng(positions[i]); 14455 m = childMarkers[i]; 14456 14457 //Move marker to new position 14458 m._preSpiderfyLatlng = m._latlng; 14459 m.setLatLng(newPos); 14460 14461 if (m.clusterShow) { 14462 m.clusterShow(); 14463 } 14464 14465 // Animate leg (animation is actually delegated to CSS transition). 14466 if (svg) { 14467 leg = m._spiderLeg; 14468 legPath = leg._path; 14469 legPath.style.strokeDashoffset = 0; 14470 //legPath.style.strokeOpacity = finalLegOpacity; 14471 leg.setStyle({opacity: finalLegOpacity}); 14472 } 14473 } 14474 this.setOpacity(0.3); 14475 14476 group._ignoreMove = false; 14477 14478 setTimeout(function () { 14479 group._animationEnd(); 14480 group.fire('spiderfied', { 14481 cluster: me, 14482 markers: childMarkers 14483 }); 14484 }, 200); 14485 }, 14486 14487 _animationUnspiderfy: function (zoomDetails) { 14488 var me = this, 14489 group = this._group, 14490 map = group._map, 14491 fg = group._featureGroup, 14492 thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng), 14493 childMarkers = this.getAllChildMarkers(null, true), 14494 svg = L.Path.SVG, 14495 m, i, leg, legPath, legLength, nonAnimatable; 14496 14497 group._ignoreMove = true; 14498 group._animationStart(); 14499 14500 //Make us visible and bring the child markers back in 14501 this.setOpacity(1); 14502 for (i = childMarkers.length - 1; i >= 0; i--) { 14503 m = childMarkers[i]; 14504 14505 //Marker was added to us after we were spiderfied 14506 if (!m._preSpiderfyLatlng) { 14507 continue; 14508 } 14509 14510 //Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll 14511 m.closePopup(); 14512 14513 //Fix up the location to the real one 14514 m.setLatLng(m._preSpiderfyLatlng); 14515 delete m._preSpiderfyLatlng; 14516 14517 //Hack override the location to be our center 14518 nonAnimatable = true; 14519 if (m._setPos) { 14520 m._setPos(thisLayerPos); 14521 nonAnimatable = false; 14522 } 14523 if (m.clusterHide) { 14524 m.clusterHide(); 14525 nonAnimatable = false; 14526 } 14527 if (nonAnimatable) { 14528 fg.removeLayer(m); 14529 } 14530 14531 // Animate the spider leg back in (animation is actually delegated to CSS transition). 14532 if (svg) { 14533 leg = m._spiderLeg; 14534 legPath = leg._path; 14535 legLength = legPath.getTotalLength() + 0.1; 14536 legPath.style.strokeDashoffset = legLength; 14537 leg.setStyle({opacity: 0}); 14538 } 14539 } 14540 14541 group._ignoreMove = false; 14542 14543 setTimeout(function () { 14544 //If we have only <= one child left then that marker will be shown on the map so don't remove it! 14545 var stillThereChildCount = 0; 14546 for (i = childMarkers.length - 1; i >= 0; i--) { 14547 m = childMarkers[i]; 14548 if (m._spiderLeg) { 14549 stillThereChildCount++; 14550 } 14551 } 14552 14553 14554 for (i = childMarkers.length - 1; i >= 0; i--) { 14555 m = childMarkers[i]; 14556 14557 if (!m._spiderLeg) { //Has already been unspiderfied 14558 continue; 14559 } 14560 14561 if (m.clusterShow) { 14562 m.clusterShow(); 14563 } 14564 if (m.setZIndexOffset) { 14565 m.setZIndexOffset(0); 14566 } 14567 14568 if (stillThereChildCount > 1) { 14569 fg.removeLayer(m); 14570 } 14571 14572 map.removeLayer(m._spiderLeg); 14573 delete m._spiderLeg; 14574 } 14575 group._animationEnd(); 14576 group.fire('unspiderfied', { 14577 cluster: me, 14578 markers: childMarkers 14579 }); 14580 }, 200); 14581 } 14582 }); 14583 14584 14585 L.MarkerClusterGroup.include({ 14586 //The MarkerCluster currently spiderfied (if any) 14587 _spiderfied: null, 14588 14589 unspiderfy: function () { 14590 this._unspiderfy.apply(this, arguments); 14591 }, 14592 14593 _spiderfierOnAdd: function () { 14594 this._map.on('click', this._unspiderfyWrapper, this); 14595 14596 if (this._map.options.zoomAnimation) { 14597 this._map.on('zoomstart', this._unspiderfyZoomStart, this); 14598 } 14599 //Browsers without zoomAnimation or a big zoom don't fire zoomstart 14600 this._map.on('zoomend', this._noanimationUnspiderfy, this); 14601 14602 if (!L.Browser.touch) { 14603 this._map.getRenderer(this); 14604 //Needs to happen in the pageload, not after, or animations don't work in webkit 14605 // http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements 14606 //Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable 14607 } 14608 }, 14609 14610 _spiderfierOnRemove: function () { 14611 this._map.off('click', this._unspiderfyWrapper, this); 14612 this._map.off('zoomstart', this._unspiderfyZoomStart, this); 14613 this._map.off('zoomanim', this._unspiderfyZoomAnim, this); 14614 this._map.off('zoomend', this._noanimationUnspiderfy, this); 14615 14616 //Ensure that markers are back where they should be 14617 // Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane 14618 this._noanimationUnspiderfy(); 14619 }, 14620 14621 //On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated) 14622 //This means we can define the animation they do rather than Markers doing an animation to their actual location 14623 _unspiderfyZoomStart: function () { 14624 if (!this._map) { //May have been removed from the map by a zoomEnd handler 14625 return; 14626 } 14627 14628 this._map.on('zoomanim', this._unspiderfyZoomAnim, this); 14629 }, 14630 14631 _unspiderfyZoomAnim: function (zoomDetails) { 14632 //Wait until the first zoomanim after the user has finished touch-zooming before running the animation 14633 if (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) { 14634 return; 14635 } 14636 14637 this._map.off('zoomanim', this._unspiderfyZoomAnim, this); 14638 this._unspiderfy(zoomDetails); 14639 }, 14640 14641 _unspiderfyWrapper: function () { 14642 /// <summary>_unspiderfy but passes no arguments</summary> 14643 this._unspiderfy(); 14644 }, 14645 14646 _unspiderfy: function (zoomDetails) { 14647 if (this._spiderfied) { 14648 this._spiderfied.unspiderfy(zoomDetails); 14649 } 14650 }, 14651 14652 _noanimationUnspiderfy: function () { 14653 if (this._spiderfied) { 14654 this._spiderfied._noanimationUnspiderfy(); 14655 } 14656 }, 14657 14658 //If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc 14659 _unspiderfyLayer: function (layer) { 14660 if (layer._spiderLeg) { 14661 this._featureGroup.removeLayer(layer); 14662 14663 if (layer.clusterShow) { 14664 layer.clusterShow(); 14665 } 14666 //Position will be fixed up immediately in _animationUnspiderfy 14667 if (layer.setZIndexOffset) { 14668 layer.setZIndexOffset(0); 14669 } 14670 14671 this._map.removeLayer(layer._spiderLeg); 14672 delete layer._spiderLeg; 14673 } 14674 } 14675 }); 14676 14677 /** 14678 * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing 14679 * markers' icon options and refreshing their icon and their parent clusters 14680 * accordingly (case where their iconCreateFunction uses data of childMarkers 14681 * to make up the cluster icon). 14682 */ 14683 14684 14685 L.MarkerClusterGroup.include({ 14686 /** 14687 * Updates the icon of all clusters which are parents of the given marker(s). 14688 * In singleMarkerMode, also updates the given marker(s) icon. 14689 * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)| 14690 * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent 14691 * clusters need to be updated. If not provided, retrieves all child markers of this. 14692 * @returns {L.MarkerClusterGroup} 14693 */ 14694 refreshClusters: function (layers) { 14695 if (!layers) { 14696 layers = this._topClusterLevel.getAllChildMarkers(); 14697 } else if (layers instanceof L.MarkerClusterGroup) { 14698 layers = layers._topClusterLevel.getAllChildMarkers(); 14699 } else if (layers instanceof L.LayerGroup) { 14700 layers = layers._layers; 14701 } else if (layers instanceof L.MarkerCluster) { 14702 layers = layers.getAllChildMarkers(); 14703 } else if (layers instanceof L.Marker) { 14704 layers = [layers]; 14705 } // else: must be an Array(L.Marker)|Map(L.Marker) 14706 this._flagParentsIconsNeedUpdate(layers); 14707 this._refreshClustersIcons(); 14708 14709 // In case of singleMarkerMode, also re-draw the markers. 14710 if (this.options.singleMarkerMode) { 14711 this._refreshSingleMarkerModeMarkers(layers); 14712 } 14713 14714 return this; 14715 }, 14716 14717 /** 14718 * Simply flags all parent clusters of the given markers as having a "dirty" icon. 14719 * @param layers Array(L.Marker)|Map(L.Marker) list of markers. 14720 * @private 14721 */ 14722 _flagParentsIconsNeedUpdate: function (layers) { 14723 var id, parent; 14724 14725 // Assumes layers is an Array or an Object whose prototype is non-enumerable. 14726 for (id in layers) { 14727 // Flag parent clusters' icon as "dirty", all the way up. 14728 // Dumb process that flags multiple times upper parents, but still 14729 // much more efficient than trying to be smart and make short lists, 14730 // at least in the case of a hierarchy following a power law: 14731 // http://jsperf.com/flag-nodes-in-power-hierarchy/2 14732 parent = layers[id].__parent; 14733 while (parent) { 14734 parent._iconNeedsUpdate = true; 14735 parent = parent.__parent; 14736 } 14737 } 14738 }, 14739 14740 /** 14741 * Re-draws the icon of the supplied markers. 14742 * To be used in singleMarkerMode only. 14743 * @param layers Array(L.Marker)|Map(L.Marker) list of markers. 14744 * @private 14745 */ 14746 _refreshSingleMarkerModeMarkers: function (layers) { 14747 var id, layer; 14748 14749 for (id in layers) { 14750 layer = layers[id]; 14751 14752 // Make sure we do not override markers that do not belong to THIS group. 14753 if (this.hasLayer(layer)) { 14754 // Need to re-create the icon first, then re-draw the marker. 14755 layer.setIcon(this._overrideMarkerIcon(layer)); 14756 } 14757 } 14758 } 14759 }); 14760 14761 L.Marker.include({ 14762 /** 14763 * Updates the given options in the marker's icon and refreshes the marker. 14764 * @param options map object of icon options. 14765 * @param directlyRefreshClusters boolean (optional) true to trigger 14766 * MCG.refreshClustersOf() right away with this single marker. 14767 * @returns {L.Marker} 14768 */ 14769 refreshIconOptions: function (options, directlyRefreshClusters) { 14770 var icon = this.options.icon; 14771 14772 L.setOptions(icon, options); 14773 14774 this.setIcon(icon); 14775 14776 // Shortcut to refresh the associated MCG clusters right away. 14777 // To be used when refreshing a single marker. 14778 // Otherwise, better use MCG.refreshClusters() once at the end with 14779 // the list of modified markers. 14780 if (directlyRefreshClusters && this.__parent) { 14781 this.__parent._group.refreshClusters(this); 14782 } 14783 14784 return this; 14785 } 14786 }); 14787 14788 exports.MarkerClusterGroup = MarkerClusterGroup; 14789 exports.MarkerCluster = MarkerCluster; 14790 14791 Object.defineProperty(exports, '__esModule', { value: true }); 14792 14793})); 14794//# sourceMappingURL=leaflet.markercluster-src.js.map
14795 14796 14797/***/ }), 14798 14799/***/ 5243: 14800/***/ (function(__unused_webpack_module, exports) { 14801 14802/* @preserve 14803 * Leaflet 1.9.3, a JS library for interactive maps. https://leafletjs.com 14804 * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade 14805 */ 14806 14807(function (global, factory) { 14808 true ? factory(exports) : 14809 0; 14810})(this, (function (exports) { 'use strict'; 14811 14812 var version = "1.9.3
vendor: 85,980 bytes, lines 14812-17429
14812"; 14813 14814 /* 14815 * @namespace Util 14816 * 14817 * Various utility functions, used by Leaflet internally. 14818 */ 14819 14820 // @function extend(dest: Object, src?: Object): Object 14821 // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut. 14822 function extend(dest) { 14823 var i, j, len, src; 14824 14825 for (j = 1, len = arguments.length; j < len; j++) { 14826 src = arguments[j]; 14827 for (i in src) { 14828 dest[i] = src[i]; 14829 } 14830 } 14831 return dest; 14832 } 14833 14834 // @function create(proto: Object, properties?: Object): Object 14835 // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create) 14836 var create$2 = Object.create || (function () { 14837 function F() {} 14838 return function (proto) { 14839 F.prototype = proto; 14840 return new F(); 14841 }; 14842 })(); 14843 14844 // @function bind(fn: Function, â¦): Function 14845 // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). 14846 // Has a `L.bind()` shortcut. 14847 function bind(fn, obj) { 14848 var slice = Array.prototype.slice; 14849 14850 if (fn.bind) { 14851 return fn.bind.apply(fn, slice.call(arguments, 1)); 14852 } 14853 14854 var args = slice.call(arguments, 2); 14855 14856 return function () { 14857 return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); 14858 }; 14859 } 14860 14861 // @property lastId: Number 14862 // Last unique ID used by [`stamp()`](#util-stamp) 14863 var lastId = 0; 14864 14865 // @function stamp(obj: Object): Number 14866 // Returns the unique ID of an object, assigning it one if it doesn't have it. 14867 function stamp(obj) { 14868 if (!('_leaflet_id' in obj)) { 14869 obj['_leaflet_id'] = ++lastId; 14870 } 14871 return obj._leaflet_id; 14872 } 14873 14874 // @function throttle(fn: Function, time: Number, context: Object): Function 14875 // Returns a function which executes function `fn` with the given scope `context` 14876 // (so that the `this` keyword refers to `context` inside `fn`'s code). The function 14877 // `fn` will be called no more than one time per given amount of `time`. The arguments 14878 // received by the bound function will be any arguments passed when binding the 14879 // function, followed by any arguments passed when invoking the bound function. 14880 // Has an `L.throttle` shortcut. 14881 function throttle(fn, time, context) { 14882 var lock, args, wrapperFn, later; 14883 14884 later = function () { 14885 // reset lock and call if queued 14886 lock = false; 14887 if (args) { 14888 wrapperFn.apply(context, args); 14889 args = false; 14890 } 14891 }; 14892 14893 wrapperFn = function () { 14894 if (lock) { 14895 // called too soon, queue to call later 14896 args = arguments; 14897 14898 } else { 14899 // call and lock until later 14900 fn.apply(context, arguments); 14901 setTimeout(later, time); 14902 lock = true; 14903 } 14904 }; 14905 14906 return wrapperFn; 14907 } 14908 14909 // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number 14910 // Returns the number `num` modulo `range` in such a way so it lies within 14911 // `range[0]` and `range[1]`. The returned value will be always smaller than 14912 // `range[1]` unless `includeMax` is set to `true`. 14913 function wrapNum(x, range, includeMax) { 14914 var max = range[1], 14915 min = range[0], 14916 d = max - min; 14917 return x === max && includeMax ? x : ((x - min) % d + d) % d + min; 14918 } 14919 14920 // @function falseFn(): Function 14921 // Returns a function which always returns `false`. 14922 function falseFn() { return false; } 14923 14924 // @function formatNum(num: Number, precision?: Number|false): Number 14925 // Returns the number `num` rounded with specified `precision`. 14926 // The default `precision` value is 6 decimal places. 14927 // `false` can be passed to skip any processing (can be useful to avoid round-off errors). 14928 function formatNum(num, precision) { 14929 if (precision === false) { return num; } 14930 var pow = Math.pow(10, precision === undefined ? 6 : precision); 14931 return Math.round(num * pow) / pow; 14932 } 14933 14934 // @function trim(str: String): String 14935 // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) 14936 function trim(str) { 14937 return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); 14938 } 14939 14940 // @function splitWords(str: String): String[] 14941 // Trims and splits the string on whitespace and returns the array of parts. 14942 function splitWords(str) { 14943 return trim(str).split(/\s+/); 14944 } 14945 14946 // @function setOptions(obj: Object, options: Object): Object 14947 // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut. 14948 function setOptions(obj, options) { 14949 if (!Object.prototype.hasOwnProperty.call(obj, 'options')) { 14950 obj.options = obj.options ? create$2(obj.options) : {}; 14951 } 14952 for (var i in options) { 14953 obj.options[i] = options[i]; 14954 } 14955 return obj.options; 14956 } 14957 14958 // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String 14959 // Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}` 14960 // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will 14961 // be appended at the end. If `uppercase` is `true`, the parameter names will 14962 // be uppercased (e.g. `'?A=foo&B=bar'`) 14963 function getParamString(obj, existingUrl, uppercase) { 14964 var params = []; 14965 for (var i in obj) { 14966 params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i])); 14967 } 14968 return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); 14969 } 14970 14971 var templateRe = /\{ *([\w_ -]+) *\}/g; 14972 14973 // @function template(str: String, data: Object): String 14974 // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'` 14975 // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string 14976 // `('Hello foo, bar')`. You can also specify functions instead of strings for 14977 // data values â they will be evaluated passing `data` as an argument. 14978 function template(str, data) { 14979 return str.replace(templateRe, function (str, key) { 14980 var value = data[key]; 14981 14982 if (value === undefined) { 14983 throw new Error('No value provided for variable ' + str); 14984 14985 } else if (typeof value === 'function') { 14986 value = value(data); 14987 } 14988 return value; 14989 }); 14990 } 14991 14992 // @function isArray(obj): Boolean 14993 // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) 14994 var isArray = Array.isArray || function (obj) { 14995 return (Object.prototype.toString.call(obj) === '[object Array]'); 14996 }; 14997 14998 // @function indexOf(array: Array, el: Object): Number 14999 // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) 15000 function indexOf(array, el) { 15001 for (var i = 0; i < array.length; i++) { 15002 if (array[i] === el) { return i; } 15003 } 15004 return -1; 15005 } 15006 15007 // @property emptyImageUrl: String 15008 // Data URI string containing a base64-encoded empty GIF image. 15009 // Used as a hack to free memory from unused images on WebKit-powered 15010 // mobile devices (by setting image `src` to this string). 15011 var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; 15012 15013 // inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/ 15014 15015 function getPrefixed(name) { 15016 return window['webkit' + name] || window['moz' + name] || window['ms' + name]; 15017 } 15018 15019 var lastTime = 0; 15020 15021 // fallback for IE 7-8 15022 function timeoutDefer(fn) { 15023 var time = +new Date(), 15024 timeToCall = Math.max(0, 16 - (time - lastTime)); 15025 15026 lastTime = time + timeToCall; 15027 return window.setTimeout(fn, timeToCall); 15028 } 15029 15030 var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer; 15031 var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || 15032 getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; 15033 15034 // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number 15035 // Schedules `fn` to be executed when the browser repaints. `fn` is bound to 15036 // `context` if given. When `immediate` is set, `fn` is called immediately if 15037 // the browser doesn't have native support for 15038 // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame), 15039 // otherwise it's delayed. Returns a request ID that can be used to cancel the request. 15040 function requestAnimFrame(fn, context, immediate) { 15041 if (immediate && requestFn === timeoutDefer) { 15042 fn.call(context); 15043 } else { 15044 return requestFn.call(window, bind(fn, context)); 15045 } 15046 } 15047 15048 // @function cancelAnimFrame(id: Number): undefined 15049 // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame). 15050 function cancelAnimFrame(id) { 15051 if (id) { 15052 cancelFn.call(window, id); 15053 } 15054 } 15055 15056 var Util = { 15057 __proto__: null, 15058 extend: extend, 15059 create: create$2, 15060 bind: bind, 15061 get lastId () { return lastId; }, 15062 stamp: stamp, 15063 throttle: throttle, 15064 wrapNum: wrapNum, 15065 falseFn: falseFn, 15066 formatNum: formatNum, 15067 trim: trim, 15068 splitWords: splitWords, 15069 setOptions: setOptions, 15070 getParamString: getParamString, 15071 template: template, 15072 isArray: isArray, 15073 indexOf: indexOf, 15074 emptyImageUrl: emptyImageUrl, 15075 requestFn: requestFn, 15076 cancelFn: cancelFn, 15077 requestAnimFrame: requestAnimFrame, 15078 cancelAnimFrame: cancelAnimFrame 15079 }; 15080 15081 // @class Class 15082 // @aka L.Class 15083 15084 // @section 15085 // @uninheritable 15086 15087 // Thanks to John Resig and Dean Edwards for inspiration! 15088 15089 function Class() {} 15090 15091 Class.extend = function (props) { 15092 15093 // @function extend(props: Object): Function 15094 // [Extends the current class](#class-inheritance) given the properties to be included. 15095 // Returns a Javascript function that is a class constructor (to be called with `new`). 15096 var NewClass = function () { 15097 15098 setOptions(this); 15099 15100 // call the constructor 15101 if (this.initialize) { 15102 this.initialize.apply(this, arguments); 15103 } 15104 15105 // call all constructor hooks 15106 this.callInitHooks(); 15107 }; 15108 15109 var parentProto = NewClass.__super__ = this.prototype; 15110 15111 var proto = create$2(parentProto); 15112 proto.constructor = NewClass; 15113 15114 NewClass.prototype = proto; 15115 15116 // inherit parent's statics 15117 for (var i in this) { 15118 if (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') { 15119 NewClass[i] = this[i]; 15120 } 15121 } 15122 15123 // mix static properties into the class 15124 if (props.statics) { 15125 extend(NewClass, props.statics); 15126 } 15127 15128 // mix includes into the prototype 15129 if (props.includes) { 15130 checkDeprecatedMixinEvents(props.includes); 15131 extend.apply(null, [proto].concat(props.includes)); 15132 } 15133 15134 // mix given properties into the prototype 15135 extend(proto, props); 15136 delete proto.statics; 15137 delete proto.includes; 15138 15139 // merge options 15140 if (proto.options) { 15141 proto.options = parentProto.options ? create$2(parentProto.options) : {}; 15142 extend(proto.options, props.options); 15143 } 15144 15145 proto._initHooks = []; 15146 15147 // add method for calling all hooks 15148 proto.callInitHooks = function () { 15149 15150 if (this._initHooksCalled) { return; } 15151 15152 if (parentProto.callInitHooks) { 15153 parentProto.callInitHooks.call(this); 15154 } 15155 15156 this._initHooksCalled = true; 15157 15158 for (var i = 0, len = proto._initHooks.length; i < len; i++) { 15159 proto._initHooks[i].call(this); 15160 } 15161 }; 15162 15163 return NewClass; 15164 }; 15165 15166 15167 // @function include(properties: Object): this 15168 // [Includes a mixin](#class-includes) into the current class. 15169 Class.include = function (props) { 15170 var parentOptions = this.prototype.options; 15171 extend(this.prototype, props); 15172 if (props.options) { 15173 this.prototype.options = parentOptions; 15174 this.mergeOptions(props.options); 15175 } 15176 return this; 15177 }; 15178 15179 // @function mergeOptions(options: Object): this 15180 // [Merges `options`](#class-options) into the defaults of the class. 15181 Class.mergeOptions = function (options) { 15182 extend(this.prototype.options, options); 15183 return this; 15184 }; 15185 15186 // @function addInitHook(fn: Function): this 15187 // Adds a [constructor hook](#class-constructor-hooks) to the class. 15188 Class.addInitHook = function (fn) { // (Function) || (String, args...) 15189 var args = Array.prototype.slice.call(arguments, 1); 15190 15191 var init = typeof fn === 'function' ? fn : function () { 15192 this[fn].apply(this, args); 15193 }; 15194 15195 this.prototype._initHooks = this.prototype._initHooks || []; 15196 this.prototype._initHooks.push(init); 15197 return this; 15198 }; 15199 15200 function checkDeprecatedMixinEvents(includes) { 15201 /* global L: true */ 15202 if (typeof L === 'undefined' || !L || !L.Mixin) { return; } 15203 15204 includes = isArray(includes) ? includes : [includes]; 15205 15206 for (var i = 0; i < includes.length; i++) { 15207 if (includes[i] === L.Mixin.Events) { 15208 console.warn('Deprecated include of L.Mixin.Events: ' + 15209 'this property will be removed in future releases, ' + 15210 'please inherit from L.Evented instead.', new Error().stack); 15211 } 15212 } 15213 } 15214 15215 /* 15216 * @class Evented 15217 * @aka L.Evented 15218 * @inherits Class 15219 * 15220 * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event). 15221 * 15222 * @example 15223 * 15224 * ```js 15225 * map.on('click', function(e) { 15226 * alert(e.latlng); 15227 * } ); 15228 * ``` 15229 * 15230 * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function: 15231 * 15232 * ```js 15233 * function onClick(e) { ... } 15234 * 15235 * map.on('click', onClick); 15236 * map.off('click', onClick); 15237 * ``` 15238 */ 15239 15240 var Events = { 15241 /* @method on(type: String, fn: Function, context?: Object): this 15242 * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`). 15243 * 15244 * @alternative 15245 * @method on(eventMap: Object): this 15246 * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` 15247 */ 15248 on: function (types, fn, context) { 15249 15250 // types can be a map of types/handlers 15251 if (typeof types === 'object') { 15252 for (var type in types) { 15253 // we don't process space-separated events here for performance; 15254 // it's a hot path since Layer uses the on(obj) syntax 15255 this._on(type, types[type], fn); 15256 } 15257 15258 } else { 15259 // types can be a string of space-separated words 15260 types = splitWords(types); 15261 15262 for (var i = 0, len = types.length; i < len; i++) { 15263 this._on(types[i], fn, context); 15264 } 15265 } 15266 15267 return this; 15268 }, 15269 15270 /* @method off(type: String, fn?: Function, context?: Object): this 15271 * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener. 15272 * 15273 * @alternative 15274 * @method off(eventMap: Object): this 15275 * Removes a set of type/listener pairs. 15276 * 15277 * @alternative 15278 * @method off: this 15279 * Removes all listeners to all events on the object. This includes implicitly attached events. 15280 */ 15281 off: function (types, fn, context) { 15282 15283 if (!arguments.length) { 15284 // clear all listeners if called without arguments 15285 delete this._events; 15286 15287 } else if (typeof types === 'object') { 15288 for (var type in types) { 15289 this._off(type, types[type], fn); 15290 } 15291 15292 } else { 15293 types = splitWords(types); 15294 15295 var removeAll = arguments.length === 1; 15296 for (var i = 0, len = types.length; i < len; i++) { 15297 if (removeAll) { 15298 this._off(types[i]); 15299 } else { 15300 this._off(types[i], fn, context); 15301 } 15302 } 15303 } 15304 15305 return this; 15306 }, 15307 15308 // attach listener (without syntactic sugar now) 15309 _on: function (type, fn, context, _once) { 15310 if (typeof fn !== 'function') { 15311 console.warn('wrong listener type: ' + typeof fn); 15312 return; 15313 } 15314 15315 // check if fn already there 15316 if (this._listens(type, fn, context) !== false) { 15317 return; 15318 } 15319 15320 if (context === this) { 15321 // Less memory footprint. 15322 context = undefined; 15323 } 15324 15325 var newListener = {fn: fn, ctx: context}; 15326 if (_once) { 15327 newListener.once = true; 15328 } 15329 15330 this._events = this._events || {}; 15331 this._events[type] = this._events[type] || []; 15332 this._events[type].push(newListener); 15333 }, 15334 15335 _off: function (type, fn, context) { 15336 var listeners, 15337 i, 15338 len; 15339 15340 if (!this._events) { 15341 return; 15342 } 15343 15344 listeners = this._events[type]; 15345 if (!listeners) { 15346 return; 15347 } 15348 15349 if (arguments.length === 1) { // remove all 15350 if (this._firingCount) { 15351 // Set all removed listeners to noop 15352 // so they are not called if remove happens in fire 15353 for (i = 0, len = listeners.length; i < len; i++) { 15354 listeners[i].fn = falseFn; 15355 } 15356 } 15357 // clear all listeners for a type if function isn't specified 15358 delete this._events[type]; 15359 return; 15360 } 15361 15362 if (typeof fn !== 'function') { 15363 console.warn('wrong listener type: ' + typeof fn); 15364 return; 15365 } 15366 15367 // find fn and remove it 15368 var index = this._listens(type, fn, context); 15369 if (index !== false) { 15370 var listener = listeners[index]; 15371 if (this._firingCount) { 15372 // set the removed listener to noop so that's not called if remove happens in fire 15373 listener.fn = falseFn; 15374 15375 /* copy array in case events are being fired */ 15376 this._events[type] = listeners = listeners.slice(); 15377 } 15378 listeners.splice(index, 1); 15379 } 15380 }, 15381 15382 // @method fire(type: String, data?: Object, propagate?: Boolean): this 15383 // Fires an event of the specified type. You can optionally provide a data 15384 // object â the first argument of the listener function will contain its 15385 // properties. The event can optionally be propagated to event parents. 15386 fire: function (type, data, propagate) { 15387 if (!this.listens(type, propagate)) { return this; } 15388 15389 var event = extend({}, data, { 15390 type: type, 15391 target: this, 15392 sourceTarget: data && data.sourceTarget || this 15393 }); 15394 15395 if (this._events) { 15396 var listeners = this._events[type]; 15397 if (listeners) { 15398 this._firingCount = (this._firingCount + 1) || 1; 15399 for (var i = 0, len = listeners.length; i < len; i++) { 15400 var l = listeners[i]; 15401 // off overwrites l.fn, so we need to copy fn to a var 15402 var fn = l.fn; 15403 if (l.once) { 15404 this.off(type, fn, l.ctx); 15405 } 15406 fn.call(l.ctx || this, event); 15407 } 15408 15409 this._firingCount--; 15410 } 15411 } 15412 15413 if (propagate) { 15414 // propagate the event to parents (set with addEventParent) 15415 this._propagateEvent(event); 15416 } 15417 15418 return this; 15419 }, 15420 15421 // @method listens(type: String, propagate?: Boolean): Boolean 15422 // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean 15423 // Returns `true` if a particular event type has any listeners attached to it. 15424 // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it. 15425 listens: function (type, fn, context, propagate) { 15426 if (typeof type !== 'string') { 15427 console.warn('"string" type argument expected'); 15428 } 15429 15430 // we don't overwrite the input `fn` value, because we need to use it for propagation 15431 var _fn = fn; 15432 if (typeof fn !== 'function') { 15433 propagate = !!fn; 15434 _fn = undefined; 15435 context = undefined; 15436 } 15437 15438 var listeners = this._events && this._events[type]; 15439 if (listeners && listeners.length) { 15440 if (this._listens(type, _fn, context) !== false) { 15441 return true; 15442 } 15443 } 15444 15445 if (propagate) { 15446 // also check parents for listeners if event propagates 15447 for (var id in this._eventParents) { 15448 if (this._eventParents[id].listens(type, fn, context, propagate)) { return true; } 15449 } 15450 } 15451 return false; 15452 }, 15453 15454 // returns the index (number) or false 15455 _listens: function (type, fn, context) { 15456 if (!this._events) { 15457 return false; 15458 } 15459 15460 var listeners = this._events[type] || []; 15461 if (!fn) { 15462 return !!listeners.length; 15463 } 15464 15465 if (context === this) { 15466 // Less memory footprint. 15467 context = undefined; 15468 } 15469 15470 for (var i = 0, len = listeners.length; i < len; i++) { 15471 if (listeners[i].fn === fn && listeners[i].ctx === context) { 15472 return i; 15473 } 15474 } 15475 return false; 15476 15477 }, 15478 15479 // @method once(â¦): this 15480 // Behaves as [`on(â¦)`](#evented-on), except the listener will only get fired once and then removed. 15481 once: function (types, fn, context) { 15482 15483 // types can be a map of types/handlers 15484 if (typeof types === 'object') { 15485 for (var type in types) { 15486 // we don't process space-separated events here for performance; 15487 // it's a hot path since Layer uses the on(obj) syntax 15488 this._on(type, types[type], fn, true); 15489 } 15490 15491 } else { 15492 // types can be a string of space-separated words 15493 types = splitWords(types); 15494 15495 for (var i = 0, len = types.length; i < len; i++) { 15496 this._on(types[i], fn, context, true); 15497 } 15498 } 15499 15500 return this; 15501 }, 15502 15503 // @method addEventParent(obj: Evented): this 15504 // Adds an event parent - an `Evented` that will receive propagated events 15505 addEventParent: function (obj) { 15506 this._eventParents = this._eventParents || {}; 15507 this._eventParents[stamp(obj)] = obj; 15508 return this; 15509 }, 15510 15511 // @method removeEventParent(obj: Evented): this 15512 // Removes an event parent, so it will stop receiving propagated events 15513 removeEventParent: function (obj) { 15514 if (this._eventParents) { 15515 delete this._eventParents[stamp(obj)]; 15516 } 15517 return this; 15518 }, 15519 15520 _propagateEvent: function (e) { 15521 for (var id in this._eventParents) { 15522 this._eventParents[id].fire(e.type, extend({ 15523 layer: e.target, 15524 propagatedFrom: e.target 15525 }, e), true); 15526 } 15527 } 15528 }; 15529 15530 // aliases; we should ditch those eventually 15531 15532 // @method addEventListener(â¦): this 15533 // Alias to [`on(â¦)`](#evented-on) 15534 Events.addEventListener = Events.on; 15535 15536 // @method removeEventListener(â¦): this 15537 // Alias to [`off(â¦)`](#evented-off) 15538 15539 // @method clearAllEventListeners(â¦): this 15540 // Alias to [`off()`](#evented-off) 15541 Events.removeEventListener = Events.clearAllEventListeners = Events.off; 15542 15543 // @method addOneTimeEventListener(â¦): this 15544 // Alias to [`once(â¦)`](#evented-once) 15545 Events.addOneTimeEventListener = Events.once; 15546 15547 // @method fireEvent(â¦): this 15548 // Alias to [`fire(â¦)`](#evented-fire) 15549 Events.fireEvent = Events.fire; 15550 15551 // @method hasEventListeners(â¦): Boolean 15552 // Alias to [`listens(â¦)`](#evented-listens) 15553 Events.hasEventListeners = Events.listens; 15554 15555 var Evented = Class.extend(Events); 15556 15557 /* 15558 * @class Point 15559 * @aka L.Point 15560 * 15561 * Represents a point with `x` and `y` coordinates in pixels. 15562 * 15563 * @example 15564 * 15565 * ```js 15566 * var point = L.point(200, 300); 15567 * ``` 15568 * 15569 * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent: 15570 * 15571 * ```js 15572 * map.panBy([200, 300]); 15573 * map.panBy(L.point(200, 300)); 15574 * ``` 15575 * 15576 * Note that `Point` does not inherit from Leaflet's `Class` object, 15577 * which means new classes can't inherit from it, and new methods 15578 * can't be added to it with the `include` function. 15579 */ 15580 15581 function Point(x, y, round) { 15582 // @property x: Number; The `x` coordinate of the point 15583 this.x = (round ? Math.round(x) : x); 15584 // @property y: Number; The `y` coordinate of the point 15585 this.y = (round ? Math.round(y) : y); 15586 } 15587 15588 var trunc = Math.trunc || function (v) { 15589 return v > 0 ? Math.floor(v) : Math.ceil(v); 15590 }; 15591 15592 Point.prototype = { 15593 15594 // @method clone(): Point 15595 // Returns a copy of the current point. 15596 clone: function () { 15597 return new Point(this.x, this.y); 15598 }, 15599 15600 // @method add(otherPoint: Point): Point 15601 // Returns the result of addition of the current and the given points. 15602 add: function (point) { 15603 // non-destructive, returns a new point 15604 return this.clone()._add(toPoint(point)); 15605 }, 15606 15607 _add: function (point) { 15608 // destructive, used directly for performance in situations where it's safe to modify existing point 15609 this.x += point.x; 15610 this.y += point.y; 15611 return this; 15612 }, 15613 15614 // @method subtract(otherPoint: Point): Point 15615 // Returns the result of subtraction of the given point from the current. 15616 subtract: function (point) { 15617 return this.clone()._subtract(toPoint(point)); 15618 }, 15619 15620 _subtract: function (point) { 15621 this.x -= point.x; 15622 this.y -= point.y; 15623 return this; 15624 }, 15625 15626 // @method divideBy(num: Number): Point 15627 // Returns the result of division of the current point by the given number. 15628 divideBy: function (num) { 15629 return this.clone()._divideBy(num); 15630 }, 15631 15632 _divideBy: function (num) { 15633 this.x /= num; 15634 this.y /= num; 15635 return this; 15636 }, 15637 15638 // @method multiplyBy(num: Number): Point 15639 // Returns the result of multiplication of the current point by the given number. 15640 multiplyBy: function (num) { 15641 return this.clone()._multiplyBy(num); 15642 }, 15643 15644 _multiplyBy: function (num) { 15645 this.x *= num; 15646 this.y *= num; 15647 return this; 15648 }, 15649 15650 // @method scaleBy(scale: Point): Point 15651 // Multiply each coordinate of the current point by each coordinate of 15652 // `scale`. In linear algebra terms, multiply the point by the 15653 // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation) 15654 // defined by `scale`. 15655 scaleBy: function (point) { 15656 return new Point(this.x * point.x, this.y * point.y); 15657 }, 15658 15659 // @method unscaleBy(scale: Point): Point 15660 // Inverse of `scaleBy`. Divide each coordinate of the current point by 15661 // each coordinate of `scale`. 15662 unscaleBy: function (point) { 15663 return new Point(this.x / point.x, this.y / point.y); 15664 }, 15665 15666 // @method round(): Point 15667 // Returns a copy of the current point with rounded coordinates. 15668 round: function () { 15669 return this.clone()._round(); 15670 }, 15671 15672 _round: function () { 15673 this.x = Math.round(this.x); 15674 this.y = Math.round(this.y); 15675 return this; 15676 }, 15677 15678 // @method floor(): Point 15679 // Returns a copy of the current point with floored coordinates (rounded down). 15680 floor: function () { 15681 return this.clone()._floor(); 15682 }, 15683 15684 _floor: function () { 15685 this.x = Math.floor(this.x); 15686 this.y = Math.floor(this.y); 15687 return this; 15688 }, 15689 15690 // @method ceil(): Point 15691 // Returns a copy of the current point with ceiled coordinates (rounded up). 15692 ceil: function () { 15693 return this.clone()._ceil(); 15694 }, 15695 15696 _ceil: function () { 15697 this.x = Math.ceil(this.x); 15698 this.y = Math.ceil(this.y); 15699 return this; 15700 }, 15701 15702 // @method trunc(): Point 15703 // Returns a copy of the current point with truncated coordinates (rounded towards zero). 15704 trunc: function () { 15705 return this.clone()._trunc(); 15706 }, 15707 15708 _trunc: function () { 15709 this.x = trunc(this.x); 15710 this.y = trunc(this.y); 15711 return this; 15712 }, 15713 15714 // @method distanceTo(otherPoint: Point): Number 15715 // Returns the cartesian distance between the current and the given points. 15716 distanceTo: function (point) { 15717 point = toPoint(point); 15718 15719 var x = point.x - this.x, 15720 y = point.y - this.y; 15721 15722 return Math.sqrt(x * x + y * y); 15723 }, 15724 15725 // @method equals(otherPoint: Point): Boolean 15726 // Returns `true` if the given point has the same coordinates. 15727 equals: function (point) { 15728 point = toPoint(point); 15729 15730 return point.x === this.x && 15731 point.y === this.y; 15732 }, 15733 15734 // @method contains(otherPoint: Point): Boolean 15735 // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). 15736 contains: function (point) { 15737 point = toPoint(point); 15738 15739 return Math.abs(point.x) <= Math.abs(this.x) && 15740 Math.abs(point.y) <= Math.abs(this.y); 15741 }, 15742 15743 // @method toString(): String 15744 // Returns a string representation of the point for debugging purposes. 15745 toString: function () { 15746 return 'Point(' + 15747 formatNum(this.x) + ', ' + 15748 formatNum(this.y) + ')'; 15749 } 15750 }; 15751 15752 // @factory L.point(x: Number, y: Number, round?: Boolean) 15753 // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values. 15754 15755 // @alternative 15756 // @factory L.point(coords: Number[]) 15757 // Expects an array of the form `[x, y]` instead. 15758 15759 // @alternative 15760 // @factory L.point(coords: Object) 15761 // Expects a plain object of the form `{x: Number, y: Number}` instead. 15762 function toPoint(x, y, round) { 15763 if (x instanceof Point) { 15764 return x; 15765 } 15766 if (isArray(x)) { 15767 return new Point(x[0], x[1]); 15768 } 15769 if (x === undefined || x === null) { 15770 return x; 15771 } 15772 if (typeof x === 'object' && 'x' in x && 'y' in x) { 15773 return new Point(x.x, x.y); 15774 } 15775 return new Point(x, y, round); 15776 } 15777 15778 /* 15779 * @class Bounds 15780 * @aka L.Bounds 15781 * 15782 * Represents a rectangular area in pixel coordinates. 15783 * 15784 * @example 15785 * 15786 * ```js 15787 * var p1 = L.point(10, 10), 15788 * p2 = L.point(40, 60), 15789 * bounds = L.bounds(p1, p2); 15790 * ``` 15791 * 15792 * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: 15793 * 15794 * ```js 15795 * otherBounds.intersects([[10, 10], [40, 60]]); 15796 * ``` 15797 * 15798 * Note that `Bounds` does not inherit from Leaflet's `Class` object, 15799 * which means new classes can't inherit from it, and new methods 15800 * can't be added to it with the `include` function. 15801 */ 15802 15803 function Bounds(a, b) { 15804 if (!a) { return; } 15805 15806 var points = b ? [a, b] : a; 15807 15808 for (var i = 0, len = points.length; i < len; i++) { 15809 this.extend(points[i]); 15810 } 15811 } 15812 15813 Bounds.prototype = { 15814 // @method extend(point: Point): this 15815 // Extends the bounds to contain the given point. 15816 15817 // @alternative 15818 // @method extend(otherBounds: Bounds): this 15819 // Extend the bounds to contain the given bounds 15820 extend: function (obj) { 15821 var min2, max2; 15822 if (!obj) { return this; } 15823 15824 if (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) { 15825 min2 = max2 = toPoint(obj); 15826 } else { 15827 obj = toBounds(obj); 15828 min2 = obj.min; 15829 max2 = obj.max; 15830 15831 if (!min2 || !max2) { return this; } 15832 } 15833 15834 // @property min: Point 15835 // The top left corner of the rectangle. 15836 // @property max: Point 15837 // The bottom right corner of the rectangle. 15838 if (!this.min && !this.max) { 15839 this.min = min2.clone(); 15840 this.max = max2.clone(); 15841 } else { 15842 this.min.x = Math.min(min2.x, this.min.x); 15843 this.max.x = Math.max(max2.x, this.max.x); 15844 this.min.y = Math.min(min2.y, this.min.y); 15845 this.max.y = Math.max(max2.y, this.max.y); 15846 } 15847 return this; 15848 }, 15849 15850 // @method getCenter(round?: Boolean): Point 15851 // Returns the center point of the bounds. 15852 getCenter: function (round) { 15853 return toPoint( 15854 (this.min.x + this.max.x) / 2, 15855 (this.min.y + this.max.y) / 2, round); 15856 }, 15857 15858 // @method getBottomLeft(): Point 15859 // Returns the bottom-left point of the bounds. 15860 getBottomLeft: function () { 15861 return toPoint(this.min.x, this.max.y); 15862 }, 15863 15864 // @method getTopRight(): Point 15865 // Returns the top-right point of the bounds. 15866 getTopRight: function () { // -> Point 15867 return toPoint(this.max.x, this.min.y); 15868 }, 15869 15870 // @method getTopLeft(): Point 15871 // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)). 15872 getTopLeft: function () { 15873 return this.min; // left, top 15874 }, 15875 15876 // @method getBottomRight(): Point 15877 // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)). 15878 getBottomRight: function () { 15879 return this.max; // right, bottom 15880 }, 15881 15882 // @method getSize(): Point 15883 // Returns the size of the given bounds 15884 getSize: function () { 15885 return this.max.subtract(this.min); 15886 }, 15887 15888 // @method contains(otherBounds: Bounds): Boolean 15889 // Returns `true` if the rectangle contains the given one. 15890 // @alternative 15891 // @method contains(point: Point): Boolean 15892 // Returns `true` if the rectangle contains the given point. 15893 contains: function (obj) { 15894 var min, max; 15895 15896 if (typeof obj[0] === 'number' || obj instanceof Point) { 15897 obj = toPoint(obj); 15898 } else { 15899 obj = toBounds(obj); 15900 } 15901 15902 if (obj instanceof Bounds) { 15903 min = obj.min; 15904 max = obj.max; 15905 } else { 15906 min = max = obj; 15907 } 15908 15909 return (min.x >= this.min.x) && 15910 (max.x <= this.max.x) && 15911 (min.y >= this.min.y) && 15912 (max.y <= this.max.y); 15913 }, 15914 15915 // @method intersects(otherBounds: Bounds): Boolean 15916 // Returns `true` if the rectangle intersects the given bounds. Two bounds 15917 // intersect if they have at least one point in common. 15918 intersects: function (bounds) { // (Bounds) -> Boolean 15919 bounds = toBounds(bounds); 15920 15921 var min = this.min, 15922 max = this.max, 15923 min2 = bounds.min, 15924 max2 = bounds.max, 15925 xIntersects = (max2.x >= min.x) && (min2.x <= max.x), 15926 yIntersects = (max2.y >= min.y) && (min2.y <= max.y); 15927 15928 return xIntersects && yIntersects; 15929 }, 15930 15931 // @method overlaps(otherBounds: Bounds): Boolean 15932 // Returns `true` if the rectangle overlaps the given bounds. Two bounds 15933 // overlap if their intersection is an area. 15934 overlaps: function (bounds) { // (Bounds) -> Boolean 15935 bounds = toBounds(bounds); 15936 15937 var min = this.min, 15938 max = this.max, 15939 min2 = bounds.min, 15940 max2 = bounds.max, 15941 xOverlaps = (max2.x > min.x) && (min2.x < max.x), 15942 yOverlaps = (max2.y > min.y) && (min2.y < max.y); 15943 15944 return xOverlaps && yOverlaps; 15945 }, 15946 15947 // @method isValid(): Boolean 15948 // Returns `true` if the bounds are properly initialized. 15949 isValid: function () { 15950 return !!(this.min && this.max); 15951 }, 15952 15953 15954 // @method pad(bufferRatio: Number): Bounds 15955 // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. 15956 // For example, a ratio of 0.5 extends the bounds by 50% in each direction. 15957 // Negative values will retract the bounds. 15958 pad: function (bufferRatio) { 15959 var min = this.min, 15960 max = this.max, 15961 heightBuffer = Math.abs(min.x - max.x) * bufferRatio, 15962 widthBuffer = Math.abs(min.y - max.y) * bufferRatio; 15963 15964 15965 return toBounds( 15966 toPoint(min.x - heightBuffer, min.y - widthBuffer), 15967 toPoint(max.x + heightBuffer, max.y + widthBuffer)); 15968 }, 15969 15970 15971 // @method equals(otherBounds: Bounds): Boolean 15972 // Returns `true` if the rectangle is equivalent to the given bounds. 15973 equals: function (bounds) { 15974 if (!bounds) { return false; } 15975 15976 bounds = toBounds(bounds); 15977 15978 return this.min.equals(bounds.getTopLeft()) && 15979 this.max.equals(bounds.getBottomRight()); 15980 }, 15981 }; 15982 15983 15984 // @factory L.bounds(corner1: Point, corner2: Point) 15985 // Creates a Bounds object from two corners coordinate pairs. 15986 // @alternative 15987 // @factory L.bounds(points: Point[]) 15988 // Creates a Bounds object from the given array of points. 15989 function toBounds(a, b) { 15990 if (!a || a instanceof Bounds) { 15991 return a; 15992 } 15993 return new Bounds(a, b); 15994 } 15995 15996 /* 15997 * @class LatLngBounds 15998 * @aka L.LatLngBounds 15999 * 16000 * Represents a rectangular geographical area on a map. 16001 * 16002 * @example 16003 * 16004 * ```js 16005 * var corner1 = L.latLng(40.712, -74.227), 16006 * corner2 = L.latLng(40.774, -74.125), 16007 * bounds = L.latLngBounds(corner1, corner2); 16008 * ``` 16009 * 16010 * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: 16011 * 16012 * ```js 16013 * map.fitBounds([ 16014 * [40.712, -74.227], 16015 * [40.774, -74.125] 16016 * ]); 16017 * ``` 16018 * 16019 * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range. 16020 * 16021 * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object, 16022 * which means new classes can't inherit from it, and new methods 16023 * can't be added to it with the `include` function. 16024 */ 16025 16026 function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[]) 16027 if (!corner1) { return; } 16028 16029 var latlngs = corner2 ? [corner1, corner2] : corner1; 16030 16031 for (var i = 0, len = latlngs.length; i < len; i++) { 16032 this.extend(latlngs[i]); 16033 } 16034 } 16035 16036 LatLngBounds.prototype = { 16037 16038 // @method extend(latlng: LatLng): this 16039 // Extend the bounds to contain the given point 16040 16041 // @alternative 16042 // @method extend(otherBounds: LatLngBounds): this 16043 // Extend the bounds to contain the given bounds 16044 extend: function (obj) { 16045 var sw = this._southWest, 16046 ne = this._northEast, 16047 sw2, ne2; 16048 16049 if (obj instanceof LatLng) { 16050 sw2 = obj; 16051 ne2 = obj; 16052 16053 } else if (obj instanceof LatLngBounds) { 16054 sw2 = obj._southWest; 16055 ne2 = obj._northEast; 16056 16057 if (!sw2 || !ne2) { return this; } 16058 16059 } else { 16060 return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this; 16061 } 16062 16063 if (!sw && !ne) { 16064 this._southWest = new LatLng(sw2.lat, sw2.lng); 16065 this._northEast = new LatLng(ne2.lat, ne2.lng); 16066 } else { 16067 sw.lat = Math.min(sw2.lat, sw.lat); 16068 sw.lng = Math.min(sw2.lng, sw.lng); 16069 ne.lat = Math.max(ne2.lat, ne.lat); 16070 ne.lng = Math.max(ne2.lng, ne.lng); 16071 } 16072 16073 return this; 16074 }, 16075 16076 // @method pad(bufferRatio: Number): LatLngBounds 16077 // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. 16078 // For example, a ratio of 0.5 extends the bounds by 50% in each direction. 16079 // Negative values will retract the bounds. 16080 pad: function (bufferRatio) { 16081 var sw = this._southWest, 16082 ne = this._northEast, 16083 heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio, 16084 widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio; 16085 16086 return new LatLngBounds( 16087 new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer), 16088 new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer)); 16089 }, 16090 16091 // @method getCenter(): LatLng 16092 // Returns the center point of the bounds. 16093 getCenter: function () { 16094 return new LatLng( 16095 (this._southWest.lat + this._northEast.lat) / 2, 16096 (this._southWest.lng + this._northEast.lng) / 2); 16097 }, 16098 16099 // @method getSouthWest(): LatLng 16100 // Returns the south-west point of the bounds. 16101 getSouthWest: function () { 16102 return this._southWest; 16103 }, 16104 16105 // @method getNorthEast(): LatLng 16106 // Returns the north-east point of the bounds. 16107 getNorthEast: function () { 16108 return this._northEast; 16109 }, 16110 16111 // @method getNorthWest(): LatLng 16112 // Returns the north-west point of the bounds. 16113 getNorthWest: function () { 16114 return new LatLng(this.getNorth(), this.getWest()); 16115 }, 16116 16117 // @method getSouthEast(): LatLng 16118 // Returns the south-east point of the bounds. 16119 getSouthEast: function () { 16120 return new LatLng(this.getSouth(), this.getEast()); 16121 }, 16122 16123 // @method getWest(): Number 16124 // Returns the west longitude of the bounds 16125 getWest: function () { 16126 return this._southWest.lng; 16127 }, 16128 16129 // @method getSouth(): Number 16130 // Returns the south latitude of the bounds 16131 getSouth: function () { 16132 return this._southWest.lat; 16133 }, 16134 16135 // @method getEast(): Number 16136 // Returns the east longitude of the bounds 16137 getEast: function () { 16138 return this._northEast.lng; 16139 }, 16140 16141 // @method getNorth(): Number 16142 // Returns the north latitude of the bounds 16143 getNorth: function () { 16144 return this._northEast.lat; 16145 }, 16146 16147 // @method contains(otherBounds: LatLngBounds): Boolean 16148 // Returns `true` if the rectangle contains the given one. 16149 16150 // @alternative 16151 // @method contains (latlng: LatLng): Boolean 16152 // Returns `true` if the rectangle contains the given point. 16153 contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean 16154 if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) { 16155 obj = toLatLng(obj); 16156 } else { 16157 obj = toLatLngBounds(obj); 16158 } 16159 16160 var sw = this._southWest, 16161 ne = this._northEast, 16162 sw2, ne2; 16163 16164 if (obj instanceof LatLngBounds) { 16165 sw2 = obj.getSouthWest(); 16166 ne2 = obj.getNorthEast(); 16167 } else { 16168 sw2 = ne2 = obj; 16169 } 16170 16171 return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) && 16172 (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng); 16173 }, 16174 16175 // @method intersects(otherBounds: LatLngBounds): Boolean 16176 // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common. 16177 intersects: function (bounds) { 16178 bounds = toLatLngBounds(bounds); 16179 16180 var sw = this._southWest, 16181 ne = this._northEast, 16182 sw2 = bounds.getSouthWest(), 16183 ne2 = bounds.getNorthEast(), 16184 16185 latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat), 16186 lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng); 16187 16188 return latIntersects && lngIntersects; 16189 }, 16190 16191 // @method overlaps(otherBounds: LatLngBounds): Boolean 16192 // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area. 16193 overlaps: function (bounds) { 16194 bounds = toLatLngBounds(bounds); 16195 16196 var sw = this._southWest, 16197 ne = this._northEast, 16198 sw2 = bounds.getSouthWest(), 16199 ne2 = bounds.getNorthEast(), 16200 16201 latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat), 16202 lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng); 16203 16204 return latOverlaps && lngOverlaps; 16205 }, 16206 16207 // @method toBBoxString(): String 16208 // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data. 16209 toBBoxString: function () { 16210 return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(','); 16211 }, 16212 16213 // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean 16214 // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number. 16215 equals: function (bounds, maxMargin) { 16216 if (!bounds) { return false; } 16217 16218 bounds = toLatLngBounds(bounds); 16219 16220 return this._southWest.equals(bounds.getSouthWest(), maxMargin) && 16221 this._northEast.equals(bounds.getNorthEast(), maxMargin); 16222 }, 16223 16224 // @method isValid(): Boolean 16225 // Returns `true` if the bounds are properly initialized. 16226 isValid: function () { 16227 return !!(this._southWest && this._northEast); 16228 } 16229 }; 16230 16231 // TODO International date line? 16232 16233 // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng) 16234 // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle. 16235 16236 // @alternative 16237 // @factory L.latLngBounds(latlngs: LatLng[]) 16238 // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds). 16239 function toLatLngBounds(a, b) { 16240 if (a instanceof LatLngBounds) { 16241 return a; 16242 } 16243 return new LatLngBounds(a, b); 16244 } 16245 16246 /* @class LatLng 16247 * @aka L.LatLng 16248 * 16249 * Represents a geographical point with a certain latitude and longitude. 16250 * 16251 * @example 16252 * 16253 * ``` 16254 * var latlng = L.latLng(50.5, 30.5); 16255 * ``` 16256 * 16257 * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent: 16258 * 16259 * ``` 16260 * map.panTo([50, 30]); 16261 * map.panTo({lon: 30, lat: 50}); 16262 * map.panTo({lat: 50, lng: 30}); 16263 * map.panTo(L.latLng(50, 30)); 16264 * ``` 16265 * 16266 * Note that `LatLng` does not inherit from Leaflet's `Class` object, 16267 * which means new classes can't inherit from it, and new methods 16268 * can't be added to it with the `include` function. 16269 */ 16270 16271 function LatLng(lat, lng, alt) { 16272 if (isNaN(lat) || isNaN(lng)) { 16273 throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')'); 16274 } 16275 16276 // @property lat: Number 16277 // Latitude in degrees 16278 this.lat = +lat; 16279 16280 // @property lng: Number 16281 // Longitude in degrees 16282 this.lng = +lng; 16283 16284 // @property alt: Number 16285 // Altitude in meters (optional) 16286 if (alt !== undefined) { 16287 this.alt = +alt; 16288 } 16289 } 16290 16291 LatLng.prototype = { 16292 // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean 16293 // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number. 16294 equals: function (obj, maxMargin) { 16295 if (!obj) { return false; } 16296 16297 obj = toLatLng(obj); 16298 16299 var margin = Math.max( 16300 Math.abs(this.lat - obj.lat), 16301 Math.abs(this.lng - obj.lng)); 16302 16303 return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin); 16304 }, 16305 16306 // @method toString(): String 16307 // Returns a string representation of the point (for debugging purposes). 16308 toString: function (precision) { 16309 return 'LatLng(' + 16310 formatNum(this.lat, precision) + ', ' + 16311 formatNum(this.lng, precision) + ')'; 16312 }, 16313 16314 // @method distanceTo(otherLatLng: LatLng): Number 16315 // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines). 16316 distanceTo: function (other) { 16317 return Earth.distance(this, toLatLng(other)); 16318 }, 16319 16320 // @method wrap(): LatLng 16321 // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees. 16322 wrap: function () { 16323 return Earth.wrapLatLng(this); 16324 }, 16325 16326 // @method toBounds(sizeInMeters: Number): LatLngBounds 16327 // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`. 16328 toBounds: function (sizeInMeters) { 16329 var latAccuracy = 180 * sizeInMeters / 40075017, 16330 lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat); 16331 16332 return toLatLngBounds( 16333 [this.lat - latAccuracy, this.lng - lngAccuracy], 16334 [this.lat + latAccuracy, this.lng + lngAccuracy]); 16335 }, 16336 16337 clone: function () { 16338 return new LatLng(this.lat, this.lng, this.alt); 16339 } 16340 }; 16341 16342 16343 16344 // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng 16345 // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude). 16346 16347 // @alternative 16348 // @factory L.latLng(coords: Array): LatLng 16349 // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead. 16350 16351 // @alternative 16352 // @factory L.latLng(coords: Object): LatLng 16353 // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead. 16354 16355 function toLatLng(a, b, c) { 16356 if (a instanceof LatLng) { 16357 return a; 16358 } 16359 if (isArray(a) && typeof a[0] !== 'object') { 16360 if (a.length === 3) { 16361 return new LatLng(a[0], a[1], a[2]); 16362 } 16363 if (a.length === 2) { 16364 return new LatLng(a[0], a[1]); 16365 } 16366 return null; 16367 } 16368 if (a === undefined || a === null) { 16369 return a; 16370 } 16371 if (typeof a === 'object' && 'lat' in a) { 16372 return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt); 16373 } 16374 if (b === undefined) { 16375 return null; 16376 } 16377 return new LatLng(a, b, c); 16378 } 16379 16380 /* 16381 * @namespace CRS 16382 * @crs L.CRS.Base 16383 * Object that defines coordinate reference systems for projecting 16384 * geographical points into pixel (screen) coordinates and back (and to 16385 * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See 16386 * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system). 16387 * 16388 * Leaflet defines the most usual CRSs by default. If you want to use a 16389 * CRS not defined by default, take a look at the 16390 * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. 16391 * 16392 * Note that the CRS instances do not inherit from Leaflet's `Class` object, 16393 * and can't be instantiated. Also, new classes can't inherit from them, 16394 * and methods can't be added to them with the `include` function. 16395 */ 16396 16397 var CRS = { 16398 // @method latLngToPoint(latlng: LatLng, zoom: Number): Point 16399 // Projects geographical coordinates into pixel coordinates for a given zoom. 16400 latLngToPoint: function (latlng, zoom) { 16401 var projectedPoint = this.projection.project(latlng), 16402 scale = this.scale(zoom); 16403 16404 return this.transformation._transform(projectedPoint, scale); 16405 }, 16406 16407 // @method pointToLatLng(point: Point, zoom: Number): LatLng 16408 // The inverse of `latLngToPoint`. Projects pixel coordinates on a given 16409 // zoom into geographical coordinates. 16410 pointToLatLng: function (point, zoom) { 16411 var scale = this.scale(zoom), 16412 untransformedPoint = this.transformation.untransform(point, scale); 16413 16414 return this.projection.unproject(untransformedPoint); 16415 }, 16416 16417 // @method project(latlng: LatLng): Point 16418 // Projects geographical coordinates into coordinates in units accepted for 16419 // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). 16420 project: function (latlng) { 16421 return this.projection.project(latlng); 16422 }, 16423 16424 // @method unproject(point: Point): LatLng 16425 // Given a projected coordinate returns the corresponding LatLng. 16426 // The inverse of `project`. 16427 unproject: function (point) { 16428 return this.projection.unproject(point); 16429 }, 16430 16431 // @method scale(zoom: Number): Number 16432 // Returns the scale used when transforming projected coordinates into 16433 // pixel coordinates for a particular zoom. For example, it returns 16434 // `256 * 2^zoom` for Mercator-based CRS. 16435 scale: function (zoom) { 16436 return 256 * Math.pow(2, zoom); 16437 }, 16438 16439 // @method zoom(scale: Number): Number 16440 // Inverse of `scale()`, returns the zoom level corresponding to a scale 16441 // factor of `scale`. 16442 zoom: function (scale) { 16443 return Math.log(scale / 256) / Math.LN2; 16444 }, 16445 16446 // @method getProjectedBounds(zoom: Number): Bounds 16447 // Returns the projection's bounds scaled and transformed for the provided `zoom`. 16448 getProjectedBounds: function (zoom) { 16449 if (this.infinite) { return null; } 16450 16451 var b = this.projection.bounds, 16452 s = this.scale(zoom), 16453 min = this.transformation.transform(b.min, s), 16454 max = this.transformation.transform(b.max, s); 16455 16456 return new Bounds(min, max); 16457 }, 16458 16459 // @method distance(latlng1: LatLng, latlng2: LatLng): Number 16460 // Returns the distance between two geographical coordinates. 16461 16462 // @property code: String 16463 // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`) 16464 // 16465 // @property wrapLng: Number[] 16466 // An array of two numbers defining whether the longitude (horizontal) coordinate 16467 // axis wraps around a given range and how. Defaults to `[-180, 180]` in most 16468 // geographical CRSs. If `undefined`, the longitude axis does not wrap around. 16469 // 16470 // @property wrapLat: Number[] 16471 // Like `wrapLng`, but for the latitude (vertical) axis. 16472 16473 // wrapLng: [min, max], 16474 // wrapLat: [min, max], 16475 16476 // @property infinite: Boolean 16477 // If true, the coordinate space will be unbounded (infinite in both axes) 16478 infinite: false, 16479 16480 // @method wrapLatLng(latlng: LatLng): LatLng 16481 // Returns a `LatLng` where lat and lng has been wrapped according to the 16482 // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds. 16483 wrapLatLng: function (latlng) { 16484 var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng, 16485 lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat, 16486 alt = latlng.alt; 16487 16488 return new LatLng(lat, lng, alt); 16489 }, 16490 16491 // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds 16492 // Returns a `LatLngBounds` with the same size as the given one, ensuring 16493 // that its center is within the CRS's bounds. 16494 // Only accepts actual `L.LatLngBounds` instances, not arrays. 16495 wrapLatLngBounds: function (bounds) { 16496 var center = bounds.getCenter(), 16497 newCenter = this.wrapLatLng(center), 16498 latShift = center.lat - newCenter.lat, 16499 lngShift = center.lng - newCenter.lng; 16500 16501 if (latShift === 0 && lngShift === 0) { 16502 return bounds; 16503 } 16504 16505 var sw = bounds.getSouthWest(), 16506 ne = bounds.getNorthEast(), 16507 newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift), 16508 newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift); 16509 16510 return new LatLngBounds(newSw, newNe); 16511 } 16512 }; 16513 16514 /* 16515 * @namespace CRS 16516 * @crs L.CRS.Earth 16517 * 16518 * Serves as the base for CRS that are global such that they cover the earth. 16519 * Can only be used as the base for other CRS and cannot be used directly, 16520 * since it does not have a `code`, `projection` or `transformation`. `distance()` returns 16521 * meters. 16522 */ 16523 16524 var Earth = extend({}, CRS, { 16525 wrapLng: [-180, 180], 16526 16527 // Mean Earth Radius, as recommended for use by 16528 // the International Union of Geodesy and Geophysics, 16529 // see https://rosettacode.org/wiki/Haversine_formula 16530 R: 6371000, 16531 16532 // distance between two geographical points using spherical law of cosines approximation 16533 distance: function (latlng1, latlng2) { 16534 var rad = Math.PI / 180, 16535 lat1 = latlng1.lat * rad, 16536 lat2 = latlng2.lat * rad, 16537 sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), 16538 sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), 16539 a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, 16540 c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); 16541 return this.R * c; 16542 } 16543 }); 16544 16545 /* 16546 * @namespace Projection 16547 * @projection L.Projection.SphericalMercator 16548 * 16549 * Spherical Mercator projection â the most common projection for online maps, 16550 * used by almost all free and commercial tile providers. Assumes that Earth is 16551 * a sphere. Used by the `EPSG:3857` CRS. 16552 */ 16553 16554 var earthRadius = 6378137; 16555 16556 var SphericalMercator = { 16557 16558 R: earthRadius, 16559 MAX_LATITUDE: 85.0511287798, 16560 16561 project: function (latlng) { 16562 var d = Math.PI / 180, 16563 max = this.MAX_LATITUDE, 16564 lat = Math.max(Math.min(max, latlng.lat), -max), 16565 sin = Math.sin(lat * d); 16566 16567 return new Point( 16568 this.R * latlng.lng * d, 16569 this.R * Math.log((1 + sin) / (1 - sin)) / 2); 16570 }, 16571 16572 unproject: function (point) { 16573 var d = 180 / Math.PI; 16574 16575 return new LatLng( 16576 (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d, 16577 point.x * d / this.R); 16578 }, 16579 16580 bounds: (function () { 16581 var d = earthRadius * Math.PI; 16582 return new Bounds([-d, -d], [d, d]); 16583 })() 16584 }; 16585 16586 /* 16587 * @class Transformation 16588 * @aka L.Transformation 16589 * 16590 * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d` 16591 * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing 16592 * the reverse. Used by Leaflet in its projections code. 16593 * 16594 * @example 16595 * 16596 * ```js 16597 * var transformation = L.transformation(2, 5, -1, 10), 16598 * p = L.point(1, 2), 16599 * p2 = transformation.transform(p), // L.point(7, 8) 16600 * p3 = transformation.untransform(p2); // L.point(1, 2) 16601 * ``` 16602 */ 16603 16604 16605 // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number) 16606 // Creates a `Transformation` object with the given coefficients. 16607 function Transformation(a, b, c, d) { 16608 if (isArray(a)) { 16609 // use array properties 16610 this._a = a[0]; 16611 this._b = a[1]; 16612 this._c = a[2]; 16613 this._d = a[3]; 16614 return; 16615 } 16616 this._a = a; 16617 this._b = b; 16618 this._c = c; 16619 this._d = d; 16620 } 16621 16622 Transformation.prototype = { 16623 // @method transform(point: Point, scale?: Number): Point 16624 // Returns a transformed point, optionally multiplied by the given scale. 16625 // Only accepts actual `L.Point` instances, not arrays. 16626 transform: function (point, scale) { // (Point, Number) -> Point 16627 return this._transform(point.clone(), scale); 16628 }, 16629 16630 // destructive transform (faster) 16631 _transform: function (point, scale) { 16632 scale = scale || 1; 16633 point.x = scale * (this._a * point.x + this._b); 16634 point.y = scale * (this._c * point.y + this._d); 16635 return point; 16636 }, 16637 16638 // @method untransform(point: Point, scale?: Number): Point 16639 // Returns the reverse transformation of the given point, optionally divided 16640 // by the given scale. Only accepts actual `L.Point` instances, not arrays. 16641 untransform: function (point, scale) { 16642 scale = scale || 1; 16643 return new Point( 16644 (point.x / scale - this._b) / this._a, 16645 (point.y / scale - this._d) / this._c); 16646 } 16647 }; 16648 16649 // factory L.transformation(a: Number, b: Number, c: Number, d: Number) 16650 16651 // @factory L.transformation(a: Number, b: Number, c: Number, d: Number) 16652 // Instantiates a Transformation object with the given coefficients. 16653 16654 // @alternative 16655 // @factory L.transformation(coefficients: Array): Transformation 16656 // Expects an coefficients array of the form 16657 // `[a: Number, b: Number, c: Number, d: Number]`. 16658 16659 function toTransformation(a, b, c, d) { 16660 return new Transformation(a, b, c, d); 16661 } 16662 16663 /* 16664 * @namespace CRS 16665 * @crs L.CRS.EPSG3857 16666 * 16667 * The most common CRS for online maps, used by almost all free and commercial 16668 * tile providers. Uses Spherical Mercator projection. Set in by default in 16669 * Map's `crs` option. 16670 */ 16671 16672 var EPSG3857 = extend({}, Earth, { 16673 code: 'EPSG:3857', 16674 projection: SphericalMercator, 16675 16676 transformation: (function () { 16677 var scale = 0.5 / (Math.PI * SphericalMercator.R); 16678 return toTransformation(scale, 0.5, -scale, 0.5); 16679 }()) 16680 }); 16681 16682 var EPSG900913 = extend({}, EPSG3857, { 16683 code: 'EPSG:900913' 16684 }); 16685 16686 // @namespace SVG; @section 16687 // There are several static functions which can be called without instantiating L.SVG: 16688 16689 // @function create(name: String): SVGElement 16690 // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement), 16691 // corresponding to the class name passed. For example, using 'line' will return 16692 // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement). 16693 function svgCreate(name) { 16694 return document.createElementNS('http://www.w3.org/2000/svg', name); 16695 } 16696 16697 // @function pointsToPath(rings: Point[], closed: Boolean): String 16698 // Generates a SVG path string for multiple rings, with each ring turning 16699 // into "M..L..L.." instructions 16700 function pointsToPath(rings, closed) { 16701 var str = '', 16702 i, j, len, len2, points, p; 16703 16704 for (i = 0, len = rings.length; i < len; i++) { 16705 points = rings[i]; 16706 16707 for (j = 0, len2 = points.length; j < len2; j++) { 16708 p = points[j]; 16709 str += (j ? 'L' : 'M') + p.x + ' ' + p.y; 16710 } 16711 16712 // closes the ring for polygons; "x" is VML syntax 16713 str += closed ? (Browser.svg ? 'z' : 'x') : ''; 16714 } 16715 16716 // SVG complains about empty path strings 16717 return str || 'M0 0'; 16718 } 16719 16720 /* 16721 * @namespace Browser 16722 * @aka L.Browser 16723 * 16724 * A namespace with static properties for browser/feature detection used by Leaflet internally. 16725 * 16726 * @example 16727 * 16728 * ```js 16729 * if (L.Browser.ielt9) { 16730 * alert('Upgrade your browser, dude!'); 16731 * } 16732 * ``` 16733 */ 16734 16735 var style = document.documentElement.style; 16736 16737 // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge). 16738 var ie = 'ActiveXObject' in window; 16739 16740 // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9. 16741 var ielt9 = ie && !document.addEventListener; 16742 16743 // @property edge: Boolean; `true` for the Edge web browser. 16744 var edge = 'msLaunchUri' in navigator && !('documentMode' in document); 16745 16746 // @property webkit: Boolean; 16747 // `true` for webkit-based browsers like Chrome and Safari (including mobile versions). 16748 var webkit = userAgentContains('webkit'); 16749 16750 // @property android: Boolean 16751 // **Deprecated.** `true` for any browser running on an Android platform. 16752 var android = userAgentContains('android'); 16753 16754 // @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3. 16755 var android23 = userAgentContains('android 2') || userAgentContains('android 3'); 16756 16757 /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */ 16758 var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit 16759 // @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome) 16760 var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window); 16761 16762 // @property opera: Boolean; `true` for the Opera browser 16763 var opera = !!window.opera; 16764 16765 // @property chrome: Boolean; `true` for the Chrome browser. 16766 var chrome = !edge && userAgentContains('chrome'); 16767 16768 // @property gecko: Boolean; `true` for gecko-based browsers like Firefox. 16769 var gecko = userAgentContains('gecko') && !webkit && !opera && !ie; 16770 16771 // @property safari: Boolean; `true` for the Safari browser. 16772 var safari = !chrome && userAgentContains('safari'); 16773 16774 var phantom = userAgentContains('phantom'); 16775 16776 // @property opera12: Boolean 16777 // `true` for the Opera browser supporting CSS transforms (version 12 or later). 16778 var opera12 = 'OTransition' in style; 16779 16780 // @property win: Boolean; `true` when the browser is running in a Windows platform 16781 var win = navigator.platform.indexOf('Win') === 0; 16782 16783 // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms. 16784 var ie3d = ie && ('transition' in style); 16785 16786 // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms. 16787 var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23; 16788 16789 // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms. 16790 var gecko3d = 'MozPerspective' in style; 16791 16792 // @property any3d: Boolean 16793 // `true` for all browsers supporting CSS transforms. 16794 var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom; 16795 16796 // @property mobile: Boolean; `true` for all browsers running in a mobile device. 16797 var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile'); 16798 16799 // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device. 16800 var mobileWebkit = mobile && webkit; 16801 16802 // @property mobileWebkit3d: Boolean 16803 // `true` for all webkit-based browsers in a mobile device supporting CSS transforms. 16804 var mobileWebkit3d = mobile && webkit3d; 16805 16806 // @property msPointer: Boolean 16807 // `true` for browsers implementing the Microsoft touch events model (notably IE10). 16808 var msPointer = !window.PointerEvent && window.MSPointerEvent; 16809 16810 // @property pointer: Boolean 16811 // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx). 16812 var pointer = !!(window.PointerEvent || msPointer); 16813 16814 // @property touchNative: Boolean 16815 // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events). 16816 // **This does not necessarily mean** that the browser is running in a computer with 16817 // a touchscreen, it only means that the browser is capable of understanding 16818 // touch events. 16819 var touchNative = 'ontouchstart' in window || !!window.TouchEvent; 16820 16821 // @property touch: Boolean 16822 // `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events. 16823 // Note: pointer events will be preferred (if available), and processed for all `touch*` listeners. 16824 var touch = !window.L_NO_TOUCH && (touchNative || pointer); 16825 16826 // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device. 16827 var mobileOpera = mobile && opera; 16828 16829 // @property mobileGecko: Boolean 16830 // `true` for gecko-based browsers running in a mobile device. 16831 var mobileGecko = mobile && gecko; 16832 16833 // @property retina: Boolean 16834 // `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%. 16835 var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1; 16836 16837 // @property passiveEvents: Boolean 16838 // `true` for browsers that support passive events. 16839 var passiveEvents = (function () { 16840 var supportsPassiveOption = false; 16841 try { 16842 var opts = Object.defineProperty({}, 'passive', { 16843 get: function () { // eslint-disable-line getter-return 16844 supportsPassiveOption = true; 16845 } 16846 }); 16847 window.addEventListener('testPassiveEventSupport', falseFn, opts); 16848 window.removeEventListener('testPassiveEventSupport', falseFn, opts); 16849 } catch (e) { 16850 // Errors can safely be ignored since this is only a browser support test. 16851 } 16852 return supportsPassiveOption; 16853 }()); 16854 16855 // @property canvas: Boolean 16856 // `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API). 16857 var canvas$1 = (function () { 16858 return !!document.createElement('canvas').getContext; 16859 }()); 16860 16861 // @property svg: Boolean 16862 // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG). 16863 var svg$1 = !!(document.createElementNS && svgCreate('svg').createSVGRect); 16864 16865 var inlineSvg = !!svg$1 && (function () { 16866 var div = document.createElement('div'); 16867 div.innerHTML = '<svg/>'; 16868 return (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg'; 16869 })(); 16870 16871 // @property vml: Boolean 16872 // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language). 16873 var vml = !svg$1 && (function () { 16874 try { 16875 var div = document.createElement('div'); 16876 div.innerHTML = '<v:shape adj="1"/>'; 16877 16878 var shape = div.firstChild; 16879 shape.style.behavior = 'url(#default#VML)'; 16880 16881 return shape && (typeof shape.adj === 'object'); 16882 16883 } catch (e) { 16884 return false; 16885 } 16886 }()); 16887 16888 16889 // @property mac: Boolean; `true` when the browser is running in a Mac platform 16890 var mac = navigator.platform.indexOf('Mac') === 0; 16891 16892 // @property mac: Boolean; `true` when the browser is running in a Linux platform 16893 var linux = navigator.platform.indexOf('Linux') === 0; 16894 16895 function userAgentContains(str) { 16896 return navigator.userAgent.toLowerCase().indexOf(str) >= 0; 16897 } 16898 16899 16900 var Browser = { 16901 ie: ie, 16902 ielt9: ielt9, 16903 edge: edge, 16904 webkit: webkit, 16905 android: android, 16906 android23: android23, 16907 androidStock: androidStock, 16908 opera: opera, 16909 chrome: chrome, 16910 gecko: gecko, 16911 safari: safari, 16912 phantom: phantom, 16913 opera12: opera12, 16914 win: win, 16915 ie3d: ie3d, 16916 webkit3d: webkit3d, 16917 gecko3d: gecko3d, 16918 any3d: any3d, 16919 mobile: mobile, 16920 mobileWebkit: mobileWebkit, 16921 mobileWebkit3d: mobileWebkit3d, 16922 msPointer: msPointer, 16923 pointer: pointer, 16924 touch: touch, 16925 touchNative: touchNative, 16926 mobileOpera: mobileOpera, 16927 mobileGecko: mobileGecko, 16928 retina: retina, 16929 passiveEvents: passiveEvents, 16930 canvas: canvas$1, 16931 svg: svg$1, 16932 vml: vml, 16933 inlineSvg: inlineSvg, 16934 mac: mac, 16935 linux: linux 16936 }; 16937 16938 /* 16939 * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. 16940 */ 16941 16942 var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown'; 16943 var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove'; 16944 var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup'; 16945 var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel'; 16946 var pEvent = { 16947 touchstart : POINTER_DOWN, 16948 touchmove : POINTER_MOVE, 16949 touchend : POINTER_UP, 16950 touchcancel : POINTER_CANCEL 16951 }; 16952 var handle = { 16953 touchstart : _onPointerStart, 16954 touchmove : _handlePointer, 16955 touchend : _handlePointer, 16956 touchcancel : _handlePointer 16957 }; 16958 var _pointers = {}; 16959 var _pointerDocListener = false; 16960 16961 // Provides a touch events wrapper for (ms)pointer events. 16962 // ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890 16963 16964 function addPointerListener(obj, type, handler) { 16965 if (type === 'touchstart') { 16966 _addPointerDocListener(); 16967 } 16968 if (!handle[type]) { 16969 console.warn('wrong event specified:', type); 16970 return falseFn; 16971 } 16972 handler = handle[type].bind(this, handler); 16973 obj.addEventListener(pEvent[type], handler, false); 16974 return handler; 16975 } 16976 16977 function removePointerListener(obj, type, handler) { 16978 if (!pEvent[type]) { 16979 console.warn('wrong event specified:', type); 16980 return; 16981 } 16982 obj.removeEventListener(pEvent[type], handler, false); 16983 } 16984 16985 function _globalPointerDown(e) { 16986 _pointers[e.pointerId] = e; 16987 } 16988 16989 function _globalPointerMove(e) { 16990 if (_pointers[e.pointerId]) { 16991 _pointers[e.pointerId] = e; 16992 } 16993 } 16994 16995 function _globalPointerUp(e) { 16996 delete _pointers[e.pointerId]; 16997 } 16998 16999 function _addPointerDocListener() { 17000 // need to keep track of what pointers and how many are active to provide e.touches emulation 17001 if (!_pointerDocListener) { 17002 // we listen document as any drags that end by moving the touch off the screen get fired there 17003 document.addEventListener(POINTER_DOWN, _globalPointerDown, true); 17004 document.addEventListener(POINTER_MOVE, _globalPointerMove, true); 17005 document.addEventListener(POINTER_UP, _globalPointerUp, true); 17006 document.addEventListener(POINTER_CANCEL, _globalPointerUp, true); 17007 17008 _pointerDocListener = true; 17009 } 17010 } 17011 17012 function _handlePointer(handler, e) { 17013 if (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; } 17014 17015 e.touches = []; 17016 for (var i in _pointers) { 17017 e.touches.push(_pointers[i]); 17018 } 17019 e.changedTouches = [e]; 17020 17021 handler(e); 17022 } 17023 17024 function _onPointerStart(handler, e) { 17025 // IE10 specific: MsTouch needs preventDefault. See #2000 17026 if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) { 17027 preventDefault(e); 17028 } 17029 _handlePointer(handler, e); 17030 } 17031 17032 /* 17033 * Extends the event handling code with double tap support for mobile browsers. 17034 * 17035 * Note: currently most browsers fire native dblclick, with only a few exceptions 17036 * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386) 17037 */ 17038 17039 function makeDblclick(event) { 17040 // in modern browsers `type` cannot be just overridden: 17041 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only 17042 var newEvent = {}, 17043 prop, i; 17044 for (i in event) { 17045 prop = event[i]; 17046 newEvent[i] = prop && prop.bind ? prop.bind(event) : prop; 17047 } 17048 event = newEvent; 17049 newEvent.type = 'dblclick'; 17050 newEvent.detail = 2; 17051 newEvent.isTrusted = false; 17052 newEvent._simulated = true; // for debug purposes 17053 return newEvent; 17054 } 17055 17056 var delay = 200; 17057 function addDoubleTapListener(obj, handler) { 17058 // Most browsers handle double tap natively 17059 obj.addEventListener('dblclick', handler); 17060 17061 // On some platforms the browser doesn't fire native dblclicks for touch events. 17062 // It seems that in all such cases `detail` property of `click` event is always `1`. 17063 // So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed. 17064 var last = 0, 17065 detail; 17066 function simDblclick(e) { 17067 if (e.detail !== 1) { 17068 detail = e.detail; // keep in sync to avoid false dblclick in some cases 17069 return; 17070 } 17071 17072 if (e.pointerType === 'mouse' || 17073 (e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) { 17074 17075 return; 17076 } 17077 17078 // When clicking on an <input>, the browser generates a click on its 17079 // <label> (and vice versa) triggering two clicks in quick succession. 17080 // This ignores clicks on elements which are a label with a 'for' 17081 // attribute (or children of such a label), but not children of 17082 // a <input>. 17083 var path = getPropagationPath(e); 17084 if (path.some(function (el) { 17085 return el instanceof HTMLLabelElement && el.attributes.for; 17086 }) && 17087 !path.some(function (el) { 17088 return ( 17089 el instanceof HTMLInputElement || 17090 el instanceof HTMLSelectElement 17091 ); 17092 }) 17093 ) { 17094 return; 17095 } 17096 17097 var now = Date.now(); 17098 if (now - last <= delay) { 17099 detail++; 17100 if (detail === 2) { 17101 handler(makeDblclick(e)); 17102 } 17103 } else { 17104 detail = 1; 17105 } 17106 last = now; 17107 } 17108 17109 obj.addEventListener('click', simDblclick); 17110 17111 return { 17112 dblclick: handler, 17113 simDblclick: simDblclick 17114 }; 17115 } 17116 17117 function removeDoubleTapListener(obj, handlers) { 17118 obj.removeEventListener('dblclick', handlers.dblclick); 17119 obj.removeEventListener('click', handlers.simDblclick); 17120 } 17121 17122 /* 17123 * @namespace DomUtil 17124 * 17125 * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model) 17126 * tree, used by Leaflet internally. 17127 * 17128 * Most functions expecting or returning a `HTMLElement` also work for 17129 * SVG elements. The only difference is that classes refer to CSS classes 17130 * in HTML and SVG classes in SVG. 17131 */ 17132 17133 17134 // @property TRANSFORM: String 17135 // Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit). 17136 var TRANSFORM = testProp( 17137 ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']); 17138 17139 // webkitTransition comes first because some browser versions that drop vendor prefix don't do 17140 // the same for the transitionend event, in particular the Android 4.1 stock browser 17141 17142 // @property TRANSITION: String 17143 // Vendor-prefixed transition style name. 17144 var TRANSITION = testProp( 17145 ['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']); 17146 17147 // @property TRANSITION_END: String 17148 // Vendor-prefixed transitionend event name. 17149 var TRANSITION_END = 17150 TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend'; 17151 17152 17153 // @function get(id: String|HTMLElement): HTMLElement 17154 // Returns an element given its DOM id, or returns the element itself 17155 // if it was passed directly. 17156 function get(id) { 17157 return typeof id === 'string' ? document.getElementById(id) : id; 17158 } 17159 17160 // @function getStyle(el: HTMLElement, styleAttrib: String): String 17161 // Returns the value for a certain style attribute on an element, 17162 // including computed values or values set through CSS. 17163 function getStyle(el, style) { 17164 var value = el.style[style] || (el.currentStyle && el.currentStyle[style]); 17165 17166 if ((!value || value === 'auto') && document.defaultView) { 17167 var css = document.defaultView.getComputedStyle(el, null); 17168 value = css ? css[style] : null; 17169 } 17170 return value === 'auto' ? null : value; 17171 } 17172 17173 // @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement 17174 // Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element. 17175 function create$1(tagName, className, container) { 17176 var el = document.createElement(tagName); 17177 el.className = className || ''; 17178 17179 if (container) { 17180 container.appendChild(el); 17181 } 17182 return el; 17183 } 17184 17185 // @function remove(el: HTMLElement) 17186 // Removes `el` from its parent element 17187 function remove(el) { 17188 var parent = el.parentNode; 17189 if (parent) { 17190 parent.removeChild(el); 17191 } 17192 } 17193 17194 // @function empty(el: HTMLElement) 17195 // Removes all of `el`'s children elements from `el` 17196 function empty(el) { 17197 while (el.firstChild) { 17198 el.removeChild(el.firstChild); 17199 } 17200 } 17201 17202 // @function toFront(el: HTMLElement) 17203 // Makes `el` the last child of its parent, so it renders in front of the other children. 17204 function toFront(el) { 17205 var parent = el.parentNode; 17206 if (parent && parent.lastChild !== el) { 17207 parent.appendChild(el); 17208 } 17209 } 17210 17211 // @function toBack(el: HTMLElement) 17212 // Makes `el` the first child of its parent, so it renders behind the other children. 17213 function toBack(el) { 17214 var parent = el.parentNode; 17215 if (parent && parent.firstChild !== el) { 17216 parent.insertBefore(el, parent.firstChild); 17217 } 17218 } 17219 17220 // @function hasClass(el: HTMLElement, name: String): Boolean 17221 // Returns `true` if the element's class attribute contains `name`. 17222 function hasClass(el, name) { 17223 if (el.classList !== undefined) { 17224 return el.classList.contains(name); 17225 } 17226 var className = getClass(el); 17227 return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className); 17228 } 17229 17230 // @function addClass(el: HTMLElement, name: String) 17231 // Adds `name` to the element's class attribute. 17232 function addClass(el, name) { 17233 if (el.classList !== undefined) { 17234 var classes = splitWords(name); 17235 for (var i = 0, len = classes.length; i < len; i++) { 17236 el.classList.add(classes[i]); 17237 } 17238 } else if (!hasClass(el, name)) { 17239 var className = getClass(el); 17240 setClass(el, (className ? className + ' ' : '') + name); 17241 } 17242 } 17243 17244 // @function removeClass(el: HTMLElement, name: String) 17245 // Removes `name` from the element's class attribute. 17246 function removeClass(el, name) { 17247 if (el.classList !== undefined) { 17248 el.classList.remove(name); 17249 } else { 17250 setClass(el, trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' '))); 17251 } 17252 } 17253 17254 // @function setClass(el: HTMLElement, name: String) 17255 // Sets the element's class. 17256 function setClass(el, name) { 17257 if (el.className.baseVal === undefined) { 17258 el.className = name; 17259 } else { 17260 // in case of SVG element 17261 el.className.baseVal = name; 17262 } 17263 } 17264 17265 // @function getClass(el: HTMLElement): String 17266 // Returns the element's class. 17267 function getClass(el) { 17268 // Check if the element is an SVGElementInstance and use the correspondingElement instead 17269 // (Required for linked SVG elements in IE11.) 17270 if (el.correspondingElement) { 17271 el = el.correspondingElement; 17272 } 17273 return el.className.baseVal === undefined ? el.className : el.className.baseVal; 17274 } 17275 17276 // @function setOpacity(el: HTMLElement, opacity: Number) 17277 // Set the opacity of an element (including old IE support). 17278 // `opacity` must be a number from `0` to `1`. 17279 function setOpacity(el, value) { 17280 if ('opacity' in el.style) { 17281 el.style.opacity = value; 17282 } else if ('filter' in el.style) { 17283 _setOpacityIE(el, value); 17284 } 17285 } 17286 17287 function _setOpacityIE(el, value) { 17288 var filter = false, 17289 filterName = 'DXImageTransform.Microsoft.Alpha'; 17290 17291 // filters collection throws an error if we try to retrieve a filter that doesn't exist 17292 try { 17293 filter = el.filters.item(filterName); 17294 } catch (e) { 17295 // don't set opacity to 1 if we haven't already set an opacity, 17296 // it isn't needed and breaks transparent pngs. 17297 if (value === 1) { return; } 17298 } 17299 17300 value = Math.round(value * 100); 17301 17302 if (filter) { 17303 filter.Enabled = (value !== 100); 17304 filter.Opacity = value; 17305 } else { 17306 el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')'; 17307 } 17308 } 17309 17310 // @function testProp(props: String[]): String|false 17311 // Goes through the array of style names and returns the first name 17312 // that is a valid style name for an element. If no such name is found, 17313 // it returns false. Useful for vendor-prefixed styles like `transform`. 17314 function testProp(props) { 17315 var style = document.documentElement.style; 17316 17317 for (var i = 0; i < props.length; i++) { 17318 if (props[i] in style) { 17319 return props[i]; 17320 } 17321 } 17322 return false; 17323 } 17324 17325 // @function setTransform(el: HTMLElement, offset: Point, scale?: Number) 17326 // Resets the 3D CSS transform of `el` so it is translated by `offset` pixels 17327 // and optionally scaled by `scale`. Does not have an effect if the 17328 // browser doesn't support 3D CSS transforms. 17329 function setTransform(el, offset, scale) { 17330 var pos = offset || new Point(0, 0); 17331 17332 el.style[TRANSFORM] = 17333 (Browser.ie3d ? 17334 'translate(' + pos.x + 'px,' + pos.y + 'px)' : 17335 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') + 17336 (scale ? ' scale(' + scale + ')' : ''); 17337 } 17338 17339 // @function setPosition(el: HTMLElement, position: Point) 17340 // Sets the position of `el` to coordinates specified by `position`, 17341 // using CSS translate or top/left positioning depending on the browser 17342 // (used by Leaflet internally to position its layers). 17343 function setPosition(el, point) { 17344 17345 /*eslint-disable */ 17346 el._leaflet_pos = point; 17347 /* eslint-enable */ 17348 17349 if (Browser.any3d) { 17350 setTransform(el, point); 17351 } else { 17352 el.style.left = point.x + 'px'; 17353 el.style.top = point.y + 'px'; 17354 } 17355 } 17356 17357 // @function getPosition(el: HTMLElement): Point 17358 // Returns the coordinates of an element previously positioned with setPosition. 17359 function getPosition(el) { 17360 // this method is only used for elements previously positioned using setPosition, 17361 // so it's safe to cache the position for performance 17362 17363 return el._leaflet_pos || new Point(0, 0); 17364 } 17365 17366 // @function disableTextSelection() 17367 // Prevents the user from generating `selectstart` DOM events, usually generated 17368 // when the user drags the mouse through a page with text. Used internally 17369 // by Leaflet to override the behaviour of any click-and-drag interaction on 17370 // the map. Affects drag interactions on the whole document. 17371 17372 // @function enableTextSelection() 17373 // Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection). 17374 var disableTextSelection; 17375 var enableTextSelection; 17376 var _userSelect; 17377 if ('onselectstart' in document) { 17378 disableTextSelection = function () { 17379 on(window, 'selectstart', preventDefault); 17380 }; 17381 enableTextSelection = function () { 17382 off(window, 'selectstart', preventDefault); 17383 }; 17384 } else { 17385 var userSelectProperty = testProp( 17386 ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']); 17387 17388 disableTextSelection = function () { 17389 if (userSelectProperty) { 17390 var style = document.documentElement.style; 17391 _userSelect = style[userSelectProperty]; 17392 style[userSelectProperty] = 'none'; 17393 } 17394 }; 17395 enableTextSelection = function () { 17396 if (userSelectProperty) { 17397 document.documentElement.style[userSelectProperty] = _userSelect; 17398 _userSelect = undefined; 17399 } 17400 }; 17401 } 17402 17403 // @function disableImageDrag() 17404 // As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but 17405 // for `dragstart` DOM events, usually generated when the user drags an image. 17406 function disableImageDrag() { 17407 on(window, 'dragstart', preventDefault); 17408 } 17409 17410 // @function enableImageDrag() 17411 // Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection). 17412 function enableImageDrag() { 17413 off(window, 'dragstart', preventDefault); 17414 } 17415 17416 var _outlineElement, _outlineStyle; 17417 // @function preventOutline(el: HTMLElement) 17418 // Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline) 17419 // of the element `el` invisible. Used internally by Leaflet to prevent 17420 // focusable elements from displaying an outline when the user performs a 17421 // drag interaction on them. 17422 function preventOutline(element) { 17423 while (element.tabIndex === -1) { 17424 element = element.parentNode; 17425 } 17426 if (!element.style) { return; } 17427 restoreOutline(); 17428 _outlineElement = element; 17429 _outlineStyle = element.style.outline
17429; 17430 element.style.outline = 'none'; 17431 on(window, 'keydown', restoreOutline); 17432 } 17433 17434 // @function restoreOutline() 17435 // Cancels the effects of a previous [`L.DomUtil.preventOutline`](). 17436 function restoreOutline() { 17437 if (!_outlineElement) { return; } 17438 _outlineElement.style.outlin
vendor: 91,919 bytes, lines 17438-20189
17438e = _outlineStyle; 17439 _outlineElement = undefined; 17440 _outlineStyle = undefined; 17441 off(window, 'keydown', restoreOutline); 17442 } 17443 17444 // @function getSizedParentNode(el: HTMLElement): HTMLElement 17445 // Finds the closest parent node which size (width and height) is not null. 17446 function getSizedParentNode(element) { 17447 do { 17448 element = element.parentNode; 17449 } while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body); 17450 return element; 17451 } 17452 17453 // @function getScale(el: HTMLElement): Object 17454 // Computes the CSS scale currently applied on the element. 17455 // Returns an object with `x` and `y` members as horizontal and vertical scales respectively, 17456 // and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). 17457 function getScale(element) { 17458 var rect = element.getBoundingClientRect(); // Read-only in old browsers. 17459 17460 return { 17461 x: rect.width / element.offsetWidth || 1, 17462 y: rect.height / element.offsetHeight || 1, 17463 boundingClientRect: rect 17464 }; 17465 } 17466 17467 var DomUtil = { 17468 __proto__: null, 17469 TRANSFORM: TRANSFORM, 17470 TRANSITION: TRANSITION, 17471 TRANSITION_END: TRANSITION_END, 17472 get: get, 17473 getStyle: getStyle, 17474 create: create$1, 17475 remove: remove, 17476 empty: empty, 17477 toFront: toFront, 17478 toBack: toBack, 17479 hasClass: hasClass, 17480 addClass: addClass, 17481 removeClass: removeClass, 17482 setClass: setClass, 17483 getClass: getClass, 17484 setOpacity: setOpacity, 17485 testProp: testProp, 17486 setTransform: setTransform, 17487 setPosition: setPosition, 17488 getPosition: getPosition, 17489 get disableTextSelection () { return disableTextSelection; }, 17490 get enableTextSelection () { return enableTextSelection; }, 17491 disableImageDrag: disableImageDrag, 17492 enableImageDrag: enableImageDrag, 17493 preventOutline: preventOutline, 17494 restoreOutline: restoreOutline, 17495 getSizedParentNode: getSizedParentNode, 17496 getScale: getScale 17497 }; 17498 17499 /* 17500 * @namespace DomEvent 17501 * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally. 17502 */ 17503 17504 // Inspired by John Resig, Dean Edwards and YUI addEvent implementations. 17505 17506 // @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this 17507 // Adds a listener function (`fn`) to a particular DOM event type of the 17508 // element `el`. You can optionally specify the context of the listener 17509 // (object the `this` keyword will point to). You can also pass several 17510 // space-separated types (e.g. `'click dblclick'`). 17511 17512 // @alternative 17513 // @function on(el: HTMLElement, eventMap: Object, context?: Object): this 17514 // Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` 17515 function on(obj, types, fn, context) { 17516 17517 if (types && typeof types === 'object') { 17518 for (var type in types) { 17519 addOne(obj, type, types[type], fn); 17520 } 17521 } else { 17522 types = splitWords(types); 17523 17524 for (var i = 0, len = types.length; i < len; i++) { 17525 addOne(obj, types[i], fn, context); 17526 } 17527 } 17528 17529 return this; 17530 } 17531 17532 var eventsKey = '_leaflet_events'; 17533 17534 // @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this 17535 // Removes a previously added listener function. 17536 // Note that if you passed a custom context to on, you must pass the same 17537 // context to `off` in order to remove the listener. 17538 17539 // @alternative 17540 // @function off(el: HTMLElement, eventMap: Object, context?: Object): this 17541 // Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` 17542 17543 // @alternative 17544 // @function off(el: HTMLElement, types: String): this 17545 // Removes all previously added listeners of given types. 17546 17547 // @alternative 17548 // @function off(el: HTMLElement): this 17549 // Removes all previously added listeners from given HTMLElement 17550 function off(obj, types, fn, context) { 17551 17552 if (arguments.length === 1) { 17553 batchRemove(obj); 17554 delete obj[eventsKey]; 17555 17556 } else if (types && typeof types === 'object') { 17557 for (var type in types) { 17558 removeOne(obj, type, types[type], fn); 17559 } 17560 17561 } else { 17562 types = splitWords(types); 17563 17564 if (arguments.length === 2) { 17565 batchRemove(obj, function (type) { 17566 return indexOf(types, type) !== -1; 17567 }); 17568 } else { 17569 for (var i = 0, len = types.length; i < len; i++) { 17570 removeOne(obj, types[i], fn, context); 17571 } 17572 } 17573 } 17574 17575 return this; 17576 } 17577 17578 function batchRemove(obj, filterFn) { 17579 for (var id in obj[eventsKey]) { 17580 var type = id.split(/\d/)[0]; 17581 if (!filterFn || filterFn(type)) { 17582 removeOne(obj, type, null, null, id); 17583 } 17584 } 17585 } 17586 17587 var mouseSubst = { 17588 mouseenter: 'mouseover', 17589 mouseleave: 'mouseout', 17590 wheel: !('onwheel' in window) && 'mousewheel' 17591 }; 17592 17593 function addOne(obj, type, fn, context) { 17594 var id = type + stamp(fn) + (context ? '_' + stamp(context) : ''); 17595 17596 if (obj[eventsKey] && obj[eventsKey][id]) { return this; } 17597 17598 var handler = function (e) { 17599 return fn.call(context || obj, e || window.event); 17600 }; 17601 17602 var originalHandler = handler; 17603 17604 if (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) { 17605 // Needs DomEvent.Pointer.js 17606 handler = addPointerListener(obj, type, handler); 17607 17608 } else if (Browser.touch && (type === 'dblclick')) { 17609 handler = addDoubleTapListener(obj, handler); 17610 17611 } else if ('addEventListener' in obj) { 17612 17613 if (type === 'touchstart' || type === 'touchmove' || type === 'wheel' || type === 'mousewheel') { 17614 obj.addEventListener(mouseSubst[type] || type, handler, Browser.passiveEvents ? {passive: false} : false); 17615 17616 } else if (type === 'mouseenter' || type === 'mouseleave') { 17617 handler = function (e) { 17618 e = e || window.event; 17619 if (isExternalTarget(obj, e)) { 17620 originalHandler(e); 17621 } 17622 }; 17623 obj.addEventListener(mouseSubst[type], handler, false); 17624 17625 } else { 17626 obj.addEventListener(type, originalHandler, false); 17627 } 17628 17629 } else { 17630 obj.attachEvent('on' + type, handler); 17631 } 17632 17633 obj[eventsKey] = obj[eventsKey] || {}; 17634 obj[eventsKey][id] = handler; 17635 } 17636 17637 function removeOne(obj, type, fn, context, id) { 17638 id = id || type + stamp(fn) + (context ? '_' + stamp(context) : ''); 17639 var handler = obj[eventsKey] && obj[eventsKey][id]; 17640 17641 if (!handler) { return this; } 17642 17643 if (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) { 17644 removePointerListener(obj, type, handler); 17645 17646 } else if (Browser.touch && (type === 'dblclick')) { 17647 removeDoubleTapListener(obj, handler); 17648 17649 } else if ('removeEventListener' in obj) { 17650 17651 obj.removeEventListener(mouseSubst[type] || type, handler, false); 17652 17653 } else { 17654 obj.detachEvent('on' + type, handler); 17655 } 17656 17657 obj[eventsKey][id] = null; 17658 } 17659 17660 // @function stopPropagation(ev: DOMEvent): this 17661 // Stop the given event from propagation to parent elements. Used inside the listener functions: 17662 // ```js 17663 // L.DomEvent.on(div, 'click', function (ev) { 17664 // L.DomEvent.stopPropagation(ev); 17665 // }); 17666 // ``` 17667 function stopPropagation(e) { 17668 17669 if (e.stopPropagation) { 17670 e.stopPropagation(); 17671 } else if (e.originalEvent) { // In case of Leaflet event. 17672 e.originalEvent._stopped = true; 17673 } else { 17674 e.cancelBubble = true; 17675 } 17676 17677 return this; 17678 } 17679 17680 // @function disableScrollPropagation(el: HTMLElement): this 17681 // Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants). 17682 function disableScrollPropagation(el) { 17683 addOne(el, 'wheel', stopPropagation); 17684 return this; 17685 } 17686 17687 // @function disableClickPropagation(el: HTMLElement): this 17688 // Adds `stopPropagation` to the element's `'click'`, `'dblclick'`, `'contextmenu'`, 17689 // `'mousedown'` and `'touchstart'` events (plus browser variants). 17690 function disableClickPropagation(el) { 17691 on(el, 'mousedown touchstart dblclick contextmenu', stopPropagation); 17692 el['_leaflet_disable_click'] = true; 17693 return this; 17694 } 17695 17696 // @function preventDefault(ev: DOMEvent): this 17697 // Prevents the default action of the DOM Event `ev` from happening (such as 17698 // following a link in the href of the a element, or doing a POST request 17699 // with page reload when a `<form>` is submitted). 17700 // Use it inside listener functions. 17701 function preventDefault(e) { 17702 if (e.preventDefault) { 17703 e.preventDefault(); 17704 } else { 17705 e.returnValue = false; 17706 } 17707 return this; 17708 } 17709 17710 // @function stop(ev: DOMEvent): this 17711 // Does `stopPropagation` and `preventDefault` at the same time. 17712 function stop(e) { 17713 preventDefault(e); 17714 stopPropagation(e); 17715 return this; 17716 } 17717 17718 // @function getPropagationPath(ev: DOMEvent): Array 17719 // Compatibility polyfill for [`Event.composedPath()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath). 17720 // Returns an array containing the `HTMLElement`s that the given DOM event 17721 // should propagate to (if not stopped). 17722 function getPropagationPath(ev) { 17723 if (ev.composedPath) { 17724 return ev.composedPath(); 17725 } 17726 17727 var path = []; 17728 var el = ev.target; 17729 17730 while (el) { 17731 path.push(el); 17732 el = el.parentNode; 17733 } 17734 return path; 17735 } 17736 17737 17738 // @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point 17739 // Gets normalized mouse position from a DOM event relative to the 17740 // `container` (border excluded) or to the whole page if not specified. 17741 function getMousePosition(e, container) { 17742 if (!container) { 17743 return new Point(e.clientX, e.clientY); 17744 } 17745 17746 var scale = getScale(container), 17747 offset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y) 17748 17749 return new Point( 17750 // offset.left/top values are in page scale (like clientX/Y), 17751 // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies). 17752 (e.clientX - offset.left) / scale.x - container.clientLeft, 17753 (e.clientY - offset.top) / scale.y - container.clientTop 17754 ); 17755 } 17756 17757 17758 // except , Safari and 17759 // We need double the scroll pixels (see #7403 and #4538) for all Browsers 17760 // except OSX (Mac) -> 3x, Chrome running on Linux 1x 17761 17762 var wheelPxFactor = 17763 (Browser.linux && Browser.chrome) ? window.devicePixelRatio : 17764 Browser.mac ? window.devicePixelRatio * 3 : 17765 window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1; 17766 // @function getWheelDelta(ev: DOMEvent): Number 17767 // Gets normalized wheel delta from a wheel DOM event, in vertical 17768 // pixels scrolled (negative if scrolling down). 17769 // Events from pointing devices without precise scrolling are mapped to 17770 // a best guess of 60 pixels. 17771 function getWheelDelta(e) { 17772 return (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta 17773 (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels 17774 (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines 17775 (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages 17776 (e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events 17777 e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels 17778 (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines 17779 e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages 17780 0; 17781 } 17782 17783 // check if element really left/entered the event target (for mouseenter/mouseleave) 17784 function isExternalTarget(el, e) { 17785 17786 var related = e.relatedTarget; 17787 17788 if (!related) { return true; } 17789 17790 try { 17791 while (related && (related !== el)) { 17792 related = related.parentNode; 17793 } 17794 } catch (err) { 17795 return false; 17796 } 17797 return (related !== el); 17798 } 17799 17800 var DomEvent = { 17801 __proto__: null, 17802 on: on, 17803 off: off, 17804 stopPropagation: stopPropagation, 17805 disableScrollPropagation: disableScrollPropagation, 17806 disableClickPropagation: disableClickPropagation, 17807 preventDefault: preventDefault, 17808 stop: stop, 17809 getPropagationPath: getPropagationPath, 17810 getMousePosition: getMousePosition, 17811 getWheelDelta: getWheelDelta, 17812 isExternalTarget: isExternalTarget, 17813 addListener: on, 17814 removeListener: off 17815 }; 17816 17817 /* 17818 * @class PosAnimation 17819 * @aka L.PosAnimation 17820 * @inherits Evented 17821 * Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9. 17822 * 17823 * @example 17824 * ```js 17825 * var myPositionMarker = L.marker([48.864716, 2.294694]).addTo(map); 17826 * 17827 * myPositionMarker.on("click", function() { 17828 * var pos = map.latLngToLayerPoint(myPositionMarker.getLatLng()); 17829 * pos.y -= 25; 17830 * var fx = new L.PosAnimation(); 17831 * 17832 * fx.once('end',function() { 17833 * pos.y += 25; 17834 * fx.run(myPositionMarker._icon, pos, 0.8); 17835 * }); 17836 * 17837 * fx.run(myPositionMarker._icon, pos, 0.3); 17838 * }); 17839 * 17840 * ``` 17841 * 17842 * @constructor L.PosAnimation() 17843 * Creates a `PosAnimation` object. 17844 * 17845 */ 17846 17847 var PosAnimation = Evented.extend({ 17848 17849 // @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number) 17850 // Run an animation of a given element to a new position, optionally setting 17851 // duration in seconds (`0.25` by default) and easing linearity factor (3rd 17852 // argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1), 17853 // `0.5` by default). 17854 run: function (el, newPos, duration, easeLinearity) { 17855 this.stop(); 17856 17857 this._el = el; 17858 this._inProgress = true; 17859 this._duration = duration || 0.25; 17860 this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2); 17861 17862 this._startPos = getPosition(el); 17863 this._offset = newPos.subtract(this._startPos); 17864 this._startTime = +new Date(); 17865 17866 // @event start: Event 17867 // Fired when the animation starts 17868 this.fire('start'); 17869 17870 this._animate(); 17871 }, 17872 17873 // @method stop() 17874 // Stops the animation (if currently running). 17875 stop: function () { 17876 if (!this._inProgress) { return; } 17877 17878 this._step(true); 17879 this._complete(); 17880 }, 17881 17882 _animate: function () { 17883 // animation loop 17884 this._animId = requestAnimFrame(this._animate, this); 17885 this._step(); 17886 }, 17887 17888 _step: function (round) { 17889 var elapsed = (+new Date()) - this._startTime, 17890 duration = this._duration * 1000; 17891 17892 if (elapsed < duration) { 17893 this._runFrame(this._easeOut(elapsed / duration), round); 17894 } else { 17895 this._runFrame(1); 17896 this._complete(); 17897 } 17898 }, 17899 17900 _runFrame: function (progress, round) { 17901 var pos = this._startPos.add(this._offset.multiplyBy(progress)); 17902 if (round) { 17903 pos._round(); 17904 } 17905 setPosition(this._el, pos); 17906 17907 // @event step: Event 17908 // Fired continuously during the animation. 17909 this.fire('step'); 17910 }, 17911 17912 _complete: function () { 17913 cancelAnimFrame(this._animId); 17914 17915 this._inProgress = false; 17916 // @event end: Event 17917 // Fired when the animation ends. 17918 this.fire('end'); 17919 }, 17920 17921 _easeOut: function (t) { 17922 return 1 - Math.pow(1 - t, this._easeOutPower); 17923 } 17924 }); 17925 17926 /* 17927 * @class Map 17928 * @aka L.Map 17929 * @inherits Evented 17930 * 17931 * The central class of the API â it is used to create a map on a page and manipulate it. 17932 * 17933 * @example 17934 * 17935 * ```js 17936 * // initialize the map on the "map" div with a given center and zoom 17937 * var map = L.map('map', { 17938 * center: [51.505, -0.09], 17939 * zoom: 13 17940 * }); 17941 * ``` 17942 * 17943 */ 17944 17945 var Map = Evented.extend({ 17946 17947 options: { 17948 // @section Map State Options 17949 // @option crs: CRS = L.CRS.EPSG3857 17950 // The [Coordinate Reference System](#crs) to use. Don't change this if you're not 17951 // sure what it means. 17952 crs: EPSG3857, 17953 17954 // @option center: LatLng = undefined 17955 // Initial geographic center of the map 17956 center: undefined, 17957 17958 // @option zoom: Number = undefined 17959 // Initial map zoom level 17960 zoom: undefined, 17961 17962 // @option minZoom: Number = * 17963 // Minimum zoom level of the map. 17964 // If not specified and at least one `GridLayer` or `TileLayer` is in the map, 17965 // the lowest of their `minZoom` options will be used instead. 17966 minZoom: undefined, 17967 17968 // @option maxZoom: Number = * 17969 // Maximum zoom level of the map. 17970 // If not specified and at least one `GridLayer` or `TileLayer` is in the map, 17971 // the highest of their `maxZoom` options will be used instead. 17972 maxZoom: undefined, 17973 17974 // @option layers: Layer[] = [] 17975 // Array of layers that will be added to the map initially 17976 layers: [], 17977 17978 // @option maxBounds: LatLngBounds = null 17979 // When this option is set, the map restricts the view to the given 17980 // geographical bounds, bouncing the user back if the user tries to pan 17981 // outside the view. To set the restriction dynamically, use 17982 // [`setMaxBounds`](#map-setmaxbounds) method. 17983 maxBounds: undefined, 17984 17985 // @option renderer: Renderer = * 17986 // The default method for drawing vector layers on the map. `L.SVG` 17987 // or `L.Canvas` by default depending on browser support. 17988 renderer: undefined, 17989 17990 17991 // @section Animation Options 17992 // @option zoomAnimation: Boolean = true 17993 // Whether the map zoom animation is enabled. By default it's enabled 17994 // in all browsers that support CSS3 Transitions except Android. 17995 zoomAnimation: true, 17996 17997 // @option zoomAnimationThreshold: Number = 4 17998 // Won't animate zoom if the zoom difference exceeds this value. 17999 zoomAnimationThreshold: 4, 18000 18001 // @option fadeAnimation: Boolean = true 18002 // Whether the tile fade animation is enabled. By default it's enabled 18003 // in all browsers that support CSS3 Transitions except Android. 18004 fadeAnimation: true, 18005 18006 // @option markerZoomAnimation: Boolean = true 18007 // Whether markers animate their zoom with the zoom animation, if disabled 18008 // they will disappear for the length of the animation. By default it's 18009 // enabled in all browsers that support CSS3 Transitions except Android. 18010 markerZoomAnimation: true, 18011 18012 // @option transform3DLimit: Number = 2^23 18013 // Defines the maximum size of a CSS translation transform. The default 18014 // value should not be changed unless a web browser positions layers in 18015 // the wrong place after doing a large `panBy`. 18016 transform3DLimit: 8388608, // Precision limit of a 32-bit float 18017 18018 // @section Interaction Options 18019 // @option zoomSnap: Number = 1 18020 // Forces the map's zoom level to always be a multiple of this, particularly 18021 // right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom. 18022 // By default, the zoom level snaps to the nearest integer; lower values 18023 // (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0` 18024 // means the zoom level will not be snapped after `fitBounds` or a pinch-zoom. 18025 zoomSnap: 1, 18026 18027 // @option zoomDelta: Number = 1 18028 // Controls how much the map's zoom level will change after a 18029 // [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+` 18030 // or `-` on the keyboard, or using the [zoom controls](#control-zoom). 18031 // Values smaller than `1` (e.g. `0.5`) allow for greater granularity. 18032 zoomDelta: 1, 18033 18034 // @option trackResize: Boolean = true 18035 // Whether the map automatically handles browser window resize to update itself. 18036 trackResize: true 18037 }, 18038 18039 initialize: function (id, options) { // (HTMLElement or String, Object) 18040 options = setOptions(this, options); 18041 18042 // Make sure to assign internal flags at the beginning, 18043 // to avoid inconsistent state in some edge cases. 18044 this._handlers = []; 18045 this._layers = {}; 18046 this._zoomBoundLayers = {}; 18047 this._sizeChanged = true; 18048 18049 this._initContainer(id); 18050 this._initLayout(); 18051 18052 // hack for https://github.com/Leaflet/Leaflet/issues/1980 18053 this._onResize = bind(this._onResize, this); 18054 18055 this._initEvents(); 18056 18057 if (options.maxBounds) { 18058 this.setMaxBounds(options.maxBounds); 18059 } 18060 18061 if (options.zoom !== undefined) { 18062 this._zoom = this._limitZoom(options.zoom); 18063 } 18064 18065 if (options.center && options.zoom !== undefined) { 18066 this.setView(toLatLng(options.center), options.zoom, {reset: true}); 18067 } 18068 18069 this.callInitHooks(); 18070 18071 // don't animate on browsers without hardware-accelerated transitions or old Android/Opera 18072 this._zoomAnimated = TRANSITION && Browser.any3d && !Browser.mobileOpera && 18073 this.options.zoomAnimation; 18074 18075 // zoom transitions run with the same duration for all layers, so if one of transitionend events 18076 // happens after starting zoom animation (propagating to the map pane), we know that it ended globally 18077 if (this._zoomAnimated) { 18078 this._createAnimProxy(); 18079 on(this._proxy, TRANSITION_END, this._catchTransitionEnd, this); 18080 } 18081 18082 this._addLayers(this.options.layers); 18083 }, 18084 18085 18086 // @section Methods for modifying map state 18087 18088 // @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this 18089 // Sets the view of the map (geographical center and zoom) with the given 18090 // animation options. 18091 setView: function (center, zoom, options) { 18092 18093 zoom = zoom === undefined ? this._zoom : this._limitZoom(zoom); 18094 center = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds); 18095 options = options || {}; 18096 18097 this._stop(); 18098 18099 if (this._loaded && !options.reset && options !== true) { 18100 18101 if (options.animate !== undefined) { 18102 options.zoom = extend({animate: options.animate}, options.zoom); 18103 options.pan = extend({animate: options.animate, duration: options.duration}, options.pan); 18104 } 18105 18106 // try animating pan or zoom 18107 var moved = (this._zoom !== zoom) ? 18108 this._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) : 18109 this._tryAnimatedPan(center, options.pan); 18110 18111 if (moved) { 18112 // prevent resize handler call, the view will refresh after animation anyway 18113 clearTimeout(this._sizeTimer); 18114 return this; 18115 } 18116 } 18117 18118 // animation didn't start, just reset the map view 18119 this._resetView(center, zoom, options.pan && options.pan.noMoveStart); 18120 18121 return this; 18122 }, 18123 18124 // @method setZoom(zoom: Number, options?: Zoom/pan options): this 18125 // Sets the zoom of the map. 18126 setZoom: function (zoom, options) { 18127 if (!this._loaded) { 18128 this._zoom = zoom; 18129 return this; 18130 } 18131 return this.setView(this.getCenter(), zoom, {zoom: options}); 18132 }, 18133 18134 // @method zoomIn(delta?: Number, options?: Zoom options): this 18135 // Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default). 18136 zoomIn: function (delta, options) { 18137 delta = delta || (Browser.any3d ? this.options.zoomDelta : 1); 18138 return this.setZoom(this._zoom + delta, options); 18139 }, 18140 18141 // @method zoomOut(delta?: Number, options?: Zoom options): this 18142 // Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default). 18143 zoomOut: function (delta, options) { 18144 delta = delta || (Browser.any3d ? this.options.zoomDelta : 1); 18145 return this.setZoom(this._zoom - delta, options); 18146 }, 18147 18148 // @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this 18149 // Zooms the map while keeping a specified geographical point on the map 18150 // stationary (e.g. used internally for scroll zoom and double-click zoom). 18151 // @alternative 18152 // @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this 18153 // Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary. 18154 setZoomAround: function (latlng, zoom, options) { 18155 var scale = this.getZoomScale(zoom), 18156 viewHalf = this.getSize().divideBy(2), 18157 containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng), 18158 18159 centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale), 18160 newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset)); 18161 18162 return this.setView(newCenter, zoom, {zoom: options}); 18163 }, 18164 18165 _getBoundsCenterZoom: function (bounds, options) { 18166 18167 options = options || {}; 18168 bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds); 18169 18170 var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]), 18171 paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]), 18172 18173 zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)); 18174 18175 zoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom; 18176 18177 if (zoom === Infinity) { 18178 return { 18179 center: bounds.getCenter(), 18180 zoom: zoom 18181 }; 18182 } 18183 18184 var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), 18185 18186 swPoint = this.project(bounds.getSouthWest(), zoom), 18187 nePoint = this.project(bounds.getNorthEast(), zoom), 18188 center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom); 18189 18190 return { 18191 center: center, 18192 zoom: zoom 18193 }; 18194 }, 18195 18196 // @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this 18197 // Sets a map view that contains the given geographical bounds with the 18198 // maximum zoom level possible. 18199 fitBounds: function (bounds, options) { 18200 18201 bounds = toLatLngBounds(bounds); 18202 18203 if (!bounds.isValid()) { 18204 throw new Error('Bounds are not valid.'); 18205 } 18206 18207 var target = this._getBoundsCenterZoom(bounds, options); 18208 return this.setView(target.center, target.zoom, options); 18209 }, 18210 18211 // @method fitWorld(options?: fitBounds options): this 18212 // Sets a map view that mostly contains the whole world with the maximum 18213 // zoom level possible. 18214 fitWorld: function (options) { 18215 return this.fitBounds([[-90, -180], [90, 180]], options); 18216 }, 18217 18218 // @method panTo(latlng: LatLng, options?: Pan options): this 18219 // Pans the map to a given center. 18220 panTo: function (center, options) { // (LatLng) 18221 return this.setView(center, this._zoom, {pan: options}); 18222 }, 18223 18224 // @method panBy(offset: Point, options?: Pan options): this 18225 // Pans the map by a given number of pixels (animated). 18226 panBy: function (offset, options) { 18227 offset = toPoint(offset).round(); 18228 options = options || {}; 18229 18230 if (!offset.x && !offset.y) { 18231 return this.fire('moveend'); 18232 } 18233 // If we pan too far, Chrome gets issues with tiles 18234 // and makes them disappear or appear in the wrong place (slightly offset) #2602 18235 if (options.animate !== true && !this.getSize().contains(offset)) { 18236 this._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom()); 18237 return this; 18238 } 18239 18240 if (!this._panAnim) { 18241 this._panAnim = new PosAnimation(); 18242 18243 this._panAnim.on({ 18244 'step': this._onPanTransitionStep, 18245 'end': this._onPanTransitionEnd 18246 }, this); 18247 } 18248 18249 // don't fire movestart if animating inertia 18250 if (!options.noMoveStart) { 18251 this.fire('movestart'); 18252 } 18253 18254 // animate pan unless animate: false specified 18255 if (options.animate !== false) { 18256 addClass(this._mapPane, 'leaflet-pan-anim'); 18257 18258 var newPos = this._getMapPanePos().subtract(offset).round(); 18259 this._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity); 18260 } else { 18261 this._rawPanBy(offset); 18262 this.fire('move').fire('moveend'); 18263 } 18264 18265 return this; 18266 }, 18267 18268 // @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this 18269 // Sets the view of the map (geographical center and zoom) performing a smooth 18270 // pan-zoom animation. 18271 flyTo: function (targetCenter, targetZoom, options) { 18272 18273 options = options || {}; 18274 if (options.animate === false || !Browser.any3d) { 18275 return this.setView(targetCenter, targetZoom, options); 18276 } 18277 18278 this._stop(); 18279 18280 var from = this.project(this.getCenter()), 18281 to = this.project(targetCenter), 18282 size = this.getSize(), 18283 startZoom = this._zoom; 18284 18285 targetCenter = toLatLng(targetCenter); 18286 targetZoom = targetZoom === undefined ? startZoom : targetZoom; 18287 18288 var w0 = Math.max(size.x, size.y), 18289 w1 = w0 * this.getZoomScale(startZoom, targetZoom), 18290 u1 = (to.distanceTo(from)) || 1, 18291 rho = 1.42, 18292 rho2 = rho * rho; 18293 18294 function r(i) { 18295 var s1 = i ? -1 : 1, 18296 s2 = i ? w1 : w0, 18297 t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1, 18298 b1 = 2 * s2 * rho2 * u1, 18299 b = t1 / b1, 18300 sq = Math.sqrt(b * b + 1) - b; 18301 18302 // workaround for floating point precision bug when sq = 0, log = -Infinite, 18303 // thus triggering an infinite loop in flyTo 18304 var log = sq < 0.000000001 ? -18 : Math.log(sq); 18305 18306 return log; 18307 } 18308 18309 function sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; } 18310 function cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; } 18311 function tanh(n) { return sinh(n) / cosh(n); } 18312 18313 var r0 = r(0); 18314 18315 function w(s) { return w0 * (cosh(r0) / cosh(r0 + rho * s)); } 18316 function u(s) { return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; } 18317 18318 function easeOut(t) { return 1 - Math.pow(1 - t, 1.5); } 18319 18320 var start = Date.now(), 18321 S = (r(1) - r0) / rho, 18322 duration = options.duration ? 1000 * options.duration : 1000 * S * 0.8; 18323 18324 function frame() { 18325 var t = (Date.now() - start) / duration, 18326 s = easeOut(t) * S; 18327 18328 if (t <= 1) { 18329 this._flyToFrame = requestAnimFrame(frame, this); 18330 18331 this._move( 18332 this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom), 18333 this.getScaleZoom(w0 / w(s), startZoom), 18334 {flyTo: true}); 18335 18336 } else { 18337 this 18338 ._move(targetCenter, targetZoom) 18339 ._moveEnd(true); 18340 } 18341 } 18342 18343 this._moveStart(true, options.noMoveStart); 18344 18345 frame.call(this); 18346 return this; 18347 }, 18348 18349 // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this 18350 // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto), 18351 // but takes a bounds parameter like [`fitBounds`](#map-fitbounds). 18352 flyToBounds: function (bounds, options) { 18353 var target = this._getBoundsCenterZoom(bounds, options); 18354 return this.flyTo(target.center, target.zoom, options); 18355 }, 18356 18357 // @method setMaxBounds(bounds: LatLngBounds): this 18358 // Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option). 18359 setMaxBounds: function (bounds) { 18360 bounds = toLatLngBounds(bounds); 18361 18362 if (this.listens('moveend', this._panInsideMaxBounds)) { 18363 this.off('moveend', this._panInsideMaxBounds); 18364 } 18365 18366 if (!bounds.isValid()) { 18367 this.options.maxBounds = null; 18368 return this; 18369 } 18370 18371 this.options.maxBounds = bounds; 18372 18373 if (this._loaded) { 18374 this._panInsideMaxBounds(); 18375 } 18376 18377 return this.on('moveend', this._panInsideMaxBounds); 18378 }, 18379 18380 // @method setMinZoom(zoom: Number): this 18381 // Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option). 18382 setMinZoom: function (zoom) { 18383 var oldZoom = this.options.minZoom; 18384 this.options.minZoom = zoom; 18385 18386 if (this._loaded && oldZoom !== zoom) { 18387 this.fire('zoomlevelschange'); 18388 18389 if (this.getZoom() < this.options.minZoom) { 18390 return this.setZoom(zoom); 18391 } 18392 } 18393 18394 return this; 18395 }, 18396 18397 // @method setMaxZoom(zoom: Number): this 18398 // Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option). 18399 setMaxZoom: function (zoom) { 18400 var oldZoom = this.options.maxZoom; 18401 this.options.maxZoom = zoom; 18402 18403 if (this._loaded && oldZoom !== zoom) { 18404 this.fire('zoomlevelschange'); 18405 18406 if (this.getZoom() > this.options.maxZoom) { 18407 return this.setZoom(zoom); 18408 } 18409 } 18410 18411 return this; 18412 }, 18413 18414 // @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this 18415 // Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any. 18416 panInsideBounds: function (bounds, options) { 18417 this._enforcingBounds = true; 18418 var center = this.getCenter(), 18419 newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds)); 18420 18421 if (!center.equals(newCenter)) { 18422 this.panTo(newCenter, options); 18423 } 18424 18425 this._enforcingBounds = false; 18426 return this; 18427 }, 18428 18429 // @method panInside(latlng: LatLng, options?: padding options): this 18430 // Pans the map the minimum amount to make the `latlng` visible. Use 18431 // padding options to fit the display to more restricted bounds. 18432 // If `latlng` is already within the (optionally padded) display bounds, 18433 // the map will not be panned. 18434 panInside: function (latlng, options) { 18435 options = options || {}; 18436 18437 var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]), 18438 paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]), 18439 pixelCenter = this.project(this.getCenter()), 18440 pixelPoint = this.project(latlng), 18441 pixelBounds = this.getPixelBounds(), 18442 paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]), 18443 paddedSize = paddedBounds.getSize(); 18444 18445 if (!paddedBounds.contains(pixelPoint)) { 18446 this._enforcingBounds = true; 18447 var centerOffset = pixelPoint.subtract(paddedBounds.getCenter()); 18448 var offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize); 18449 pixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x; 18450 pixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y; 18451 this.panTo(this.unproject(pixelCenter), options); 18452 this._enforcingBounds = false; 18453 } 18454 return this; 18455 }, 18456 18457 // @method invalidateSize(options: Zoom/pan options): this 18458 // Checks if the map container size changed and updates the map if so â 18459 // call it after you've changed the map size dynamically, also animating 18460 // pan by default. If `options.pan` is `false`, panning will not occur. 18461 // If `options.debounceMoveend` is `true`, it will delay `moveend` event so 18462 // that it doesn't happen often even if the method is called many 18463 // times in a row. 18464 18465 // @alternative 18466 // @method invalidateSize(animate: Boolean): this 18467 // Checks if the map container size changed and updates the map if so â 18468 // call it after you've changed the map size dynamically, also animating 18469 // pan by default. 18470 invalidateSize: function (options) { 18471 if (!this._loaded) { return this; } 18472 18473 options = extend({ 18474 animate: false, 18475 pan: true 18476 }, options === true ? {animate: true} : options); 18477 18478 var oldSize = this.getSize(); 18479 this._sizeChanged = true; 18480 this._lastCenter = null; 18481 18482 var newSize = this.getSize(), 18483 oldCenter = oldSize.divideBy(2).round(), 18484 newCenter = newSize.divideBy(2).round(), 18485 offset = oldCenter.subtract(newCenter); 18486 18487 if (!offset.x && !offset.y) { return this; } 18488 18489 if (options.animate && options.pan) { 18490 this.panBy(offset); 18491 18492 } else { 18493 if (options.pan) { 18494 this._rawPanBy(offset); 18495 } 18496 18497 this.fire('move'); 18498 18499 if (options.debounceMoveend) { 18500 clearTimeout(this._sizeTimer); 18501 this._sizeTimer = setTimeout(bind(this.fire, this, 'moveend'), 200); 18502 } else { 18503 this.fire('moveend'); 18504 } 18505 } 18506 18507 // @section Map state change events 18508 // @event resize: ResizeEvent 18509 // Fired when the map is resized. 18510 return this.fire('resize', { 18511 oldSize: oldSize, 18512 newSize: newSize 18513 }); 18514 }, 18515 18516 // @section Methods for modifying map state 18517 // @method stop(): this 18518 // Stops the currently running `panTo` or `flyTo` animation, if any. 18519 stop: function () { 18520 this.setZoom(this._limitZoom(this._zoom)); 18521 if (!this.options.zoomSnap) { 18522 this.fire('viewreset'); 18523 } 18524 return this._stop(); 18525 }, 18526 18527 // @section Geolocation methods 18528 // @method locate(options?: Locate options): this 18529 // Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound) 18530 // event with location data on success or a [`locationerror`](#map-locationerror) event on failure, 18531 // and optionally sets the map view to the user's location with respect to 18532 // detection accuracy (or to the world view if geolocation failed). 18533 // Note that, if your page doesn't use HTTPS, this method will fail in 18534 // modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins)) 18535 // See `Locate options` for more details. 18536 locate: function (options) { 18537 18538 options = this._locateOptions = extend({ 18539 timeout: 10000, 18540 watch: false 18541 // setView: false 18542 // maxZoom: <Number> 18543 // maximumAge: 0 18544 // enableHighAccuracy: false 18545 }, options); 18546 18547 if (!('geolocation' in navigator)) { 18548 this._handleGeolocationError({ 18549 code: 0, 18550 message: 'Geolocation not supported.' 18551 }); 18552 return this; 18553 } 18554 18555 var onResponse = bind(this._handleGeolocationResponse, this), 18556 onError = bind(this._handleGeolocationError, this); 18557 18558 if (options.watch) { 18559 this._locationWatchId = 18560 navigator.geolocation.watchPosition(onResponse, onError, options); 18561 } else { 18562 navigator.geolocation.getCurrentPosition(onResponse, onError, options); 18563 } 18564 return this; 18565 }, 18566 18567 // @method stopLocate(): this 18568 // Stops watching location previously initiated by `map.locate({watch: true})` 18569 // and aborts resetting the map view if map.locate was called with 18570 // `{setView: true}`. 18571 stopLocate: function () { 18572 if (navigator.geolocation && navigator.geolocation.clearWatch) { 18573 navigator.geolocation.clearWatch(this._locationWatchId); 18574 } 18575 if (this._locateOptions) { 18576 this._locateOptions.setView = false; 18577 } 18578 return this; 18579 }, 18580 18581 _handleGeolocationError: function (error) { 18582 if (!this._container._leaflet_id) { return; } 18583 18584 var c = error.code, 18585 message = error.message || 18586 (c === 1 ? 'permission denied' : 18587 (c === 2 ? 'position unavailable' : 'timeout')); 18588 18589 if (this._locateOptions.setView && !this._loaded) { 18590 this.fitWorld(); 18591 } 18592 18593 // @section Location events 18594 // @event locationerror: ErrorEvent 18595 // Fired when geolocation (using the [`locate`](#map-locate) method) failed. 18596 this.fire('locationerror', { 18597 code: c, 18598 message: 'Geolocation error: ' + message + '.' 18599 }); 18600 }, 18601 18602 _handleGeolocationResponse: function (pos) { 18603 if (!this._container._leaflet_id) { return; } 18604 18605 var lat = pos.coords.latitude, 18606 lng = pos.coords.longitude, 18607 latlng = new LatLng(lat, lng), 18608 bounds = latlng.toBounds(pos.coords.accuracy * 2), 18609 options = this._locateOptions; 18610 18611 if (options.setView) { 18612 var zoom = this.getBoundsZoom(bounds); 18613 this.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom); 18614 } 18615 18616 var data = { 18617 latlng: latlng, 18618 bounds: bounds, 18619 timestamp: pos.timestamp 18620 }; 18621 18622 for (var i in pos.coords) { 18623 if (typeof pos.coords[i] === 'number') { 18624 data[i] = pos.coords[i]; 18625 } 18626 } 18627 18628 // @event locationfound: LocationEvent 18629 // Fired when geolocation (using the [`locate`](#map-locate) method) 18630 // went successfully. 18631 this.fire('locationfound', data); 18632 }, 18633 18634 // TODO Appropriate docs section? 18635 // @section Other Methods 18636 // @method addHandler(name: String, HandlerClass: Function): this 18637 // Adds a new `Handler` to the map, given its name and constructor function. 18638 addHandler: function (name, HandlerClass) { 18639 if (!HandlerClass) { return this; } 18640 18641 var handler = this[name] = new HandlerClass(this); 18642 18643 this._handlers.push(handler); 18644 18645 if (this.options[name]) { 18646 handler.enable(); 18647 } 18648 18649 return this; 18650 }, 18651 18652 // @method remove(): this 18653 // Destroys the map and clears all related event listeners. 18654 remove: function () { 18655 18656 this._initEvents(true); 18657 if (this.options.maxBounds) { this.off('moveend', this._panInsideMaxBounds); } 18658 18659 if (this._containerId !== this._container._leaflet_id) { 18660 throw new Error('Map container is being reused by another instance'); 18661 } 18662 18663 try { 18664 // throws error in IE6-8 18665 delete this._container._leaflet_id; 18666 delete this._containerId; 18667 } catch (e) { 18668 /*eslint-disable */ 18669 this._container._leaflet_id = undefined; 18670 /* eslint-enable */ 18671 this._containerId = undefined; 18672 } 18673 18674 if (this._locationWatchId !== undefined) { 18675 this.stopLocate(); 18676 } 18677 18678 this._stop(); 18679 18680 remove(this._mapPane); 18681 18682 if (this._clearControlPos) { 18683 this._clearControlPos(); 18684 } 18685 if (this._resizeRequest) { 18686 cancelAnimFrame(this._resizeRequest); 18687 this._resizeRequest = null; 18688 } 18689 18690 this._clearHandlers(); 18691 18692 if (this._loaded) { 18693 // @section Map state change events 18694 // @event unload: Event 18695 // Fired when the map is destroyed with [remove](#map-remove) method. 18696 this.fire('unload'); 18697 } 18698 18699 var i; 18700 for (i in this._layers) { 18701 this._layers[i].remove(); 18702 } 18703 for (i in this._panes) { 18704 remove(this._panes[i]); 18705 } 18706 18707 this._layers = []; 18708 this._panes = []; 18709 delete this._mapPane; 18710 delete this._renderer; 18711 18712 return this; 18713 }, 18714 18715 // @section Other Methods 18716 // @method createPane(name: String, container?: HTMLElement): HTMLElement 18717 // Creates a new [map pane](#map-pane) with the given name if it doesn't exist already, 18718 // then returns it. The pane is created as a child of `container`, or 18719 // as a child of the main map pane if not set. 18720 createPane: function (name, container) { 18721 var className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''), 18722 pane = create$1('div', className, container || this._mapPane); 18723 18724 if (name) { 18725 this._panes[name] = pane; 18726 } 18727 return pane; 18728 }, 18729 18730 // @section Methods for Getting Map State 18731 18732 // @method getCenter(): LatLng 18733 // Returns the geographical center of the map view 18734 getCenter: function () { 18735 this._checkIfLoaded(); 18736 18737 if (this._lastCenter && !this._moved()) { 18738 return this._lastCenter.clone(); 18739 } 18740 return this.layerPointToLatLng(this._getCenterLayerPoint()); 18741 }, 18742 18743 // @method getZoom(): Number 18744 // Returns the current zoom level of the map view 18745 getZoom: function () { 18746 return this._zoom; 18747 }, 18748 18749 // @method getBounds(): LatLngBounds 18750 // Returns the geographical bounds visible in the current map view 18751 getBounds: function () { 18752 var bounds = this.getPixelBounds(), 18753 sw = this.unproject(bounds.getBottomLeft()), 18754 ne = this.unproject(bounds.getTopRight()); 18755 18756 return new LatLngBounds(sw, ne); 18757 }, 18758 18759 // @method getMinZoom(): Number 18760 // Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default. 18761 getMinZoom: function () { 18762 return this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom; 18763 }, 18764 18765 // @method getMaxZoom(): Number 18766 // Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers). 18767 getMaxZoom: function () { 18768 return this.options.maxZoom === undefined ? 18769 (this._layersMaxZoom === undefined ? Infinity : this._layersMaxZoom) : 18770 this.options.maxZoom; 18771 }, 18772 18773 // @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number 18774 // Returns the maximum zoom level on which the given bounds fit to the map 18775 // view in its entirety. If `inside` (optional) is set to `true`, the method 18776 // instead returns the minimum zoom level on which the map view fits into 18777 // the given bounds in its entirety. 18778 getBoundsZoom: function (bounds, inside, padding) { // (LatLngBounds[, Boolean, Point]) -> Number 18779 bounds = toLatLngBounds(bounds); 18780 padding = toPoint(padding || [0, 0]); 18781 18782 var zoom = this.getZoom() || 0, 18783 min = this.getMinZoom(), 18784 max = this.getMaxZoom(), 18785 nw = bounds.getNorthWest(), 18786 se = bounds.getSouthEast(), 18787 size = this.getSize().subtract(padding), 18788 boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(), 18789 snap = Browser.any3d ? this.options.zoomSnap : 1, 18790 scalex = size.x / boundsSize.x, 18791 scaley = size.y / boundsSize.y, 18792 scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley); 18793 18794 zoom = this.getScaleZoom(scale, zoom); 18795 18796 if (snap) { 18797 zoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level 18798 zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap; 18799 } 18800 18801 return Math.max(min, Math.min(max, zoom)); 18802 }, 18803 18804 // @method getSize(): Point 18805 // Returns the current size of the map container (in pixels). 18806 getSize: function () { 18807 if (!this._size || this._sizeChanged) { 18808 this._size = new Point( 18809 this._container.clientWidth || 0, 18810 this._container.clientHeight || 0); 18811 18812 this._sizeChanged = false; 18813 } 18814 return this._size.clone(); 18815 }, 18816 18817 // @method getPixelBounds(): Bounds 18818 // Returns the bounds of the current map view in projected pixel 18819 // coordinates (sometimes useful in layer and overlay implementations). 18820 getPixelBounds: function (center, zoom) { 18821 var topLeftPoint = this._getTopLeftPoint(center, zoom); 18822 return new Bounds(topLeftPoint, topLeftPoint.add(this.getSize())); 18823 }, 18824 18825 // TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to 18826 // the map pane? "left point of the map layer" can be confusing, specially 18827 // since there can be negative offsets. 18828 // @method getPixelOrigin(): Point 18829 // Returns the projected pixel coordinates of the top left point of 18830 // the map layer (useful in custom layer and overlay implementations). 18831 getPixelOrigin: function () { 18832 this._checkIfLoaded(); 18833 return this._pixelOrigin; 18834 }, 18835 18836 // @method getPixelWorldBounds(zoom?: Number): Bounds 18837 // Returns the world's bounds in pixel coordinates for zoom level `zoom`. 18838 // If `zoom` is omitted, the map's current zoom level is used. 18839 getPixelWorldBounds: function (zoom) { 18840 return this.options.crs.getProjectedBounds(zoom === undefined ? this.getZoom() : zoom); 18841 }, 18842 18843 // @section Other Methods 18844 18845 // @method getPane(pane: String|HTMLElement): HTMLElement 18846 // Returns a [map pane](#map-pane), given its name or its HTML element (its identity). 18847 getPane: function (pane) { 18848 return typeof pane === 'string' ? this._panes[pane] : pane; 18849 }, 18850 18851 // @method getPanes(): Object 18852 // Returns a plain object containing the names of all [panes](#map-pane) as keys and 18853 // the panes as values. 18854 getPanes: function () { 18855 return this._panes; 18856 }, 18857 18858 // @method getContainer: HTMLElement 18859 // Returns the HTML element that contains the map. 18860 getContainer: function () { 18861 return this._container; 18862 }, 18863 18864 18865 // @section Conversion Methods 18866 18867 // @method getZoomScale(toZoom: Number, fromZoom: Number): Number 18868 // Returns the scale factor to be applied to a map transition from zoom level 18869 // `fromZoom` to `toZoom`. Used internally to help with zoom animations. 18870 getZoomScale: function (toZoom, fromZoom) { 18871 // TODO replace with universal implementation after refactoring projections 18872 var crs = this.options.crs; 18873 fromZoom = fromZoom === undefined ? this._zoom : fromZoom; 18874 return crs.scale(toZoom) / crs.scale(fromZoom); 18875 }, 18876 18877 // @method getScaleZoom(scale: Number, fromZoom: Number): Number 18878 // Returns the zoom level that the map would end up at, if it is at `fromZoom` 18879 // level and everything is scaled by a factor of `scale`. Inverse of 18880 // [`getZoomScale`](#map-getZoomScale). 18881 getScaleZoom: function (scale, fromZoom) { 18882 var crs = this.options.crs; 18883 fromZoom = fromZoom === undefined ? this._zoom : fromZoom; 18884 var zoom = crs.zoom(scale * crs.scale(fromZoom)); 18885 return isNaN(zoom) ? Infinity : zoom; 18886 }, 18887 18888 // @method project(latlng: LatLng, zoom: Number): Point 18889 // Projects a geographical coordinate `LatLng` according to the projection 18890 // of the map's CRS, then scales it according to `zoom` and the CRS's 18891 // `Transformation`. The result is pixel coordinate relative to 18892 // the CRS origin. 18893 project: function (latlng, zoom) { 18894 zoom = zoom === undefined ? this._zoom : zoom; 18895 return this.options.crs.latLngToPoint(toLatLng(latlng), zoom); 18896 }, 18897 18898 // @method unproject(point: Point, zoom: Number): LatLng 18899 // Inverse of [`project`](#map-project). 18900 unproject: function (point, zoom) { 18901 zoom = zoom === undefined ? this._zoom : zoom; 18902 return this.options.crs.pointToLatLng(toPoint(point), zoom); 18903 }, 18904 18905 // @method layerPointToLatLng(point: Point): LatLng 18906 // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin), 18907 // returns the corresponding geographical coordinate (for the current zoom level). 18908 layerPointToLatLng: function (point) { 18909 var projectedPoint = toPoint(point).add(this.getPixelOrigin()); 18910 return this.unproject(projectedPoint); 18911 }, 18912 18913 // @method latLngToLayerPoint(latlng: LatLng): Point 18914 // Given a geographical coordinate, returns the corresponding pixel coordinate 18915 // relative to the [origin pixel](#map-getpixelorigin). 18916 latLngToLayerPoint: function (latlng) { 18917 var projectedPoint = this.project(toLatLng(latlng))._round(); 18918 return projectedPoint._subtract(this.getPixelOrigin()); 18919 }, 18920 18921 // @method wrapLatLng(latlng: LatLng): LatLng 18922 // Returns a `LatLng` where `lat` and `lng` has been wrapped according to the 18923 // map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the 18924 // CRS's bounds. 18925 // By default this means longitude is wrapped around the dateline so its 18926 // value is between -180 and +180 degrees. 18927 wrapLatLng: function (latlng) { 18928 return this.options.crs.wrapLatLng(toLatLng(latlng)); 18929 }, 18930 18931 // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds 18932 // Returns a `LatLngBounds` with the same size as the given one, ensuring that 18933 // its center is within the CRS's bounds. 18934 // By default this means the center longitude is wrapped around the dateline so its 18935 // value is between -180 and +180 degrees, and the majority of the bounds 18936 // overlaps the CRS's bounds. 18937 wrapLatLngBounds: function (latlng) { 18938 return this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng)); 18939 }, 18940 18941 // @method distance(latlng1: LatLng, latlng2: LatLng): Number 18942 // Returns the distance between two geographical coordinates according to 18943 // the map's CRS. By default this measures distance in meters. 18944 distance: function (latlng1, latlng2) { 18945 return this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2)); 18946 }, 18947 18948 // @method containerPointToLayerPoint(point: Point): Point 18949 // Given a pixel coordinate relative to the map container, returns the corresponding 18950 // pixel coordinate relative to the [origin pixel](#map-getpixelorigin). 18951 containerPointToLayerPoint: function (point) { // (Point) 18952 return toPoint(point).subtract(this._getMapPanePos()); 18953 }, 18954 18955 // @method layerPointToContainerPoint(point: Point): Point 18956 // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin), 18957 // returns the corresponding pixel coordinate relative to the map container. 18958 layerPointToContainerPoint: function (point) { // (Point) 18959 return toPoint(point).add(this._getMapPanePos()); 18960 }, 18961 18962 // @method containerPointToLatLng(point: Point): LatLng 18963 // Given a pixel coordinate relative to the map container, returns 18964 // the corresponding geographical coordinate (for the current zoom level). 18965 containerPointToLatLng: function (point) { 18966 var layerPoint = this.containerPointToLayerPoint(toPoint(point)); 18967 return this.layerPointToLatLng(layerPoint); 18968 }, 18969 18970 // @method latLngToContainerPoint(latlng: LatLng): Point 18971 // Given a geographical coordinate, returns the corresponding pixel coordinate 18972 // relative to the map container. 18973 latLngToContainerPoint: function (latlng) { 18974 return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng))); 18975 }, 18976 18977 // @method mouseEventToContainerPoint(ev: MouseEvent): Point 18978 // Given a MouseEvent object, returns the pixel coordinate relative to the 18979 // map container where the event took place. 18980 mouseEventToContainerPoint: function (e) { 18981 return getMousePosition(e, this._container); 18982 }, 18983 18984 // @method mouseEventToLayerPoint(ev: MouseEvent): Point 18985 // Given a MouseEvent object, returns the pixel coordinate relative to 18986 // the [origin pixel](#map-getpixelorigin) where the event took place. 18987 mouseEventToLayerPoint: function (e) { 18988 return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e)); 18989 }, 18990 18991 // @method mouseEventToLatLng(ev: MouseEvent): LatLng 18992 // Given a MouseEvent object, returns geographical coordinate where the 18993 // event took place. 18994 mouseEventToLatLng: function (e) { // (MouseEvent) 18995 return this.layerPointToLatLng(this.mouseEventToLayerPoint(e)); 18996 }, 18997 18998 18999 // map initialization methods 19000 19001 _initContainer: function (id) { 19002 var container = this._container = get(id); 19003 19004 if (!container) { 19005 throw new Error('Map container not found.'); 19006 } else if (container._leaflet_id) { 19007 throw new Error('Map container is already initialized.'); 19008 } 19009 19010 on(container, 'scroll', this._onScroll, this); 19011 this._containerId = stamp(container); 19012 }, 19013 19014 _initLayout: function () { 19015 var container = this._container; 19016 19017 this._fadeAnimated = this.options.fadeAnimation && Browser.any3d; 19018 19019 addClass(container, 'leaflet-container' + 19020 (Browser.touch ? ' leaflet-touch' : '') + 19021 (Browser.retina ? ' leaflet-retina' : '') + 19022 (Browser.ielt9 ? ' leaflet-oldie' : '') + 19023 (Browser.safari ? ' leaflet-safari' : '') + 19024 (this._fadeAnimated ? ' leaflet-fade-anim' : '')); 19025 19026 var position = getStyle(container, 'position'); 19027 19028 if (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') { 19029 container.style.position = 'relative'; 19030 } 19031 19032 this._initPanes(); 19033 19034 if (this._initControlPos) { 19035 this._initControlPos(); 19036 } 19037 }, 19038 19039 _initPanes: function () { 19040 var panes = this._panes = {}; 19041 this._paneRenderers = {}; 19042 19043 // @section 19044 // 19045 // Panes are DOM elements used to control the ordering of layers on the map. You 19046 // can access panes with [`map.getPane`](#map-getpane) or 19047 // [`map.getPanes`](#map-getpanes) methods. New panes can be created with the 19048 // [`map.createPane`](#map-createpane) method. 19049 // 19050 // Every map has the following default panes that differ only in zIndex. 19051 // 19052 // @pane mapPane: HTMLElement = 'auto' 19053 // Pane that contains all other map panes 19054 19055 this._mapPane = this.createPane('mapPane', this._container); 19056 setPosition(this._mapPane, new Point(0, 0)); 19057 19058 // @pane tilePane: HTMLElement = 200 19059 // Pane for `GridLayer`s and `TileLayer`s 19060 this.createPane('tilePane'); 19061 // @pane overlayPane: HTMLElement = 400 19062 // Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s 19063 this.createPane('overlayPane'); 19064 // @pane shadowPane: HTMLElement = 500 19065 // Pane for overlay shadows (e.g. `Marker` shadows) 19066 this.createPane('shadowPane'); 19067 // @pane markerPane: HTMLElement = 600 19068 // Pane for `Icon`s of `Marker`s 19069 this.createPane('markerPane'); 19070 // @pane tooltipPane: HTMLElement = 650 19071 // Pane for `Tooltip`s. 19072 this.createPane('tooltipPane'); 19073 // @pane popupPane: HTMLElement = 700 19074 // Pane for `Popup`s. 19075 this.createPane('popupPane'); 19076 19077 if (!this.options.markerZoomAnimation) { 19078 addClass(panes.markerPane, 'leaflet-zoom-hide'); 19079 addClass(panes.shadowPane, 'leaflet-zoom-hide'); 19080 } 19081 }, 19082 19083 19084 // private methods that modify map state 19085 19086 // @section Map state change events 19087 _resetView: function (center, zoom, noMoveStart) { 19088 setPosition(this._mapPane, new Point(0, 0)); 19089 19090 var loading = !this._loaded; 19091 this._loaded = true; 19092 zoom = this._limitZoom(zoom); 19093 19094 this.fire('viewprereset'); 19095 19096 var zoomChanged = this._zoom !== zoom; 19097 this 19098 ._moveStart(zoomChanged, noMoveStart) 19099 ._move(center, zoom) 19100 ._moveEnd(zoomChanged); 19101 19102 // @event viewreset: Event 19103 // Fired when the map needs to redraw its content (this usually happens 19104 // on map zoom or load). Very useful for creating custom overlays. 19105 this.fire('viewreset'); 19106 19107 // @event load: Event 19108 // Fired when the map is initialized (when its center and zoom are set 19109 // for the first time). 19110 if (loading) { 19111 this.fire('load'); 19112 } 19113 }, 19114 19115 _moveStart: function (zoomChanged, noMoveStart) { 19116 // @event zoomstart: Event 19117 // Fired when the map zoom is about to change (e.g. before zoom animation). 19118 // @event movestart: Event 19119 // Fired when the view of the map starts changing (e.g. user starts dragging the map). 19120 if (zoomChanged) { 19121 this.fire('zoomstart'); 19122 } 19123 if (!noMoveStart) { 19124 this.fire('movestart'); 19125 } 19126 return this; 19127 }, 19128 19129 _move: function (center, zoom, data, supressEvent) { 19130 if (zoom === undefined) { 19131 zoom = this._zoom; 19132 } 19133 var zoomChanged = this._zoom !== zoom; 19134 19135 this._zoom = zoom; 19136 this._lastCenter = center; 19137 this._pixelOrigin = this._getNewPixelOrigin(center); 19138 19139 if (!supressEvent) { 19140 // @event zoom: Event 19141 // Fired repeatedly during any change in zoom level, 19142 // including zoom and fly animations. 19143 if (zoomChanged || (data && data.pinch)) { // Always fire 'zoom' if pinching because #3530 19144 this.fire('zoom', data); 19145 } 19146 19147 // @event move: Event 19148 // Fired repeatedly during any movement of the map, 19149 // including pan and fly animations. 19150 this.fire('move', data); 19151 } else if (data && data.pinch) { // Always fire 'zoom' if pinching because #3530 19152 this.fire('zoom', data); 19153 } 19154 return this; 19155 }, 19156 19157 _moveEnd: function (zoomChanged) { 19158 // @event zoomend: Event 19159 // Fired when the map zoom changed, after any animations. 19160 if (zoomChanged) { 19161 this.fire('zoomend'); 19162 } 19163 19164 // @event moveend: Event 19165 // Fired when the center of the map stops changing 19166 // (e.g. user stopped dragging the map or after non-centered zoom). 19167 return this.fire('moveend'); 19168 }, 19169 19170 _stop: function () { 19171 cancelAnimFrame(this._flyToFrame); 19172 if (this._panAnim) { 19173 this._panAnim.stop(); 19174 } 19175 return this; 19176 }, 19177 19178 _rawPanBy: function (offset) { 19179 setPosition(this._mapPane, this._getMapPanePos().subtract(offset)); 19180 }, 19181 19182 _getZoomSpan: function () { 19183 return this.getMaxZoom() - this.getMinZoom(); 19184 }, 19185 19186 _panInsideMaxBounds: function () { 19187 if (!this._enforcingBounds) { 19188 this.panInsideBounds(this.options.maxBounds); 19189 } 19190 }, 19191 19192 _checkIfLoaded: function () { 19193 if (!this._loaded) { 19194 throw new Error('Set map center and zoom first.'); 19195 } 19196 }, 19197 19198 // DOM event handling 19199 19200 // @section Interaction events 19201 _initEvents: function (remove) { 19202 this._targets = {}; 19203 this._targets[stamp(this._container)] = this; 19204 19205 var onOff = remove ? off : on; 19206 19207 // @event click: MouseEvent 19208 // Fired when the user clicks (or taps) the map. 19209 // @event dblclick: MouseEvent 19210 // Fired when the user double-clicks (or double-taps) the map. 19211 // @event mousedown: MouseEvent 19212 // Fired when the user pushes the mouse button on the map. 19213 // @event mouseup: MouseEvent 19214 // Fired when the user releases the mouse button on the map. 19215 // @event mouseover: MouseEvent 19216 // Fired when the mouse enters the map. 19217 // @event mouseout: MouseEvent 19218 // Fired when the mouse leaves the map. 19219 // @event mousemove: MouseEvent 19220 // Fired while the mouse moves over the map. 19221 // @event contextmenu: MouseEvent 19222 // Fired when the user pushes the right mouse button on the map, prevents 19223 // default browser context menu from showing if there are listeners on 19224 // this event. Also fired on mobile when the user holds a single touch 19225 // for a second (also called long press). 19226 // @event keypress: KeyboardEvent 19227 // Fired when the user presses a key from the keyboard that produces a character value while the map is focused. 19228 // @event keydown: KeyboardEvent 19229 // Fired when the user presses a key from the keyboard while the map is focused. Unlike the `keypress` event, 19230 // the `keydown` event is fired for keys that produce a character value and for keys 19231 // that do not produce a character value. 19232 // @event keyup: KeyboardEvent 19233 // Fired when the user releases a key from the keyboard while the map is focused. 19234 onOff(this._container, 'click dblclick mousedown mouseup ' + 19235 'mouseover mouseout mousemove contextmenu keypress keydown keyup', this._handleDOMEvent, this); 19236 19237 if (this.options.trackResize) { 19238 onOff(window, 'resize', this._onResize, this); 19239 } 19240 19241 if (Browser.any3d && this.options.transform3DLimit) { 19242 (remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd); 19243 } 19244 }, 19245 19246 _onResize: function () { 19247 cancelAnimFrame(this._resizeRequest); 19248 this._resizeRequest = requestAnimFrame( 19249 function () { this.invalidateSize({debounceMoveend: true}); }, this); 19250 }, 19251 19252 _onScroll: function () { 19253 this._container.scrollTop = 0; 19254 this._container.scrollLeft = 0; 19255 }, 19256 19257 _onMoveEnd: function () { 19258 var pos = this._getMapPanePos(); 19259 if (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) { 19260 // https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have 19261 // a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/ 19262 this._resetView(this.getCenter(), this.getZoom()); 19263 } 19264 }, 19265 19266 _findEventTargets: function (e, type) { 19267 var targets = [], 19268 target, 19269 isHover = type === 'mouseout' || type === 'mouseover', 19270 src = e.target || e.srcElement, 19271 dragging = false; 19272 19273 while (src) { 19274 target = this._targets[stamp(src)]; 19275 if (target && (type === 'click' || type === 'preclick') && this._draggableMoved(target)) { 19276 // Prevent firing click after you just dragged an object. 19277 dragging = true; 19278 break; 19279 } 19280 if (target && target.listens(type, true)) { 19281 if (isHover && !isExternalTarget(src, e)) { break; } 19282 targets.push(target); 19283 if (isHover) { break; } 19284 } 19285 if (src === this._container) { break; } 19286 src = src.parentNode; 19287 } 19288 if (!targets.length && !dragging && !isHover && this.listens(type, true)) { 19289 targets = [this]; 19290 } 19291 return targets; 19292 }, 19293 19294 _isClickDisabled: function (el) { 19295 while (el && el !== this._container) { 19296 if (el['_leaflet_disable_click']) { return true; } 19297 el = el.parentNode; 19298 } 19299 }, 19300 19301 _handleDOMEvent: function (e) { 19302 var el = (e.target || e.srcElement); 19303 if (!this._loaded || el['_leaflet_disable_events'] || e.type === 'click' && this._isClickDisabled(el)) { 19304 return; 19305 } 19306 19307 var type = e.type; 19308 19309 if (type === 'mousedown') { 19310 // prevents outline when clicking on keyboard-focusable element 19311 preventOutline(el); 19312 } 19313 19314 this._fireDOMEvent(e, type); 19315 }, 19316 19317 _mouseEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'], 19318 19319 _fireDOMEvent: function (e, type, canvasTargets) { 19320 19321 if (e.type === 'click') { 19322 // Fire a synthetic 'preclick' event which propagates up (mainly for closing popups). 19323 // @event preclick: MouseEvent 19324 // Fired before mouse click on the map (sometimes useful when you 19325 // want something to happen on click before any existing click 19326 // handlers start running). 19327 var synth = extend({}, e); 19328 synth.type = 'preclick'; 19329 this._fireDOMEvent(synth, synth.type, canvasTargets); 19330 } 19331 19332 // Find the layer the event is propagating from and its parents. 19333 var targets = this._findEventTargets(e, type); 19334 19335 if (canvasTargets) { 19336 var filtered = []; // pick only targets with listeners 19337 for (var i = 0; i < canvasTargets.length; i++) { 19338 if (canvasTargets[i].listens(type, true)) { 19339 filtered.push(canvasTargets[i]); 19340 } 19341 } 19342 targets = filtered.concat(targets); 19343 } 19344 19345 if (!targets.length) { return; } 19346 19347 if (type === 'contextmenu') { 19348 preventDefault(e); 19349 } 19350 19351 var target = targets[0]; 19352 var data = { 19353 originalEvent: e 19354 }; 19355 19356 if (e.type !== 'keypress' && e.type !== 'keydown' && e.type !== 'keyup') { 19357 var isMarker = target.getLatLng && (!target._radius || target._radius <= 10); 19358 data.containerPoint = isMarker ? 19359 this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e); 19360 data.layerPoint = this.containerPointToLayerPoint(data.containerPoint); 19361 data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint); 19362 } 19363 19364 for (i = 0; i < targets.length; i++) { 19365 targets[i].fire(type, data, true); 19366 if (data.originalEvent._stopped || 19367 (targets[i].options.bubblingMouseEvents === false && indexOf(this._mouseEvents, type) !== -1)) { return; } 19368 } 19369 }, 19370 19371 _draggableMoved: function (obj) { 19372 obj = obj.dragging && obj.dragging.enabled() ? obj : this; 19373 return (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved()); 19374 }, 19375 19376 _clearHandlers: function () { 19377 for (var i = 0, len = this._handlers.length; i < len; i++) { 19378 this._handlers[i].disable(); 19379 } 19380 }, 19381 19382 // @section Other Methods 19383 19384 // @method whenReady(fn: Function, context?: Object): this 19385 // Runs the given function `fn` when the map gets initialized with 19386 // a view (center and zoom) and at least one layer, or immediately 19387 // if it's already initialized, optionally passing a function context. 19388 whenReady: function (callback, context) { 19389 if (this._loaded) { 19390 callback.call(context || this, {target: this}); 19391 } else { 19392 this.on('load', callback, context); 19393 } 19394 return this; 19395 }, 19396 19397 19398 // private methods for getting map state 19399 19400 _getMapPanePos: function () { 19401 return getPosition(this._mapPane) || new Point(0, 0); 19402 }, 19403 19404 _moved: function () { 19405 var pos = this._getMapPanePos(); 19406 return pos && !pos.equals([0, 0]); 19407 }, 19408 19409 _getTopLeftPoint: function (center, zoom) { 19410 var pixelOrigin = center && zoom !== undefined ? 19411 this._getNewPixelOrigin(center, zoom) : 19412 this.getPixelOrigin(); 19413 return pixelOrigin.subtract(this._getMapPanePos()); 19414 }, 19415 19416 _getNewPixelOrigin: function (center, zoom) { 19417 var viewHalf = this.getSize()._divideBy(2); 19418 return this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round(); 19419 }, 19420 19421 _latLngToNewLayerPoint: function (latlng, zoom, center) { 19422 var topLeft = this._getNewPixelOrigin(center, zoom); 19423 return this.project(latlng, zoom)._subtract(topLeft); 19424 }, 19425 19426 _latLngBoundsToNewLayerBounds: function (latLngBounds, zoom, center) { 19427 var topLeft = this._getNewPixelOrigin(center, zoom); 19428 return toBounds([ 19429 this.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft), 19430 this.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft), 19431 this.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft), 19432 this.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft) 19433 ]); 19434 }, 19435 19436 // layer point of the current center 19437 _getCenterLayerPoint: function () { 19438 return this.containerPointToLayerPoint(this.getSize()._divideBy(2)); 19439 }, 19440 19441 // offset of the specified place to the current center in pixels 19442 _getCenterOffset: function (latlng) { 19443 return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint()); 19444 }, 19445 19446 // adjust center for view to get inside bounds 19447 _limitCenter: function (center, zoom, bounds) { 19448 19449 if (!bounds) { return center; } 19450 19451 var centerPoint = this.project(center, zoom), 19452 viewHalf = this.getSize().divideBy(2), 19453 viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)), 19454 offset = this._getBoundsOffset(viewBounds, bounds, zoom); 19455 19456 // If offset is less than a pixel, ignore. 19457 // This prevents unstable projections from getting into 19458 // an infinite loop of tiny offsets. 19459 if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) { 19460 return center; 19461 } 19462 19463 return this.unproject(centerPoint.add(offset), zoom); 19464 }, 19465 19466 // adjust offset for view to get inside bounds 19467 _limitOffset: function (offset, bounds) { 19468 if (!bounds) { return offset; } 19469 19470 var viewBounds = this.getPixelBounds(), 19471 newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset)); 19472 19473 return offset.add(this._getBoundsOffset(newBounds, bounds)); 19474 }, 19475 19476 // returns offset needed for pxBounds to get inside maxBounds at a specified zoom 19477 _getBoundsOffset: function (pxBounds, maxBounds, zoom) { 19478 var projectedMaxBounds = toBounds( 19479 this.project(maxBounds.getNorthEast(), zoom), 19480 this.project(maxBounds.getSouthWest(), zoom) 19481 ), 19482 minOffset = projectedMaxBounds.min.subtract(pxBounds.min), 19483 maxOffset = projectedMaxBounds.max.subtract(pxBounds.max), 19484 19485 dx = this._rebound(minOffset.x, -maxOffset.x), 19486 dy = this._rebound(minOffset.y, -maxOffset.y); 19487 19488 return new Point(dx, dy); 19489 }, 19490 19491 _rebound: function (left, right) { 19492 return left + right > 0 ? 19493 Math.round(left - right) / 2 : 19494 Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right)); 19495 }, 19496 19497 _limitZoom: function (zoom) { 19498 var min = this.getMinZoom(), 19499 max = this.getMaxZoom(), 19500 snap = Browser.any3d ? this.options.zoomSnap : 1; 19501 if (snap) { 19502 zoom = Math.round(zoom / snap) * snap; 19503 } 19504 return Math.max(min, Math.min(max, zoom)); 19505 }, 19506 19507 _onPanTransitionStep: function () { 19508 this.fire('move'); 19509 }, 19510 19511 _onPanTransitionEnd: function () { 19512 removeClass(this._mapPane, 'leaflet-pan-anim'); 19513 this.fire('moveend'); 19514 }, 19515 19516 _tryAnimatedPan: function (center, options) { 19517 // difference between the new and current centers in pixels 19518 var offset = this._getCenterOffset(center)._trunc(); 19519 19520 // don't animate too far unless animate: true specified in options 19521 if ((options && options.animate) !== true && !this.getSize().contains(offset)) { return false; } 19522 19523 this.panBy(offset, options); 19524 19525 return true; 19526 }, 19527 19528 _createAnimProxy: function () { 19529 19530 var proxy = this._proxy = create$1('div', 'leaflet-proxy leaflet-zoom-animated'); 19531 this._panes.mapPane.appendChild(proxy); 19532 19533 this.on('zoomanim', function (e) { 19534 var prop = TRANSFORM, 19535 transform = this._proxy.style[prop]; 19536 19537 setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)); 19538 19539 // workaround for case when transform is the same and so transitionend event is not fired 19540 if (transform === this._proxy.style[prop] && this._animatingZoom) { 19541 this._onZoomTransitionEnd(); 19542 } 19543 }, this); 19544 19545 this.on('load moveend', this._animMoveEnd, this); 19546 19547 this._on('unload', this._destroyAnimProxy, this); 19548 }, 19549 19550 _destroyAnimProxy: function () { 19551 remove(this._proxy); 19552 this.off('load moveend', this._animMoveEnd, this); 19553 delete this._proxy; 19554 }, 19555 19556 _animMoveEnd: function () { 19557 var c = this.getCenter(), 19558 z = this.getZoom(); 19559 setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1)); 19560 }, 19561 19562 _catchTransitionEnd: function (e) { 19563 if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) { 19564 this._onZoomTransitionEnd(); 19565 } 19566 }, 19567 19568 _nothingToAnimate: function () { 19569 return !this._container.getElementsByClassName('leaflet-zoom-animated').length; 19570 }, 19571 19572 _tryAnimatedZoom: function (center, zoom, options) { 19573 19574 if (this._animatingZoom) { return true; } 19575 19576 options = options || {}; 19577 19578 // don't animate if disabled, not supported or zoom difference is too large 19579 if (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() || 19580 Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) { return false; } 19581 19582 // offset is the pixel coords of the zoom origin relative to the current center 19583 var scale = this.getZoomScale(zoom), 19584 offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale); 19585 19586 // don't animate if the zoom origin isn't within one screen from the current center, unless forced 19587 if (options.animate !== true && !this.getSize().contains(offset)) { return false; } 19588 19589 requestAnimFrame(function () { 19590 this 19591 ._moveStart(true, false) 19592 ._animateZoom(center, zoom, true); 19593 }, this); 19594 19595 return true; 19596 }, 19597 19598 _animateZoom: function (center, zoom, startAnim, noUpdate) { 19599 if (!this._mapPane) { return; } 19600 19601 if (startAnim) { 19602 this._animatingZoom = true; 19603 19604 // remember what center/zoom to set after animation 19605 this._animateToCenter = center; 19606 this._animateToZoom = zoom; 19607 19608 addClass(this._mapPane, 'leaflet-zoom-anim'); 19609 } 19610 19611 // @section Other Events 19612 // @event zoomanim: ZoomAnimEvent 19613 // Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom. 19614 this.fire('zoomanim', { 19615 center: center, 19616 zoom: zoom, 19617 noUpdate: noUpdate 19618 }); 19619 19620 if (!this._tempFireZoomEvent) { 19621 this._tempFireZoomEvent = this._zoom !== this._animateToZoom; 19622 } 19623 19624 this._move(this._animateToCenter, this._animateToZoom, undefined, true); 19625 19626 // Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693 19627 setTimeout(bind(this._onZoomTransitionEnd, this), 250); 19628 }, 19629 19630 _onZoomTransitionEnd: function () { 19631 if (!this._animatingZoom) { return; } 19632 19633 if (this._mapPane) { 19634 removeClass(this._mapPane, 'leaflet-zoom-anim'); 19635 } 19636 19637 this._animatingZoom = false; 19638 19639 this._move(this._animateToCenter, this._animateToZoom, undefined, true); 19640 19641 if (this._tempFireZoomEvent) { 19642 this.fire('zoom'); 19643 } 19644 delete this._tempFireZoomEvent; 19645 19646 this.fire('move'); 19647 19648 this._moveEnd(true); 19649 } 19650 }); 19651 19652 // @section 19653 19654 // @factory L.map(id: String, options?: Map options) 19655 // Instantiates a map object given the DOM ID of a `<div>` element 19656 // and optionally an object literal with `Map options`. 19657 // 19658 // @alternative 19659 // @factory L.map(el: HTMLElement, options?: Map options) 19660 // Instantiates a map object given an instance of a `<div>` HTML element 19661 // and optionally an object literal with `Map options`. 19662 function createMap(id, options) { 19663 return new Map(id, options); 19664 } 19665 19666 /* 19667 * @class Control 19668 * @aka L.Control 19669 * @inherits Class 19670 * 19671 * L.Control is a base class for implementing map controls. Handles positioning. 19672 * All other controls extend from this class. 19673 */ 19674 19675 var Control = Class.extend({ 19676 // @section 19677 // @aka Control Options 19678 options: { 19679 // @option position: String = 'topright' 19680 // The position of the control (one of the map corners). Possible values are `'topleft'`, 19681 // `'topright'`, `'bottomleft'` or `'bottomright'` 19682 position: 'topright' 19683 }, 19684 19685 initialize: function (options) { 19686 setOptions(this, options); 19687 }, 19688 19689 /* @section 19690 * Classes extending L.Control will inherit the following methods: 19691 * 19692 * @method getPosition: string 19693 * Returns the position of the control. 19694 */ 19695 getPosition: function () { 19696 return this.options.position; 19697 }, 19698 19699 // @method setPosition(position: string): this 19700 // Sets the position of the control. 19701 setPosition: function (position) { 19702 var map = this._map; 19703 19704 if (map) { 19705 map.removeControl(this); 19706 } 19707 19708 this.options.position = position; 19709 19710 if (map) { 19711 map.addControl(this); 19712 } 19713 19714 return this; 19715 }, 19716 19717 // @method getContainer: HTMLElement 19718 // Returns the HTMLElement that contains the control. 19719 getContainer: function () { 19720 return this._container; 19721 }, 19722 19723 // @method addTo(map: Map): this 19724 // Adds the control to the given map. 19725 addTo: function (map) { 19726 this.remove(); 19727 this._map = map; 19728 19729 var container = this._container = this.onAdd(map), 19730 pos = this.getPosition(), 19731 corner = map._controlCorners[pos]; 19732 19733 addClass(container, 'leaflet-control'); 19734 19735 if (pos.indexOf('bottom') !== -1) { 19736 corner.insertBefore(container, corner.firstChild); 19737 } else { 19738 corner.appendChild(container); 19739 } 19740 19741 this._map.on('unload', this.remove, this); 19742 19743 return this; 19744 }, 19745 19746 // @method remove: this 19747 // Removes the control from the map it is currently active on. 19748 remove: function () { 19749 if (!this._map) { 19750 return this; 19751 } 19752 19753 remove(this._container); 19754 19755 if (this.onRemove) { 19756 this.onRemove(this._map); 19757 } 19758 19759 this._map.off('unload', this.remove, this); 19760 this._map = null; 19761 19762 return this; 19763 }, 19764 19765 _refocusOnMap: function (e) { 19766 // if map exists and event is not a keyboard event 19767 if (this._map && e && e.screenX > 0 && e.screenY > 0) { 19768 this._map.getContainer().focus(); 19769 } 19770 } 19771 }); 19772 19773 var control = function (options) { 19774 return new Control(options); 19775 }; 19776 19777 /* @section Extension methods 19778 * @uninheritable 19779 * 19780 * Every control should extend from `L.Control` and (re-)implement the following methods. 19781 * 19782 * @method onAdd(map: Map): HTMLElement 19783 * Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo). 19784 * 19785 * @method onRemove(map: Map) 19786 * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove). 19787 */ 19788 19789 /* @namespace Map 19790 * @section Methods for Layers and Controls 19791 */ 19792 Map.include({ 19793 // @method addControl(control: Control): this 19794 // Adds the given control to the map 19795 addControl: function (control) { 19796 control.addTo(this); 19797 return this; 19798 }, 19799 19800 // @method removeControl(control: Control): this 19801 // Removes the given control from the map 19802 removeControl: function (control) { 19803 control.remove(); 19804 return this; 19805 }, 19806 19807 _initControlPos: function () { 19808 var corners = this._controlCorners = {}, 19809 l = 'leaflet-', 19810 container = this._controlContainer = 19811 create$1('div', l + 'control-container', this._container); 19812 19813 function createCorner(vSide, hSide) { 19814 var className = l + vSide + ' ' + l + hSide; 19815 19816 corners[vSide + hSide] = create$1('div', className, container); 19817 } 19818 19819 createCorner('top', 'left'); 19820 createCorner('top', 'right'); 19821 createCorner('bottom', 'left'); 19822 createCorner('bottom', 'right'); 19823 }, 19824 19825 _clearControlPos: function () { 19826 for (var i in this._controlCorners) { 19827 remove(this._controlCorners[i]); 19828 } 19829 remove(this._controlContainer); 19830 delete this._controlCorners; 19831 delete this._controlContainer; 19832 } 19833 }); 19834 19835 /* 19836 * @class Control.Layers 19837 * @aka L.Control.Layers 19838 * @inherits Control 19839 * 19840 * The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](https://leafletjs.com/examples/layers-control/)). Extends `Control`. 19841 * 19842 * @example 19843 * 19844 * ```js 19845 * var baseLayers = { 19846 * "Mapbox": mapbox, 19847 * "OpenStreetMap": osm 19848 * }; 19849 * 19850 * var overlays = { 19851 * "Marker": marker, 19852 * "Roads": roadsLayer 19853 * }; 19854 * 19855 * L.control.layers(baseLayers, overlays).addTo(map); 19856 * ``` 19857 * 19858 * The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values: 19859 * 19860 * ```js 19861 * { 19862 * "<someName1>": layer1, 19863 * "<someName2>": layer2 19864 * } 19865 * ``` 19866 * 19867 * The layer names can contain HTML, which allows you to add additional styling to the items: 19868 * 19869 * ```js 19870 * {"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer} 19871 * ``` 19872 */ 19873 19874 var Layers = Control.extend({ 19875 // @section 19876 // @aka Control.Layers options 19877 options: { 19878 // @option collapsed: Boolean = true 19879 // If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation. 19880 collapsed: true, 19881 position: 'topright', 19882 19883 // @option autoZIndex: Boolean = true 19884 // If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off. 19885 autoZIndex: true, 19886 19887 // @option hideSingleBase: Boolean = false 19888 // If `true`, the base layers in the control will be hidden when there is only one. 19889 hideSingleBase: false, 19890 19891 // @option sortLayers: Boolean = false 19892 // Whether to sort the layers. When `false`, layers will keep the order 19893 // in which they were added to the control. 19894 sortLayers: false, 19895 19896 // @option sortFunction: Function = * 19897 // A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 19898 // that will be used for sorting the layers, when `sortLayers` is `true`. 19899 // The function receives both the `L.Layer` instances and their names, as in 19900 // `sortFunction(layerA, layerB, nameA, nameB)`. 19901 // By default, it sorts layers alphabetically by their name. 19902 sortFunction: function (layerA, layerB, nameA, nameB) { 19903 return nameA < nameB ? -1 : (nameB < nameA ? 1 : 0); 19904 } 19905 }, 19906 19907 initialize: function (baseLayers, overlays, options) { 19908 setOptions(this, options); 19909 19910 this._layerControlInputs = []; 19911 this._layers = []; 19912 this._lastZIndex = 0; 19913 this._handlingClick = false; 19914 19915 for (var i in baseLayers) { 19916 this._addLayer(baseLayers[i], i); 19917 } 19918 19919 for (i in overlays) { 19920 this._addLayer(overlays[i], i, true); 19921 } 19922 }, 19923 19924 onAdd: function (map) { 19925 this._initLayout(); 19926 this._update(); 19927 19928 this._map = map; 19929 map.on('zoomend', this._checkDisabledLayers, this); 19930 19931 for (var i = 0; i < this._layers.length; i++) { 19932 this._layers[i].layer.on('add remove', this._onLayerChange, this); 19933 } 19934 19935 return this._container; 19936 }, 19937 19938 addTo: function (map) { 19939 Control.prototype.addTo.call(this, map); 19940 // Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height. 19941 return this._expandIfNotCollapsed(); 19942 }, 19943 19944 onRemove: function () { 19945 this._map.off('zoomend', this._checkDisabledLayers, this); 19946 19947 for (var i = 0; i < this._layers.length; i++) { 19948 this._layers[i].layer.off('add remove', this._onLayerChange, this); 19949 } 19950 }, 19951 19952 // @method addBaseLayer(layer: Layer, name: String): this 19953 // Adds a base layer (radio button entry) with the given name to the control. 19954 addBaseLayer: function (layer, name) { 19955 this._addLayer(layer, name); 19956 return (this._map) ? this._update() : this; 19957 }, 19958 19959 // @method addOverlay(layer: Layer, name: String): this 19960 // Adds an overlay (checkbox entry) with the given name to the control. 19961 addOverlay: function (layer, name) { 19962 this._addLayer(layer, name, true); 19963 return (this._map) ? this._update() : this; 19964 }, 19965 19966 // @method removeLayer(layer: Layer): this 19967 // Remove the given layer from the control. 19968 removeLayer: function (layer) { 19969 layer.off('add remove', this._onLayerChange, this); 19970 19971 var obj = this._getLayer(stamp(layer)); 19972 if (obj) { 19973 this._layers.splice(this._layers.indexOf(obj), 1); 19974 } 19975 return (this._map) ? this._update() : this; 19976 }, 19977 19978 // @method expand(): this 19979 // Expand the control container if collapsed. 19980 expand: function () { 19981 addClass(this._container, 'leaflet-control-layers-expanded'); 19982 this._section.style.height = null; 19983 var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50); 19984 if (acceptableHeight < this._section.clientHeight) { 19985 addClass(this._section, 'leaflet-control-layers-scrollbar'); 19986 this._section.style.height = acceptableHeight + 'px'; 19987 } else { 19988 removeClass(this._section, 'leaflet-control-layers-scrollbar'); 19989 } 19990 this._checkDisabledLayers(); 19991 return this; 19992 }, 19993 19994 // @method collapse(): this 19995 // Collapse the control container if expanded. 19996 collapse: function () { 19997 removeClass(this._container, 'leaflet-control-layers-expanded'); 19998 return this; 19999 }, 20000 20001 _initLayout: function () { 20002 var className = 'leaflet-control-layers', 20003 container = this._container = create$1('div', className), 20004 collapsed = this.options.collapsed; 20005 20006 // makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released 20007 container.setAttribute('aria-haspopup', true); 20008 20009 disableClickPropagation(container); 20010 disableScrollPropagation(container); 20011 20012 var section = this._section = create$1('section', className + '-list'); 20013 20014 if (collapsed) { 20015 this._map.on('click', this.collapse, this); 20016 20017 on(container, { 20018 mouseenter: this._expandSafely, 20019 mouseleave: this.collapse 20020 }, this); 20021 } 20022 20023 var link = this._layersLink = create$1('a', className + '-toggle', container); 20024 link.href = '#'; 20025 link.title = 'Layers'; 20026 link.setAttribute('role', 'button'); 20027 20028 on(link, { 20029 keydown: function (e) { 20030 if (e.keyCode === 13) { 20031 this._expandSafely(); 20032 } 20033 }, 20034 // Certain screen readers intercept the key event and instead send a click event 20035 click: function (e) { 20036 preventDefault(e); 20037 this._expandSafely(); 20038 } 20039 }, this); 20040 20041 if (!collapsed) { 20042 this.expand(); 20043 } 20044 20045 this._baseLayersList = create$1('div', className + '-base', section); 20046 this._separator = create$1('div', className + '-separator', section); 20047 this._overlaysList = create$1('div', className + '-overlays', section); 20048 20049 container.appendChild(section); 20050 }, 20051 20052 _getLayer: function (id) { 20053 for (var i = 0; i < this._layers.length; i++) { 20054 20055 if (this._layers[i] && stamp(this._layers[i].layer) === id) { 20056 return this._layers[i]; 20057 } 20058 } 20059 }, 20060 20061 _addLayer: function (layer, name, overlay) { 20062 if (this._map) { 20063 layer.on('add remove', this._onLayerChange, this); 20064 } 20065 20066 this._layers.push({ 20067 layer: layer, 20068 name: name, 20069 overlay: overlay 20070 }); 20071 20072 if (this.options.sortLayers) { 20073 this._layers.sort(bind(function (a, b) { 20074 return this.options.sortFunction(a.layer, b.layer, a.name, b.name); 20075 }, this)); 20076 } 20077 20078 if (this.options.autoZIndex && layer.setZIndex) { 20079 this._lastZIndex++; 20080 layer.setZIndex(this._lastZIndex); 20081 } 20082 20083 this._expandIfNotCollapsed(); 20084 }, 20085 20086 _update: function () { 20087 if (!this._container) { return this; } 20088 20089 empty(this._baseLayersList); 20090 empty(this._overlaysList); 20091 20092 this._layerControlInputs = []; 20093 var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0; 20094 20095 for (i = 0; i < this._layers.length; i++) { 20096 obj = this._layers[i]; 20097 this._addItem(obj); 20098 overlaysPresent = overlaysPresent || obj.overlay; 20099 baseLayersPresent = baseLayersPresent || !obj.overlay; 20100 baseLayersCount += !obj.overlay ? 1 : 0; 20101 } 20102 20103 // Hide base layers section if there's only one layer. 20104 if (this.options.hideSingleBase) { 20105 baseLayersPresent = baseLayersPresent && baseLayersCount > 1; 20106 this._baseLayersList.style.display = baseLayersPresent ? '' : 'none'; 20107 } 20108 20109 this._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none'; 20110 20111 return this; 20112 }, 20113 20114 _onLayerChange: function (e) { 20115 if (!this._handlingClick) { 20116 this._update(); 20117 } 20118 20119 var obj = this._getLayer(stamp(e.target)); 20120 20121 // @namespace Map 20122 // @section Layer events 20123 // @event baselayerchange: LayersControlEvent 20124 // Fired when the base layer is changed through the [layers control](#control-layers). 20125 // @event overlayadd: LayersControlEvent 20126 // Fired when an overlay is selected through the [layers control](#control-layers). 20127 // @event overlayremove: LayersControlEvent 20128 // Fired when an overlay is deselected through the [layers control](#control-layers). 20129 // @namespace Control.Layers 20130 var type = obj.overlay ? 20131 (e.type === 'add' ? 'overlayadd' : 'overlayremove') : 20132 (e.type === 'add' ? 'baselayerchange' : null); 20133 20134 if (type) { 20135 this._map.fire(type, obj); 20136 } 20137 }, 20138 20139 // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079) 20140 _createRadioElement: function (name, checked) { 20141 20142 var radioHtml = '<input type="radio" class="leaflet-control-layers-selector" name="' + 20143 name + '"' + (checked ? ' checked="checked"' : '') + '/>'; 20144 20145 var radioFragment = document.createElement('div'); 20146 radioFragment.innerHTML = radioHtml; 20147 20148 return radioFragment.firstChild; 20149 }, 20150 20151 _addItem: function (obj) { 20152 var label = document.createElement('label'), 20153 checked = this._map.hasLayer(obj.layer), 20154 input; 20155 20156 if (obj.overlay) { 20157 input = document.createElement('input'); 20158 input.type = 'checkbox'; 20159 input.className = 'leaflet-control-layers-selector'; 20160 input.defaultChecked = checked; 20161 } else { 20162 input = this._createRadioElement('leaflet-base-layers_' + stamp(this), checked); 20163 } 20164 20165 this._layerControlInputs.push(input); 20166 input.layerId = stamp(obj.layer); 20167 20168 on(input, 'click', this._onInputClick, this); 20169 20170 var name = document.createElement('span'); 20171 name.innerHTML = ' ' + obj.name; 20172 20173 // Helps from preventing layer control flicker when checkboxes are disabled 20174 // https://github.com/Leaflet/Leaflet/issues/2771 20175 var holder = document.createElement('span'); 20176 20177 label.appendChild(holder); 20178 holder.appendChild(input); 20179 holder.appendChild(name); 20180 20181 var container = obj.overlay ? this._overlaysList : this._baseLayersList; 20182 container.appendChild(label); 20183 20184 this._checkDisabledLayers(); 20185 return label; 20186 }, 20187 20188 _onInputClick: function () { 20189
20189var inputs = this._layerControlInputs, 20190 input, layer; 20191 var addedLayers = [], 20192 removedLayers = []; 20193 20194 this._handlingClick = true; 20195 20196 for (var i = inputs.length - 1; i >= 0; i--) { 20197 input = inputs[i]; 20198 layer = this._getLayer(input.layerId).layer; 20199 20200 if (input.checked) { 20201 addedLayers.push(layer); 20202 } else if (!input.checked) { 20203 removedLayers.push(layer); 20204 } 20205 } 20206 20207 // Bugfix issue 2318: Should remove all old layers before readding new ones 20208 for (i = 0; i < removedLayers.length; i++) {
vendor: 1,180 bytes, lines 20209-20251
20209 if (this._map.hasLayer(removedLayers[i])) { 20210 this._map.removeLayer(removedLayers[i]); 20211 } 20212 } 20213 for (i = 0; i < addedLayers.length; i++) { 20214 if (!this._map.hasLayer(addedLayers[i])) { 20215 this._map.addLayer(addedLayers[i]); 20216 } 20217 } 20218 20219 this._handlingClick = false; 20220 20221 this._refocusOnMap(); 20222 }, 20223 20224 _checkDisabledLayers: function () { 20225 var inputs = this._layerControlInputs, 20226 input, 20227 layer, 20228 zoom = this._map.getZoom(); 20229 20230 for (var i = inputs.length - 1; i >= 0; i--) { 20231 input = inputs[i]; 20232 layer = this._getLayer(input.layerId).layer; 20233 input.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) || 20234 (layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom); 20235 20236 } 20237 }, 20238 20239 _expandIfNotCollapsed: function () { 20240 if (this._map && !this.options.collapsed) { 20241 this.expand(); 20242 } 20243 return this; 20244 }, 20245 20246 _expandSafely: function () { 20247 var section = this._section; 20248 on(section, 'click', preventDefault); 20249 this.expand(); 20250 setTimeout(function () { 20251 off(section, 'click', preventDefault)
vendor: 20,683 bytes, lines 20251-20940
20251; 20252 }); 20253 } 20254 20255 }); 20256 20257 20258 // @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options) 20259 // Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation. 20260 var layers = function (baseLayers, overlays, options) { 20261 return new Layers(baseLayers, overlays, options); 20262 }; 20263 20264 /* 20265 * @class Control.Zoom 20266 * @aka L.Control.Zoom 20267 * @inherits Control 20268 * 20269 * A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`. 20270 */ 20271 20272 var Zoom = Control.extend({ 20273 // @section 20274 // @aka Control.Zoom options 20275 options: { 20276 position: 'topleft', 20277 20278 // @option zoomInText: String = '<span aria-hidden="true">+</span>' 20279 // The text set on the 'zoom in' button. 20280 zoomInText: '<span aria-hidden="true">+</span>', 20281 20282 // @option zoomInTitle: String = 'Zoom in' 20283 // The title set on the 'zoom in' button. 20284 zoomInTitle: 'Zoom in', 20285 20286 // @option zoomOutText: String = '<span aria-hidden="true">−</span>' 20287 // The text set on the 'zoom out' button. 20288 zoomOutText: '<span aria-hidden="true">−</span>', 20289 20290 // @option zoomOutTitle: String = 'Zoom out' 20291 // The title set on the 'zoom out' button. 20292 zoomOutTitle: 'Zoom out' 20293 }, 20294 20295 onAdd: function (map) { 20296 var zoomName = 'leaflet-control-zoom', 20297 container = create$1('div', zoomName + ' leaflet-bar'), 20298 options = this.options; 20299 20300 this._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle, 20301 zoomName + '-in', container, this._zoomIn); 20302 this._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle, 20303 zoomName + '-out', container, this._zoomOut); 20304 20305 this._updateDisabled(); 20306 map.on('zoomend zoomlevelschange', this._updateDisabled, this); 20307 20308 return container; 20309 }, 20310 20311 onRemove: function (map) { 20312 map.off('zoomend zoomlevelschange', this._updateDisabled, this); 20313 }, 20314 20315 disable: function () { 20316 this._disabled = true; 20317 this._updateDisabled(); 20318 return this; 20319 }, 20320 20321 enable: function () { 20322 this._disabled = false; 20323 this._updateDisabled(); 20324 return this; 20325 }, 20326 20327 _zoomIn: function (e) { 20328 if (!this._disabled && this._map._zoom < this._map.getMaxZoom()) { 20329 this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); 20330 } 20331 }, 20332 20333 _zoomOut: function (e) { 20334 if (!this._disabled && this._map._zoom > this._map.getMinZoom()) { 20335 this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); 20336 } 20337 }, 20338 20339 _createButton: function (html, title, className, container, fn) { 20340 var link = create$1('a', className, container); 20341 link.innerHTML = html; 20342 link.href = '#'; 20343 link.title = title; 20344 20345 /* 20346 * Will force screen readers like VoiceOver to read this as "Zoom in - button" 20347 */ 20348 link.setAttribute('role', 'button'); 20349 link.setAttribute('aria-label', title); 20350 20351 disableClickPropagation(link); 20352 on(link, 'click', stop); 20353 on(link, 'click', fn, this); 20354 on(link, 'click', this._refocusOnMap, this); 20355 20356 return link; 20357 }, 20358 20359 _updateDisabled: function () { 20360 var map = this._map, 20361 className = 'leaflet-disabled'; 20362 20363 removeClass(this._zoomInButton, className); 20364 removeClass(this._zoomOutButton, className); 20365 this._zoomInButton.setAttribute('aria-disabled', 'false'); 20366 this._zoomOutButton.setAttribute('aria-disabled', 'false'); 20367 20368 if (this._disabled || map._zoom === map.getMinZoom()) { 20369 addClass(this._zoomOutButton, className); 20370 this._zoomOutButton.setAttribute('aria-disabled', 'true'); 20371 } 20372 if (this._disabled || map._zoom === map.getMaxZoom()) { 20373 addClass(this._zoomInButton, className); 20374 this._zoomInButton.setAttribute('aria-disabled', 'true'); 20375 } 20376 } 20377 }); 20378 20379 // @namespace Map 20380 // @section Control options 20381 // @option zoomControl: Boolean = true 20382 // Whether a [zoom control](#control-zoom) is added to the map by default. 20383 Map.mergeOptions({ 20384 zoomControl: true 20385 }); 20386 20387 Map.addInitHook(function () { 20388 if (this.options.zoomControl) { 20389 // @section Controls 20390 // @property zoomControl: Control.Zoom 20391 // The default zoom control (only available if the 20392 // [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map). 20393 this.zoomControl = new Zoom(); 20394 this.addControl(this.zoomControl); 20395 } 20396 }); 20397 20398 // @namespace Control.Zoom 20399 // @factory L.control.zoom(options: Control.Zoom options) 20400 // Creates a zoom control 20401 var zoom = function (options) { 20402 return new Zoom(options); 20403 }; 20404 20405 /* 20406 * @class Control.Scale 20407 * @aka L.Control.Scale 20408 * @inherits Control 20409 * 20410 * A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`. 20411 * 20412 * @example 20413 * 20414 * ```js 20415 * L.control.scale().addTo(map); 20416 * ``` 20417 */ 20418 20419 var Scale = Control.extend({ 20420 // @section 20421 // @aka Control.Scale options 20422 options: { 20423 position: 'bottomleft', 20424 20425 // @option maxWidth: Number = 100 20426 // Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500). 20427 maxWidth: 100, 20428 20429 // @option metric: Boolean = True 20430 // Whether to show the metric scale line (m/km). 20431 metric: true, 20432 20433 // @option imperial: Boolean = True 20434 // Whether to show the imperial scale line (mi/ft). 20435 imperial: true 20436 20437 // @option updateWhenIdle: Boolean = false 20438 // If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)). 20439 }, 20440 20441 onAdd: function (map) { 20442 var className = 'leaflet-control-scale', 20443 container = create$1('div', className), 20444 options = this.options; 20445 20446 this._addScales(options, className + '-line', container); 20447 20448 map.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this); 20449 map.whenReady(this._update, this); 20450 20451 return container; 20452 }, 20453 20454 onRemove: function (map) { 20455 map.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this); 20456 }, 20457 20458 _addScales: function (options, className, container) { 20459 if (options.metric) { 20460 this._mScale = create$1('div', className, container); 20461 } 20462 if (options.imperial) { 20463 this._iScale = create$1('div', className, container); 20464 } 20465 }, 20466 20467 _update: function () { 20468 var map = this._map, 20469 y = map.getSize().y / 2; 20470 20471 var maxMeters = map.distance( 20472 map.containerPointToLatLng([0, y]), 20473 map.containerPointToLatLng([this.options.maxWidth, y])); 20474 20475 this._updateScales(maxMeters); 20476 }, 20477 20478 _updateScales: function (maxMeters) { 20479 if (this.options.metric && maxMeters) { 20480 this._updateMetric(maxMeters); 20481 } 20482 if (this.options.imperial && maxMeters) { 20483 this._updateImperial(maxMeters); 20484 } 20485 }, 20486 20487 _updateMetric: function (maxMeters) { 20488 var meters = this._getRoundNum(maxMeters), 20489 label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km'; 20490 20491 this._updateScale(this._mScale, label, meters / maxMeters); 20492 }, 20493 20494 _updateImperial: function (maxMeters) { 20495 var maxFeet = maxMeters * 3.2808399, 20496 maxMiles, miles, feet; 20497 20498 if (maxFeet > 5280) { 20499 maxMiles = maxFeet / 5280; 20500 miles = this._getRoundNum(maxMiles); 20501 this._updateScale(this._iScale, miles + ' mi', miles / maxMiles); 20502 20503 } else { 20504 feet = this._getRoundNum(maxFeet); 20505 this._updateScale(this._iScale, feet + ' ft', feet / maxFeet); 20506 } 20507 }, 20508 20509 _updateScale: function (scale, text, ratio) { 20510 scale.style.width = Math.round(this.options.maxWidth * ratio) + 'px'; 20511 scale.innerHTML = text; 20512 }, 20513 20514 _getRoundNum: function (num) { 20515 var pow10 = Math.pow(10, (Math.floor(num) + '').length - 1), 20516 d = num / pow10; 20517 20518 d = d >= 10 ? 10 : 20519 d >= 5 ? 5 : 20520 d >= 3 ? 3 : 20521 d >= 2 ? 2 : 1; 20522 20523 return pow10 * d; 20524 } 20525 }); 20526 20527 20528 // @factory L.control.scale(options?: Control.Scale options) 20529 // Creates an scale control with the given options. 20530 var scale = function (options) { 20531 return new Scale(options); 20532 }; 20533 20534 var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>'; 20535 20536 20537 /* 20538 * @class Control.Attribution 20539 * @aka L.Control.Attribution 20540 * @inherits Control 20541 * 20542 * The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control. 20543 */ 20544 20545 var Attribution = Control.extend({ 20546 // @section 20547 // @aka Control.Attribution options 20548 options: { 20549 position: 'bottomright', 20550 20551 // @option prefix: String|false = 'Leaflet' 20552 // The HTML text shown before the attributions. Pass `false` to disable. 20553 prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (Browser.inlineSvg ? ukrainianFlag + ' ' : '') + 'Leaflet</a>' 20554 }, 20555 20556 initialize: function (options) { 20557 setOptions(this, options); 20558 20559 this._attributions = {}; 20560 }, 20561 20562 onAdd: function (map) { 20563 map.attributionControl = this; 20564 this._container = create$1('div', 'leaflet-control-attribution'); 20565 disableClickPropagation(this._container); 20566 20567 // TODO ugly, refactor 20568 for (var i in map._layers) { 20569 if (map._layers[i].getAttribution) { 20570 this.addAttribution(map._layers[i].getAttribution()); 20571 } 20572 } 20573 20574 this._update(); 20575 20576 map.on('layeradd', this._addAttribution, this); 20577 20578 return this._container; 20579 }, 20580 20581 onRemove: function (map) { 20582 map.off('layeradd', this._addAttribution, this); 20583 }, 20584 20585 _addAttribution: function (ev) { 20586 if (ev.layer.getAttribution) { 20587 this.addAttribution(ev.layer.getAttribution()); 20588 ev.layer.once('remove', function () { 20589 this.removeAttribution(ev.layer.getAttribution()); 20590 }, this); 20591 } 20592 }, 20593 20594 // @method setPrefix(prefix: String|false): this 20595 // The HTML text shown before the attributions. Pass `false` to disable. 20596 setPrefix: function (prefix) { 20597 this.options.prefix = prefix; 20598 this._update(); 20599 return this; 20600 }, 20601 20602 // @method addAttribution(text: String): this 20603 // Adds an attribution text (e.g. `'© OpenStreetMap contributors'`). 20604 addAttribution: function (text) { 20605 if (!text) { return this; } 20606 20607 if (!this._attributions[text]) { 20608 this._attributions[text] = 0; 20609 } 20610 this._attributions[text]++; 20611 20612 this._update(); 20613 20614 return this; 20615 }, 20616 20617 // @method removeAttribution(text: String): this 20618 // Removes an attribution text. 20619 removeAttribution: function (text) { 20620 if (!text) { return this; } 20621 20622 if (this._attributions[text]) { 20623 this._attributions[text]--; 20624 this._update(); 20625 } 20626 20627 return this; 20628 }, 20629 20630 _update: function () { 20631 if (!this._map) { return; } 20632 20633 var attribs = []; 20634 20635 for (var i in this._attributions) { 20636 if (this._attributions[i]) { 20637 attribs.push(i); 20638 } 20639 } 20640 20641 var prefixAndAttribs = []; 20642 20643 if (this.options.prefix) { 20644 prefixAndAttribs.push(this.options.prefix); 20645 } 20646 if (attribs.length) { 20647 prefixAndAttribs.push(attribs.join(', ')); 20648 } 20649 20650 this._container.innerHTML = prefixAndAttribs.join(' <span aria-hidden="true">|</span> '); 20651 } 20652 }); 20653 20654 // @namespace Map 20655 // @section Control options 20656 // @option attributionControl: Boolean = true 20657 // Whether a [attribution control](#control-attribution) is added to the map by default. 20658 Map.mergeOptions({ 20659 attributionControl: true 20660 }); 20661 20662 Map.addInitHook(function () { 20663 if (this.options.attributionControl) { 20664 new Attribution().addTo(this); 20665 } 20666 }); 20667 20668 // @namespace Control.Attribution 20669 // @factory L.control.attribution(options: Control.Attribution options) 20670 // Creates an attribution control. 20671 var attribution = function (options) { 20672 return new Attribution(options); 20673 }; 20674 20675 Control.Layers = Layers; 20676 Control.Zoom = Zoom; 20677 Control.Scale = Scale; 20678 Control.Attribution = Attribution; 20679 20680 control.layers = layers; 20681 control.zoom = zoom; 20682 control.scale = scale; 20683 control.attribution = attribution; 20684 20685 /* 20686 L.Handler is a base class for handler classes that are used internally to inject 20687 interaction features like dragging to classes like Map and Marker. 20688 */ 20689 20690 // @class Handler 20691 // @aka L.Handler 20692 // Abstract class for map interaction handlers 20693 20694 var Handler = Class.extend({ 20695 initialize: function (map) { 20696 this._map = map; 20697 }, 20698 20699 // @method enable(): this 20700 // Enables the handler 20701 enable: function () { 20702 if (this._enabled) { return this; } 20703 20704 this._enabled = true; 20705 this.addHooks(); 20706 return this; 20707 }, 20708 20709 // @method disable(): this 20710 // Disables the handler 20711 disable: function () { 20712 if (!this._enabled) { return this; } 20713 20714 this._enabled = false; 20715 this.removeHooks(); 20716 return this; 20717 }, 20718 20719 // @method enabled(): Boolean 20720 // Returns `true` if the handler is enabled 20721 enabled: function () { 20722 return !!this._enabled; 20723 } 20724 20725 // @section Extension methods 20726 // Classes inheriting from `Handler` must implement the two following methods: 20727 // @method addHooks() 20728 // Called when the handler is enabled, should add event hooks. 20729 // @method removeHooks() 20730 // Called when the handler is disabled, should remove the event hooks added previously. 20731 }); 20732 20733 // @section There is static function which can be called without instantiating L.Handler: 20734 // @function addTo(map: Map, name: String): this 20735 // Adds a new Handler to the given map with the given name. 20736 Handler.addTo = function (map, name) { 20737 map.addHandler(name, this); 20738 return this; 20739 }; 20740 20741 var Mixin = {Events: Events}; 20742 20743 /* 20744 * @class Draggable 20745 * @aka L.Draggable 20746 * @inherits Evented 20747 * 20748 * A class for making DOM elements draggable (including touch support). 20749 * Used internally for map and marker dragging. Only works for elements 20750 * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition). 20751 * 20752 * @example 20753 * ```js 20754 * var draggable = new L.Draggable(elementToDrag); 20755 * draggable.enable(); 20756 * ``` 20757 */ 20758 20759 var START = Browser.touch ? 'touchstart mousedown' : 'mousedown'; 20760 20761 var Draggable = Evented.extend({ 20762 20763 options: { 20764 // @section 20765 // @aka Draggable options 20766 // @option clickTolerance: Number = 3 20767 // The max number of pixels a user can shift the mouse pointer during a click 20768 // for it to be considered a valid click (as opposed to a mouse drag). 20769 clickTolerance: 3 20770 }, 20771 20772 // @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options) 20773 // Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default). 20774 initialize: function (element, dragStartTarget, preventOutline, options) { 20775 setOptions(this, options); 20776 20777 this._element = element; 20778 this._dragStartTarget = dragStartTarget || element; 20779 this._preventOutline = preventOutline; 20780 }, 20781 20782 // @method enable() 20783 // Enables the dragging ability 20784 enable: function () { 20785 if (this._enabled) { return; } 20786 20787 on(this._dragStartTarget, START, this._onDown, this); 20788 20789 this._enabled = true; 20790 }, 20791 20792 // @method disable() 20793 // Disables the dragging ability 20794 disable: function () { 20795 if (!this._enabled) { return; } 20796 20797 // If we're currently dragging this draggable, 20798 // disabling it counts as first ending the drag. 20799 if (Draggable._dragging === this) { 20800 this.finishDrag(true); 20801 } 20802 20803 off(this._dragStartTarget, START, this._onDown, this); 20804 20805 this._enabled = false; 20806 this._moved = false; 20807 }, 20808 20809 _onDown: function (e) { 20810 // Ignore the event if disabled; this happens in IE11 20811 // under some circumstances, see #3666. 20812 if (!this._enabled) { return; } 20813 20814 this._moved = false; 20815 20816 if (hasClass(this._element, 'leaflet-zoom-anim')) { return; } 20817 20818 if (e.touches && e.touches.length !== 1) { 20819 // Finish dragging to avoid conflict with touchZoom 20820 if (Draggable._dragging === this) { 20821 this.finishDrag(); 20822 } 20823 return; 20824 } 20825 20826 if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } 20827 Draggable._dragging = this; // Prevent dragging multiple objects at once. 20828 20829 if (this._preventOutline) { 20830 preventOutline(this._element); 20831 } 20832 20833 disableImageDrag(); 20834 disableTextSelection(); 20835 20836 if (this._moving) { return; } 20837 20838 // @event down: Event 20839 // Fired when a drag is about to start. 20840 this.fire('down'); 20841 20842 var first = e.touches ? e.touches[0] : e, 20843 sizedParent = getSizedParentNode(this._element); 20844 20845 this._startPoint = new Point(first.clientX, first.clientY); 20846 this._startPos = getPosition(this._element); 20847 20848 // Cache the scale, so that we can continuously compensate for it during drag (_onMove). 20849 this._parentScale = getScale(sizedParent); 20850 20851 var mouseevent = e.type === 'mousedown'; 20852 on(document, mouseevent ? 'mousemove' : 'touchmove', this._onMove, this); 20853 on(document, mouseevent ? 'mouseup' : 'touchend touchcancel', this._onUp, this); 20854 }, 20855 20856 _onMove: function (e) { 20857 // Ignore the event if disabled; this happens in IE11 20858 // under some circumstances, see #3666. 20859 if (!this._enabled) { return; } 20860 20861 if (e.touches && e.touches.length > 1) { 20862 this._moved = true; 20863 return; 20864 } 20865 20866 var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e), 20867 offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint); 20868 20869 if (!offset.x && !offset.y) { return; } 20870 if (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; } 20871 20872 // We assume that the parent container's position, border and scale do not change for the duration of the drag. 20873 // Therefore there is no need to account for the position and border (they are eliminated by the subtraction) 20874 // and we can use the cached value for the scale. 20875 offset.x /= this._parentScale.x; 20876 offset.y /= this._parentScale.y; 20877 20878 preventDefault(e); 20879 20880 if (!this._moved) { 20881 // @event dragstart: Event 20882 // Fired when a drag starts 20883 this.fire('dragstart'); 20884 20885 this._moved = true; 20886 20887 addClass(document.body, 'leaflet-dragging'); 20888 20889 this._lastTarget = e.target || e.srcElement; 20890 // IE and Edge do not give the <use> element, so fetch it 20891 // if necessary 20892 if (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) { 20893 this._lastTarget = this._lastTarget.correspondingUseElement; 20894 } 20895 addClass(this._lastTarget, 'leaflet-drag-target'); 20896 } 20897 20898 this._newPos = this._startPos.add(offset); 20899 this._moving = true; 20900 20901 this._lastEvent = e; 20902 this._updatePosition(); 20903 }, 20904 20905 _updatePosition: function () { 20906 var e = {originalEvent: this._lastEvent}; 20907 20908 // @event predrag: Event 20909 // Fired continuously during dragging *before* each corresponding 20910 // update of the element's position. 20911 this.fire('predrag', e); 20912 setPosition(this._element, this._newPos); 20913 20914 // @event drag: Event 20915 // Fired continuously during dragging. 20916 this.fire('drag', e); 20917 }, 20918 20919 _onUp: function () { 20920 // Ignore the event if disabled; this happens in IE11 20921 // under some circumstances, see #3666. 20922 if (!this._enabled) { return; } 20923 this.finishDrag(); 20924 }, 20925 20926 finishDrag: function (noInertia) { 20927 removeClass(document.body, 'leaflet-dragging'); 20928 20929 if (this._lastTarget) { 20930 removeClass(this._lastTarget, 'leaflet-drag-target'); 20931 this._lastTarget = null; 20932 } 20933 20934 off(document, 'mousemove touchmove', this._onMove, this); 20935 off(document, 'mouseup touchend touchcancel', this._onUp, this); 20936 20937 enableImageDrag(); 20938 enableTextSelection(); 20939 20940
20940if (this._moved && this._moving) { 20941 20942 // @event dragend: DragEndEvent 20943 // Fired when the drag ends. 20944 this.fire('dragend', { 20945 noInertia: noInertia, 20946 distance: this._newPos.distanceTo(this._startPos) 20947 });
vendor: 9,922 bytes, lines 20948-21287
20948 } 20949 20950 this._moving = false; 20951 Draggable._dragging = false; 20952 } 20953 20954 }); 20955 20956 /* 20957 * @namespace LineUtil 20958 * 20959 * Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast. 20960 */ 20961 20962 // Simplify polyline with vertex reduction and Douglas-Peucker simplification. 20963 // Improves rendering performance dramatically by lessening the number of points to draw. 20964 20965 // @function simplify(points: Point[], tolerance: Number): Point[] 20966 // Dramatically reduces the number of points in a polyline while retaining 20967 // its shape and returns a new array of simplified points, using the 20968 // [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). 20969 // Used for a huge performance boost when processing/displaying Leaflet polylines for 20970 // each zoom level and also reducing visual noise. tolerance affects the amount of 20971 // simplification (lesser value means higher quality but slower and with more points). 20972 // Also released as a separated micro-library [Simplify.js](https://mourner.github.io/simplify-js/). 20973 function simplify(points, tolerance) { 20974 if (!tolerance || !points.length) { 20975 return points.slice(); 20976 } 20977 20978 var sqTolerance = tolerance * tolerance; 20979 20980 // stage 1: vertex reduction 20981 points = _reducePoints(points, sqTolerance); 20982 20983 // stage 2: Douglas-Peucker simplification 20984 points = _simplifyDP(points, sqTolerance); 20985 20986 return points; 20987 } 20988 20989 // @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number 20990 // Returns the distance between point `p` and segment `p1` to `p2`. 20991 function pointToSegmentDistance(p, p1, p2) { 20992 return Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true)); 20993 } 20994 20995 // @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number 20996 // Returns the closest point from a point `p` on a segment `p1` to `p2`. 20997 function closestPointOnSegment(p, p1, p2) { 20998 return _sqClosestPointOnSegment(p, p1, p2); 20999 } 21000 21001 // Ramer-Douglas-Peucker simplification, see https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm 21002 function _simplifyDP(points, sqTolerance) { 21003 21004 var len = points.length, 21005 ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array, 21006 markers = new ArrayConstructor(len); 21007 21008 markers[0] = markers[len - 1] = 1; 21009 21010 _simplifyDPStep(points, markers, sqTolerance, 0, len - 1); 21011 21012 var i, 21013 newPoints = []; 21014 21015 for (i = 0; i < len; i++) { 21016 if (markers[i]) { 21017 newPoints.push(points[i]); 21018 } 21019 } 21020 21021 return newPoints; 21022 } 21023 21024 function _simplifyDPStep(points, markers, sqTolerance, first, last) { 21025 21026 var maxSqDist = 0, 21027 index, i, sqDist; 21028 21029 for (i = first + 1; i <= last - 1; i++) { 21030 sqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true); 21031 21032 if (sqDist > maxSqDist) { 21033 index = i; 21034 maxSqDist = sqDist; 21035 } 21036 } 21037 21038 if (maxSqDist > sqTolerance) { 21039 markers[index] = 1; 21040 21041 _simplifyDPStep(points, markers, sqTolerance, first, index); 21042 _simplifyDPStep(points, markers, sqTolerance, index, last); 21043 } 21044 } 21045 21046 // reduce points that are too close to each other to a single point 21047 function _reducePoints(points, sqTolerance) { 21048 var reducedPoints = [points[0]]; 21049 21050 for (var i = 1, prev = 0, len = points.length; i < len; i++) { 21051 if (_sqDist(points[i], points[prev]) > sqTolerance) { 21052 reducedPoints.push(points[i]); 21053 prev = i; 21054 } 21055 } 21056 if (prev < len - 1) { 21057 reducedPoints.push(points[len - 1]); 21058 } 21059 return reducedPoints; 21060 } 21061 21062 var _lastCode; 21063 21064 // @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean 21065 // Clips the segment a to b by rectangular bounds with the 21066 // [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm) 21067 // (modifying the segment points directly!). Used by Leaflet to only show polyline 21068 // points that are on the screen or near, increasing performance. 21069 function clipSegment(a, b, bounds, useLastCode, round) { 21070 var codeA = useLastCode ? _lastCode : _getBitCode(a, bounds), 21071 codeB = _getBitCode(b, bounds), 21072 21073 codeOut, p, newCode; 21074 21075 // save 2nd code to avoid calculating it on the next segment 21076 _lastCode = codeB; 21077 21078 while (true) { 21079 // if a,b is inside the clip window (trivial accept) 21080 if (!(codeA | codeB)) { 21081 return [a, b]; 21082 } 21083 21084 // if a,b is outside the clip window (trivial reject) 21085 if (codeA & codeB) { 21086 return false; 21087 } 21088 21089 // other cases 21090 codeOut = codeA || codeB; 21091 p = _getEdgeIntersection(a, b, codeOut, bounds, round); 21092 newCode = _getBitCode(p, bounds); 21093 21094 if (codeOut === codeA) { 21095 a = p; 21096 codeA = newCode; 21097 } else { 21098 b = p; 21099 codeB = newCode; 21100 } 21101 } 21102 } 21103 21104 function _getEdgeIntersection(a, b, code, bounds, round) { 21105 var dx = b.x - a.x, 21106 dy = b.y - a.y, 21107 min = bounds.min, 21108 max = bounds.max, 21109 x, y; 21110 21111 if (code & 8) { // top 21112 x = a.x + dx * (max.y - a.y) / dy; 21113 y = max.y; 21114 21115 } else if (code & 4) { // bottom 21116 x = a.x + dx * (min.y - a.y) / dy; 21117 y = min.y; 21118 21119 } else if (code & 2) { // right 21120 x = max.x; 21121 y = a.y + dy * (max.x - a.x) / dx; 21122 21123 } else if (code & 1) { // left 21124 x = min.x; 21125 y = a.y + dy * (min.x - a.x) / dx; 21126 } 21127 21128 return new Point(x, y, round); 21129 } 21130 21131 function _getBitCode(p, bounds) { 21132 var code = 0; 21133 21134 if (p.x < bounds.min.x) { // left 21135 code |= 1; 21136 } else if (p.x > bounds.max.x) { // right 21137 code |= 2; 21138 } 21139 21140 if (p.y < bounds.min.y) { // bottom 21141 code |= 4; 21142 } else if (p.y > bounds.max.y) { // top 21143 code |= 8; 21144 } 21145 21146 return code; 21147 } 21148 21149 // square distance (to avoid unnecessary Math.sqrt calls) 21150 function _sqDist(p1, p2) { 21151 var dx = p2.x - p1.x, 21152 dy = p2.y - p1.y; 21153 return dx * dx + dy * dy; 21154 } 21155 21156 // return closest point on segment or distance to that point 21157 function _sqClosestPointOnSegment(p, p1, p2, sqDist) { 21158 var x = p1.x, 21159 y = p1.y, 21160 dx = p2.x - x, 21161 dy = p2.y - y, 21162 dot = dx * dx + dy * dy, 21163 t; 21164 21165 if (dot > 0) { 21166 t = ((p.x - x) * dx + (p.y - y) * dy) / dot; 21167 21168 if (t > 1) { 21169 x = p2.x; 21170 y = p2.y; 21171 } else if (t > 0) { 21172 x += dx * t; 21173 y += dy * t; 21174 } 21175 } 21176 21177 dx = p.x - x; 21178 dy = p.y - y; 21179 21180 return sqDist ? dx * dx + dy * dy : new Point(x, y); 21181 } 21182 21183 21184 // @function isFlat(latlngs: LatLng[]): Boolean 21185 // Returns true if `latlngs` is a flat array, false is nested. 21186 function isFlat(latlngs) { 21187 return !isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined'); 21188 } 21189 21190 function _flat(latlngs) { 21191 console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.'); 21192 return isFlat(latlngs); 21193 } 21194 21195 /* @function polylineCenter(latlngs: LatLng[], crs: CRS): LatLng 21196 * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polyline. 21197 */ 21198 function polylineCenter(latlngs, crs) { 21199 var i, halfDist, segDist, dist, p1, p2, ratio, center; 21200 21201 if (!latlngs || latlngs.length === 0) { 21202 throw new Error('latlngs not passed'); 21203 } 21204 21205 if (!isFlat(latlngs)) { 21206 console.warn('latlngs are not flat! Only the first ring will be used'); 21207 latlngs = latlngs[0]; 21208 } 21209 21210 var points = []; 21211 for (var j in latlngs) { 21212 points.push(crs.project(toLatLng(latlngs[j]))); 21213 } 21214 21215 var len = points.length; 21216 21217 for (i = 0, halfDist = 0; i < len - 1; i++) { 21218 halfDist += points[i].distanceTo(points[i + 1]) / 2; 21219 } 21220 21221 // The line is so small in the current view that all points are on the same pixel. 21222 if (halfDist === 0) { 21223 center = points[0]; 21224 } else { 21225 for (i = 0, dist = 0; i < len - 1; i++) { 21226 p1 = points[i]; 21227 p2 = points[i + 1]; 21228 segDist = p1.distanceTo(p2); 21229 dist += segDist; 21230 21231 if (dist > halfDist) { 21232 ratio = (dist - halfDist) / segDist; 21233 center = [ 21234 p2.x - ratio * (p2.x - p1.x), 21235 p2.y - ratio * (p2.y - p1.y) 21236 ]; 21237 break; 21238 } 21239 } 21240 } 21241 return crs.unproject(toPoint(center)); 21242 } 21243 21244 var LineUtil = { 21245 __proto__: null, 21246 simplify: simplify, 21247 pointToSegmentDistance: pointToSegmentDistance, 21248 closestPointOnSegment: closestPointOnSegment, 21249 clipSegment: clipSegment, 21250 _getEdgeIntersection: _getEdgeIntersection, 21251 _getBitCode: _getBitCode, 21252 _sqClosestPointOnSegment: _sqClosestPointOnSegment, 21253 isFlat: isFlat, 21254 _flat: _flat, 21255 polylineCenter: polylineCenter 21256 }; 21257 21258 /* 21259 * @namespace PolyUtil 21260 * Various utility functions for polygon geometries. 21261 */ 21262 21263 /* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[] 21264 * Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)). 21265 * Used by Leaflet to only show polygon points that are on the screen or near, increasing 21266 * performance. Note that polygon points needs different algorithm for clipping 21267 * than polyline, so there's a separate method for it. 21268 */ 21269 function clipPolygon(points, bounds, round) { 21270 var clippedPoints, 21271 edges = [1, 4, 2, 8], 21272 i, j, k, 21273 a, b, 21274 len, edge, p; 21275 21276 for (i = 0, len = points.length; i < len; i++) { 21277 points[i]._code = _getBitCode(points[i], bounds); 21278 } 21279 21280 // for each edge (left, bottom, right, top) 21281 for (k = 0; k < 4; k++) { 21282 edge = edges[k]; 21283 clippedPoints = []; 21284 21285 for (i = 0, len = points.length, j = len - 1; i < len; j = i++) { 21286 a = points[i]; 21287 b = points[j];
21288 21289 // if a is inside the clip window 21290 if (!(a._code & edge)) { 21291 // if b is outside the clip window (a->b goes out of screen) 21292 if (b._code & edge) { 21293 p = _getEdgeIntersection(b, a, edge, bounds, round); 21294 p._code = _getBitCode(p, bounds); 21295 clippedPoints.push(p); 21296 } 21297 clippedPoints.push(a); 21298 21299 // else if b is inside the clip window (a->b enters the screen) 21300 } else if (!(b._code & edge)) { 21301 p = _getEdgeIntersection(b, a, edge, bounds, round); 21302 p._code = _getBitCode(p, bounds); 21303 clippedPoints.push(p); 21304 } 21305 } 21306 points = clippedPoints; 21307 } 21308 21309 return points; 21310 } 21311 21312 /* @function polygonCenter(latlngs: LatLng[] crs: CRS): LatLng 21313 * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polygon. 21314 */ 21315 function polygonCenter(latlngs, crs) { 21316 var i, j, p1, p2, f, area, x, y, center; 21317 21318 if (!latlngs || latlngs.length === 0) { 21319 throw new Error('latlngs not passed'); 21320 } 21321 21322 if (!isFlat(latlngs)) { 21323 console.warn('latlngs are not flat! Only the first ring will be used'); 21324 latlngs = latlngs[0]; 21325 } 21326 21327 var points = []; 21328 for (var k in latlngs) { 21329 points.push(crs.project(toLatLng(latlngs[k]))); 21330 } 21331 21332 var len = points.length; 21333 area = x = y = 0; 21334 21335 // polygon centroid algorithm; 21336 for (i = 0, j = len - 1; i < len; j = i++) { 21337 p1 = points[i]; 21338 p2 = points[j]; 21339 21340 f = p1.y * p2.x - p2.y * p1.x; 21341 x += (p1.x + p2.x) * f; 21342 y += (p1.y + p2.y) * f; 21343 area += f * 3; 21344 } 21345 21346 if (area === 0) { 21347 // Polygon is so small that all points are on same pixel. 21348 center = points[0]; 21349 } else { 21350 center = [x / area, y / area]; 21351 } 21352 return crs.unproject(toPoint(center)); 21353 } 21354 21355 var PolyUtil = { 21356 __proto__: null, 21357 clipPolygon: clipPolygon, 21358 polygonCenter: polygon
vendor: 132,701 bytes, lines 21358-25736
21358Center 21359 }; 21360 21361 /* 21362 * @namespace Projection 21363 * @section 21364 * Leaflet comes with a set of already defined Projections out of the box: 21365 * 21366 * @projection L.Projection.LonLat 21367 * 21368 * Equirectangular, or Plate Carree projection â the most simple projection, 21369 * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as 21370 * latitude. Also suitable for flat worlds, e.g. game maps. Used by the 21371 * `EPSG:4326` and `Simple` CRS. 21372 */ 21373 21374 var LonLat = { 21375 project: function (latlng) { 21376 return new Point(latlng.lng, latlng.lat); 21377 }, 21378 21379 unproject: function (point) { 21380 return new LatLng(point.y, point.x); 21381 }, 21382 21383 bounds: new Bounds([-180, -90], [180, 90]) 21384 }; 21385 21386 /* 21387 * @namespace Projection 21388 * @projection L.Projection.Mercator 21389 * 21390 * Elliptical Mercator projection â more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS. 21391 */ 21392 21393 var Mercator = { 21394 R: 6378137, 21395 R_MINOR: 6356752.314245179, 21396 21397 bounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]), 21398 21399 project: function (latlng) { 21400 var d = Math.PI / 180, 21401 r = this.R, 21402 y = latlng.lat * d, 21403 tmp = this.R_MINOR / r, 21404 e = Math.sqrt(1 - tmp * tmp), 21405 con = e * Math.sin(y); 21406 21407 var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2); 21408 y = -r * Math.log(Math.max(ts, 1E-10)); 21409 21410 return new Point(latlng.lng * d * r, y); 21411 }, 21412 21413 unproject: function (point) { 21414 var d = 180 / Math.PI, 21415 r = this.R, 21416 tmp = this.R_MINOR / r, 21417 e = Math.sqrt(1 - tmp * tmp), 21418 ts = Math.exp(-point.y / r), 21419 phi = Math.PI / 2 - 2 * Math.atan(ts); 21420 21421 for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) { 21422 con = e * Math.sin(phi); 21423 con = Math.pow((1 - con) / (1 + con), e / 2); 21424 dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi; 21425 phi += dphi; 21426 } 21427 21428 return new LatLng(phi * d, point.x * d / r); 21429 } 21430 }; 21431 21432 /* 21433 * @class Projection 21434 21435 * An object with methods for projecting geographical coordinates of the world onto 21436 * a flat surface (and back). See [Map projection](https://en.wikipedia.org/wiki/Map_projection). 21437 21438 * @property bounds: Bounds 21439 * The bounds (specified in CRS units) where the projection is valid 21440 21441 * @method project(latlng: LatLng): Point 21442 * Projects geographical coordinates into a 2D point. 21443 * Only accepts actual `L.LatLng` instances, not arrays. 21444 21445 * @method unproject(point: Point): LatLng 21446 * The inverse of `project`. Projects a 2D point into a geographical location. 21447 * Only accepts actual `L.Point` instances, not arrays. 21448 21449 * Note that the projection instances do not inherit from Leaflet's `Class` object, 21450 * and can't be instantiated. Also, new classes can't inherit from them, 21451 * and methods can't be added to them with the `include` function. 21452 21453 */ 21454 21455 var index = { 21456 __proto__: null, 21457 LonLat: LonLat, 21458 Mercator: Mercator, 21459 SphericalMercator: SphericalMercator 21460 }; 21461 21462 /* 21463 * @namespace CRS 21464 * @crs L.CRS.EPSG3395 21465 * 21466 * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection. 21467 */ 21468 var EPSG3395 = extend({}, Earth, { 21469 code: 'EPSG:3395', 21470 projection: Mercator, 21471 21472 transformation: (function () { 21473 var scale = 0.5 / (Math.PI * Mercator.R); 21474 return toTransformation(scale, 0.5, -scale, 0.5); 21475 }()) 21476 }); 21477 21478 /* 21479 * @namespace CRS 21480 * @crs L.CRS.EPSG4326 21481 * 21482 * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection. 21483 * 21484 * Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic), 21485 * which is a breaking change from 0.7.x behaviour. If you are using a `TileLayer` 21486 * with this CRS, ensure that there are two 256x256 pixel tiles covering the 21487 * whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90), 21488 * or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set. 21489 */ 21490 21491 var EPSG4326 = extend({}, Earth, { 21492 code: 'EPSG:4326', 21493 projection: LonLat, 21494 transformation: toTransformation(1 / 180, 1, -1 / 180, 0.5) 21495 }); 21496 21497 /* 21498 * @namespace CRS 21499 * @crs L.CRS.Simple 21500 * 21501 * A simple CRS that maps longitude and latitude into `x` and `y` directly. 21502 * May be used for maps of flat surfaces (e.g. game maps). Note that the `y` 21503 * axis should still be inverted (going from bottom to top). `distance()` returns 21504 * simple euclidean distance. 21505 */ 21506 21507 var Simple = extend({}, CRS, { 21508 projection: LonLat, 21509 transformation: toTransformation(1, 0, -1, 0), 21510 21511 scale: function (zoom) { 21512 return Math.pow(2, zoom); 21513 }, 21514 21515 zoom: function (scale) { 21516 return Math.log(scale) / Math.LN2; 21517 }, 21518 21519 distance: function (latlng1, latlng2) { 21520 var dx = latlng2.lng - latlng1.lng, 21521 dy = latlng2.lat - latlng1.lat; 21522 21523 return Math.sqrt(dx * dx + dy * dy); 21524 }, 21525 21526 infinite: true 21527 }); 21528 21529 CRS.Earth = Earth; 21530 CRS.EPSG3395 = EPSG3395; 21531 CRS.EPSG3857 = EPSG3857; 21532 CRS.EPSG900913 = EPSG900913; 21533 CRS.EPSG4326 = EPSG4326; 21534 CRS.Simple = Simple; 21535 21536 /* 21537 * @class Layer 21538 * @inherits Evented 21539 * @aka L.Layer 21540 * @aka ILayer 21541 * 21542 * A set of methods from the Layer base class that all Leaflet layers use. 21543 * Inherits all methods, options and events from `L.Evented`. 21544 * 21545 * @example 21546 * 21547 * ```js 21548 * var layer = L.marker(latlng).addTo(map); 21549 * layer.addTo(map); 21550 * layer.remove(); 21551 * ``` 21552 * 21553 * @event add: Event 21554 * Fired after the layer is added to a map 21555 * 21556 * @event remove: Event 21557 * Fired after the layer is removed from a map 21558 */ 21559 21560 21561 var Layer = Evented.extend({ 21562 21563 // Classes extending `L.Layer` will inherit the following options: 21564 options: { 21565 // @option pane: String = 'overlayPane' 21566 // By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default. 21567 pane: 'overlayPane', 21568 21569 // @option attribution: String = null 21570 // String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. 21571 attribution: null, 21572 21573 bubblingMouseEvents: true 21574 }, 21575 21576 /* @section 21577 * Classes extending `L.Layer` will inherit the following methods: 21578 * 21579 * @method addTo(map: Map|LayerGroup): this 21580 * Adds the layer to the given map or layer group. 21581 */ 21582 addTo: function (map) { 21583 map.addLayer(this); 21584 return this; 21585 }, 21586 21587 // @method remove: this 21588 // Removes the layer from the map it is currently active on. 21589 remove: function () { 21590 return this.removeFrom(this._map || this._mapToAdd); 21591 }, 21592 21593 // @method removeFrom(map: Map): this 21594 // Removes the layer from the given map 21595 // 21596 // @alternative 21597 // @method removeFrom(group: LayerGroup): this 21598 // Removes the layer from the given `LayerGroup` 21599 removeFrom: function (obj) { 21600 if (obj) { 21601 obj.removeLayer(this); 21602 } 21603 return this; 21604 }, 21605 21606 // @method getPane(name? : String): HTMLElement 21607 // Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer. 21608 getPane: function (name) { 21609 return this._map.getPane(name ? (this.options[name] || name) : this.options.pane); 21610 }, 21611 21612 addInteractiveTarget: function (targetEl) { 21613 this._map._targets[stamp(targetEl)] = this; 21614 return this; 21615 }, 21616 21617 removeInteractiveTarget: function (targetEl) { 21618 delete this._map._targets[stamp(targetEl)]; 21619 return this; 21620 }, 21621 21622 // @method getAttribution: String 21623 // Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution). 21624 getAttribution: function () { 21625 return this.options.attribution; 21626 }, 21627 21628 _layerAdd: function (e) { 21629 var map = e.target; 21630 21631 // check in case layer gets added and then removed before the map is ready 21632 if (!map.hasLayer(this)) { return; } 21633 21634 this._map = map; 21635 this._zoomAnimated = map._zoomAnimated; 21636 21637 if (this.getEvents) { 21638 var events = this.getEvents(); 21639 map.on(events, this); 21640 this.once('remove', function () { 21641 map.off(events, this); 21642 }, this); 21643 } 21644 21645 this.onAdd(map); 21646 21647 this.fire('add'); 21648 map.fire('layeradd', {layer: this}); 21649 } 21650 }); 21651 21652 /* @section Extension methods 21653 * @uninheritable 21654 * 21655 * Every layer should extend from `L.Layer` and (re-)implement the following methods. 21656 * 21657 * @method onAdd(map: Map): this 21658 * Should contain code that creates DOM elements for the layer, adds them to `map panes` where they should belong and puts listeners on relevant map events. Called on [`map.addLayer(layer)`](#map-addlayer). 21659 * 21660 * @method onRemove(map: Map): this 21661 * Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in [`onAdd`](#layer-onadd). Called on [`map.removeLayer(layer)`](#map-removelayer). 21662 * 21663 * @method getEvents(): Object 21664 * This optional method should return an object like `{ viewreset: this._reset }` for [`addEventListener`](#evented-addeventlistener). The event handlers in this object will be automatically added and removed from the map with your layer. 21665 * 21666 * @method getAttribution(): String 21667 * This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible. 21668 * 21669 * @method beforeAdd(map: Map): this 21670 * Optional method. Called on [`map.addLayer(layer)`](#map-addlayer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only. 21671 */ 21672 21673 21674 /* @namespace Map 21675 * @section Layer events 21676 * 21677 * @event layeradd: LayerEvent 21678 * Fired when a new layer is added to the map. 21679 * 21680 * @event layerremove: LayerEvent 21681 * Fired when some layer is removed from the map 21682 * 21683 * @section Methods for Layers and Controls 21684 */ 21685 Map.include({ 21686 // @method addLayer(layer: Layer): this 21687 // Adds the given layer to the map 21688 addLayer: function (layer) { 21689 if (!layer._layerAdd) { 21690 throw new Error('The provided object is not a Layer.'); 21691 } 21692 21693 var id = stamp(layer); 21694 if (this._layers[id]) { return this; } 21695 this._layers[id] = layer; 21696 21697 layer._mapToAdd = this; 21698 21699 if (layer.beforeAdd) { 21700 layer.beforeAdd(this); 21701 } 21702 21703 this.whenReady(layer._layerAdd, layer); 21704 21705 return this; 21706 }, 21707 21708 // @method removeLayer(layer: Layer): this 21709 // Removes the given layer from the map. 21710 removeLayer: function (layer) { 21711 var id = stamp(layer); 21712 21713 if (!this._layers[id]) { return this; } 21714 21715 if (this._loaded) { 21716 layer.onRemove(this); 21717 } 21718 21719 delete this._layers[id]; 21720 21721 if (this._loaded) { 21722 this.fire('layerremove', {layer: layer}); 21723 layer.fire('remove'); 21724 } 21725 21726 layer._map = layer._mapToAdd = null; 21727 21728 return this; 21729 }, 21730 21731 // @method hasLayer(layer: Layer): Boolean 21732 // Returns `true` if the given layer is currently added to the map 21733 hasLayer: function (layer) { 21734 return stamp(layer) in this._layers; 21735 }, 21736 21737 /* @method eachLayer(fn: Function, context?: Object): this 21738 * Iterates over the layers of the map, optionally specifying context of the iterator function. 21739 * ``` 21740 * map.eachLayer(function(layer){ 21741 * layer.bindPopup('Hello'); 21742 * }); 21743 * ``` 21744 */ 21745 eachLayer: function (method, context) { 21746 for (var i in this._layers) { 21747 method.call(context, this._layers[i]); 21748 } 21749 return this; 21750 }, 21751 21752 _addLayers: function (layers) { 21753 layers = layers ? (isArray(layers) ? layers : [layers]) : []; 21754 21755 for (var i = 0, len = layers.length; i < len; i++) { 21756 this.addLayer(layers[i]); 21757 } 21758 }, 21759 21760 _addZoomLimit: function (layer) { 21761 if (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) { 21762 this._zoomBoundLayers[stamp(layer)] = layer; 21763 this._updateZoomLevels(); 21764 } 21765 }, 21766 21767 _removeZoomLimit: function (layer) { 21768 var id = stamp(layer); 21769 21770 if (this._zoomBoundLayers[id]) { 21771 delete this._zoomBoundLayers[id]; 21772 this._updateZoomLevels(); 21773 } 21774 }, 21775 21776 _updateZoomLevels: function () { 21777 var minZoom = Infinity, 21778 maxZoom = -Infinity, 21779 oldZoomSpan = this._getZoomSpan(); 21780 21781 for (var i in this._zoomBoundLayers) { 21782 var options = this._zoomBoundLayers[i].options; 21783 21784 minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom); 21785 maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom); 21786 } 21787 21788 this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom; 21789 this._layersMinZoom = minZoom === Infinity ? undefined : minZoom; 21790 21791 // @section Map state change events 21792 // @event zoomlevelschange: Event 21793 // Fired when the number of zoomlevels on the map is changed due 21794 // to adding or removing a layer. 21795 if (oldZoomSpan !== this._getZoomSpan()) { 21796 this.fire('zoomlevelschange'); 21797 } 21798 21799 if (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) { 21800 this.setZoom(this._layersMaxZoom); 21801 } 21802 if (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) { 21803 this.setZoom(this._layersMinZoom); 21804 } 21805 } 21806 }); 21807 21808 /* 21809 * @class LayerGroup 21810 * @aka L.LayerGroup 21811 * @inherits Interactive layer 21812 * 21813 * Used to group several layers and handle them as one. If you add it to the map, 21814 * any layers added or removed from the group will be added/removed on the map as 21815 * well. Extends `Layer`. 21816 * 21817 * @example 21818 * 21819 * ```js 21820 * L.layerGroup([marker1, marker2]) 21821 * .addLayer(polyline) 21822 * .addTo(map); 21823 * ``` 21824 */ 21825 21826 var LayerGroup = Layer.extend({ 21827 21828 initialize: function (layers, options) { 21829 setOptions(this, options); 21830 21831 this._layers = {}; 21832 21833 var i, len; 21834 21835 if (layers) { 21836 for (i = 0, len = layers.length; i < len; i++) { 21837 this.addLayer(layers[i]); 21838 } 21839 } 21840 }, 21841 21842 // @method addLayer(layer: Layer): this 21843 // Adds the given layer to the group. 21844 addLayer: function (layer) { 21845 var id = this.getLayerId(layer); 21846 21847 this._layers[id] = layer; 21848 21849 if (this._map) { 21850 this._map.addLayer(layer); 21851 } 21852 21853 return this; 21854 }, 21855 21856 // @method removeLayer(layer: Layer): this 21857 // Removes the given layer from the group. 21858 // @alternative 21859 // @method removeLayer(id: Number): this 21860 // Removes the layer with the given internal ID from the group. 21861 removeLayer: function (layer) { 21862 var id = layer in this._layers ? layer : this.getLayerId(layer); 21863 21864 if (this._map && this._layers[id]) { 21865 this._map.removeLayer(this._layers[id]); 21866 } 21867 21868 delete this._layers[id]; 21869 21870 return this; 21871 }, 21872 21873 // @method hasLayer(layer: Layer): Boolean 21874 // Returns `true` if the given layer is currently added to the group. 21875 // @alternative 21876 // @method hasLayer(id: Number): Boolean 21877 // Returns `true` if the given internal ID is currently added to the group. 21878 hasLayer: function (layer) { 21879 var layerId = typeof layer === 'number' ? layer : this.getLayerId(layer); 21880 return layerId in this._layers; 21881 }, 21882 21883 // @method clearLayers(): this 21884 // Removes all the layers from the group. 21885 clearLayers: function () { 21886 return this.eachLayer(this.removeLayer, this); 21887 }, 21888 21889 // @method invoke(methodName: String, â¦): this 21890 // Calls `methodName` on every layer contained in this group, passing any 21891 // additional parameters. Has no effect if the layers contained do not 21892 // implement `methodName`. 21893 invoke: function (methodName) { 21894 var args = Array.prototype.slice.call(arguments, 1), 21895 i, layer; 21896 21897 for (i in this._layers) { 21898 layer = this._layers[i]; 21899 21900 if (layer[methodName]) { 21901 layer[methodName].apply(layer, args); 21902 } 21903 } 21904 21905 return this; 21906 }, 21907 21908 onAdd: function (map) { 21909 this.eachLayer(map.addLayer, map); 21910 }, 21911 21912 onRemove: function (map) { 21913 this.eachLayer(map.removeLayer, map); 21914 }, 21915 21916 // @method eachLayer(fn: Function, context?: Object): this 21917 // Iterates over the layers of the group, optionally specifying context of the iterator function. 21918 // ```js 21919 // group.eachLayer(function (layer) { 21920 // layer.bindPopup('Hello'); 21921 // }); 21922 // ``` 21923 eachLayer: function (method, context) { 21924 for (var i in this._layers) { 21925 method.call(context, this._layers[i]); 21926 } 21927 return this; 21928 }, 21929 21930 // @method getLayer(id: Number): Layer 21931 // Returns the layer with the given internal ID. 21932 getLayer: function (id) { 21933 return this._layers[id]; 21934 }, 21935 21936 // @method getLayers(): Layer[] 21937 // Returns an array of all the layers added to the group. 21938 getLayers: function () { 21939 var layers = []; 21940 this.eachLayer(layers.push, layers); 21941 return layers; 21942 }, 21943 21944 // @method setZIndex(zIndex: Number): this 21945 // Calls `setZIndex` on every layer contained in this group, passing the z-index. 21946 setZIndex: function (zIndex) { 21947 return this.invoke('setZIndex', zIndex); 21948 }, 21949 21950 // @method getLayerId(layer: Layer): Number 21951 // Returns the internal ID for a layer 21952 getLayerId: function (layer) { 21953 return stamp(layer); 21954 } 21955 }); 21956 21957 21958 // @factory L.layerGroup(layers?: Layer[], options?: Object) 21959 // Create a layer group, optionally given an initial set of layers and an `options` object. 21960 var layerGroup = function (layers, options) { 21961 return new LayerGroup(layers, options); 21962 }; 21963 21964 /* 21965 * @class FeatureGroup 21966 * @aka L.FeatureGroup 21967 * @inherits LayerGroup 21968 * 21969 * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers: 21970 * * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip)) 21971 * * Events are propagated to the `FeatureGroup`, so if the group has an event 21972 * handler, it will handle events from any of the layers. This includes mouse events 21973 * and custom events. 21974 * * Has `layeradd` and `layerremove` events 21975 * 21976 * @example 21977 * 21978 * ```js 21979 * L.featureGroup([marker1, marker2, polyline]) 21980 * .bindPopup('Hello world!') 21981 * .on('click', function() { alert('Clicked on a member of the group!'); }) 21982 * .addTo(map); 21983 * ``` 21984 */ 21985 21986 var FeatureGroup = LayerGroup.extend({ 21987 21988 addLayer: function (layer) { 21989 if (this.hasLayer(layer)) { 21990 return this; 21991 } 21992 21993 layer.addEventParent(this); 21994 21995 LayerGroup.prototype.addLayer.call(this, layer); 21996 21997 // @event layeradd: LayerEvent 21998 // Fired when a layer is added to this `FeatureGroup` 21999 return this.fire('layeradd', {layer: layer}); 22000 }, 22001 22002 removeLayer: function (layer) { 22003 if (!this.hasLayer(layer)) { 22004 return this; 22005 } 22006 if (layer in this._layers) { 22007 layer = this._layers[layer]; 22008 } 22009 22010 layer.removeEventParent(this); 22011 22012 LayerGroup.prototype.removeLayer.call(this, layer); 22013 22014 // @event layerremove: LayerEvent 22015 // Fired when a layer is removed from this `FeatureGroup` 22016 return this.fire('layerremove', {layer: layer}); 22017 }, 22018 22019 // @method setStyle(style: Path options): this 22020 // Sets the given path options to each layer of the group that has a `setStyle` method. 22021 setStyle: function (style) { 22022 return this.invoke('setStyle', style); 22023 }, 22024 22025 // @method bringToFront(): this 22026 // Brings the layer group to the top of all other layers 22027 bringToFront: function () { 22028 return this.invoke('bringToFront'); 22029 }, 22030 22031 // @method bringToBack(): this 22032 // Brings the layer group to the back of all other layers 22033 bringToBack: function () { 22034 return this.invoke('bringToBack'); 22035 }, 22036 22037 // @method getBounds(): LatLngBounds 22038 // Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children). 22039 getBounds: function () { 22040 var bounds = new LatLngBounds(); 22041 22042 for (var id in this._layers) { 22043 var layer = this._layers[id]; 22044 bounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng()); 22045 } 22046 return bounds; 22047 } 22048 }); 22049 22050 // @factory L.featureGroup(layers?: Layer[], options?: Object) 22051 // Create a feature group, optionally given an initial set of layers and an `options` object. 22052 var featureGroup = function (layers, options) { 22053 return new FeatureGroup(layers, options); 22054 }; 22055 22056 /* 22057 * @class Icon 22058 * @aka L.Icon 22059 * 22060 * Represents an icon to provide when creating a marker. 22061 * 22062 * @example 22063 * 22064 * ```js 22065 * var myIcon = L.icon({ 22066 * iconUrl: 'my-icon.png', 22067 * iconRetinaUrl: '[email protected]', 22068 * iconSize: [38, 95], 22069 * iconAnchor: [22, 94], 22070 * popupAnchor: [-3, -76], 22071 * shadowUrl: 'my-icon-shadow.png', 22072 * shadowRetinaUrl: '[email protected]', 22073 * shadowSize: [68, 95], 22074 * shadowAnchor: [22, 94] 22075 * }); 22076 * 22077 * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map); 22078 * ``` 22079 * 22080 * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default. 22081 * 22082 */ 22083 22084 var Icon = Class.extend({ 22085 22086 /* @section 22087 * @aka Icon options 22088 * 22089 * @option iconUrl: String = null 22090 * **(required)** The URL to the icon image (absolute or relative to your script path). 22091 * 22092 * @option iconRetinaUrl: String = null 22093 * The URL to a retina sized version of the icon image (absolute or relative to your 22094 * script path). Used for Retina screen devices. 22095 * 22096 * @option iconSize: Point = null 22097 * Size of the icon image in pixels. 22098 * 22099 * @option iconAnchor: Point = null 22100 * The coordinates of the "tip" of the icon (relative to its top left corner). The icon 22101 * will be aligned so that this point is at the marker's geographical location. Centered 22102 * by default if size is specified, also can be set in CSS with negative margins. 22103 * 22104 * @option popupAnchor: Point = [0, 0] 22105 * The coordinates of the point from which popups will "open", relative to the icon anchor. 22106 * 22107 * @option tooltipAnchor: Point = [0, 0] 22108 * The coordinates of the point from which tooltips will "open", relative to the icon anchor. 22109 * 22110 * @option shadowUrl: String = null 22111 * The URL to the icon shadow image. If not specified, no shadow image will be created. 22112 * 22113 * @option shadowRetinaUrl: String = null 22114 * 22115 * @option shadowSize: Point = null 22116 * Size of the shadow image in pixels. 22117 * 22118 * @option shadowAnchor: Point = null 22119 * The coordinates of the "tip" of the shadow (relative to its top left corner) (the same 22120 * as iconAnchor if not specified). 22121 * 22122 * @option className: String = '' 22123 * A custom class name to assign to both icon and shadow images. Empty by default. 22124 */ 22125 22126 options: { 22127 popupAnchor: [0, 0], 22128 tooltipAnchor: [0, 0], 22129 22130 // @option crossOrigin: Boolean|String = false 22131 // Whether the crossOrigin attribute will be added to the tiles. 22132 // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. 22133 // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. 22134 crossOrigin: false 22135 }, 22136 22137 initialize: function (options) { 22138 setOptions(this, options); 22139 }, 22140 22141 // @method createIcon(oldIcon?: HTMLElement): HTMLElement 22142 // Called internally when the icon has to be shown, returns a `<img>` HTML element 22143 // styled according to the options. 22144 createIcon: function (oldIcon) { 22145 return this._createIcon('icon', oldIcon); 22146 }, 22147 22148 // @method createShadow(oldIcon?: HTMLElement): HTMLElement 22149 // As `createIcon`, but for the shadow beneath it. 22150 createShadow: function (oldIcon) { 22151 return this._createIcon('shadow', oldIcon); 22152 }, 22153 22154 _createIcon: function (name, oldIcon) { 22155 var src = this._getIconUrl(name); 22156 22157 if (!src) { 22158 if (name === 'icon') { 22159 throw new Error('iconUrl not set in Icon options (see the docs).'); 22160 } 22161 return null; 22162 } 22163 22164 var img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null); 22165 this._setIconStyles(img, name); 22166 22167 if (this.options.crossOrigin || this.options.crossOrigin === '') { 22168 img.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin; 22169 } 22170 22171 return img; 22172 }, 22173 22174 _setIconStyles: function (img, name) { 22175 var options = this.options; 22176 var sizeOption = options[name + 'Size']; 22177 22178 if (typeof sizeOption === 'number') { 22179 sizeOption = [sizeOption, sizeOption]; 22180 } 22181 22182 var size = toPoint(sizeOption), 22183 anchor = toPoint(name === 'shadow' && options.shadowAnchor || options.iconAnchor || 22184 size && size.divideBy(2, true)); 22185 22186 img.className = 'leaflet-marker-' + name + ' ' + (options.className || ''); 22187 22188 if (anchor) { 22189 img.style.marginLeft = (-anchor.x) + 'px'; 22190 img.style.marginTop = (-anchor.y) + 'px'; 22191 } 22192 22193 if (size) { 22194 img.style.width = size.x + 'px'; 22195 img.style.height = size.y + 'px'; 22196 } 22197 }, 22198 22199 _createImg: function (src, el) { 22200 el = el || document.createElement('img'); 22201 el.src = src; 22202 return el; 22203 }, 22204 22205 _getIconUrl: function (name) { 22206 return Browser.retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url']; 22207 } 22208 }); 22209 22210 22211 // @factory L.icon(options: Icon options) 22212 // Creates an icon instance with the given options. 22213 function icon(options) { 22214 return new Icon(options); 22215 } 22216 22217 /* 22218 * @miniclass Icon.Default (Icon) 22219 * @aka L.Icon.Default 22220 * @section 22221 * 22222 * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when 22223 * no icon is specified. Points to the blue marker image distributed with Leaflet 22224 * releases. 22225 * 22226 * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options` 22227 * (which is a set of `Icon options`). 22228 * 22229 * If you want to _completely_ replace the default icon, override the 22230 * `L.Marker.prototype.options.icon` with your own icon instead. 22231 */ 22232 22233 var IconDefault = Icon.extend({ 22234 22235 options: { 22236 iconUrl: 'marker-icon.png', 22237 iconRetinaUrl: 'marker-icon-2x.png', 22238 shadowUrl: 'marker-shadow.png', 22239 iconSize: [25, 41], 22240 iconAnchor: [12, 41], 22241 popupAnchor: [1, -34], 22242 tooltipAnchor: [16, -28], 22243 shadowSize: [41, 41] 22244 }, 22245 22246 _getIconUrl: function (name) { 22247 if (typeof IconDefault.imagePath !== 'string') { // Deprecated, backwards-compatibility only 22248 IconDefault.imagePath = this._detectIconPath(); 22249 } 22250 22251 // @option imagePath: String 22252 // `Icon.Default` will try to auto-detect the location of the 22253 // blue icon images. If you are placing these images in a non-standard 22254 // way, set this option to point to the right path. 22255 return (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name); 22256 }, 22257 22258 _stripUrl: function (path) { // separate function to use in tests 22259 var strip = function (str, re, idx) { 22260 var match = re.exec(str); 22261 return match && match[idx]; 22262 }; 22263 path = strip(path, /^url\((['"])?(.+)\1\)$/, 2); 22264 return path && strip(path, /^(.*)marker-icon\.png$/, 1); 22265 }, 22266 22267 _detectIconPath: function () { 22268 var el = create$1('div', 'leaflet-default-icon-path', document.body); 22269 var path = getStyle(el, 'background-image') || 22270 getStyle(el, 'backgroundImage'); // IE8 22271 22272 document.body.removeChild(el); 22273 path = this._stripUrl(path); 22274 if (path) { return path; } 22275 var link = document.querySelector('link[href$="leaflet.css"]'); 22276 if (!link) { return ''; } 22277 return link.href.substring(0, link.href.length - 'leaflet.css'.length - 1); 22278 } 22279 }); 22280 22281 /* 22282 * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable. 22283 */ 22284 22285 22286 /* @namespace Marker 22287 * @section Interaction handlers 22288 * 22289 * Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example: 22290 * 22291 * ```js 22292 * marker.dragging.disable(); 22293 * ``` 22294 * 22295 * @property dragging: Handler 22296 * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)). 22297 */ 22298 22299 var MarkerDrag = Handler.extend({ 22300 initialize: function (marker) { 22301 this._marker = marker; 22302 }, 22303 22304 addHooks: function () { 22305 var icon = this._marker._icon; 22306 22307 if (!this._draggable) { 22308 this._draggable = new Draggable(icon, icon, true); 22309 } 22310 22311 this._draggable.on({ 22312 dragstart: this._onDragStart, 22313 predrag: this._onPreDrag, 22314 drag: this._onDrag, 22315 dragend: this._onDragEnd 22316 }, this).enable(); 22317 22318 addClass(icon, 'leaflet-marker-draggable'); 22319 }, 22320 22321 removeHooks: function () { 22322 this._draggable.off({ 22323 dragstart: this._onDragStart, 22324 predrag: this._onPreDrag, 22325 drag: this._onDrag, 22326 dragend: this._onDragEnd 22327 }, this).disable(); 22328 22329 if (this._marker._icon) { 22330 removeClass(this._marker._icon, 'leaflet-marker-draggable'); 22331 } 22332 }, 22333 22334 moved: function () { 22335 return this._draggable && this._draggable._moved; 22336 }, 22337 22338 _adjustPan: function (e) { 22339 var marker = this._marker, 22340 map = marker._map, 22341 speed = this._marker.options.autoPanSpeed, 22342 padding = this._marker.options.autoPanPadding, 22343 iconPos = getPosition(marker._icon), 22344 bounds = map.getPixelBounds(), 22345 origin = map.getPixelOrigin(); 22346 22347 var panBounds = toBounds( 22348 bounds.min._subtract(origin).add(padding), 22349 bounds.max._subtract(origin).subtract(padding) 22350 ); 22351 22352 if (!panBounds.contains(iconPos)) { 22353 // Compute incremental movement 22354 var movement = toPoint( 22355 (Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) - 22356 (Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x), 22357 22358 (Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) - 22359 (Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y) 22360 ).multiplyBy(speed); 22361 22362 map.panBy(movement, {animate: false}); 22363 22364 this._draggable._newPos._add(movement); 22365 this._draggable._startPos._add(movement); 22366 22367 setPosition(marker._icon, this._draggable._newPos); 22368 this._onDrag(e); 22369 22370 this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e)); 22371 } 22372 }, 22373 22374 _onDragStart: function () { 22375 // @section Dragging events 22376 // @event dragstart: Event 22377 // Fired when the user starts dragging the marker. 22378 22379 // @event movestart: Event 22380 // Fired when the marker starts moving (because of dragging). 22381 22382 this._oldLatLng = this._marker.getLatLng(); 22383 22384 // When using ES6 imports it could not be set when `Popup` was not imported as well 22385 this._marker.closePopup && this._marker.closePopup(); 22386 22387 this._marker 22388 .fire('movestart') 22389 .fire('dragstart'); 22390 }, 22391 22392 _onPreDrag: function (e) { 22393 if (this._marker.options.autoPan) { 22394 cancelAnimFrame(this._panRequest); 22395 this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e)); 22396 } 22397 }, 22398 22399 _onDrag: function (e) { 22400 var marker = this._marker, 22401 shadow = marker._shadow, 22402 iconPos = getPosition(marker._icon), 22403 latlng = marker._map.layerPointToLatLng(iconPos); 22404 22405 // update shadow position 22406 if (shadow) { 22407 setPosition(shadow, iconPos); 22408 } 22409 22410 marker._latlng = latlng; 22411 e.latlng = latlng; 22412 e.oldLatLng = this._oldLatLng; 22413 22414 // @event drag: Event 22415 // Fired repeatedly while the user drags the marker. 22416 marker 22417 .fire('move', e) 22418 .fire('drag', e); 22419 }, 22420 22421 _onDragEnd: function (e) { 22422 // @event dragend: DragEndEvent 22423 // Fired when the user stops dragging the marker. 22424 22425 cancelAnimFrame(this._panRequest); 22426 22427 // @event moveend: Event 22428 // Fired when the marker stops moving (because of dragging). 22429 delete this._oldLatLng; 22430 this._marker 22431 .fire('moveend') 22432 .fire('dragend', e); 22433 } 22434 }); 22435 22436 /* 22437 * @class Marker 22438 * @inherits Interactive layer 22439 * @aka L.Marker 22440 * L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`. 22441 * 22442 * @example 22443 * 22444 * ```js 22445 * L.marker([50.5, 30.5]).addTo(map); 22446 * ``` 22447 */ 22448 22449 var Marker = Layer.extend({ 22450 22451 // @section 22452 // @aka Marker options 22453 options: { 22454 // @option icon: Icon = * 22455 // Icon instance to use for rendering the marker. 22456 // See [Icon documentation](#L.Icon) for details on how to customize the marker icon. 22457 // If not specified, a common instance of `L.Icon.Default` is used. 22458 icon: new IconDefault(), 22459 22460 // Option inherited from "Interactive layer" abstract class 22461 interactive: true, 22462 22463 // @option keyboard: Boolean = true 22464 // Whether the marker can be tabbed to with a keyboard and clicked by pressing enter. 22465 keyboard: true, 22466 22467 // @option title: String = '' 22468 // Text for the browser tooltip that appear on marker hover (no tooltip by default). 22469 // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled). 22470 title: '', 22471 22472 // @option alt: String = 'Marker' 22473 // Text for the `alt` attribute of the icon image. 22474 // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled). 22475 alt: 'Marker', 22476 22477 // @option zIndexOffset: Number = 0 22478 // By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively). 22479 zIndexOffset: 0, 22480 22481 // @option opacity: Number = 1.0 22482 // The opacity of the marker. 22483 opacity: 1, 22484 22485 // @option riseOnHover: Boolean = false 22486 // If `true`, the marker will get on top of others when you hover the mouse over it. 22487 riseOnHover: false, 22488 22489 // @option riseOffset: Number = 250 22490 // The z-index offset used for the `riseOnHover` feature. 22491 riseOffset: 250, 22492 22493 // @option pane: String = 'markerPane' 22494 // `Map pane` where the markers icon will be added. 22495 pane: 'markerPane', 22496 22497 // @option shadowPane: String = 'shadowPane' 22498 // `Map pane` where the markers shadow will be added. 22499 shadowPane: 'shadowPane', 22500 22501 // @option bubblingMouseEvents: Boolean = false 22502 // When `true`, a mouse event on this marker will trigger the same event on the map 22503 // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used). 22504 bubblingMouseEvents: false, 22505 22506 // @option autoPanOnFocus: Boolean = true 22507 // When `true`, the map will pan whenever the marker is focused (via 22508 // e.g. pressing `tab` on the keyboard) to ensure the marker is 22509 // visible within the map's bounds 22510 autoPanOnFocus: true, 22511 22512 // @section Draggable marker options 22513 // @option draggable: Boolean = false 22514 // Whether the marker is draggable with mouse/touch or not. 22515 draggable: false, 22516 22517 // @option autoPan: Boolean = false 22518 // Whether to pan the map when dragging this marker near its edge or not. 22519 autoPan: false, 22520 22521 // @option autoPanPadding: Point = Point(50, 50) 22522 // Distance (in pixels to the left/right and to the top/bottom) of the 22523 // map edge to start panning the map. 22524 autoPanPadding: [50, 50], 22525 22526 // @option autoPanSpeed: Number = 10 22527 // Number of pixels the map should pan by. 22528 autoPanSpeed: 10 22529 }, 22530 22531 /* @section 22532 * 22533 * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods: 22534 */ 22535 22536 initialize: function (latlng, options) { 22537 setOptions(this, options); 22538 this._latlng = toLatLng(latlng); 22539 }, 22540 22541 onAdd: function (map) { 22542 this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation; 22543 22544 if (this._zoomAnimated) { 22545 map.on('zoomanim', this._animateZoom, this); 22546 } 22547 22548 this._initIcon(); 22549 this.update(); 22550 }, 22551 22552 onRemove: function (map) { 22553 if (this.dragging && this.dragging.enabled()) { 22554 this.options.draggable = true; 22555 this.dragging.removeHooks(); 22556 } 22557 delete this.dragging; 22558 22559 if (this._zoomAnimated) { 22560 map.off('zoomanim', this._animateZoom, this); 22561 } 22562 22563 this._removeIcon(); 22564 this._removeShadow(); 22565 }, 22566 22567 getEvents: function () { 22568 return { 22569 zoom: this.update, 22570 viewreset: this.update 22571 }; 22572 }, 22573 22574 // @method getLatLng: LatLng 22575 // Returns the current geographical position of the marker. 22576 getLatLng: function () { 22577 return this._latlng; 22578 }, 22579 22580 // @method setLatLng(latlng: LatLng): this 22581 // Changes the marker position to the given point. 22582 setLatLng: function (latlng) { 22583 var oldLatLng = this._latlng; 22584 this._latlng = toLatLng(latlng); 22585 this.update(); 22586 22587 // @event move: Event 22588 // Fired when the marker is moved via [`setLatLng`](#marker-setlatlng) or by [dragging](#marker-dragging). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`. 22589 return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng}); 22590 }, 22591 22592 // @method setZIndexOffset(offset: Number): this 22593 // Changes the [zIndex offset](#marker-zindexoffset) of the marker. 22594 setZIndexOffset: function (offset) { 22595 this.options.zIndexOffset = offset; 22596 return this.update(); 22597 }, 22598 22599 // @method getIcon: Icon 22600 // Returns the current icon used by the marker 22601 getIcon: function () { 22602 return this.options.icon; 22603 }, 22604 22605 // @method setIcon(icon: Icon): this 22606 // Changes the marker icon. 22607 setIcon: function (icon) { 22608 22609 this.options.icon = icon; 22610 22611 if (this._map) { 22612 this._initIcon(); 22613 this.update(); 22614 } 22615 22616 if (this._popup) { 22617 this.bindPopup(this._popup, this._popup.options); 22618 } 22619 22620 return this; 22621 }, 22622 22623 getElement: function () { 22624 return this._icon; 22625 }, 22626 22627 update: function () { 22628 22629 if (this._icon && this._map) { 22630 var pos = this._map.latLngToLayerPoint(this._latlng).round(); 22631 this._setPos(pos); 22632 } 22633 22634 return this; 22635 }, 22636 22637 _initIcon: function () { 22638 var options = this.options, 22639 classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide'); 22640 22641 var icon = options.icon.createIcon(this._icon), 22642 addIcon = false; 22643 22644 // if we're not reusing the icon, remove the old one and init new one 22645 if (icon !== this._icon) { 22646 if (this._icon) { 22647 this._removeIcon(); 22648 } 22649 addIcon = true; 22650 22651 if (options.title) { 22652 icon.title = options.title; 22653 } 22654 22655 if (icon.tagName === 'IMG') { 22656 icon.alt = options.alt || ''; 22657 } 22658 } 22659 22660 addClass(icon, classToAdd); 22661 22662 if (options.keyboard) { 22663 icon.tabIndex = '0'; 22664 icon.setAttribute('role', 'button'); 22665 } 22666 22667 this._icon = icon; 22668 22669 if (options.riseOnHover) { 22670 this.on({ 22671 mouseover: this._bringToFront, 22672 mouseout: this._resetZIndex 22673 }); 22674 } 22675 22676 if (this.options.autoPanOnFocus) { 22677 on(icon, 'focus', this._panOnFocus, this); 22678 } 22679 22680 var newShadow = options.icon.createShadow(this._shadow), 22681 addShadow = false; 22682 22683 if (newShadow !== this._shadow) { 22684 this._removeShadow(); 22685 addShadow = true; 22686 } 22687 22688 if (newShadow) { 22689 addClass(newShadow, classToAdd); 22690 newShadow.alt = ''; 22691 } 22692 this._shadow = newShadow; 22693 22694 22695 if (options.opacity < 1) { 22696 this._updateOpacity(); 22697 } 22698 22699 22700 if (addIcon) { 22701 this.getPane().appendChild(this._icon); 22702 } 22703 this._initInteraction(); 22704 if (newShadow && addShadow) { 22705 this.getPane(options.shadowPane).appendChild(this._shadow); 22706 } 22707 }, 22708 22709 _removeIcon: function () { 22710 if (this.options.riseOnHover) { 22711 this.off({ 22712 mouseover: this._bringToFront, 22713 mouseout: this._resetZIndex 22714 }); 22715 } 22716 22717 if (this.options.autoPanOnFocus) { 22718 off(this._icon, 'focus', this._panOnFocus, this); 22719 } 22720 22721 remove(this._icon); 22722 this.removeInteractiveTarget(this._icon); 22723 22724 this._icon = null; 22725 }, 22726 22727 _removeShadow: function () { 22728 if (this._shadow) { 22729 remove(this._shadow); 22730 } 22731 this._shadow = null; 22732 }, 22733 22734 _setPos: function (pos) { 22735 22736 if (this._icon) { 22737 setPosition(this._icon, pos); 22738 } 22739 22740 if (this._shadow) { 22741 setPosition(this._shadow, pos); 22742 } 22743 22744 this._zIndex = pos.y + this.options.zIndexOffset; 22745 22746 this._resetZIndex(); 22747 }, 22748 22749 _updateZIndex: function (offset) { 22750 if (this._icon) { 22751 this._icon.style.zIndex = this._zIndex + offset; 22752 } 22753 }, 22754 22755 _animateZoom: function (opt) { 22756 var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round(); 22757 22758 this._setPos(pos); 22759 }, 22760 22761 _initInteraction: function () { 22762 22763 if (!this.options.interactive) { return; } 22764 22765 addClass(this._icon, 'leaflet-interactive'); 22766 22767 this.addInteractiveTarget(this._icon); 22768 22769 if (MarkerDrag) { 22770 var draggable = this.options.draggable; 22771 if (this.dragging) { 22772 draggable = this.dragging.enabled(); 22773 this.dragging.disable(); 22774 } 22775 22776 this.dragging = new MarkerDrag(this); 22777 22778 if (draggable) { 22779 this.dragging.enable(); 22780 } 22781 } 22782 }, 22783 22784 // @method setOpacity(opacity: Number): this 22785 // Changes the opacity of the marker. 22786 setOpacity: function (opacity) { 22787 this.options.opacity = opacity; 22788 if (this._map) { 22789 this._updateOpacity(); 22790 } 22791 22792 return this; 22793 }, 22794 22795 _updateOpacity: function () { 22796 var opacity = this.options.opacity; 22797 22798 if (this._icon) { 22799 setOpacity(this._icon, opacity); 22800 } 22801 22802 if (this._shadow) { 22803 setOpacity(this._shadow, opacity); 22804 } 22805 }, 22806 22807 _bringToFront: function () { 22808 this._updateZIndex(this.options.riseOffset); 22809 }, 22810 22811 _resetZIndex: function () { 22812 this._updateZIndex(0); 22813 }, 22814 22815 _panOnFocus: function () { 22816 var map = this._map; 22817 if (!map) { return; } 22818 22819 var iconOpts = this.options.icon.options; 22820 var size = iconOpts.iconSize ? toPoint(iconOpts.iconSize) : toPoint(0, 0); 22821 var anchor = iconOpts.iconAnchor ? toPoint(iconOpts.iconAnchor) : toPoint(0, 0); 22822 22823 map.panInside(this._latlng, { 22824 paddingTopLeft: anchor, 22825 paddingBottomRight: size.subtract(anchor) 22826 }); 22827 }, 22828 22829 _getPopupAnchor: function () { 22830 return this.options.icon.options.popupAnchor; 22831 }, 22832 22833 _getTooltipAnchor: function () { 22834 return this.options.icon.options.tooltipAnchor; 22835 } 22836 }); 22837 22838 22839 // factory L.marker(latlng: LatLng, options? : Marker options) 22840 22841 // @factory L.marker(latlng: LatLng, options? : Marker options) 22842 // Instantiates a Marker object given a geographical point and optionally an options object. 22843 function marker(latlng, options) { 22844 return new Marker(latlng, options); 22845 } 22846 22847 /* 22848 * @class Path 22849 * @aka L.Path 22850 * @inherits Interactive layer 22851 * 22852 * An abstract class that contains options and constants shared between vector 22853 * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`. 22854 */ 22855 22856 var Path = Layer.extend({ 22857 22858 // @section 22859 // @aka Path options 22860 options: { 22861 // @option stroke: Boolean = true 22862 // Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles. 22863 stroke: true, 22864 22865 // @option color: String = '#3388ff' 22866 // Stroke color 22867 color: '#3388ff', 22868 22869 // @option weight: Number = 3 22870 // Stroke width in pixels 22871 weight: 3, 22872 22873 // @option opacity: Number = 1.0 22874 // Stroke opacity 22875 opacity: 1, 22876 22877 // @option lineCap: String= 'round' 22878 // A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke. 22879 lineCap: 'round', 22880 22881 // @option lineJoin: String = 'round' 22882 // A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke. 22883 lineJoin: 'round', 22884 22885 // @option dashArray: String = null 22886 // A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility). 22887 dashArray: null, 22888 22889 // @option dashOffset: String = null 22890 // A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility). 22891 dashOffset: null, 22892 22893 // @option fill: Boolean = depends 22894 // Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles. 22895 fill: false, 22896 22897 // @option fillColor: String = * 22898 // Fill color. Defaults to the value of the [`color`](#path-color) option 22899 fillColor: null, 22900 22901 // @option fillOpacity: Number = 0.2 22902 // Fill opacity. 22903 fillOpacity: 0.2, 22904 22905 // @option fillRule: String = 'evenodd' 22906 // A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined. 22907 fillRule: 'evenodd', 22908 22909 // className: '', 22910 22911 // Option inherited from "Interactive layer" abstract class 22912 interactive: true, 22913 22914 // @option bubblingMouseEvents: Boolean = true 22915 // When `true`, a mouse event on this path will trigger the same event on the map 22916 // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used). 22917 bubblingMouseEvents: true 22918 }, 22919 22920 beforeAdd: function (map) { 22921 // Renderer is set here because we need to call renderer.getEvents 22922 // before this.getEvents. 22923 this._renderer = map.getRenderer(this); 22924 }, 22925 22926 onAdd: function () { 22927 this._renderer._initPath(this); 22928 this._reset(); 22929 this._renderer._addPath(this); 22930 }, 22931 22932 onRemove: function () { 22933 this._renderer._removePath(this); 22934 }, 22935 22936 // @method redraw(): this 22937 // Redraws the layer. Sometimes useful after you changed the coordinates that the path uses. 22938 redraw: function () { 22939 if (this._map) { 22940 this._renderer._updatePath(this); 22941 } 22942 return this; 22943 }, 22944 22945 // @method setStyle(style: Path options): this 22946 // Changes the appearance of a Path based on the options in the `Path options` object. 22947 setStyle: function (style) { 22948 setOptions(this, style); 22949 if (this._renderer) { 22950 this._renderer._updateStyle(this); 22951 if (this.options.stroke && style && Object.prototype.hasOwnProperty.call(style, 'weight')) { 22952 this._updateBounds(); 22953 } 22954 } 22955 return this; 22956 }, 22957 22958 // @method bringToFront(): this 22959 // Brings the layer to the top of all path layers. 22960 bringToFront: function () { 22961 if (this._renderer) { 22962 this._renderer._bringToFront(this); 22963 } 22964 return this; 22965 }, 22966 22967 // @method bringToBack(): this 22968 // Brings the layer to the bottom of all path layers. 22969 bringToBack: function () { 22970 if (this._renderer) { 22971 this._renderer._bringToBack(this); 22972 } 22973 return this; 22974 }, 22975 22976 getElement: function () { 22977 return this._path; 22978 }, 22979 22980 _reset: function () { 22981 // defined in child classes 22982 this._project(); 22983 this._update(); 22984 }, 22985 22986 _clickTolerance: function () { 22987 // used when doing hit detection for Canvas layers 22988 return (this.options.stroke ? this.options.weight / 2 : 0) + 22989 (this._renderer.options.tolerance || 0); 22990 } 22991 }); 22992 22993 /* 22994 * @class CircleMarker 22995 * @aka L.CircleMarker 22996 * @inherits Path 22997 * 22998 * A circle of a fixed size with radius specified in pixels. Extends `Path`. 22999 */ 23000 23001 var CircleMarker = Path.extend({ 23002 23003 // @section 23004 // @aka CircleMarker options 23005 options: { 23006 fill: true, 23007 23008 // @option radius: Number = 10 23009 // Radius of the circle marker, in pixels 23010 radius: 10 23011 }, 23012 23013 initialize: function (latlng, options) { 23014 setOptions(this, options); 23015 this._latlng = toLatLng(latlng); 23016 this._radius = this.options.radius; 23017 }, 23018 23019 // @method setLatLng(latLng: LatLng): this 23020 // Sets the position of a circle marker to a new location. 23021 setLatLng: function (latlng) { 23022 var oldLatLng = this._latlng; 23023 this._latlng = toLatLng(latlng); 23024 this.redraw(); 23025 23026 // @event move: Event 23027 // Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`. 23028 return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng}); 23029 }, 23030 23031 // @method getLatLng(): LatLng 23032 // Returns the current geographical position of the circle marker 23033 getLatLng: function () { 23034 return this._latlng; 23035 }, 23036 23037 // @method setRadius(radius: Number): this 23038 // Sets the radius of a circle marker. Units are in pixels. 23039 setRadius: function (radius) { 23040 this.options.radius = this._radius = radius; 23041 return this.redraw(); 23042 }, 23043 23044 // @method getRadius(): Number 23045 // Returns the current radius of the circle 23046 getRadius: function () { 23047 return this._radius; 23048 }, 23049 23050 setStyle : function (options) { 23051 var radius = options && options.radius || this._radius; 23052 Path.prototype.setStyle.call(this, options); 23053 this.setRadius(radius); 23054 return this; 23055 }, 23056 23057 _project: function () { 23058 this._point = this._map.latLngToLayerPoint(this._latlng); 23059 this._updateBounds(); 23060 }, 23061 23062 _updateBounds: function () { 23063 var r = this._radius, 23064 r2 = this._radiusY || r, 23065 w = this._clickTolerance(), 23066 p = [r + w, r2 + w]; 23067 this._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p)); 23068 }, 23069 23070 _update: function () { 23071 if (this._map) { 23072 this._updatePath(); 23073 } 23074 }, 23075 23076 _updatePath: function () { 23077 this._renderer._updateCircle(this); 23078 }, 23079 23080 _empty: function () { 23081 return this._radius && !this._renderer._bounds.intersects(this._pxBounds); 23082 }, 23083 23084 // Needed by the `Canvas` renderer for interactivity 23085 _containsPoint: function (p) { 23086 return p.distanceTo(this._point) <= this._radius + this._clickTolerance(); 23087 } 23088 }); 23089 23090 23091 // @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options) 23092 // Instantiates a circle marker object given a geographical point, and an optional options object. 23093 function circleMarker(latlng, options) { 23094 return new CircleMarker(latlng, options); 23095 } 23096 23097 /* 23098 * @class Circle 23099 * @aka L.Circle 23100 * @inherits CircleMarker 23101 * 23102 * A class for drawing circle overlays on a map. Extends `CircleMarker`. 23103 * 23104 * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion). 23105 * 23106 * @example 23107 * 23108 * ```js 23109 * L.circle([50.5, 30.5], {radius: 200}).addTo(map); 23110 * ``` 23111 */ 23112 23113 var Circle = CircleMarker.extend({ 23114 23115 initialize: function (latlng, options, legacyOptions) { 23116 if (typeof options === 'number') { 23117 // Backwards compatibility with 0.7.x factory (latlng, radius, options?) 23118 options = extend({}, legacyOptions, {radius: options}); 23119 } 23120 setOptions(this, options); 23121 this._latlng = toLatLng(latlng); 23122 23123 if (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); } 23124 23125 // @section 23126 // @aka Circle options 23127 // @option radius: Number; Radius of the circle, in meters. 23128 this._mRadius = this.options.radius; 23129 }, 23130 23131 // @method setRadius(radius: Number): this 23132 // Sets the radius of a circle. Units are in meters. 23133 setRadius: function (radius) { 23134 this._mRadius = radius; 23135 return this.redraw(); 23136 }, 23137 23138 // @method getRadius(): Number 23139 // Returns the current radius of a circle. Units are in meters. 23140 getRadius: function () { 23141 return this._mRadius; 23142 }, 23143 23144 // @method getBounds(): LatLngBounds 23145 // Returns the `LatLngBounds` of the path. 23146 getBounds: function () { 23147 var half = [this._radius, this._radiusY || this._radius]; 23148 23149 return new LatLngBounds( 23150 this._map.layerPointToLatLng(this._point.subtract(half)), 23151 this._map.layerPointToLatLng(this._point.add(half))); 23152 }, 23153 23154 setStyle: Path.prototype.setStyle, 23155 23156 _project: function () { 23157 23158 var lng = this._latlng.lng, 23159 lat = this._latlng.lat, 23160 map = this._map, 23161 crs = map.options.crs; 23162 23163 if (crs.distance === Earth.distance) { 23164 var d = Math.PI / 180, 23165 latR = (this._mRadius / Earth.R) / d, 23166 top = map.project([lat + latR, lng]), 23167 bottom = map.project([lat - latR, lng]), 23168 p = top.add(bottom).divideBy(2), 23169 lat2 = map.unproject(p).lat, 23170 lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) / 23171 (Math.cos(lat * d) * Math.cos(lat2 * d))) / d; 23172 23173 if (isNaN(lngR) || lngR === 0) { 23174 lngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425 23175 } 23176 23177 this._point = p.subtract(map.getPixelOrigin()); 23178 this._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x; 23179 this._radiusY = p.y - top.y; 23180 23181 } else { 23182 var latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0])); 23183 23184 this._point = map.latLngToLayerPoint(this._latlng); 23185 this._radius = this._point.x - map.latLngToLayerPoint(latlng2).x; 23186 } 23187 23188 this._updateBounds(); 23189 } 23190 }); 23191 23192 // @factory L.circle(latlng: LatLng, options?: Circle options) 23193 // Instantiates a circle object given a geographical point, and an options object 23194 // which contains the circle radius. 23195 // @alternative 23196 // @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options) 23197 // Obsolete way of instantiating a circle, for compatibility with 0.7.x code. 23198 // Do not use in new applications or plugins. 23199 function circle(latlng, options, legacyOptions) { 23200 return new Circle(latlng, options, legacyOptions); 23201 } 23202 23203 /* 23204 * @class Polyline 23205 * @aka L.Polyline 23206 * @inherits Path 23207 * 23208 * A class for drawing polyline overlays on a map. Extends `Path`. 23209 * 23210 * @example 23211 * 23212 * ```js 23213 * // create a red polyline from an array of LatLng points 23214 * var latlngs = [ 23215 * [45.51, -122.68], 23216 * [37.77, -122.43], 23217 * [34.04, -118.2] 23218 * ]; 23219 * 23220 * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map); 23221 * 23222 * // zoom the map to the polyline 23223 * map.fitBounds(polyline.getBounds()); 23224 * ``` 23225 * 23226 * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape: 23227 * 23228 * ```js 23229 * // create a red polyline from an array of arrays of LatLng points 23230 * var latlngs = [ 23231 * [[45.51, -122.68], 23232 * [37.77, -122.43], 23233 * [34.04, -118.2]], 23234 * [[40.78, -73.91], 23235 * [41.83, -87.62], 23236 * [32.76, -96.72]] 23237 * ]; 23238 * ``` 23239 */ 23240 23241 23242 var Polyline = Path.extend({ 23243 23244 // @section 23245 // @aka Polyline options 23246 options: { 23247 // @option smoothFactor: Number = 1.0 23248 // How much to simplify the polyline on each zoom level. More means 23249 // better performance and smoother look, and less means more accurate representation. 23250 smoothFactor: 1.0, 23251 23252 // @option noClip: Boolean = false 23253 // Disable polyline clipping. 23254 noClip: false 23255 }, 23256 23257 initialize: function (latlngs, options) { 23258 setOptions(this, options); 23259 this._setLatLngs(latlngs); 23260 }, 23261 23262 // @method getLatLngs(): LatLng[] 23263 // Returns an array of the points in the path, or nested arrays of points in case of multi-polyline. 23264 getLatLngs: function () { 23265 return this._latlngs; 23266 }, 23267 23268 // @method setLatLngs(latlngs: LatLng[]): this 23269 // Replaces all the points in the polyline with the given array of geographical points. 23270 setLatLngs: function (latlngs) { 23271 this._setLatLngs(latlngs); 23272 return this.redraw(); 23273 }, 23274 23275 // @method isEmpty(): Boolean 23276 // Returns `true` if the Polyline has no LatLngs. 23277 isEmpty: function () { 23278 return !this._latlngs.length; 23279 }, 23280 23281 // @method closestLayerPoint(p: Point): Point 23282 // Returns the point closest to `p` on the Polyline. 23283 closestLayerPoint: function (p) { 23284 var minDistance = Infinity, 23285 minPoint = null, 23286 closest = _sqClosestPointOnSegment, 23287 p1, p2; 23288 23289 for (var j = 0, jLen = this._parts.length; j < jLen; j++) { 23290 var points = this._parts[j]; 23291 23292 for (var i = 1, len = points.length; i < len; i++) { 23293 p1 = points[i - 1]; 23294 p2 = points[i]; 23295 23296 var sqDist = closest(p, p1, p2, true); 23297 23298 if (sqDist < minDistance) { 23299 minDistance = sqDist; 23300 minPoint = closest(p, p1, p2); 23301 } 23302 } 23303 } 23304 if (minPoint) { 23305 minPoint.distance = Math.sqrt(minDistance); 23306 } 23307 return minPoint; 23308 }, 23309 23310 // @method getCenter(): LatLng 23311 // Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline. 23312 getCenter: function () { 23313 // throws error when not yet added to map as this center calculation requires projected coordinates 23314 if (!this._map) { 23315 throw new Error('Must add layer to map before using getCenter()'); 23316 } 23317 return polylineCenter(this._defaultShape(), this._map.options.crs); 23318 }, 23319 23320 // @method getBounds(): LatLngBounds 23321 // Returns the `LatLngBounds` of the path. 23322 getBounds: function () { 23323 return this._bounds; 23324 }, 23325 23326 // @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this 23327 // Adds a given point to the polyline. By default, adds to the first ring of 23328 // the polyline in case of a multi-polyline, but can be overridden by passing 23329 // a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)). 23330 addLatLng: function (latlng, latlngs) { 23331 latlngs = latlngs || this._defaultShape(); 23332 latlng = toLatLng(latlng); 23333 latlngs.push(latlng); 23334 this._bounds.extend(latlng); 23335 return this.redraw(); 23336 }, 23337 23338 _setLatLngs: function (latlngs) { 23339 this._bounds = new LatLngBounds(); 23340 this._latlngs = this._convertLatLngs(latlngs); 23341 }, 23342 23343 _defaultShape: function () { 23344 return isFlat(this._latlngs) ? this._latlngs : this._latlngs[0]; 23345 }, 23346 23347 // recursively convert latlngs input into actual LatLng instances; calculate bounds along the way 23348 _convertLatLngs: function (latlngs) { 23349 var result = [], 23350 flat = isFlat(latlngs); 23351 23352 for (var i = 0, len = latlngs.length; i < len; i++) { 23353 if (flat) { 23354 result[i] = toLatLng(latlngs[i]); 23355 this._bounds.extend(result[i]); 23356 } else { 23357 result[i] = this._convertLatLngs(latlngs[i]); 23358 } 23359 } 23360 23361 return result; 23362 }, 23363 23364 _project: function () { 23365 var pxBounds = new Bounds(); 23366 this._rings = []; 23367 this._projectLatlngs(this._latlngs, this._rings, pxBounds); 23368 23369 if (this._bounds.isValid() && pxBounds.isValid()) { 23370 this._rawPxBounds = pxBounds; 23371 this._updateBounds(); 23372 } 23373 }, 23374 23375 _updateBounds: function () { 23376 var w = this._clickTolerance(), 23377 p = new Point(w, w); 23378 23379 if (!this._rawPxBounds) { 23380 return; 23381 } 23382 23383 this._pxBounds = new Bounds([ 23384 this._rawPxBounds.min.subtract(p), 23385 this._rawPxBounds.max.add(p) 23386 ]); 23387 }, 23388 23389 // recursively turns latlngs into a set of rings with projected coordinates 23390 _projectLatlngs: function (latlngs, result, projectedBounds) { 23391 var flat = latlngs[0] instanceof LatLng, 23392 len = latlngs.length, 23393 i, ring; 23394 23395 if (flat) { 23396 ring = []; 23397 for (i = 0; i < len; i++) { 23398 ring[i] = this._map.latLngToLayerPoint(latlngs[i]); 23399 projectedBounds.extend(ring[i]); 23400 } 23401 result.push(ring); 23402 } else { 23403 for (i = 0; i < len; i++) { 23404 this._projectLatlngs(latlngs[i], result, projectedBounds); 23405 } 23406 } 23407 }, 23408 23409 // clip polyline by renderer bounds so that we have less to render for performance 23410 _clipPoints: function () { 23411 var bounds = this._renderer._bounds; 23412 23413 this._parts = []; 23414 if (!this._pxBounds || !this._pxBounds.intersects(bounds)) { 23415 return; 23416 } 23417 23418 if (this.options.noClip) { 23419 this._parts = this._rings; 23420 return; 23421 } 23422 23423 var parts = this._parts, 23424 i, j, k, len, len2, segment, points; 23425 23426 for (i = 0, k = 0, len = this._rings.length; i < len; i++) { 23427 points = this._rings[i]; 23428 23429 for (j = 0, len2 = points.length; j < len2 - 1; j++) { 23430 segment = clipSegment(points[j], points[j + 1], bounds, j, true); 23431 23432 if (!segment) { continue; } 23433 23434 parts[k] = parts[k] || []; 23435 parts[k].push(segment[0]); 23436 23437 // if segment goes out of screen, or it's the last one, it's the end of the line part 23438 if ((segment[1] !== points[j + 1]) || (j === len2 - 2)) { 23439 parts[k].push(segment[1]); 23440 k++; 23441 } 23442 } 23443 } 23444 }, 23445 23446 // simplify each clipped part of the polyline for performance 23447 _simplifyPoints: function () { 23448 var parts = this._parts, 23449 tolerance = this.options.smoothFactor; 23450 23451 for (var i = 0, len = parts.length; i < len; i++) { 23452 parts[i] = simplify(parts[i], tolerance); 23453 } 23454 }, 23455 23456 _update: function () { 23457 if (!this._map) { return; } 23458 23459 this._clipPoints(); 23460 this._simplifyPoints(); 23461 this._updatePath(); 23462 }, 23463 23464 _updatePath: function () { 23465 this._renderer._updatePoly(this); 23466 }, 23467 23468 // Needed by the `Canvas` renderer for interactivity 23469 _containsPoint: function (p, closed) { 23470 var i, j, k, len, len2, part, 23471 w = this._clickTolerance(); 23472 23473 if (!this._pxBounds || !this._pxBounds.contains(p)) { return false; } 23474 23475 // hit detection for polylines 23476 for (i = 0, len = this._parts.length; i < len; i++) { 23477 part = this._parts[i]; 23478 23479 for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) { 23480 if (!closed && (j === 0)) { continue; } 23481 23482 if (pointToSegmentDistance(p, part[k], part[j]) <= w) { 23483 return true; 23484 } 23485 } 23486 } 23487 return false; 23488 } 23489 }); 23490 23491 // @factory L.polyline(latlngs: LatLng[], options?: Polyline options) 23492 // Instantiates a polyline object given an array of geographical points and 23493 // optionally an options object. You can create a `Polyline` object with 23494 // multiple separate lines (`MultiPolyline`) by passing an array of arrays 23495 // of geographic points. 23496 function polyline(latlngs, options) { 23497 return new Polyline(latlngs, options); 23498 } 23499 23500 // Retrocompat. Allow plugins to support Leaflet versions before and after 1.1. 23501 Polyline._flat = _flat; 23502 23503 /* 23504 * @class Polygon 23505 * @aka L.Polygon 23506 * @inherits Polyline 23507 * 23508 * A class for drawing polygon overlays on a map. Extends `Polyline`. 23509 * 23510 * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one â it's better to filter out such points. 23511 * 23512 * 23513 * @example 23514 * 23515 * ```js 23516 * // create a red polygon from an array of LatLng points 23517 * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]]; 23518 * 23519 * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map); 23520 * 23521 * // zoom the map to the polygon 23522 * map.fitBounds(polygon.getBounds()); 23523 * ``` 23524 * 23525 * You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape: 23526 * 23527 * ```js 23528 * var latlngs = [ 23529 * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring 23530 * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole 23531 * ]; 23532 * ``` 23533 * 23534 * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape. 23535 * 23536 * ```js 23537 * var latlngs = [ 23538 * [ // first polygon 23539 * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring 23540 * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole 23541 * ], 23542 * [ // second polygon 23543 * [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]] 23544 * ] 23545 * ]; 23546 * ``` 23547 */ 23548 23549 var Polygon = Polyline.extend({ 23550 23551 options: { 23552 fill: true 23553 }, 23554 23555 isEmpty: function () { 23556 return !this._latlngs.length || !this._latlngs[0].length; 23557 }, 23558 23559 // @method getCenter(): LatLng 23560 // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon. 23561 getCenter: function () { 23562 // throws error when not yet added to map as this center calculation requires projected coordinates 23563 if (!this._map) { 23564 throw new Error('Must add layer to map before using getCenter()'); 23565 } 23566 return polygonCenter(this._defaultShape(), this._map.options.crs); 23567 }, 23568 23569 _convertLatLngs: function (latlngs) { 23570 var result = Polyline.prototype._convertLatLngs.call(this, latlngs), 23571 len = result.length; 23572 23573 // remove last point if it equals first one 23574 if (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) { 23575 result.pop(); 23576 } 23577 return result; 23578 }, 23579 23580 _setLatLngs: function (latlngs) { 23581 Polyline.prototype._setLatLngs.call(this, latlngs); 23582 if (isFlat(this._latlngs)) { 23583 this._latlngs = [this._latlngs]; 23584 } 23585 }, 23586 23587 _defaultShape: function () { 23588 return isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0]; 23589 }, 23590 23591 _clipPoints: function () { 23592 // polygons need a different clipping algorithm so we redefine that 23593 23594 var bounds = this._renderer._bounds, 23595 w = this.options.weight, 23596 p = new Point(w, w); 23597 23598 // increase clip padding by stroke width to avoid stroke on clip edges 23599 bounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p)); 23600 23601 this._parts = []; 23602 if (!this._pxBounds || !this._pxBounds.intersects(bounds)) { 23603 return; 23604 } 23605 23606 if (this.options.noClip) { 23607 this._parts = this._rings; 23608 return; 23609 } 23610 23611 for (var i = 0, len = this._rings.length, clipped; i < len; i++) { 23612 clipped = clipPolygon(this._rings[i], bounds, true); 23613 if (clipped.length) { 23614 this._parts.push(clipped); 23615 } 23616 } 23617 }, 23618 23619 _updatePath: function () { 23620 this._renderer._updatePoly(this, true); 23621 }, 23622 23623 // Needed by the `Canvas` renderer for interactivity 23624 _containsPoint: function (p) { 23625 var inside = false, 23626 part, p1, p2, i, j, k, len, len2; 23627 23628 if (!this._pxBounds || !this._pxBounds.contains(p)) { return false; } 23629 23630 // ray casting algorithm for detecting if point is in polygon 23631 for (i = 0, len = this._parts.length; i < len; i++) { 23632 part = this._parts[i]; 23633 23634 for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) { 23635 p1 = part[j]; 23636 p2 = part[k]; 23637 23638 if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) { 23639 inside = !inside; 23640 } 23641 } 23642 } 23643 23644 // also check if it's on polygon stroke 23645 return inside || Polyline.prototype._containsPoint.call(this, p, true); 23646 } 23647 23648 }); 23649 23650 23651 // @factory L.polygon(latlngs: LatLng[], options?: Polyline options) 23652 function polygon(latlngs, options) { 23653 return new Polygon(latlngs, options); 23654 } 23655 23656 /* 23657 * @class GeoJSON 23658 * @aka L.GeoJSON 23659 * @inherits FeatureGroup 23660 * 23661 * Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse 23662 * GeoJSON data and display it on the map. Extends `FeatureGroup`. 23663 * 23664 * @example 23665 * 23666 * ```js 23667 * L.geoJSON(data, { 23668 * style: function (feature) { 23669 * return {color: feature.properties.color}; 23670 * } 23671 * }).bindPopup(function (layer) { 23672 * return layer.feature.properties.description; 23673 * }).addTo(map); 23674 * ``` 23675 */ 23676 23677 var GeoJSON = FeatureGroup.extend({ 23678 23679 /* @section 23680 * @aka GeoJSON options 23681 * 23682 * @option pointToLayer: Function = * 23683 * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally 23684 * called when data is added, passing the GeoJSON point feature and its `LatLng`. 23685 * The default is to spawn a default `Marker`: 23686 * ```js 23687 * function(geoJsonPoint, latlng) { 23688 * return L.marker(latlng); 23689 * } 23690 * ``` 23691 * 23692 * @option style: Function = * 23693 * A `Function` defining the `Path options` for styling GeoJSON lines and polygons, 23694 * called internally when data is added. 23695 * The default value is to not override any defaults: 23696 * ```js 23697 * function (geoJsonFeature) { 23698 * return {} 23699 * } 23700 * ``` 23701 * 23702 * @option onEachFeature: Function = * 23703 * A `Function` that will be called once for each created `Feature`, after it has 23704 * been created and styled. Useful for attaching events and popups to features. 23705 * The default is to do nothing with the newly created layers: 23706 * ```js 23707 * function (feature, layer) {} 23708 * ``` 23709 * 23710 * @option filter: Function = * 23711 * A `Function` that will be used to decide whether to include a feature or not. 23712 * The default is to include all features: 23713 * ```js 23714 * function (geoJsonFeature) { 23715 * return true; 23716 * } 23717 * ``` 23718 * Note: dynamically changing the `filter` option will have effect only on newly 23719 * added data. It will _not_ re-evaluate already included features. 23720 * 23721 * @option coordsToLatLng: Function = * 23722 * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s. 23723 * The default is the `coordsToLatLng` static method. 23724 * 23725 * @option markersInheritOptions: Boolean = false 23726 * Whether default Markers for "Point" type Features inherit from group options. 23727 */ 23728 23729 initialize: function (geojson, options) { 23730 setOptions(this, options); 23731 23732 this._layers = {}; 23733 23734 if (geojson) { 23735 this.addData(geojson); 23736 } 23737 }, 23738 23739 // @method addData( <GeoJSON> data ): this 23740 // Adds a GeoJSON object to the layer. 23741 addData: function (geojson) { 23742 var features = isArray(geojson) ? geojson : geojson.features, 23743 i, len, feature; 23744 23745 if (features) { 23746 for (i = 0, len = features.length; i < len; i++) { 23747 // only add this if geometry or geometries are set and not null 23748 feature = features[i]; 23749 if (feature.geometries || feature.geometry || feature.features || feature.coordinates) { 23750 this.addData(feature); 23751 } 23752 } 23753 return this; 23754 } 23755 23756 var options = this.options; 23757 23758 if (options.filter && !options.filter(geojson)) { return this; } 23759 23760 var layer = geometryToLayer(geojson, options); 23761 if (!layer) { 23762 return this; 23763 } 23764 layer.feature = asFeature(geojson); 23765 23766 layer.defaultOptions = layer.options; 23767 this.resetStyle(layer); 23768 23769 if (options.onEachFeature) { 23770 options.onEachFeature(geojson, layer); 23771 } 23772 23773 return this.addLayer(layer); 23774 }, 23775 23776 // @method resetStyle( <Path> layer? ): this 23777 // Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events. 23778 // If `layer` is omitted, the style of all features in the current layer is reset. 23779 resetStyle: function (layer) { 23780 if (layer === undefined) { 23781 return this.eachLayer(this.resetStyle, this); 23782 } 23783 // reset any custom styles 23784 layer.options = extend({}, layer.defaultOptions); 23785 this._setLayerStyle(layer, this.options.style); 23786 return this; 23787 }, 23788 23789 // @method setStyle( <Function> style ): this 23790 // Changes styles of GeoJSON vector layers with the given style function. 23791 setStyle: function (style) { 23792 return this.eachLayer(function (layer) { 23793 this._setLayerStyle(layer, style); 23794 }, this); 23795 }, 23796 23797 _setLayerStyle: function (layer, style) { 23798 if (layer.setStyle) { 23799 if (typeof style === 'function') { 23800 style = style(layer.feature); 23801 } 23802 layer.setStyle(style); 23803 } 23804 } 23805 }); 23806 23807 // @section 23808 // There are several static functions which can be called without instantiating L.GeoJSON: 23809 23810 // @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer 23811 // Creates a `Layer` from a given GeoJSON feature. Can use a custom 23812 // [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng) 23813 // functions if provided as options. 23814 function geometryToLayer(geojson, options) { 23815 23816 var geometry = geojson.type === 'Feature' ? geojson.geometry : geojson, 23817 coords = geometry ? geometry.coordinates : null, 23818 layers = [], 23819 pointToLayer = options && options.pointToLayer, 23820 _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng, 23821 latlng, latlngs, i, len; 23822 23823 if (!coords && !geometry) { 23824 return null; 23825 } 23826 23827 switch (geometry.type) { 23828 case 'Point': 23829 latlng = _coordsToLatLng(coords); 23830 return _pointToLayer(pointToLayer, geojson, latlng, options); 23831 23832 case 'MultiPoint': 23833 for (i = 0, len = coords.length; i < len; i++) { 23834 latlng = _coordsToLatLng(coords[i]); 23835 layers.push(_pointToLayer(pointToLayer, geojson, latlng, options)); 23836 } 23837 return new FeatureGroup(layers); 23838 23839 case 'LineString': 23840 case 'MultiLineString': 23841 latlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng); 23842 return new Polyline(latlngs, options); 23843 23844 case 'Polygon': 23845 case 'MultiPolygon': 23846 latlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng); 23847 return new Polygon(latlngs, options); 23848 23849 case 'GeometryCollection': 23850 for (i = 0, len = geometry.geometries.length; i < len; i++) { 23851 var geoLayer = geometryToLayer({ 23852 geometry: geometry.geometries[i], 23853 type: 'Feature', 23854 properties: geojson.properties 23855 }, options); 23856 23857 if (geoLayer) { 23858 layers.push(geoLayer); 23859 } 23860 } 23861 return new FeatureGroup(layers); 23862 23863 case 'FeatureCollection': 23864 for (i = 0, len = geometry.features.length; i < len; i++) { 23865 var featureLayer = geometryToLayer(geometry.features[i], options); 23866 23867 if (featureLayer) { 23868 layers.push(featureLayer); 23869 } 23870 } 23871 return new FeatureGroup(layers); 23872 23873 default: 23874 throw new Error('Invalid GeoJSON object.'); 23875 } 23876 } 23877 23878 function _pointToLayer(pointToLayerFn, geojson, latlng, options) { 23879 return pointToLayerFn ? 23880 pointToLayerFn(geojson, latlng) : 23881 new Marker(latlng, options && options.markersInheritOptions && options); 23882 } 23883 23884 // @function coordsToLatLng(coords: Array): LatLng 23885 // Creates a `LatLng` object from an array of 2 numbers (longitude, latitude) 23886 // or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points. 23887 function coordsToLatLng(coords) { 23888 return new LatLng(coords[1], coords[0], coords[2]); 23889 } 23890 23891 // @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array 23892 // Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array. 23893 // `levelsDeep` specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default). 23894 // Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function. 23895 function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) { 23896 var latlngs = []; 23897 23898 for (var i = 0, len = coords.length, latlng; i < len; i++) { 23899 latlng = levelsDeep ? 23900 coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) : 23901 (_coordsToLatLng || coordsToLatLng)(coords[i]); 23902 23903 latlngs.push(latlng); 23904 } 23905 23906 return latlngs; 23907 } 23908 23909 // @function latLngToCoords(latlng: LatLng, precision?: Number|false): Array 23910 // Reverse of [`coordsToLatLng`](#geojson-coordstolatlng) 23911 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function. 23912 function latLngToCoords(latlng, precision) { 23913 latlng = toLatLng(latlng); 23914 return latlng.alt !== undefined ? 23915 [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision), formatNum(latlng.alt, precision)] : 23916 [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision)]; 23917 } 23918 23919 // @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean, precision?: Number|false): Array 23920 // Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs) 23921 // `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default. 23922 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function. 23923 function latLngsToCoords(latlngs, levelsDeep, closed, precision) { 23924 var coords = []; 23925 23926 for (var i = 0, len = latlngs.length; i < len; i++) { 23927 // Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion 23928 coords.push(levelsDeep ? 23929 latLngsToCoords(latlngs[i], isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) : 23930 latLngToCoords(latlngs[i], precision)); 23931 } 23932 23933 if (!levelsDeep && closed) { 23934 coords.push(coords[0].slice()); 23935 } 23936 23937 return coords; 23938 } 23939 23940 function getFeature(layer, newGeometry) { 23941 return layer.feature ? 23942 extend({}, layer.feature, {geometry: newGeometry}) : 23943 asFeature(newGeometry); 23944 } 23945 23946 // @function asFeature(geojson: Object): Object 23947 // Normalize GeoJSON geometries/features into GeoJSON features. 23948 function asFeature(geojson) { 23949 if (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') { 23950 return geojson; 23951 } 23952 23953 return { 23954 type: 'Feature', 23955 properties: {}, 23956 geometry: geojson 23957 }; 23958 } 23959 23960 var PointToGeoJSON = { 23961 toGeoJSON: function (precision) { 23962 return getFeature(this, { 23963 type: 'Point', 23964 coordinates: latLngToCoords(this.getLatLng(), precision) 23965 }); 23966 } 23967 }; 23968 23969 // @namespace Marker 23970 // @section Other methods 23971 // @method toGeoJSON(precision?: Number|false): Object 23972 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. 23973 // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature). 23974 Marker.include(PointToGeoJSON); 23975 23976 // @namespace CircleMarker 23977 // @method toGeoJSON(precision?: Number|false): Object 23978 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. 23979 // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature). 23980 Circle.include(PointToGeoJSON); 23981 CircleMarker.include(PointToGeoJSON); 23982 23983 23984 // @namespace Polyline 23985 // @method toGeoJSON(precision?: Number|false): Object 23986 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. 23987 // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature). 23988 Polyline.include({ 23989 toGeoJSON: function (precision) { 23990 var multi = !isFlat(this._latlngs); 23991 23992 var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision); 23993 23994 return getFeature(this, { 23995 type: (multi ? 'Multi' : '') + 'LineString', 23996 coordinates: coords 23997 }); 23998 } 23999 }); 24000 24001 // @namespace Polygon 24002 // @method toGeoJSON(precision?: Number|false): Object 24003 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. 24004 // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature). 24005 Polygon.include({ 24006 toGeoJSON: function (precision) { 24007 var holes = !isFlat(this._latlngs), 24008 multi = holes && !isFlat(this._latlngs[0]); 24009 24010 var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision); 24011 24012 if (!holes) { 24013 coords = [coords]; 24014 } 24015 24016 return getFeature(this, { 24017 type: (multi ? 'Multi' : '') + 'Polygon', 24018 coordinates: coords 24019 }); 24020 } 24021 }); 24022 24023 24024 // @namespace LayerGroup 24025 LayerGroup.include({ 24026 toMultiPoint: function (precision) { 24027 var coords = []; 24028 24029 this.eachLayer(function (layer) { 24030 coords.push(layer.toGeoJSON(precision).geometry.coordinates); 24031 }); 24032 24033 return getFeature(this, { 24034 type: 'MultiPoint', 24035 coordinates: coords 24036 }); 24037 }, 24038 24039 // @method toGeoJSON(precision?: Number|false): Object 24040 // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. 24041 // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`). 24042 toGeoJSON: function (precision) { 24043 24044 var type = this.feature && this.feature.geometry && this.feature.geometry.type; 24045 24046 if (type === 'MultiPoint') { 24047 return this.toMultiPoint(precision); 24048 } 24049 24050 var isGeometryCollection = type === 'GeometryCollection', 24051 jsons = []; 24052 24053 this.eachLayer(function (layer) { 24054 if (layer.toGeoJSON) { 24055 var json = layer.toGeoJSON(precision); 24056 if (isGeometryCollection) { 24057 jsons.push(json.geometry); 24058 } else { 24059 var feature = asFeature(json); 24060 // Squash nested feature collections 24061 if (feature.type === 'FeatureCollection') { 24062 jsons.push.apply(jsons, feature.features); 24063 } else { 24064 jsons.push(feature); 24065 } 24066 } 24067 } 24068 }); 24069 24070 if (isGeometryCollection) { 24071 return getFeature(this, { 24072 geometries: jsons, 24073 type: 'GeometryCollection' 24074 }); 24075 } 24076 24077 return { 24078 type: 'FeatureCollection', 24079 features: jsons 24080 }; 24081 } 24082 }); 24083 24084 // @namespace GeoJSON 24085 // @factory L.geoJSON(geojson?: Object, options?: GeoJSON options) 24086 // Creates a GeoJSON layer. Optionally accepts an object in 24087 // [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map 24088 // (you can alternatively add it later with `addData` method) and an `options` object. 24089 function geoJSON(geojson, options) { 24090 return new GeoJSON(geojson, options); 24091 } 24092 24093 // Backward compatibility. 24094 var geoJson = geoJSON; 24095 24096 /* 24097 * @class ImageOverlay 24098 * @aka L.ImageOverlay 24099 * @inherits Interactive layer 24100 * 24101 * Used to load and display a single image over specific bounds of the map. Extends `Layer`. 24102 * 24103 * @example 24104 * 24105 * ```js 24106 * var imageUrl = 'https://maps.lib.utexas.edu/maps/historical/newark_nj_1922.jpg', 24107 * imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]]; 24108 * L.imageOverlay(imageUrl, imageBounds).addTo(map); 24109 * ``` 24110 */ 24111 24112 var ImageOverlay = Layer.extend({ 24113 24114 // @section 24115 // @aka ImageOverlay options 24116 options: { 24117 // @option opacity: Number = 1.0 24118 // The opacity of the image overlay. 24119 opacity: 1, 24120 24121 // @option alt: String = '' 24122 // Text for the `alt` attribute of the image (useful for accessibility). 24123 alt: '', 24124 24125 // @option interactive: Boolean = false 24126 // If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered. 24127 interactive: false, 24128 24129 // @option crossOrigin: Boolean|String = false 24130 // Whether the crossOrigin attribute will be added to the image. 24131 // If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data. 24132 // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. 24133 crossOrigin: false, 24134 24135 // @option errorOverlayUrl: String = '' 24136 // URL to the overlay image to show in place of the overlay that failed to load. 24137 errorOverlayUrl: '', 24138 24139 // @option zIndex: Number = 1 24140 // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer. 24141 zIndex: 1, 24142 24143 // @option className: String = '' 24144 // A custom class name to assign to the image. Empty by default. 24145 className: '' 24146 }, 24147 24148 initialize: function (url, bounds, options) { // (String, LatLngBounds, Object) 24149 this._url = url; 24150 this._bounds = toLatLngBounds(bounds); 24151 24152 setOptions(this, options); 24153 }, 24154 24155 onAdd: function () { 24156 if (!this._image) { 24157 this._initImage(); 24158 24159 if (this.options.opacity < 1) { 24160 this._updateOpacity(); 24161 } 24162 } 24163 24164 if (this.options.interactive) { 24165 addClass(this._image, 'leaflet-interactive'); 24166 this.addInteractiveTarget(this._image); 24167 } 24168 24169 this.getPane().appendChild(this._image); 24170 this._reset(); 24171 }, 24172 24173 onRemove: function () { 24174 remove(this._image); 24175 if (this.options.interactive) { 24176 this.removeInteractiveTarget(this._image); 24177 } 24178 }, 24179 24180 // @method setOpacity(opacity: Number): this 24181 // Sets the opacity of the overlay. 24182 setOpacity: function (opacity) { 24183 this.options.opacity = opacity; 24184 24185 if (this._image) { 24186 this._updateOpacity(); 24187 } 24188 return this; 24189 }, 24190 24191 setStyle: function (styleOpts) { 24192 if (styleOpts.opacity) { 24193 this.setOpacity(styleOpts.opacity); 24194 } 24195 return this; 24196 }, 24197 24198 // @method bringToFront(): this 24199 // Brings the layer to the top of all overlays. 24200 bringToFront: function () { 24201 if (this._map) { 24202 toFront(this._image); 24203 } 24204 return this; 24205 }, 24206 24207 // @method bringToBack(): this 24208 // Brings the layer to the bottom of all overlays. 24209 bringToBack: function () { 24210 if (this._map) { 24211 toBack(this._image); 24212 } 24213 return this; 24214 }, 24215 24216 // @method setUrl(url: String): this 24217 // Changes the URL of the image. 24218 setUrl: function (url) { 24219 this._url = url; 24220 24221 if (this._image) { 24222 this._image.src = url; 24223 } 24224 return this; 24225 }, 24226 24227 // @method setBounds(bounds: LatLngBounds): this 24228 // Update the bounds that this ImageOverlay covers 24229 setBounds: function (bounds) { 24230 this._bounds = toLatLngBounds(bounds); 24231 24232 if (this._map) { 24233 this._reset(); 24234 } 24235 return this; 24236 }, 24237 24238 getEvents: function () { 24239 var events = { 24240 zoom: this._reset, 24241 viewreset: this._reset 24242 }; 24243 24244 if (this._zoomAnimated) { 24245 events.zoomanim = this._animateZoom; 24246 } 24247 24248 return events; 24249 }, 24250 24251 // @method setZIndex(value: Number): this 24252 // Changes the [zIndex](#imageoverlay-zindex) of the image overlay. 24253 setZIndex: function (value) { 24254 this.options.zIndex = value; 24255 this._updateZIndex(); 24256 return this; 24257 }, 24258 24259 // @method getBounds(): LatLngBounds 24260 // Get the bounds that this ImageOverlay covers 24261 getBounds: function () { 24262 return this._bounds; 24263 }, 24264 24265 // @method getElement(): HTMLElement 24266 // Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement) 24267 // used by this overlay. 24268 getElement: function () { 24269 return this._image; 24270 }, 24271 24272 _initImage: function () { 24273 var wasElementSupplied = this._url.tagName === 'IMG'; 24274 var img = this._image = wasElementSupplied ? this._url : create$1('img'); 24275 24276 addClass(img, 'leaflet-image-layer'); 24277 if (this._zoomAnimated) { addClass(img, 'leaflet-zoom-animated'); } 24278 if (this.options.className) { addClass(img, this.options.className); } 24279 24280 img.onselectstart = falseFn; 24281 img.onmousemove = falseFn; 24282 24283 // @event load: Event 24284 // Fired when the ImageOverlay layer has loaded its image 24285 img.onload = bind(this.fire, this, 'load'); 24286 img.onerror = bind(this._overlayOnError, this, 'error'); 24287 24288 if (this.options.crossOrigin || this.options.crossOrigin === '') { 24289 img.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin; 24290 } 24291 24292 if (this.options.zIndex) { 24293 this._updateZIndex(); 24294 } 24295 24296 if (wasElementSupplied) { 24297 this._url = img.src; 24298 return; 24299 } 24300 24301 img.src = this._url; 24302 img.alt = this.options.alt; 24303 }, 24304 24305 _animateZoom: function (e) { 24306 var scale = this._map.getZoomScale(e.zoom), 24307 offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min; 24308 24309 setTransform(this._image, offset, scale); 24310 }, 24311 24312 _reset: function () { 24313 var image = this._image, 24314 bounds = new Bounds( 24315 this._map.latLngToLayerPoint(this._bounds.getNorthWest()), 24316 this._map.latLngToLayerPoint(this._bounds.getSouthEast())), 24317 size = bounds.getSize(); 24318 24319 setPosition(image, bounds.min); 24320 24321 image.style.width = size.x + 'px'; 24322 image.style.height = size.y + 'px'; 24323 }, 24324 24325 _updateOpacity: function () { 24326 setOpacity(this._image, this.options.opacity); 24327 }, 24328 24329 _updateZIndex: function () { 24330 if (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) { 24331 this._image.style.zIndex = this.options.zIndex; 24332 } 24333 }, 24334 24335 _overlayOnError: function () { 24336 // @event error: Event 24337 // Fired when the ImageOverlay layer fails to load its image 24338 this.fire('error'); 24339 24340 var errorUrl = this.options.errorOverlayUrl; 24341 if (errorUrl && this._url !== errorUrl) { 24342 this._url = errorUrl; 24343 this._image.src = errorUrl; 24344 } 24345 }, 24346 24347 // @method getCenter(): LatLng 24348 // Returns the center of the ImageOverlay. 24349 getCenter: function () { 24350 return this._bounds.getCenter(); 24351 } 24352 }); 24353 24354 // @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options) 24355 // Instantiates an image overlay object given the URL of the image and the 24356 // geographical bounds it is tied to. 24357 var imageOverlay = function (url, bounds, options) { 24358 return new ImageOverlay(url, bounds, options); 24359 }; 24360 24361 /* 24362 * @class VideoOverlay 24363 * @aka L.VideoOverlay 24364 * @inherits ImageOverlay 24365 * 24366 * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`. 24367 * 24368 * A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video) 24369 * HTML5 element. 24370 * 24371 * @example 24372 * 24373 * ```js 24374 * var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm', 24375 * videoBounds = [[ 32, -130], [ 13, -100]]; 24376 * L.videoOverlay(videoUrl, videoBounds ).addTo(map); 24377 * ``` 24378 */ 24379 24380 var VideoOverlay = ImageOverlay.extend({ 24381 24382 // @section 24383 // @aka VideoOverlay options 24384 options: { 24385 // @option autoplay: Boolean = true 24386 // Whether the video starts playing automatically when loaded. 24387 // On some browsers autoplay will only work with `muted: true` 24388 autoplay: true, 24389 24390 // @option loop: Boolean = true 24391 // Whether the video will loop back to the beginning when played. 24392 loop: true, 24393 24394 // @option keepAspectRatio: Boolean = true 24395 // Whether the video will save aspect ratio after the projection. 24396 // Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) 24397 keepAspectRatio: true, 24398 24399 // @option muted: Boolean = false 24400 // Whether the video starts on mute when loaded. 24401 muted: false, 24402 24403 // @option playsInline: Boolean = true 24404 // Mobile browsers will play the video right where it is instead of open it up in fullscreen mode. 24405 playsInline: true 24406 }, 24407 24408 _initImage: function () { 24409 var wasElementSupplied = this._url.tagName === 'VIDEO'; 24410 var vid = this._image = wasElementSupplied ? this._url : create$1('video'); 24411 24412 addClass(vid, 'leaflet-image-layer'); 24413 if (this._zoomAnimated) { addClass(vid, 'leaflet-zoom-animated'); } 24414 if (this.options.className) { addClass(vid, this.options.className); } 24415 24416 vid.onselectstart = falseFn; 24417 vid.onmousemove = falseFn; 24418 24419 // @event load: Event 24420 // Fired when the video has finished loading the first frame 24421 vid.onloadeddata = bind(this.fire, this, 'load'); 24422 24423 if (wasElementSupplied) { 24424 var sourceElements = vid.getElementsByTagName('source'); 24425 var sources = []; 24426 for (var j = 0; j < sourceElements.length; j++) { 24427 sources.push(sourceElements[j].src); 24428 } 24429 24430 this._url = (sourceElements.length > 0) ? sources : [vid.src]; 24431 return; 24432 } 24433 24434 if (!isArray(this._url)) { this._url = [this._url]; } 24435 24436 if (!this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(vid.style, 'objectFit')) { 24437 vid.style['objectFit'] = 'fill'; 24438 } 24439 vid.autoplay = !!this.options.autoplay; 24440 vid.loop = !!this.options.loop; 24441 vid.muted = !!this.options.muted; 24442 vid.playsInline = !!this.options.playsInline; 24443 for (var i = 0; i < this._url.length; i++) { 24444 var source = create$1('source'); 24445 source.src = this._url[i]; 24446 vid.appendChild(source); 24447 } 24448 } 24449 24450 // @method getElement(): HTMLVideoElement 24451 // Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement) 24452 // used by this overlay. 24453 }); 24454 24455 24456 // @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options) 24457 // Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the 24458 // geographical bounds it is tied to. 24459 24460 function videoOverlay(video, bounds, options) { 24461 return new VideoOverlay(video, bounds, options); 24462 } 24463 24464 /* 24465 * @class SVGOverlay 24466 * @aka L.SVGOverlay 24467 * @inherits ImageOverlay 24468 * 24469 * Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends `ImageOverlay`. 24470 * 24471 * An SVG overlay uses the [`<svg>`](https://developer.mozilla.org/docs/Web/SVG/Element/svg) element. 24472 * 24473 * @example 24474 * 24475 * ```js 24476 * var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 24477 * svgElement.setAttribute('xmlns', "http://www.w3.org/2000/svg"); 24478 * svgElement.setAttribute('viewBox', "0 0 200 200"); 24479 * svgElement.innerHTML = '<rect width="200" height="200"/><rect x="75" y="23" width="50" height="50" style="fill:red"/><rect x="75" y="123" width="50" height="50" style="fill:#0013ff"/>'; 24480 * var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ]; 24481 * L.svgOverlay(svgElement, svgElementBounds).addTo(map); 24482 * ``` 24483 */ 24484 24485 var SVGOverlay = ImageOverlay.extend({ 24486 _initImage: function () { 24487 var el = this._image = this._url; 24488 24489 addClass(el, 'leaflet-image-layer'); 24490 if (this._zoomAnimated) { addClass(el, 'leaflet-zoom-animated'); } 24491 if (this.options.className) { addClass(el, this.options.className); } 24492 24493 el.onselectstart = falseFn; 24494 el.onmousemove = falseFn; 24495 } 24496 24497 // @method getElement(): SVGElement 24498 // Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement) 24499 // used by this overlay. 24500 }); 24501 24502 24503 // @factory L.svgOverlay(svg: String|SVGElement, bounds: LatLngBounds, options?: SVGOverlay options) 24504 // Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to. 24505 // A viewBox attribute is required on the SVG element to zoom in and out properly. 24506 24507 function svgOverlay(el, bounds, options) { 24508 return new SVGOverlay(el, bounds, options); 24509 } 24510 24511 /* 24512 * @class DivOverlay 24513 * @inherits Interactive layer 24514 * @aka L.DivOverlay 24515 * Base model for L.Popup and L.Tooltip. Inherit from it for custom overlays like plugins. 24516 */ 24517 24518 // @namespace DivOverlay 24519 var DivOverlay = Layer.extend({ 24520 24521 // @section 24522 // @aka DivOverlay options 24523 options: { 24524 // @option interactive: Boolean = false 24525 // If true, the popup/tooltip will listen to the mouse events. 24526 interactive: false, 24527 24528 // @option offset: Point = Point(0, 0) 24529 // The offset of the overlay position. 24530 offset: [0, 0], 24531 24532 // @option className: String = '' 24533 // A custom CSS class name to assign to the overlay. 24534 className: '', 24535 24536 // @option pane: String = undefined 24537 // `Map pane` where the overlay will be added. 24538 pane: undefined, 24539 24540 // @option content: String|HTMLElement|Function = '' 24541 // Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be 24542 // passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay. 24543 content: '' 24544 }, 24545 24546 initialize: function (options, source) { 24547 if (options && (options instanceof LatLng || isArray(options))) { 24548 this._latlng = toLatLng(options); 24549 setOptions(this, source); 24550 } else { 24551 setOptions(this, options); 24552 this._source = source; 24553 } 24554 if (this.options.content) { 24555 this._content = this.options.content; 24556 } 24557 }, 24558 24559 // @method openOn(map: Map): this 24560 // Adds the overlay to the map. 24561 // Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`. 24562 openOn: function (map) { 24563 map = arguments.length ? map : this._source._map; // experimental, not the part of public api 24564 if (!map.hasLayer(this)) { 24565 map.addLayer(this); 24566 } 24567 return this; 24568 }, 24569 24570 // @method close(): this 24571 // Closes the overlay. 24572 // Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)` 24573 // and `layer.closePopup()`/`.closeTooltip()`. 24574 close: function () { 24575 if (this._map) { 24576 this._map.removeLayer(this); 24577 } 24578 return this; 24579 }, 24580 24581 // @method toggle(layer?: Layer): this 24582 // Opens or closes the overlay bound to layer depending on its current state. 24583 // Argument may be omitted only for overlay bound to layer. 24584 // Alternative to `layer.togglePopup()`/`.toggleTooltip()`. 24585 toggle: function (layer) { 24586 if (this._map) { 24587 this.close(); 24588 } else { 24589 if (arguments.length) { 24590 this._source = layer; 24591 } else { 24592 layer = this._source; 24593 } 24594 this._prepareOpen(); 24595 24596 // open the overlay on the map 24597 this.openOn(layer._map); 24598 } 24599 return this; 24600 }, 24601 24602 onAdd: function (map) { 24603 this._zoomAnimated = map._zoomAnimated; 24604 24605 if (!this._container) { 24606 this._initLayout(); 24607 } 24608 24609 if (map._fadeAnimated) { 24610 setOpacity(this._container, 0); 24611 } 24612 24613 clearTimeout(this._removeTimeout); 24614 this.getPane().appendChild(this._container); 24615 this.update(); 24616 24617 if (map._fadeAnimated) { 24618 setOpacity(this._container, 1); 24619 } 24620 24621 this.bringToFront(); 24622 24623 if (this.options.interactive) { 24624 addClass(this._container, 'leaflet-interactive'); 24625 this.addInteractiveTarget(this._container); 24626 } 24627 }, 24628 24629 onRemove: function (map) { 24630 if (map._fadeAnimated) { 24631 setOpacity(this._container, 0); 24632 this._removeTimeout = setTimeout(bind(remove, undefined, this._container), 200); 24633 } else { 24634 remove(this._container); 24635 } 24636 24637 if (this.options.interactive) { 24638 removeClass(this._container, 'leaflet-interactive'); 24639 this.removeInteractiveTarget(this._container); 24640 } 24641 }, 24642 24643 // @namespace DivOverlay 24644 // @method getLatLng: LatLng 24645 // Returns the geographical point of the overlay. 24646 getLatLng: function () { 24647 return this._latlng; 24648 }, 24649 24650 // @method setLatLng(latlng: LatLng): this 24651 // Sets the geographical point where the overlay will open. 24652 setLatLng: function (latlng) { 24653 this._latlng = toLatLng(latlng); 24654 if (this._map) { 24655 this._updatePosition(); 24656 this._adjustPan(); 24657 } 24658 return this; 24659 }, 24660 24661 // @method getContent: String|HTMLElement 24662 // Returns the content of the overlay. 24663 getContent: function () { 24664 return this._content; 24665 }, 24666 24667 // @method setContent(htmlContent: String|HTMLElement|Function): this 24668 // Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function. 24669 // The function should return a `String` or `HTMLElement` to be used in the overlay. 24670 setContent: function (content) { 24671 this._content = content; 24672 this.update(); 24673 return this; 24674 }, 24675 24676 // @method getElement: String|HTMLElement 24677 // Returns the HTML container of the overlay. 24678 getElement: function () { 24679 return this._container; 24680 }, 24681 24682 // @method update: null 24683 // Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded. 24684 update: function () { 24685 if (!this._map) { return; } 24686 24687 this._container.style.visibility = 'hidden'; 24688 24689 this._updateContent(); 24690 this._updateLayout(); 24691 this._updatePosition(); 24692 24693 this._container.style.visibility = ''; 24694 24695 this._adjustPan(); 24696 }, 24697 24698 getEvents: function () { 24699 var events = { 24700 zoom: this._updatePosition, 24701 viewreset: this._updatePosition 24702 }; 24703 24704 if (this._zoomAnimated) { 24705 events.zoomanim = this._animateZoom; 24706 } 24707 return events; 24708 }, 24709 24710 // @method isOpen: Boolean 24711 // Returns `true` when the overlay is visible on the map. 24712 isOpen: function () { 24713 return !!this._map && this._map.hasLayer(this); 24714 }, 24715 24716 // @method bringToFront: this 24717 // Brings this overlay in front of other overlays (in the same map pane). 24718 bringToFront: function () { 24719 if (this._map) { 24720 toFront(this._container); 24721 } 24722 return this; 24723 }, 24724 24725 // @method bringToBack: this 24726 // Brings this overlay to the back of other overlays (in the same map pane). 24727 bringToBack: function () { 24728 if (this._map) { 24729 toBack(this._container); 24730 } 24731 return this; 24732 }, 24733 24734 // prepare bound overlay to open: update latlng pos / content source (for FeatureGroup) 24735 _prepareOpen: function (latlng) { 24736 var source = this._source; 24737 if (!source._map) { return false; } 24738 24739 if (source instanceof FeatureGroup) { 24740 source = null; 24741 var layers = this._source._layers; 24742 for (var id in layers) { 24743 if (layers[id]._map) { 24744 source = layers[id]; 24745 break; 24746 } 24747 } 24748 if (!source) { return false; } // Unable to get source layer. 24749 24750 // set overlay source to this layer 24751 this._source = source; 24752 } 24753 24754 if (!latlng) { 24755 if (source.getCenter) { 24756 latlng = source.getCenter(); 24757 } else if (source.getLatLng) { 24758 latlng = source.getLatLng(); 24759 } else if (source.getBounds) { 24760 latlng = source.getBounds().getCenter(); 24761 } else { 24762 throw new Error('Unable to get source layer LatLng.'); 24763 } 24764 } 24765 this.setLatLng(latlng); 24766 24767 if (this._map) { 24768 // update the overlay (content, layout, etc...) 24769 this.update(); 24770 } 24771 24772 return true; 24773 }, 24774 24775 _updateContent: function () { 24776 if (!this._content) { return; } 24777 24778 var node = this._contentNode; 24779 var content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content; 24780 24781 if (typeof content === 'string') { 24782 node.innerHTML = content; 24783 } else { 24784 while (node.hasChildNodes()) { 24785 node.removeChild(node.firstChild); 24786 } 24787 node.appendChild(content); 24788 } 24789 24790 // @namespace DivOverlay 24791 // @section DivOverlay events 24792 // @event contentupdate: Event 24793 // Fired when the content of the overlay is updated 24794 this.fire('contentupdate'); 24795 }, 24796 24797 _updatePosition: function () { 24798 if (!this._map) { return; } 24799 24800 var pos = this._map.latLngToLayerPoint(this._latlng), 24801 offset = toPoint(this.options.offset), 24802 anchor = this._getAnchor(); 24803 24804 if (this._zoomAnimated) { 24805 setPosition(this._container, pos.add(anchor)); 24806 } else { 24807 offset = offset.add(pos).add(anchor); 24808 } 24809 24810 var bottom = this._containerBottom = -offset.y, 24811 left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x; 24812 24813 // bottom position the overlay in case the height of the overlay changes (images loading etc) 24814 this._container.style.bottom = bottom + 'px'; 24815 this._container.style.left = left + 'px'; 24816 }, 24817 24818 _getAnchor: function () { 24819 return [0, 0]; 24820 } 24821 24822 }); 24823 24824 Map.include({ 24825 _initOverlay: function (OverlayClass, content, latlng, options) { 24826 var overlay = content; 24827 if (!(overlay instanceof OverlayClass)) { 24828 overlay = new OverlayClass(options).setContent(content); 24829 } 24830 if (latlng) { 24831 overlay.setLatLng(latlng); 24832 } 24833 return overlay; 24834 } 24835 }); 24836 24837 24838 Layer.include({ 24839 _initOverlay: function (OverlayClass, old, content, options) { 24840 var overlay = content; 24841 if (overlay instanceof OverlayClass) { 24842 setOptions(overlay, options); 24843 overlay._source = this; 24844 } else { 24845 overlay = (old && !options) ? old : new OverlayClass(options, this); 24846 overlay.setContent(content); 24847 } 24848 return overlay; 24849 } 24850 }); 24851 24852 /* 24853 * @class Popup 24854 * @inherits DivOverlay 24855 * @aka L.Popup 24856 * Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to 24857 * open popups while making sure that only one popup is open at one time 24858 * (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want. 24859 * 24860 * @example 24861 * 24862 * If you want to just bind a popup to marker click and then open it, it's really easy: 24863 * 24864 * ```js 24865 * marker.bindPopup(popupContent).openPopup(); 24866 * ``` 24867 * Path overlays like polylines also have a `bindPopup` method. 24868 * 24869 * A popup can be also standalone: 24870 * 24871 * ```js 24872 * var popup = L.popup() 24873 * .setLatLng(latlng) 24874 * .setContent('<p>Hello world!<br />This is a nice popup.</p>') 24875 * .openOn(map); 24876 * ``` 24877 * or 24878 * ```js 24879 * var popup = L.popup(latlng, {content: '<p>Hello world!<br />This is a nice popup.</p>') 24880 * .openOn(map); 24881 * ``` 24882 */ 24883 24884 24885 // @namespace Popup 24886 var Popup = DivOverlay.extend({ 24887 24888 // @section 24889 // @aka Popup options 24890 options: { 24891 // @option pane: String = 'popupPane' 24892 // `Map pane` where the popup will be added. 24893 pane: 'popupPane', 24894 24895 // @option offset: Point = Point(0, 7) 24896 // The offset of the popup position. 24897 offset: [0, 7], 24898 24899 // @option maxWidth: Number = 300 24900 // Max width of the popup, in pixels. 24901 maxWidth: 300, 24902 24903 // @option minWidth: Number = 50 24904 // Min width of the popup, in pixels. 24905 minWidth: 50, 24906 24907 // @option maxHeight: Number = null 24908 // If set, creates a scrollable container of the given height 24909 // inside a popup if its content exceeds it. 24910 // The scrollable container can be styled using the 24911 // `leaflet-popup-scrolled` CSS class selector. 24912 maxHeight: null, 24913 24914 // @option autoPan: Boolean = true 24915 // Set it to `false` if you don't want the map to do panning animation 24916 // to fit the opened popup. 24917 autoPan: true, 24918 24919 // @option autoPanPaddingTopLeft: Point = null 24920 // The margin between the popup and the top left corner of the map 24921 // view after autopanning was performed. 24922 autoPanPaddingTopLeft: null, 24923 24924 // @option autoPanPaddingBottomRight: Point = null 24925 // The margin between the popup and the bottom right corner of the map 24926 // view after autopanning was performed. 24927 autoPanPaddingBottomRight: null, 24928 24929 // @option autoPanPadding: Point = Point(5, 5) 24930 // Equivalent of setting both top left and bottom right autopan padding to the same value. 24931 autoPanPadding: [5, 5], 24932 24933 // @option keepInView: Boolean = false 24934 // Set it to `true` if you want to prevent users from panning the popup 24935 // off of the screen while it is open. 24936 keepInView: false, 24937 24938 // @option closeButton: Boolean = true 24939 // Controls the presence of a close button in the popup. 24940 closeButton: true, 24941 24942 // @option autoClose: Boolean = true 24943 // Set it to `false` if you want to override the default behavior of 24944 // the popup closing when another popup is opened. 24945 autoClose: true, 24946 24947 // @option closeOnEscapeKey: Boolean = true 24948 // Set it to `false` if you want to override the default behavior of 24949 // the ESC key for closing of the popup. 24950 closeOnEscapeKey: true, 24951 24952 // @option closeOnClick: Boolean = * 24953 // Set it if you want to override the default behavior of the popup closing when user clicks 24954 // on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option. 24955 24956 // @option className: String = '' 24957 // A custom CSS class name to assign to the popup. 24958 className: '' 24959 }, 24960 24961 // @namespace Popup 24962 // @method openOn(map: Map): this 24963 // Alternative to `map.openPopup(popup)`. 24964 // Adds the popup to the map and closes the previous one. 24965 openOn: function (map) { 24966 map = arguments.length ? map : this._source._map; // experimental, not the part of public api 24967 24968 if (!map.hasLayer(this) && map._popup && map._popup.options.autoClose) { 24969 map.removeLayer(map._popup); 24970 } 24971 map._popup = this; 24972 24973 return DivOverlay.prototype.openOn.call(this, map); 24974 }, 24975 24976 onAdd: function (map) { 24977 DivOverlay.prototype.onAdd.call(this, map); 24978 24979 // @namespace Map 24980 // @section Popup events 24981 // @event popupopen: PopupEvent 24982 // Fired when a popup is opened in the map 24983 map.fire('popupopen', {popup: this}); 24984 24985 if (this._source) { 24986 // @namespace Layer 24987 // @section Popup events 24988 // @event popupopen: PopupEvent 24989 // Fired when a popup bound to this layer is opened 24990 this._source.fire('popupopen', {popup: this}, true); 24991 // For non-path layers, we toggle the popup when clicking 24992 // again the layer, so prevent the map to reopen it. 24993 if (!(this._source instanceof Path)) { 24994 this._source.on('preclick', stopPropagation); 24995 } 24996 } 24997 }, 24998 24999 onRemove: function (map) { 25000 DivOverlay.prototype.onRemove.call(this, map); 25001 25002 // @namespace Map 25003 // @section Popup events 25004 // @event popupclose: PopupEvent 25005 // Fired when a popup in the map is closed 25006 map.fire('popupclose', {popup: this}); 25007 25008 if (this._source) { 25009 // @namespace Layer 25010 // @section Popup events 25011 // @event popupclose: PopupEvent 25012 // Fired when a popup bound to this layer is closed 25013 this._source.fire('popupclose', {popup: this}, true); 25014 if (!(this._source instanceof Path)) { 25015 this._source.off('preclick', stopPropagation); 25016 } 25017 } 25018 }, 25019 25020 getEvents: function () { 25021 var events = DivOverlay.prototype.getEvents.call(this); 25022 25023 if (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) { 25024 events.preclick = this.close; 25025 } 25026 25027 if (this.options.keepInView) { 25028 events.moveend = this._adjustPan; 25029 } 25030 25031 return events; 25032 }, 25033 25034 _initLayout: function () { 25035 var prefix = 'leaflet-popup', 25036 container = this._container = create$1('div', 25037 prefix + ' ' + (this.options.className || '') + 25038 ' leaflet-zoom-animated'); 25039 25040 var wrapper = this._wrapper = create$1('div', prefix + '-content-wrapper', container); 25041 this._contentNode = create$1('div', prefix + '-content', wrapper); 25042 25043 disableClickPropagation(container); 25044 disableScrollPropagation(this._contentNode); 25045 on(container, 'contextmenu', stopPropagation); 25046 25047 this._tipContainer = create$1('div', prefix + '-tip-container', container); 25048 this._tip = create$1('div', prefix + '-tip', this._tipContainer); 25049 25050 if (this.options.closeButton) { 25051 var closeButton = this._closeButton = create$1('a', prefix + '-close-button', container); 25052 closeButton.setAttribute('role', 'button'); // overrides the implicit role=link of <a> elements #7399 25053 closeButton.setAttribute('aria-label', 'Close popup'); 25054 closeButton.href = '#close'; 25055 closeButton.innerHTML = '<span aria-hidden="true">×</span>'; 25056 25057 on(closeButton, 'click', function (ev) { 25058 preventDefault(ev); 25059 this.close(); 25060 }, this); 25061 } 25062 }, 25063 25064 _updateLayout: function () { 25065 var container = this._contentNode, 25066 style = container.style; 25067 25068 style.width = ''; 25069 style.whiteSpace = 'nowrap'; 25070 25071 var width = container.offsetWidth; 25072 width = Math.min(width, this.options.maxWidth); 25073 width = Math.max(width, this.options.minWidth); 25074 25075 style.width = (width + 1) + 'px'; 25076 style.whiteSpace = ''; 25077 25078 style.height = ''; 25079 25080 var height = container.offsetHeight, 25081 maxHeight = this.options.maxHeight, 25082 scrolledClass = 'leaflet-popup-scrolled'; 25083 25084 if (maxHeight && height > maxHeight) { 25085 style.height = maxHeight + 'px'; 25086 addClass(container, scrolledClass); 25087 } else { 25088 removeClass(container, scrolledClass); 25089 } 25090 25091 this._containerWidth = this._container.offsetWidth; 25092 }, 25093 25094 _animateZoom: function (e) { 25095 var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center), 25096 anchor = this._getAnchor(); 25097 setPosition(this._container, pos.add(anchor)); 25098 }, 25099 25100 _adjustPan: function () { 25101 if (!this.options.autoPan) { return; } 25102 if (this._map._panAnim) { this._map._panAnim.stop(); } 25103 25104 // We can endlessly recurse if keepInView is set and the view resets. 25105 // Let's guard against that by exiting early if we're responding to our own autopan. 25106 if (this._autopanning) { 25107 this._autopanning = false; 25108 return; 25109 } 25110 25111 var map = this._map, 25112 marginBottom = parseInt(getStyle(this._container, 'marginBottom'), 10) || 0, 25113 containerHeight = this._container.offsetHeight + marginBottom, 25114 containerWidth = this._containerWidth, 25115 layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom); 25116 25117 layerPos._add(getPosition(this._container)); 25118 25119 var containerPos = map.layerPointToContainerPoint(layerPos), 25120 padding = toPoint(this.options.autoPanPadding), 25121 paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding), 25122 paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding), 25123 size = map.getSize(), 25124 dx = 0, 25125 dy = 0; 25126 25127 if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right 25128 dx = containerPos.x + containerWidth - size.x + paddingBR.x; 25129 } 25130 if (containerPos.x - dx - paddingTL.x < 0) { // left 25131 dx = containerPos.x - paddingTL.x; 25132 } 25133 if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom 25134 dy = containerPos.y + containerHeight - size.y + paddingBR.y; 25135 } 25136 if (containerPos.y - dy - paddingTL.y < 0) { // top 25137 dy = containerPos.y - paddingTL.y; 25138 } 25139 25140 // @namespace Map 25141 // @section Popup events 25142 // @event autopanstart: Event 25143 // Fired when the map starts autopanning when opening a popup. 25144 if (dx || dy) { 25145 // Track that we're autopanning, as this function will be re-ran on moveend 25146 if (this.options.keepInView) { 25147 this._autopanning = true; 25148 } 25149 25150 map 25151 .fire('autopanstart') 25152 .panBy([dx, dy]); 25153 } 25154 }, 25155 25156 _getAnchor: function () { 25157 // Where should we anchor the popup on the source layer? 25158 return toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]); 25159 } 25160 25161 }); 25162 25163 // @namespace Popup 25164 // @factory L.popup(options?: Popup options, source?: Layer) 25165 // Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers. 25166 // @alternative 25167 // @factory L.popup(latlng: LatLng, options?: Popup options) 25168 // Instantiates a `Popup` object given `latlng` where the popup will open and an optional `options` object that describes its appearance and location. 25169 var popup = function (options, source) { 25170 return new Popup(options, source); 25171 }; 25172 25173 25174 /* @namespace Map 25175 * @section Interaction Options 25176 * @option closePopupOnClick: Boolean = true 25177 * Set it to `false` if you don't want popups to close when user clicks the map. 25178 */ 25179 Map.mergeOptions({ 25180 closePopupOnClick: true 25181 }); 25182 25183 25184 // @namespace Map 25185 // @section Methods for Layers and Controls 25186 Map.include({ 25187 // @method openPopup(popup: Popup): this 25188 // Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability). 25189 // @alternative 25190 // @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this 25191 // Creates a popup with the specified content and options and opens it in the given point on a map. 25192 openPopup: function (popup, latlng, options) { 25193 this._initOverlay(Popup, popup, latlng, options) 25194 .openOn(this); 25195 25196 return this; 25197 }, 25198 25199 // @method closePopup(popup?: Popup): this 25200 // Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one). 25201 closePopup: function (popup) { 25202 popup = arguments.length ? popup : this._popup; 25203 if (popup) { 25204 popup.close(); 25205 } 25206 return this; 25207 } 25208 }); 25209 25210 /* 25211 * @namespace Layer 25212 * @section Popup methods example 25213 * 25214 * All layers share a set of methods convenient for binding popups to it. 25215 * 25216 * ```js 25217 * var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map); 25218 * layer.openPopup(); 25219 * layer.closePopup(); 25220 * ``` 25221 * 25222 * Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened. 25223 */ 25224 25225 // @section Popup methods 25226 Layer.include({ 25227 25228 // @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this 25229 // Binds a popup to the layer with the passed `content` and sets up the 25230 // necessary event listeners. If a `Function` is passed it will receive 25231 // the layer as the first argument and should return a `String` or `HTMLElement`. 25232 bindPopup: function (content, options) { 25233 this._popup = this._initOverlay(Popup, this._popup, content, options); 25234 if (!this._popupHandlersAdded) { 25235 this.on({ 25236 click: this._openPopup, 25237 keypress: this._onKeyPress, 25238 remove: this.closePopup, 25239 move: this._movePopup 25240 }); 25241 this._popupHandlersAdded = true; 25242 } 25243 25244 return this; 25245 }, 25246 25247 // @method unbindPopup(): this 25248 // Removes the popup previously bound with `bindPopup`. 25249 unbindPopup: function () { 25250 if (this._popup) { 25251 this.off({ 25252 click: this._openPopup, 25253 keypress: this._onKeyPress, 25254 remove: this.closePopup, 25255 move: this._movePopup 25256 }); 25257 this._popupHandlersAdded = false; 25258 this._popup = null; 25259 } 25260 return this; 25261 }, 25262 25263 // @method openPopup(latlng?: LatLng): this 25264 // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed. 25265 openPopup: function (latlng) { 25266 if (this._popup) { 25267 if (!(this instanceof FeatureGroup)) { 25268 this._popup._source = this; 25269 } 25270 if (this._popup._prepareOpen(latlng || this._latlng)) { 25271 // open the popup on the map 25272 this._popup.openOn(this._map); 25273 } 25274 } 25275 return this; 25276 }, 25277 25278 // @method closePopup(): this 25279 // Closes the popup bound to this layer if it is open. 25280 closePopup: function () { 25281 if (this._popup) { 25282 this._popup.close(); 25283 } 25284 return this; 25285 }, 25286 25287 // @method togglePopup(): this 25288 // Opens or closes the popup bound to this layer depending on its current state. 25289 togglePopup: function () { 25290 if (this._popup) { 25291 this._popup.toggle(this); 25292 } 25293 return this; 25294 }, 25295 25296 // @method isPopupOpen(): boolean 25297 // Returns `true` if the popup bound to this layer is currently open. 25298 isPopupOpen: function () { 25299 return (this._popup ? this._popup.isOpen() : false); 25300 }, 25301 25302 // @method setPopupContent(content: String|HTMLElement|Popup): this 25303 // Sets the content of the popup bound to this layer. 25304 setPopupContent: function (content) { 25305 if (this._popup) { 25306 this._popup.setContent(content); 25307 } 25308 return this; 25309 }, 25310 25311 // @method getPopup(): Popup 25312 // Returns the popup bound to this layer. 25313 getPopup: function () { 25314 return this._popup; 25315 }, 25316 25317 _openPopup: function (e) { 25318 if (!this._popup || !this._map) { 25319 return; 25320 } 25321 // prevent map click 25322 stop(e); 25323 25324 var target = e.layer || e.target; 25325 if (this._popup._source === target && !(target instanceof Path)) { 25326 // treat it like a marker and figure out 25327 // if we should toggle it open/closed 25328 if (this._map.hasLayer(this._popup)) { 25329 this.closePopup(); 25330 } else { 25331 this.openPopup(e.latlng); 25332 } 25333 return; 25334 } 25335 this._popup._source = target; 25336 this.openPopup(e.latlng); 25337 }, 25338 25339 _movePopup: function (e) { 25340 this._popup.setLatLng(e.latlng); 25341 }, 25342 25343 _onKeyPress: function (e) { 25344 if (e.originalEvent.keyCode === 13) { 25345 this._openPopup(e); 25346 } 25347 } 25348 }); 25349 25350 /* 25351 * @class Tooltip 25352 * @inherits DivOverlay 25353 * @aka L.Tooltip 25354 * Used to display small texts on top of map layers. 25355 * 25356 * @example 25357 * If you want to just bind a tooltip to marker: 25358 * 25359 * ```js 25360 * marker.bindTooltip("my tooltip text").openTooltip(); 25361 * ``` 25362 * Path overlays like polylines also have a `bindTooltip` method. 25363 * 25364 * A tooltip can be also standalone: 25365 * 25366 * ```js 25367 * var tooltip = L.tooltip() 25368 * .setLatLng(latlng) 25369 * .setContent('Hello world!<br />This is a nice tooltip.') 25370 * .addTo(map); 25371 * ``` 25372 * or 25373 * ```js 25374 * var tooltip = L.tooltip(latlng, {content: 'Hello world!<br />This is a nice tooltip.'}) 25375 * .addTo(map); 25376 * ``` 25377 * 25378 * 25379 * Note about tooltip offset. Leaflet takes two options in consideration 25380 * for computing tooltip offsetting: 25381 * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip. 25382 * Add a positive x offset to move the tooltip to the right, and a positive y offset to 25383 * move it to the bottom. Negatives will move to the left and top. 25384 * - the `tooltipAnchor` Icon option: this will only be considered for Marker. You 25385 * should adapt this value if you use a custom icon. 25386 */ 25387 25388 25389 // @namespace Tooltip 25390 var Tooltip = DivOverlay.extend({ 25391 25392 // @section 25393 // @aka Tooltip options 25394 options: { 25395 // @option pane: String = 'tooltipPane' 25396 // `Map pane` where the tooltip will be added. 25397 pane: 'tooltipPane', 25398 25399 // @option offset: Point = Point(0, 0) 25400 // Optional offset of the tooltip position. 25401 offset: [0, 0], 25402 25403 // @option direction: String = 'auto' 25404 // Direction where to open the tooltip. Possible values are: `right`, `left`, 25405 // `top`, `bottom`, `center`, `auto`. 25406 // `auto` will dynamically switch between `right` and `left` according to the tooltip 25407 // position on the map. 25408 direction: 'auto', 25409 25410 // @option permanent: Boolean = false 25411 // Whether to open the tooltip permanently or only on mouseover. 25412 permanent: false, 25413 25414 // @option sticky: Boolean = false 25415 // If true, the tooltip will follow the mouse instead of being fixed at the feature center. 25416 sticky: false, 25417 25418 // @option opacity: Number = 0.9 25419 // Tooltip container opacity. 25420 opacity: 0.9 25421 }, 25422 25423 onAdd: function (map) { 25424 DivOverlay.prototype.onAdd.call(this, map); 25425 this.setOpacity(this.options.opacity); 25426 25427 // @namespace Map 25428 // @section Tooltip events 25429 // @event tooltipopen: TooltipEvent 25430 // Fired when a tooltip is opened in the map. 25431 map.fire('tooltipopen', {tooltip: this}); 25432 25433 if (this._source) { 25434 this.addEventParent(this._source); 25435 25436 // @namespace Layer 25437 // @section Tooltip events 25438 // @event tooltipopen: TooltipEvent 25439 // Fired when a tooltip bound to this layer is opened. 25440 this._source.fire('tooltipopen', {tooltip: this}, true); 25441 } 25442 }, 25443 25444 onRemove: function (map) { 25445 DivOverlay.prototype.onRemove.call(this, map); 25446 25447 // @namespace Map 25448 // @section Tooltip events 25449 // @event tooltipclose: TooltipEvent 25450 // Fired when a tooltip in the map is closed. 25451 map.fire('tooltipclose', {tooltip: this}); 25452 25453 if (this._source) { 25454 this.removeEventParent(this._source); 25455 25456 // @namespace Layer 25457 // @section Tooltip events 25458 // @event tooltipclose: TooltipEvent 25459 // Fired when a tooltip bound to this layer is closed. 25460 this._source.fire('tooltipclose', {tooltip: this}, true); 25461 } 25462 }, 25463 25464 getEvents: function () { 25465 var events = DivOverlay.prototype.getEvents.call(this); 25466 25467 if (!this.options.permanent) { 25468 events.preclick = this.close; 25469 } 25470 25471 return events; 25472 }, 25473 25474 _initLayout: function () { 25475 var prefix = 'leaflet-tooltip', 25476 className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide'); 25477 25478 this._contentNode = this._container = create$1('div', className); 25479 25480 this._container.setAttribute('role', 'tooltip'); 25481 this._container.setAttribute('id', 'leaflet-tooltip-' + stamp(this)); 25482 }, 25483 25484 _updateLayout: function () {}, 25485 25486 _adjustPan: function () {}, 25487 25488 _setPosition: function (pos) { 25489 var subX, subY, 25490 map = this._map, 25491 container = this._container, 25492 centerPoint = map.latLngToContainerPoint(map.getCenter()), 25493 tooltipPoint = map.layerPointToContainerPoint(pos), 25494 direction = this.options.direction, 25495 tooltipWidth = container.offsetWidth, 25496 tooltipHeight = container.offsetHeight, 25497 offset = toPoint(this.options.offset), 25498 anchor = this._getAnchor(); 25499 25500 if (direction === 'top') { 25501 subX = tooltipWidth / 2; 25502 subY = tooltipHeight; 25503 } else if (direction === 'bottom') { 25504 subX = tooltipWidth / 2; 25505 subY = 0; 25506 } else if (direction === 'center') { 25507 subX = tooltipWidth / 2; 25508 subY = tooltipHeight / 2; 25509 } else if (direction === 'right') { 25510 subX = 0; 25511 subY = tooltipHeight / 2; 25512 } else if (direction === 'left') { 25513 subX = tooltipWidth; 25514 subY = tooltipHeight / 2; 25515 } else if (tooltipPoint.x < centerPoint.x) { 25516 direction = 'right'; 25517 subX = 0; 25518 subY = tooltipHeight / 2; 25519 } else { 25520 direction = 'left'; 25521 subX = tooltipWidth + (offset.x + anchor.x) * 2; 25522 subY = tooltipHeight / 2; 25523 } 25524 25525 pos = pos.subtract(toPoint(subX, subY, true)).add(offset).add(anchor); 25526 25527 removeClass(container, 'leaflet-tooltip-right'); 25528 removeClass(container, 'leaflet-tooltip-left'); 25529 removeClass(container, 'leaflet-tooltip-top'); 25530 removeClass(container, 'leaflet-tooltip-bottom'); 25531 addClass(container, 'leaflet-tooltip-' + direction); 25532 setPosition(container, pos); 25533 }, 25534 25535 _updatePosition: function () { 25536 var pos = this._map.latLngToLayerPoint(this._latlng); 25537 this._setPosition(pos); 25538 }, 25539 25540 setOpacity: function (opacity) { 25541 this.options.opacity = opacity; 25542 25543 if (this._container) { 25544 setOpacity(this._container, opacity); 25545 } 25546 }, 25547 25548 _animateZoom: function (e) { 25549 var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center); 25550 this._setPosition(pos); 25551 }, 25552 25553 _getAnchor: function () { 25554 // Where should we anchor the tooltip on the source layer? 25555 return toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]); 25556 } 25557 25558 }); 25559 25560 // @namespace Tooltip 25561 // @factory L.tooltip(options?: Tooltip options, source?: Layer) 25562 // Instantiates a `Tooltip` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers. 25563 // @alternative 25564 // @factory L.tooltip(latlng: LatLng, options?: Tooltip options) 25565 // Instantiates a `Tooltip` object given `latlng` where the tooltip will open and an optional `options` object that describes its appearance and location. 25566 var tooltip = function (options, source) { 25567 return new Tooltip(options, source); 25568 }; 25569 25570 // @namespace Map 25571 // @section Methods for Layers and Controls 25572 Map.include({ 25573 25574 // @method openTooltip(tooltip: Tooltip): this 25575 // Opens the specified tooltip. 25576 // @alternative 25577 // @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this 25578 // Creates a tooltip with the specified content and options and open it. 25579 openTooltip: function (tooltip, latlng, options) { 25580 this._initOverlay(Tooltip, tooltip, latlng, options) 25581 .openOn(this); 25582 25583 return this; 25584 }, 25585 25586 // @method closeTooltip(tooltip: Tooltip): this 25587 // Closes the tooltip given as parameter. 25588 closeTooltip: function (tooltip) { 25589 tooltip.close(); 25590 return this; 25591 } 25592 25593 }); 25594 25595 /* 25596 * @namespace Layer 25597 * @section Tooltip methods example 25598 * 25599 * All layers share a set of methods convenient for binding tooltips to it. 25600 * 25601 * ```js 25602 * var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map); 25603 * layer.openTooltip(); 25604 * layer.closeTooltip(); 25605 * ``` 25606 */ 25607 25608 // @section Tooltip methods 25609 Layer.include({ 25610 25611 // @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this 25612 // Binds a tooltip to the layer with the passed `content` and sets up the 25613 // necessary event listeners. If a `Function` is passed it will receive 25614 // the layer as the first argument and should return a `String` or `HTMLElement`. 25615 bindTooltip: function (content, options) { 25616 25617 if (this._tooltip && this.isTooltipOpen()) { 25618 this.unbindTooltip(); 25619 } 25620 25621 this._tooltip = this._initOverlay(Tooltip, this._tooltip, content, options); 25622 this._initTooltipInteractions(); 25623 25624 if (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) { 25625 this.openTooltip(); 25626 } 25627 25628 return this; 25629 }, 25630 25631 // @method unbindTooltip(): this 25632 // Removes the tooltip previously bound with `bindTooltip`. 25633 unbindTooltip: function () { 25634 if (this._tooltip) { 25635 this._initTooltipInteractions(true); 25636 this.closeTooltip(); 25637 this._tooltip = null; 25638 } 25639 return this; 25640 }, 25641 25642 _initTooltipInteractions: function (remove) { 25643 if (!remove && this._tooltipHandlersAdded) { return; } 25644 var onOff = remove ? 'off' : 'on', 25645 events = { 25646 remove: this.closeTooltip, 25647 move: this._moveTooltip 25648 }; 25649 if (!this._tooltip.options.permanent) { 25650 events.mouseover = this._openTooltip; 25651 events.mouseout = this.closeTooltip; 25652 events.click = this._openTooltip; 25653 if (this._map) { 25654 this._addFocusListeners(); 25655 } else { 25656 events.add = this._addFocusListeners; 25657 } 25658 } else { 25659 events.add = this._openTooltip; 25660 } 25661 if (this._tooltip.options.sticky) { 25662 events.mousemove = this._moveTooltip; 25663 } 25664 this[onOff](events); 25665 this._tooltipHandlersAdded = !remove; 25666 }, 25667 25668 // @method openTooltip(latlng?: LatLng): this 25669 // Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed. 25670 openTooltip: function (latlng) { 25671 if (this._tooltip) { 25672 if (!(this instanceof FeatureGroup)) { 25673 this._tooltip._source = this; 25674 } 25675 if (this._tooltip._prepareOpen(latlng)) { 25676 // open the tooltip on the map 25677 this._tooltip.openOn(this._map); 25678 25679 if (this.getElement) { 25680 this._setAriaDescribedByOnLayer(this); 25681 } else if (this.eachLayer) { 25682 this.eachLayer(this._setAriaDescribedByOnLayer, this); 25683 } 25684 } 25685 } 25686 return this; 25687 }, 25688 25689 // @method closeTooltip(): this 25690 // Closes the tooltip bound to this layer if it is open. 25691 closeTooltip: function () { 25692 if (this._tooltip) { 25693 return this._tooltip.close(); 25694 } 25695 }, 25696 25697 // @method toggleTooltip(): this 25698 // Opens or closes the tooltip bound to this layer depending on its current state. 25699 toggleTooltip: function () { 25700 if (this._tooltip) { 25701 this._tooltip.toggle(this); 25702 } 25703 return this; 25704 }, 25705 25706 // @method isTooltipOpen(): boolean 25707 // Returns `true` if the tooltip bound to this layer is currently open. 25708 isTooltipOpen: function () { 25709 return this._tooltip.isOpen(); 25710 }, 25711 25712 // @method setTooltipContent(content: String|HTMLElement|Tooltip): this 25713 // Sets the content of the tooltip bound to this layer. 25714 setTooltipContent: function (content) { 25715 if (this._tooltip) { 25716 this._tooltip.setContent(content); 25717 } 25718 return this; 25719 }, 25720 25721 // @method getTooltip(): Tooltip 25722 // Returns the tooltip bound to this layer. 25723 getTooltip: function () { 25724 return this._tooltip; 25725 }, 25726 25727 _addFocusListeners: function () { 25728 if (this.getElement) { 25729 this._addFocusListenersOnLayer(this); 25730 } else if (this.eachLayer) { 25731 this.eachLayer(this._addFocusListenersOnLayer, this); 25732 } 25733 }, 25734 25735 _addFocusListenersOnLayer: function (layer) { 25736 var el =
25736layer.getElement(); 25737 if (el) { 25738 on(el, 'focus', function () { 25739 this._tooltip._source = layer; 25740 this.openTooltip(); 25741 }, this); 25742 on(el, 'blur', this.closeTooltip, this); 25743 } 25744 }, 25745 25746 _setAriaDescribedByOnLayer: function (layer) { 25747 var el = layer.getElement(); 25748 if (el) { 25749 el.setAttribute('aria-describedby', this._tooltip._container.id); 25750 } 25751 }, 25752 25753 25754 _openTooltip: function (e) { 25755 if (!this._tooltip || !this._map || (this._map.dragging && this._map.dragging.moving())) { 25756 return; 25757 }
vendor: 44,787 bytes, lines 25757-27222
25757 25758 this._tooltip._source = e.layer || e.target; 25759 25760 this.openTooltip(this._tooltip.options.sticky ? e.latlng : undefined); 25761 }, 25762 25763 _moveTooltip: function (e) { 25764 var latlng = e.latlng, containerPoint, layerPoint; 25765 if (this._tooltip.options.sticky && e.originalEvent) { 25766 containerPoint = this._map.mouseEventToContainerPoint(e.originalEvent); 25767 layerPoint = this._map.containerPointToLayerPoint(containerPoint); 25768 latlng = this._map.layerPointToLatLng(layerPoint); 25769 } 25770 this._tooltip.setLatLng(latlng); 25771 } 25772 }); 25773 25774 /* 25775 * @class DivIcon 25776 * @aka L.DivIcon 25777 * @inherits Icon 25778 * 25779 * Represents a lightweight icon for markers that uses a simple `<div>` 25780 * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options. 25781 * 25782 * @example 25783 * ```js 25784 * var myIcon = L.divIcon({className: 'my-div-icon'}); 25785 * // you can set .my-div-icon styles in CSS 25786 * 25787 * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map); 25788 * ``` 25789 * 25790 * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow. 25791 */ 25792 25793 var DivIcon = Icon.extend({ 25794 options: { 25795 // @section 25796 // @aka DivIcon options 25797 iconSize: [12, 12], // also can be set through CSS 25798 25799 // iconAnchor: (Point), 25800 // popupAnchor: (Point), 25801 25802 // @option html: String|HTMLElement = '' 25803 // Custom HTML code to put inside the div element, empty by default. Alternatively, 25804 // an instance of `HTMLElement`. 25805 html: false, 25806 25807 // @option bgPos: Point = [0, 0] 25808 // Optional relative position of the background, in pixels 25809 bgPos: null, 25810 25811 className: 'leaflet-div-icon' 25812 }, 25813 25814 createIcon: function (oldIcon) { 25815 var div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'), 25816 options = this.options; 25817 25818 if (options.html instanceof Element) { 25819 empty(div); 25820 div.appendChild(options.html); 25821 } else { 25822 div.innerHTML = options.html !== false ? options.html : ''; 25823 } 25824 25825 if (options.bgPos) { 25826 var bgPos = toPoint(options.bgPos); 25827 div.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px'; 25828 } 25829 this._setIconStyles(div, 'icon'); 25830 25831 return div; 25832 }, 25833 25834 createShadow: function () { 25835 return null; 25836 } 25837 }); 25838 25839 // @factory L.divIcon(options: DivIcon options) 25840 // Creates a `DivIcon` instance with the given options. 25841 function divIcon(options) { 25842 return new DivIcon(options); 25843 } 25844 25845 Icon.Default = IconDefault; 25846 25847 /* 25848 * @class GridLayer 25849 * @inherits Layer 25850 * @aka L.GridLayer 25851 * 25852 * Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces `TileLayer.Canvas`. 25853 * GridLayer can be extended to create a tiled grid of HTML elements like `<canvas>`, `<img>` or `<div>`. GridLayer will handle creating and animating these DOM elements for you. 25854 * 25855 * 25856 * @section Synchronous usage 25857 * @example 25858 * 25859 * To create a custom layer, extend GridLayer and implement the `createTile()` method, which will be passed a `Point` object with the `x`, `y`, and `z` (zoom level) coordinates to draw your tile. 25860 * 25861 * ```js 25862 * var CanvasLayer = L.GridLayer.extend({ 25863 * createTile: function(coords){ 25864 * // create a <canvas> element for drawing 25865 * var tile = L.DomUtil.create('canvas', 'leaflet-tile'); 25866 * 25867 * // setup tile width and height according to the options 25868 * var size = this.getTileSize(); 25869 * tile.width = size.x; 25870 * tile.height = size.y; 25871 * 25872 * // get a canvas context and draw something on it using coords.x, coords.y and coords.z 25873 * var ctx = tile.getContext('2d'); 25874 * 25875 * // return the tile so it can be rendered on screen 25876 * return tile; 25877 * } 25878 * }); 25879 * ``` 25880 * 25881 * @section Asynchronous usage 25882 * @example 25883 * 25884 * Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the `done()` callback. 25885 * 25886 * ```js 25887 * var CanvasLayer = L.GridLayer.extend({ 25888 * createTile: function(coords, done){ 25889 * var error; 25890 * 25891 * // create a <canvas> element for drawing 25892 * var tile = L.DomUtil.create('canvas', 'leaflet-tile'); 25893 * 25894 * // setup tile width and height according to the options 25895 * var size = this.getTileSize(); 25896 * tile.width = size.x; 25897 * tile.height = size.y; 25898 * 25899 * // draw something asynchronously and pass the tile to the done() callback 25900 * setTimeout(function() { 25901 * done(error, tile); 25902 * }, 1000); 25903 * 25904 * return tile; 25905 * } 25906 * }); 25907 * ``` 25908 * 25909 * @section 25910 */ 25911 25912 25913 var GridLayer = Layer.extend({ 25914 25915 // @section 25916 // @aka GridLayer options 25917 options: { 25918 // @option tileSize: Number|Point = 256 25919 // Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise. 25920 tileSize: 256, 25921 25922 // @option opacity: Number = 1.0 25923 // Opacity of the tiles. Can be used in the `createTile()` function. 25924 opacity: 1, 25925 25926 // @option updateWhenIdle: Boolean = (depends) 25927 // Load new tiles only when panning ends. 25928 // `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation. 25929 // `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the 25930 // [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers. 25931 updateWhenIdle: Browser.mobile, 25932 25933 // @option updateWhenZooming: Boolean = true 25934 // By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends. 25935 updateWhenZooming: true, 25936 25937 // @option updateInterval: Number = 200 25938 // Tiles will not update more than once every `updateInterval` milliseconds when panning. 25939 updateInterval: 200, 25940 25941 // @option zIndex: Number = 1 25942 // The explicit zIndex of the tile layer. 25943 zIndex: 1, 25944 25945 // @option bounds: LatLngBounds = undefined 25946 // If set, tiles will only be loaded inside the set `LatLngBounds`. 25947 bounds: null, 25948 25949 // @option minZoom: Number = 0 25950 // The minimum zoom level down to which this layer will be displayed (inclusive). 25951 minZoom: 0, 25952 25953 // @option maxZoom: Number = undefined 25954 // The maximum zoom level up to which this layer will be displayed (inclusive). 25955 maxZoom: undefined, 25956 25957 // @option maxNativeZoom: Number = undefined 25958 // Maximum zoom number the tile source has available. If it is specified, 25959 // the tiles on all zoom levels higher than `maxNativeZoom` will be loaded 25960 // from `maxNativeZoom` level and auto-scaled. 25961 maxNativeZoom: undefined, 25962 25963 // @option minNativeZoom: Number = undefined 25964 // Minimum zoom number the tile source has available. If it is specified, 25965 // the tiles on all zoom levels lower than `minNativeZoom` will be loaded 25966 // from `minNativeZoom` level and auto-scaled. 25967 minNativeZoom: undefined, 25968 25969 // @option noWrap: Boolean = false 25970 // Whether the layer is wrapped around the antimeridian. If `true`, the 25971 // GridLayer will only be displayed once at low zoom levels. Has no 25972 // effect when the [map CRS](#map-crs) doesn't wrap around. Can be used 25973 // in combination with [`bounds`](#gridlayer-bounds) to prevent requesting 25974 // tiles outside the CRS limits. 25975 noWrap: false, 25976 25977 // @option pane: String = 'tilePane' 25978 // `Map pane` where the grid layer will be added. 25979 pane: 'tilePane', 25980 25981 // @option className: String = '' 25982 // A custom class name to assign to the tile layer. Empty by default. 25983 className: '', 25984 25985 // @option keepBuffer: Number = 2 25986 // When panning the map, keep this many rows and columns of tiles before unloading them. 25987 keepBuffer: 2 25988 }, 25989 25990 initialize: function (options) { 25991 setOptions(this, options); 25992 }, 25993 25994 onAdd: function () { 25995 this._initContainer(); 25996 25997 this._levels = {}; 25998 this._tiles = {}; 25999 26000 this._resetView(); // implicit _update() call 26001 }, 26002 26003 beforeAdd: function (map) { 26004 map._addZoomLimit(this); 26005 }, 26006 26007 onRemove: function (map) { 26008 this._removeAllTiles(); 26009 remove(this._container); 26010 map._removeZoomLimit(this); 26011 this._container = null; 26012 this._tileZoom = undefined; 26013 }, 26014 26015 // @method bringToFront: this 26016 // Brings the tile layer to the top of all tile layers. 26017 bringToFront: function () { 26018 if (this._map) { 26019 toFront(this._container); 26020 this._setAutoZIndex(Math.max); 26021 } 26022 return this; 26023 }, 26024 26025 // @method bringToBack: this 26026 // Brings the tile layer to the bottom of all tile layers. 26027 bringToBack: function () { 26028 if (this._map) { 26029 toBack(this._container); 26030 this._setAutoZIndex(Math.min); 26031 } 26032 return this; 26033 }, 26034 26035 // @method getContainer: HTMLElement 26036 // Returns the HTML element that contains the tiles for this layer. 26037 getContainer: function () { 26038 return this._container; 26039 }, 26040 26041 // @method setOpacity(opacity: Number): this 26042 // Changes the [opacity](#gridlayer-opacity) of the grid layer. 26043 setOpacity: function (opacity) { 26044 this.options.opacity = opacity; 26045 this._updateOpacity(); 26046 return this; 26047 }, 26048 26049 // @method setZIndex(zIndex: Number): this 26050 // Changes the [zIndex](#gridlayer-zindex) of the grid layer. 26051 setZIndex: function (zIndex) { 26052 this.options.zIndex = zIndex; 26053 this._updateZIndex(); 26054 26055 return this; 26056 }, 26057 26058 // @method isLoading: Boolean 26059 // Returns `true` if any tile in the grid layer has not finished loading. 26060 isLoading: function () { 26061 return this._loading; 26062 }, 26063 26064 // @method redraw: this 26065 // Causes the layer to clear all the tiles and request them again. 26066 redraw: function () { 26067 if (this._map) { 26068 this._removeAllTiles(); 26069 var tileZoom = this._clampZoom(this._map.getZoom()); 26070 if (tileZoom !== this._tileZoom) { 26071 this._tileZoom = tileZoom; 26072 this._updateLevels(); 26073 } 26074 this._update(); 26075 } 26076 return this; 26077 }, 26078 26079 getEvents: function () { 26080 var events = { 26081 viewprereset: this._invalidateAll, 26082 viewreset: this._resetView, 26083 zoom: this._resetView, 26084 moveend: this._onMoveEnd 26085 }; 26086 26087 if (!this.options.updateWhenIdle) { 26088 // update tiles on move, but not more often than once per given interval 26089 if (!this._onMove) { 26090 this._onMove = throttle(this._onMoveEnd, this.options.updateInterval, this); 26091 } 26092 26093 events.move = this._onMove; 26094 } 26095 26096 if (this._zoomAnimated) { 26097 events.zoomanim = this._animateZoom; 26098 } 26099 26100 return events; 26101 }, 26102 26103 // @section Extension methods 26104 // Layers extending `GridLayer` shall reimplement the following method. 26105 // @method createTile(coords: Object, done?: Function): HTMLElement 26106 // Called only internally, must be overridden by classes extending `GridLayer`. 26107 // Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback 26108 // is specified, it must be called when the tile has finished loading and drawing. 26109 createTile: function () { 26110 return document.createElement('div'); 26111 }, 26112 26113 // @section 26114 // @method getTileSize: Point 26115 // Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method. 26116 getTileSize: function () { 26117 var s = this.options.tileSize; 26118 return s instanceof Point ? s : new Point(s, s); 26119 }, 26120 26121 _updateZIndex: function () { 26122 if (this._container && this.options.zIndex !== undefined && this.options.zIndex !== null) { 26123 this._container.style.zIndex = this.options.zIndex; 26124 } 26125 }, 26126 26127 _setAutoZIndex: function (compare) { 26128 // go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back) 26129 26130 var layers = this.getPane().children, 26131 edgeZIndex = -compare(-Infinity, Infinity); // -Infinity for max, Infinity for min 26132 26133 for (var i = 0, len = layers.length, zIndex; i < len; i++) { 26134 26135 zIndex = layers[i].style.zIndex; 26136 26137 if (layers[i] !== this._container && zIndex) { 26138 edgeZIndex = compare(edgeZIndex, +zIndex); 26139 } 26140 } 26141 26142 if (isFinite(edgeZIndex)) { 26143 this.options.zIndex = edgeZIndex + compare(-1, 1); 26144 this._updateZIndex(); 26145 } 26146 }, 26147 26148 _updateOpacity: function () { 26149 if (!this._map) { return; } 26150 26151 // IE doesn't inherit filter opacity properly, so we're forced to set it on tiles 26152 if (Browser.ielt9) { return; } 26153 26154 setOpacity(this._container, this.options.opacity); 26155 26156 var now = +new Date(), 26157 nextFrame = false, 26158 willPrune = false; 26159 26160 for (var key in this._tiles) { 26161 var tile = this._tiles[key]; 26162 if (!tile.current || !tile.loaded) { continue; } 26163 26164 var fade = Math.min(1, (now - tile.loaded) / 200); 26165 26166 setOpacity(tile.el, fade); 26167 if (fade < 1) { 26168 nextFrame = true; 26169 } else { 26170 if (tile.active) { 26171 willPrune = true; 26172 } else { 26173 this._onOpaqueTile(tile); 26174 } 26175 tile.active = true; 26176 } 26177 } 26178 26179 if (willPrune && !this._noPrune) { this._pruneTiles(); } 26180 26181 if (nextFrame) { 26182 cancelAnimFrame(this._fadeFrame); 26183 this._fadeFrame = requestAnimFrame(this._updateOpacity, this); 26184 } 26185 }, 26186 26187 _onOpaqueTile: falseFn, 26188 26189 _initContainer: function () { 26190 if (this._container) { return; } 26191 26192 this._container = create$1('div', 'leaflet-layer ' + (this.options.className || '')); 26193 this._updateZIndex(); 26194 26195 if (this.options.opacity < 1) { 26196 this._updateOpacity(); 26197 } 26198 26199 this.getPane().appendChild(this._container); 26200 }, 26201 26202 _updateLevels: function () { 26203 26204 var zoom = this._tileZoom, 26205 maxZoom = this.options.maxZoom; 26206 26207 if (zoom === undefined) { return undefined; } 26208 26209 for (var z in this._levels) { 26210 z = Number(z); 26211 if (this._levels[z].el.children.length || z === zoom) { 26212 this._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom - z); 26213 this._onUpdateLevel(z); 26214 } else { 26215 remove(this._levels[z].el); 26216 this._removeTilesAtZoom(z); 26217 this._onRemoveLevel(z); 26218 delete this._levels[z]; 26219 } 26220 } 26221 26222 var level = this._levels[zoom], 26223 map = this._map; 26224 26225 if (!level) { 26226 level = this._levels[zoom] = {}; 26227 26228 level.el = create$1('div', 'leaflet-tile-container leaflet-zoom-animated', this._container); 26229 level.el.style.zIndex = maxZoom; 26230 26231 level.origin = map.project(map.unproject(map.getPixelOrigin()), zoom).round(); 26232 level.zoom = zoom; 26233 26234 this._setZoomTransform(level, map.getCenter(), map.getZoom()); 26235 26236 // force the browser to consider the newly added element for transition 26237 falseFn(level.el.offsetWidth); 26238 26239 this._onCreateLevel(level); 26240 } 26241 26242 this._level = level; 26243 26244 return level; 26245 }, 26246 26247 _onUpdateLevel: falseFn, 26248 26249 _onRemoveLevel: falseFn, 26250 26251 _onCreateLevel: falseFn, 26252 26253 _pruneTiles: function () { 26254 if (!this._map) { 26255 return; 26256 } 26257 26258 var key, tile; 26259 26260 var zoom = this._map.getZoom(); 26261 if (zoom > this.options.maxZoom || 26262 zoom < this.options.minZoom) { 26263 this._removeAllTiles(); 26264 return; 26265 } 26266 26267 for (key in this._tiles) { 26268 tile = this._tiles[key]; 26269 tile.retain = tile.current; 26270 } 26271 26272 for (key in this._tiles) { 26273 tile = this._tiles[key]; 26274 if (tile.current && !tile.active) { 26275 var coords = tile.coords; 26276 if (!this._retainParent(coords.x, coords.y, coords.z, coords.z - 5)) { 26277 this._retainChildren(coords.x, coords.y, coords.z, coords.z + 2); 26278 } 26279 } 26280 } 26281 26282 for (key in this._tiles) { 26283 if (!this._tiles[key].retain) { 26284 this._removeTile(key); 26285 } 26286 } 26287 }, 26288 26289 _removeTilesAtZoom: function (zoom) { 26290 for (var key in this._tiles) { 26291 if (this._tiles[key].coords.z !== zoom) { 26292 continue; 26293 } 26294 this._removeTile(key); 26295 } 26296 }, 26297 26298 _removeAllTiles: function () { 26299 for (var key in this._tiles) { 26300 this._removeTile(key); 26301 } 26302 }, 26303 26304 _invalidateAll: function () { 26305 for (var z in this._levels) { 26306 remove(this._levels[z].el); 26307 this._onRemoveLevel(Number(z)); 26308 delete this._levels[z]; 26309 } 26310 this._removeAllTiles(); 26311 26312 this._tileZoom = undefined; 26313 }, 26314 26315 _retainParent: function (x, y, z, minZoom) { 26316 var x2 = Math.floor(x / 2), 26317 y2 = Math.floor(y / 2), 26318 z2 = z - 1, 26319 coords2 = new Point(+x2, +y2); 26320 coords2.z = +z2; 26321 26322 var key = this._tileCoordsToKey(coords2), 26323 tile = this._tiles[key]; 26324 26325 if (tile && tile.active) { 26326 tile.retain = true; 26327 return true; 26328 26329 } else if (tile && tile.loaded) { 26330 tile.retain = true; 26331 } 26332 26333 if (z2 > minZoom) { 26334 return this._retainParent(x2, y2, z2, minZoom); 26335 } 26336 26337 return false; 26338 }, 26339 26340 _retainChildren: function (x, y, z, maxZoom) { 26341 26342 for (var i = 2 * x; i < 2 * x + 2; i++) { 26343 for (var j = 2 * y; j < 2 * y + 2; j++) { 26344 26345 var coords = new Point(i, j); 26346 coords.z = z + 1; 26347 26348 var key = this._tileCoordsToKey(coords), 26349 tile = this._tiles[key]; 26350 26351 if (tile && tile.active) { 26352 tile.retain = true; 26353 continue; 26354 26355 } else if (tile && tile.loaded) { 26356 tile.retain = true; 26357 } 26358 26359 if (z + 1 < maxZoom) { 26360 this._retainChildren(i, j, z + 1, maxZoom); 26361 } 26362 } 26363 } 26364 }, 26365 26366 _resetView: function (e) { 26367 var animating = e && (e.pinch || e.flyTo); 26368 this._setView(this._map.getCenter(), this._map.getZoom(), animating, animating); 26369 }, 26370 26371 _animateZoom: function (e) { 26372 this._setView(e.center, e.zoom, true, e.noUpdate); 26373 }, 26374 26375 _clampZoom: function (zoom) { 26376 var options = this.options; 26377 26378 if (undefined !== options.minNativeZoom && zoom < options.minNativeZoom) { 26379 return options.minNativeZoom; 26380 } 26381 26382 if (undefined !== options.maxNativeZoom && options.maxNativeZoom < zoom) { 26383 return options.maxNativeZoom; 26384 } 26385 26386 return zoom; 26387 }, 26388 26389 _setView: function (center, zoom, noPrune, noUpdate) { 26390 var tileZoom = Math.round(zoom); 26391 if ((this.options.maxZoom !== undefined && tileZoom > this.options.maxZoom) || 26392 (this.options.minZoom !== undefined && tileZoom < this.options.minZoom)) { 26393 tileZoom = undefined; 26394 } else { 26395 tileZoom = this._clampZoom(tileZoom); 26396 } 26397 26398 var tileZoomChanged = this.options.updateWhenZooming && (tileZoom !== this._tileZoom); 26399 26400 if (!noUpdate || tileZoomChanged) { 26401 26402 this._tileZoom = tileZoom; 26403 26404 if (this._abortLoading) { 26405 this._abortLoading(); 26406 } 26407 26408 this._updateLevels(); 26409 this._resetGrid(); 26410 26411 if (tileZoom !== undefined) { 26412 this._update(center); 26413 } 26414 26415 if (!noPrune) { 26416 this._pruneTiles(); 26417 } 26418 26419 // Flag to prevent _updateOpacity from pruning tiles during 26420 // a zoom anim or a pinch gesture 26421 this._noPrune = !!noPrune; 26422 } 26423 26424 this._setZoomTransforms(center, zoom); 26425 }, 26426 26427 _setZoomTransforms: function (center, zoom) { 26428 for (var i in this._levels) { 26429 this._setZoomTransform(this._levels[i], center, zoom); 26430 } 26431 }, 26432 26433 _setZoomTransform: function (level, center, zoom) { 26434 var scale = this._map.getZoomScale(zoom, level.zoom), 26435 translate = level.origin.multiplyBy(scale) 26436 .subtract(this._map._getNewPixelOrigin(center, zoom)).round(); 26437 26438 if (Browser.any3d) { 26439 setTransform(level.el, translate, scale); 26440 } else { 26441 setPosition(level.el, translate); 26442 } 26443 }, 26444 26445 _resetGrid: function () { 26446 var map = this._map, 26447 crs = map.options.crs, 26448 tileSize = this._tileSize = this.getTileSize(), 26449 tileZoom = this._tileZoom; 26450 26451 var bounds = this._map.getPixelWorldBounds(this._tileZoom); 26452 if (bounds) { 26453 this._globalTileRange = this._pxBoundsToTileRange(bounds); 26454 } 26455 26456 this._wrapX = crs.wrapLng && !this.options.noWrap && [ 26457 Math.floor(map.project([0, crs.wrapLng[0]], tileZoom).x / tileSize.x), 26458 Math.ceil(map.project([0, crs.wrapLng[1]], tileZoom).x / tileSize.y) 26459 ]; 26460 this._wrapY = crs.wrapLat && !this.options.noWrap && [ 26461 Math.floor(map.project([crs.wrapLat[0], 0], tileZoom).y / tileSize.x), 26462 Math.ceil(map.project([crs.wrapLat[1], 0], tileZoom).y / tileSize.y) 26463 ]; 26464 }, 26465 26466 _onMoveEnd: function () { 26467 if (!this._map || this._map._animatingZoom) { return; } 26468 26469 this._update(); 26470 }, 26471 26472 _getTiledPixelBounds: function (center) { 26473 var map = this._map, 26474 mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(), 26475 scale = map.getZoomScale(mapZoom, this._tileZoom), 26476 pixelCenter = map.project(center, this._tileZoom).floor(), 26477 halfSize = map.getSize().divideBy(scale * 2); 26478 26479 return new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize)); 26480 }, 26481 26482 // Private method to load tiles in the grid's active zoom level according to map bounds 26483 _update: function (center) { 26484 var map = this._map; 26485 if (!map) { return; } 26486 var zoom = this._clampZoom(map.getZoom()); 26487 26488 if (center === undefined) { center = map.getCenter(); } 26489 if (this._tileZoom === undefined) { return; } // if out of minzoom/maxzoom 26490 26491 var pixelBounds = this._getTiledPixelBounds(center), 26492 tileRange = this._pxBoundsToTileRange(pixelBounds), 26493 tileCenter = tileRange.getCenter(), 26494 queue = [], 26495 margin = this.options.keepBuffer, 26496 noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([margin, -margin]), 26497 tileRange.getTopRight().add([margin, -margin])); 26498 26499 // Sanity check: panic if the tile range contains Infinity somewhere. 26500 if (!(isFinite(tileRange.min.x) && 26501 isFinite(tileRange.min.y) && 26502 isFinite(tileRange.max.x) && 26503 isFinite(tileRange.max.y))) { throw new Error('Attempted to load an infinite number of tiles'); } 26504 26505 for (var key in this._tiles) { 26506 var c = this._tiles[key].coords; 26507 if (c.z !== this._tileZoom || !noPruneRange.contains(new Point(c.x, c.y))) { 26508 this._tiles[key].current = false; 26509 } 26510 } 26511 26512 // _update just loads more tiles. If the tile zoom level differs too much 26513 // from the map's, let _setView reset levels and prune old tiles. 26514 if (Math.abs(zoom - this._tileZoom) > 1) { this._setView(center, zoom); return; } 26515 26516 // create a queue of coordinates to load tiles from 26517 for (var j = tileRange.min.y; j <= tileRange.max.y; j++) { 26518 for (var i = tileRange.min.x; i <= tileRange.max.x; i++) { 26519 var coords = new Point(i, j); 26520 coords.z = this._tileZoom; 26521 26522 if (!this._isValidTile(coords)) { continue; } 26523 26524 var tile = this._tiles[this._tileCoordsToKey(coords)]; 26525 if (tile) { 26526 tile.current = true; 26527 } else { 26528 queue.push(coords); 26529 } 26530 } 26531 } 26532 26533 // sort tile queue to load tiles in order of their distance to center 26534 queue.sort(function (a, b) { 26535 return a.distanceTo(tileCenter) - b.distanceTo(tileCenter); 26536 }); 26537 26538 if (queue.length !== 0) { 26539 // if it's the first batch of tiles to load 26540 if (!this._loading) { 26541 this._loading = true; 26542 // @event loading: Event 26543 // Fired when the grid layer starts loading tiles. 26544 this.fire('loading'); 26545 } 26546 26547 // create DOM fragment to append tiles in one batch 26548 var fragment = document.createDocumentFragment(); 26549 26550 for (i = 0; i < queue.length; i++) { 26551 this._addTile(queue[i], fragment); 26552 } 26553 26554 this._level.el.appendChild(fragment); 26555 } 26556 }, 26557 26558 _isValidTile: function (coords) { 26559 var crs = this._map.options.crs; 26560 26561 if (!crs.infinite) { 26562 // don't load tile if it's out of bounds and not wrapped 26563 var bounds = this._globalTileRange; 26564 if ((!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) || 26565 (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))) { return false; } 26566 } 26567 26568 if (!this.options.bounds) { return true; } 26569 26570 // don't load tile if it doesn't intersect the bounds in options 26571 var tileBounds = this._tileCoordsToBounds(coords); 26572 return toLatLngBounds(this.options.bounds).overlaps(tileBounds); 26573 }, 26574 26575 _keyToBounds: function (key) { 26576 return this._tileCoordsToBounds(this._keyToTileCoords(key)); 26577 }, 26578 26579 _tileCoordsToNwSe: function (coords) { 26580 var map = this._map, 26581 tileSize = this.getTileSize(), 26582 nwPoint = coords.scaleBy(tileSize), 26583 sePoint = nwPoint.add(tileSize), 26584 nw = map.unproject(nwPoint, coords.z), 26585 se = map.unproject(sePoint, coords.z); 26586 return [nw, se]; 26587 }, 26588 26589 // converts tile coordinates to its geographical bounds 26590 _tileCoordsToBounds: function (coords) { 26591 var bp = this._tileCoordsToNwSe(coords), 26592 bounds = new LatLngBounds(bp[0], bp[1]); 26593 26594 if (!this.options.noWrap) { 26595 bounds = this._map.wrapLatLngBounds(bounds); 26596 } 26597 return bounds; 26598 }, 26599 // converts tile coordinates to key for the tile cache 26600 _tileCoordsToKey: function (coords) { 26601 return coords.x + ':' + coords.y + ':' + coords.z; 26602 }, 26603 26604 // converts tile cache key to coordinates 26605 _keyToTileCoords: function (key) { 26606 var k = key.split(':'), 26607 coords = new Point(+k[0], +k[1]); 26608 coords.z = +k[2]; 26609 return coords; 26610 }, 26611 26612 _removeTile: function (key) { 26613 var tile = this._tiles[key]; 26614 if (!tile) { return; } 26615 26616 remove(tile.el); 26617 26618 delete this._tiles[key]; 26619 26620 // @event tileunload: TileEvent 26621 // Fired when a tile is removed (e.g. when a tile goes off the screen). 26622 this.fire('tileunload', { 26623 tile: tile.el, 26624 coords: this._keyToTileCoords(key) 26625 }); 26626 }, 26627 26628 _initTile: function (tile) { 26629 addClass(tile, 'leaflet-tile'); 26630 26631 var tileSize = this.getTileSize(); 26632 tile.style.width = tileSize.x + 'px'; 26633 tile.style.height = tileSize.y + 'px'; 26634 26635 tile.onselectstart = falseFn; 26636 tile.onmousemove = falseFn; 26637 26638 // update opacity on tiles in IE7-8 because of filter inheritance problems 26639 if (Browser.ielt9 && this.options.opacity < 1) { 26640 setOpacity(tile, this.options.opacity); 26641 } 26642 }, 26643 26644 _addTile: function (coords, container) { 26645 var tilePos = this._getTilePos(coords), 26646 key = this._tileCoordsToKey(coords); 26647 26648 var tile = this.createTile(this._wrapCoords(coords), bind(this._tileReady, this, coords)); 26649 26650 this._initTile(tile); 26651 26652 // if createTile is defined with a second argument ("done" callback), 26653 // we know that tile is async and will be ready later; otherwise 26654 if (this.createTile.length < 2) { 26655 // mark tile as ready, but delay one frame for opacity animation to happen 26656 requestAnimFrame(bind(this._tileReady, this, coords, null, tile)); 26657 } 26658 26659 setPosition(tile, tilePos); 26660 26661 // save tile in cache 26662 this._tiles[key] = { 26663 el: tile, 26664 coords: coords, 26665 current: true 26666 }; 26667 26668 container.appendChild(tile); 26669 // @event tileloadstart: TileEvent 26670 // Fired when a tile is requested and starts loading. 26671 this.fire('tileloadstart', { 26672 tile: tile, 26673 coords: coords 26674 }); 26675 }, 26676 26677 _tileReady: function (coords, err, tile) { 26678 if (err) { 26679 // @event tileerror: TileErrorEvent 26680 // Fired when there is an error loading a tile. 26681 this.fire('tileerror', { 26682 error: err, 26683 tile: tile, 26684 coords: coords 26685 }); 26686 } 26687 26688 var key = this._tileCoordsToKey(coords); 26689 26690 tile = this._tiles[key]; 26691 if (!tile) { return; } 26692 26693 tile.loaded = +new Date(); 26694 if (this._map._fadeAnimated) { 26695 setOpacity(tile.el, 0); 26696 cancelAnimFrame(this._fadeFrame); 26697 this._fadeFrame = requestAnimFrame(this._updateOpacity, this); 26698 } else { 26699 tile.active = true; 26700 this._pruneTiles(); 26701 } 26702 26703 if (!err) { 26704 addClass(tile.el, 'leaflet-tile-loaded'); 26705 26706 // @event tileload: TileEvent 26707 // Fired when a tile loads. 26708 this.fire('tileload', { 26709 tile: tile.el, 26710 coords: coords 26711 }); 26712 } 26713 26714 if (this._noTilesToLoad()) { 26715 this._loading = false; 26716 // @event load: Event 26717 // Fired when the grid layer loaded all visible tiles. 26718 this.fire('load'); 26719 26720 if (Browser.ielt9 || !this._map._fadeAnimated) { 26721 requestAnimFrame(this._pruneTiles, this); 26722 } else { 26723 // Wait a bit more than 0.2 secs (the duration of the tile fade-in) 26724 // to trigger a pruning. 26725 setTimeout(bind(this._pruneTiles, this), 250); 26726 } 26727 } 26728 }, 26729 26730 _getTilePos: function (coords) { 26731 return coords.scaleBy(this.getTileSize()).subtract(this._level.origin); 26732 }, 26733 26734 _wrapCoords: function (coords) { 26735 var newCoords = new Point( 26736 this._wrapX ? wrapNum(coords.x, this._wrapX) : coords.x, 26737 this._wrapY ? wrapNum(coords.y, this._wrapY) : coords.y); 26738 newCoords.z = coords.z; 26739 return newCoords; 26740 }, 26741 26742 _pxBoundsToTileRange: function (bounds) { 26743 var tileSize = this.getTileSize(); 26744 return new Bounds( 26745 bounds.min.unscaleBy(tileSize).floor(), 26746 bounds.max.unscaleBy(tileSize).ceil().subtract([1, 1])); 26747 }, 26748 26749 _noTilesToLoad: function () { 26750 for (var key in this._tiles) { 26751 if (!this._tiles[key].loaded) { return false; } 26752 } 26753 return true; 26754 } 26755 }); 26756 26757 // @factory L.gridLayer(options?: GridLayer options) 26758 // Creates a new instance of GridLayer with the supplied options. 26759 function gridLayer(options) { 26760 return new GridLayer(options); 26761 } 26762 26763 /* 26764 * @class TileLayer 26765 * @inherits GridLayer 26766 * @aka L.TileLayer 26767 * Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under `Layer`. Extends `GridLayer`. 26768 * 26769 * @example 26770 * 26771 * ```js 26772 * L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(map); 26773 * ``` 26774 * 26775 * @section URL template 26776 * @example 26777 * 26778 * A string of the following form: 26779 * 26780 * ``` 26781 * 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png' 26782 * ``` 26783 * 26784 * `{s}` means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; `a`, `b` or `c` by default, can be omitted), `{z}` â zoom level, `{x}` and `{y}` â tile coordinates. `{r}` can be used to add "@2x" to the URL to load retina tiles. 26785 * 26786 * You can use custom keys in the template, which will be [evaluated](#util-template) from TileLayer options, like this: 26787 * 26788 * ``` 26789 * L.tileLayer('https://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'}); 26790 * ``` 26791 */ 26792 26793 26794 var TileLayer = GridLayer.extend({ 26795 26796 // @section 26797 // @aka TileLayer options 26798 options: { 26799 // @option minZoom: Number = 0 26800 // The minimum zoom level down to which this layer will be displayed (inclusive). 26801 minZoom: 0, 26802 26803 // @option maxZoom: Number = 18 26804 // The maximum zoom level up to which this layer will be displayed (inclusive). 26805 maxZoom: 18, 26806 26807 // @option subdomains: String|String[] = 'abc' 26808 // Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings. 26809 subdomains: 'abc', 26810 26811 // @option errorTileUrl: String = '' 26812 // URL to the tile image to show in place of the tile that failed to load. 26813 errorTileUrl: '', 26814 26815 // @option zoomOffset: Number = 0 26816 // The zoom number used in tile URLs will be offset with this value. 26817 zoomOffset: 0, 26818 26819 // @option tms: Boolean = false 26820 // If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services). 26821 tms: false, 26822 26823 // @option zoomReverse: Boolean = false 26824 // If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`) 26825 zoomReverse: false, 26826 26827 // @option detectRetina: Boolean = false 26828 // If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution. 26829 detectRetina: false, 26830 26831 // @option crossOrigin: Boolean|String = false 26832 // Whether the crossOrigin attribute will be added to the tiles. 26833 // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. 26834 // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. 26835 crossOrigin: false, 26836 26837 // @option referrerPolicy: Boolean|String = false 26838 // Whether the referrerPolicy attribute will be added to the tiles. 26839 // If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided. 26840 // This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer 26841 // (e.g. to validate an API token). 26842 // Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values. 26843 referrerPolicy: false 26844 }, 26845 26846 initialize: function (url, options) { 26847 26848 this._url = url; 26849 26850 options = setOptions(this, options); 26851 26852 // detecting retina displays, adjusting tileSize and zoom levels 26853 if (options.detectRetina && Browser.retina && options.maxZoom > 0) { 26854 26855 options.tileSize = Math.floor(options.tileSize / 2); 26856 26857 if (!options.zoomReverse) { 26858 options.zoomOffset++; 26859 options.maxZoom = Math.max(options.minZoom, options.maxZoom - 1); 26860 } else { 26861 options.zoomOffset--; 26862 options.minZoom = Math.min(options.maxZoom, options.minZoom + 1); 26863 } 26864 26865 options.minZoom = Math.max(0, options.minZoom); 26866 } else if (!options.zoomReverse) { 26867 // make sure maxZoom is gte minZoom 26868 options.maxZoom = Math.max(options.minZoom, options.maxZoom); 26869 } else { 26870 // make sure minZoom is lte maxZoom 26871 options.minZoom = Math.min(options.maxZoom, options.minZoom); 26872 } 26873 26874 if (typeof options.subdomains === 'string') { 26875 options.subdomains = options.subdomains.split(''); 26876 } 26877 26878 this.on('tileunload', this._onTileRemove); 26879 }, 26880 26881 // @method setUrl(url: String, noRedraw?: Boolean): this 26882 // Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`). 26883 // If the URL does not change, the layer will not be redrawn unless 26884 // the noRedraw parameter is set to false. 26885 setUrl: function (url, noRedraw) { 26886 if (this._url === url && noRedraw === undefined) { 26887 noRedraw = true; 26888 } 26889 26890 this._url = url; 26891 26892 if (!noRedraw) { 26893 this.redraw(); 26894 } 26895 return this; 26896 }, 26897 26898 // @method createTile(coords: Object, done?: Function): HTMLElement 26899 // Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile) 26900 // to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done` 26901 // callback is called when the tile has been loaded. 26902 createTile: function (coords, done) { 26903 var tile = document.createElement('img'); 26904 26905 on(tile, 'load', bind(this._tileOnLoad, this, done, tile)); 26906 on(tile, 'error', bind(this._tileOnError, this, done, tile)); 26907 26908 if (this.options.crossOrigin || this.options.crossOrigin === '') { 26909 tile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin; 26910 } 26911 26912 // for this new option we follow the documented behavior 26913 // more closely by only setting the property when string 26914 if (typeof this.options.referrerPolicy === 'string') { 26915 tile.referrerPolicy = this.options.referrerPolicy; 26916 } 26917 26918 // The alt attribute is set to the empty string, 26919 // allowing screen readers to ignore the decorative image tiles. 26920 // https://www.w3.org/WAI/tutorials/images/decorative/ 26921 // https://www.w3.org/TR/html-aria/#el-img-empty-alt 26922 tile.alt = ''; 26923 26924 tile.src = this.getTileUrl(coords); 26925 26926 return tile; 26927 }, 26928 26929 // @section Extension methods 26930 // @uninheritable 26931 // Layers extending `TileLayer` might reimplement the following method. 26932 // @method getTileUrl(coords: Object): String 26933 // Called only internally, returns the URL for a tile given its coordinates. 26934 // Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes. 26935 getTileUrl: function (coords) { 26936 var data = { 26937 r: Browser.retina ? '@2x' : '', 26938 s: this._getSubdomain(coords), 26939 x: coords.x, 26940 y: coords.y, 26941 z: this._getZoomForUrl() 26942 }; 26943 if (this._map && !this._map.options.crs.infinite) { 26944 var invertedY = this._globalTileRange.max.y - coords.y; 26945 if (this.options.tms) { 26946 data['y'] = invertedY; 26947 } 26948 data['-y'] = invertedY; 26949 } 26950 26951 return template(this._url, extend(data, this.options)); 26952 }, 26953 26954 _tileOnLoad: function (done, tile) { 26955 // For https://github.com/Leaflet/Leaflet/issues/3332 26956 if (Browser.ielt9) { 26957 setTimeout(bind(done, this, null, tile), 0); 26958 } else { 26959 done(null, tile); 26960 } 26961 }, 26962 26963 _tileOnError: function (done, tile, e) { 26964 var errorUrl = this.options.errorTileUrl; 26965 if (errorUrl && tile.getAttribute('src') !== errorUrl) { 26966 tile.src = errorUrl; 26967 } 26968 done(e, tile); 26969 }, 26970 26971 _onTileRemove: function (e) { 26972 e.tile.onload = null; 26973 }, 26974 26975 _getZoomForUrl: function () { 26976 var zoom = this._tileZoom, 26977 maxZoom = this.options.maxZoom, 26978 zoomReverse = this.options.zoomReverse, 26979 zoomOffset = this.options.zoomOffset; 26980 26981 if (zoomReverse) { 26982 zoom = maxZoom - zoom; 26983 } 26984 26985 return zoom + zoomOffset; 26986 }, 26987 26988 _getSubdomain: function (tilePoint) { 26989 var index = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length; 26990 return this.options.subdomains[index]; 26991 }, 26992 26993 // stops loading all tiles in the background layer 26994 _abortLoading: function () { 26995 var i, tile; 26996 for (i in this._tiles) { 26997 if (this._tiles[i].coords.z !== this._tileZoom) { 26998 tile = this._tiles[i].el; 26999 27000 tile.onload = falseFn; 27001 tile.onerror = falseFn; 27002 27003 if (!tile.complete) { 27004 tile.src = emptyImageUrl; 27005 var coords = this._tiles[i].coords; 27006 remove(tile); 27007 delete this._tiles[i]; 27008 // @event tileabort: TileEvent 27009 // Fired when a tile was loading but is now not wanted. 27010 this.fire('tileabort', { 27011 tile: tile, 27012 coords: coords 27013 }); 27014 } 27015 } 27016 } 27017 }, 27018 27019 _removeTile: function (key) { 27020 var tile = this._tiles[key]; 27021 if (!tile) { return; } 27022 27023 // Cancels any pending http requests associated with the tile 27024 tile.el.setAttribute('src', emptyImageUrl); 27025 27026 return GridLayer.prototype._removeTile.call(this, key); 27027 }, 27028 27029 _tileReady: function (coords, err, tile) { 27030 if (!this._map || (tile && tile.getAttribute('src') === emptyImageUrl)) { 27031 return; 27032 } 27033 27034 return GridLayer.prototype._tileReady.call(this, coords, err, tile); 27035 } 27036 }); 27037 27038 27039 // @factory L.tilelayer(urlTemplate: String, options?: TileLayer options) 27040 // Instantiates a tile layer object given a `URL template` and optionally an options object. 27041 27042 function tileLayer(url, options) { 27043 return new TileLayer(url, options); 27044 } 27045 27046 /* 27047 * @class TileLayer.WMS 27048 * @inherits TileLayer 27049 * @aka L.TileLayer.WMS 27050 * Used to display [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services as tile layers on the map. Extends `TileLayer`. 27051 * 27052 * @example 27053 * 27054 * ```js 27055 * var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", { 27056 * layers: 'nexrad-n0r-900913', 27057 * format: 'image/png', 27058 * transparent: true, 27059 * attribution: "Weather data © 2012 IEM Nexrad" 27060 * }); 27061 * ``` 27062 */ 27063 27064 var TileLayerWMS = TileLayer.extend({ 27065 27066 // @section 27067 // @aka TileLayer.WMS options 27068 // If any custom options not documented here are used, they will be sent to the 27069 // WMS server as extra parameters in each request URL. This can be useful for 27070 // [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html). 27071 defaultWmsParams: { 27072 service: 'WMS', 27073 request: 'GetMap', 27074 27075 // @option layers: String = '' 27076 // **(required)** Comma-separated list of WMS layers to show. 27077 layers: '', 27078 27079 // @option styles: String = '' 27080 // Comma-separated list of WMS styles. 27081 styles: '', 27082 27083 // @option format: String = 'image/jpeg' 27084 // WMS image format (use `'image/png'` for layers with transparency). 27085 format: 'image/jpeg', 27086 27087 // @option transparent: Boolean = false 27088 // If `true`, the WMS service will return images with transparency. 27089 transparent: false, 27090 27091 // @option version: String = '1.1.1' 27092 // Version of the WMS service to use 27093 version: '1.1.1' 27094 }, 27095 27096 options: { 27097 // @option crs: CRS = null 27098 // Coordinate Reference System to use for the WMS requests, defaults to 27099 // map CRS. Don't change this if you're not sure what it means. 27100 crs: null, 27101 27102 // @option uppercase: Boolean = false 27103 // If `true`, WMS request parameter keys will be uppercase. 27104 uppercase: false 27105 }, 27106 27107 initialize: function (url, options) { 27108 27109 this._url = url; 27110 27111 var wmsParams = extend({}, this.defaultWmsParams); 27112 27113 // all keys that are not TileLayer options go to WMS params 27114 for (var i in options) { 27115 if (!(i in this.options)) { 27116 wmsParams[i] = options[i]; 27117 } 27118 } 27119 27120 options = setOptions(this, options); 27121 27122 var realRetina = options.detectRetina && Browser.retina ? 2 : 1; 27123 var tileSize = this.getTileSize(); 27124 wmsParams.width = tileSize.x * realRetina; 27125 wmsParams.height = tileSize.y * realRetina; 27126 27127 this.wmsParams = wmsParams; 27128 }, 27129 27130 onAdd: function (map) { 27131 27132 this._crs = this.options.crs || map.options.crs; 27133 this._wmsVersion = parseFloat(this.wmsParams.version); 27134 27135 var projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs'; 27136 this.wmsParams[projectionKey] = this._crs.code; 27137 27138 TileLayer.prototype.onAdd.call(this, map); 27139 }, 27140 27141 getTileUrl: function (coords) { 27142 27143 var tileBounds = this._tileCoordsToNwSe(coords), 27144 crs = this._crs, 27145 bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])), 27146 min = bounds.min, 27147 max = bounds.max, 27148 bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ? 27149 [min.y, min.x, max.y, max.x] : 27150 [min.x, min.y, max.x, max.y]).join(','), 27151 url = TileLayer.prototype.getTileUrl.call(this, coords); 27152 return url + 27153 getParamString(this.wmsParams, url, this.options.uppercase) + 27154 (this.options.uppercase ? '&BBOX=' : '&bbox=') + bbox; 27155 }, 27156 27157 // @method setParams(params: Object, noRedraw?: Boolean): this 27158 // Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true). 27159 setParams: function (params, noRedraw) { 27160 27161 extend(this.wmsParams, params); 27162 27163 if (!noRedraw) { 27164 this.redraw(); 27165 } 27166 27167 return this; 27168 } 27169 }); 27170 27171 27172 // @factory L.tileLayer.wms(baseUrl: String, options: TileLayer.WMS options) 27173 // Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object. 27174 function tileLayerWMS(url, options) { 27175 return new TileLayerWMS(url, options); 27176 } 27177 27178 TileLayer.WMS = TileLayerWMS; 27179 tileLayer.wms = tileLayerWMS; 27180 27181 /* 27182 * @class Renderer 27183 * @inherits Layer 27184 * @aka L.Renderer 27185 * 27186 * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the 27187 * DOM container of the renderer, its bounds, and its zoom animation. 27188 * 27189 * A `Renderer` works as an implicit layer group for all `Path`s - the renderer 27190 * itself can be added or removed to the map. All paths use a renderer, which can 27191 * be implicit (the map will decide the type of renderer and use it automatically) 27192 * or explicit (using the [`renderer`](#path-renderer) option of the path). 27193 * 27194 * Do not use this class directly, use `SVG` and `Canvas` instead. 27195 * 27196 * @event update: Event 27197 * Fired when the renderer updates its bounds, center and zoom, for example when 27198 * its map has moved 27199 */ 27200 27201 var Renderer = Layer.extend({ 27202 27203 // @section 27204 // @aka Renderer options 27205 options: { 27206 // @option padding: Number = 0.1 27207 // How much to extend the clip area around the map view (relative to its size) 27208 // e.g. 0.1 would be 10% of map view in each direction 27209 padding: 0.1 27210 }, 27211 27212 initialize: function (options) { 27213 setOptions(this, options); 27214 stamp(this); 27215 this._layers = this._layers || {}; 27216 }, 27217 27218 onAdd: function () { 27219 if (!this._container) { 27220 this._initContainer(); // defined by renderer implementations 27221 27222
27222if (this._zoomAnimated) { 27223 addClass(this._container, 'leaflet-zoom-animated'); 27224 }
vendor: 56,361 bytes, lines 27224-29249
27224 27225 } 27226 27227 this.getPane().appendChild(this._container); 27228 this._update(); 27229 this.on('update', this._updatePaths, this); 27230 }, 27231 27232 onRemove: function () { 27233 this.off('update', this._updatePaths, this); 27234 this._destroyContainer(); 27235 }, 27236 27237 getEvents: function () { 27238 var events = { 27239 viewreset: this._reset, 27240 zoom: this._onZoom, 27241 moveend: this._update, 27242 zoomend: this._onZoomEnd 27243 }; 27244 if (this._zoomAnimated) { 27245 events.zoomanim = this._onAnimZoom; 27246 } 27247 return events; 27248 }, 27249 27250 _onAnimZoom: function (ev) { 27251 this._updateTransform(ev.center, ev.zoom); 27252 }, 27253 27254 _onZoom: function () { 27255 this._updateTransform(this._map.getCenter(), this._map.getZoom()); 27256 }, 27257 27258 _updateTransform: function (center, zoom) { 27259 var scale = this._map.getZoomScale(zoom, this._zoom), 27260 viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding), 27261 currentCenterPoint = this._map.project(this._center, zoom), 27262 27263 topLeftOffset = viewHalf.multiplyBy(-scale).add(currentCenterPoint) 27264 .subtract(this._map._getNewPixelOrigin(center, zoom)); 27265 27266 if (Browser.any3d) { 27267 setTransform(this._container, topLeftOffset, scale); 27268 } else { 27269 setPosition(this._container, topLeftOffset); 27270 } 27271 }, 27272 27273 _reset: function () { 27274 this._update(); 27275 this._updateTransform(this._center, this._zoom); 27276 27277 for (var id in this._layers) { 27278 this._layers[id]._reset(); 27279 } 27280 }, 27281 27282 _onZoomEnd: function () { 27283 for (var id in this._layers) { 27284 this._layers[id]._project(); 27285 } 27286 }, 27287 27288 _updatePaths: function () { 27289 for (var id in this._layers) { 27290 this._layers[id]._update(); 27291 } 27292 }, 27293 27294 _update: function () { 27295 // Update pixel bounds of renderer container (for positioning/sizing/clipping later) 27296 // Subclasses are responsible of firing the 'update' event. 27297 var p = this.options.padding, 27298 size = this._map.getSize(), 27299 min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round(); 27300 27301 this._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round()); 27302 27303 this._center = this._map.getCenter(); 27304 this._zoom = this._map.getZoom(); 27305 } 27306 }); 27307 27308 /* 27309 * @class Canvas 27310 * @inherits Renderer 27311 * @aka L.Canvas 27312 * 27313 * Allows vector layers to be displayed with [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API). 27314 * Inherits `Renderer`. 27315 * 27316 * Due to [technical limitations](https://caniuse.com/canvas), Canvas is not 27317 * available in all web browsers, notably IE8, and overlapping geometries might 27318 * not display properly in some edge cases. 27319 * 27320 * @example 27321 * 27322 * Use Canvas by default for all paths in the map: 27323 * 27324 * ```js 27325 * var map = L.map('map', { 27326 * renderer: L.canvas() 27327 * }); 27328 * ``` 27329 * 27330 * Use a Canvas renderer with extra padding for specific vector geometries: 27331 * 27332 * ```js 27333 * var map = L.map('map'); 27334 * var myRenderer = L.canvas({ padding: 0.5 }); 27335 * var line = L.polyline( coordinates, { renderer: myRenderer } ); 27336 * var circle = L.circle( center, { renderer: myRenderer } ); 27337 * ``` 27338 */ 27339 27340 var Canvas = Renderer.extend({ 27341 27342 // @section 27343 // @aka Canvas options 27344 options: { 27345 // @option tolerance: Number = 0 27346 // How much to extend the click tolerance around a path/object on the map. 27347 tolerance: 0 27348 }, 27349 27350 getEvents: function () { 27351 var events = Renderer.prototype.getEvents.call(this); 27352 events.viewprereset = this._onViewPreReset; 27353 return events; 27354 }, 27355 27356 _onViewPreReset: function () { 27357 // Set a flag so that a viewprereset+moveend+viewreset only updates&redraws once 27358 this._postponeUpdatePaths = true; 27359 }, 27360 27361 onAdd: function () { 27362 Renderer.prototype.onAdd.call(this); 27363 27364 // Redraw vectors since canvas is cleared upon removal, 27365 // in case of removing the renderer itself from the map. 27366 this._draw(); 27367 }, 27368 27369 _initContainer: function () { 27370 var container = this._container = document.createElement('canvas'); 27371 27372 on(container, 'mousemove', this._onMouseMove, this); 27373 on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this); 27374 on(container, 'mouseout', this._handleMouseOut, this); 27375 container['_leaflet_disable_events'] = true; 27376 27377 this._ctx = container.getContext('2d'); 27378 }, 27379 27380 _destroyContainer: function () { 27381 cancelAnimFrame(this._redrawRequest); 27382 delete this._ctx; 27383 remove(this._container); 27384 off(this._container); 27385 delete this._container; 27386 }, 27387 27388 _updatePaths: function () { 27389 if (this._postponeUpdatePaths) { return; } 27390 27391 var layer; 27392 this._redrawBounds = null; 27393 for (var id in this._layers) { 27394 layer = this._layers[id]; 27395 layer._update(); 27396 } 27397 this._redraw(); 27398 }, 27399 27400 _update: function () { 27401 if (this._map._animatingZoom && this._bounds) { return; } 27402 27403 Renderer.prototype._update.call(this); 27404 27405 var b = this._bounds, 27406 container = this._container, 27407 size = b.getSize(), 27408 m = Browser.retina ? 2 : 1; 27409 27410 setPosition(container, b.min); 27411 27412 // set canvas size (also clearing it); use double size on retina 27413 container.width = m * size.x; 27414 container.height = m * size.y; 27415 container.style.width = size.x + 'px'; 27416 container.style.height = size.y + 'px'; 27417 27418 if (Browser.retina) { 27419 this._ctx.scale(2, 2); 27420 } 27421 27422 // translate so we use the same path coordinates after canvas element moves 27423 this._ctx.translate(-b.min.x, -b.min.y); 27424 27425 // Tell paths to redraw themselves 27426 this.fire('update'); 27427 }, 27428 27429 _reset: function () { 27430 Renderer.prototype._reset.call(this); 27431 27432 if (this._postponeUpdatePaths) { 27433 this._postponeUpdatePaths = false; 27434 this._updatePaths(); 27435 } 27436 }, 27437 27438 _initPath: function (layer) { 27439 this._updateDashArray(layer); 27440 this._layers[stamp(layer)] = layer; 27441 27442 var order = layer._order = { 27443 layer: layer, 27444 prev: this._drawLast, 27445 next: null 27446 }; 27447 if (this._drawLast) { this._drawLast.next = order; } 27448 this._drawLast = order; 27449 this._drawFirst = this._drawFirst || this._drawLast; 27450 }, 27451 27452 _addPath: function (layer) { 27453 this._requestRedraw(layer); 27454 }, 27455 27456 _removePath: function (layer) { 27457 var order = layer._order; 27458 var next = order.next; 27459 var prev = order.prev; 27460 27461 if (next) { 27462 next.prev = prev; 27463 } else { 27464 this._drawLast = prev; 27465 } 27466 if (prev) { 27467 prev.next = next; 27468 } else { 27469 this._drawFirst = next; 27470 } 27471 27472 delete layer._order; 27473 27474 delete this._layers[stamp(layer)]; 27475 27476 this._requestRedraw(layer); 27477 }, 27478 27479 _updatePath: function (layer) { 27480 // Redraw the union of the layer's old pixel 27481 // bounds and the new pixel bounds. 27482 this._extendRedrawBounds(layer); 27483 layer._project(); 27484 layer._update(); 27485 // The redraw will extend the redraw bounds 27486 // with the new pixel bounds. 27487 this._requestRedraw(layer); 27488 }, 27489 27490 _updateStyle: function (layer) { 27491 this._updateDashArray(layer); 27492 this._requestRedraw(layer); 27493 }, 27494 27495 _updateDashArray: function (layer) { 27496 if (typeof layer.options.dashArray === 'string') { 27497 var parts = layer.options.dashArray.split(/[, ]+/), 27498 dashArray = [], 27499 dashValue, 27500 i; 27501 for (i = 0; i < parts.length; i++) { 27502 dashValue = Number(parts[i]); 27503 // Ignore dash array containing invalid lengths 27504 if (isNaN(dashValue)) { return; } 27505 dashArray.push(dashValue); 27506 } 27507 layer.options._dashArray = dashArray; 27508 } else { 27509 layer.options._dashArray = layer.options.dashArray; 27510 } 27511 }, 27512 27513 _requestRedraw: function (layer) { 27514 if (!this._map) { return; } 27515 27516 this._extendRedrawBounds(layer); 27517 this._redrawRequest = this._redrawRequest || requestAnimFrame(this._redraw, this); 27518 }, 27519 27520 _extendRedrawBounds: function (layer) { 27521 if (layer._pxBounds) { 27522 var padding = (layer.options.weight || 0) + 1; 27523 this._redrawBounds = this._redrawBounds || new Bounds(); 27524 this._redrawBounds.extend(layer._pxBounds.min.subtract([padding, padding])); 27525 this._redrawBounds.extend(layer._pxBounds.max.add([padding, padding])); 27526 } 27527 }, 27528 27529 _redraw: function () { 27530 this._redrawRequest = null; 27531 27532 if (this._redrawBounds) { 27533 this._redrawBounds.min._floor(); 27534 this._redrawBounds.max._ceil(); 27535 } 27536 27537 this._clear(); // clear layers in redraw bounds 27538 this._draw(); // draw layers 27539 27540 this._redrawBounds = null; 27541 }, 27542 27543 _clear: function () { 27544 var bounds = this._redrawBounds; 27545 if (bounds) { 27546 var size = bounds.getSize(); 27547 this._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y); 27548 } else { 27549 this._ctx.save(); 27550 this._ctx.setTransform(1, 0, 0, 1, 0, 0); 27551 this._ctx.clearRect(0, 0, this._container.width, this._container.height); 27552 this._ctx.restore(); 27553 } 27554 }, 27555 27556 _draw: function () { 27557 var layer, bounds = this._redrawBounds; 27558 this._ctx.save(); 27559 if (bounds) { 27560 var size = bounds.getSize(); 27561 this._ctx.beginPath(); 27562 this._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y); 27563 this._ctx.clip(); 27564 } 27565 27566 this._drawing = true; 27567 27568 for (var order = this._drawFirst; order; order = order.next) { 27569 layer = order.layer; 27570 if (!bounds || (layer._pxBounds && layer._pxBounds.intersects(bounds))) { 27571 layer._updatePath(); 27572 } 27573 } 27574 27575 this._drawing = false; 27576 27577 this._ctx.restore(); // Restore state before clipping. 27578 }, 27579 27580 _updatePoly: function (layer, closed) { 27581 if (!this._drawing) { return; } 27582 27583 var i, j, len2, p, 27584 parts = layer._parts, 27585 len = parts.length, 27586 ctx = this._ctx; 27587 27588 if (!len) { return; } 27589 27590 ctx.beginPath(); 27591 27592 for (i = 0; i < len; i++) { 27593 for (j = 0, len2 = parts[i].length; j < len2; j++) { 27594 p = parts[i][j]; 27595 ctx[j ? 'lineTo' : 'moveTo'](p.x, p.y); 27596 } 27597 if (closed) { 27598 ctx.closePath(); 27599 } 27600 } 27601 27602 this._fillStroke(ctx, layer); 27603 27604 // TODO optimization: 1 fill/stroke for all features with equal style instead of 1 for each feature 27605 }, 27606 27607 _updateCircle: function (layer) { 27608 27609 if (!this._drawing || layer._empty()) { return; } 27610 27611 var p = layer._point, 27612 ctx = this._ctx, 27613 r = Math.max(Math.round(layer._radius), 1), 27614 s = (Math.max(Math.round(layer._radiusY), 1) || r) / r; 27615 27616 if (s !== 1) { 27617 ctx.save(); 27618 ctx.scale(1, s); 27619 } 27620 27621 ctx.beginPath(); 27622 ctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false); 27623 27624 if (s !== 1) { 27625 ctx.restore(); 27626 } 27627 27628 this._fillStroke(ctx, layer); 27629 }, 27630 27631 _fillStroke: function (ctx, layer) { 27632 var options = layer.options; 27633 27634 if (options.fill) { 27635 ctx.globalAlpha = options.fillOpacity; 27636 ctx.fillStyle = options.fillColor || options.color; 27637 ctx.fill(options.fillRule || 'evenodd'); 27638 } 27639 27640 if (options.stroke && options.weight !== 0) { 27641 if (ctx.setLineDash) { 27642 ctx.setLineDash(layer.options && layer.options._dashArray || []); 27643 } 27644 ctx.globalAlpha = options.opacity; 27645 ctx.lineWidth = options.weight; 27646 ctx.strokeStyle = options.color; 27647 ctx.lineCap = options.lineCap; 27648 ctx.lineJoin = options.lineJoin; 27649 ctx.stroke(); 27650 } 27651 }, 27652 27653 // Canvas obviously doesn't have mouse events for individual drawn objects, 27654 // so we emulate that by calculating what's under the mouse on mousemove/click manually 27655 27656 _onClick: function (e) { 27657 var point = this._map.mouseEventToLayerPoint(e), layer, clickedLayer; 27658 27659 for (var order = this._drawFirst; order; order = order.next) { 27660 layer = order.layer; 27661 if (layer.options.interactive && layer._containsPoint(point)) { 27662 if (!(e.type === 'click' || e.type === 'preclick') || !this._map._draggableMoved(layer)) { 27663 clickedLayer = layer; 27664 } 27665 } 27666 } 27667 this._fireEvent(clickedLayer ? [clickedLayer] : false, e); 27668 }, 27669 27670 _onMouseMove: function (e) { 27671 if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; } 27672 27673 var point = this._map.mouseEventToLayerPoint(e); 27674 this._handleMouseHover(e, point); 27675 }, 27676 27677 27678 _handleMouseOut: function (e) { 27679 var layer = this._hoveredLayer; 27680 if (layer) { 27681 // if we're leaving the layer, fire mouseout 27682 removeClass(this._container, 'leaflet-interactive'); 27683 this._fireEvent([layer], e, 'mouseout'); 27684 this._hoveredLayer = null; 27685 this._mouseHoverThrottled = false; 27686 } 27687 }, 27688 27689 _handleMouseHover: function (e, point) { 27690 if (this._mouseHoverThrottled) { 27691 return; 27692 } 27693 27694 var layer, candidateHoveredLayer; 27695 27696 for (var order = this._drawFirst; order; order = order.next) { 27697 layer = order.layer; 27698 if (layer.options.interactive && layer._containsPoint(point)) { 27699 candidateHoveredLayer = layer; 27700 } 27701 } 27702 27703 if (candidateHoveredLayer !== this._hoveredLayer) { 27704 this._handleMouseOut(e); 27705 27706 if (candidateHoveredLayer) { 27707 addClass(this._container, 'leaflet-interactive'); // change cursor 27708 this._fireEvent([candidateHoveredLayer], e, 'mouseover'); 27709 this._hoveredLayer = candidateHoveredLayer; 27710 } 27711 } 27712 27713 this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e); 27714 27715 this._mouseHoverThrottled = true; 27716 setTimeout(bind(function () { 27717 this._mouseHoverThrottled = false; 27718 }, this), 32); 27719 }, 27720 27721 _fireEvent: function (layers, e, type) { 27722 this._map._fireDOMEvent(e, type || e.type, layers); 27723 }, 27724 27725 _bringToFront: function (layer) { 27726 var order = layer._order; 27727 27728 if (!order) { return; } 27729 27730 var next = order.next; 27731 var prev = order.prev; 27732 27733 if (next) { 27734 next.prev = prev; 27735 } else { 27736 // Already last 27737 return; 27738 } 27739 if (prev) { 27740 prev.next = next; 27741 } else if (next) { 27742 // Update first entry unless this is the 27743 // single entry 27744 this._drawFirst = next; 27745 } 27746 27747 order.prev = this._drawLast; 27748 this._drawLast.next = order; 27749 27750 order.next = null; 27751 this._drawLast = order; 27752 27753 this._requestRedraw(layer); 27754 }, 27755 27756 _bringToBack: function (layer) { 27757 var order = layer._order; 27758 27759 if (!order) { return; } 27760 27761 var next = order.next; 27762 var prev = order.prev; 27763 27764 if (prev) { 27765 prev.next = next; 27766 } else { 27767 // Already first 27768 return; 27769 } 27770 if (next) { 27771 next.prev = prev; 27772 } else if (prev) { 27773 // Update last entry unless this is the 27774 // single entry 27775 this._drawLast = prev; 27776 } 27777 27778 order.prev = null; 27779 27780 order.next = this._drawFirst; 27781 this._drawFirst.prev = order; 27782 this._drawFirst = order; 27783 27784 this._requestRedraw(layer); 27785 } 27786 }); 27787 27788 // @factory L.canvas(options?: Renderer options) 27789 // Creates a Canvas renderer with the given options. 27790 function canvas(options) { 27791 return Browser.canvas ? new Canvas(options) : null; 27792 } 27793 27794 /* 27795 * Thanks to Dmitry Baranovsky and his Raphael library for inspiration! 27796 */ 27797 27798 27799 var vmlCreate = (function () { 27800 try { 27801 document.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml'); 27802 return function (name) { 27803 return document.createElement('<lvml:' + name + ' class="lvml">'); 27804 }; 27805 } catch (e) { 27806 // Do not return fn from catch block so `e` can be garbage collected 27807 // See https://github.com/Leaflet/Leaflet/pull/7279 27808 } 27809 return function (name) { 27810 return document.createElement('<' + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">'); 27811 }; 27812 })(); 27813 27814 27815 /* 27816 * @class SVG 27817 * 27818 * 27819 * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility 27820 * with old versions of Internet Explorer. 27821 */ 27822 27823 // mixin to redefine some SVG methods to handle VML syntax which is similar but with some differences 27824 var vmlMixin = { 27825 27826 _initContainer: function () { 27827 this._container = create$1('div', 'leaflet-vml-container'); 27828 }, 27829 27830 _update: function () { 27831 if (this._map._animatingZoom) { return; } 27832 Renderer.prototype._update.call(this); 27833 this.fire('update'); 27834 }, 27835 27836 _initPath: function (layer) { 27837 var container = layer._container = vmlCreate('shape'); 27838 27839 addClass(container, 'leaflet-vml-shape ' + (this.options.className || '')); 27840 27841 container.coordsize = '1 1'; 27842 27843 layer._path = vmlCreate('path'); 27844 container.appendChild(layer._path); 27845 27846 this._updateStyle(layer); 27847 this._layers[stamp(layer)] = layer; 27848 }, 27849 27850 _addPath: function (layer) { 27851 var container = layer._container; 27852 this._container.appendChild(container); 27853 27854 if (layer.options.interactive) { 27855 layer.addInteractiveTarget(container); 27856 } 27857 }, 27858 27859 _removePath: function (layer) { 27860 var container = layer._container; 27861 remove(container); 27862 layer.removeInteractiveTarget(container); 27863 delete this._layers[stamp(layer)]; 27864 }, 27865 27866 _updateStyle: function (layer) { 27867 var stroke = layer._stroke, 27868 fill = layer._fill, 27869 options = layer.options, 27870 container = layer._container; 27871 27872 container.stroked = !!options.stroke; 27873 container.filled = !!options.fill; 27874 27875 if (options.stroke) { 27876 if (!stroke) { 27877 stroke = layer._stroke = vmlCreate('stroke'); 27878 } 27879 container.appendChild(stroke); 27880 stroke.weight = options.weight + 'px'; 27881 stroke.color = options.color; 27882 stroke.opacity = options.opacity; 27883 27884 if (options.dashArray) { 27885 stroke.dashStyle = isArray(options.dashArray) ? 27886 options.dashArray.join(' ') : 27887 options.dashArray.replace(/( *, *)/g, ' '); 27888 } else { 27889 stroke.dashStyle = ''; 27890 } 27891 stroke.endcap = options.lineCap.replace('butt', 'flat'); 27892 stroke.joinstyle = options.lineJoin; 27893 27894 } else if (stroke) { 27895 container.removeChild(stroke); 27896 layer._stroke = null; 27897 } 27898 27899 if (options.fill) { 27900 if (!fill) { 27901 fill = layer._fill = vmlCreate('fill'); 27902 } 27903 container.appendChild(fill); 27904 fill.color = options.fillColor || options.color; 27905 fill.opacity = options.fillOpacity; 27906 27907 } else if (fill) { 27908 container.removeChild(fill); 27909 layer._fill = null; 27910 } 27911 }, 27912 27913 _updateCircle: function (layer) { 27914 var p = layer._point.round(), 27915 r = Math.round(layer._radius), 27916 r2 = Math.round(layer._radiusY || r); 27917 27918 this._setPath(layer, layer._empty() ? 'M0 0' : 27919 'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360)); 27920 }, 27921 27922 _setPath: function (layer, path) { 27923 layer._path.v = path; 27924 }, 27925 27926 _bringToFront: function (layer) { 27927 toFront(layer._container); 27928 }, 27929 27930 _bringToBack: function (layer) { 27931 toBack(layer._container); 27932 } 27933 }; 27934 27935 var create = Browser.vml ? vmlCreate : svgCreate; 27936 27937 /* 27938 * @class SVG 27939 * @inherits Renderer 27940 * @aka L.SVG 27941 * 27942 * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG). 27943 * Inherits `Renderer`. 27944 * 27945 * Due to [technical limitations](https://caniuse.com/svg), SVG is not 27946 * available in all web browsers, notably Android 2.x and 3.x. 27947 * 27948 * Although SVG is not available on IE7 and IE8, these browsers support 27949 * [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language) 27950 * (a now deprecated technology), and the SVG renderer will fall back to VML in 27951 * this case. 27952 * 27953 * @example 27954 * 27955 * Use SVG by default for all paths in the map: 27956 * 27957 * ```js 27958 * var map = L.map('map', { 27959 * renderer: L.svg() 27960 * }); 27961 * ``` 27962 * 27963 * Use a SVG renderer with extra padding for specific vector geometries: 27964 * 27965 * ```js 27966 * var map = L.map('map'); 27967 * var myRenderer = L.svg({ padding: 0.5 }); 27968 * var line = L.polyline( coordinates, { renderer: myRenderer } ); 27969 * var circle = L.circle( center, { renderer: myRenderer } ); 27970 * ``` 27971 */ 27972 27973 var SVG = Renderer.extend({ 27974 27975 _initContainer: function () { 27976 this._container = create('svg'); 27977 27978 // makes it possible to click through svg root; we'll reset it back in individual paths 27979 this._container.setAttribute('pointer-events', 'none'); 27980 27981 this._rootGroup = create('g'); 27982 this._container.appendChild(this._rootGroup); 27983 }, 27984 27985 _destroyContainer: function () { 27986 remove(this._container); 27987 off(this._container); 27988 delete this._container; 27989 delete this._rootGroup; 27990 delete this._svgSize; 27991 }, 27992 27993 _update: function () { 27994 if (this._map._animatingZoom && this._bounds) { return; } 27995 27996 Renderer.prototype._update.call(this); 27997 27998 var b = this._bounds, 27999 size = b.getSize(), 28000 container = this._container; 28001 28002 // set size of svg-container if changed 28003 if (!this._svgSize || !this._svgSize.equals(size)) { 28004 this._svgSize = size; 28005 container.setAttribute('width', size.x); 28006 container.setAttribute('height', size.y); 28007 } 28008 28009 // movement: update container viewBox so that we don't have to change coordinates of individual layers 28010 setPosition(container, b.min); 28011 container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' ')); 28012 28013 this.fire('update'); 28014 }, 28015 28016 // methods below are called by vector layers implementations 28017 28018 _initPath: function (layer) { 28019 var path = layer._path = create('path'); 28020 28021 // @namespace Path 28022 // @option className: String = null 28023 // Custom class name set on an element. Only for SVG renderer. 28024 if (layer.options.className) { 28025 addClass(path, layer.options.className); 28026 } 28027 28028 if (layer.options.interactive) { 28029 addClass(path, 'leaflet-interactive'); 28030 } 28031 28032 this._updateStyle(layer); 28033 this._layers[stamp(layer)] = layer; 28034 }, 28035 28036 _addPath: function (layer) { 28037 if (!this._rootGroup) { this._initContainer(); } 28038 this._rootGroup.appendChild(layer._path); 28039 layer.addInteractiveTarget(layer._path); 28040 }, 28041 28042 _removePath: function (layer) { 28043 remove(layer._path); 28044 layer.removeInteractiveTarget(layer._path); 28045 delete this._layers[stamp(layer)]; 28046 }, 28047 28048 _updatePath: function (layer) { 28049 layer._project(); 28050 layer._update(); 28051 }, 28052 28053 _updateStyle: function (layer) { 28054 var path = layer._path, 28055 options = layer.options; 28056 28057 if (!path) { return; } 28058 28059 if (options.stroke) { 28060 path.setAttribute('stroke', options.color); 28061 path.setAttribute('stroke-opacity', options.opacity); 28062 path.setAttribute('stroke-width', options.weight); 28063 path.setAttribute('stroke-linecap', options.lineCap); 28064 path.setAttribute('stroke-linejoin', options.lineJoin); 28065 28066 if (options.dashArray) { 28067 path.setAttribute('stroke-dasharray', options.dashArray); 28068 } else { 28069 path.removeAttribute('stroke-dasharray'); 28070 } 28071 28072 if (options.dashOffset) { 28073 path.setAttribute('stroke-dashoffset', options.dashOffset); 28074 } else { 28075 path.removeAttribute('stroke-dashoffset'); 28076 } 28077 } else { 28078 path.setAttribute('stroke', 'none'); 28079 } 28080 28081 if (options.fill) { 28082 path.setAttribute('fill', options.fillColor || options.color); 28083 path.setAttribute('fill-opacity', options.fillOpacity); 28084 path.setAttribute('fill-rule', options.fillRule || 'evenodd'); 28085 } else { 28086 path.setAttribute('fill', 'none'); 28087 } 28088 }, 28089 28090 _updatePoly: function (layer, closed) { 28091 this._setPath(layer, pointsToPath(layer._parts, closed)); 28092 }, 28093 28094 _updateCircle: function (layer) { 28095 var p = layer._point, 28096 r = Math.max(Math.round(layer._radius), 1), 28097 r2 = Math.max(Math.round(layer._radiusY), 1) || r, 28098 arc = 'a' + r + ',' + r2 + ' 0 1,0 '; 28099 28100 // drawing a circle with two half-arcs 28101 var d = layer._empty() ? 'M0 0' : 28102 'M' + (p.x - r) + ',' + p.y + 28103 arc + (r * 2) + ',0 ' + 28104 arc + (-r * 2) + ',0 '; 28105 28106 this._setPath(layer, d); 28107 }, 28108 28109 _setPath: function (layer, path) { 28110 layer._path.setAttribute('d', path); 28111 }, 28112 28113 // SVG does not have the concept of zIndex so we resort to changing the DOM order of elements 28114 _bringToFront: function (layer) { 28115 toFront(layer._path); 28116 }, 28117 28118 _bringToBack: function (layer) { 28119 toBack(layer._path); 28120 } 28121 }); 28122 28123 if (Browser.vml) { 28124 SVG.include(vmlMixin); 28125 } 28126 28127 // @namespace SVG 28128 // @factory L.svg(options?: Renderer options) 28129 // Creates a SVG renderer with the given options. 28130 function svg(options) { 28131 return Browser.svg || Browser.vml ? new SVG(options) : null; 28132 } 28133 28134 Map.include({ 28135 // @namespace Map; @method getRenderer(layer: Path): Renderer 28136 // Returns the instance of `Renderer` that should be used to render the given 28137 // `Path`. It will ensure that the `renderer` options of the map and paths 28138 // are respected, and that the renderers do exist on the map. 28139 getRenderer: function (layer) { 28140 // @namespace Path; @option renderer: Renderer 28141 // Use this specific instance of `Renderer` for this path. Takes 28142 // precedence over the map's [default renderer](#map-renderer). 28143 var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer; 28144 28145 if (!renderer) { 28146 renderer = this._renderer = this._createRenderer(); 28147 } 28148 28149 if (!this.hasLayer(renderer)) { 28150 this.addLayer(renderer); 28151 } 28152 return renderer; 28153 }, 28154 28155 _getPaneRenderer: function (name) { 28156 if (name === 'overlayPane' || name === undefined) { 28157 return false; 28158 } 28159 28160 var renderer = this._paneRenderers[name]; 28161 if (renderer === undefined) { 28162 renderer = this._createRenderer({pane: name}); 28163 this._paneRenderers[name] = renderer; 28164 } 28165 return renderer; 28166 }, 28167 28168 _createRenderer: function (options) { 28169 // @namespace Map; @option preferCanvas: Boolean = false 28170 // Whether `Path`s should be rendered on a `Canvas` renderer. 28171 // By default, all `Path`s are rendered in a `SVG` renderer. 28172 return (this.options.preferCanvas && canvas(options)) || svg(options); 28173 } 28174 }); 28175 28176 /* 28177 * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object. 28178 */ 28179 28180 /* 28181 * @class Rectangle 28182 * @aka L.Rectangle 28183 * @inherits Polygon 28184 * 28185 * A class for drawing rectangle overlays on a map. Extends `Polygon`. 28186 * 28187 * @example 28188 * 28189 * ```js 28190 * // define rectangle geographical bounds 28191 * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]]; 28192 * 28193 * // create an orange rectangle 28194 * L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map); 28195 * 28196 * // zoom the map to the rectangle bounds 28197 * map.fitBounds(bounds); 28198 * ``` 28199 * 28200 */ 28201 28202 28203 var Rectangle = Polygon.extend({ 28204 initialize: function (latLngBounds, options) { 28205 Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options); 28206 }, 28207 28208 // @method setBounds(latLngBounds: LatLngBounds): this 28209 // Redraws the rectangle with the passed bounds. 28210 setBounds: function (latLngBounds) { 28211 return this.setLatLngs(this._boundsToLatLngs(latLngBounds)); 28212 }, 28213 28214 _boundsToLatLngs: function (latLngBounds) { 28215 latLngBounds = toLatLngBounds(latLngBounds); 28216 return [ 28217 latLngBounds.getSouthWest(), 28218 latLngBounds.getNorthWest(), 28219 latLngBounds.getNorthEast(), 28220 latLngBounds.getSouthEast() 28221 ]; 28222 } 28223 }); 28224 28225 28226 // @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options) 28227 function rectangle(latLngBounds, options) { 28228 return new Rectangle(latLngBounds, options); 28229 } 28230 28231 SVG.create = create; 28232 SVG.pointsToPath = pointsToPath; 28233 28234 GeoJSON.geometryToLayer = geometryToLayer; 28235 GeoJSON.coordsToLatLng = coordsToLatLng; 28236 GeoJSON.coordsToLatLngs = coordsToLatLngs; 28237 GeoJSON.latLngToCoords = latLngToCoords; 28238 GeoJSON.latLngsToCoords = latLngsToCoords; 28239 GeoJSON.getFeature = getFeature; 28240 GeoJSON.asFeature = asFeature; 28241 28242 /* 28243 * L.Handler.BoxZoom is used to add shift-drag zoom interaction to the map 28244 * (zoom to a selected bounding box), enabled by default. 28245 */ 28246 28247 // @namespace Map 28248 // @section Interaction Options 28249 Map.mergeOptions({ 28250 // @option boxZoom: Boolean = true 28251 // Whether the map can be zoomed to a rectangular area specified by 28252 // dragging the mouse while pressing the shift key. 28253 boxZoom: true 28254 }); 28255 28256 var BoxZoom = Handler.extend({ 28257 initialize: function (map) { 28258 this._map = map; 28259 this._container = map._container; 28260 this._pane = map._panes.overlayPane; 28261 this._resetStateTimeout = 0; 28262 map.on('unload', this._destroy, this); 28263 }, 28264 28265 addHooks: function () { 28266 on(this._container, 'mousedown', this._onMouseDown, this); 28267 }, 28268 28269 removeHooks: function () { 28270 off(this._container, 'mousedown', this._onMouseDown, this); 28271 }, 28272 28273 moved: function () { 28274 return this._moved; 28275 }, 28276 28277 _destroy: function () { 28278 remove(this._pane); 28279 delete this._pane; 28280 }, 28281 28282 _resetState: function () { 28283 this._resetStateTimeout = 0; 28284 this._moved = false; 28285 }, 28286 28287 _clearDeferredResetState: function () { 28288 if (this._resetStateTimeout !== 0) { 28289 clearTimeout(this._resetStateTimeout); 28290 this._resetStateTimeout = 0; 28291 } 28292 }, 28293 28294 _onMouseDown: function (e) { 28295 if (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; } 28296 28297 // Clear the deferred resetState if it hasn't executed yet, otherwise it 28298 // will interrupt the interaction and orphan a box element in the container. 28299 this._clearDeferredResetState(); 28300 this._resetState(); 28301 28302 disableTextSelection(); 28303 disableImageDrag(); 28304 28305 this._startPoint = this._map.mouseEventToContainerPoint(e); 28306 28307 on(document, { 28308 contextmenu: stop, 28309 mousemove: this._onMouseMove, 28310 mouseup: this._onMouseUp, 28311 keydown: this._onKeyDown 28312 }, this); 28313 }, 28314 28315 _onMouseMove: function (e) { 28316 if (!this._moved) { 28317 this._moved = true; 28318 28319 this._box = create$1('div', 'leaflet-zoom-box', this._container); 28320 addClass(this._container, 'leaflet-crosshair'); 28321 28322 this._map.fire('boxzoomstart'); 28323 } 28324 28325 this._point = this._map.mouseEventToContainerPoint(e); 28326 28327 var bounds = new Bounds(this._point, this._startPoint), 28328 size = bounds.getSize(); 28329 28330 setPosition(this._box, bounds.min); 28331 28332 this._box.style.width = size.x + 'px'; 28333 this._box.style.height = size.y + 'px'; 28334 }, 28335 28336 _finish: function () { 28337 if (this._moved) { 28338 remove(this._box); 28339 removeClass(this._container, 'leaflet-crosshair'); 28340 } 28341 28342 enableTextSelection(); 28343 enableImageDrag(); 28344 28345 off(document, { 28346 contextmenu: stop, 28347 mousemove: this._onMouseMove, 28348 mouseup: this._onMouseUp, 28349 keydown: this._onKeyDown 28350 }, this); 28351 }, 28352 28353 _onMouseUp: function (e) { 28354 if ((e.which !== 1) && (e.button !== 1)) { return; } 28355 28356 this._finish(); 28357 28358 if (!this._moved) { return; } 28359 // Postpone to next JS tick so internal click event handling 28360 // still see it as "moved". 28361 this._clearDeferredResetState(); 28362 this._resetStateTimeout = setTimeout(bind(this._resetState, this), 0); 28363 28364 var bounds = new LatLngBounds( 28365 this._map.containerPointToLatLng(this._startPoint), 28366 this._map.containerPointToLatLng(this._point)); 28367 28368 this._map 28369 .fitBounds(bounds) 28370 .fire('boxzoomend', {boxZoomBounds: bounds}); 28371 }, 28372 28373 _onKeyDown: function (e) { 28374 if (e.keyCode === 27) { 28375 this._finish(); 28376 this._clearDeferredResetState(); 28377 this._resetState(); 28378 } 28379 } 28380 }); 28381 28382 // @section Handlers 28383 // @property boxZoom: Handler 28384 // Box (shift-drag with mouse) zoom handler. 28385 Map.addInitHook('addHandler', 'boxZoom', BoxZoom); 28386 28387 /* 28388 * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default. 28389 */ 28390 28391 // @namespace Map 28392 // @section Interaction Options 28393 28394 Map.mergeOptions({ 28395 // @option doubleClickZoom: Boolean|String = true 28396 // Whether the map can be zoomed in by double clicking on it and 28397 // zoomed out by double clicking while holding shift. If passed 28398 // `'center'`, double-click zoom will zoom to the center of the 28399 // view regardless of where the mouse was. 28400 doubleClickZoom: true 28401 }); 28402 28403 var DoubleClickZoom = Handler.extend({ 28404 addHooks: function () { 28405 this._map.on('dblclick', this._onDoubleClick, this); 28406 }, 28407 28408 removeHooks: function () { 28409 this._map.off('dblclick', this._onDoubleClick, this); 28410 }, 28411 28412 _onDoubleClick: function (e) { 28413 var map = this._map, 28414 oldZoom = map.getZoom(), 28415 delta = map.options.zoomDelta, 28416 zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta; 28417 28418 if (map.options.doubleClickZoom === 'center') { 28419 map.setZoom(zoom); 28420 } else { 28421 map.setZoomAround(e.containerPoint, zoom); 28422 } 28423 } 28424 }); 28425 28426 // @section Handlers 28427 // 28428 // Map properties include interaction handlers that allow you to control 28429 // interaction behavior in runtime, enabling or disabling certain features such 28430 // as dragging or touch zoom (see `Handler` methods). For example: 28431 // 28432 // ```js 28433 // map.doubleClickZoom.disable(); 28434 // ``` 28435 // 28436 // @property doubleClickZoom: Handler 28437 // Double click zoom handler. 28438 Map.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom); 28439 28440 /* 28441 * L.Handler.MapDrag is used to make the map draggable (with panning inertia), enabled by default. 28442 */ 28443 28444 // @namespace Map 28445 // @section Interaction Options 28446 Map.mergeOptions({ 28447 // @option dragging: Boolean = true 28448 // Whether the map is draggable with mouse/touch or not. 28449 dragging: true, 28450 28451 // @section Panning Inertia Options 28452 // @option inertia: Boolean = * 28453 // If enabled, panning of the map will have an inertia effect where 28454 // the map builds momentum while dragging and continues moving in 28455 // the same direction for some time. Feels especially nice on touch 28456 // devices. Enabled by default. 28457 inertia: true, 28458 28459 // @option inertiaDeceleration: Number = 3000 28460 // The rate with which the inertial movement slows down, in pixels/second². 28461 inertiaDeceleration: 3400, // px/s^2 28462 28463 // @option inertiaMaxSpeed: Number = Infinity 28464 // Max speed of the inertial movement, in pixels/second. 28465 inertiaMaxSpeed: Infinity, // px/s 28466 28467 // @option easeLinearity: Number = 0.2 28468 easeLinearity: 0.2, 28469 28470 // TODO refactor, move to CRS 28471 // @option worldCopyJump: Boolean = false 28472 // With this option enabled, the map tracks when you pan to another "copy" 28473 // of the world and seamlessly jumps to the original one so that all overlays 28474 // like markers and vector layers are still visible. 28475 worldCopyJump: false, 28476 28477 // @option maxBoundsViscosity: Number = 0.0 28478 // If `maxBounds` is set, this option will control how solid the bounds 28479 // are when dragging the map around. The default value of `0.0` allows the 28480 // user to drag outside the bounds at normal speed, higher values will 28481 // slow down map dragging outside bounds, and `1.0` makes the bounds fully 28482 // solid, preventing the user from dragging outside the bounds. 28483 maxBoundsViscosity: 0.0 28484 }); 28485 28486 var Drag = Handler.extend({ 28487 addHooks: function () { 28488 if (!this._draggable) { 28489 var map = this._map; 28490 28491 this._draggable = new Draggable(map._mapPane, map._container); 28492 28493 this._draggable.on({ 28494 dragstart: this._onDragStart, 28495 drag: this._onDrag, 28496 dragend: this._onDragEnd 28497 }, this); 28498 28499 this._draggable.on('predrag', this._onPreDragLimit, this); 28500 if (map.options.worldCopyJump) { 28501 this._draggable.on('predrag', this._onPreDragWrap, this); 28502 map.on('zoomend', this._onZoomEnd, this); 28503 28504 map.whenReady(this._onZoomEnd, this); 28505 } 28506 } 28507 addClass(this._map._container, 'leaflet-grab leaflet-touch-drag'); 28508 this._draggable.enable(); 28509 this._positions = []; 28510 this._times = []; 28511 }, 28512 28513 removeHooks: function () { 28514 removeClass(this._map._container, 'leaflet-grab'); 28515 removeClass(this._map._container, 'leaflet-touch-drag'); 28516 this._draggable.disable(); 28517 }, 28518 28519 moved: function () { 28520 return this._draggable && this._draggable._moved; 28521 }, 28522 28523 moving: function () { 28524 return this._draggable && this._draggable._moving; 28525 }, 28526 28527 _onDragStart: function () { 28528 var map = this._map; 28529 28530 map._stop(); 28531 if (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) { 28532 var bounds = toLatLngBounds(this._map.options.maxBounds); 28533 28534 this._offsetLimit = toBounds( 28535 this._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1), 28536 this._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1) 28537 .add(this._map.getSize())); 28538 28539 this._viscosity = Math.min(1.0, Math.max(0.0, this._map.options.maxBoundsViscosity)); 28540 } else { 28541 this._offsetLimit = null; 28542 } 28543 28544 map 28545 .fire('movestart') 28546 .fire('dragstart'); 28547 28548 if (map.options.inertia) { 28549 this._positions = []; 28550 this._times = []; 28551 } 28552 }, 28553 28554 _onDrag: function (e) { 28555 if (this._map.options.inertia) { 28556 var time = this._lastTime = +new Date(), 28557 pos = this._lastPos = this._draggable._absPos || this._draggable._newPos; 28558 28559 this._positions.push(pos); 28560 this._times.push(time); 28561 28562 this._prunePositions(time); 28563 } 28564 28565 this._map 28566 .fire('move', e) 28567 .fire('drag', e); 28568 }, 28569 28570 _prunePositions: function (time) { 28571 while (this._positions.length > 1 && time - this._times[0] > 50) { 28572 this._positions.shift(); 28573 this._times.shift(); 28574 } 28575 }, 28576 28577 _onZoomEnd: function () { 28578 var pxCenter = this._map.getSize().divideBy(2), 28579 pxWorldCenter = this._map.latLngToLayerPoint([0, 0]); 28580 28581 this._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x; 28582 this._worldWidth = this._map.getPixelWorldBounds().getSize().x; 28583 }, 28584 28585 _viscousLimit: function (value, threshold) { 28586 return value - (value - threshold) * this._viscosity; 28587 }, 28588 28589 _onPreDragLimit: function () { 28590 if (!this._viscosity || !this._offsetLimit) { return; } 28591 28592 var offset = this._draggable._newPos.subtract(this._draggable._startPos); 28593 28594 var limit = this._offsetLimit; 28595 if (offset.x < limit.min.x) { offset.x = this._viscousLimit(offset.x, limit.min.x); } 28596 if (offset.y < limit.min.y) { offset.y = this._viscousLimit(offset.y, limit.min.y); } 28597 if (offset.x > limit.max.x) { offset.x = this._viscousLimit(offset.x, limit.max.x); } 28598 if (offset.y > limit.max.y) { offset.y = this._viscousLimit(offset.y, limit.max.y); } 28599 28600 this._draggable._newPos = this._draggable._startPos.add(offset); 28601 }, 28602 28603 _onPreDragWrap: function () { 28604 // TODO refactor to be able to adjust map pane position after zoom 28605 var worldWidth = this._worldWidth, 28606 halfWidth = Math.round(worldWidth / 2), 28607 dx = this._initialWorldOffset, 28608 x = this._draggable._newPos.x, 28609 newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx, 28610 newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx, 28611 newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2; 28612 28613 this._draggable._absPos = this._draggable._newPos.clone(); 28614 this._draggable._newPos.x = newX; 28615 }, 28616 28617 _onDragEnd: function (e) { 28618 var map = this._map, 28619 options = map.options, 28620 28621 noInertia = !options.inertia || e.noInertia || this._times.length < 2; 28622 28623 map.fire('dragend', e); 28624 28625 if (noInertia) { 28626 map.fire('moveend'); 28627 28628 } else { 28629 this._prunePositions(+new Date()); 28630 28631 var direction = this._lastPos.subtract(this._positions[0]), 28632 duration = (this._lastTime - this._times[0]) / 1000, 28633 ease = options.easeLinearity, 28634 28635 speedVector = direction.multiplyBy(ease / duration), 28636 speed = speedVector.distanceTo([0, 0]), 28637 28638 limitedSpeed = Math.min(options.inertiaMaxSpeed, speed), 28639 limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed), 28640 28641 decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease), 28642 offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); 28643 28644 if (!offset.x && !offset.y) { 28645 map.fire('moveend'); 28646 28647 } else { 28648 offset = map._limitOffset(offset, map.options.maxBounds); 28649 28650 requestAnimFrame(function () { 28651 map.panBy(offset, { 28652 duration: decelerationDuration, 28653 easeLinearity: ease, 28654 noMoveStart: true, 28655 animate: true 28656 }); 28657 }); 28658 } 28659 } 28660 } 28661 }); 28662 28663 // @section Handlers 28664 // @property dragging: Handler 28665 // Map dragging handler (by both mouse and touch). 28666 Map.addInitHook('addHandler', 'dragging', Drag); 28667 28668 /* 28669 * L.Map.Keyboard is handling keyboard interaction with the map, enabled by default. 28670 */ 28671 28672 // @namespace Map 28673 // @section Keyboard Navigation Options 28674 Map.mergeOptions({ 28675 // @option keyboard: Boolean = true 28676 // Makes the map focusable and allows users to navigate the map with keyboard 28677 // arrows and `+`/`-` keys. 28678 keyboard: true, 28679 28680 // @option keyboardPanDelta: Number = 80 28681 // Amount of pixels to pan when pressing an arrow key. 28682 keyboardPanDelta: 80 28683 }); 28684 28685 var Keyboard = Handler.extend({ 28686 28687 keyCodes: { 28688 left: [37], 28689 right: [39], 28690 down: [40], 28691 up: [38], 28692 zoomIn: [187, 107, 61, 171], 28693 zoomOut: [189, 109, 54, 173] 28694 }, 28695 28696 initialize: function (map) { 28697 this._map = map; 28698 28699 this._setPanDelta(map.options.keyboardPanDelta); 28700 this._setZoomDelta(map.options.zoomDelta); 28701 }, 28702 28703 addHooks: function () { 28704 var container = this._map._container; 28705 28706 // make the container focusable by tabbing 28707 if (container.tabIndex <= 0) { 28708 container.tabIndex = '0'; 28709 } 28710 28711 on(container, { 28712 focus: this._onFocus, 28713 blur: this._onBlur, 28714 mousedown: this._onMouseDown 28715 }, this); 28716 28717 this._map.on({ 28718 focus: this._addHooks, 28719 blur: this._removeHooks 28720 }, this); 28721 }, 28722 28723 removeHooks: function () { 28724 this._removeHooks(); 28725 28726 off(this._map._container, { 28727 focus: this._onFocus, 28728 blur: this._onBlur, 28729 mousedown: this._onMouseDown 28730 }, this); 28731 28732 this._map.off({ 28733 focus: this._addHooks, 28734 blur: this._removeHooks 28735 }, this); 28736 }, 28737 28738 _onMouseDown: function () { 28739 if (this._focused) { return; } 28740 28741 var body = document.body, 28742 docEl = document.documentElement, 28743 top = body.scrollTop || docEl.scrollTop, 28744 left = body.scrollLeft || docEl.scrollLeft; 28745 28746 this._map._container.focus(); 28747 28748 window.scrollTo(left, top); 28749 }, 28750 28751 _onFocus: function () { 28752 this._focused = true; 28753 this._map.fire('focus'); 28754 }, 28755 28756 _onBlur: function () { 28757 this._focused = false; 28758 this._map.fire('blur'); 28759 }, 28760 28761 _setPanDelta: function (panDelta) { 28762 var keys = this._panKeys = {}, 28763 codes = this.keyCodes, 28764 i, len; 28765 28766 for (i = 0, len = codes.left.length; i < len; i++) { 28767 keys[codes.left[i]] = [-1 * panDelta, 0]; 28768 } 28769 for (i = 0, len = codes.right.length; i < len; i++) { 28770 keys[codes.right[i]] = [panDelta, 0]; 28771 } 28772 for (i = 0, len = codes.down.length; i < len; i++) { 28773 keys[codes.down[i]] = [0, panDelta]; 28774 } 28775 for (i = 0, len = codes.up.length; i < len; i++) { 28776 keys[codes.up[i]] = [0, -1 * panDelta]; 28777 } 28778 }, 28779 28780 _setZoomDelta: function (zoomDelta) { 28781 var keys = this._zoomKeys = {}, 28782 codes = this.keyCodes, 28783 i, len; 28784 28785 for (i = 0, len = codes.zoomIn.length; i < len; i++) { 28786 keys[codes.zoomIn[i]] = zoomDelta; 28787 } 28788 for (i = 0, len = codes.zoomOut.length; i < len; i++) { 28789 keys[codes.zoomOut[i]] = -zoomDelta; 28790 } 28791 }, 28792 28793 _addHooks: function () { 28794 on(document, 'keydown', this._onKeyDown, this); 28795 }, 28796 28797 _removeHooks: function () { 28798 off(document, 'keydown', this._onKeyDown, this); 28799 }, 28800 28801 _onKeyDown: function (e) { 28802 if (e.altKey || e.ctrlKey || e.metaKey) { return; } 28803 28804 var key = e.keyCode, 28805 map = this._map, 28806 offset; 28807 28808 if (key in this._panKeys) { 28809 if (!map._panAnim || !map._panAnim._inProgress) { 28810 offset = this._panKeys[key]; 28811 if (e.shiftKey) { 28812 offset = toPoint(offset).multiplyBy(3); 28813 } 28814 28815 if (map.options.maxBounds) { 28816 offset = map._limitOffset(toPoint(offset), map.options.maxBounds); 28817 } 28818 28819 if (map.options.worldCopyJump) { 28820 var newLatLng = map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset))); 28821 map.panTo(newLatLng); 28822 } else { 28823 map.panBy(offset); 28824 } 28825 } 28826 } else if (key in this._zoomKeys) { 28827 map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]); 28828 28829 } else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) { 28830 map.closePopup(); 28831 28832 } else { 28833 return; 28834 } 28835 28836 stop(e); 28837 } 28838 }); 28839 28840 // @section Handlers 28841 // @section Handlers 28842 // @property keyboard: Handler 28843 // Keyboard navigation handler. 28844 Map.addInitHook('addHandler', 'keyboard', Keyboard); 28845 28846 /* 28847 * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map. 28848 */ 28849 28850 // @namespace Map 28851 // @section Interaction Options 28852 Map.mergeOptions({ 28853 // @section Mouse wheel options 28854 // @option scrollWheelZoom: Boolean|String = true 28855 // Whether the map can be zoomed by using the mouse wheel. If passed `'center'`, 28856 // it will zoom to the center of the view regardless of where the mouse was. 28857 scrollWheelZoom: true, 28858 28859 // @option wheelDebounceTime: Number = 40 28860 // Limits the rate at which a wheel can fire (in milliseconds). By default 28861 // user can't zoom via wheel more often than once per 40 ms. 28862 wheelDebounceTime: 40, 28863 28864 // @option wheelPxPerZoomLevel: Number = 60 28865 // How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta)) 28866 // mean a change of one full zoom level. Smaller values will make wheel-zooming 28867 // faster (and vice versa). 28868 wheelPxPerZoomLevel: 60 28869 }); 28870 28871 var ScrollWheelZoom = Handler.extend({ 28872 addHooks: function () { 28873 on(this._map._container, 'wheel', this._onWheelScroll, this); 28874 28875 this._delta = 0; 28876 }, 28877 28878 removeHooks: function () { 28879 off(this._map._container, 'wheel', this._onWheelScroll, this); 28880 }, 28881 28882 _onWheelScroll: function (e) { 28883 var delta = getWheelDelta(e); 28884 28885 var debounce = this._map.options.wheelDebounceTime; 28886 28887 this._delta += delta; 28888 this._lastMousePos = this._map.mouseEventToContainerPoint(e); 28889 28890 if (!this._startTime) { 28891 this._startTime = +new Date(); 28892 } 28893 28894 var left = Math.max(debounce - (+new Date() - this._startTime), 0); 28895 28896 clearTimeout(this._timer); 28897 this._timer = setTimeout(bind(this._performZoom, this), left); 28898 28899 stop(e); 28900 }, 28901 28902 _performZoom: function () { 28903 var map = this._map, 28904 zoom = map.getZoom(), 28905 snap = this._map.options.zoomSnap || 0; 28906 28907 map._stop(); // stop panning and fly animations if any 28908 28909 // map the delta with a sigmoid function to -4..4 range leaning on -1..1 28910 var d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), 28911 d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2, 28912 d4 = snap ? Math.ceil(d3 / snap) * snap : d3, 28913 delta = map._limitZoom(zoom + (this._delta > 0 ? d4 : -d4)) - zoom; 28914 28915 this._delta = 0; 28916 this._startTime = null; 28917 28918 if (!delta) { return; } 28919 28920 if (map.options.scrollWheelZoom === 'center') { 28921 map.setZoom(zoom + delta); 28922 } else { 28923 map.setZoomAround(this._lastMousePos, zoom + delta); 28924 } 28925 } 28926 }); 28927 28928 // @section Handlers 28929 // @property scrollWheelZoom: Handler 28930 // Scroll wheel zoom handler. 28931 Map.addInitHook('addHandler', 'scrollWheelZoom', ScrollWheelZoom); 28932 28933 /* 28934 * L.Map.TapHold is used to simulate `contextmenu` event on long hold, 28935 * which otherwise is not fired by mobile Safari. 28936 */ 28937 28938 var tapHoldDelay = 600; 28939 28940 // @namespace Map 28941 // @section Interaction Options 28942 Map.mergeOptions({ 28943 // @section Touch interaction options 28944 // @option tapHold: Boolean 28945 // Enables simulation of `contextmenu` event, default is `true` for mobile Safari. 28946 tapHold: Browser.touchNative && Browser.safari && Browser.mobile, 28947 28948 // @option tapTolerance: Number = 15 28949 // The max number of pixels a user can shift his finger during touch 28950 // for it to be considered a valid tap. 28951 tapTolerance: 15 28952 }); 28953 28954 var TapHold = Handler.extend({ 28955 addHooks: function () { 28956 on(this._map._container, 'touchstart', this._onDown, this); 28957 }, 28958 28959 removeHooks: function () { 28960 off(this._map._container, 'touchstart', this._onDown, this); 28961 }, 28962 28963 _onDown: function (e) { 28964 clearTimeout(this._holdTimeout); 28965 if (e.touches.length !== 1) { return; } 28966 28967 var first = e.touches[0]; 28968 this._startPos = this._newPos = new Point(first.clientX, first.clientY); 28969 28970 this._holdTimeout = setTimeout(bind(function () { 28971 this._cancel(); 28972 if (!this._isTapValid()) { return; } 28973 28974 // prevent simulated mouse events https://w3c.github.io/touch-events/#mouse-events 28975 on(document, 'touchend', preventDefault); 28976 on(document, 'touchend touchcancel', this._cancelClickPrevent); 28977 this._simulateEvent('contextmenu', first); 28978 }, this), tapHoldDelay); 28979 28980 on(document, 'touchend touchcancel contextmenu', this._cancel, this); 28981 on(document, 'touchmove', this._onMove, this); 28982 }, 28983 28984 _cancelClickPrevent: function cancelClickPrevent() { 28985 off(document, 'touchend', preventDefault); 28986 off(document, 'touchend touchcancel', cancelClickPrevent); 28987 }, 28988 28989 _cancel: function () { 28990 clearTimeout(this._holdTimeout); 28991 off(document, 'touchend touchcancel contextmenu', this._cancel, this); 28992 off(document, 'touchmove', this._onMove, this); 28993 }, 28994 28995 _onMove: function (e) { 28996 var first = e.touches[0]; 28997 this._newPos = new Point(first.clientX, first.clientY); 28998 }, 28999 29000 _isTapValid: function () { 29001 return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance; 29002 }, 29003 29004 _simulateEvent: function (type, e) { 29005 var simulatedEvent = new MouseEvent(type, { 29006 bubbles: true, 29007 cancelable: true, 29008 view: window, 29009 // detail: 1, 29010 screenX: e.screenX, 29011 screenY: e.screenY, 29012 clientX: e.clientX, 29013 clientY: e.clientY, 29014 // button: 2, 29015 // buttons: 2 29016 }); 29017 29018 simulatedEvent._simulated = true; 29019 29020 e.target.dispatchEvent(simulatedEvent); 29021 } 29022 }); 29023 29024 // @section Handlers 29025 // @property tapHold: Handler 29026 // Long tap handler to simulate `contextmenu` event (useful in mobile Safari). 29027 Map.addInitHook('addHandler', 'tapHold', TapHold); 29028 29029 /* 29030 * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers. 29031 */ 29032 29033 // @namespace Map 29034 // @section Interaction Options 29035 Map.mergeOptions({ 29036 // @section Touch interaction options 29037 // @option touchZoom: Boolean|String = * 29038 // Whether the map can be zoomed by touch-dragging with two fingers. If 29039 // passed `'center'`, it will zoom to the center of the view regardless of 29040 // where the touch events (fingers) were. Enabled for touch-capable web 29041 // browsers. 29042 touchZoom: Browser.touch, 29043 29044 // @option bounceAtZoomLimits: Boolean = true 29045 // Set it to false if you don't want the map to zoom beyond min/max zoom 29046 // and then bounce back when pinch-zooming. 29047 bounceAtZoomLimits: true 29048 }); 29049 29050 var TouchZoom = Handler.extend({ 29051 addHooks: function () { 29052 addClass(this._map._container, 'leaflet-touch-zoom'); 29053 on(this._map._container, 'touchstart', this._onTouchStart, this); 29054 }, 29055 29056 removeHooks: function () { 29057 removeClass(this._map._container, 'leaflet-touch-zoom'); 29058 off(this._map._container, 'touchstart', this._onTouchStart, this); 29059 }, 29060 29061 _onTouchStart: function (e) { 29062 var map = this._map; 29063 if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { return; } 29064 29065 var p1 = map.mouseEventToContainerPoint(e.touches[0]), 29066 p2 = map.mouseEventToContainerPoint(e.touches[1]); 29067 29068 this._centerPoint = map.getSize()._divideBy(2); 29069 this._startLatLng = map.containerPointToLatLng(this._centerPoint); 29070 if (map.options.touchZoom !== 'center') { 29071 this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2)); 29072 } 29073 29074 this._startDist = p1.distanceTo(p2); 29075 this._startZoom = map.getZoom(); 29076 29077 this._moved = false; 29078 this._zooming = true; 29079 29080 map._stop(); 29081 29082 on(document, 'touchmove', this._onTouchMove, this); 29083 on(document, 'touchend touchcancel', this._onTouchEnd, this); 29084 29085 preventDefault(e); 29086 }, 29087 29088 _onTouchMove: function (e) { 29089 if (!e.touches || e.touches.length !== 2 || !this._zooming) { return; } 29090 29091 var map = this._map, 29092 p1 = map.mouseEventToContainerPoint(e.touches[0]), 29093 p2 = map.mouseEventToContainerPoint(e.touches[1]), 29094 scale = p1.distanceTo(p2) / this._startDist; 29095 29096 this._zoom = map.getScaleZoom(scale, this._startZoom); 29097 29098 if (!map.options.bounceAtZoomLimits && ( 29099 (this._zoom < map.getMinZoom() && scale < 1) || 29100 (this._zoom > map.getMaxZoom() && scale > 1))) { 29101 this._zoom = map._limitZoom(this._zoom); 29102 } 29103 29104 if (map.options.touchZoom === 'center') { 29105 this._center = this._startLatLng; 29106 if (scale === 1) { return; } 29107 } else { 29108 // Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng 29109 var delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint); 29110 if (scale === 1 && delta.x === 0 && delta.y === 0) { return; } 29111 this._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom); 29112 } 29113 29114 if (!this._moved) { 29115 map._moveStart(true, false); 29116 this._moved = true; 29117 } 29118 29119 cancelAnimFrame(this._animRequest); 29120 29121 var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false}, undefined); 29122 this._animRequest = requestAnimFrame(moveFn, this, true); 29123 29124 preventDefault(e); 29125 }, 29126 29127 _onTouchEnd: function () { 29128 if (!this._moved || !this._zooming) { 29129 this._zooming = false; 29130 return; 29131 } 29132 29133 this._zooming = false; 29134 cancelAnimFrame(this._animRequest); 29135 29136 off(document, 'touchmove', this._onTouchMove, this); 29137 off(document, 'touchend touchcancel', this._onTouchEnd, this); 29138 29139 // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate. 29140 if (this._map.options.zoomAnimation) { 29141 this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap); 29142 } else { 29143 this._map._resetView(this._center, this._map._limitZoom(this._zoom)); 29144 } 29145 } 29146 }); 29147 29148 // @section Handlers 29149 // @property touchZoom: Handler 29150 // Touch zoom handler. 29151 Map.addInitHook('addHandler', 'touchZoom', TouchZoom); 29152 29153 Map.BoxZoom = BoxZoom; 29154 Map.DoubleClickZoom = DoubleClickZoom; 29155 Map.Drag = Drag; 29156 Map.Keyboard = Keyboard; 29157 Map.ScrollWheelZoom = ScrollWheelZoom; 29158 Map.TapHold = TapHold; 29159 Map.TouchZoom = TouchZoom; 29160 29161 exports.Bounds = Bounds; 29162 exports.Browser = Browser; 29163 exports.CRS = CRS; 29164 exports.Canvas = Canvas; 29165 exports.Circle = Circle; 29166 exports.CircleMarker = CircleMarker; 29167 exports.Class = Class; 29168 exports.Control = Control; 29169 exports.DivIcon = DivIcon; 29170 exports.DivOverlay = DivOverlay; 29171 exports.DomEvent = DomEvent; 29172 exports.DomUtil = DomUtil; 29173 exports.Draggable = Draggable; 29174 exports.Evented = Evented; 29175 exports.FeatureGroup = FeatureGroup; 29176 exports.GeoJSON = GeoJSON; 29177 exports.GridLayer = GridLayer; 29178 exports.Handler = Handler; 29179 exports.Icon = Icon; 29180 exports.ImageOverlay = ImageOverlay; 29181 exports.LatLng = LatLng; 29182 exports.LatLngBounds = LatLngBounds; 29183 exports.Layer = Layer; 29184 exports.LayerGroup = LayerGroup; 29185 exports.LineUtil = LineUtil; 29186 exports.Map = Map; 29187 exports.Marker = Marker; 29188 exports.Mixin = Mixin; 29189 exports.Path = Path; 29190 exports.Point = Point; 29191 exports.PolyUtil = PolyUtil; 29192 exports.Polygon = Polygon; 29193 exports.Polyline = Polyline; 29194 exports.Popup = Popup; 29195 exports.PosAnimation = PosAnimation; 29196 exports.Projection = index; 29197 exports.Rectangle = Rectangle; 29198 exports.Renderer = Renderer; 29199 exports.SVG = SVG; 29200 exports.SVGOverlay = SVGOverlay; 29201 exports.TileLayer = TileLayer; 29202 exports.Tooltip = Tooltip; 29203 exports.Transformation = Transformation; 29204 exports.Util = Util; 29205 exports.VideoOverlay = VideoOverlay; 29206 exports.bind = bind; 29207 exports.bounds = toBounds; 29208 exports.canvas = canvas; 29209 exports.circle = circle; 29210 exports.circleMarker = circleMarker; 29211 exports.control = control; 29212 exports.divIcon = divIcon; 29213 exports.extend = extend; 29214 exports.featureGroup = featureGroup; 29215 exports.geoJSON = geoJSON; 29216 exports.geoJson = geoJson; 29217 exports.gridLayer = gridLayer; 29218 exports.icon = icon; 29219 exports.imageOverlay = imageOverlay; 29220 exports.latLng = toLatLng; 29221 exports.latLngBounds = toLatLngBounds; 29222 exports.layerGroup = layerGroup; 29223 exports.map = createMap; 29224 exports.marker = marker; 29225 exports.point = toPoint; 29226 exports.polygon = polygon; 29227 exports.polyline = polyline; 29228 exports.popup = popup; 29229 exports.rectangle = rectangle; 29230 exports.setOptions = setOptions; 29231 exports.stamp = stamp; 29232 exports.svg = svg; 29233 exports.svgOverlay = svgOverlay; 29234 exports.tileLayer = tileLayer; 29235 exports.tooltip = tooltip; 29236 exports.transformation = toTransformation; 29237 exports.version = version; 29238 exports.videoOverlay = videoOverlay; 29239 29240 var oldL = window.L; 29241 exports.noConflict = function() { 29242 window.L = oldL; 29243 return this; 29244 } 29245 // Always export us to window global (see #2364) 29246 window.L = exports; 29247 29248})); 29249//# sourceMappingURL=leaflet-src.js.map
29250 29251 29252/***/ }), 29253 29254/***/ 8624: 29255/***/ (function() { 29256 29257document.addEventListener('DOMContentLoaded', function () { 29258 // Auswahl aller Elemente in der Liste neben der Karte 29259 let listItems = document.querySelectorAll('.organisation-map .list .lma-map-list'); 29260 29261 // Wenn keine Listenelemente gefunden wurden, beende die Funktion 29262 if (listItems.length === 0) { 29263 return; 29264 } 29265 29266 // Auswahl aller SVG-Gruppen mit der Klasse 'lma-map-list-inactive 29267 let mapParts = document.querySelectorAll('.organisation-map .map svg .lma-map-list-inactive'); 29268 29269 // Iteriere über die Listen-Elemente 29270 listItems.forEach((listItem) => { 29271 // Extrahiere die 'data-id' des aktuellen Listenelements 29272 const listItemID = listItem.dataset.id; 29273 29274 // Iteriere über jeden SVG-Gruppe mit der Klasse 'lma-map-list-inactive 29275 mapParts.forEach((mapPart) => { 29276 // Wenn die 'data-id' des SVG-Teils der 'data-id' des Listenelements entspricht 29277 if (mapPart.getAttribute('data-id') === listItemID) { 29278 mapPart.classList.remove('lma-map-list-inactive'); 29279 mapPart.classList.add('lma-map-list'); 29280 } 29281 }); 29282 }); 29283 29284 // Selektiere alle Elemente mit der Klasse "lma-map-list" 29285 // Sowohl in der Map, wie auch in der List ... hierüber ist das verbunden. 29286 const lmaMapLists = document.querySelectorAll('.lma-map-list'); 29287 29288 // Funktion, um die Klasse "has-mouseover" hinzuzufügen oder zu entfernen 29289 function toggleMouseoverClass(element, addClass) { 29290 // Ermittle die data-id des Elements 29291 const dataId = element.dataset.id; 29292 // Finde das passende Element basierend auf data-id 29293 const matchingElements = document.querySelectorAll(`[data-id="${dataId}"]`); 29294 if (addClass) { 29295 element.classList.add('has-mouseover'); 29296 matchingElements.forEach((matchingElement) => { 29297 matchingElement.classList.add('has-mouseover'); 29298 }); 29299 } else { 29300 element.classList.remove('has-mouseover'); 29301 matchingElements.forEach((matchingElement) => { 29302 matchingElement.classList.remove('has-mouseover'); 29303 }); 29304 } 29305 } 29306 29307 // Funktion, um die Klasse "detail-is-open" hinzuzufügen 29308 function setOpenClass(element) { 29309 // Entferne zunächst "detail-is-open" von allen Elementen 29310 document.querySelectorAll('.detail-is-open').forEach((el) => el.classList.remove('detail-is-open')); 29311 // Ermittle die data-id des Elements 29312 const dataId = element.dataset.id; 29313 // Finde das passende Element basierend auf data-id und füge "detail-is-open" hinzu 29314 const matchingElement = document.querySelector(`[id="${dataId}"]`); 29315 if (matchingElement) matchingElement.classList.add('detail-is-open'); 29316 // Erweiterung: Suche nach einem <g> Element im SVG, das die gleiche data-id hat 29317 const svgElement = document.querySelector(`svg g[data-id="${dataId}"]`); 29318 if (svgElement) svgElement.classList.add('detail-is-open'); 29319 // Helper-Klasse in Body 29320 document.body.classList.add('map-details-open'); 29321 29322 // Damit der globale Klick-Event-Listener nicht greift und die Klasse sorft wieder entfernt 29323 event.stopPropagation(); 29324 } 29325 29326 // Event-Listener für Mouseover und Mouseout 29327 lmaMapLists.forEach((element) => { 29328 element.addEventListener('mouseenter', () => toggleMouseoverClass(element, true)); 29329 element.addEventListener('mouseleave', () => toggleMouseoverClass(element, false)); 29330 element.addEventListener('click', () => setOpenClass(element)); 29331 }); 29332 29333 // Globaler Klick-Event-Listener, um "detail-is-open" zu entfernen, wenn auÃerhalb geklickt wird oder auf den Close-Button 29334 document.addEventListener('click', function (event) { 29335 // A: Ãberprüfe, ob das geklickte Element oder eines seiner Elternelemente "detail" ist 29336 let isDetailOrChildClicked = event.target.closest('.detail'); 29337 29338 // B: Ãberprüfe, ob der Close-Button geklickt wurde 29339 let isCloseButtonInsideDetailClicked = 29340 event.target.classList.contains('close') && event.target.closest('.detail.detail-is-open'); 29341 29342 // Wenn nicht A: oder B: 29343 if (!isDetailOrChildClicked || isCloseButtonInsideDetailClicked) { 29344 document.querySelectorAll('.detail-is-open').forEach((el) => { 29345 el.classList.remove('detail-is-open'); 29346 document.body.classList.remove('map-details-open'); 29347 }); 29348 } 29349 }); 29350}); 29351 29352 29353/***/ }), 29354 29355/***/ 9002: 29356/***/ (function() { 29357 29358document.addEventListener("DOMContentLoaded", () => { 29359 const cOrganigramm = document.querySelectorAll(".c-organigram"); 29360 29361 if (cOrganigramm.length !== 1) { 29362 return; 29363 } 29364 29365 const lineColorDefault = getComputedStyle(document.body).getPropertyValue( 29366 "--bs-body-color" 29367 ); // Bootstrap: body color 29368 const lineOutsideDistancePx = 50; // Abstand, wenn eine Verbindung oberhalb oder unterhalb liegt. 29369 29370 const canvas = document.getElementById("connections"); 29371 const ctx = canvas.getContext("2d"); 29372 29373 // Die Standard-Breakpoints von Bootstrap > v5.x 29374 // const breakpoints = { 29375 // xs: parseInt( 29376 // getComputedStyle(document.body).getPropertyValue( 29377 // "--bs-breakpoint-xs" 29378 // ) 29379 // ), 29380 // sm: parseInt( 29381 // getComputedStyle(document.body).getPropertyValue( 29382 // "--bs-breakpoint-sm" 29383 // ) 29384 // ), 29385 // md: parseInt( 29386 // getComputedStyle(document.body).getPropertyValue( 29387 // "--bs-breakpoint-md" 29388 // ) 29389 // ), 29390 // lg: parseInt( 29391 // getComputedStyle(document.body).getPropertyValue( 29392 // "--bs-breakpoint-lg" 29393 // ) 29394 // ), 29395 // xl: parseInt( 29396 // getComputedStyle(document.body).getPropertyValue( 29397 // "--bs-breakpoint-xl" 29398 // ) 29399 // ), 29400 // xxl: parseInt( 29401 // getComputedStyle(document.body).getPropertyValue( 29402 // "--bs-breakpoint-xxl" 29403 // ) 29404 // ), 29405 // }; 29406 29407 // Die breakpoints stehen in diesem Projekt im Frontend nicht zur Verfügung, daher hier definiert. 29408 29409 const breakpoints = { 29410 xs: 0, 29411 sm: 576, 29412 md: 768, 29413 lg: 992, 29414 xl: 1200, 29415 xxl: 1400, 29416 }; 29417 29418 function getBoxParams(box) { 29419 /** 29420 * x: Mittelpunkt einer Box hotizontal 29421 * y Mittelpunkt einer Box vertikal
29422 * top Oberkante einer Box 29423 * bottom Unterkante einer Box 29424 */ 29425 const rect = box.getBoundingClientRect(); 29426 // Berechne die Koordinaten relativ zum Canvas 29427 const canvasRect = canvas.getBoundingClientRect(); 29428 const x = rect.left - canvasRect.left + rect.width / 2; 29429 const y = rect.top - canvasRect.top + rect.height / 2; 29430 const top = rect.top - canvasRect.top; 29431 const bottom = rect.top - canvasRect.top + rect.height; 29432 29433 return { x, y, top, bottom }; 29434 } 29435 29436 function drawLine(startX, startY, endX, endY, color) { 29437 ctx.beginPath(); 29438 ctx.moveTo(startX, startY); 29439 ctx.lineTo(endX, endY); 29440 ctx.strokeStyle = color; 29441 ctx.stroke(); 29442 } 29443 29444 function buildConnection({ 29445 boxA, 29446 boxB, 29447 position = "default", 29448 color = lineColorDefault, 29449 breakpointFrom = breakpoints.xs, 29450 breakpointTo = 4000, 29451 windowWidth, 29452 } = {}) { 29453 /** 29454 * boxA: Start-Box 29455 * boxB: Ziel-Box 29456 * position: ['default', 'above', 'below'] 29457 * Per default ist die Linie horizontal mittig, kann aber auch oberhalb oder unterhalb liegen. 29458 * Abstand siehe lineOutsideDistancePx 29459 * color: Farbe der Linie -> vor allem für Debugging, damit man sieht, welche Linie man trifft. 29460 * Default siehe lineColorDefault 29461 * breakpointFrom: Unterer Breakpoint, default = breakpoints.xs, also = 0 29462 * breakpointTo: Oberer Breakpoint, default = 4000, also einfach nur sehr groà 29463 * windowWidth: Viewport Breite 29464 */ 29465 29466 // Wenn die Verbindung nicht im gewünschten Breakpoint liegt, dann tue nichts. 29467 if (!(windowWidth >= breakpointFrom && windowWidth < breakpointTo)) 29468 return; 29469 29470 // Parameter der Boxen 29471 const boxStart = document.querySelector('.box[data-id="' + boxA + '"]'); 29472 const boxEnd = document.querySelector('.box[data-id="' + boxB + '"]'); 29473 const centerPoint1 = getBoxParams(boxStart); 29474 const centerPoint2 = getBoxParams(boxEnd); 29475 var startX; 29476 var startY; 29477 var endX; 29478 var endY; 29479 29480 switch (position) { 29481 case "above": 29482 startX = centerPoint1.x; 29483 startY = centerPoint1.top - lineOutsideDistancePx; // Start der Linie ist oberhalb 29484 endX = centerPoint2.x; 29485 endY = centerPoint2.top - lineOutsideDistancePx; // Ende der Linie ist oberhalb 29486 29487 drawLine(startX, startY, endX, endY, color); // die Linie 29488 drawLine(startX, startY, centerPoint1.x, centerPoint1.y, color); // senkrechter Teil A 29489 drawLine(endX, endY, centerPoint2.x, centerPoint2.y, color); // senkrechter Teil B 29490 29491 break; 29492 case "below": 29493 startX = centerPoint1.x; 29494 startY = centerPoint1.bottom + lineOutsideDistancePx; // Start der Linie ist unterhalb 29495 endX = centerPoint2.x; 29496 endY = centerPoint2.bottom + lineOutsideDistancePx; // Ende der Linie ist unterhalb 29497 29498 drawLine(startX, startY, endX, endY, color); // die Linie 29499 drawLine(startX, startY, centerPoint1.x, centerPoint1.y, color); // senkrechter Teil A 29500 drawLine(endX, endY, centerPoint2.x, centerPoint2.y, color); // senkrechter Teil B 29501 29502 break; 29503 default: 29504 startX = centerPoint1.x; 29505 startY = centerPoint1.y; 29506 endX = centerPoint2.x; 29507 endY = centerPoint2.y; 29508 29509 drawLine(startX, startY, endX, endY, color); // die Linie 29510 } 29511 } 29512 29513 function init() { 29514 const windowWidth = window.innerWidth; // hier muss window.innerWidth nur einmalig ermittelt werden 29515 29516 buildConnection({ 29517 boxA: "dlm", 29518 boxB: "zak", 29519 breakpointTo: breakpoints.lg, 29520 windowWidth: windowWidth, 29521 }); 29522 buildConnection({ 29523 boxA: "dlm", 29524 boxB: "zak", 29525 position: "below", 29526 breakpointFrom: breakpoints.lg, 29527 windowWidth: windowWidth, 29528 }); 29529 buildConnection({ 29530 boxA: "between-dlm-zak", 29531 boxB: "media", 29532 windowWidth: windowWidth, 29533 }); 29534 buildConnection({ 29535 boxA: "dlm", 29536 boxB: "gk", 29537 windowWidth: windowWidth, 29538 }); 29539 buildConnection({ 29540 boxA: "gk", 29541 boxB: "gvk", 29542 windowWidth: windowWidth, 29543 }); 29544 buildConnection({ 29545 boxA: "regulation", 29546 boxB: "innovation", 29547 windowWidth: windowWidth, 29548 }); 29549 buildConnection({ 29550 boxA: "europe", 29551 boxB: "household", 29552 breakpointTo: breakpoints.lg, 29553 windowWidth: windowWidth, 29554 }); 29555 buildConnection({ 29556 boxA: "europe", 29557 boxB: "household", 29558 position: "above", 29559 breakpointFrom: breakpoints.lg, 29560 windowWidth: windowWidth, 29561 }); 29562 } 29563 29564 function rebuildOrganigram() { 29565 ctx.clearRect(0, 0, canvas.width, canvas.height); // Lösche das Canvas, damit es neu gezeichnet werden kann. 29566 29567 init(); 29568 } 29569 29570 // Debounce-Funktion, die sicherstellt, die Linien erst nach dem Windows Resize-Event gezeichnet werden. 29571 // Das wäre ansonsten zu aufwendig. 29572 function debounce(func, delay) { 29573 let timeoutId; 29574 return function (...args) { 29575 if (timeoutId) { 29576 clearTimeout(timeoutId); 29577 } 29578 timeoutId = setTimeout(() => { 29579 func(...args); 29580 }, delay); 29581 }; 29582 } 29583 // Die Funktion, die nach dem Resize-Event aufgerufen werden soll 29584 function onResizeComplete() { 29585 rebuildOrganigram(); 29586 } 29587 // Wartet 250ms, damit die Neuberechnung erststartet, wenn Windows Resize-Event beendet ist. 29588 const debouncedResize = debounce(onResizeComplete, 250); 29589 // EventListener, um die Linien des Organigram nach Windows Resize-Event neu zu zeichnen. 29590 window.addEventListener("resize", debouncedResize); 29591 29592 init(); 29593 29594 // SchlieÃt alle geöffneten Boxen 29595 function closeAllDropdowns(exceptBoxId = null) { 29596 document.querySelectorAll(".box").forEach((box) => { 29597 if ( 29598 exceptBoxId === null || 29599 box.dataset.id !== exceptBoxId.toString() 29600 ) { 29601 const dropdown = box.querySelector(".dropdown"); 29602 if (dropdown && !dropdown.classList.contains("d-none")) { 29603 dropdown.classList.add("d-none"); 29604 box.classList.remove("organigram-is-open"); 29605 } 29606 } 29607 }); 29608 } 29609 29610 // Ãffnet / schlieÃt eine Box 29611 document.querySelectorAll(".box .box-inner").forEach((inner) => { 29612 inner.addEventListener("click", function () { 29613 const box = this.closest(".box"); 29614 const dropdown = this.nextElementSibling; 29615 const isOpening = dropdown.classList.contains("d-none"); 29616 29617 // Zuerst alle Dropdowns schlieÃen 29618 closeAllDropdowns(isOpening ? box.dataset.id : null); 29619 29620 // Dann das geklickte Dropdown umschalten, wenn es zuvor nicht geöffnet war 29621 if (isOpening) { 29622 dropdown.classList.toggle("d-none", false); 29623 box.classList.add("organigram-is-open"); 29624 } 29625 }); 29626 }); 29627 29628 // blendet das Overlay über den Bildern im Accordion ein / aus, per Mouseover und Klick. 29629 document.querySelectorAll('.authorities .item .inner').forEach(item => { 29630 item.addEventListener('mouseenter', function() { 29631 this.querySelector('.overlay').classList.remove('d-none'); 29632 }); 29633 item.addEventListener('mouseleave', function() { 29634 this.querySelector('.overlay').classList.add('d-none'); 29635 }); 29636 item.addEventListener('click', function() { 29637 this.querySelector('.overlay').classList.remove('d-none'); 29638 }); 29639 }); 29640}); 29641 29642 29643/***/ }), 29644 29645/***/ 9738: 29646/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 29647 29648/* provided dependency */ var jQuery = __webpack_require__(3336); 29649/* 29650Copyright © 2013 Adobe Systems Incorporated. 29651 29652Licensed under the Apache License, Version 2.0 (the âLicenseâ); 29653you may not use this file except in compliance with the License. 29654You may obtain a copy of the License at 29655 29656http://www.apache.org/licenses/LICENSE-2.0 29657 29658Unless required by applicable law or agreed to in writing, softw
29658are 29659distributed under the License is distributed on an âAS ISâ BASIS, 29660WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29661See the License for the specific language governing permissions and 29662limitations under the License. 29663*/ 29664 29665/** 29666 * See <a href="http://jquery.com">http://jquery.com</a>. 29667 * @name jquery 29668 * @class 29669 * See the jQuery Library (<a href="http://jquery.com">http://jquery.com</a>) for full details. This just 29670 * documents the function and classes that are added to jQuery by this plug-in. 29671 */ 29672 29673/** 29674 * See <a href="http://jquery.com">http://jquery.com</a> 29675 * @name fn 29676 * @class 29677 * See the jQuery Library (<a href="http://jquery.com">http://jquery.com</a>) for full details. This just 29678 * documents the function and classes that are added to jQuery by this plug-in. 29679 * @memberOf jquery 29680 */ 29681 29682/** 29683 * @fileOverview accessibleMegaMenu plugin 29684 * 29685 *<p>Licensed under the Apache License, Version 2.0 (the âLicenseâ) 29686 *<br />Copyright © 2013 Adobe Systems Incorporated. 29687 *<br />Project page <a href="https://github.com/adobe-accessibility/Accessible-Mega-Menu">https://github.com/adobe-accessibility/Accessible-Mega-Menu</a> 29688 * @version 0.1 29689 * @author Michael Jordan 29690 * @requires jquery 29691 */ 29692 29693/*jslint browser: true, devel: true, plusplus: true, nomen: true */ 29694/*global jQuery, window, document */ 29695(function ($, window, document) { 29696 "use strict"; 29697 var pluginName = "accessibleMegaMenu", 29698 defaults = { 29699 uuidPrefix: "accessible-megamenu", // unique ID's are required to indicate aria-owns, aria-controls and aria-labelledby 29700 menuClass: "accessible-megamenu", // default css class used to define the megamenu styling 29701 topNavItemClass: "accessible-megamenu-top-nav-item", // default css class for a top-level navigation item in the megamenu 29702 panelClass: "accessible-megamenu-panel", // default css class for a megamenu panel 29703 panelGroupClass: "accessible-megamenu-panel-group", // default css class for a group of items within a megamenu panel 29704 hoverClass: "hover", // default css class for the hover state 29705 focusClass: "focus", // default css class for the focus state 29706 openClass: "open", // default css class for the open state, 29707 toggleButtonClass: "accessible-megamenu-toggle", // default css class responsive toggle button 29708 openDelay: 0, // default open delay when opening menu via mouseover 29709 closeDelay: 250, // default open delay when opening menu via mouseover 29710 openOnMouseover: true // default setting for whether menu should open on mouseover 29711 }, 29712 Keyboard = { 29713 BACKSPACE: 8, 29714 COMMA: 188, 29715 DELETE: 46, 29716 DOWN: 40, 29717 END: 35, 29718 ENTER: 13, 29719 ESCAPE: 27, 29720 HOME: 36, 29721 LEFT: 37, 29722 PAGE_DOWN: 34, 29723 PAGE_UP: 33, 29724 PERIOD: 190, 29725 RIGHT: 39, 29726 SPACE: 32, 29727 TAB: 9, 29728 UP: 38, 29729 keyMap: { 29730 48: "0", 29731 49: "1", 29732 50: "2", 29733 51: "3", 29734 52: "4", 29735 53: "5", 29736 54: "6", 29737 55: "7", 29738 56: "8", 29739 57: "9", 29740 59: ";", 29741 65: "a", 29742 66: "b", 29743 67: "c", 29744 68: "d", 29745 69: "e", 29746 70: "f", 29747 71: "g", 29748 72: "h", 29749 73: "i", 29750 74: "j", 29751 75: "k", 29752 76: "l", 29753 77: "m", 29754 78: "n", 29755 79: "o", 29756 80: "p", 29757 81: "q", 29758 82: "r", 29759 83: "s", 29760 84: "t", 29761 85: "u", 29762 86: "v", 29763 87: "w", 29764 88: "x", 29765 89: "y", 29766 90: "z", 29767 96: "0", 29768 97: "1", 29769 98: "2", 29770 99: "3", 29771 100: "4", 29772 101: "5", 29773 102: "6", 29774 103: "7", 29775 104: "8", 29776 105: "9", 29777 190: "." 29778 } 29779 }, 29780 clearTimeout = window.clearTimeout, 29781 setTimeout = window.setTimeout, 29782 isOpera = window.opera && window.opera.toString() === '[object Opera]'; 29783 /**
29784 * @desc Creates a new accessible mega menu instance. 29785 * @param {jquery} element 29786 * @param {object} [options] Mega Menu options 29787 * @param {string} [options.uuidPrefix=accessible-megamenu] - Prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby 29788 * @param {string} [options.menuClass=accessible-megamenu] - CSS class used to define the megamenu styling 29789 * @param {string} [options.topNavItemClass=accessible-megamenu-top-nav-item] - CSS class for a top-level navigation item in the megamenu 29790 * @param {string} [options.panelClass=accessible-megamenu-panel] - CSS class for a megamenu panel 29791 * @param {string} [options.panelGroupClass=accessible-megamenu-panel-group] - CSS class for a group of items within a megamenu panel 29792 * @param {string} [options.hoverClass=hover] - CSS class for the hover state 29793 * @param {string} [options.focusClass=focus] - CSS class for the focus state 29794 * @param {string} [options.openClass=open] - CSS class for the open state 29795 * @constructor 29796 */ 29797 function AccessibleMegaMenu(element, options) { 29798 this.element = element; 29799 29800 // merge optional settings and defaults into settings 29801 this.settings = $.extend({}, defaults, options); 29802 29803 this._defaults = defaults; 29804 this._name = pluginName; 29805 29806 this.mouseTimeoutID = null; 29807 this.focusTimeoutID = null; 29808 this.mouseFocused = false; 29809 this.justFocused = false; 29810 29811 this.init(); 29812 } 29813 29814 AccessibleMegaMenu.prototype = (function () { 29815 29816 /* private attributes and methods ------------------------ */ 29817 var uuid = 0, 29818 keydownTimeoutDuration = 1000, 29819 keydownSearchString = "", 29820 isTouch = 'ontouchstart' in window || window.navigator.msMaxTouchPoints, 29821 _getPlugin, 29822 _addUniqueId, 29823 _togglePanel, 29824 _clickHandler, 29825 _touchmoveHandler, 29826 _clickOutsideHandler, 29827 _DOMAttrModifiedHandler, 29828 _focusInHandler, 29829 _focusOutHandler, 29830 _keyDownHandler, 29831 _mouseDownHandler, 29832 _mouseOverHandler, 29833 _mouseOutHandler, 29834 _clickToggleHandler, 29835 _toggleExpandedEventHandlers, 29836 _addEventHandlers, 29837 _removeEventHandlers; 29838 29839 /** 29840 * @name jQuery.fn.accessibleMegaMenu~_getPlugin 29841 * @desc Returns the parent accessibleMegaMenu instance for a given element 29842 * @param {jQuery} element 29843 * @memberof jQuery.fn.accessibleMegaMenu 29844 * @inner 29845 * @private 29846 */ 29847 _getPlugin = function (element) { 29848 return $(element).closest(':data(plugin_' + pluginName + ')').data("plugin_" + pluginName); 29849 }; 29850 29851 /** 29852 * @name jQuery.fn.accessibleMegaMenu~_addUniqueId 29853 * @desc Adds a unique id and element. 29854 * The id string starts with the 29855 * string defined in settings.uuidPrefix. 29856 * @param {jQuery} element 29857 * @memberof jQuery.fn.accessibleMegaMenu 29858 * @inner 29859 * @private 29860 */ 29861 _addUniqueId = function (element) { 29862 element = $(element); 29863 var settings = this.settings; 29864 if (!element.attr("id")) { 29865 element.attr("id", settings.uuidPrefix + "-" + new Date().getTime() + "-" + (++uuid)); 29866 } 29867 }; 29868 29869 /** 29870 * @name jQuery.fn.accessibleMegaMenu~_togglePanel 29871 * @desc Toggle the display of mega menu panels in response to an event. 29872 * The optional boolean value 'hide' forces all panels to hide. 29873 * @param {event} event 29874 * @param {Boolean} [hide] Hide all mega menu panels when true 29875 * @memberof jQuery.fn.accessibleMegaMenu 29876 * @inner 29877 * @private 29878 */ 29879 _togglePanel = function (event, hide) { 29880 var target = $(event.target), 29881 that = this, 29882 settings = this.settings, 29883 menu = this.menu, 29884 topli = target.closest('.' + settings.topNavItemClass), 29885 panel = target.hasClass(settings.panelClass) ? target : target.closest('.' + settings.panelClass), 29886 newfocus; 29887 29888 _toggleExpandedEventHandlers.call(this, true); 29889 29890 if (hide) { 29891 topli = menu.find('.' + settings.topNavItemClass + ' .' + settings.openClass + ':first').closest('.' + settings.topNavItemClass); 29892 if (!(topli.is(event.relatedTarget) || topli.has(event.relatedTarget).length > 0)) { 29893 if ((event.type === 'mouseout' || event.type === 'focusout') && topli.has(document.activeElement).length > 0) { 29894 return; 29895 } 29896 topli.find('[aria-expanded]') 29897 .attr('aria-expanded', 'false') 29898 .removeClass(settings.openClass) 29899 .filter('.' + settings.panelClass) 29900 .attr('aria-hidden', 'true'); 29901 if ((event.type === 'keydown' && event.keyCode === Keyboard.ESCAPE) || event.type === 'DOMAttrModified') { 29902 newfocus = topli.find(':tabbable:first'); 29903 setTimeout(function () { 29904 menu.find('[aria-expanded].' + that.settings.panelClass).off('DOMAttrModified.accessible-megamenu'); 29905 newfocus.focus(); 29906 that.justFocused = false;
29907 }, 99); 29908 } 29909 } else if (topli.length === 0) { 29910 menu.find('[aria-expanded=true]') 29911 .attr('aria-expanded', 'false') 29912 .removeClass(settings.openClass) 29913 .filter('.' + settings.panelClass) 29914 .attr('aria-hidden', 'true'); 29915 } 29916 } else { 29917 clearTimeout(that.focusTimeoutID); 29918 topli.siblings() 29919 .find('[aria-expanded]') 29920 .attr('aria-expanded', 'false') 29921 .removeClass(settings.openClass) 29922 .filter('.' + settings.panelClass) 29923 .attr('aria-hidden', 'true'); 29924 topli.find('[aria-expanded]') 29925 .attr('aria-expanded', 'true') 29926 .addClass(settings.openClass) 29927 .filter('.' + settings.panelClass) 29928 .attr('aria-hidden', 'false'); 29929 29930 var pageScrollPosition = $('html')[0].scrollTop; 29931 var $openPanel = $('.' + settings.panelClass + '.' + settings.openClass).parent(); 29932 if ($openPanel.length > 0) { 29933 var openPanelTopPosition = $openPanel.offset().top; 29934 if (pageScrollPosition > openPanelTopPosition) { 29935 $('html')[0].scrollTop = openPanelTopPosition; 29936 } 29937 } 29938 29939 if (event.type === 'mouseover' && target.is(':tabbable') && topli.length === 1 && panel.length === 0 && menu.has(document.activeElement).length > 0) { 29940 target.focus(); 29941 that.justFocused = false; 29942 } 29943 29944 _toggleExpandedEventHandlers.call(that); 29945 } 29946 }; 29947 29948 /** 29949 * @name jQuery.fn.accessibleMegaMenu~_clickHandler 29950 * @desc Handle click event on mega menu item 29951 * @param {event} Event object 29952 * @memberof jQuery.fn.accessibleMegaMenu 29953 * @inner 29954 * @private 29955 */ 29956 _clickHandler = function (event) { 29957 var target = $(event.target).closest(':tabbable'), 29958 topli = target.closest('.' + this.settings.topNavItemClass), 29959 panel = target.closest('.' + this.settings.panelClass); 29960 if (topli.length === 1 29961 && panel.length === 0 29962 && topli.find('.' + this.settings.panelClass).length === 1) { 29963 if (!target.hasClass(this.settings.openClass)) { 29964 event.preventDefault(); 29965 event.stopPropagation(); 29966 _togglePanel.call(this, event); 29967 this.justFocused = false; 29968 } else { 29969 if (this.justFocused) { 29970 event.preventDefault(); 29971 event.stopPropagation(); 29972 this.justFocused = false; 29973 } else if (isTouch || !isTouch && !this.settings.openOnMouseover) { 29974 event.preventDefault(); 29975 event.stopPropagation(); 29976 _togglePanel.call(this, event, target.hasClass(this.settings.openClass)); 29977 } 29978 } 29979 } 29980 }; 29981 29982 /** 29983 * @name jQuery.fn.accessibleMegaMenu~_touchmoveHandler 29984 * @desc Handle touch move event on menu 29985 * @memberof jQuery.fn.accessibleMegaMenu 29986 * @inner 29987 * @private 29988 */ 29989 _touchmoveHandler = function () { 29990 this.justMoved = true; 29991 }; 29992 29993 /** 29994 * @name jQuery.fn.accessibleMegaMenu~_clickOutsideHandler 29995 * @desc Handle click event outside of a the megamenu 29996 * @param {event} Event object 29997 * @memberof jQuery.fn.accessibleMegaMenu 29998 * @inner 29999 * @private 30000 */ 30001 _clickOutsideHandler = function (event) { 30002 if ($(event.target).closest(this.menu).length === 0) { 30003 event.preventDefault(); 30004 event.stopPropagation(); 30005 _togglePanel.call(this, event, true); 30006 } 30007 }; 30008 30009 /** 30010 * @name jQuery.fn.accessibleMegaMenu~_DOMAttrModifiedHandler
30011 * @desc Handle DOMAttrModified event on panel to respond to Windows 8 Narrator ExpandCollapse pattern 30012 * @param {event} Event object 30013 * @memberof jQuery.fn.accessibleMegaMenu 30014 * @inner 30015 * @private 30016 */ 30017 _DOMAttrModifiedHandler = function (event) { 30018 if (event.originalEvent.attrName === 'aria-expanded' 30019 && event.originalEvent.newValue === 'false' 30020 && $(event.target).hasClass(this.settings.openClass)) { 30021 event.preventDefault(); 30022 event.stopPropagation(); 30023 _togglePanel.call(this, event, true); 30024 } 30025 }; 30026 30027 /** 30028 * @name jQuery.fn.accessibleMegaMenu~_focusInHandler 30029 * @desc Handle focusin event on mega menu item. 30030 * @param {event} Event object 30031 * @memberof jQuery.fn.accessibleMegaMenu 30032 * @inner 30033 * @private 30034 */ 30035 _focusInHandler = function (event) { 30036 clearTimeout(this.focusTimeoutID); 30037 var target = $(event.target), 30038 panel = target.closest('.' + this.settings.panelClass); 30039 target 30040 .addClass(this.settings.focusClass); 30041 this.justFocused = !this.mouseFocused || (!this.settings.openOnMouseover && this.mouseFocused); 30042 this.mouseFocused = false; 30043 if (this.justFocused && this.panels.not(panel).filter('.' + this.settings.openClass).length) { 30044 _togglePanel.call(this, event); 30045 } 30046 }; 30047 30048 /** 30049 * @name jQuery.fn.accessibleMegaMenu~_focusOutHandler 30050 * @desc Handle focusout event on mega menu item. 30051 * @param {event} Event object 30052 * @memberof jQuery.fn.accessibleMegaMenu 30053 * @inner 30054 * @private 30055 */ 30056 _focusOutHandler = function (event) { 30057 this.justFocused = false; 30058 var that = this, 30059 target = $(event.target), 30060 topli = target.closest('.' + this.settings.topNavItemClass); 30061 target 30062 .removeClass(this.settings.focusClass); 30063 30064 if (window.cvox) { 30065 // If ChromeVox is running... 30066 that.focusTimeoutID = setTimeout(function () { 30067 window.cvox.Api.getCurrentNode(function (node) { 30068 if (topli.has(node).length) { 30069 // and the current node being voiced is in 30070 // the mega menu, clearTimeout, 30071 // so the panel stays open. 30072 clearTimeout(that.focusTimeoutID); 30073 } else { 30074 that.focusTimeoutID = setTimeout(function (scope, event, hide) { 30075 _togglePanel.call(scope, event, hide); 30076 }, 275, that, event, true); 30077 } 30078 }); 30079 }, 25); 30080 } else { 30081 that.focusTimeoutID = setTimeout(function () { 30082 if (that.mouseFocused && event.relatedTarget === null) { 30083 return; 30084 } 30085 _togglePanel.call(that, event, true); 30086 }, 300); 30087 } 30088 }; 30089 30090 /** 30091 * @name jQuery.fn.accessibleMegaMenu~_keyDownHandler 30092 * @desc Handle keydown event on mega menu. 30093 * @param {event} Event object 30094 * @memberof jQuery.fn.accessibleMegaMenu 30095 * @inner 30096 * @private 30097 */ 30098 _keyDownHandler = function (event) { 30099 var that = (this.constructor === AccessibleMegaMenu) ? this : _getPlugin(this), // determine the AccessibleMegaMenu plugin instance 30100 settings = that.settings, 30101 target = $($(this).is('.' + settings.hoverClass + ':tabbable') ? this : event.target), // if the element is hovered the target is this, otherwise, its the focused element 30102 menu = that.menu, 30103 topnavitems = that.topnavitems, 30104 topli = target.closest('.' + settings.topNavItemClass), 30105 tabbables = menu.find(':tabbable'), 30106 panel = target.hasClass(settings.panelClass) ? target : target.closest('.' + settings.panelClass), 30107 panelGroups = panel.find('.' + settings.panelGroupClass), 30108 currentPanelGroup = target.closest('.' + settings.panelGroupClass), 30109 next, 30110 keycode = event.keyCode || event.which, 30111 start, 30112 i, 30113 o, 30114 label, 30115 found = false, 30116 newString = Keyboard.keyMap[event.keyCode] || '', 30117 regex, 30118 isTopNavItem = (topli.length === 1 && panel.length === 0); 30119
30120 if (target.is("input:focus, select:focus, textarea:focus, button:focus")) { 30121 // if the event target is a form element we should handle keydown normally 30122 return; 30123 } 30124 30125 if (target.is('.' + settings.hoverClass + ':tabbable')) { 30126 $('html').off('keydown.accessible-megamenu'); 30127 } 30128 30129 switch (keycode) { 30130 case Keyboard.ESCAPE: 30131 this.mouseFocused = false; 30132 _togglePanel.call(that, event, true); 30133 break; 30134 case Keyboard.DOWN: 30135 event.preventDefault(); 30136 this.mouseFocused = false; 30137 if (isTopNavItem) { 30138 _togglePanel.call(that, event); 30139 found = (topli.find('.' + settings.panelClass + ' :tabbable:first').focus().length === 1); 30140 } else { 30141 found = (tabbables.filter(':gt(' + tabbables.index(target) + '):first').focus().length === 1); 30142 } 30143 30144 if (!found && isOpera && (event.ctrlKey || event.metaKey)) { 30145 tabbables = $(':tabbable'); 30146 i = tabbables.index(target); 30147 found = ($(':tabbable:gt(' + $(':tabbable').index(target) + '):first').focus().length === 1); 30148 } 30149 break; 30150 case Keyboard.UP: 30151 event.preventDefault(); 30152 this.mouseFocused = false; 30153 if (isTopNavItem && target.hasClass(settings.openClass)) { 30154 _togglePanel.call(that, event, true); 30155 next = topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last'); 30156 if (next.children('.' + settings.panelClass).length) { 30157 found = (next.find('[aria-expanded]') 30158 .attr('aria-expanded', 'true') 30159 .addClass(settings.openClass) 30160 .filter('.' + settings.panelClass) 30161 .attr('aria-hidden', 'false') 30162 .find(':tabbable:last') 30163 .focus() === 1); 30164 } 30165 } else if (!isTopNavItem) { 30166 found = (tabbables.filter(':lt(' + tabbables.index(target) + '):last').focus().length === 1); 30167 } 30168 30169 if (!found && isOpera && (event.ctrlKey || event.metaKey)) { 30170 tabbables = $(':tabbable'); 30171 i = tabbables.index(target); 30172 found = ($(':tabbable:lt(' + $(':tabbable').index(target) + '):first').focus().length === 1); 30173 } 30174 break; 30175 case Keyboard.RIGHT: 30176 event.preventDefault(); 30177 this.mouseFocused = false; 30178 if (isTopNavItem) { 30179 found = (topnavitems.filter(':gt(' + topnavitems.index(topli) + '):first').find(':tabbable:first').focus().length === 1); 30180 } else { 30181 if (panelGroups.length && currentPanelGroup.length) { 30182 // if the current panel contains panel groups, and we are able to focus the first tabbable element of the next panel group 30183 found = (panelGroups.filter(':gt(' + panelGroups.index(currentPanelGroup) + '):first').find(':tabbable:first').focus().length === 1); 30184 } 30185 30186 if (!found) { 30187 found = (topli.find(':tabbable:first').focus().length === 1); 30188 } 30189 } 30190 break; 30191 case Keyboard.LEFT: 30192 event.preventDefault(); 30193 this.mouseFocused = false; 30194 if (isTopNavItem) { 30195 found = (topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last').find(':tabbable:first').focus().length === 1); 30196 } else { 30197 if (panelGroups.length && currentPanelGroup.length) { 30198 // if the current panel contains panel groups, and we are able to focus the first tabbable element of the previous panel group 30199 found = (panelGroups.filter(':lt(' + panelGroups.index(currentPanelGroup) + '):last').find(':tabbable:first').focus().length === 1); 30200 } 30201 30202 if (!found) { 30203 found = (topli.find(':tabbable:first').focus().length === 1); 30204 } 30205 } 30206 break; 30207 case Keyboard.TAB: 30208 this.mouseFocused = false;
30209 i = tabbables.index(target); 30210 if (event.shiftKey && isTopNavItem && target.hasClass(settings.openClass)) { 30211 _togglePanel.call(that, event, true); 30212 next = topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last'); 30213 if (next.children('.' + settings.panelClass).length) { 30214 found = next.children() 30215 .attr('aria-expanded', 'true') 30216 .addClass(settings.openClass) 30217 .filter('.' + settings.panelClass) 30218 .attr('aria-hidden', 'false') 30219 .find(':tabbable:last') 30220 .focus(); 30221 } 30222 } else if (event.shiftKey && i > 0) { 30223 found = (tabbables.filter(':lt(' + i + '):last').focus().length === 1); 30224 } else if (!event.shiftKey && i < tabbables.length - 1) { 30225 found = (tabbables.filter(':gt(' + i + '):first').focus().length === 1); 30226 } else if (isOpera) { 30227 tabbables = $(':tabbable'); 30228 i = tabbables.index(target); 30229 if (event.shiftKey) { 30230 found = ($(':tabbable:lt(' + $(':tabbable').index(target) + '):last').focus().length === 1); 30231 } else { 30232 found = ($(':tabbable:gt(' + $(':tabbable').index(target) + '):first').focus().length === 1); 30233 } 30234 } 30235 30236 if (found) { 30237 event.preventDefault(); 30238 } 30239 break; 30240 case Keyboard.SPACE: 30241 case Keyboard.ENTER: 30242 if (isTopNavItem) { 30243 event.preventDefault(); 30244 _clickHandler.call(that, event); 30245 } else { 30246 return true; 30247 } 30248 break; 30249 default: 30250 // alphanumeric filter 30251 clearTimeout(this.keydownTimeoutID); 30252 30253 keydownSearchString += newString !== keydownSearchString ? newString : ''; 30254 30255 if (keydownSearchString.length === 0) { 30256 return; 30257 } 30258 30259 this.keydownTimeoutID = setTimeout(function () { 30260 keydownSearchString = ''; 30261 }, keydownTimeoutDuration); 30262 30263 if (isTopNavItem && !target.hasClass(settings.openClass)) { 30264 tabbables = tabbables.filter(':not(.' + settings.panelClass + ' :tabbable)'); 30265 } else { 30266 tabbables = topli.find(':tabbable'); 30267 } 30268 30269 if (event.shiftKey) { 30270 tabbables = $(tabbables.get() 30271 .reverse()); 30272 } 30273 30274 for (i = 0; i < tabbables.length; i++) { 30275 o = tabbables.eq(i); 30276 if (o.is(target)) { 30277 start = (keydownSearchString.length === 1) ? i + 1 : i; 30278 break; 30279 } 30280 } 30281 30282 regex = new RegExp('^' + keydownSearchString.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'), 'i'); 30283 30284 for (i = start; i < tabbables.length; i++) { 30285 o = tabbables.eq(i); 30286 label = $.trim(o.text()); 30287 if (regex.test(label)) { 30288 found = true; 30289 o.focus(); 30290 break; 30291 } 30292 } 30293 if (!found) { 30294 for (i = 0; i < start; i++) { 30295 o = tabbables.eq(i); 30296 label = $.trim(o.text()); 30297 if (regex.test(label)) { 30298 o.focus(); 30299 break; 30300 } 30301 } 30302 } 30303 break; 30304 } 30305 that.justFocused = false;
30306 }; 30307 30308 /** 30309 * @name jQuery.fn.accessibleMegaMenu~_mouseDownHandler 30310 * @desc Handle mousedown event on mega menu. 30311 * @param {event} Event object 30312 * @memberof accessibleMegaMenu 30313 * @inner 30314 * @private 30315 */ 30316 _mouseDownHandler = function (event) { 30317 if ($(event.target).closest(this.settings.panelClass) || $(event.target).closest(":focusable").length) { 30318 this.mouseFocused = true; 30319 if ($(event.target).closest(this.settings.menuClass)) { 30320 $('html').on('keydown.accessible-megamenu', $.proxy(_keyDownHandler, event.target)); 30321 } 30322 } 30323 clearTimeout(this.mouseTimeoutID); 30324 this.mouseTimeoutID = setTimeout(function () { 30325 clearTimeout(this.focusTimeoutID); 30326 }, 1); 30327 }; 30328 30329 /** 30330 * @name jQuery.fn.accessibleMegaMenu~_mouseOverHandler 30331 * @desc Handle mouseover event on mega menu. 30332 * @param {event} Event object 30333 * @memberof jQuery.fn.accessibleMegaMenu 30334 * @inner 30335 * @private 30336 */ 30337 _mouseOverHandler = function (event) { 30338 clearTimeout(this.mouseTimeoutID); 30339 var that = this; 30340 30341 if (!that.settings.openOnMouseover) { 30342 return; 30343 } 30344 30345 this.mouseTimeoutID = setTimeout(function () { 30346 $(event.target).addClass(that.settings.hoverClass); 30347 _togglePanel.call(that, event); 30348 if ($(event.target).closest(that.settings.menuClass)) { 30349 $('html').on('keydown.accessible-megamenu', $.proxy(_keyDownHandler, event.target)); 30350 } 30351 }, this.settings.openDelay); 30352 }; 30353 30354 /** 30355 * @name jQuery.fn.accessibleMegaMenu~_mouseOutHandler 30356 * @desc Handle mouseout event on mega menu. 30357 * @param {event} Event object 30358 * @memberof jQuery.fn.accessibleMegaMenu 30359 * @inner 30360 * @private 30361 */ 30362 _mouseOutHandler = function (event) { 30363 clearTimeout(this.mouseTimeoutID); 30364 var that = this; 30365 30366 if (!that.settings.openOnMouseover) { 30367 return; 30368 } 30369 30370 $(event.target) 30371 .removeClass(that.settings.hoverClass); 30372 30373 that.mouseTimeoutID = setTimeout(function () { 30374 _togglePanel.call(that, event, true); 30375 }, this.settings.closeDelay); 30376 if ($(event.target).is(':tabbable')) { 30377 $('html').off('keydown.accessible-megamenu'); 30378 } 30379 }; 30380 30381 /** 30382 * @name jQuery.fn.accessibleMegaMenu~_clickToggleHandler 30383 * @desc Handle click event on menu toggle button. 30384 * @memberof jQuery.fn.accessibleMegaMenu 30385 * @inner 30386 * @private 30387 */ 30388 _clickToggleHandler = function () { 30389 var isExpanded = this.toggleButton.attr('aria-expanded') === 'true'; 30390 this.toggleButton.attr({'aria-expanded': !isExpanded, 'aria-pressed': !isExpanded}); 30391 }; 30392 30393 _toggleExpandedEventHandlers = function (hide) { 30394 var menu = this.menu; 30395 if (hide) { 30396 $('html').off('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu'); 30397 30398 menu.find('[aria-expanded].' + this.settings.panelClass).off('DOMAttrModified.accessible-megamenu'); 30399 } else { 30400 $('html').on('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu', $.proxy(_clickOutsideHandler, this)); 30401 30402 /* Narrator in Windows 8 automatically toggles the aria-expanded property on double tap or click. 30403 To respond to the change to collapse the panel, we must add a listener for a DOMAttrModified event. */ 30404 menu.find('[aria-expanded=true].' + this.settings.panelClass).on('DOMAttrModified.accessible-megamenu', $.proxy(_DOMAttrModifiedHandler, this)); 30405 } 30406 }; 30407 30408 _addEventHandlers = function() { 30409 var menu = this.menu, 30410 toggleButton = this.toggleButton; 30411 menu.on("focusin.accessible-megamenu", ":focusable, ." + this.settings.panelClass, $.proxy(_focusInHandler, this)) 30412 .on("focusout.accessible-megamenu", ":focusable, ." + this.settings.panelClass, $.proxy(_focusOutHandler, this))
30413 .on("keydown.accessible-megamenu", $.proxy(_keyDownHandler, this)) 30414 .on("mouseover.accessible-megamenu", $.proxy(_mouseOverHandler, this)) 30415 .on("mouseout.accessible-megamenu", $.proxy(_mouseOutHandler, this)) 30416 .on("mousedown.accessible-megamenu", $.proxy(_mouseDownHandler, this)) 30417 .on("click.accessible-megamenu", $.proxy(_clickHandler, this)); 30418 30419 toggleButton.on('click.accessible-megamenu', $.proxy(_clickToggleHandler, this)); 30420 30421 if (isTouch) { 30422 menu.on("touchmove.accessible-megamenu", $.proxy(_touchmoveHandler, this)); 30423 } 30424 30425 if ($(document.activeElement).closest(menu).length) { 30426 $(document.activeElement).trigger("focusin.accessible-megamenu"); 30427 } 30428 }; 30429 30430 _removeEventHandlers = function () { 30431 var menu = this.menu, 30432 toggleButton = this.toggleButton; 30433 menu.off('.accessible-megamenu'); 30434 if (menu.find('[aria-expanded=true].' + this.settings.panelClass).length) { 30435 _toggleExpandedEventHandlers.call(this, true); 30436 } 30437 30438 toggleButton.off('.accessible-megamenu'); 30439 }; 30440 30441 /* public attributes and methods ------------------------- */ 30442 return { 30443 constructor: AccessibleMegaMenu, 30444 30445 /** 30446 * @lends jQuery.fn.accessibleMegaMenu 30447 * @desc Initializes an instance of the accessibleMegaMenu plugins 30448 * @memberof jQuery.fn.accessibleMegaMenu 30449 * @instance 30450 */ 30451 init: function () { 30452 var settings = this.settings, 30453 nav = $(this.element), 30454 menu = nav.children('ol,ul').first(), 30455 topnavitems = menu.children(), 30456 toggleButton = nav.children('button').first(); 30457 this.start(settings, nav, menu, topnavitems, toggleButton); 30458 }, 30459 30460 start: function(settings, nav, menu, topnavitems, toggleButton) { 30461 var that = this; 30462 this.settings = settings; 30463 this.menu = menu; 30464 this.topnavitems = topnavitems; 30465 this.toggleButton = toggleButton; 30466 30467 nav.attr("role", "navigation"); 30468 _addUniqueId.call(that, menu); 30469 menu.addClass(settings.menuClass); 30470 menu.addClass(['js', settings.menuClass].join('-')); 30471 topnavitems.each(function (i, topnavitem) { 30472 var topnavitemlink, topnavitempanel; 30473 topnavitem = $(topnavitem); 30474 topnavitem.addClass(settings.topNavItemClass); 30475 topnavitemlink = topnavitem.find(":tabbable:first"); 30476 topnavitempanel = topnavitem.children(":not(:tabbable):last"); 30477 _addUniqueId.call(that, topnavitemlink); 30478 if (topnavitempanel.length) { 30479 _addUniqueId.call(that, topnavitempanel); 30480 topnavitemlink.attr({ 30481 "role": "button", 30482 "aria-controls": topnavitempanel.attr("id"), 30483 "aria-expanded": false, 30484 "tabindex": 0 30485 }); 30486 30487 topnavitempanel.attr({ 30488 "role": "region", 30489 "aria-expanded": false, 30490 "aria-hidden": true 30491 }) 30492 .addClass(settings.panelClass) 30493 .not("[aria-labelledby]") 30494 .attr("aria-labelledby", topnavitemlink.attr("id")); 30495 } 30496 }); 30497 30498 this.panels = menu.find("." + settings.panelClass); 30499 30500 menu.find("hr").attr("role", "separator"); 30501 30502 toggleButton.addClass(settings.toggleButtonClass); 30503 toggleButton.attr({'aria-expanded': false, 'aria-pressed': false, 'aria-controls': menu.attr('id')}); 30504 30505 _addEventHandlers.call(this); 30506 }, 30507 30508 /**
30509 * @desc Removes maga menu javascript behavior 30510 * @example $(selector).accessibleMegaMenu("destroy"); 30511 * @return {object} 30512 * @memberof jQuery.fn.accessibleMegaMenu 30513 * @instance 30514 */ 30515 destroy: function () { 30516 this.menu.removeClass(['js', this.settings.menuClass].join('-')); 30517 _removeEventHandlers.call(this, true); 30518 }, 30519 30520 /** 30521 * @desc Get default values 30522 * @example $(selector).accessibleMegaMenu("getDefaults"); 30523 * @return {object} 30524 * @memberof jQuery.fn.accessibleMegaMenu 30525 * @instance 30526 */ 30527 getDefaults: function () { 30528 return this._defaults; 30529 }, 30530 30531 /** 30532 * @desc Get any option set to plugin using its name (as string) 30533 * @example $(selector).accessibleMegaMenu("getOption", some_option); 30534 * @param {string} opt 30535 * @return {string} 30536 * @memberof jQuery.fn.accessibleMegaMenu 30537 * @instance 30538 */ 30539 getOption: function (opt) { 30540 return this.settings[opt]; 30541 }, 30542 30543 /** 30544 * @desc Get all options 30545 * @example $(selector).accessibleMegaMenu("getAllOptions"); 30546 * @return {object} 30547 * @memberof jQuery.fn.accessibleMegaMenu 30548 * @instance 30549 */ 30550 getAllOptions: function () { 30551 return this.settings; 30552 }, 30553 30554 /** 30555 * @desc Set option 30556 * @example $(selector).accessibleMegaMenu("setOption", "option_name", "option_value", reinitialize); 30557 * @param {string} opt - Option name 30558 * @param {string} val - Option value 30559 * @param {boolean} [reinitialize] - boolean to re-initialize the menu. 30560 * @memberof jQuery.fn.accessibleMegaMenu 30561 * @instance 30562 */ 30563 setOption: function (opt, value, reinitialize) { 30564 this.settings[opt] = value; 30565 if (reinitialize) { 30566 this.init(); 30567 } 30568 } 30569 }; 30570 }()); 30571 30572 /* lightweight plugin wrapper around the constructor, 30573 to prevent against multiple instantiations */ 30574 30575 /** 30576 * @class accessibleMegaMenu 30577 * @memberOf jQuery.fn 30578 * @classdesc Implements an accessible mega menu as a jQuery plugin. 30579 * <p>The mega-menu It is modeled after the mega menu on {@link http://adobe.com|adobe.com} but has been simplified for use by others. A brief description of the interaction design choices can be found in a blog post at {@link http://blogs.adobe.com/accessibility/2013/05/adobe-com.html|Mega menu accessibility on adobe.com}.</p> 30580 * <h3>Keyboard Accessibility</h3> 30581 * <p>The accessible mega menu supports keyboard interaction modeled after the behavior described in the {@link http://www.w3.org/TR/wai-aria-practices/#menu|WAI-ARIA Menu or Menu bar (widget) design pattern}, however we also try to respect users' general expectations for the behavior of links in a global navigation. To this end, the accessible mega menu implementation permits tab focus on each of the six top-level menu items. When one of the menu items has focus, pressing the Enter key, Spacebar or Down arrow will open the submenu panel, and pressing the Left or Right arrow key will shift focus to the adjacent menu item. Links within the submenu panels are included in the tab order when the panel is open. They can also be navigated with the arrow keys or by typing the first character in the link name, which speeds up keyboard navigation considerably. Pressing the Escape key closes the submenu and restores focus to the parent menu item.</p> 30582 * <h3>Screen Reader Accessibility</h3> 30583 * <p>The accessible mega menu models its use of WAI-ARIA Roles, States, and Properties after those described in the {@link http://www.w3.org/TR/wai-aria-practices/#menu|WAI-ARIA Menu or Menu bar (widget) design pattern} with some notable exceptions, so that it behaves better with screen reader user expectations for global navigation. We don't use <code class="prettyprint prettyprinted" style=""><span class="pln">role</span><span class="pun">=</span><span class="str">"menu"</span></code> for the menu container and <code class="prettyprint prettyprinted" style=""><span class="pln">role</span><span class="pun">=</span><span class="str">"menuitem"</span></code> for each of the links therein, because if we do, assistive technology will no longer interpret the links as links, but instead, as menu items, and the links in our global navigation will no longer show up when a screen reader user executes a shortcut command to bring up a list of links in the page.</p> 30584 * @example <h4>HTML</h4><hr/> 30585 <nav> 30586 <ul class="nav-menu"> 30587 <li class="nav-item"> 30588 <a href="?movie">Movies</a> 30589 <div class="sub-nav"> 30590 <ul class="sub-nav-group"> 30591 <li><a href="?movie&genre=0">Action &amp; Adventure</a></li> 30592 <li><a href="?movie&genre=2">Children &amp; Family</a></li> 30593 <li>&#8230;</li> 30594 </ul> 30595 <ul class="sub-nav-group"> 30596 <li><a href="?movie&genre=7">Dramas</a></li> 30597 <li><a href="?movie&genre=9">Foreign</a></li> 30598 <li>&#8230;</li> 30599 </ul> 30600 <ul class="sub-nav-group"> 30601 <li><a href="?movie&genre=14">Musicals</a></li> 30602 <li><a href="?movie&genre=15">Romance</a></li> 30603 <li>&#8230;</li> 30604 </ul> 30605 </div> 30606 </li> 30607 <li class="nav-item"> 30608 <a href="?tv">TV Shows</a> 30609 <div class="sub-nav"> 30610 <ul class="sub-nav-group"> 30611 <li><a href="?tv&genre=20">Classic TV</a></li> 30612 <li><a href="?tv&genre=21">Crime TV</a></li> 30613 <li>&#8230;</li> 30614 </ul> 30615 <ul class="sub-nav-group"> 30616 <li><a href="?tv&genre=27">Reality TV</a></li> 30617 <li><a href="?tv&genre=30">TV Action</a></li> 30618 <li>&#8230;</li> 30619 </ul> 30620 <ul class="sub-nav-group"> 30621 <li><a href="?tv&genre=33">TV Dramas</a></li> 30622 <li><a href="?tv&genre=34">TV Horror</a></li> 30623 <li>&#8230;</li> 30624 </ul> 30625 </div> 30626 </li> 30627 </ul> 30628 </nav> 30629 * @example <h4>CSS</h4><hr/> 30630 /* Rudimentary mega menu CSS for demonstration */ 30631 30632 /* mega menu list */ 30633 .nav-menu { 30634 display: block; 30635 position: relative; 30636 list-style: none; 30637 margin: 0; 30638 padding: 0; 30639 z-index: 15; 30640} 30641 30642 /* a top level navigation item in the mega menu */ 30643 .nav-item { 30644 list-style: none; 30645 display: inline-block; 30646 padding: 0; 30647 margin: 0; 30648} 30649 30650 /* first descendant link within a top level navigation item */ 30651 .nav-item > a { 30652 position: relative; 30653 display: inline-block; 30654 padding: 0.5em 1em; 30655 margin: 0 0 -1px 0; 30656 border: 1px solid transparent; 30657} 30658 30659 /* focus/open states of first descendant link within a top level 30660 navigation item */ 30661 .nav-item > a:focus, 30662 .nav-item > a.open { 30663 border: 1px solid #dedede; 30664} 30665 30666 /* open state of first descendant link within a top level 30667 navigation item */ 30668 .nav-item > a.open { 30669 background-color: #fff; 30670 border-bottom: none; 30671 z-index: 1; 30672} 30673 30674 /* sub-navigation panel */ 30675 .sub-nav { 30676 position: absolute; 30677 display: none; 30678 top: 2.2em;
30679 margin-top: -1px; 30680 padding: 0.5em 1em; 30681 border: 1px solid #dedede; 30682 background-color: #fff; 30683} 30684 30685 /* sub-navigation panel open state */ 30686 .sub-nav.open { 30687 display: block; 30688} 30689 30690 /* list of items within sub-navigation panel */ 30691 .sub-nav ul { 30692 display: inline-block; 30693 vertical-align: top; 30694 margin: 0 1em 0 0; 30695 padding: 0; 30696} 30697 30698 /* list item within sub-navigation panel */ 30699 .sub-nav li { 30700 display: block; 30701 list-style-type: none; 30702 margin: 0; 30703 padding: 0; 30704} 30705 * @example <h4>JavaScript</h4><hr/> 30706 <!-- include jquery --> 30707 <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> 30708 30709 <!-- include the jquery-accessibleMegaMenu plugin script --> 30710 <script src="js/jquery-accessibleMegaMenu.js"></script> 30711 30712 <!-- initialize a selector as an accessibleMegaMenu --> 30713 <script> 30714 $("nav:first").accessibleMegaMenu({ 30715 /* prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby */ 30716 uuidPrefix: "accessible-megamenu", 30717 30718 /* css class used to define the megamenu styling */ 30719 menuClass: "nav-menu", 30720 30721 /* css class for a top-level navigation item in the megamenu */ 30722 topNavItemClass: "nav-item", 30723 30724 /* css class for a megamenu panel */ 30725 panelClass: "sub-nav", 30726 30727 /* css class for a group of items within a megamenu panel */ 30728 panelGroupClass: "sub-nav-group", 30729 30730 /* css class for the hover state */ 30731 hoverClass: "hover", 30732 30733 /* css class for the focus state */ 30734 focusClass: "focus", 30735 30736 /* css class for the open state */ 30737 openClass: "open" 30738 }); 30739 </script> 30740 * @param {object} [options] Mega Menu options 30741 * @param {string} [options.uuidPrefix=accessible-megamenu] - Prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby 30742 * @param {string} [options.menuClass=accessible-megamenu] - CSS class used to define the megamenu styling 30743 * @param {string} [options.topNavItemClass=accessible-megamenu-top-nav-item] - CSS class for a top-level navigation item in the megamenu 30744 * @param {string} [options.panelClass=accessible-megamenu-panel] - CSS class for a megamenu panel 30745 * @param {string} [options.panelGroupClass=accessible-megamenu-panel-group] - CSS class for a group of items within a megamenu panel 30746 * @param {string} [options.hoverClass=hover] - CSS class for the hover state 30747 * @param {string} [options.focusClass=focus] - CSS class for the focus state 30748 * @param {string} [options.openClass=open] - CSS class for the open state 30749 * @param {string} [options.openDelay=0] - Open delay when opening menu via mouseover 30750 * @param {string} [options.closeDelay=250] - Open delay when opening menu via mouseover 30751 * @param {boolean} [options.openOnMouseover=false] - Should menu open on mouseover 30752 */ 30753 $.fn[pluginName] = function (options) { 30754 return this.each(function () { 30755 var pluginInstance = $.data(this, "plugin_" + pluginName); 30756 if (!pluginInstance) { 30757 $.data(this, "plugin_" + pluginName, new $.fn[pluginName].Acce
30757ssibleMegaMenu(this, options)); 30758 } else if (typeof pluginInstance[options] === 'function') { 30759 pluginInstance[options].apply(pluginInstance, Array.prototype.slice.call(arguments, 1)); 30760 } 30761 }); 30762 }; 30763 30764 $.fn[pluginName].AccessibleMegaMenu = AccessibleMegaMenu; 30765 30766 /* :focusable and :tabbable selectors from 30767 https://raw.github.com/jquery/jquery-ui/master/ui/jquery.ui.core.js */ 30768 30769 /** 30770 * @private 30771 */ 30772 function visible(element) { 30773 return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function () { 30774 return $.css(this, "visibility") === "hidden"; 30775 }).length; 30776 } 30777 30778 /** 30779 * @private 30780 */ 30781 function focusable(element, isTabIndexNotNaN) { 30782 var map, mapName, img, 30783 nodeName = element.nodeName.toLowerCase(); 30784 if ("area" === nodeName) { 30785 map = element.parentNode; 30786 mapName = map.name; 30787 if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") { 30788 return false; 30789 } 30790 img = $("img[usemap=#" + mapName + "]")[0]; 30791 return !!img && visible(img); 30792 } 30793 return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : 30794 "a" === nodeName ? 30795 element.href || isTabIndexNotNaN : 30796 isTabIndexNotNaN) && 30797 // the element and all of its ancestors must be visible 30798 visible(element); 30799 } 30800 30801 $.extend($.expr[":"], { 30802 data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) { 30803 return function (elem) { 30804 return !!$.data(elem, dataName); 30805 }; 30806 }) : // support: jQuery <1.8 30807 function (elem, i, match) { 30808 return !!$.data(elem, match[3]); 30809 }, 30810 30811 focusable: function (element) { 30812 return focusable(element, !isNaN($.attr(element, "tabindex"))); 30813 }, 30814 30815 tabbable: function (element) { 30816 var tabIndex = $.attr(element, "tabindex"), 30817 isTabIndexNaN = isNaN(tabIndex); 30818 return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); 30819 } 30820 }); 30821}(jQuery, window, document)); 30822 30823 30824/***/ }), 30825 30826/***/ 2385: 30827/***/ (function() { 30828 30829// Setzt eine Hilfsklasse, falls Browser diesen Selektor nicht unterstützen: 30830// .contentMain:not(:has(.documentContent__content>*)) 30831 30832function assignFallbackClassToContentMain() { 30833 // Selektiert alle Elemente, die der Klasse '.contentMain' angehören. 30834 const contentMainElements = document.querySelectorAll('.contentMain'); 30835 30836 // Durchläuft jedes Element in der Liste der '.contentMain'-Elemente. 30837 contentMainElements.forEach(contentMainElement => { 30838 30839 // Ermittelt alle direkten Kinder des Elements mit der spezifischen Klasse. 30840 const documentContentContentChildren = 30841 contentMainElement.querySelectorAll('.documentContent__content > *'); 30842 30843 // Prüft, ob das Element keine solchen Kinder hat. 30844 if (documentContentContentChildren.length === 0) { 30845 // Weist dem Element die Klasse 'contentMain--hasNoContent' zu, wenn es keine Kinder hat. 30846 contentMainElement.classList.add('contentMain--hasNoContent'); 30847 } 30848 }); 30849} 30850 30851// Führt die Funktion aus, sobald das gesamte Dokument geladen wurde. 30852document.addEventListener('DOMContentLoaded', assignFallbackClassToContentMain); 30853 30854 30855/***/ }), 30856 30857/***/ 7242: 30858/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 30859 30860/* provided dependency */ var $ = __webpack_require__(3336); 30861const debug = true; 30862const buttonThemeDisabled = 'button--outline'; 30863const buttonThemeEnabled = 'button--primary'; 30864 30865$.when($.ready).then(() => { 30866 if (debug) { 30867 console.log('cookieman initialised on ready'); 30868 } 30869 30870 const $modal = $('#cookieman-modal'); 30871 30872 if ($modal.length < 1) { 30873 return; 30874 } 30875 30876 const $checkboxes = $modal.find('input[type="checkbox"]'); 30877 const $saveButton = $modal.find('[data-cookieman-save]'); 30878 30879 $checkboxes.change(() => { 30880 $saveButton.removeClass(buttonThemeDisabled).addClass(buttonThemeEnabled); 30881 }) 30882}); 30883 30884/***/ }), 30885 30886/***/ 7172: 30887/***/ (function() { 30888 30889const options = { 30890 selector: '.expand', 30891} 30892 30893function initExpand(expand) { 30894 30895 /** 30896 * Switch Labels with Open/Closed Expand State 30897 */ 30898 const expandButton = expand.querySelectorAll('.expand-button').item(0); 30899 const expandButtonText = expandButton.querySelectorAll('[data-expand-label]').item(0); 30900 const label = expandButton.textContent.trim(); 30901 const switchLabel = expandButton.getAttribute('data-expand-switch-label').trim(); 30902 30903 document.querySelectorAll(expandButton.getAttribute('data-bs-target')).forEac
30903h(function (e) { 30904 e.addEventListener('show.bs.collapse', function () { 30905 expandButtonText.textContent = switchLabel; 30906 }) 30907 30908 e.addEventListener('hide.bs.collapse', function () { 30909 expandButtonText.textContent = label; 30910 }) 30911 }) 30912} 30913 30914function init(selector = options.selector) { 30915 const expands = document.querySelectorAll(selector); 30916 30917 if (expands.length < 1) { 30918 return; 30919 } 30920 30921 expands.forEach(initExpand); 30922} 30923 30924document.addEventListener('DOMContentLoaded', function () { 30925 init(); 30926}); 30927 30928 30929/***/ }), 30930 30931/***/ 690: 30932/***/ (function() { 30933 30934document.addEventListener('DOMContentLoaded', function () { 30935 // Füge hier deinen Code ein 30936 console.log('DOM fully loaded and parsed'); 30937 30938// Wähle alle Buttons aus 30939 var buttons = document.querySelectorAll('.basicTeaser .basicTeaser__description__toggle'); 30940 30941// Füge jedem Button einen Event-Listener hinzu 30942 buttons.forEach(function (button) { 30943 button.addEventListener('click', function (event) { 30944 // Verhindere das Standardverhalten des Buttons 30945 event.preventDefault(); 30946 30947 // Hole das zugehörige Inhalts-Element 30948 var content = document.querySelector('#' + button.getAttribute('aria-controls')); 30949 30950 // Prüfe den aktuellen Zustand des Buttons 30951 var isExpanded = button.getAttribute('aria-expanded') === 'true'; 30952 30953 // Wechsle den Zustand des Buttons und des Inhalts 30954 button.setAttribute('aria-expanded', !isExpanded); 30955 if (isExpanded) { 30956 content.classList.remove('expanded'); 30957 } else { 30958 content.classList.add('expanded'); 30959 } 30960 }); 30961 }); 30962}); 30963 30964 30965/***/ }), 30966 30967/***/ 1295: 30968/***/ (function() { 30969 30970document.addEventListener("DOMContentLoaded", function() { 30971 const coElements = document.querySelectorAll('.documentContent__content > .co'); 30972 30973 coElements.forEach((el, index) => { 30974 const container = el.querySelector('.container'); 30975 if (!container) return; // Wenn kein .container gefunden wurde, überspringe das Element 30976 30977 const bgClasses = Array.from(container.classList).filter(cls => cls.startsWith('bg--')); 30978 30979 // Ãberprüfe das vorherige .co Element, wenn es existiert 30980 if (index > 0) { 30981 const prevContainer = coElements[index - 1].querySelector('.container'); 30982 if (prevContainer) { 30983 const prevBgClasses = Array.from(prevContainer.classList).filter(cls => cls.startsWith('bg--')); 30984 // Prüfe auf vollständige Ãbereinstimmung der BG-Klassen 30985 if (bgClasses.length === prevBgClasses.length && bgClasses.every(cls => prevBgClasses.includes(cls))) { 30986 el.classList.add('preceeded-by-same-bg'); 30987 coElements[index - 1].classList.add('followed-by-same-bg'); 30988 } 30989 } 30990 } 30991 30992 // Ãberprüfe das nächste .co Element, wenn es existiert 30993 if (index < coElements.length - 1) { 30994 const nextContainer = coElements[index + 1].querySelector('.container'); 30995 if (nextContainer) { 30996 const nextBgClasses = Array.from(nextContainer.classList).filter(cls => cls.startsWith('bg--')); 30997 // Prüfe auf vollständige Ãbereinstimmung der BG-Klassen 30998 if (bgClasses.length === nextBgClasses.length && bgClasses.every(cls => nextBgClasses.includes(cls))) { 30999 el.classList.add('followed-by-same-bg'); 31000 coElements[index + 1].classList.add('preceded-by-same-bg'); 31001 } 31002 } 31003 } 31004 }); 31005}); 31006 31007 31008/***/ }), 31009 31010/***/ 3506: 31011/***/ (function() { 31012 31013// IIFE, die prüft, ob der Browser den CSS-Selektor ":has" unterstützt 31014const _supportsHasSelector = (() => { 31015 try { 31016 // Versucht, den ":has" Selektor anzuwenden, um die Unterstützung zu überprüfen 31017 document.createElement('div').querySelector(':has(*)'); 31018 return true; // Unterstützt ":has" Selektor 31019 } catch (e) { 31020 return false; // Unterstützt nicht ":has" Selektor 31021 } 31022})(); 31023 31024function evaluateContentTables() { 31025 // Beendet die Funktion, wenn der Browser den ":has" Selektor unterstützt 31026 if (_supportsHasSelector) { 31027 return; 31028 } 31029 31030 // Wählt alle Elemente mit der Klasse "contenttable" aus 31031 const contentTables = document.querySelectorAll('.contenttable');
31032 contentTables.forEach((contentTable) => { 31033 // Ãberprüft, ob das "contentTable" Element ein "th" Element enthält 31034 const hasTH = contentTable.querySelectorAll('th').length > 0; 31035 // Fügt die Klasse "contenttable--has-th" hinzu oder entfernt sie, abhängig vom Wert von "hasTH" 31036 contentTable.classList.toggle('contenttable--has-th', hasTH); 31037 //contentTable.classList.toggle('contenttable--plain', !hasTH); 31038 // ^^ Funktioniert nicht, weil die Seite kaputt angelegt wurde. 31039 // Jetzt müssten alle RTE-Tabellen angepasst werden, 31040 // für die der Workaround mit der leeren ersten Zeile angewendet wurde 31041 }); 31042} 31043 31044// Fügt einen EventListener für das DOMContentLoaded Ereignis hinzu 31045document.addEventListener('DOMContentLoaded', () => { 31046 evaluateContentTables(); 31047 31048 document.addEventListener('ajaxLoadmore', () => { 31049 evaluateContentTables(); 31050 }); 31051}); 31052 31053 31054/***/ }), 31055 31056/***/ 3336: 31057/***/ (function(module) { 31058 31059"use strict"; 31060module.exports = $; 31061 31062/***/ }) 31063 31064/******/ }); 31065/************************************************************************/ 31066/******/ // The module cache 31067/******/ var __webpack_module_cache__ = {}; 31068/******/ 31069/******/ // The require function 31070/******/ function __webpack_require__(moduleId) { 31071/******/ // Check if module is in cache 31072/******/ var cachedModule = __webpack_module_cache__[moduleId]; 31073/******/ if (cachedModule !== undefined) { 31074/******/ return cachedModule.exports; 31075/******/ } 31076/******/ // Create a new module (and put it into the cache) 31077/******/ var module = __webpack_module_cache__[moduleId] = { 31078/******/ // no module.id needed 31079/******/ // no module.loaded needed 31080/******/ exports: {} 31081/******/ }; 31082/******/ 31083/******/ // Execute the module function 31084/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31085/******/ 31086/******/ // Return the exports of the module 31087/******/ return module.exports; 31088/******/ } 31089/******/ 31090/************************************************************************/ 31091/******/ /* webpack/runtime/compat get default export */ 31092/******/ !function() { 31093/******/ // getDefaultExport function for compatibility with non-harmony modules 31094/******/ __webpack_require__.n = function(module) { 31095/******/ var getter = module && module.__esModule ? 31096/******/ function() { return module['default']; } : 31097/******/ function() { return module; }; 31098/******/ __webpack_require__.d(getter, { a: getter }); 31099/******/ return getter; 31100/******/ }; 31101/******/ }(); 31102/******/ 31103/******/ /* webpack/runtime/define property getters */ 31104/******/ !function() { 31105/******/ // define getter functions for harmony exports 31106/******/ __webpack_require__.d = function(exports, definition) { 31107/******/ for(var key in definition) { 31108/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 31109/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 31110/******/ } 31111/******/ } 31112/******/ }; 31113/******/ }(); 31114/******/ 31115/******/ /* webpack/runtime/hasOwnProperty shorthand */ 31116/******/ !function() { 31117/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 31118/******/ }(); 31119/******/ 31120/******/ /* webpack/runtime/make namespace object */ 31121/******/ !function() { 31122/******/ // define __esModule on exports 31123/******/ __webpack_require__.r = function(exports) { 31124/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 31125/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 31126/******/ } 31127/******/ Object.defineProperty(exports, '__esModule', { value: true }); 31128/******/ }; 31129/******/ }(); 31130/******/ 31131/************************************************************************/ 31132var __webpack_exports__ = {}; 31133// This entry need to be wrapped in an IIFE because it need to be in strict mode. 31134!function() { 31135"use strict"; 31136 31137// NAMESPACE OBJECT: ./node_modules/@popperjs/core/lib/index.js 31138var lib_namespaceObject = {}; 31139__webpack_require__.r(lib_namespaceObject); 31140__webpack_require__.d(lib_namespaceObject, { 31141 "afterMain": function() { return afterMain; }, 31142 "afterRead": function() { return afterRead; }, 31143 "afterWrite": function() { return afterWrite; }, 31144 "applyStyles": function() { return modifiers_applyStyles; }, 31145 "arrow": function() { return modifiers_arrow; }, 31146 "auto": function() { return auto; }, 31147 "basePlacements": function() { return basePlacements; }, 31148 "beforeMain": function() { return beforeMain; }, 31149 "beforeRead": function() { return beforeRead; }, 31150 "beforeWrite": function() { return beforeWrite; }, 31151 "bottom": function() { return bottom; }, 31152 "clippingParents": function() { return clippingParents; }, 31153 "computeStyles": function() { return modifiers_computeStyles; }, 31154 "createPopper": function() { return popper_createPopper; }, 31155 "createPopperBase": function() { return createPopper; }, 31156 "createPopperLite": function() { return popper_lite_createPopper; }, 31157 "detectOverflow": function() { return detectOverflow; }, 31158 "end": function() { return end; }, 31159 "eventListeners": function() { return eventListeners; }, 31160 "flip": function() { return modifiers_flip; }, 31161 "hide": function() { return modifiers_hide; },
31162 "left": function() { return left; }, 31163 "main": function() { return main; }, 31164 "modifierPhases": function() { return modifierPhases; }, 31165 "offset": function() { return modifiers_offset; }, 31166 "placements": function() { return enums_placements; }, 31167 "popper": function() { return popper; }, 31168 "popperGenerator": function() { return popperGenerator; }, 31169 "popperOffsets": function() { return modifiers_popperOffsets; }, 31170 "preventOverflow": function() { return modifiers_preventOverflow; }, 31171 "read": function() { return read; }, 31172 "reference": function() { return reference; }, 31173 "right": function() { return right; }, 31174 "start": function() { return start; }, 31175 "top": function() { return enums_top; }, 31176 "variationPlacements": function() { return variationPlacements; }, 31177 "viewport": function() { return viewport; }, 31178 "write": function() { return write; } 31179}); 31180 31181// EXTERNAL MODULE: external "$" 31182var external_$_ = __webpack_require__(3336); 31183var external_$_default = /*#__PURE__*/__webpack_require__.n(external_$_); 31184;// CONCATENATED MODULE: ./src/modules/components/accordionNav/accordionNav.main.js 31185/** 31186 * ARIA Handling not compatible to Accessible Mega Menu in hover mode on Firefox. 31187 * To use ARIA Handling, set openOnMouseover to false in accessibleMegaMenu 31188 */ 31189 31190 31191 31192function changeState(state, $button, $label, $panel) { 31193 31194 /** ARIA Handling disabled */ 31195 $button.data('expanded', !state); 31196 $button.toggleClass('open-accordion'); 31197 // .attr({'aria-expanded': !state}) 31198 // .prop({'aria-expanded': !state}); 31199 31200 $label.toggleClass('open-accordion'); 31201 31202 /** ARIA Handling disabled */ 31203 $panel.toggleClass('open-accordion'); 31204 $panel.data('expanded', !state); 31205 // .attr({'aria-expanded': !state, 'aria-hidden': state}) 31206 // .prop({'aria-expanded': !state, 'aria-hidden': state}); 31207} 31208 31209function closeSiblings($btn) { 31210 $btn.parent().siblings('.has-accordion-panel').each((i, el) => { 31211 const $el = external_$_default()(el); 31212 const $button = $el.find('> .accordion-panel-toggle'); 31213 const $label = $el.find('> a'); 31214 const $panel = $el.find('> .secondLevel, > .thirdLevel'); 31215 31216 /** ARIA Handling disabled */ 31217 $button.data('expanded', false); 31218 $button.removeClass('open-accordion'); 31219 // .attr({'aria-expanded': false}) 31220 // .prop({'aria-expanded': false}); 31221 31222 $label.removeClass('open-accordion'); 31223 31224 /** ARIA Handling disabled */ 31225 $panel.data('expanded', false); 31226 $panel.removeClass('open-accordion'); 31227 // .attr({'aria-expanded': false, 'aria-hidden': true}) 31228 // .prop({'aria-expanded': false, 'aria-hidden': true}); 31229 }); 31230} 31231 31232function scaffold(i, el) { 31233 const $panel = external_$_default()(el); 31234 const $label = $panel.prev('a'); 31235 const svg = document.getElementById('accordionNav__panel-svg').outerHTML; 31236 31237 const $button = external_$_default()('<button class="accordion-panel-toggle"></button>'); 31238 const buttonLabelOpen = `Untermenü von ${$label.text()} anzeigen`; 31239 const buttonLabelClose = `Untermenü von ${$label.text()} ausblenden`; 31240 31241 $button 31242 .text(buttonLabelOpen) 31243 .data({ 31244 labelOpen: buttonLabelOpen, 31245 labelClose: buttonLabelClose 31246 }); 31247 31248 /** ARIA Handling disabled */ 31249 // const idLabel = `accordion-nav-sub-label-${i}`; 31250 // const idPanel = `accordion-nav-sub-panel-${i}`; 31251 // $button.attr({ 31252 // 'aria-controls': idPanel, 31253 // 'aria-expanded': false, 31254 // id: idLabel, 31255 // role: 'region' 31256 // }); 31257 // $panel.attr({ 31258 // 'aria-expanded': false, 31259 // 'aria-hidden': true, 31260 // 'aria-labeledby': idLabel, 31261 // id: idPanel, 31262 // role: 'region' 31263 // }); 31264 31265 $button.data('expanded', false); 31266 $panel.data('expanded', false); 31267 31268 /* delegate click on label to the button */ 31269 $label.click((evt) => { 31270 if (!$button.data('expanded')) { 31271 evt.preventDefault(); 31272 $button.trigger('click'); 31273 } 31274 }); 31275 31276 /* handle click on toggle: switch between open and close */ 31277 $button.click((evt) => { 31278 const state = $button.data('expanded'); 31279 31280 evt.preventDefault(); 31281 31282 changeState(state, $button, $label, $panel); 31283 closeSiblings($button); 31284 31285 external_$_default()(window).trigger('accordionNav:toggle'); 31286 }); 31287 31288 $button.append(external_$_default()(svg).removeAttr('id')); 31289 31290 /* add functional classnames */ 31291 $panel.addClass('accordion-panel'); 31292 $panel.parent().addClass('has-accordion-panel'); 31293 31294 /* add button to the dom */ 31295 $panel.before($button); 31296} 31297 31298/* Init on DOM ready */ 31299function init(selector = '.accordionNav .subNav') { 31300 console.log('accordionNav initialised through accordionNav on: ' + selector); 31301 31302 external_$_default()(selector).each(scaffold); 31303} 31304 31305external_$_default().when((external_$_default()).ready).then(() => { 31306 console.log('accordionNav initialised on DOMContentLoaded'); 31307 31308 // init modes 31309 init('.accordionNav .secondLevel'); 31310 init('.accordionNav .thirdLevel'); 31311}); 31312 31313 31314/* Init on document load */ 31315function load() { 31316 31317} 31318 31319;
31319// CONCATENATED MODULE: ./src/modules/components/ajaxLoadmore/ajaxLoadmore.main.js 31320 31321 31322function handleError($module) { 31323 $module.removeClass('ajaxLoadmore--is-processing'); 31324 31325 // show some form of error message 31326 $module.attr('aria-live', 'assertive'); 31327 $module.removeClass('ajaxLoadmore--has-success'); 31328 $module.addClass('ajaxLoadmore--has-error'); 31329 $module.data('error-count', $module.data('error-count') + 1); 31330 31331 // dismiss 31332 setTimeout(() => { 31333 $module.attr('aria-live', 'off'); 31334 $module.removeClass('ajaxLoadmore--has-error'); 31335 31336 // disable module after third error in row 31337 if ($module.data('error-count') > 2) { 31338 $module.find('.ajaxLoadmore__button').attr('disable', 'disable'); 31339 $module.addClass('ajaxLoadmore--has-finished'); 31340 } 31341 }, 5000); 31342 31343 $module.data('is-loading', false); 31344 $module.find('button').trigger('button:removeLoader'); 31345} 31346 31347function loadContent($module, $list) { 31348 const url = $module.data('nextpage'); 31349 const $lastListItemBeforeLoadmore = $list.find('.teaserList__item').last(); 31350 $module.addClass('ajaxLoadmore--is-processing'); 31351 31352 external_$_default().get({ 31353 dataType: 'json', 31354 url: url, 31355 success: function (responseData) { 31356 if (!responseData.data) { 31357 handleError($module); 31358 31359 return; 31360 } 31361 31362 const $el = external_$_default()(responseData.data).find('.teaserList__item'); 31363 31364 $el.appendTo($list).fadeIn(); 31365 31366 $el.each(function () { 31367 external_$_default()(document).trigger('ajaxLoadmore', this); 31368 }); 31369 31370 $module.removeClass('ajaxLoadmore--is-processing'); 31371 $module.data('is-loading', false); 31372 31373 if (responseData.nextpage === '') { 31374 $module.addClass('ajaxLoadmore--has-finished'); 31375 $module.find('button').trigger('button:removeLoader'); 31376 31377 return; 31378 } 31379 31380 $module.data('nextpage', responseData.nextpage); 31381 $module.removeClass('ajaxLoadmore--has-error'); 31382 $module.addClass('ajaxLoadmore--has-success'); 31383 31384 // reset error count 31385 $module.data('error-count', 0); 31386 31387 $module.data('is-loading', false); 31388 31389 // focus on newest element to keep flow for keyboard users 31390 $lastListItemBeforeLoadmore.next().find('a').focus(); 31391 $module.find('button').trigger('button:removeLoader'); 31392 }, 31393 error: function () { 31394 handleError($module); 31395 } 31396 }); 31397} 31398 31399function initloadmore() { 31400 const $module = external_$_default()(this); 31401 const $button = $module.find('.button'); 31402 const $list = $module.closest('.co').find('.teaserList').eq(0); 31403 31404 $module.data('error-count', 0); 31405 $module.data('nextpage', $module.attr('data-url')); 31406 // keep reference to first URL in case user klicks 'show less' 31407 $module.data('firstUrl', $module.data('nextpage')); 31408 $module.data('moreButton', $button); 31409 31410 $button.click(function () { 31411 if ($module.data('is-loading') === true) { 31412 return; 31413 } 31414 31415 $module.data('is-loading', true); 31416 loadContent($module, $list); 31417 }); 31418} 31419 31420/** 31421 * Init on DOM ready 31422 */ 31423external_$_default().when((external_$_default()).ready).then(() => { 31424 console.log('ajaxLoadmore initialised on DOMContentLoaded'); 31425}); 31426 31427/** 31428 * Init on document load 31429 */ 31430external_$_default()(window).on('load', () => { 31431 console.log('ajaxLoadmore initialised on load'); 31432 external_$_default()('.ajaxLoadmore').each(initloadmore); 31433}); 31434 31435;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/characterNav/characterNav.main.js 31436 31437 31438external_$_default().when((external_$_default()).ready).then(() => { 31439 console.log('characterNav initialised on ready'); 31440 31441 const $charFilter = external_$_default()('.co__characterFilter'); 31442 31443 if ($charFilter.length < 1) { 31444 return; 31445 } 31446 31447 const $listItem = $charFilter.find('li'); 31448 const $teaser = $charFilter.parent().next('.co__main').find('.teaserList .teaserList__item'); 31449 let alphabet = []; 31450 31451 $teaser.each(function () { 31452 const $this = external_$_default()(this); 31453 let dataAttr = $this.data('jump'); 31454 31455 // bail if undefined 31456 if (typeof dataAttr === 'undefined') { 31457 return; 31458 } 31459 31460 if (!alphabet.includes(dataAttr)) { 31461 alphabet.push(dataAttr); 31462 } 31463 }); 31464 31465 $listItem.each(function () { 31466 const $this = external_$_default()(this); 31467 const $link = $this.find('a'); 31468 const letter = $link.data('jumptarget'); 31469 31470 if (!alphabet.includes(letter)) { 31471 const linkHtml = $link.html(); 31472 $link.before('<span>' + linkHtml + '</span>'); 31473 $link.remove(); 31474 } 31475 }); 31476}); 31477 31478external_$_default()(window).on('load', () => { 31479 // console.log('characterNav initialised on load'); 31480}); 31481 31482;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/index.js 31483/** 31484 * -------------------------------------------------------------------------- 31485 * Bootstrap (v5.1.3): util/index.js 31486 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 31487 * -------------------------------------------------------------------------- 31488 */ 31489 31490const MAX_UID = 1000000 31491const MILLISECONDS_MULTIPLIER = 1000 31492const TRANSITION_END = 'transitionend' 31493 31494// Shoutout AngusCroll (https://goo.gl/pxwQGp) 31495const toType = obj => { 31496 if (obj === null || obj === undefined) { 31497 return `${obj}` 31498 } 31499 31500 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() 31501} 31502 31503/** 31504 * -------------------------------------------------------------------------- 31505 * Public Util Api 31506 * -------------------------------------------------------------------------- 31507 */ 31508 31509const getUID = prefix => { 31510 do { 31511 prefix += Math.floor(Math.random() * MAX_UID) 31512 } while (document.getElementById(prefix)) 31513 31514 return prefix 31515} 31516 31517const getSelector = element => { 31518 let selector = element.getAttribute('data-bs-target') 31519 31520 if (!selector || selector === '#') { 31521 let hrefAttr = element.getAttribute('href') 31522 31523 // The only valid content that could double as a selector are IDs or classes, 31524 // so everything starting with `#` or `.`. If a "real" URL is used as the selector, 31525 // `document.querySelector` will rightfully complain it is invali
31525d. 31526 // See https://github.com/twbs/bootstrap/issues/32273 31527 if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) { 31528 return null 31529 } 31530 31531 // Just in case some CMS puts out a full URL with the anchor appended 31532 if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) { 31533 hrefAttr = `#${hrefAttr.split('#')[1]}` 31534 } 31535 31536 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null 31537 } 31538 31539 return selector 31540} 31541 31542const getSelectorFromElement = element => { 31543 const selector = getSelector(element) 31544 31545 if (selector) { 31546 return document.querySelector(selector) ? selector : null 31547 } 31548 31549 return null 31550} 31551 31552const getElementFromSelector = element => { 31553 const selector = getSelector(element) 31554 31555 return selector ? document.querySelector(selector) : null 31556} 31557 31558const getTransitionDurationFromElement = element => { 31559 if (!element) { 31560 return 0 31561 } 31562 31563 // Get transition-duration of the element 31564 let { transitionDuration, transitionDelay } = window.getComputedStyle(element) 31565 31566 const floatTransitionDuration = Number.parseFloat(transitionDuration) 31567 const floatTransitionDelay = Number.parseFloat(transitionDelay) 31568 31569 // Return 0 if element or transition duration is not found 31570 if (!floatTransitionDuration && !floatTransitionDelay) { 31571 return 0 31572 } 31573 31574 // If multiple durations are defined, take the first 31575 transitionDuration = transitionDuration.split(',')[0] 31576 transitionDelay = transitionDelay.split(',')[0] 31577 31578 return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER 31579} 31580 31581const triggerTransitionEnd = element => { 31582 element.dispatchEvent(new Event(TRANSITION_END)) 31583} 31584 31585const isElement = obj => { 31586 if (!obj || typeof obj !== 'object') { 31587 return false 31588 } 31589 31590 if (typeof obj.jquery !== 'undefined') { 31591 obj = obj[0] 31592 } 31593 31594 return typeof obj.nodeType !== 'undefined' 31595} 31596 31597const getElement = obj => { 31598 if (isElement(obj)) { // it's a jQuery object or a node element 31599 return obj.jquery ? obj[0] : obj 31600 } 31601 31602 if (typeof obj === 'string' && obj.length > 0) { 31603 return document.querySelector(obj) 31604 } 31605 31606 return null 31607} 31608 31609const typeCheckConfig = (componentName, config, configTypes) => { 31610 Object.keys(configTypes).forEach(property => { 31611 const expectedTypes = configTypes[property] 31612 const value = config[property] 31613 const valueType = value && isElement(value) ? 'element' : toType(value) 31614 31615 if (!new RegExp(expectedTypes).test(valueType)) { 31616 throw new TypeError( 31617 `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".` 31618 ) 31619 } 31620 }) 31621} 31622 31623const isVisible = element => { 31624 if (!isElement(element) || element.getClientRects().length === 0) { 31625 return false 31626 } 31627 31628 return getComputedStyle(element).getPropertyValue('visibility') === 'visible' 31629} 31630 31631const isDisabled = element => { 31632 if (!element || element.nodeType !== Node.ELEMENT_NODE) { 31633 return true 31634 } 31635 31636 if (element.classList.contains('disabled')) { 31637 return true 31638 } 31639 31640 if (typeof element.disabled !== 'undefined') { 31641 return element.disabled 31642 } 31643 31644 return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false' 31645} 31646 31647const findShadowRoot = element => { 31648 if (!document.documentElement.attachShadow) { 31649 return null 31650 } 31651 31652 // Can find the shadow root otherwise it'll return the document 31653 if (typeof element.getRootNode === 'function') { 31654 const root = element.getRootNode() 31655 return root instanceof ShadowRoot ? root : null 31656 } 31657 31658 if (element instanceof ShadowRoot) { 31659 return element 31660 } 31661 31662 // when we don't find a shadow root 31663 if (!element.parentNode) { 31664 return null 31665 } 31666 31667 return findShadowRoot(element.parentNode) 31668} 31669 31670const noop = () => {} 31671 31672/** 31673 * Trick to restart an element's animation 31674 * 31675 * @param {HTMLElement} element 31676 * @return void 31677 * 31678 * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation 31679 */ 31680const reflow = element => { 31681 // eslint-disable-next-line no-unused-expressions 31682 element.offsetHeight 31683} 31684 31685const getjQuery = () => { 31686 const { jQuery } = window 31687 31688 if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { 31689 return jQuery 31690 } 31691 31692 return null 31693} 31694 31695const DOMContentLoadedCallbacks = [] 31696 31697const onDOMContentLoaded = callback => { 31698 if (document.readyState === 'loading') { 31699 // add listener on the first call when the document is in loading state 31700 if (!DOMContentLoadedCallbacks.length) { 31701 document.addEventListener('DOMContentLoaded', () => { 31702 DOMContentLoadedCallbacks.forEach(callback => callback()) 31703 }) 31704 } 31705 31706 DOMContentLoadedCallbacks.push(callback) 31707 } else { 31708 callback() 31709 } 31710} 31711 31712const isRTL = () => document.documentElement.dir === 'rtl' 31713 31714const defineJQueryPlugin = plugin => { 31715 onDOMContentLoaded(() => { 31716 const $ = getjQuery() 31717 /* istanbul ignore if */ 31718 if ($) { 31719 const name = plugin.NAME 31720 const JQUERY_NO_CONFLICT = $.fn[name] 31721 $.fn[name] = plugin.jQueryInterface 31722 $.fn[name].Constructor = plugin 31723 $.fn[name].noConflict = () => { 31724 $.fn[name] = JQUERY_NO_CONFLICT 31725 return plugin.jQueryInterface 31726 } 31727 } 31728 }) 31729} 31730 31731const execute = callback => { 31732 if (typeof callback === 'function') { 31733 callback() 31734 } 31735} 31736 31737const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { 31738 if (!waitForTransition) { 31739 execute(callback) 31740 return 31741 } 31742 31743 const durationPadding = 5 31744 const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding 31745 31746 let called = false 31747 31748 const handler = ({ target }) => { 31749 if (target !== transitionElement) { 31750 return 31751 } 31752 31753 called = true 31754 transitionElement.removeEventListener(TRANSITION_END, handler) 31755 execute(callback) 31756 } 31757 31758 transitionElement.addEventListener(TRANSITION_END, handler) 31759 setTimeout(() => { 31760 if (!called) { 31761 triggerTransitionEnd(transitionElement) 31762 } 31763 }, emulatedDuration) 31764} 31765 31766/** 31767 * Return the previous/next element of a list. 31768 * 31769 * @param {array} list The list of elements 31770 * @param activeElement The active element 31771 * @param shouldGetNext Choose to get next or previous element 31772 * @param isCycleAllowed 31773 * @return {Element|elem} The proper element 31774 */ 31775const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { 31776 let index = list.indexOf(activeElement) 31777 31778 // if the element does not exist in the list return an element depending on the direction and if cycle is allowed 31779 if (index === -1) { 31780 return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0] 31781 } 31782 31783 const listLength = list.length 31784 31785 index += shouldGetNext ? 1 : -1 31786 31787 if (isCycleAllowed) { 31788 index = (index + listLength) % listLength 31789 } 31790 31791 return list[Math.max(0, Math.min(index, listLength - 1))] 31792} 31793 31794 31795 31796;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/dom/data.js 31797/** 31798 * -------------------------------------------------------------------------- 31799 * Bootstrap (v5.1.3): dom/data.js 31800 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 31801 * -------------------------------------------------------------------------- 31802 */ 31803 31804/** 31805 * ------------------------------------------------------------------------ 31806 * Constants 31807 * ------------------------------------------------------------------------ 31808 */ 31809 31810const elementMap = new Map() 31811 31812/* harmony default export */ var data = ({ 31813 set(element, key, instance) { 31814 if (!elementMap.has(element)) { 31815 elementMap.set(element, new Map()) 31816 } 31817 31818 const instanceMap = elementMap.get(element) 31819 31820 // make it clear we only want one instance per element 31821 // can be removed later when multiple key/instances are fine to be used 31822 if (!instanceMap.has(key) && instanceMap.size !== 0) { 31823 // eslint-disable-next-line no-console 31824 console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`) 31825 return 31826 } 31827 31828 instanceMap.set(key, instance) 31829 }, 31830 31831 get(element, key) { 31832 if (elementMap.has(element)) { 31833 return elementMap.get(element).get(key) || null 31834 } 31835 31836 return null 31837 }, 31838 31839 remove(element, key) { 31840 if (!elementMap.has(element)) { 31841 return 31842 } 31843 31844 const instanceMap = elementMap.get(element) 31845 31846 instanceMap.delete(key) 31847 31848 // free up element references if there are no instances left for an element 31849 if (instanceMap.size === 0) { 31850 elementMap.delete(element) 31851 } 31852 } 31853}); 31854 31855;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/dom/event-handler.js 31856/** 31857 * -------------------------------------------------------------------------- 31858 * Bootstrap (v5.1.3): dom/event-handler.js 31859 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 31860 * -------------------------------------------------------------------------- 31861 */ 31862 31863 31864 31865/** 31866 * ------------------------------------------------------------------------ 31867 * Constants 31868 * ------------------------------------------------------------------------ 31869 */ 31870 31871const namespaceRegex = /[^.]*(?=\..*)\.|.*/ 31872const stripNameRegex = /\..*/ 31873const stripUidRegex = /::\d+$/ 31874const eventRegistry = {} // Events storage 31875let uidEvent = 1 31876const customEvents = {
31877 mouseenter: 'mouseover', 31878 mouseleave: 'mouseout' 31879} 31880const customEventsRegex = /^(mouseenter|mouseleave)/i 31881const nativeEvents = new Set([ 31882 'click', 31883 'dblclick', 31884 'mouseup', 31885 'mousedown', 31886 'contextmenu', 31887 'mousewheel', 31888 'DOMMouseScroll', 31889 'mouseover', 31890 'mouseout', 31891 'mousemove', 31892 'selectstart', 31893 'selectend', 31894 'keydown', 31895 'keypress', 31896 'keyup', 31897 'orientationchange', 31898 'touchstart', 31899 'touchmove', 31900 'touchend', 31901 'touchcancel', 31902 'pointerdown', 31903 'pointermove', 31904 'pointerup', 31905 'pointerleave', 31906 'pointercancel', 31907 'gesturestart', 31908 'gesturechange', 31909 'gestureend', 31910 'focus', 31911 'blur', 31912 'change', 31913 'reset', 31914 'select', 31915 'submit', 31916 'focusin', 31917 'focusout', 31918 'load', 31919 'unload', 31920 'beforeunload', 31921 'resize', 31922 'move', 31923 'DOMContentLoaded', 31924 'readystatechange', 31925 'error', 31926 'abort', 31927 'scroll' 31928]) 31929 31930/** 31931 * ------------------------------------------------------------------------ 31932 * Private methods 31933 * ------------------------------------------------------------------------ 31934 */ 31935 31936function getUidEvent(element, uid) { 31937 return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++ 31938} 31939 31940function getEvent(element) { 31941 const uid = getUidEvent(element) 31942 31943 element.uidEvent = uid 31944 eventRegistry[uid] = eventRegistry[uid] || {} 31945 31946 return eventRegistry[uid] 31947} 31948 31949function bootstrapHandler(element, fn) { 31950 return function handler(event) { 31951 event.delegateTarget = element 31952 31953 if (handler.oneOff) { 31954 EventHandler.off(element, event.type, fn) 31955 } 31956 31957 return fn.apply(element, [event]) 31958 } 31959} 31960 31961function bootstrapDelegationHandler(element, selector, fn) { 31962 return function handler(event) { 31963 const domElements = element.querySelectorAll(selector) 31964 31965 for (let { target } = event; target && target !== this; target = target.parentNode) { 31966 for (let i = domElements.length; i--;) { 31967 if (domElements[i] === target) { 31968 event.delegateTarget = target 31969 31970 if (handler.oneOff) { 31971 EventHandler.off(element, event.type, selector, fn) 31972 } 31973 31974 return fn.apply(target, [event]) 31975 } 31976 } 31977 } 31978 31979 // To please ESLint 31980 return null 31981 } 31982} 31983 31984function findHandler(events, handler, delegationSelector = null) { 31985 const uidEventList = Object.keys(events) 31986 31987 for (let i = 0, len = uidEventList.length; i < len; i++) { 31988 const event = events[uidEventList[i]] 31989 31990 if (event.originalHandler === handler && event.delegationSelector === delegationSelector) { 31991 return event 31992 } 31993 } 31994 31995 return null 31996} 31997 31998function normalizeParams(originalTypeEvent, handler, delegationFn) { 31999 const delegation = typeof handler === 'string' 32000 const originalHandler = delegation ? delegationFn : handler 32001 32002 let typeEvent = getTypeEvent(originalTypeEvent) 32003 const isNative = nativeEvents.has(typeEvent) 32004 32005 if (!isNative) { 32006 typeEvent = originalTypeEvent 32007 } 32008 32009 return [delegation, originalHandler, typeEvent] 32010} 32011 32012function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) { 32013 if (typeof originalTypeEvent !== 'string' || !element) { 32014 return 32015 } 32016 32017 if (!handler) { 32018 handler = delegationFn 32019 delegationFn = null 32020 } 32021 32022 // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position 32023 // this prevents the handler from being dispatched the same way as mouseover or mouseout does 32024 if (customEventsRegex.test(originalTypeEvent)) { 32025 const wrapFn = fn => { 32026 return function (event) { 32027 if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) { 32028 return fn.call(this, event) 32029 } 32030 } 32031 } 32032 32033 if (delegationFn) { 32034 delegationFn = wrapFn(delegationFn) 32035 } else { 32036 handler = wrapFn(handler) 32037 } 32038 } 32039 32040 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn) 32041 const events = getEvent(element) 32042 const handlers = events[typeEvent] || (events[typeEvent] = {}) 32043 const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null) 32044 32045 if (previousFn) { 32046 previousFn.oneOff = previousFn.oneOff && oneOff 32047 32048 return 32049 } 32050 32051 const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, '')) 32052 const fn = delegation ? 32053 bootstrapDelegationHandler(element, handler, delegationFn) : 32054 bootstrapHandler(element, handler) 32055 32056 fn.delegationSelector = delegation ? handler : null 32057 fn.originalHandler = originalHandler 32058 fn.oneOff = oneOff 32059 fn.uidEvent = uid 32060 handlers[uid] = fn 32061 32062 element.addEventListener(typeEvent, fn, delegation) 32063} 32064 32065function removeHandler(element, events, typeEvent, handler, delegationSelector) { 32066 const fn = findHandler(events[typeEvent], handler, delegationSelector) 32067 32068 if (!fn) { 32069 return 32070 } 32071 32072 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)) 32073 delete events[typeEvent][fn.uidEvent] 32074} 32075 32076function removeNamespacedHandlers(element, events, typeEvent, namespace) { 32077 const storeElementEvent = events[typeEvent] || {} 32078 32079 Object.keys(storeElementEvent).forEach(handlerKey => { 32080 if (handlerKey.includes(namespace)) { 32081 const event = storeElementEvent[handlerKey] 32082 32083 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector) 32084 } 32085 }) 32086} 32087 32088function getTypeEvent(event) { 32089 // allow to get the native events from namespaced events ('click.bs.button' --> 'click') 32090 event = event.replace(stripNameRegex, '') 32091 return customEvents[event] || event 32092} 32093 32094const EventHandler = { 32095 on(element, event, handler, delegationFn) { 32096 addHandler(element, event, handler, delegationFn, false) 32097 }, 32098 32099 one(element, event, handler, delegationFn) { 32100 addHandler(element, event, handler, delegationFn, true) 32101 }, 32102 32103 off(element, originalTypeEvent, handler, delegationFn) { 32104 if (typeof originalTypeEvent !== 'string' || !element) { 32105 return 32106 } 32107 32108 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn) 32109 const inNamespace = typeEvent !== originalTypeEvent 32110 const events = getEvent(element) 32111 const isNamespace = originalTypeEvent.startsWith('.') 32112 32113 if (typeof originalHandler !== 'undefined') { 32114 // Simplest case: handler is passed, remove that listener ONLY. 32115 if (!events || !events[typeEvent]) { 32116 return 32117 } 32118 32119 removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null) 32120 return 32121 } 32122 32123 if (isNamespace) {
32124 Object.keys(events).forEach(elementEvent => { 32125 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)) 32126 }) 32127 } 32128 32129 const storeElementEvent = events[typeEvent] || {} 32130 Object.keys(storeElementEvent).forEach(keyHandlers => { 32131 const handlerKey = keyHandlers.replace(stripUidRegex, '') 32132 32133 if (!inNamespace || originalTypeEvent.includes(handlerKey)) { 32134 const event = storeElementEvent[keyHandlers] 32135 32136 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector) 32137 } 32138 }) 32139 }, 32140 32141 trigger(element, event, args) { 32142 if (typeof event !== 'string' || !element) { 32143 return null 32144 } 32145 32146 const $ = getjQuery() 32147 const typeEvent = getTypeEvent(event) 32148 const inNamespace = event !== typeEvent 32149 const isNative = nativeEvents.has(typeEvent) 32150 32151 let jQueryEvent 32152 let bubbles = true 32153 let nativeDispatch = true 32154 let defaultPrevented = false 32155 let evt = null 32156 32157 if (inNamespace && $) { 32158 jQueryEvent = $.Event(event, args) 32159 32160 $(element).trigger(jQueryEvent) 32161 bubbles = !jQueryEvent.isPropagationStopped() 32162 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped() 32163 defaultPrevented = jQueryEvent.isDefaultPrevented() 32164 } 32165 32166 if (isNative) { 32167 evt = document.createEvent('HTMLEvents') 32168 evt.initEvent(typeEvent, bubbles, true) 32169 } else { 32170 evt = new CustomEvent(event, { 32171 bubbles, 32172 cancelable: true 32173 }) 32174 } 32175 32176 // merge custom information in our event 32177 if (typeof args !== 'undefined') { 32178 Object.keys(args).forEach(key => { 32179 Object.defineProperty(evt, key, { 32180 get() { 32181 return args[key] 32182 } 32183 }) 32184 }) 32185 } 32186 32187 if (defaultPrevented) { 32188 evt.preventDefault() 32189 } 32190 32191 if (nativeDispatch) { 32192 element.dispatchEvent(evt) 32193 } 32194 32195 if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') { 32196 jQueryEvent.preventDefault() 32197 } 32198 32199 return evt 32200 } 32201} 32202 32203/* harmony default export */ var event_handler = (EventHandler); 32204 32205;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/dom/manipulator.js 32206/** 32207 * -------------------------------------------------------------------------- 32208 * Bootstrap (v5.1.3): dom/manipulator.js 32209 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 32210 * -------------------------------------------------------------------------- 32211 */ 32212 32213function normalizeData(val) { 32214 if (val === 'true') { 32215 return true 32216 } 32217 32218 if (val === 'false') { 32219 return false 32220 } 32221 32222 if (val === Number(val).toString()) { 32223 return Number(val) 32224 } 32225 32226 if (val === '' || val === 'null') { 32227 return null 32228 } 32229 32230 return val 32231} 32232 32233function normalizeDataKey(key) { 32234 return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`) 32235} 32236 32237const Manipulator = { 32238 setDataAttribute(element, key, value) { 32239 element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value) 32240 }, 32241 32242 removeDataAttribute(element, key) { 32243 element.removeAttribute(`data-bs-${normalizeDataKey(key)}`) 32244 }, 32245 32246 getDataAttributes(element) { 32247 if (!element) { 32248 return {} 32249 } 32250 32251 const attributes = {} 32252 32253 Object.keys(element.dataset) 32254 .filter(key => key.startsWith('bs')) 32255 .forEach(key => { 32256 let pureKey = key.replace(/^bs/, '') 32257 pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length) 32258 attributes[pureKey] = normalizeData(element.dataset[key]) 32259 }) 32260 32261 return attributes 32262 }, 32263 32264 getDataAttribute(element, key) { 32265 return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)) 32266 }, 32267 32268 offset(element) { 32269 const rect = element.getBoundingClientRect() 32270 32271 return { 32272 top: rect.top + window.pageYOffset, 32273 left: rect.left + window.pageXOffset 32274 } 32275 }, 32276 32277 position(element) { 32278 return { 32279 top: element.offsetTop, 32280 left: element.offsetLeft 32281 } 32282 } 32283} 32284 32285/* harmony default export */ var manipulator = (Manipulator); 32286 32287;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/dom/selector-engine.js 32288/** 32289 * -------------------------------------------------------------------------- 32290 * Bootstrap (v5.1.3): dom/selector-engine.js 32291 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 32292 * -------------------------------------------------------------------------- 32293 */ 32294 32295/** 32296 * ------------------------------------------------------------------------ 32297 * Constants 32298 * ------------------------------------------------------------------------ 32299 */ 32300 32301 32302 32303const NODE_TEXT = 3 32304 32305const SelectorEngine = { 32306 find(selector, element = document.documentElement) { 32307 return [].concat(...Element.prototype.querySelectorAll.call(element, selector)) 32308 }, 32309 32310 findOne(selector, element = document.documentElement) { 32311 return Element.prototype.querySelector.call(element, selector) 32312 }, 32313 32314 children(element, selector) { 32315 return [].concat(...element.children) 32316 .filter(child => child.matches(selector)) 32317 }, 32318 32319 parents(element, selector) { 32320 const parents = [] 32321 32322 let ancestor = element.parentNode 32323 32324 while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { 32325 if (ancestor.matches(selector)) { 32326 parents.push(ancestor) 32327 } 32328 32329 ancestor = ancestor.parentNode 32330 } 32331 32332 return parents 32333 }, 32334 32335 prev(element, selector) { 32336 let previous = element.previousElementSibling 32337 32338 while (previous) { 32339 if (previous.matches(selector)) { 32340 return [previous] 32341 } 32342 32343 previous = previous.previousElementSibling 32344 } 32345 32346 return [] 32347 }, 32348 32349 next(element, selector) { 32350 let next = element.nextElementSibling 32351 32352 while (next) { 32353 if (next.matches(selector)) { 32354 return [next] 32355 } 32356 32357 next = next.nextElementSibling 32358 } 32359 32360 return [] 32361 }, 32362 32363 focusableChildren(element) { 32364 const focusables = [ 32365 'a', 32366 'button', 32367 'input', 32368 'textarea', 32369 'select', 32370 'details', 32371 '[tabindex]', 32372 '[contenteditable="true"]' 32373 ].map(selector => `${selector}:not([tabindex^="-"])`).join(', ') 32374 32375 return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)) 32376 } 32377} 32378 32379/* harmony default export */ var selector_engine = (SelectorEngine); 32380 32381;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/base-component.js 32382/** 32383 * -------------------------------------------------------------------------- 32384 * Bootstrap (v5.1.3): base-component.js 32385 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 32386 * -------------------------------------------------------------------------- 32387 */ 32388 32389 32390 32391 32392 32393/** 32394 * ------------------------------------------------------------------------ 32395 * Constants 32396 * ------------------------------------------------------------------------ 32397 */ 32398 32399const VERSION = '5.1.3' 32400 32401class BaseComponent { 32402 constructor(element) { 32403 element = getElement(element) 32404 32405 if (!element) { 32406 return 32407 } 32408 32409 this._element = element 32410 data.set(this._element, this.constructor.DATA_KEY, this) 32411 } 32412 32413 dispose() { 32414 data.remove(this._element, this.constructor.DATA_KEY) 32415 event_handler.off(this._element, this.constructor.EVENT_KEY) 32416
32417 Object.getOwnPropertyNames(this).forEach(propertyName => { 32418 this[propertyName] = null 32419 }) 32420 } 32421 32422 _queueCallback(callback, element, isAnimated = true) { 32423 executeAfterTransition(callback, element, isAnimated) 32424 } 32425 32426 /** Static */ 32427 32428 static getInstance(element) { 32429 return data.get(getElement(element), this.DATA_KEY) 32430 } 32431 32432 static getOrCreateInstance(element, config = {}) { 32433 return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null) 32434 } 32435 32436 static get VERSION() { 32437 return VERSION 32438 } 32439 32440 static get NAME() { 32441 throw new Error('You have to implement the static method "NAME", for each component!') 32442 } 32443 32444 static get DATA_KEY() { 32445 return `bs.${this.NAME}` 32446 } 32447 32448 static get EVENT_KEY() { 32449 return `.${this.DATA_KEY}` 32450 } 32451} 32452 32453/* harmony default export */ var base_component = (BaseComponent); 32454 32455;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/collapse.js 32456/** 32457 * -------------------------------------------------------------------------- 32458 * Bootstrap (v5.1.3): collapse.js 32459 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 32460 * -------------------------------------------------------------------------- 32461 */ 32462 32463 32464 32465 32466 32467 32468 32469 32470/** 32471 * ------------------------------------------------------------------------ 32472 * Constants 32473 * ------------------------------------------------------------------------ 32474 */ 32475 32476const NAME = 'collapse' 32477const DATA_KEY = 'bs.collapse' 32478const EVENT_KEY = `.${DATA_KEY}` 32479const DATA_API_KEY = '.data-api' 32480 32481const Default = { 32482 toggle: true, 32483 parent: null 32484} 32485 32486const DefaultType = { 32487 toggle: 'boolean', 32488 parent: '(null|element)' 32489} 32490 32491const EVENT_SHOW = `show${EVENT_KEY}` 32492const EVENT_SHOWN = `shown${EVENT_KEY}` 32493const EVENT_HIDE = `hide${EVENT_KEY}` 32494const EVENT_HIDDEN = `hidden${EVENT_KEY}` 32495const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}` 32496 32497const CLASS_NAME_SHOW = 'show' 32498const CLASS_NAME_COLLAPSE = 'collapse' 32499const CLASS_NAME_COLLAPSING = 'collapsing' 32500const CLASS_NAME_COLLAPSED = 'collapsed' 32501const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}` 32502const CLASS_NAME_HORIZONTAL = 'collapse-horizontal' 32503 32504const WIDTH = 'width' 32505const HEIGHT = 'height' 32506 32507const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing' 32508const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]' 32509 32510/** 32511 * ------------------------------------------------------------------------ 32512 * Class Definition 32513 * ------------------------------------------------------------------------ 32514 */ 32515 32516class Collapse extends base_component { 32517 constructor(element, config) { 32518 super(element) 32519 32520 this._isTransitioning = false 32521 this._config = this._getConfig(config) 32522 this._triggerArray = [] 32523 32524 const toggleList = selector_engine.find(SELECTOR_DATA_TOGGLE) 32525 32526 for (let i = 0, len = toggleList.length; i < len; i++) { 32527 const elem = toggleList[i] 32528 const selector = getSelectorFromElement(elem) 32529 const filterElement = selector_engine.find(selector) 32530 .filter(foundElem => foundElem === this._element) 32531 32532 if (selector !== null && filterElement.length) { 32533 this._selector = selector 32534 this._triggerArray.push(elem) 32535 } 32536 } 32537 32538 this._initializeChildren() 32539 32540 if (!this._config.parent) { 32541 this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()) 32542 } 32543 32544 if (this._config.toggle) { 32545 this.toggle() 32546 } 32547 } 32548 32549 // Getters 32550 32551 static get Default() { 32552 return Default 32553 } 32554 32555 static get NAME() { 32556 return NAME 32557 } 32558 32559 // Public 32560 32561 toggle() { 32562 if (this._isShown()) { 32563 this.hide() 32564 } else { 32565 this.show() 32566 } 32567 } 32568 32569 show() { 32570 if (this._isTransitioning || this._isShown()) { 32571 return 32572 } 32573 32574 let actives = [] 32575 let activesData 32576 32577 if (this._config.parent) { 32578 const children = selector_engine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent) 32579 actives = selector_engine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)) // remove children if greater depth 32580 } 32581 32582 const container = selector_engine.findOne(this._selector) 32583 if (actives.length) { 32584 const tempActiveData = actives.find(elem => container !== elem) 32585 activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null 32586 32587 if (activesData && activesData._isTransitioning) { 32588 return 32589 } 32590 } 32591 32592 const startEvent = event_handler.trigger(this._element, EVENT_SHOW) 32593 if (startEvent.defaultPrevented) { 32594 return 32595 } 32596
32597 actives.forEach(elemActive => { 32598 if (container !== elemActive) { 32599 Collapse.getOrCreateInstance(elemActive, { toggle: false }).hide() 32600 } 32601 32602 if (!activesData) { 32603 data.set(elemActive, DATA_KEY, null) 32604 } 32605 }) 32606 32607 const dimension = this._getDimension() 32608 32609 this._element.classList.remove(CLASS_NAME_COLLAPSE) 32610 this._element.classList.add(CLASS_NAME_COLLAPSING) 32611 32612 this._element.style[dimension] = 0 32613 32614 this._addAriaAndCollapsedClass(this._triggerArray, true) 32615 this._isTransitioning = true 32616 32617 const complete = () => { 32618 this._isTransitioning = false 32619 32620 this._element.classList.remove(CLASS_NAME_COLLAPSING) 32621 this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW) 32622 32623 this._element.style[dimension] = '' 32624 32625 event_handler.trigger(this._element, EVENT_SHOWN) 32626 } 32627 32628 const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1) 32629 const scrollSize = `scroll${capitalizedDimension}` 32630 32631 this._queueCallback(complete, this._element, true) 32632 this._element.style[dimension] = `${this._element[scrollSize]}px` 32633 } 32634 32635 hide() { 32636 if (this._isTransitioning || !this._isShown()) { 32637 return 32638 } 32639 32640 const startEvent = event_handler.trigger(this._element, EVENT_HIDE) 32641 if (startEvent.defaultPrevented) { 32642 return 32643 } 32644 32645 const dimension = this._getDimension() 32646 32647 this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px` 32648 32649 reflow(this._element) 32650 32651 this._element.classList.add(CLASS_NAME_COLLAPSING) 32652 this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW) 32653 32654 const triggerArrayLength = this._triggerArray.length 32655 for (let i = 0; i < triggerArrayLength; i++) { 32656 const trigger = this._triggerArray[i] 32657 const elem = getElementFromSelector(trigger) 32658 32659 if (elem && !this._isShown(elem)) { 32660 this._addAriaAndCollapsedClass([trigger], false) 32661 } 32662 } 32663 32664 this._isTransitioning = true 32665 32666 const complete = () => { 32667 this._isTransitioning = false 32668 this._element.classList.remove(CLASS_NAME_COLLAPSING) 32669 this._element.classList.add(CLASS_NAME_COLLAPSE) 32670 event_handler.trigger(this._element, EVENT_HIDDEN) 32671 } 32672 32673 this._element.style[dimension] = '' 32674 32675 this._queueCallback(complete, this._element, true) 32676 } 32677 32678 _isShown(element = this._element) { 32679 return element.classList.contains(CLASS_NAME_SHOW) 32680 } 32681 32682 // Private 32683 32684 _getConfig(config) { 32685 config = { 32686 ...Default, 32687 ...manipulator.getDataAttributes(this._element), 32688 ...config 32689 } 32690 config.toggle = Boolean(config.toggle) // Coerce string values 32691 config.parent = getElement(config.parent) 32692 typeCheckConfig(NAME, config, DefaultType) 32693 return config 32694 } 32695 32696 _getDimension() { 32697 return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT 32698 } 32699 32700 _initializeChildren() { 32701 if (!this._config.parent) { 32702 return 32703 } 32704 32705 const children = selector_engine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent) 32706 selector_engine.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem)) 32707 .forEach(element => { 32708 const selected = getElementFromSelector(element) 32709 32710 if (selected) { 32711 this._addAriaAndCollapsedClass([element], this._isShown(selected)) 32712 } 32713 }) 32714 } 32715 32716 _addAriaAndCollapsedClass(triggerArray, isOpen) { 32717 if (!triggerArray.length) { 32718 return 32719 } 32720 32721 triggerArray.forEach(elem => { 32722 if (isOpen) { 32723 elem.classList.remove(CLASS_NAME_COLLAPSED) 32724 } else { 32725 elem.classList.add(CLASS_NAME_COLLAPSED) 32726 } 32727 32728 elem.setAttribute('aria-expanded', isOpen) 32729 }) 32730 } 32731 32732 // Static 32733 32734 static jQueryInterface(config) { 32735 return this.each(function () { 32736 const _config = {} 32737 if (typeof config === 'string' && /show|hide/.test(config)) { 32738 _config.toggle = false 32739 } 32740 32741 const data = Collapse.getOrCreateInstance(this, _config) 32742 32743 if (typeof config === 'string') { 32744 if (typeof data[config] === 'undefined') {
32745 throw new TypeError(`No method named "${config}"`) 32746 } 32747 32748 data[config]() 32749 } 32750 }) 32751 } 32752} 32753 32754/** 32755 * ------------------------------------------------------------------------ 32756 * Data Api implementation 32757 * ------------------------------------------------------------------------ 32758 */ 32759 32760event_handler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 32761 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 32762 if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) { 32763 event.preventDefault() 32764 } 32765 32766 const selector = getSelectorFromElement(this) 32767 const selectorElements = selector_engine.find(selector) 32768 32769 selectorElements.forEach(element => { 32770 Collapse.getOrCreateInstance(element, { toggle: false }).toggle() 32771 }) 32772}) 32773 32774/** 32775 * ------------------------------------------------------------------------ 32776 * jQuery 32777 * ------------------------------------------------------------------------ 32778 * add .Collapse to jQuery only if jQuery is present 32779 */ 32780 32781defineJQueryPlugin(Collapse) 32782 32783/* harmony default export */ var collapse = ((/* unused pure expression or super */ null && (Collapse))); 32784 32785;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/collapse/collapse.main.js 32786 32787 32788// EXTERNAL MODULE: ./src/modules/components/cookieman/cookieman.main.js 32789var cookieman_main = __webpack_require__(7242); 32790// EXTERNAL MODULE: ./src/js/vendor/Accessible-Mega-Menu/js/jquery-accessibleMegaMenu.js 32791var jquery_accessibleMegaMenu = __webpack_require__(9738); 32792;// CONCATENATED MODULE: ./src/modules/components/dropdownNav/dropdownNav.main.js 32793// todo: is this import needed 32794// must test with only one nav available! 32795 32796 32797 32798function clickHandler(el) { 32799 external_$_default()(el).on('click', (e) => { 32800 let url = e.target.href; 32801 32802 // this catches if event is on a span etc instead on the a tag 32803 if(url === undefined) { 32804 url = external_$_default()(e.target).closest('a')[0].href; 32805 } 32806 // workaround, as megamenu will deactivate top level links 32807 window.location.href = url; 32808 }); 32809} 32810 32811function touchHandler(el) { 32812 external_$_default()(el).on('touchstart', () => { 32813 external_$_default()('.firstLevel__list > li > a').removeClass('focus'); 32814 external_$_default()('.subNav').removeClass('open'); 32815 32816 external_$_default()(el).addClass('focus'); 32817 external_$_default()(el).siblings('.subNav').addClass('open'); 32818 }); 32819} 32820 32821/** 32822 * Init on DOM ready 32823 */ 32824function dropdownNav_main_init(selector = '.dropdownNav .firstLevel') { 32825 console.log('dropdownNav initialised through dropdownNav on: ' + selector); 32826 external_$_default()(selector).accessibleMegaMenu({ 32827 openOnMouseover: true, 32828 }); 32829 32830 // hack so that the megamenu doesn't show flash of css animation after the page loads. 32831 setTimeout(function () { 32832 external_$_default()('body').removeClass('init'); 32833 }, 500); 32834 32835 const $links = external_$_default()('.dropdownNav .firstLevel__list > li > a'); 32836 $links.each((e, el) => clickHandler(el)); 32837 $links.each((e, el) => touchHandler(el)); 32838 32839 external_$_default()(window).on('touchstart', (e) => { 32840 if (external_$_default()(e.target).parents('.dropdownNav').length < 1) { 32841 external_$_default()('.dropdownNav .firstLevel__list > li > a').removeClass('focus'); 32842 external_$_default()('.dropdownNav .subNav').removeClass('open'); 32843 } 32844 }); 32845} 32846 32847external_$_default().when((external_$_default()).ready).then(() => { 32848 console.log('dropdownNav initialised on DOMContentLoaded'); 32849 32850 // init modes 32851 dropdownNav_main_init('.dropdownNav .firstLevel'); 32852}); 32853 32854;// CONCATENATED MODULE: ./src/modules/components/dropdownAccordionNav/dropdownAccordionNav.main.js 32855 32856 32857 32858 32859 32860external_$_default().when((external_$_default()).ready).then(() => { 32861 console.log('dropdownAccordionNav initialised on DOMContentLoaded'); 32862 32863 // init modes 32864 dropdownNav_main_init('.dropdownAccordionNav .firstLevel'); 32865 init('.dropdownAccordionNav .thirdLevel'); 32866}); 32867 32868;// CONCATENATED MODULE: ./src/modules/components/dropdownFilter/dropdownFilter.main.js 32869 32870 32871function isFilterEmpty($filter) { 32872 const $selects = $filter.find('select');
32873 const $inputs = $filter.find('input:not(:hidden)'); 32874 let isEmpty = true; 32875 32876 $selects.each(function () { 32877 const $select = external_$_default()(this); 32878 if ($select[0].selectedIndex !== 0) { 32879 isEmpty = false; 32880 } 32881 }); 32882 32883 $inputs.each(function () { 32884 const $input = external_$_default()(this); 32885 if ($input.val() !== '') { 32886 isEmpty = false; 32887 } 32888 32889 if ($input.next().length > 0) { 32890 if ($input.next().val() !== '') { 32891 isEmpty = false; 32892 } 32893 } 32894 }); 32895 32896 return isEmpty; 32897} 32898 32899function resetFilter($filter) { 32900 const $selects = $filter.find('select'); 32901 const $inputs = $filter.find('input:not(:hidden)'); 32902 32903 $selects.each(function () { 32904 const $select = external_$_default()(this); 32905 $select[0].selectedIndex = 0; 32906 }); 32907 32908 $inputs.each(function () { 32909 const $input = external_$_default()(this); 32910 $input.val(''); 32911 if ($input.next().length > 0) { 32912 $input.next().val(''); 32913 } 32914 }); 32915} 32916 32917/** 32918 * Init on DOM ready 32919 */ 32920external_$_default().when((external_$_default()).ready).then(() => { 32921 const assets = external_$_default()('.dropdownFilter'); 32922 if(!assets.length) { 32923 return; 32924 } 32925 32926 console.log('initialized dropdownFilter'); 32927 assets.each(function () { 32928 const $dropdownFilter = external_$_default()(this); 32929 const $submit = $dropdownFilter.find('[type="submit"]'); 32930 32931 if (isFilterEmpty($dropdownFilter)) { 32932 return; 32933 } 32934 32935 const $filterReset = external_$_default()('<span class="f-navigation__reset">' + 32936 '<button class="dropdownFilter__reset" aria-label="Filter reset">' + 32937 '<?xml version="1.0" encoding="UTF-8"?>\n' + 32938 '<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n' + 32939 ' <title>Group</title>\n' + 32940 ' <g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n' + 32941 ' <g id="Icon/close/d" transform="translate(-11.000000, -11.000000)" stroke="currentColor" stroke-width="2">\n' + 32942 ' <g id="Group" transform="translate(12.000000, 12.000000)">\n' + 32943 ' <line x1="0.286106045" y1="0.286106045" x2="7.68405796" y2="7.68405796" id="Line-2"></line>\n' + 32944 ' <line x1="0.285714286" y1="0.285714286" x2="7.71428571" y2="7.71428571" id="Line-2" transform="translate(4.000000, 4.000000) rotate(-270.000000) translate(-4.000000, -4.000000) "></line>\n' + 32945 ' </g>\n' + 32946 ' </g>\n' + 32947 ' </g>\n' + 32948 '</svg>' + 32949 '</button></span>'); 32950 $dropdownFilter.find('.f-navigation').append($filterReset); 32951 32952 $filterReset.on('click', function (evt) { 32953 evt.preventDefault(); 32954 resetFilter($dropdownFilter); 32955 $submit.trigger('click'); 32956 }); 32957 32958 }); 32959}); 32960 32961/** 32962 * Init on document load 32963 */ 32964function dropdownFilter_main_load() { 32965 32966} 32967 32968// EXTERNAL MODULE: ./src/modules/components/expand/expand.main.js 32969var expand_main = __webpack_require__(7172); 32970;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js 32971var enums_top = 'top'; 32972var bottom = 'bottom'; 32973var right = 'right'; 32974var left = 'left'; 32975var auto = 'auto'; 32976var basePlacements = [enums_top, bottom, right, left]; 32977var start = 'start'; 32978var end = 'end'; 32979var clippingParents = 'clippingParents'; 32980var viewport = 'viewport'; 32981var popper = 'popper'; 32982var reference = 'reference'; 32983var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 32984 return acc.concat([placement + "-" + start, placement + "-" + end]); 32985}, []); 32986var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 32987 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 32988}, []); // modifiers that need to read the DOM 32989 32990var beforeRead = 'beforeRead'; 32991var read = 'read'; 32992var afterRead = 'afterRead'; // pure-logic modifiers 32993 32994var beforeMain = 'beforeMain'; 32995var main = 'main'; 32996var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 32997 32998var beforeWrite = 'beforeWrite'; 32999var write = 'write'; 33000var afterWrite = 'afterWrite'; 33001var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 33002;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js 33003function getNodeName(element) { 33004 return element ? (element.nodeName || '').toLowerCase() : null; 33005} 33006;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js 33007function getWindow(node) { 33008 if (node == null) { 33009 return window; 33010 } 33011 33012 if (node.toString() !== '[object Window]') { 33013 var ownerDocument = node.ownerDocument; 33014 return ownerDocument ? ownerDocument.defaultView || window : window; 33015 } 33016 33017 return node; 33018} 33019;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js 33020 33021 33022function instanceOf_isElement(node) { 33023 var OwnElement = getWindow(node).Element; 33024 return node instanceof OwnElement || node instanceof Element; 33025} 33026 33027function isHTMLElement(node) { 33028 var OwnElement = getWindow(node).HTMLElement; 33029 return node instanceof OwnElement || node instanceof HTMLElement; 33030} 33031 33032function isShadowRoot(node) { 33033 // IE 11 has no ShadowRoot 33034 if (typeof ShadowRoot === 'undefined') { 33035 return false;
vendor: 9,203 bytes, lines 33036-33324
33036 } 33037 33038 var OwnElement = getWindow(node).ShadowRoot; 33039 return node instanceof OwnElement || node instanceof ShadowRoot; 33040} 33041 33042 33043;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js 33044 33045 // This modifier takes the styles prepared by the `computeStyles` modifier 33046// and applies them to the HTMLElements such as popper and arrow 33047 33048function applyStyles(_ref) { 33049 var state = _ref.state; 33050 Object.keys(state.elements).forEach(function (name) { 33051 var style = state.styles[name] || {}; 33052 var attributes = state.attributes[name] || {}; 33053 var element = state.elements[name]; // arrow is optional + virtual elements 33054 33055 if (!isHTMLElement(element) || !getNodeName(element)) { 33056 return; 33057 } // Flow doesn't support to extend this property, but it's the most 33058 // effective way to apply styles to an HTMLElement 33059 // $FlowFixMe[cannot-write] 33060 33061 33062 Object.assign(element.style, style); 33063 Object.keys(attributes).forEach(function (name) { 33064 var value = attributes[name]; 33065 33066 if (value === false) { 33067 element.removeAttribute(name); 33068 } else { 33069 element.setAttribute(name, value === true ? '' : value); 33070 } 33071 }); 33072 }); 33073} 33074 33075function effect(_ref2) { 33076 var state = _ref2.state; 33077 var initialStyles = { 33078 popper: { 33079 position: state.options.strategy, 33080 left: '0', 33081 top: '0', 33082 margin: '0' 33083 }, 33084 arrow: { 33085 position: 'absolute' 33086 }, 33087 reference: {} 33088 }; 33089 Object.assign(state.elements.popper.style, initialStyles.popper); 33090 state.styles = initialStyles; 33091 33092 if (state.elements.arrow) { 33093 Object.assign(state.elements.arrow.style, initialStyles.arrow); 33094 } 33095 33096 return function () { 33097 Object.keys(state.elements).forEach(function (name) { 33098 var element = state.elements[name]; 33099 var attributes = state.attributes[name] || {}; 33100 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 33101 33102 var style = styleProperties.reduce(function (style, property) { 33103 style[property] = ''; 33104 return style; 33105 }, {}); // arrow is optional + virtual elements 33106 33107 if (!isHTMLElement(element) || !getNodeName(element)) { 33108 return; 33109 } 33110 33111 Object.assign(element.style, style); 33112 Object.keys(attributes).forEach(function (attribute) { 33113 element.removeAttribute(attribute); 33114 }); 33115 }); 33116 }; 33117} // eslint-disable-next-line import/no-unused-modules 33118 33119 33120/* harmony default export */ var modifiers_applyStyles = ({ 33121 name: 'applyStyles', 33122 enabled: true, 33123 phase: 'write', 33124 fn: applyStyles, 33125 effect: effect, 33126 requires: ['computeStyles'] 33127}); 33128;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js 33129 33130function getBasePlacement(placement) { 33131 return placement.split('-')[0]; 33132} 33133;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js 33134var math_max = Math.max; 33135var math_min = Math.min; 33136var round = Math.round; 33137;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js 33138 33139 33140function getBoundingClientRect(element, includeScale) { 33141 if (includeScale === void 0) { 33142 includeScale = false; 33143 } 33144 33145 var rect = element.getBoundingClientRect(); 33146 var scaleX = 1; 33147 var scaleY = 1; 33148 33149 if (isHTMLElement(element) && includeScale) { 33150 var offsetHeight = element.offsetHeight; 33151 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale 33152 // Fallback to 1 in case both values are `0` 33153 33154 if (offsetWidth > 0) { 33155 scaleX = round(rect.width) / offsetWidth || 1; 33156 } 33157 33158 if (offsetHeight > 0) { 33159 scaleY = round(rect.height) / offsetHeight || 1; 33160 } 33161 } 33162 33163 return { 33164 width: rect.width / scaleX, 33165 height: rect.height / scaleY, 33166 top: rect.top / scaleY, 33167 right: rect.right / scaleX, 33168 bottom: rect.bottom / scaleY, 33169 left: rect.left / scaleX, 33170 x: rect.left / scaleX, 33171 y: rect.top / scaleY 33172 }; 33173} 33174;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js 33175 // Returns the layout rect of an element relative to its offsetParent. Layout 33176// means it doesn't take into account transforms. 33177 33178function getLayoutRect(element) { 33179 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 33180 // Fixes https://github.com/popperjs/popper-core/issues/1223 33181 33182 var width = element.offsetWidth; 33183 var height = element.offsetHeight; 33184 33185 if (Math.abs(clientRect.width - width) <= 1) { 33186 width = clientRect.width; 33187 } 33188 33189 if (Math.abs(clientRect.height - height) <= 1) { 33190 height = clientRect.height; 33191 } 33192 33193 return { 33194 x: element.offsetLeft, 33195 y: element.offsetTop, 33196 width: width, 33197 height: height 33198 }; 33199} 33200;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js 33201 33202function contains(parent, child) { 33203 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 33204 33205 if (parent.contains(child)) { 33206 return true; 33207 } // then fallback to custom implementation with Shadow DOM support 33208 else if (rootNode && isShadowRoot(rootNode)) { 33209 var next = child; 33210 33211 do { 33212 if (next && parent.isSameNode(next)) { 33213 return true; 33214 } // $FlowFixMe[prop-missing]: need a better way to handle this... 33215 33216 33217 next = next.parentNode || next.host; 33218 } while (next); 33219 } // Give up, the result is false 33220 33221 33222 return false; 33223} 33224;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js 33225 33226function getComputedStyle_getComputedStyle(element) { 33227 return getWindow(element).getComputedStyle(element); 33228} 33229;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js 33230 33231function isTableElement(element) { 33232 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 33233} 33234;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js 33235 33236function getDocumentElement(element) { 33237 // $FlowFixMe[incompatible-return]: assume body is always available 33238 return ((instanceOf_isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 33239 element.document) || window.document).documentElement; 33240} 33241;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js 33242 33243 33244 33245function getParentNode(element) { 33246 if (getNodeName(element) === 'html') { 33247 return element; 33248 } 33249 33250 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 33251 // $FlowFixMe[incompatible-return] 33252 // $FlowFixMe[prop-missing] 33253 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 33254 element.parentNode || ( // DOM Element detected 33255 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 33256 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 33257 getDocumentElement(element) // fallback 33258 33259 ); 33260} 33261;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js 33262 33263 33264 33265 33266 33267 33268 33269function getTrueOffsetParent(element) { 33270 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 33271 getComputedStyle_getComputedStyle(element).position === 'fixed') { 33272 return null; 33273 } 33274 33275 return element.offsetParent; 33276} // `.offsetParent` reports `null` for fixed elements, while absolute elements 33277// return the containing block 33278 33279 33280function getContainingBlock(element) { 33281 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; 33282 var isIE = navigator.userAgent.indexOf('Trident') !== -1; 33283 33284 if (isIE && isHTMLElement(element)) { 33285 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 33286 var elementCss = getComputedStyle_getComputedStyle(element); 33287 33288 if (elementCss.position === 'fixed') { 33289 return null; 33290 } 33291 } 33292 33293 var currentNode = getParentNode(element); 33294 33295 if (isShadowRoot(currentNode)) { 33296 currentNode = currentNode.host; 33297 } 33298 33299 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 33300 var css = getComputedStyle_getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that 33301 // create a containing block. 33302 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 33303 33304 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 33305 return currentNode; 33306 } else { 33307 currentNode = currentNode.parentNode; 33308 } 33309 } 33310 33311 return null; 33312} // Gets the closest ancestor positioned element. Handles some edge cases, 33313// such as table ancestors and cross browser bugs. 33314 33315 33316function getOffsetParent(element) { 33317 var window = getWindow(element); 33318 var offsetParent = getTrueOffsetParent(element); 33319 33320 while (offsetParent && isTableElement(offsetParent) && getComputedStyle_getComputedStyle(offsetParent).position === 'static') { 33321 offsetParent = getTrueOffsetParent(offsetParent); 33322 } 33323 33324 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle_
vendor: 6,229 bytes, lines 33324-33536
33324getComputedStyle(offsetParent).position === 'static')) { 33325 return window; 33326 } 33327 33328 return offsetParent || getContainingBlock(element) || window; 33329} 33330;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js 33331function getMainAxisFromPlacement(placement) { 33332 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 33333} 33334;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js 33335 33336function within(min, value, max) { 33337 return math_max(min, math_min(value, max)); 33338} 33339function withinMaxClamp(min, value, max) { 33340 var v = within(min, value, max); 33341 return v > max ? max : v; 33342} 33343;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js 33344function getFreshSideObject() { 33345 return { 33346 top: 0, 33347 right: 0, 33348 bottom: 0, 33349 left: 0 33350 }; 33351} 33352;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js 33353 33354function mergePaddingObject(paddingObject) { 33355 return Object.assign({}, getFreshSideObject(), paddingObject); 33356} 33357;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js 33358function expandToHashMap(value, keys) { 33359 return keys.reduce(function (hashMap, key) { 33360 hashMap[key] = value; 33361 return hashMap; 33362 }, {}); 33363} 33364;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js 33365 33366 33367 33368 33369 33370 33371 33372 33373 33374 // eslint-disable-next-line import/no-unused-modules 33375 33376var toPaddingObject = function toPaddingObject(padding, state) { 33377 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 33378 placement: state.placement 33379 })) : padding; 33380 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 33381}; 33382 33383function arrow(_ref) { 33384 var _state$modifiersData$; 33385 33386 var state = _ref.state, 33387 name = _ref.name, 33388 options = _ref.options; 33389 var arrowElement = state.elements.arrow; 33390 var popperOffsets = state.modifiersData.popperOffsets; 33391 var basePlacement = getBasePlacement(state.placement); 33392 var axis = getMainAxisFromPlacement(basePlacement); 33393 var isVertical = [left, right].indexOf(basePlacement) >= 0; 33394 var len = isVertical ? 'height' : 'width'; 33395 33396 if (!arrowElement || !popperOffsets) { 33397 return; 33398 } 33399 33400 var paddingObject = toPaddingObject(options.padding, state); 33401 var arrowRect = getLayoutRect(arrowElement); 33402 var minProp = axis === 'y' ? enums_top : left; 33403 var maxProp = axis === 'y' ? bottom : right; 33404 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 33405 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 33406 var arrowOffsetParent = getOffsetParent(arrowElement); 33407 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 33408 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 33409 // outside of the popper bounds 33410 33411 var min = paddingObject[minProp]; 33412 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 33413 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 33414 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 33415 33416 var axisProp = axis; 33417 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 33418} 33419 33420function arrow_effect(_ref2) { 33421 var state = _ref2.state, 33422 options = _ref2.options; 33423 var _options$element = options.element, 33424 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 33425 33426 if (arrowElement == null) { 33427 return; 33428 } // CSS selector 33429 33430 33431 if (typeof arrowElement === 'string') { 33432 arrowElement = state.elements.popper.querySelector(arrowElement); 33433 33434 if (!arrowElement) { 33435 return; 33436 } 33437 } 33438 33439 if (false) {} 33440 33441 if (!contains(state.elements.popper, arrowElement)) { 33442 if (false) {} 33443 33444 return; 33445 } 33446 33447 state.elements.arrow = arrowElement; 33448} // eslint-disable-next-line import/no-unused-modules 33449 33450 33451/* harmony default export */ var modifiers_arrow = ({ 33452 name: 'arrow', 33453 enabled: true, 33454 phase: 'main', 33455 fn: arrow, 33456 effect: arrow_effect, 33457 requires: ['popperOffsets'], 33458 requiresIfExists: ['preventOverflow'] 33459}); 33460;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js 33461function getVariation(placement) { 33462 return placement.split('-')[1]; 33463} 33464;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js 33465 33466 33467 33468 33469 33470 33471 33472 // eslint-disable-next-line import/no-unused-modules 33473 33474var unsetSides = { 33475 top: 'auto', 33476 right: 'auto', 33477 bottom: 'auto', 33478 left: 'auto' 33479}; // Round the offsets to the nearest suitable subpixel based on the DPR. 33480// Zooming can change the DPR, but it seems to report a value that will 33481// cleanly divide the values into the appropriate subpixels. 33482 33483function roundOffsetsByDPR(_ref) { 33484 var x = _ref.x, 33485 y = _ref.y; 33486 var win = window; 33487 var dpr = win.devicePixelRatio || 1; 33488 return { 33489 x: round(x * dpr) / dpr || 0, 33490 y: round(y * dpr) / dpr || 0 33491 }; 33492} 33493 33494function mapToStyles(_ref2) { 33495 var _Object$assign2; 33496 33497 var popper = _ref2.popper, 33498 popperRect = _ref2.popperRect, 33499 placement = _ref2.placement, 33500 variation = _ref2.variation, 33501 offsets = _ref2.offsets, 33502 position = _ref2.position, 33503 gpuAcceleration = _ref2.gpuAcceleration, 33504 adaptive = _ref2.adaptive, 33505 roundOffsets = _ref2.roundOffsets, 33506 isFixed = _ref2.isFixed; 33507 var _offsets$x = offsets.x, 33508 x = _offsets$x === void 0 ? 0 : _offsets$x, 33509 _offsets$y = offsets.y, 33510 y = _offsets$y === void 0 ? 0 : _offsets$y; 33511 33512 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ 33513 x: x, 33514 y: y 33515 }) : { 33516 x: x, 33517 y: y 33518 }; 33519 33520 x = _ref3.x; 33521 y = _ref3.y; 33522 var hasX = offsets.hasOwnProperty('x'); 33523 var hasY = offsets.hasOwnProperty('y'); 33524 var sideX = left; 33525 var sideY = enums_top; 33526 var win = window; 33527 33528 if (adaptive) { 33529 var offsetParent = getOffsetParent(popper); 33530 var heightProp = 'clientHeight'; 33531 var widthProp = 'clientWidth'; 33532 33533 if (offsetParent === getWindow(popper)) { 33534 offsetParent = getDocumentElement(popper); 33535 33536 if (getComputedStyle
vendor: 7,421 bytes, lines 33536-33753
33536_getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { 33537 heightProp = 'scrollHeight'; 33538 widthProp = 'scrollWidth'; 33539 } 33540 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 33541 33542 33543 offsetParent = offsetParent; 33544 33545 if (placement === enums_top || (placement === left || placement === right) && variation === end) { 33546 sideY = bottom; 33547 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 33548 offsetParent[heightProp]; 33549 y -= offsetY - popperRect.height; 33550 y *= gpuAcceleration ? 1 : -1; 33551 } 33552 33553 if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { 33554 sideX = right; 33555 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 33556 offsetParent[widthProp]; 33557 x -= offsetX - popperRect.width; 33558 x *= gpuAcceleration ? 1 : -1; 33559 } 33560 } 33561 33562 var commonStyles = Object.assign({ 33563 position: position 33564 }, adaptive && unsetSides); 33565 33566 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 33567 x: x, 33568 y: y 33569 }) : { 33570 x: x, 33571 y: y 33572 }; 33573 33574 x = _ref4.x; 33575 y = _ref4.y; 33576 33577 if (gpuAcceleration) { 33578 var _Object$assign; 33579 33580 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 33581 } 33582 33583 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 33584} 33585 33586function computeStyles(_ref5) { 33587 var state = _ref5.state, 33588 options = _ref5.options; 33589 var _options$gpuAccelerat = options.gpuAcceleration, 33590 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 33591 _options$adaptive = options.adaptive, 33592 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 33593 _options$roundOffsets = options.roundOffsets, 33594 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 33595 33596 if (false) { var transitionProperty; } 33597 33598 var commonStyles = { 33599 placement: getBasePlacement(state.placement), 33600 variation: getVariation(state.placement), 33601 popper: state.elements.popper, 33602 popperRect: state.rects.popper, 33603 gpuAcceleration: gpuAcceleration, 33604 isFixed: state.options.strategy === 'fixed' 33605 }; 33606 33607 if (state.modifiersData.popperOffsets != null) { 33608 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 33609 offsets: state.modifiersData.popperOffsets, 33610 position: state.options.strategy, 33611 adaptive: adaptive, 33612 roundOffsets: roundOffsets 33613 }))); 33614 } 33615 33616 if (state.modifiersData.arrow != null) { 33617 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 33618 offsets: state.modifiersData.arrow, 33619 position: 'absolute', 33620 adaptive: false, 33621 roundOffsets: roundOffsets 33622 }))); 33623 } 33624 33625 state.attributes.popper = Object.assign({}, state.attributes.popper, { 33626 'data-popper-placement': state.placement 33627 }); 33628} // eslint-disable-next-line import/no-unused-modules 33629 33630 33631/* harmony default export */ var modifiers_computeStyles = ({ 33632 name: 'computeStyles', 33633 enabled: true, 33634 phase: 'beforeWrite', 33635 fn: computeStyles, 33636 data: {} 33637}); 33638;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js 33639 // eslint-disable-next-line import/no-unused-modules 33640 33641var passive = { 33642 passive: true 33643}; 33644 33645function eventListeners_effect(_ref) { 33646 var state = _ref.state, 33647 instance = _ref.instance, 33648 options = _ref.options; 33649 var _options$scroll = options.scroll, 33650 scroll = _options$scroll === void 0 ? true : _options$scroll, 33651 _options$resize = options.resize, 33652 resize = _options$resize === void 0 ? true : _options$resize; 33653 var window = getWindow(state.elements.popper); 33654 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 33655 33656 if (scroll) { 33657 scrollParents.forEach(function (scrollParent) { 33658 scrollParent.addEventListener('scroll', instance.update, passive); 33659 }); 33660 } 33661 33662 if (resize) { 33663 window.addEventListener('resize', instance.update, passive); 33664 } 33665 33666 return function () { 33667 if (scroll) { 33668 scrollParents.forEach(function (scrollParent) { 33669 scrollParent.removeEventListener('scroll', instance.update, passive); 33670 }); 33671 } 33672 33673 if (resize) { 33674 window.removeEventListener('resize', instance.update, passive); 33675 } 33676 }; 33677} // eslint-disable-next-line import/no-unused-modules 33678 33679 33680/* harmony default export */ var eventListeners = ({ 33681 name: 'eventListeners', 33682 enabled: true, 33683 phase: 'write', 33684 fn: function fn() {}, 33685 effect: eventListeners_effect, 33686 data: {} 33687}); 33688;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js 33689var hash = { 33690 left: 'right', 33691 right: 'left', 33692 bottom: 'top', 33693 top: 'bottom' 33694}; 33695function getOppositePlacement(placement) { 33696 return placement.replace(/left|right|bottom|top/g, function (matched) { 33697 return hash[matched]; 33698 }); 33699} 33700;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js 33701var getOppositeVariationPlacement_hash = { 33702 start: 'end', 33703 end: 'start' 33704}; 33705function getOppositeVariationPlacement(placement) { 33706 return placement.replace(/start|end/g, function (matched) { 33707 return getOppositeVariationPlacement_hash[matched]; 33708 }); 33709} 33710;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js 33711 33712function getWindowScroll(node) { 33713 var win = getWindow(node); 33714 var scrollLeft = win.pageXOffset; 33715 var scrollTop = win.pageYOffset; 33716 return { 33717 scrollLeft: scrollLeft, 33718 scrollTop: scrollTop 33719 }; 33720} 33721;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js 33722 33723 33724 33725function getWindowScrollBarX(element) { 33726 // If <html> has a CSS width greater than the viewport, then this will be 33727 // incorrect for RTL. 33728 // Popper 1 is broken in this case and never had a bug report so let's assume 33729 // it's not an issue. I don't think anyone ever specifies width on <html> 33730 // anyway. 33731 // Browsers where the left scrollbar doesn't cause an issue report `0` for 33732 // this (e.g. Edge 2019, IE11, Safari) 33733 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 33734} 33735;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js 33736 33737 33738 33739function getViewportRect(element) { 33740 var win = getWindow(element); 33741 var html = getDocumentElement(element); 33742 var visualViewport = win.visualViewport; 33743 var width = html.clientWidth; 33744 var height = html.clientHeight; 33745 var x = 0; 33746 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper 33747 // can be obscured underneath it. 33748 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even 33749 // if it isn't open, so if this isn't available, the popper will be detected 33750 // to overflow the bottom of the screen too early. 33751 33752 if (visualViewport) { 33753 width = visualViewport.width;
vendor: 9,843 bytes, lines 33754-34045
33754 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) 33755 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding 33756 // errors due to floating point numbers, so we need to check precision. 33757 // Safari returns a number <= 0, usually < -1 when pinch-zoomed 33758 // Feature detection fails in mobile emulation mode in Chrome. 33759 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 33760 // 0.001 33761 // Fallback here: "Not Safari" userAgent 33762 33763 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { 33764 x = visualViewport.offsetLeft; 33765 y = visualViewport.offsetTop; 33766 } 33767 } 33768 33769 return { 33770 width: width, 33771 height: height, 33772 x: x + getWindowScrollBarX(element), 33773 y: y 33774 }; 33775} 33776;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js 33777 33778 33779 33780 33781 // Gets the entire size of the scrollable document area, even extending outside 33782// of the `<html>` and `<body>` rect bounds if horizontally scrollable 33783 33784function getDocumentRect(element) { 33785 var _element$ownerDocumen; 33786 33787 var html = getDocumentElement(element); 33788 var winScroll = getWindowScroll(element); 33789 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 33790 var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 33791 var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 33792 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 33793 var y = -winScroll.scrollTop; 33794 33795 if (getComputedStyle_getComputedStyle(body || html).direction === 'rtl') { 33796 x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; 33797 } 33798 33799 return { 33800 width: width, 33801 height: height, 33802 x: x, 33803 y: y 33804 }; 33805} 33806;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js 33807 33808function isScrollParent(element) { 33809 // Firefox wants us to check `-x` and `-y` variations as well 33810 var _getComputedStyle = getComputedStyle_getComputedStyle(element), 33811 overflow = _getComputedStyle.overflow, 33812 overflowX = _getComputedStyle.overflowX, 33813 overflowY = _getComputedStyle.overflowY; 33814 33815 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 33816} 33817;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js 33818 33819 33820 33821 33822function getScrollParent(node) { 33823 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 33824 // $FlowFixMe[incompatible-return]: assume body is always available 33825 return node.ownerDocument.body; 33826 } 33827 33828 if (isHTMLElement(node) && isScrollParent(node)) { 33829 return node; 33830 } 33831 33832 return getScrollParent(getParentNode(node)); 33833} 33834;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js 33835 33836 33837 33838 33839/* 33840given a DOM element, return the list of all scroll parents, up the list of ancesors 33841until we get to the top window object. This list is what we attach scroll listeners 33842to, because if any of these parent elements scroll, we'll need to re-calculate the 33843reference element's position. 33844*/ 33845 33846function listScrollParents(element, list) { 33847 var _element$ownerDocumen; 33848 33849 if (list === void 0) { 33850 list = []; 33851 } 33852 33853 var scrollParent = getScrollParent(element); 33854 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 33855 var win = getWindow(scrollParent); 33856 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 33857 var updatedList = list.concat(target); 33858 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 33859 updatedList.concat(listScrollParents(getParentNode(target))); 33860} 33861;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js 33862function rectToClientRect(rect) { 33863 return Object.assign({}, rect, { 33864 left: rect.x, 33865 top: rect.y, 33866 right: rect.x + rect.width, 33867 bottom: rect.y + rect.height 33868 }); 33869} 33870;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js 33871 33872 33873 33874 33875 33876 33877 33878 33879 33880 33881 33882 33883 33884 33885 33886function getInnerBoundingClientRect(element) { 33887 var rect = getBoundingClientRect(element); 33888 rect.top = rect.top + element.clientTop; 33889 rect.left = rect.left + element.clientLeft; 33890 rect.bottom = rect.top + element.clientHeight; 33891 rect.right = rect.left + element.clientWidth; 33892 rect.width = element.clientWidth; 33893 rect.height = element.clientHeight; 33894 rect.x = rect.left; 33895 rect.y = rect.top; 33896 return rect; 33897} 33898 33899function getClientRectFromMixedType(element, clippingParent) { 33900 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : instanceOf_isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 33901} // A "clipping parent" is an overflowable container with the characteristic of 33902// clipping (or hiding) overflowing elements with a position different from 33903// `initial` 33904 33905 33906function getClippingParents(element) { 33907 var clippingParents = listScrollParents(getParentNode(element)); 33908 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle_getComputedStyle(element).position) >= 0; 33909 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 33910 33911 if (!instanceOf_isElement(clipperElement)) { 33912 return []; 33913 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 33914 33915 33916 return clippingParents.filter(function (clippingParent) { 33917 return instanceOf_isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 33918 }); 33919} // Gets the maximum area that the element is visible in due to any number of 33920// clipping parents 33921 33922 33923function getClippingRect(element, boundary, rootBoundary) { 33924 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 33925 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 33926 var firstClippingParent = clippingParents[0]; 33927 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 33928 var rect = getClientRectFromMixedType(element, clippingParent); 33929 accRect.top = math_max(rect.top, accRect.top); 33930 accRect.right = math_min(rect.right, accRect.right); 33931 accRect.bottom = math_min(rect.bottom, accRect.bottom); 33932 accRect.left = math_max(rect.left, accRect.left); 33933 return accRect; 33934 }, getClientRectFromMixedType(element, firstClippingParent)); 33935 clippingRect.width = clippingRect.right - clippingRect.left; 33936 clippingRect.height = clippingRect.bottom - clippingRect.top; 33937 clippingRect.x = clippingRect.left; 33938 clippingRect.y = clippingRect.top; 33939 return clippingRect; 33940} 33941;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js 33942 33943 33944 33945 33946function computeOffsets(_ref) { 33947 var reference = _ref.reference, 33948 element = _ref.element, 33949 placement = _ref.placement; 33950 var basePlacement = placement ? getBasePlacement(placement) : null; 33951 var variation = placement ? getVariation(placement) : null; 33952 var commonX = reference.x + reference.width / 2 - element.width / 2; 33953 var commonY = reference.y + reference.height / 2 - element.height / 2; 33954 var offsets; 33955 33956 switch (basePlacement) { 33957 case enums_top: 33958 offsets = { 33959 x: commonX, 33960 y: reference.y - element.height 33961 }; 33962 break; 33963 33964 case bottom: 33965 offsets = { 33966 x: commonX, 33967 y: reference.y + reference.height 33968 }; 33969 break; 33970 33971 case right: 33972 offsets = { 33973 x: reference.x + reference.width, 33974 y: commonY 33975 }; 33976 break; 33977 33978 case left: 33979 offsets = { 33980 x: reference.x - element.width, 33981 y: commonY 33982 }; 33983 break; 33984 33985 default: 33986 offsets = { 33987 x: reference.x, 33988 y: reference.y 33989 }; 33990 } 33991 33992 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 33993 33994 if (mainAxis != null) { 33995 var len = mainAxis === 'y' ? 'height' : 'width'; 33996 33997 switch (variation) { 33998 case start: 33999 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 34000 break; 34001 34002 case end: 34003 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 34004 break; 34005 34006 default: 34007 } 34008 } 34009 34010 return offsets; 34011} 34012;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js 34013 34014 34015 34016 34017 34018 34019 34020 34021 // eslint-disable-next-line import/no-unused-modules 34022 34023function detectOverflow(state, options) { 34024 if (options === void 0) { 34025 options = {}; 34026 } 34027 34028 var _options = options, 34029 _options$placement = _options.placement, 34030 placement = _options$placement === void 0 ? state.placement : _options$placement, 34031 _options$boundary = _options.boundary, 34032 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 34033 _options$rootBoundary = _options.rootBoundary, 34034 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 34035 _options$elementConte = _options.elementContext, 34036 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 34037 _options$altBoundary = _options.altBoundary, 34038 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 34039 _options$padding = _options.padding, 34040 padding = _options$padding === void 0 ? 0 : _options$padding; 34041 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 34042 var altContext = elementContext === popper ? reference : popper; 34043 var popperRect = state.rects.popper; 34044 var element = state.elements[altBoundary ? altContext : elementContext]; 34045 var clippingClientRect = getClippingRect(instanceOf_
vendor: 5,572 bytes, lines 34045-34188
34045isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); 34046 var referenceClientRect = getBoundingClientRect(state.elements.reference); 34047 var popperOffsets = computeOffsets({ 34048 reference: referenceClientRect, 34049 element: popperRect, 34050 strategy: 'absolute', 34051 placement: placement 34052 }); 34053 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 34054 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 34055 // 0 or negative = within the clipping rect 34056 34057 var overflowOffsets = { 34058 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 34059 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 34060 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 34061 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 34062 }; 34063 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 34064 34065 if (elementContext === popper && offsetData) { 34066 var offset = offsetData[placement]; 34067 Object.keys(overflowOffsets).forEach(function (key) { 34068 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 34069 var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 34070 overflowOffsets[key] += offset[axis] * multiply; 34071 }); 34072 } 34073 34074 return overflowOffsets; 34075} 34076;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js 34077 34078 34079 34080 34081function computeAutoPlacement(state, options) { 34082 if (options === void 0) { 34083 options = {}; 34084 } 34085 34086 var _options = options, 34087 placement = _options.placement, 34088 boundary = _options.boundary, 34089 rootBoundary = _options.rootBoundary, 34090 padding = _options.padding, 34091 flipVariations = _options.flipVariations, 34092 _options$allowedAutoP = _options.allowedAutoPlacements, 34093 allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; 34094 var variation = getVariation(placement); 34095 var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 34096 return getVariation(placement) === variation; 34097 }) : basePlacements; 34098 var allowedPlacements = placements.filter(function (placement) { 34099 return allowedAutoPlacements.indexOf(placement) >= 0; 34100 }); 34101 34102 if (allowedPlacements.length === 0) { 34103 allowedPlacements = placements; 34104 34105 if (false) {} 34106 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 34107 34108 34109 var overflows = allowedPlacements.reduce(function (acc, placement) { 34110 acc[placement] = detectOverflow(state, { 34111 placement: placement, 34112 boundary: boundary, 34113 rootBoundary: rootBoundary, 34114 padding: padding 34115 })[getBasePlacement(placement)]; 34116 return acc; 34117 }, {}); 34118 return Object.keys(overflows).sort(function (a, b) { 34119 return overflows[a] - overflows[b]; 34120 }); 34121} 34122;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js 34123 34124 34125 34126 34127 34128 34129 // eslint-disable-next-line import/no-unused-modules 34130 34131function getExpandedFallbackPlacements(placement) { 34132 if (getBasePlacement(placement) === auto) { 34133 return []; 34134 } 34135 34136 var oppositePlacement = getOppositePlacement(placement); 34137 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 34138} 34139 34140function flip(_ref) { 34141 var state = _ref.state, 34142 options = _ref.options, 34143 name = _ref.name; 34144 34145 if (state.modifiersData[name]._skip) { 34146 return; 34147 } 34148 34149 var _options$mainAxis = options.mainAxis, 34150 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 34151 _options$altAxis = options.altAxis, 34152 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 34153 specifiedFallbackPlacements = options.fallbackPlacements, 34154 padding = options.padding, 34155 boundary = options.boundary, 34156 rootBoundary = options.rootBoundary, 34157 altBoundary = options.altBoundary, 34158 _options$flipVariatio = options.flipVariations, 34159 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 34160 allowedAutoPlacements = options.allowedAutoPlacements; 34161 var preferredPlacement = state.options.placement; 34162 var basePlacement = getBasePlacement(preferredPlacement); 34163 var isBasePlacement = basePlacement === preferredPlacement; 34164 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 34165 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 34166 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 34167 placement: placement, 34168 boundary: boundary, 34169 rootBoundary: rootBoundary, 34170 padding: padding, 34171 flipVariations: flipVariations, 34172 allowedAutoPlacements: allowedAutoPlacements 34173 }) : placement); 34174 }, []); 34175 var referenceRect = state.rects.reference; 34176 var popperRect = state.rects.popper; 34177 var checksMap = new Map(); 34178 var makeFallbackChecks = true; 34179 var firstFittingPlacement = placements[0]; 34180 34181 for (var i = 0; i < placements.length; i++) { 34182 var placement = placements[i]; 34183 34184 var _basePlacement = getBasePlacement(placement); 34185 34186 var isStartVariation = getVariation(placement) === start; 34187 var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; 34188 var len = isVertical ? 'width' : 'height';
vendor: 14,091 bytes, lines 34189-34616
34189 var overflow = detectOverflow(state, { 34190 placement: placement, 34191 boundary: boundary, 34192 rootBoundary: rootBoundary, 34193 altBoundary: altBoundary, 34194 padding: padding 34195 }); 34196 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; 34197 34198 if (referenceRect[len] > popperRect[len]) { 34199 mainVariationSide = getOppositePlacement(mainVariationSide); 34200 } 34201 34202 var altVariationSide = getOppositePlacement(mainVariationSide); 34203 var checks = []; 34204 34205 if (checkMainAxis) { 34206 checks.push(overflow[_basePlacement] <= 0); 34207 } 34208 34209 if (checkAltAxis) { 34210 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 34211 } 34212 34213 if (checks.every(function (check) { 34214 return check; 34215 })) { 34216 firstFittingPlacement = placement; 34217 makeFallbackChecks = false; 34218 break; 34219 } 34220 34221 checksMap.set(placement, checks); 34222 } 34223 34224 if (makeFallbackChecks) { 34225 // `2` may be desired in some cases â research later 34226 var numberOfChecks = flipVariations ? 3 : 1; 34227 34228 var _loop = function _loop(_i) { 34229 var fittingPlacement = placements.find(function (placement) { 34230 var checks = checksMap.get(placement); 34231 34232 if (checks) { 34233 return checks.slice(0, _i).every(function (check) { 34234 return check; 34235 }); 34236 } 34237 }); 34238 34239 if (fittingPlacement) { 34240 firstFittingPlacement = fittingPlacement; 34241 return "break"; 34242 } 34243 }; 34244 34245 for (var _i = numberOfChecks; _i > 0; _i--) { 34246 var _ret = _loop(_i); 34247 34248 if (_ret === "break") break; 34249 } 34250 } 34251 34252 if (state.placement !== firstFittingPlacement) { 34253 state.modifiersData[name]._skip = true; 34254 state.placement = firstFittingPlacement; 34255 state.reset = true; 34256 } 34257} // eslint-disable-next-line import/no-unused-modules 34258 34259 34260/* harmony default export */ var modifiers_flip = ({ 34261 name: 'flip', 34262 enabled: true, 34263 phase: 'main', 34264 fn: flip, 34265 requiresIfExists: ['offset'], 34266 data: { 34267 _skip: false 34268 } 34269}); 34270;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js 34271 34272 34273 34274function getSideOffsets(overflow, rect, preventedOffsets) { 34275 if (preventedOffsets === void 0) { 34276 preventedOffsets = { 34277 x: 0, 34278 y: 0 34279 }; 34280 } 34281 34282 return { 34283 top: overflow.top - rect.height - preventedOffsets.y, 34284 right: overflow.right - rect.width + preventedOffsets.x, 34285 bottom: overflow.bottom - rect.height + preventedOffsets.y, 34286 left: overflow.left - rect.width - preventedOffsets.x 34287 }; 34288} 34289 34290function isAnySideFullyClipped(overflow) { 34291 return [enums_top, right, bottom, left].some(function (side) { 34292 return overflow[side] >= 0; 34293 }); 34294} 34295 34296function hide(_ref) { 34297 var state = _ref.state, 34298 name = _ref.name; 34299 var referenceRect = state.rects.reference; 34300 var popperRect = state.rects.popper; 34301 var preventedOffsets = state.modifiersData.preventOverflow; 34302 var referenceOverflow = detectOverflow(state, { 34303 elementContext: 'reference' 34304 }); 34305 var popperAltOverflow = detectOverflow(state, { 34306 altBoundary: true 34307 }); 34308 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 34309 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 34310 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 34311 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 34312 state.modifiersData[name] = { 34313 referenceClippingOffsets: referenceClippingOffsets, 34314 popperEscapeOffsets: popperEscapeOffsets, 34315 isReferenceHidden: isReferenceHidden, 34316 hasPopperEscaped: hasPopperEscaped 34317 }; 34318 state.attributes.popper = Object.assign({}, state.attributes.popper, { 34319 'data-popper-reference-hidden': isReferenceHidden, 34320 'data-popper-escaped': hasPopperEscaped 34321 }); 34322} // eslint-disable-next-line import/no-unused-modules 34323 34324 34325/* harmony default export */ var modifiers_hide = ({ 34326 name: 'hide', 34327 enabled: true, 34328 phase: 'main', 34329 requiresIfExists: ['preventOverflow'], 34330 fn: hide 34331}); 34332;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js 34333 34334 // eslint-disable-next-line import/no-unused-modules 34335 34336function distanceAndSkiddingToXY(placement, rects, offset) { 34337 var basePlacement = getBasePlacement(placement); 34338 var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; 34339 34340 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 34341 placement: placement 34342 })) : offset, 34343 skidding = _ref[0], 34344 distance = _ref[1]; 34345 34346 skidding = skidding || 0; 34347 distance = (distance || 0) * invertDistance; 34348 return [left, right].indexOf(basePlacement) >= 0 ? { 34349 x: distance, 34350 y: skidding 34351 } : { 34352 x: skidding, 34353 y: distance 34354 }; 34355} 34356 34357function offset(_ref2) { 34358 var state = _ref2.state, 34359 options = _ref2.options, 34360 name = _ref2.name; 34361 var _options$offset = options.offset, 34362 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 34363 var data = enums_placements.reduce(function (acc, placement) { 34364 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 34365 return acc; 34366 }, {}); 34367 var _data$state$placement = data[state.placement], 34368 x = _data$state$placement.x, 34369 y = _data$state$placement.y; 34370 34371 if (state.modifiersData.popperOffsets != null) { 34372 state.modifiersData.popperOffsets.x += x; 34373 state.modifiersData.popperOffsets.y += y; 34374 } 34375 34376 state.modifiersData[name] = data; 34377} // eslint-disable-next-line import/no-unused-modules 34378 34379 34380/* harmony default export */ var modifiers_offset = ({ 34381 name: 'offset', 34382 enabled: true, 34383 phase: 'main', 34384 requires: ['popperOffsets'], 34385 fn: offset 34386}); 34387;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js 34388 34389 34390function popperOffsets(_ref) { 34391 var state = _ref.state, 34392 name = _ref.name; 34393 // Offsets are the actual position the popper needs to have to be 34394 // properly positioned near its reference element 34395 // This is the most basic placement, and will be adjusted by 34396 // the modifiers in the next step 34397 state.modifiersData[name] = computeOffsets({ 34398 reference: state.rects.reference, 34399 element: state.rects.popper, 34400 strategy: 'absolute', 34401 placement: state.placement 34402 }); 34403} // eslint-disable-next-line import/no-unused-modules 34404 34405 34406/* harmony default export */ var modifiers_popperOffsets = ({ 34407 name: 'popperOffsets', 34408 enabled: true, 34409 phase: 'read', 34410 fn: popperOffsets, 34411 data: {} 34412}); 34413;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js 34414function getAltAxis(axis) { 34415 return axis === 'x' ? 'y' : 'x'; 34416} 34417;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js 34418 34419 34420 34421 34422 34423 34424 34425 34426 34427 34428 34429 34430function preventOverflow(_ref) { 34431 var state = _ref.state, 34432 options = _ref.options, 34433 name = _ref.name; 34434 var _options$mainAxis = options.mainAxis, 34435 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 34436 _options$altAxis = options.altAxis, 34437 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 34438 boundary = options.boundary, 34439 rootBoundary = options.rootBoundary, 34440 altBoundary = options.altBoundary, 34441 padding = options.padding, 34442 _options$tether = options.tether, 34443 tether = _options$tether === void 0 ? true : _options$tether, 34444 _options$tetherOffset = options.tetherOffset, 34445 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 34446 var overflow = detectOverflow(state, { 34447 boundary: boundary, 34448 rootBoundary: rootBoundary, 34449 padding: padding, 34450 altBoundary: altBoundary 34451 }); 34452 var basePlacement = getBasePlacement(state.placement); 34453 var variation = getVariation(state.placement); 34454 var isBasePlacement = !variation; 34455 var mainAxis = getMainAxisFromPlacement(basePlacement); 34456 var altAxis = getAltAxis(mainAxis); 34457 var popperOffsets = state.modifiersData.popperOffsets; 34458 var referenceRect = state.rects.reference; 34459 var popperRect = state.rects.popper; 34460 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 34461 placement: state.placement 34462 })) : tetherOffset; 34463 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 34464 mainAxis: tetherOffsetValue, 34465 altAxis: tetherOffsetValue 34466 } : Object.assign({ 34467 mainAxis: 0, 34468 altAxis: 0 34469 }, tetherOffsetValue); 34470 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 34471 var data = { 34472 x: 0, 34473 y: 0 34474 }; 34475 34476 if (!popperOffsets) { 34477 return; 34478 } 34479 34480 if (checkMainAxis) { 34481 var _offsetModifierState$; 34482 34483 var mainSide = mainAxis === 'y' ? enums_top : left; 34484 var altSide = mainAxis === 'y' ? bottom : right; 34485 var len = mainAxis === 'y' ? 'height' : 'width'; 34486 var offset = popperOffsets[mainAxis]; 34487 var min = offset + overflow[mainSide]; 34488 var max = offset - overflow[altSide]; 34489 var additive = tether ? -popperRect[len] / 2 : 0; 34490 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 34491 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 34492 // outside the reference bounds 34493 34494 var arrowElement = state.elements.arrow; 34495 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 34496 width: 0, 34497 height: 0 34498 }; 34499 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 34500 var arrowPaddingMin = arrowPaddingObject[mainSide]; 34501 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 34502 // to include its full size in the calculation. If the reference is small 34503 // and near the edge of a boundary, the popper can overflow even if the 34504 // reference is not overflowing as well (e.g. virtual elements with no 34505 // width or height) 34506 34507 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 34508 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 34509 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 34510 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 34511 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 34512 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 34513 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 34514 var tetherMax = offset + maxOffset - offsetModifierValue; 34515 var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); 34516 popperOffsets[mainAxis] = preventedOffset; 34517 data[mainAxis] = preventedOffset - offset; 34518 } 34519 34520 if (checkAltAxis) { 34521 var _offsetModifierState$2; 34522 34523 var _mainSide = mainAxis === 'x' ? enums_top : left; 34524 34525 var _altSide = mainAxis === 'x' ? bottom : right; 34526 34527 var _offset = popperOffsets[altAxis]; 34528 34529 var _len = altAxis === 'y' ? 'height' : 'width'; 34530 34531 var _min = _offset + overflow[_mainSide]; 34532 34533 var _max = _offset - overflow[_altSide]; 34534 34535 var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; 34536 34537 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 34538 34539 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 34540 34541 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 34542 34543 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 34544 34545 popperOffsets[altAxis] = _preventedOffset; 34546 data[altAxis] = _preventedOffset - _offset; 34547 } 34548 34549 state.modifiersData[name] = data; 34550} // eslint-disable-next-line import/no-unused-modules 34551 34552 34553/* harmony default export */ var modifiers_preventOverflow = ({ 34554 name: 'preventOverflow', 34555 enabled: true, 34556 phase: 'main', 34557 fn: preventOverflow, 34558 requiresIfExists: ['offset'] 34559}); 34560;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/index.js 34561 34562 34563 34564 34565 34566 34567 34568 34569 34570;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js 34571function getHTMLElementScroll(element) { 34572 return { 34573 scrollLeft: element.scrollLeft, 34574 scrollTop: element.scrollTop 34575 }; 34576} 34577;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js 34578 34579 34580 34581 34582function getNodeScroll(node) { 34583 if (node === getWindow(node) || !isHTMLElement(node)) { 34584 return getWindowScroll(node); 34585 } else { 34586 return getHTMLElementScroll(node); 34587 } 34588} 34589;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js 34590 34591 34592 34593 34594 34595 34596 34597 34598 34599function isElementScaled(element) { 34600 var rect = element.getBoundingClientRect(); 34601 var scaleX = round(rect.width) / element.offsetWidth || 1; 34602 var scaleY = round(rect.height) / element.offsetHeight || 1; 34603 return scaleX !== 1 || scaleY !== 1; 34604} // Returns the composite rect of an element relative to its offsetParent. 34605// Composite means it takes into account transforms as well as layout. 34606 34607 34608function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 34609 if (isFixed === void 0) { 34610 isFixed = false; 34611 } 34612 34613 var isOffsetParentAnElement = isHTMLElement(offsetParent); 34614 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); 34615 var documentElement = getDocumentElement(offsetParent); 34616 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled
vendor: 13,030 bytes, lines 34616-35019
34616); 34617 var scroll = { 34618 scrollLeft: 0, 34619 scrollTop: 0 34620 }; 34621 var offsets = { 34622 x: 0, 34623 y: 0 34624 }; 34625 34626 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 34627 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 34628 isScrollParent(documentElement)) { 34629 scroll = getNodeScroll(offsetParent); 34630 } 34631 34632 if (isHTMLElement(offsetParent)) { 34633 offsets = getBoundingClientRect(offsetParent, true); 34634 offsets.x += offsetParent.clientLeft; 34635 offsets.y += offsetParent.clientTop; 34636 } else if (documentElement) { 34637 offsets.x = getWindowScrollBarX(documentElement); 34638 } 34639 } 34640 34641 return { 34642 x: rect.left + scroll.scrollLeft - offsets.x, 34643 y: rect.top + scroll.scrollTop - offsets.y, 34644 width: rect.width, 34645 height: rect.height 34646 }; 34647} 34648;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js 34649 // source: https://stackoverflow.com/questions/49875255 34650 34651function order(modifiers) { 34652 var map = new Map(); 34653 var visited = new Set(); 34654 var result = []; 34655 modifiers.forEach(function (modifier) { 34656 map.set(modifier.name, modifier); 34657 }); // On visiting object, check for its dependencies and visit them recursively 34658 34659 function sort(modifier) { 34660 visited.add(modifier.name); 34661 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); 34662 requires.forEach(function (dep) { 34663 if (!visited.has(dep)) { 34664 var depModifier = map.get(dep); 34665 34666 if (depModifier) { 34667 sort(depModifier); 34668 } 34669 } 34670 }); 34671 result.push(modifier); 34672 } 34673 34674 modifiers.forEach(function (modifier) { 34675 if (!visited.has(modifier.name)) { 34676 // check for visited object 34677 sort(modifier); 34678 } 34679 }); 34680 return result; 34681} 34682 34683function orderModifiers(modifiers) { 34684 // order based on dependencies 34685 var orderedModifiers = order(modifiers); // order based on phase 34686 34687 return modifierPhases.reduce(function (acc, phase) { 34688 return acc.concat(orderedModifiers.filter(function (modifier) { 34689 return modifier.phase === phase; 34690 })); 34691 }, []); 34692} 34693;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js 34694function debounce(fn) { 34695 var pending; 34696 return function () { 34697 if (!pending) { 34698 pending = new Promise(function (resolve) { 34699 Promise.resolve().then(function () { 34700 pending = undefined; 34701 resolve(fn()); 34702 }); 34703 }); 34704 } 34705 34706 return pending; 34707 }; 34708} 34709;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js 34710function mergeByName(modifiers) { 34711 var merged = modifiers.reduce(function (merged, current) { 34712 var existing = merged[current.name]; 34713 merged[current.name] = existing ? Object.assign({}, existing, current, { 34714 options: Object.assign({}, existing.options, current.options), 34715 data: Object.assign({}, existing.data, current.data) 34716 }) : current; 34717 return merged; 34718 }, {}); // IE11 does not support Object.values 34719 34720 return Object.keys(merged).map(function (key) { 34721 return merged[key]; 34722 }); 34723} 34724;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js 34725 34726 34727 34728 34729 34730 34731 34732 34733 34734 34735 34736 34737 34738 34739var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; 34740var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; 34741var DEFAULT_OPTIONS = { 34742 placement: 'bottom', 34743 modifiers: [], 34744 strategy: 'absolute' 34745}; 34746 34747function areValidElements() { 34748 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 34749 args[_key] = arguments[_key]; 34750 } 34751 34752 return !args.some(function (element) { 34753 return !(element && typeof element.getBoundingClientRect === 'function'); 34754 }); 34755} 34756 34757function popperGenerator(generatorOptions) { 34758 if (generatorOptions === void 0) { 34759 generatorOptions = {}; 34760 } 34761 34762 var _generatorOptions = generatorOptions, 34763 _generatorOptions$def = _generatorOptions.defaultModifiers, 34764 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 34765 _generatorOptions$def2 = _generatorOptions.defaultOptions, 34766 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 34767 return function createPopper(reference, popper, options) { 34768 if (options === void 0) { 34769 options = defaultOptions; 34770 } 34771 34772 var state = { 34773 placement: 'bottom', 34774 orderedModifiers: [], 34775 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 34776 modifiersData: {}, 34777 elements: { 34778 reference: reference, 34779 popper: popper 34780 }, 34781 attributes: {}, 34782 styles: {} 34783 }; 34784 var effectCleanupFns = []; 34785 var isDestroyed = false; 34786 var instance = { 34787 state: state, 34788 setOptions: function setOptions(setOptionsAction) { 34789 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 34790 cleanupModifierEffects(); 34791 state.options = Object.assign({}, defaultOptions, state.options, options); 34792 state.scrollParents = { 34793 reference: instanceOf_isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 34794 popper: listScrollParents(popper) 34795 }; // Orders the modifiers based on their dependencies and `phase` 34796 // properties 34797 34798 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 34799 34800 state.orderedModifiers = orderedModifiers.filter(function (m) { 34801 return m.enabled; 34802 }); // Validate the provided modifiers so that the consumer will get warned 34803 // if one of the modifiers is invalid for any reason 34804 34805 if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } 34806 34807 runModifierEffects(); 34808 return instance.update(); 34809 }, 34810 // Sync update â it will always be executed, even if not necessary. This 34811 // is useful for low frequency updates where sync behavior simplifies the 34812 // logic. 34813 // For high frequency updates (e.g. `resize` and `scroll` events), always 34814 // prefer the async Popper#update method 34815 forceUpdate: function forceUpdate() { 34816 if (isDestroyed) { 34817 return; 34818 } 34819 34820 var _state$elements = state.elements, 34821 reference = _state$elements.reference, 34822 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 34823 // anymore 34824 34825 if (!areValidElements(reference, popper)) { 34826 if (false) {} 34827 34828 return; 34829 } // Store the reference and popper rects to be read by modifiers 34830 34831 34832 state.rects = { 34833 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 34834 popper: getLayoutRect(popper) 34835 }; // Modifiers have the ability to reset the current update cycle. The 34836 // most common use case for this is the `flip` modifier changing the 34837 // placement, which then needs to re-run all the modifiers, because the 34838 // logic was previously ran for the previous placement and is therefore 34839 // stale/incorrect 34840 34841 state.reset = false; 34842 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 34843 // is filled with the initial data specified by the modifier. This means 34844 // it doesn't persist and is fresh on each update. 34845 // To ensure persistent data, use `${name}#persistent` 34846 34847 state.orderedModifiers.forEach(function (modifier) { 34848 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 34849 }); 34850 var __debug_loops__ = 0; 34851 34852 for (var index = 0; index < state.orderedModifiers.length; index++) { 34853 if (false) {} 34854 34855 if (state.reset === true) { 34856 state.reset = false; 34857 index = -1; 34858 continue; 34859 } 34860 34861 var _state$orderedModifie = state.orderedModifiers[index], 34862 fn = _state$orderedModifie.fn, 34863 _state$orderedModifie2 = _state$orderedModifie.options, 34864 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 34865 name = _state$orderedModifie.name; 34866 34867 if (typeof fn === 'function') { 34868 state = fn({ 34869 state: state, 34870 options: _options, 34871 name: name, 34872 instance: instance 34873 }) || state; 34874 } 34875 } 34876 }, 34877 // Async and optimistically optimized update â it will not be executed if 34878 // not necessary (debounced to run at most once-per-tick) 34879 update: debounce(function () { 34880 return new Promise(function (resolve) { 34881 instance.forceUpdate(); 34882 resolve(state); 34883 }); 34884 }), 34885 destroy: function destroy() { 34886 cleanupModifierEffects(); 34887 isDestroyed = true; 34888 } 34889 }; 34890 34891 if (!areValidElements(reference, popper)) { 34892 if (false) {} 34893 34894 return instance; 34895 } 34896 34897 instance.setOptions(options).then(function (state) { 34898 if (!isDestroyed && options.onFirstUpdate) { 34899 options.onFirstUpdate(state); 34900 } 34901 }); // Modifiers have the ability to execute arbitrary code before the first 34902 // update cycle runs. They will be executed in the same order as the update 34903 // cycle. This is useful when a modifier adds some persistent data that 34904 // other modifiers need to use, but the modifier is run after the dependent 34905 // one. 34906 34907 function runModifierEffects() { 34908 state.orderedModifiers.forEach(function (_ref3) { 34909 var name = _ref3.name, 34910 _ref3$options = _ref3.options, 34911 options = _ref3$options === void 0 ? {} : _ref3$options, 34912 effect = _ref3.effect; 34913 34914 if (typeof effect === 'function') { 34915 var cleanupFn = effect({ 34916 state: state, 34917 name: name, 34918 instance: instance, 34919 options: options 34920 }); 34921 34922 var noopFn = function noopFn() {}; 34923 34924 effectCleanupFns.push(cleanupFn || noopFn); 34925 } 34926 }); 34927 } 34928 34929 function cleanupModifierEffects() { 34930 effectCleanupFns.forEach(function (fn) { 34931 return fn(); 34932 }); 34933 effectCleanupFns = []; 34934 } 34935 34936 return instance; 34937 }; 34938} 34939var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules 34940 34941 34942;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js 34943 34944 34945 34946 34947 34948 34949 34950 34951 34952 34953var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; 34954var popper_createPopper = /*#__PURE__*/popperGenerator({ 34955 defaultModifiers: defaultModifiers 34956}); // eslint-disable-next-line import/no-unused-modules 34957 34958 // eslint-disable-next-line import/no-unused-modules 34959 34960 // eslint-disable-next-line import/no-unused-modules 34961 34962 34963;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper-lite.js 34964 34965 34966 34967 34968 34969var popper_lite_defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles]; 34970var popper_lite_createPopper = /*#__PURE__*/popperGenerator({ 34971 defaultModifiers: popper_lite_defaultModifiers 34972}); // eslint-disable-next-line import/no-unused-modules 34973 34974 34975;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/index.js 34976 34977 // eslint-disable-next-line import/no-unused-modules 34978 34979 // eslint-disable-next-line import/no-unused-modules 34980 34981 // eslint-disable-next-line import/no-unused-modules 34982 34983 34984;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/sanitizer.js 34985/** 34986 * -------------------------------------------------------------------------- 34987 * Bootstrap (v5.1.3): util/sanitizer.js 34988 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 34989 * -------------------------------------------------------------------------- 34990 */ 34991 34992const uriAttributes = new Set([ 34993 'background', 34994 'cite', 34995 'href', 34996 'itemtype', 34997 'longdesc', 34998 'poster', 34999 'src', 35000 'xlink:href' 35001]) 35002 35003const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i 35004 35005/** 35006 * A pattern that recognizes a commonly useful subset of URLs that are safe. 35007 * 35008 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 35009 */ 35010const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i 35011 35012/** 35013 * A pattern that matches safe data URLs. Only matches image, video and audio types. 35014 * 35015 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 35016 */ 35017const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i 35018 35019const allowedAttribute = (attribute, allowedAttributeList) => {
35020 const attributeName = attribute.nodeName.toLowerCase() 35021 35022 if (allowedAttributeList.includes(attributeName)) { 35023 if (uriAttributes.has(attributeName)) { 35024 return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue)) 35025 } 35026 35027 return true 35028 } 35029 35030 const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp) 35031 35032 // Check if a regular expression validates the attribute. 35033 for (let i = 0, len = regExp.length; i < len; i++) { 35034 if (regExp[i].test(attributeName)) { 35035 return true 35036 } 35037 } 35038 35039 return false 35040} 35041 35042const DefaultAllowlist = { 35043 // Global attributes allowed on any supplied element below. 35044 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 35045 a: ['target', 'href', 'title', 'rel'], 35046 area: [], 35047 b: [], 35048 br: [], 35049 col: [], 35050 code: [], 35051 div: [], 35052 em: [], 35053 hr: [], 35054 h1: [], 35055 h2: [], 35056 h3: [], 35057 h4: [], 35058 h5: [], 35059 h6: [], 35060 i: [], 35061 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 35062 li: [], 35063 ol: [], 35064 p: [], 35065 pre: [], 35066 s: [], 35067 small: [], 35068 span: [], 35069 sub: [], 35070 sup: [], 35071 strong: [], 35072 u: [], 35073 ul: [] 35074} 35075 35076function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) { 35077 if (!unsafeHtml.length) { 35078 return unsafeHtml 35079 } 35080 35081 if (sanitizeFn && typeof sanitizeFn === 'function') { 35082 return sanitizeFn(unsafeHtml) 35083 } 35084 35085 const domParser = new window.DOMParser() 35086 const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html') 35087 const elements = [].concat(...createdDocument.body.querySelectorAll('*')) 35088 35089 for (let i = 0, len = elements.length; i < len; i++) { 35090 const element = elements[i] 35091 const elementName = element.nodeName.toLowerCase() 35092 35093 if (!Object.keys(allowList).includes(elementName)) { 35094 element.remove() 35095 35096 continue 35097 } 35098 35099 const attributeList = [].concat(...element.attributes) 35100 const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []) 35101 35102 attributeList.forEach(attribute => { 35103 if (!allowedAttribute(attribute, allowedAttributes)) { 35104 element.removeAttribute(attribute.nodeName) 35105 } 35106 }) 35107 } 35108 35109 return createdDocument.body.innerHTML 35110} 35111 35112;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/tooltip.js 35113/** 35114 * -------------------------------------------------------------------------- 35115 * Bootstrap (v5.1.3): tooltip.js 35116 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 35117 * -------------------------------------------------------------------------- 35118 */ 35119 35120 35121 35122 35123 35124 35125 35126 35127 35128 35129 35130/** 35131 * ------------------------------------------------------------------------ 35132 * Constants 35133 * ------------------------------------------------------------------------ 35134 */ 35135 35136const tooltip_NAME = 'tooltip' 35137const tooltip_DATA_KEY = 'bs.tooltip' 35138const tooltip_EVENT_KEY = `.${tooltip_DATA_KEY}` 35139const CLASS_PREFIX = 'bs-tooltip' 35140const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']) 35141 35142const tooltip_DefaultType = { 35143 animation: 'boolean', 35144 template: 'string', 35145 title: '(string|element|function)', 35146 trigger: 'string', 35147 delay: '(number|object)', 35148 html: 'boolean', 35149 selector: '(string|boolean)', 35150 placement: '(string|function)', 35151 offset: '(array|string|function)', 35152 container: '(string|element|boolean)', 35153 fallbackPlacements: 'array', 35154 boundary: '(string|element)', 35155 customClass: '(string|function)', 35156 sanitize: 'boolean', 35157 sanitizeFn: '(null|function)', 35158 allowList: 'object', 35159 popperConfig: '(null|object|function)' 35160} 35161 35162const AttachmentMap = { 35163 AUTO: 'auto', 35164 TOP: 'top', 35165 RIGHT: isRTL() ? 'left' : 'right', 35166 BOTTOM: 'bottom', 35167 LEFT: isRTL() ? 'right' : 'left' 35168} 35169 35170const tooltip_Default = { 35171 animation: true, 35172 template: '<div class="tooltip" role="tooltip">' + 35173 '<div class="tooltip-arrow"></div>' + 35174 '<div class="tooltip-inner"></div>' + 35175 '</div>', 35176 trigger: 'hover focus', 35177 title: '', 35178 delay: 0, 35179 html: false, 35180 selector: false, 35181 placement: 'top', 35182 offset: [0, 0], 35183 container: false, 35184 fallbackPlacements: ['top', 'right', 'bottom', 'left'], 35185 boundary: 'clippingParents', 35186 customClass: '', 35187 sanitize: true, 35188 sanitizeFn: null, 35189 allowList: DefaultAllowlist, 35190 popperConfig: null 35191} 35192 35193const tooltip_Event = { 35194 HIDE: `hide${tooltip_EVENT_KEY}`, 35195 HIDDEN: `hidden${tooltip_EVENT_KEY}`, 35196 SHOW: `show${tooltip_EVENT_KEY}`, 35197 SHOWN: `shown${tooltip_EVENT_KEY}`, 35198 INSERTED: `inserted${tooltip_EVENT_KEY}`, 35199 CLICK: `click${tooltip_EVENT_KEY}`, 35200 FOCUSIN: `focusin${tooltip_EVENT_KEY}`, 35201 FOCUSOUT: `focusout${tooltip_EVENT_KEY}`, 35202 MOUSEENTER: `mouseenter${tooltip_EVENT_KEY}`, 35203 MOUSELEAVE: `mouseleave${tooltip_EVENT_KEY}` 35204} 35205 35206const CLASS_NAME_FADE = 'fade' 35207const CLASS_NAME_MODAL = 'modal' 35208const tooltip_CLASS_NAME_SHOW = 'show' 35209 35210const HOVER_STATE_SHOW = 'show' 35211const HOVER_STATE_OUT = 'out' 35212 35213const SELECTOR_TOOLTIP_INNER = '.tooltip-inner' 35214const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}` 35215 35216const EVENT_MODAL_HIDE = 'hide.bs.modal' 35217 35218const TRIGGER_HOVER = 'hover' 35219const TRIGGER_FOCUS = 'focus' 35220const TRIGGER_CLICK = 'click' 35221const TRIGGER_MANUAL = 'manual' 35222 35223/** 35224 * ------------------------------------------------------------------------ 35225 * Class Definition 35226 * ------------------------------------------------------------------------ 35227 */ 35228 35229class Tooltip extends base_component { 35230 constructor(element, config) { 35231 if (typeof lib_namespaceObject === 'undefined') { 35232 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)') 35233 } 35234 35235 super(element) 35236 35237 // private 35238 this._isEnabled = true 35239 this._timeout = 0 35240 this._hoverState = '' 35241 this._activeTrigger = {} 35242 this._popper = null 35243 35244 // Protected 35245 this._config = this._getConfig(config) 35246 this.tip = null 35247 35248 this._setListeners() 35249 } 35250 35251 // Getters 35252 35253 static get Default() { 35254 return tooltip_Default 35255 } 35256 35257 static get NAME() { 35258 return tooltip_NAME 35259 } 35260 35261 static get Event() { 35262 return tooltip_Event 35263 } 35264 35265 static get DefaultType() { 35266 return tooltip_DefaultType 35267 } 35268 35269 // Public 35270 35271 enable() { 35272 this._isEnabled = true 35273 } 35274 35275 disable() { 35276 this._isEnabled = false 35277 } 35278 35279 toggleEnabled() { 35280 this._isEnabled = !this._isEnabled 35281 } 35282 35283 toggle(event) { 35284 if (!this._isEnabled) { 35285 return 35286 } 35287 35288 if (event) { 35289 const context = this._initializeOnDelegatedTarget(event) 35290 35291 context._activeTrigger.click = !context._activeTrigger.click 35292 35293 if (context._isWithActiveTrigger()) { 35294 context._enter(null, context) 35295 } else { 35296 context._leave(null, context) 35297 } 35298 } else { 35299 if (this.getTipElement().classList.contains(tooltip_CLASS_NAME_SHOW)) { 35300 this._leave(null, this) 35301 return 35302 } 35303 35304 this._enter(null, this) 35305 } 35306 } 35307 35308 dispose() { 35309 clearTimeout(this._timeout) 35310 35311 event_handler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler) 35312 35313 if (this.tip) { 35314 this.tip.remove() 35315 } 35316 35317 this._disposePopper() 35318 super.dispose() 35319 } 35320 35321 show() { 35322 if (this._element.style.display === 'none') { 35323 throw new Error('Please use show on visible elements') 35324 } 35325 35326 if (!(this.isWithContent() && this._isEnabled)) { 35327 return 35328 } 35329 35330 const showEvent = event_handler.trigger(this._element, this.constructor.Event.SHOW) 35331 const shadowRoot = findShadowRoot(this._element) 35332 const isInTheDom = shadowRoot === null ? 35333 this._element.ownerDocument.documentElement.contains(this._element) : 35334 shadowRoot.contains(this._element) 35335 35336 if (showEvent.defaultPrevented || !isInTheDom) { 35337 return 35338 } 35339 35340 // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title` 35341 // This will be removed later in favor of a `setContent` method
35342 if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) { 35343 this._disposePopper() 35344 this.tip.remove() 35345 this.tip = null 35346 } 35347 35348 const tip = this.getTipElement() 35349 const tipId = getUID(this.constructor.NAME) 35350 35351 tip.setAttribute('id', tipId) 35352 this._element.setAttribute('aria-describedby', tipId) 35353 35354 if (this._config.animation) { 35355 tip.classList.add(CLASS_NAME_FADE) 35356 } 35357 35358 const placement = typeof this._config.placement === 'function' ? 35359 this._config.placement.call(this, tip, this._element) : 35360 this._config.placement 35361 35362 const attachment = this._getAttachment(placement) 35363 this._addAttachmentClass(attachment) 35364 35365 const { container } = this._config 35366 data.set(tip, this.constructor.DATA_KEY, this) 35367 35368 if (!this._element.ownerDocument.documentElement.contains(this.tip)) { 35369 container.append(tip) 35370 event_handler.trigger(this._element, this.constructor.Event.INSERTED) 35371 } 35372 35373 if (this._popper) { 35374 this._popper.update() 35375 } else { 35376 this._popper = popper_createPopper(this._element, tip, this._getPopperConfig(attachment)) 35377 } 35378 35379 tip.classList.add(tooltip_CLASS_NAME_SHOW) 35380 35381 const customClass = this._resolvePossibleFunction(this._config.customClass) 35382 if (customClass) { 35383 tip.classList.add(...customClass.split(' ')) 35384 } 35385 35386 // If this is a touch-enabled device we add extra 35387 // empty mouseover listeners to the body's immediate children; 35388 // only needed because of broken event delegation on iOS 35389 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 35390 if ('ontouchstart' in document.documentElement) { 35391 [].concat(...document.body.children).forEach(element => { 35392 event_handler.on(element, 'mouseover', noop) 35393 }) 35394 } 35395 35396 const complete = () => { 35397 const prevHoverState = this._hoverState 35398 35399 this._hoverState = null 35400 event_handler.trigger(this._element, this.constructor.Event.SHOWN) 35401 35402 if (prevHoverState === HOVER_STATE_OUT) { 35403 this._leave(null, this) 35404 } 35405 } 35406 35407 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE) 35408 this._queueCallback(complete, this.tip, isAnimated) 35409 } 35410 35411 hide() { 35412 if (!this._popper) { 35413 return 35414 } 35415 35416 const tip = this.getTipElement() 35417 const complete = () => { 35418 if (this._isWithActiveTrigger()) { 35419 return 35420 } 35421 35422 if (this._hoverState !== HOVER_STATE_SHOW) { 35423 tip.remove() 35424 } 35425 35426 this._cleanTipClass() 35427 this._element.removeAttribute('aria-describedby') 35428 event_handler.trigger(this._element, this.constructor.Event.HIDDEN) 35429 35430 this._disposePopper() 35431 } 35432 35433 const hideEvent = event_handler.trigger(this._element, this.constructor.Event.HIDE) 35434 if (hideEvent.defaultPrevented) { 35435 return 35436 } 35437 35438 tip.classList.remove(tooltip_CLASS_NAME_SHOW) 35439 35440 // If this is a touch-enabled device we remove the extra 35441 // empty mouseover listeners we added for iOS support 35442 if ('ontouchstart' in document.documentElement) { 35443 [].concat(...document.body.children) 35444 .forEach(element => event_handler.off(element, 'mouseover', noop)) 35445 } 35446 35447 this._activeTrigger[TRIGGER_CLICK] = false 35448 this._activeTrigger[TRIGGER_FOCUS] = false 35449 this._activeTrigger[TRIGGER_HOVER] = false 35450 35451 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE) 35452 this._queueCallback(complete, this.tip, isAnimated) 35453 this._hoverState = '' 35454 } 35455 35456 update() { 35457 if (this._popper !== null) { 35458 this._popper.update() 35459 } 35460 } 35461 35462 // Protected 35463 35464 isWithContent() { 35465 return Boolean(this.getTitle()) 35466 } 35467 35468 getTipElement() { 35469 if (this.tip) { 35470 return this.tip 35471 } 35472 35473 const element = document.createElement('div') 35474 element.innerHTML = this._config.template 35475 35476 const tip = element.children[0] 35477 this.setContent(tip) 35478 tip.classList.remove(CLASS_NAME_FADE, tooltip_CLASS_NAME_SHOW) 35479 35480 this.tip = tip 35481 return this.tip 35482 } 35483 35484 setContent(tip) { 35485 this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER) 35486 } 35487 35488 _sanitizeAndSetContent(template, content, selector) { 35489 const templateElement = selector_engine.findOne(selector, template) 35490 35491 if (!content && templateElement) { 35492 templateElement.remove() 35493 return 35494 } 35495 35496 // we use append for html objects to maintain js events 35497 this.setElementContent(templateElement, content) 35498 } 35499 35500 setElementContent(element, content) { 35501 if (element === null) { 35502 return 35503 } 35504 35505 if (isElement(content)) { 35506 content = getElement(content) 35507 35508 // content is a DOM node or a jQuery 35509 if (this._config.html) { 35510 if (content.parentNode !== element) { 35511 element.innerHTML = '' 35512 element.append(content) 35513 } 35514 } else { 35515 element.textContent = content.textContent 35516 } 35517 35518 return 35519 } 35520 35521 if (this._config.html) { 35522 if (this._config.sanitize) { 35523 content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn) 35524 } 35525 35526 element.innerHTML = content 35527 } else { 35528 element.textContent = content 35529 } 35530 } 35531 35532 getTitle() { 35533 const title = this._element.getAttribute('data-bs-original-title') || this._config.title 35534 35535 return this._resolvePossibleFunction(title) 35536 } 35537 35538 updateAttachment(attachment) { 35539 if (attachment === 'right') { 35540 return 'end'
35541 } 35542 35543 if (attachment === 'left') { 35544 return 'start' 35545 } 35546 35547 return attachment 35548 } 35549 35550 // Private 35551 35552 _initializeOnDelegatedTarget(event, context) { 35553 return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()) 35554 } 35555 35556 _getOffset() { 35557 const { offset } = this._config 35558 35559 if (typeof offset === 'string') { 35560 return offset.split(',').map(val => Number.parseInt(val, 10)) 35561 } 35562 35563 if (typeof offset === 'function') { 35564 return popperData => offset(popperData, this._element) 35565 } 35566 35567 return offset 35568 } 35569 35570 _resolvePossibleFunction(content) { 35571 return typeof content === 'function' ? content.call(this._element) : content 35572 } 35573 35574 _getPopperConfig(attachment) { 35575 const defaultBsPopperConfig = { 35576 placement: attachment, 35577 modifiers: [ 35578 { 35579 name: 'flip', 35580 options: { 35581 fallbackPlacements: this._config.fallbackPlacements 35582 } 35583 }, 35584 { 35585 name: 'offset', 35586 options: { 35587 offset: this._getOffset() 35588 } 35589 }, 35590 { 35591 name: 'preventOverflow', 35592 options: { 35593 boundary: this._config.boundary 35594 } 35595 }, 35596 { 35597 name: 'arrow', 35598 options: { 35599 element: `.${this.constructor.NAME}-arrow` 35600 } 35601 }, 35602 { 35603 name: 'onChange', 35604 enabled: true, 35605 phase: 'afterWrite', 35606 fn: data => this._handlePopperPlacementChange(data) 35607 } 35608 ], 35609 onFirstUpdate: data => { 35610 if (data.options.placement !== data.placement) { 35611 this._handlePopperPlacementChange(data) 35612 } 35613 } 35614 } 35615 35616 return { 35617 ...defaultBsPopperConfig, 35618 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) 35619 } 35620 } 35621 35622 _addAttachmentClass(attachment) { 35623 this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`) 35624 } 35625 35626 _getAttachment(placement) { 35627 return AttachmentMap[placement.toUpperCase()] 35628 } 35629 35630 _setListeners() { 35631 const triggers = this._config.trigger.split(' ') 35632 35633 triggers.forEach(trigger => { 35634 if (trigger === 'click') { 35635 event_handler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event)) 35636 } else if (trigger !== TRIGGER_MANUAL) { 35637 const eventIn = trigger === TRIGGER_HOVER ? 35638 this.constructor.Event.MOUSEENTER : 35639 this.constructor.Event.FOCUSIN 35640 const eventOut = trigger === TRIGGER_HOVER ? 35641 this.constructor.Event.MOUSELEAVE : 35642 this.constructor.Event.FOCUSOUT 35643 35644 event_handler.on(this._element, eventIn, this._config.selector, event => this._enter(event)) 35645 event_handler.on(this._element, eventOut, this._config.selector, event => this._leave(event)) 35646 } 35647 }) 35648 35649 this._hideModalHandler = () => { 35650 if (this._element) { 35651 this.hide() 35652 } 35653 } 35654 35655 event_handler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler) 35656 35657 if (this._config.selector) { 35658 this._config = { 35659 ...this._config, 35660 trigger: 'manual', 35661 selector: '' 35662 } 35663 } else { 35664 this._fixTitle() 35665 } 35666 } 35667 35668 _fixTitle() { 35669 const title = this._element.getAttribute('title') 35670 const originalTitleType = typeof this._element.getAttribute('data-bs-original-title') 35671 35672 if (title || originalTitleType !== 'string') { 35673 this._element.setAttribute('data-bs-original-title', title || '') 35674 if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) { 35675 this._element.setAttribute('aria-label', title) 35676 } 35677 35678 this._element.setAttribute('title', '') 35679 } 35680 } 35681 35682 _enter(event, context) { 35683 context = this._initializeOnDelegatedTarget(event, context) 35684 35685 if (event) { 35686 context._activeTrigger[ 35687 event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER 35688 ] = true 35689 } 35690 35691 if (context.getTipElement().classList.contains(tooltip_CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) { 35692 context._hoverState = HOVER_STATE_SHOW 35693 return 35694 } 35695 35696 clearTimeout(context._timeout) 35697 35698 context._hoverState = HOVER_STATE_SHOW 35699 35700 if (!context._config.delay || !context._config.delay.show) { 35701 context.show() 35702 return 35703 } 35704 35705 context._timeout = setTimeout(() => { 35706 if (context._hoverState === HOVER_STATE_SHOW) { 35707 context.show() 35708 } 35709 }, context._config.delay.show) 35710 } 35711 35712 _leave(event, context) { 35713 context = this._initializeOnDelegatedTarget(event, context) 35714 35715 if (event) { 35716 context._activeTrigger[ 35717 event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER 35718 ] = context._element.contains(event.relatedTarget) 35719 } 35720 35721 if (context._isWithActiveTrigger()) { 35722 return 35723 } 35724 35725 clearTimeout(context._timeout) 35726 35727 context._hoverState = HOVER_STATE_OUT 35728 35729 if (!context._config.delay || !context._config.delay.hide) { 35730 context.hide() 35731 return 35732 } 35733 35734 context._timeout = setTimeout(() => { 35735 if (context._hoverState === HOVER_STATE_OUT) { 35736 context.hide() 35737 } 35738 }, context._config.delay.hide) 35739 } 35740 35741 _isWithActiveTrigger() { 35742 for (const trigger in this._activeTrigger) { 35743 if (this._activeTrigger[trigger]) { 35744 return true 35745 } 35746 } 35747 35748 return false 35749 } 35750 35751 _getConfig(config) { 35752 const dataAttributes = manipulator.getDataAttributes(this._element) 35753
35754 Object.keys(dataAttributes).forEach(dataAttr => { 35755 if (DISALLOWED_ATTRIBUTES.has(dataAttr)) { 35756 delete dataAttributes[dataAttr] 35757 } 35758 }) 35759 35760 config = { 35761 ...this.constructor.Default, 35762 ...dataAttributes, 35763 ...(typeof config === 'object' && config ? config : {}) 35764 } 35765 35766 config.container = config.container === false ? document.body : getElement(config.container) 35767 35768 if (typeof config.delay === 'number') { 35769 config.delay = { 35770 show: config.delay, 35771 hide: config.delay 35772 } 35773 } 35774 35775 if (typeof config.title === 'number') { 35776 config.title = config.title.toString() 35777 } 35778 35779 if (typeof config.content === 'number') { 35780 config.content = config.content.toString() 35781 } 35782 35783 typeCheckConfig(tooltip_NAME, config, this.constructor.DefaultType) 35784 35785 if (config.sanitize) { 35786 config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn) 35787 } 35788 35789 return config 35790 } 35791 35792 _getDelegateConfig() { 35793 const config = {} 35794 35795 for (const key in this._config) { 35796 if (this.constructor.Default[key] !== this._config[key]) { 35797 config[key] = this._config[key] 35798 } 35799 } 35800 35801 // In the future can be replaced with: 35802 // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) 35803 // `Object.fromEntries(keysWithDifferentValues)` 35804 return config 35805 } 35806 35807 _cleanTipClass() { 35808 const tip = this.getTipElement() 35809 const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g') 35810 const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex) 35811 if (tabClass !== null && tabClass.length > 0) { 35812 tabClass.map(token => token.trim()) 35813 .forEach(tClass => tip.classList.remove(tClass)) 35814 } 35815 } 35816 35817 _getBasicClassPrefix() { 35818 return CLASS_PREFIX 35819 } 35820 35821 _handlePopperPlacementChange(popperData) { 35822 const { state } = popperData 35823 35824 if (!state) { 35825 return 35826 } 35827 35828 this.tip = state.elements.popper 35829 this._cleanTipClass() 35830 this._addAttachmentClass(this._getAttachment(state.placement)) 35831 } 35832 35833 _disposePopper() { 35834 if (this._popper) { 35835 this._popper.destroy() 35836 this._popper = null 35837 } 35838 } 35839 35840 // Static 35841 35842 static jQueryInterface(config) { 35843 return this.each(function () { 35844 const data = Tooltip.getOrCreateInstance(this, config) 35845 35846 if (typeof config === 'string') { 35847 if (typeof data[config] === 'undefined') { 35848 throw new TypeError(`No method named "${config}"`) 35849 } 35850 35851 data[config]() 35852 } 35853 }) 35854 } 35855} 35856 35857/** 35858 * ------------------------------------------------------------------------ 35859 * jQuery 35860 * ------------------------------------------------------------------------ 35861 * add .Tooltip to jQuery only if jQuery is present 35862 */ 35863 35864defineJQueryPlugin(Tooltip) 35865 35866/* harmony default export */ var src_tooltip = (Tooltip); 35867 35868;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/glossary/glossary.main.js 35869 35870 35871 35872external_$_default().when((external_$_default()).ready).then(() => { 35873 const $assets = external_$_default()('.dpnglossary'); 35874 if(!$assets.length) { 35875 return; 35876 } 35877 console.log('glossary initialised on load'); 35878 35879 const tooltips = document.querySelectorAll('.dpnglossary.link'); 35880 tooltips.forEach(tt => { 35881 new src_tooltip(tt); 35882 }); 35883}); 35884 35885;// CONCATENATED MODULE: ./src/modules/components/headerSearch/headerSearch.main.js 35886//todo: toggle label 35887 35888 35889const $searchToggle = external_$_default()('.headerSearch__toggle'); 35890const $search = external_$_default()('.headerSearch'); 35891 35892function openHeaderSearch() { 35893 const mq = window.matchMedia("(max-width: 48.75em)"); 35894 35895 if (mq.matches) { 35896 external_$_default()('.main-nav-toggle--show').click(); 35897 } 35898 35899 external_$_default()('body').addClass('headerSearch-is-visible'); 35900 external_$_default()('.documentHeader .headerSearch__submit').attr('tabindex', '0'); 35901 $searchToggle.attr('aria-expanded', true); 35902 $search.attr('aria-expanded', true); 35903 $search.find('.headerSearch__q').focus(); 35904} 35905 35906function closeHeaderSearch() { 35907 external_$_default()('body').removeClass('headerSearch-is-visible'); 35908 external_$_default()('.documentHeader .headerSearch__submit').attr('tabindex', '-1'); 35909 $searchToggle.attr('aria-expanded', false); 35910 $search.attr('aria-expanded', false); 35911} 35912 35913/** 35914 * Init on DOM ready 35915 */ 35916external_$_default().when((external_$_default()).ready).then(() => { 35917 console.log('headerSearch initialised on DOMContentLoaded'); 35918 35919 if ($searchToggle.length < 1) { 35920 return; 35921 } 35922 35923 const $body = external_$_default()('body'); 35924 35925 // add a canvas to put an opacity layer over the content except the header 35926 // rather add 2 items than have complicated CSS 35927 external_$_default()('<div class="headerSearch__canvas"></div>').appendTo('.documentMain'); 35928 external_$_default()('<div class="headerSearch__canvas"></div>').appendTo('.documentFooter'); 35929 35930 // close on click elsewhere 35931 external_$_default()(window).on('click', (evt) => { 35932 if ($body.hasClass('headerSearch-is-visible') && external_$_default()(evt.target).parents('.headerSearch').length < 1) { 35933 $body.removeClass('headerSearch-is-visible'); 35934 } 35935 }); 35936 35937 $searchToggle.click(function () { 35938 if ($searchToggle.attr('aria-expanded') === 'false') { 35939 openHeaderSearch(); 35940 } else { 35941 closeHeaderSearch(); 35942 } 35943 }); 35944 35945 // close on ESC 35946 $body.on('keydown', function (evt) { 35947 if (evt.keyCode === 27 && $body.hasClass('headerSearch-is-visible')) { 35948 closeHeaderSearch(); 35949 $searchToggle.focus(); 35950 } 35951 }); 35952 35953 external_$_default()(window).on('focusin', (e) => { 35954 if (external_$_default()(e.target).parents('.headerSearch').length < 1 && $search.attr('aria-expanded', true)) { 35955 closeHeaderSearch(); 35956 } 35957 }); 35958}); 35959 35960;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/infoBox/infobox.main.js 35961 35962 35963external_$_default().when((external_$_default()).ready).then(() => { 35964 console.log('hello im infobox'); 35965 let $this; 35966 35967 /** 35968 * Create Context for different behaviour of Textmedia Elements with, without or only infoboxes 35969 */ 35970 external_$_default()('.infoBox').each((e, el) => { 35971 $this = external_$_default()(el); 35972 $this.siblings('figure').addClass('figure--infoBox'); 35973 35974 console.log($this.parent().siblings().length, $this.siblings().length); 35975 if ($this.parent().siblings().length < 1) { 35976 $this.parents('.co').addClass('coInfobox'); 35977 } 35978 }); 35979}); 35980 35981;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/megaNav/megaNav.main.js 35982 35983 35984function positionSecondLevel() { 35985 const $docHeader = external_$_default()('.documentHeader__container'); 35986 35987 if ($docHeader.length < 1) { 35988 return; 35989 } 35990 35991 const menuBottom = $docHeader[0].getBoundingClientRect().top; 35992 35993 external_$_default()('.megaNav .secondLevel').css('transform', 'translateY(' + menuBottom + 'px)'); 35994} 35995 35996/** 35997 * Init on DOM ready 35998 */ 35999function megaNav_main_init(selector = '.megaNav .firstLevel') { 36000 console.log('megaNav initialised on DOMContentLoaded'); 36001 external_$_default()(selector).accessibleMegaMenu({ 36002 openOnMouseover: true, 36003 }); 36004 external_$_default()(selector).removeAttr('role'); //set by aMM but not needed 36005 // $('.documentHeader__offscreen').css('display', 'none'); 36006 36007 // hack so that the megamenu doesn't show flash of css animation after the page loads. 36008 setTimeout(function () { 36009 external_$_default()('body').removeClass('init'); 36010 }, 500); 36011 36012 positionSecondLevel(); 36013 36014 external_$_default()(window).on('scroll resize', function () { 36015 positionSecondLevel(); 36016 }); 36017} 36018 36019external_$_default().when((external_$_default()).ready).then(() => { 36020 console.log('megaNav initialised on DOMContentLoaded'); 36021 36022 // init modes 36023 megaNav_main_init('.megaNav .firstLevel'); 36024}); 36025 36026;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/scrollbar.
36026js 36027/** 36028 * -------------------------------------------------------------------------- 36029 * Bootstrap (v5.1.3): util/scrollBar.js 36030 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 36031 * -------------------------------------------------------------------------- 36032 */ 36033 36034 36035 36036 36037 36038const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top' 36039const SELECTOR_STICKY_CONTENT = '.sticky-top' 36040 36041class ScrollBarHelper { 36042 constructor() { 36043 this._element = document.body 36044 } 36045 36046 getWidth() { 36047 // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes 36048 const documentWidth = document.documentElement.clientWidth 36049 return Math.abs(window.innerWidth - documentWidth) 36050 } 36051 36052 hide() { 36053 const width = this.getWidth() 36054 this._disableOverFlow() 36055 // give padding to element to balance the hidden scrollbar width 36056 this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width) 36057 // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth 36058 this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width) 36059 this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width) 36060 } 36061 36062 _disableOverFlow() { 36063 this._saveInitialAttribute(this._element, 'overflow') 36064 this._element.style.overflow = 'hidden' 36065 } 36066 36067 _setElementAttributes(selector, styleProp, callback) { 36068 const scrollbarWidth = this.getWidth() 36069 const manipulationCallBack = element => { 36070 if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { 36071 return 36072 } 36073 36074 this._saveInitialAttribute(element, styleProp) 36075 const calculatedValue = window.getComputedStyle(element)[styleProp] 36076 element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px` 36077 } 36078 36079 this._applyManipulationCallback(selector, manipulationCallBack) 36080 } 36081 36082 reset() { 36083 this._resetElementAttributes(this._element, 'overflow') 36084 this._resetElementAttributes(this._element, 'paddingRight') 36085 this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight') 36086 this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight') 36087 } 36088 36089 _saveInitialAttribute(element, styleProp) { 36090 const actualValue = element.style[styleProp] 36091 if (actualValue) { 36092 manipulator.setDataAttribute(element, styleProp, actualValue) 36093 } 36094 } 36095 36096 _resetElementAttributes(selector, styleProp) { 36097 const manipulationCallBack = element => { 36098 const value = manipulator.getDataAttribute(element, styleProp) 36099 if (typeof value === 'undefined') { 36100 element.style.removeProperty(styleProp) 36101 } else { 36102 manipulator.removeDataAttribute(element, styleProp) 36103 element.style[styleProp] = value 36104 } 36105 } 36106 36107 this._applyManipulationCallback(selector, manipulationCallBack) 36108 } 36109 36110 _applyManipulationCallback(selector, callBack) { 36111 if (isElement(selector)) { 36112 callBack(selector) 36113 } else { 36114 selector_engine.find(selector, this._element).forEach(callBack) 36115 } 36116 } 36117 36118 isOverflowing() { 36119 return this.getWidth() > 0 36120 } 36121} 36122 36123/* harmony default export */ var scrollbar = (ScrollBarHelper); 36124 36125;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/backdrop.js 36126/** 36127 * -------------------------------------------------------------------------- 36128 * Bootstrap (v5.1.3): util/backdrop.js 36129 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 36130 * -------------------------------------------------------------------------- 36131 */ 36132 36133 36134 36135 36136const backdrop_Default = { 36137 className: 'modal-backdrop', 36138 isVisible: true, // if false, we use the backdrop helper without adding any element to the dom 36139 isAnimated: false, 36140 rootElement: 'body', // give the choice to place backdrop under different elements 36141 clickCallback: null 36142} 36143 36144const backdrop_DefaultType = { 36145 className: 'string', 36146 isVisible: 'boolean', 36147 isAnimated: 'boolean', 36148 rootElement: '(element|string)', 36149 clickCallback: '(function|null)' 36150} 36151const backdrop_NAME = 'backdrop' 36152const backdrop_CLASS_NAME_FADE = 'fade' 36153const backdrop_CLASS_NAME_SHOW = 'show' 36154 36155const EVENT_MOUSEDOWN = `mousedown.bs.${backdrop_NAME}` 36156 36157class Backdrop { 36158 constructor(config) { 36159 this._config = this._getConfig(config) 36160 this._isAppended = false 36161 this._element = null 36162 } 36163 36164 show(callback) { 36165 if (!this._config.isVisible) { 36166 execute(callback) 36167 return 36168 } 36169 36170 this._append() 36171 36172 if (this._config.isAnimated) { 36173 reflow(this._getElement()) 36174 } 36175 36176 this._getElement().classList.add(backdrop_CLASS_NAME_SHOW) 36177 36178 this._emulateAnimation(() => { 36179 execute(callback) 36180 }) 36181 } 36182 36183 hide(callback) { 36184 if (!this._config.isVisible) { 36185 execute(callback) 36186 return 36187 } 36188 36189 this._getElement().classList.remove(backdrop_CLASS_NAME_SHOW) 36190 36191 this._emulateAnimation(() => { 36192 this.dispose() 36193 execute(callback) 36194 }) 36195 } 36196 36197 // Private 36198 36199 _getElement() { 36200 if (!this._element) { 36201 const backdrop = document.createElement('div') 36202 backdrop.className = this._config.className 36203 if (this._config.isAnimated) { 36204 backdrop.classList.add(backdrop_CLASS_NAME_FADE) 36205 } 36206 36207 this._element = backdrop 36208 } 36209 36210 return this._element 36211 } 36212 36213 _getConfig(config) { 36214 config = { 36215 ...backdrop_Default, 36216 ...(typeof config === 'object' ? config : {}) 36217 } 36218 36219 // use getElement() with the default "body" to get a fresh Element on each instantiation 36220 config.rootElement = getElement(config.rootElement)
36221 typeCheckConfig(backdrop_NAME, config, backdrop_DefaultType) 36222 return config 36223 } 36224 36225 _append() { 36226 if (this._isAppended) { 36227 return 36228 } 36229 36230 this._config.rootElement.append(this._getElement()) 36231 36232 event_handler.on(this._getElement(), EVENT_MOUSEDOWN, () => { 36233 execute(this._config.clickCallback) 36234 }) 36235 36236 this._isAppended = true 36237 } 36238 36239 dispose() { 36240 if (!this._isAppended) { 36241 return 36242 } 36243 36244 event_handler.off(this._element, EVENT_MOUSEDOWN) 36245 36246 this._element.remove() 36247 this._isAppended = false 36248 } 36249 36250 _emulateAnimation(callback) { 36251 executeAfterTransition(callback, this._getElement(), this._config.isAnimated) 36252 } 36253} 36254 36255/* harmony default export */ var backdrop = (Backdrop); 36256 36257;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/focustrap.js 36258/** 36259 * -------------------------------------------------------------------------- 36260 * Bootstrap (v5.1.3): util/focustrap.js 36261 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 36262 * -------------------------------------------------------------------------- 36263 */ 36264 36265 36266 36267 36268 36269const focustrap_Default = { 36270 trapElement: null, // The element to trap focus inside of 36271 autofocus: true 36272} 36273 36274const focustrap_DefaultType = { 36275 trapElement: 'element', 36276 autofocus: 'boolean' 36277} 36278 36279const focustrap_NAME = 'focustrap' 36280const focustrap_DATA_KEY = 'bs.focustrap' 36281const focustrap_EVENT_KEY = `.${focustrap_DATA_KEY}` 36282const EVENT_FOCUSIN = `focusin${focustrap_EVENT_KEY}` 36283const EVENT_KEYDOWN_TAB = `keydown.tab${focustrap_EVENT_KEY}` 36284 36285const TAB_KEY = 'Tab' 36286const TAB_NAV_FORWARD = 'forward' 36287const TAB_NAV_BACKWARD = 'backward' 36288 36289class FocusTrap { 36290 constructor(config) { 36291 this._config = this._getConfig(config) 36292 this._isActive = false 36293 this._lastTabNavDirection = null 36294 } 36295 36296 activate() { 36297 const { trapElement, autofocus } = this._config 36298 36299 if (this._isActive) { 36300 return 36301 } 36302 36303 if (autofocus) { 36304 trapElement.focus() 36305 } 36306 36307 event_handler.off(document, focustrap_EVENT_KEY) // guard against infinite focus loop 36308 event_handler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event)) 36309 event_handler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)) 36310 36311 this._isActive = true 36312 } 36313 36314 deactivate() { 36315 if (!this._isActive) { 36316 return 36317 } 36318 36319 this._isActive = false 36320 event_handler.off(document, focustrap_EVENT_KEY) 36321 } 36322 36323 // Private 36324 36325 _handleFocusin(event) { 36326 const { target } = event 36327 const { trapElement } = this._config 36328 36329 if (target === document || target === trapElement || trapElement.contains(target)) { 36330 return 36331 } 36332 36333 const elements = selector_engine.focusableChildren(trapElement) 36334 36335 if (elements.length === 0) { 36336 trapElement.focus() 36337 } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { 36338 elements[elements.length - 1].focus() 36339 } else { 36340 elements[0].focus() 36341 } 36342 } 36343 36344 _handleKeydown(event) { 36345 if (event.key !== TAB_KEY) { 36346 return 36347 } 36348 36349 this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD 36350 } 36351 36352 _getConfig(config) { 36353 config = { 36354 ...focustrap_Default, 36355 ...(typeof config === 'object' ? config : {}) 36356 } 36357 typeCheckConfig(focustrap_NAME, config, focustrap_DefaultType) 36358 return config 36359 } 36360} 36361 36362/* harmony default export */ var focustrap = (FocusTrap); 36363 36364;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/util/component-functions.js 36365/** 36366 * -------------------------------------------------------------------------- 36367 * Bootstrap (v5.1.3): util/component-functions.js 36368 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 36369 * -------------------------------------------------------------------------- 36370 */ 36371 36372 36373 36374 36375const enableDismissTrigger = (component, method = 'hide') => { 36376 const clickEvent = `click.dismiss${component.EVENT_KEY}` 36377 const name = component.NAME 36378 36379 event_handler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { 36380 if (['A', 'AREA'].includes(this.tagName)) { 36381 event.preventDefault() 36382 } 36383 36384 if (isDisabled(this)) { 36385 return 36386 } 36387 36388 const target = getElementFromSelector(this) || this.closest(`.${name}`) 36389 const instance = component.getOrCreateInstance(target) 36390 36391 // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method 36392 instance[method]() 36393 }) 36394} 36395 36396 36397 36398;// CONCATENATED MODULE: ./node_modules/bootstrap/js/src/offcanvas.js 36399/** 36400 * -------------------------------------------------------------------------- 36401 * Bootstrap (v5.1.3): offcanvas.js 36402 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 36403 * -------------------------------------------------------------------------- 36404 */ 36405 36406 36407 36408 36409 36410 36411 36412 36413 36414 36415 36416/** 36417 * ------------------------------------------------------------------------ 36418 * Constants 36419 * ------------------------------------------------------------------------ 36420 */ 36421
36422const offcanvas_NAME = 'offcanvas' 36423const offcanvas_DATA_KEY = 'bs.offcanvas' 36424const offcanvas_EVENT_KEY = `.${offcanvas_DATA_KEY}` 36425const offcanvas_DATA_API_KEY = '.data-api' 36426const EVENT_LOAD_DATA_API = `load${offcanvas_EVENT_KEY}${offcanvas_DATA_API_KEY}` 36427const ESCAPE_KEY = 'Escape' 36428 36429const offcanvas_Default = { 36430 backdrop: true, 36431 keyboard: true, 36432 scroll: false 36433} 36434 36435const offcanvas_DefaultType = { 36436 backdrop: 'boolean', 36437 keyboard: 'boolean', 36438 scroll: 'boolean' 36439} 36440 36441const offcanvas_CLASS_NAME_SHOW = 'show' 36442const CLASS_NAME_BACKDROP = 'offcanvas-backdrop' 36443const OPEN_SELECTOR = '.offcanvas.show' 36444 36445const offcanvas_EVENT_SHOW = `show${offcanvas_EVENT_KEY}` 36446const offcanvas_EVENT_SHOWN = `shown${offcanvas_EVENT_KEY}` 36447const offcanvas_EVENT_HIDE = `hide${offcanvas_EVENT_KEY}` 36448const offcanvas_EVENT_HIDDEN = `hidden${offcanvas_EVENT_KEY}` 36449const offcanvas_EVENT_CLICK_DATA_API = `click${offcanvas_EVENT_KEY}${offcanvas_DATA_API_KEY}` 36450const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${offcanvas_EVENT_KEY}` 36451 36452const offcanvas_SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]' 36453 36454/** 36455 * ------------------------------------------------------------------------ 36456 * Class Definition 36457 * ------------------------------------------------------------------------ 36458 */ 36459 36460class Offcanvas extends base_component { 36461 constructor(element, config) { 36462 super(element) 36463 36464 this._config = this._getConfig(config) 36465 this._isShown = false 36466 this._backdrop = this._initializeBackDrop() 36467 this._focustrap = this._initializeFocusTrap() 36468 this._addEventListeners() 36469 } 36470 36471 // Getters 36472 36473 static get NAME() { 36474 return offcanvas_NAME 36475 } 36476 36477 static get Default() { 36478 return offcanvas_Default 36479 } 36480 36481 // Public 36482 36483 toggle(relatedTarget) { 36484 return this._isShown ? this.hide() : this.show(relatedTarget) 36485 } 36486 36487 show(relatedTarget) { 36488 if (this._isShown) { 36489 return 36490 } 36491 36492 const showEvent = event_handler.trigger(this._element, offcanvas_EVENT_SHOW, { relatedTarget }) 36493 36494 if (showEvent.defaultPrevented) { 36495 return 36496 } 36497 36498 this._isShown = true 36499 this._element.style.visibility = 'visible' 36500 36501 this._backdrop.show() 36502 36503 if (!this._config.scroll) { 36504 new scrollbar().hide() 36505 } 36506 36507 this._element.removeAttribute('aria-hidden') 36508 this._element.setAttribute('aria-modal', true) 36509 this._element.setAttribute('role', 'dialog') 36510 this._element.classList.add(offcanvas_CLASS_NAME_SHOW) 36511 36512 const completeCallBack = () => { 36513 if (!this._config.scroll) { 36514 this._focustrap.activate() 36515 } 36516 36517 event_handler.trigger(this._element, offcanvas_EVENT_SHOWN, { relatedTarget }) 36518 } 36519 36520 this._queueCallback(completeCallBack, this._element, true) 36521 } 36522 36523 hide() { 36524 if (!this._isShown) { 36525 return 36526 } 36527 36528 const hideEvent = event_handler.trigger(this._element, offcanvas_EVENT_HIDE) 36529 36530 if (hideEvent.defaultPrevented) { 36531 return 36532 } 36533 36534 this._focustrap.deactivate() 36535 this._element.blur() 36536 this._isShown = false 36537 this._element.classList.remove(offcanvas_CLASS_NAME_SHOW) 36538 this._backdrop.hide() 36539 36540 const completeCallback = () => { 36541 this._element.setAttribute('aria-hidden', true) 36542 this._element.removeAttribute('aria-modal') 36543 this._element.removeAttribute('role') 36544 this._element.style.visibility = 'hidden' 36545 36546 if (!this._config.scroll) { 36547 new scrollbar().reset() 36548 } 36549 36550 event_handler.trigger(this._element, offcanvas_EVENT_HIDDEN) 36551 } 36552 36553 this._queueCallback(completeCallback, this._element, true) 36554 } 36555 36556 dispose() { 36557 this._backdrop.dispose() 36558 this._focustrap.deactivate() 36559 super.dispose() 36560 } 36561 36562 // Private 36563 36564 _getConfig(config) { 36565 config = { 36566 ...offcanvas_Default, 36567 ...manipulator.getDataAttributes(this._element), 36568 ...(typeof config === 'object' ? config : {}) 36569 } 36570 typeCheckConfig(offcanvas_NAME, config, offcanvas_DefaultType) 36571 return config 36572 } 36573 36574 _initializeBackDrop() { 36575 return new backdrop({ 36576 className: CLASS_NAME_BACKDROP, 36577 isVisible: this._config.backdrop, 36578 isAnimated: true, 36579 rootElement: this._element.parentNode, 36580 clickCallback: () => this.hide() 36581 }) 36582 } 36583 36584 _initializeFocusTrap() {
36585 return new focustrap({ 36586 trapElement: this._element 36587 }) 36588 } 36589 36590 _addEventListeners() { 36591 event_handler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { 36592 if (this._config.keyboard && event.key === ESCAPE_KEY) { 36593 this.hide() 36594 } 36595 }) 36596 } 36597 36598 // Static 36599 36600 static jQueryInterface(config) { 36601 return this.each(function () { 36602 const data = Offcanvas.getOrCreateInstance(this, config) 36603 36604 if (typeof config !== 'string') { 36605 return 36606 } 36607 36608 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 36609 throw new TypeError(`No method named "${config}"`) 36610 } 36611 36612 data[config](this) 36613 }) 36614 } 36615} 36616 36617/** 36618 * ------------------------------------------------------------------------ 36619 * Data Api implementation 36620 * ------------------------------------------------------------------------ 36621 */ 36622 36623event_handler.on(document, offcanvas_EVENT_CLICK_DATA_API, offcanvas_SELECTOR_DATA_TOGGLE, function (event) { 36624 const target = getElementFromSelector(this) 36625 36626 if (['A', 'AREA'].includes(this.tagName)) { 36627 event.preventDefault() 36628 } 36629 36630 if (isDisabled(this)) { 36631 return 36632 } 36633 36634 event_handler.one(target, offcanvas_EVENT_HIDDEN, () => { 36635 // focus on trigger when it is closed 36636 if (isVisible(this)) { 36637 this.focus() 36638 } 36639 }) 36640 36641 // avoid conflict when clicking a toggler of an offcanvas, while another is open 36642 const allReadyOpen = selector_engine.findOne(OPEN_SELECTOR) 36643 if (allReadyOpen && allReadyOpen !== target) { 36644 Offcanvas.getInstance(allReadyOpen).hide() 36645 } 36646 36647 const data = Offcanvas.getOrCreateInstance(target) 36648 data.toggle(this) 36649}) 36650 36651event_handler.on(window, EVENT_LOAD_DATA_API, () => 36652 selector_engine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()) 36653) 36654 36655enableDismissTrigger(Offcanvas) 36656/** 36657 * ------------------------------------------------------------------------ 36658 * jQuery 36659 * ------------------------------------------------------------------------ 36660 */ 36661 36662defineJQueryPlugin(Offcanvas) 36663 36664/* harmony default export */ var src_offcanvas = (Offcanvas); 36665 36666;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/js/core/config.core.js 36667// Keep in sync with breakpoints in sass/_variables.scss 36668const breakpoints = { 36669 base: 0, 36670 36671 mobile: 320, 36672 phablet: 540, 36673 36674 tablet: 740, 36675 36676 desktop: 980, 36677 mainNavigation: 980, 36678 wide: 1200, 36679 36680 slider: 1280, 36681 extraordinary: 1400 36682}; 36683 36684// Keep in sync with transitions in sass/_variables.scss 36685const speed = { 36686 instant: 5, 36687 fast: 100, 36688 normal: 300, 36689 slow: 700, 36690 sluggish: 1200 36691}; 36692 36693// todo @skm: ist this the right place for this? copied from gf-023... 36694if ("ontouchstart" in document.documentElement) { 36695 var root = document.getElementsByTagName( 'html' )[0]; // '0' to assign the first (and only `HTML` tag) 36696 root.className += ' touch-device'; 36697} 36698 36699window.addEventListener('beforeprint', () => { 36700 window.scrollTo(0, 0); 36701}); 36702 36703;// CONCATENATED MODULE: ./src/modules/components/offcanvas/offcanvas.main.js 36704 36705 36706 36707function offcanvas_main_init(id = 'offcanvas') { 36708 const offcanvas = new src_offcanvas(document.getElementById(id)) 36709 36710 window.addEventListener('resize', function() { 36711 if (window.innerWidth > breakpoints.mainNavigation) { 36712 offcanvas.hide() 36713 } 36714 }); 36715} 36716 36717document.addEventListener('DOMContentLoaded', function () { 36718 offcanvas_main_init(); 36719}); 36720 36721;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/printButton/printButton.main.js 36722/** 36723 * Trigger print 36724 */ 36725 36726 36727 36728/** 36729 * module initialisation 36730 */ 36731external_$_default().when((external_$_default()).ready).then(() => { 36732 external_$_default()('.printButton').on('click', function (evt) { 36733 evt.preventDefault(); 36734 36735 window.print(); 36736 }); 36737}); 36738 36739;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/skiplinks/skiplinks.main.js 36740 36741 36742// Init on DOM ready 36743external_$_default().when((external_$_default()).ready).then(() => { 36744 console.log('skiplinks initialised on DOMContentLoaded'); 36745 36746 const $skiplinksContainer = external_$_default()('.skiplinks'); 36747 const $skiplinks = $skiplinksContainer.find('a'); 36748 36749 $skiplinks.on('focus', function() { 36750 $skiplinksContainer.addClass('is-focussed'); 36751 }); 36752 36753 $skiplinks.on('blur', function() { 36754 $skiplinksContainer.removeClass('is-focussed'); 36755 }); 36756}); 36757 36758;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/toggle/toggle.main.js 36759 36760 36761function getTarget($toggle) { 36762 let $target; 36763 const mode = $toggle.data('mode'); 36764 const target = $toggle.data('target') || 'body'; 36765 36766 if (mode === 'siblings') { 36767 $target = $toggle.siblings(target); 36768 } else if (mode === 'closest') { 36769 $target = $toggle.closest(target); 36770 } else { 36771 $target = external_$_default()(target); 36772 } 36773 36774 return $target; 36775} 36776 36777/** 36778 * build toggle 36779 * @param el 36780 */ 36781function prepare(el) { 36782 /* jshint maxcomplexity: false */ 36783 const $toggle = external_$_default()(el); 36784 let $label = $toggle.find('.m-toggle__label'); 36785 const $target = getTarget($toggle); 36786 const ariaTarget = $toggle.data('aria-target') || false; 36787 const $ariaTarget = ariaTarget ? external_$_default()(ariaTarget) : false;
36788 const mode = $toggle.data('mode') || false; 36789 const accordion = $toggle.closest('.coAccordion .co__main').data('accordion') || false; // accordion functionality 36790 const firstOpen = $toggle.closest('.coAccordion .co__main').data('first-open') || false; // accordion functionality 36791 const closeOnClickOutside = $toggle.data('close-on-click-outside') || false; 36792 const expanded = $toggle.data('expanded') || false; // initially opens Expand 36793 const switchClassname = $toggle.data('switch-classname') || 'm-toggle--active'; 36794 const switchLabel = $toggle.data('switch-label') ? $toggle.data('switch-label') || $toggle.text() : false; 36795 const toggleOnce = $toggle.data('toggle-once') || false; 36796 const focus = $toggle.data('focus') || false; // defines element that should be focussed - used in header search 36797 36798 // wrap toggle text if not already happened 36799 if ($label.length < 1) { 36800 $label = $toggle.wrapInner('<span class="m-toggle__label"></span>'); 36801 } 36802 36803 // store current label 36804 if (switchLabel) { 36805 $toggle.data('default-label', $toggle.text()); 36806 } 36807 36808 // set aria attribute 36809 if ($ariaTarget) { 36810 $ariaTarget.attr('aria-expanded', 'false'); 36811 } 36812 36813 // set tabindex 36814 // could be a bit better maybe... 36815 // see: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus 36816 $target.find('.expand__main').find('a[href], button, input, select, textarea').attr('tabindex', '-1'); 36817 36818 // close toggle when clicked outside 36819 if (closeOnClickOutside) { 36820 external_$_default()(document).on('click', (evt) => { 36821 if (external_$_default()(evt.target).is($toggle) === false && $toggle.hasClass(switchClassname)) { 36822 $toggle.trigger('click'); 36823 } 36824 }); 36825 } 36826 36827 /* jshint maxcomplexity: false */ 36828 const doToggle = function (evt) { 36829 evt.preventDefault(); 36830 evt.stopPropagation(); 36831 36832 console.log('toggle.js triggered'); 36833 36834 let state; 36835 const isToggled = $target.data('is-toggled') || false; 36836 36837 if (toggleOnce && isToggled) { 36838 $toggle.off('click', doToggle); 36839 36840 return; 36841 } 36842 36843 if ($target.hasClass(switchClassname)) { 36844 $target.removeClass(switchClassname); 36845 $toggle.removeClass(switchClassname); 36846 36847 if (switchLabel) { 36848 $label.text($toggle.data('default-label')); 36849 } 36850 36851 state = false; 36852 } else { 36853 if (accordion === true) { 36854 $toggle 36855 .closest('.coAccordion .co__main') 36856 .find('.expand--expanded .m-toggle') 36857 .not($toggle) 36858 .click(); 36859 } else if ((mode !== 'siblings') && (mode !== 'closest')) { 36860 $toggle.siblings().removeClass(switchClassname); 36861 $target.siblings().removeClass(switchClassname); 36862 $toggle.parent().parent().find('.' + switchClassname).removeClass(switchClassname); 36863 } 36864 36865 if (switchLabel) { 36866 $label.text(switchLabel); 36867 } 36868 36869 $target.addClass(switchClassname); 36870 $toggle.addClass(switchClassname); 36871 36872 state = true; 36873 } 36874 36875 $target.data('is-toggled', true).data('toggle-state', state); 36876 36877 // set aria attribute 36878 if ($ariaTarget) { 36879 $ariaTarget.attr('aria-expanded', state); 36880 } 36881 36882 // focus on element defined in data focus 36883 if (focus !== false) { 36884 setTimeout(() => { 36885 external_$_default()(focus).focus(); 36886 }, 500); 36887 } 36888 }; 36889 36890 $toggle.on('click', doToggle); 36891 36892 // mark toggle as initialised 36893 $toggle.addClass('m-toggle--initialised'); 36894 $toggle.trigger('mToggleInitialised'); 36895 36896 // only for cco--accordion 36897 if (expanded) { 36898 $toggle.trigger('click'); 36899 } 36900 36901 //open first expand if firstOpen is set 36902 if (firstOpen && $toggle.parent().is(':first-child')) { 36903 $toggle.trigger('click'); 36904 } 36905} 36906 36907/** 36908 * module initialisation 36909 */ 36910external_$_default().when((external_$_default()).ready).then(() => { 36911 console.log('toggle initialised on DOMContentLoaded'); 36912 36913 // prevent double-initialisation when combined with solrSearch.solr.js 36914 const $toggle = external_$_default()('.m-toggle:not(.m-toggle--initialised)'); 36915 36916 $toggle.each(function () { 36917 prepare(this); 36918 }); 36919}); 36920 36921;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/tooltip/tooltip.settings.main.js 36922const options = { 36923 selector: '[data-bs-toggle="tooltip"]', 36924 attrConsentType: 'data-bs-cookie-consent-type', 36925 attrCookieDependency: 'data-bs-cookie-dependency' 36926} 36927;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/components/tooltip/tooltip.main.js 36928/* provided dependency */ var $ = __webpack_require__(3336); 36929 36930 36931 36932function updateTooltip(cookieman, tooltip) { 36933 tooltip.enable(); 36934 36935 const cookieConsentType = 36936 tooltip._element.getAttribute(options.attrConsentType); 36937 36938 const cookieDependency = 36939 tooltip._element.getAttribute(options.attrCookieDependency) ? 36940 tooltip._element.getAttribute(options.attrCookieDependency) : 'if'; 36941 36942 if (!cookieman.hasConsented(cookieConsentType) && cookieDependency === 'if') { 36943 tooltip.disable(); 36944 } 36945 36946 if (cookieman.hasConsented(cookieConsentType) && cookieDependency === 'else') { 36947 tooltip.disable(); 36948 } 36949} 36950 36951function initTooltip(tt) { 36952 const tooltip = new src_tooltip(tt); 36953 const cookieman = window.cookieman ? window.cookieman : null; 36954 const cookieConsentType = tooltip._element.getAttribute(options.attrConsentType); 36955 36956 if (!cookieman || !cookieConsentType) { 36957 return; 36958 } 36959 36960 updateTooltip(cookieman, tooltip); 36961
36962 $(document).on('cookieman-updated', () => { 36963 updateTooltip(cookieman, tooltip); 36964 }); 36965} 36966 36967function tooltip_main_init(selector = options.selector) { 36968 const tooltips = document.querySelectorAll(selector); 36969 36970 if (tooltips.length < 1) { 36971 return; 36972 } 36973 36974 tooltips.forEach(initTooltip); 36975} 36976 36977document.addEventListener('DOMContentLoaded', function () { 36978 tooltip_main_init(); 36979}); 36980 36981;// CONCATENATED MODULE: ./src/modules/contentObjects/coTextmedia/coTextmedia.main.js 36982 36983 36984 36985function checkLines($el) { 36986 let height = $el.height(); 36987 let lineheight = parseInt($el.css('line-height')); 36988 36989 return (height > lineheight); 36990} 36991 36992function alignToNumber($el) { 36993 36994 const $sibling = $el.find('+ *'); 36995 36996 let y1 = $el[0].getBoundingClientRect().bottom; 36997 let y2 = $sibling[0].getBoundingClientRect().bottom; 36998 36999 37000 $sibling.css('transform', 'translateY(' + (y1 - y2) + 'px)'); 37001} 37002 37003function setMarginForBeside() { 37004 // only do this from tablet up 37005 if (external_$_default()(window).width() > breakpoints.phablet) { 37006 external_$_default()('.coTextmedia.co--beside').each(function () { 37007 const $co = external_$_default()(this); 37008 const $mediaContainer = $co.find('.mediaContainer'); 37009 const $rteContent = $co.find('.co__rteContent'); 37010 const alignment = $mediaContainer.hasClass('mediaContainer--left') ? 'left' : 'right'; 37011 const mediaWidth = $mediaContainer.outerWidth(); 37012 $rteContent.css('margin-' + alignment, mediaWidth); 37013 }); 37014 } else { 37015 external_$_default()('.coTextmedia.co--beside').each(function () { 37016 const $co = external_$_default()(this); 37017 const $rteContent = $co.find('.co__rteContent'); 37018 $rteContent.css({ 37019 'margin-left': '', 37020 'margin-right': '' 37021 }); 37022 }); 37023 } 37024} 37025 37026external_$_default().when((external_$_default()).ready).then(() => { 37027 external_$_default()('.coTextmedia p').filter(function () { 37028 return !external_$_default().trim(external_$_default()(this).text()); 37029 }).remove(); 37030 37031 /** 37032 * [#27812], [#28443] CO »Herausgestellte Zahl 37033 */ 37034 const $floatedNumber = external_$_default()('.number-floated'); 37035 37036 $floatedNumber.each(function () { 37037 const $this = external_$_default()(this); 37038 37039 /** 37040 * if sibling of floated number is a oneliner, align to baseline of number 37041 */ 37042 if (!checkLines($this.find('+ *'))) { 37043 alignToNumber($this); 37044 } 37045 }); 37046 37047 // todo: maybe there is a pure CSS solution but could not find anything 37048 // problem is that the image size/width can be adjusted in the BE 37049 if (external_$_default()('.coTextmedia.co--beside').length > 0) { 37050 setMarginForBeside(); 37051 37052 // update the slider options on resize 37053 var resizeTimer = null; 37054 37055 external_$_default()(window).on('resize', function () { 37056 clearTimeout(resizeTimer); 37057 resizeTimer = setTimeout(setMarginForBeside(), 50); 37058 }); 37059 } 37060}); 37061 37062;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/js/core/supports.core.js 37063function supports_core_passive() { 37064 let supports = false; 37065 37066 try { 37067 const opts = Object.defineProperty({}, 'passive', { 37068 get: function() { 37069 supports = true; 37070 } 37071 }); 37072 37073 window.addEventListener("test", null, opts); 37074 } catch (e) {} 37075 37076 return supports; 37077} 37078 37079;// CONCATENATED MODULE: ./src/modules/document/documentHeader/fixedHeader.settings.js 37080const fixedHeader_settings_options = { 37081 // On-Off Switch 37082 active: true, 37083 // <string>, element selector -> element that is being fixed 37084 element: '.documentHeader', 37085 // <string>, element selector 37086 switchOnElement: 'body', 37087 // <string>, switch classname 37088 switchClassname: 'is-fixed', 37089 // <string>, set scroll offset -> offset is calculated 37090 offsetElement: '.documentHeader', 37091 // <string>, element to receive padding to make sure we do not get any jumping of content 37092 paddingElement: 'body', 37093 // <bool> set to true, if documentHeader is basically fixed 37094 paddingInstant: false, 37095 // the sticky handler 37096 priority: 1, 37097}; 37098 37099;// CONCATENATED MODULE: ./src/modules/document/documentHeader/fixedHeader.main.js 37100 37101 37102 37103 37104function getPosition(selector) { 37105 let $element = external_$_default()(selector); 37106 let element = $element[0]; 37107 let xPosition = 0; 37108 let yPosition = 0; 37109 37110 // bail if element is hidden with CSS 37111 if ($element.css('display') === 'none') { 37112 return {x: false, y: false}; 37113 } 37114 37115 while (element) { 37116 xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft); 37117 yPosition += (element.offsetTop - element.scrollTop + element.clientTop); 37118 element = element.offsetParent; 37119 } 37120 37121 return {x: xPosition, y: yPosition}; 37122} 37123 37124 37125external_$_default().when((external_$_default()).ready).then(() => { 37126 console.log('fixedHeader initialised on DOMContentLoaded'); 37127 37128 if (!fixedHeader_settings_options.active) { 37129 return; 37130 } 37131 37132 const $window = external_$_default()(window); 37133 const $el = external_$_default()(fixedHeader_settings_options.element); 37134 37135 if ($el.length < 1) { 37136 return; 37137 } 37138 37139 const elClass = external_$_default()(fixedHeader_settings_options.element).attr('class').split(' ')[0]; 37140 const $elSwitch = external_$_default()(fixedHeader_settings_options.switchOnElement); 37141 const $paddingElement = external_$_default()(fixedHeader_settings_options.paddingElement); 37142 37143 if (!$el || !$elSwitch) { 37144 return; 37145 } 37146 37147 let attached = false;
37148 let offset = getPosition(fixedHeader_settings_options.offsetElement).y || $el.outerHeight(); 37149 let headerHeight = $el.outerHeight(); 37150 37151 const attachhandler = () => { 37152 $elSwitch.addClass(elClass + '-' + fixedHeader_settings_options.switchClassname); 37153 $el.addClass(fixedHeader_settings_options.switchClassname); 37154 headerHeight = $el.outerHeight(); // get headerHeight in case it changed 37155 $paddingElement.css('padding-top', parseInt(headerHeight, 10)); 37156 37157 // dispatch to sticky handler 37158 $window.trigger('sticky', { 37159 $el: $el, 37160 priority: fixedHeader_settings_options.priority, 37161 status: 'stuck' 37162 } 37163 ); 37164 }; 37165 37166 const detachhandler = () => { 37167 $elSwitch.removeClass(elClass + '-' + fixedHeader_settings_options.switchClassname); 37168 $el.removeClass(fixedHeader_settings_options.switchClassname); 37169 37170 if (!fixedHeader_settings_options.paddingInstant) { 37171 $paddingElement.css('padding-top', ''); 37172 } 37173 37174 // dispatch to sticky handler 37175 $window.trigger('sticky', { 37176 $el: $el, 37177 priority: fixedHeader_settings_options.priority, 37178 status: 'unstuck' 37179 } 37180 ); 37181 }; 37182 37183 const resizeUpdate = () => { 37184 if (attached) { 37185 $el.removeClass(fixedHeader_settings_options.switchClassname); 37186 } 37187 37188 offset = getPosition(fixedHeader_settings_options.offsetElement).y || $el.outerHeight(); 37189 headerHeight = $el.outerHeight(); 37190 37191 if (attached) { 37192 $el.addClass(fixedHeader_settings_options.switchClassname); 37193 $paddingElement.css('padding-top', parseInt(headerHeight, 10)); 37194 } 37195 37196 external_$_default()(window).scroll(); 37197 }; 37198 37199 var lastScrollTop = 0; 37200 37201 window.addEventListener('scroll', function () { 37202 var nextScrollTop = window.pageYOffset || document.documentElement.scrollTop; 37203 37204 if (nextScrollTop > lastScrollTop) { 37205 $elSwitch.removeClass('is-topscrolling'); 37206 } else { 37207 $elSwitch.addClass('is-topscrolling'); 37208 } 37209 37210 lastScrollTop = nextScrollTop <= 0 ? 0 : nextScrollTop; 37211 37212 if (!attached && window.pageYOffset > offset) { 37213 attached = true; 37214 attachhandler(); 37215 } else if (attached && window.pageYOffset <= offset) { 37216 attached = false; 37217 detachhandler(); 37218 } 37219 }, (supports_core_passive() ? {passive: true} : false)); 37220 37221 // update the slider options on resize 37222 var resizeTimer = null; 37223 37224 external_$_default()(window).on('resize', function () { 37225 clearTimeout(resizeTimer); 37226 resizeTimer = setTimeout(resizeUpdate, 20); 37227 }); 37228 37229 window.dispatchEvent(new CustomEvent('scroll')); 37230}); 37231 37232;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/elements/audio/audio.main.js 37233 37234 37235function initAudio() { 37236 const $audios = external_$_default()(this); 37237 37238 if ($audios.length < 1) { 37239 return; 37240 } 37241 37242 $audios.each((i, audio) => { 37243 const $audio = external_$_default()(audio); 37244 const $playButton = $audio.find('.audio__play-button'); 37245 const $player = $audio.find('.audio__player audio'); 37246 37247 $playButton.on('click', () => { 37248 $audio.addClass('player-is-initialised'); 37249 $player[0].play(); 37250 }); 37251 }); 37252} 37253 37254/** 37255 * Init on DOM ready 37256 */ 37257external_$_default().when((external_$_default()).ready).then(() => { 37258 // console.log('audios initialised on DOMContentLoaded'); 37259 external_$_default()('.audio').each(initAudio); 37260}); 37261 37262// EXTERNAL MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/elements/button/button.main.js 37263var button_main = __webpack_require__(1453); 37264;// CONCATENATED MODULE: ./src/modules/rteElements/sortableTable/sortableTable.main.js 37265// import { breakpoints, speed } from 'Src/core/config'; 37266 37267 37268function sortableTable_main_init() { 37269 const $table = external_$_default()(this); 37270 37271 //sortableTable currontly only works with tables with a thead at the TOP 37272 37273 // early exit if Table has no thead at the top 37274 if ($table.find('thead').length === 0) { 37275 return; 37276 } 37277 37278 37279 const $tHead = $table.find('thead').eq(0); 37280 const $tHeadRow = $tHead.find('tr').eq(0); 37281 const $tHeadRowCells = $tHeadRow.find('th, td'); 37282 37283 let _hasTHead = $tHeadRowCells.length > 1; 37284 37285 const $headerTR = _hasTHead ? $tHeadRow : $table.find('tr').eq(0); 37286 37287 const $allTableHeadCells = $headerTR.find('th, td'); 37288 37289 $table.addClass('sortable-table'); 37290 $allTableHeadCells.addClass('sortable-table__th'); 37291 37292 const $sortableRows = $table.find('tr').not($headerTR); 37293 37294 let sortableData = []; 37295 37296 $sortableRows.each(function () { 37297 const $row = external_$_default()(this); 37298 let row = [$row]; 37299 const $td = $row.find('th, td'); 37300 $td.each(function () { 37301 row.push(external_$_default()(this).text()); 37302 }); 37303 sortableData.push(row); 37304 }); 37305 37306 const stripSpaces = function (string) { 37307 const temp = String(string).split(' '); 37308 return temp.join(''); 37309 }; 37310 37311 const sortTable = function (index, direction) { 37312 console.log("sortTable: " + index + " : " + direction); 37313 37314 // index 0 is the jQuery Object, so comparable Data is starting at index 1 37315 index = index + 1; 37316 37317 const _supportsLocaleCompare = !!(String.prototype.localeCompare); 37318 37319 sortableData.sort(function (a, b) {
37320 let valueA = stripSpaces(a[index]); 37321 let valueB = stripSpaces(b[index]); 37322 37323 let _compareByString = isNaN(Number(valueA)) || isNaN(Number(valueB)); 37324 37325 if (_compareByString) { 37326 valueA = valueA.toLowerCase(); 37327 valueB = valueB.toLowerCase(); 37328 37329 if (_supportsLocaleCompare) { 37330 return valueA.localeCompare(valueB) * direction; 37331 } else { 37332 if (valueA > valueB) { 37333 return -1 * direction; 37334 } else if (valueB > valueA) { 37335 return 1 * direction; 37336 } else { 37337 return 0; 37338 } 37339 } 37340 37341 } else { 37342 valueA = Number(valueA); 37343 valueB = Number(valueB); 37344 37345 if (valueA > valueB) { 37346 return -1 * direction; 37347 } else if (valueB > valueA) { 37348 return 1 * direction; 37349 } else { 37350 return 0; 37351 } 37352 } 37353 }); 37354 37355 sortableData.map(function (e) { 37356 e[0].appendTo($table); 37357 }); 37358 37359 }; 37360 37361 $allTableHeadCells.each(function (index) { 37362 const $th = external_$_default()(this); 37363 37364 $th.data('direction', 0); 37365 37366 $th.click(function () { 37367 const $this = external_$_default()(this); 37368 let direction = Number($this.data('direction')); 37369 37370 $allTableHeadCells 37371 .data('direction', 0) 37372 .removeClass('sortable-table__th--active sortable-table__th--up sortable-table__th--down'); 37373 37374 if (direction === 0 || direction === 1) { 37375 direction = -1; 37376 } else { 37377 direction = 1; 37378 } 37379 37380 $this 37381 .data('direction', direction) 37382 .addClass('sortable-table__th--active') 37383 .addClass('sortable-table__th--' + ((direction === 1) ? "up" : "down")); 37384 37385 sortTable(index, direction); 37386 }); 37387 }); 37388 37389 return $table; 37390} 37391 37392/** 37393 * Init on DOM ready 37394 */ 37395external_$_default().when((external_$_default()).ready).then(() => { 37396 console.log('sortableTable initialised on DOMContentLoaded'); 37397 // do it only for figures 37398 const $table = external_$_default()('table.contenttable'); 37399 37400 $table.each(sortableTable_main_init); 37401 $table.wrap('<div class="contenttable__outer-wrapper">'); 37402}); 37403 37404// EXTERNAL MODULE: ./src/modules/rteElements/contentTable/contentTable.main.js 37405var contentTable_main = __webpack_require__(3506); 37406;// CONCATENATED MODULE: ./src/modules/components/teaser/stageTeaser/stageTeaser.main.js 37407 37408 37409function checkImage($img, $wrapper) { 37410 if (!$wrapper.data('imageFillsHeight') && $img.height() < $wrapper.height()) { 37411 $wrapper.addClass('js-imageFillsHeight'); 37412 $wrapper.data('imageFillsHeight', true); 37413 } 37414 37415 if ($wrapper.data('imageFillsHeight') && $img.width() < $wrapper.width()) { 37416 $wrapper.removeClass('js-imageFillsHeight'); 37417 $wrapper.data('imageFillsHeight', false); 37418 return false; 37419 } 37420} 37421 37422external_$_default().when((external_$_default()).ready).then(() => { 37423 console.log('stageTeaser initialised at DOM Ready'); 37424 37425 external_$_default()('.stageTeaser__content').each(function () { 37426 const $content = external_$_default()(this); 37427 $content.parents('.stageTeaser').addClass('js-ready'); 37428 }); 37429 37430 external_$_default()('.stageTeaser--layout-c .stageTeaser__media').each(function () { 37431 const $this = external_$_default()(this); 37432 const $img = $this.find('img'); 37433 $this.data('imageFillsHeight', false); 37434 37435 checkImage($img, $this); 37436 37437 external_$_default()(window).resize(function () { 37438 checkImage($img, $this); 37439 }); 37440 }); 37441}); 37442 37443;// CONCATENATED MODULE: ./src/modules/components/teaser/tileTeaser/tileTeaser.main.js 37444 37445 37446external_$_default().when((external_$_default()).ready).then(() => { 37447}); 37448 37449// EXTERNAL MODULE: ./src/modules/contentObjects/co-background-collapse/co-background-collapse.main.js 37450var co_background_collapse_main = __webpack_require__(1295); 37451// EXTERNAL MODULE: ./src/modules/components/contentHeader/_css/contentHeader.main.js 37452var contentHeader_main = __webpack_require__(2385); 37453// EXTERNAL MODULE: ./src/modules/components/teaser/basicTeaser/basicTeaser.main.js 37454var basicTeaser_main = __webpack_require__(690); 37455;// CONCATENATED MODULE: ../../backend/vendor/ww.t3/wwt3_frontend_prototype/src/modules/contentObjects/coMap/coMapLeaflet.main.js 37456 37457const L = __webpack_require__(5243); 37458__webpack_require__(5732); 37459 37460let map = {}; 37461let tileLayer = {}; 37462let markers = []; 37463let currentMarkers; 37464let $contentStringTemplate = null; 37465let eventType = null; 37466let $listItemTemplate = null; 37467let listContent = []; 37468let listItemsInitiated = 0; 37469let initialCoordinates = { lat: 51.165691, lng: 10.451526 }; 37470 37471function addListItems(interval = 50, $asset) { 37472 if(listItemsInitiated >= listContent.length) { 37473 return; 37474 } 37475 37476 const maxListItems = listItemsInitiated+interval > listContent.length ? 37477 listContent.length : 37478 listItemsInitiated+interval; 37479 const newListItems = listContent.slice(listItemsInitiated, maxListItems); 37480 listItemsInitiated += interval;
37481 newListItems.forEach(item => { 37482 $asset.find('.map__list ul').append(item); 37483 }) 37484} 37485 37486function createMapContent(data = [], $asset) { 37487 const id = `instance${$asset.attr('id').replace('c', '')}`; 37488 const $list = $asset.find('.map__list'); 37489 if($list.length > 0) { 37490 if(!$listItemTemplate) { 37491 $listItemTemplate = $list.find('.map__listItem').first().clone(); 37492 } 37493 $list.find('.map__listItem').remove(); 37494 listContent = []; 37495 listItemsInitiated = 0; 37496 } 37497 if($contentStringTemplate === null) { 37498 $contentStringTemplate = $asset.find('.map__infowindow').clone(); 37499 $asset.find('.map__infowindow').remove(); 37500 } 37501 37502 if(markers.length) { 37503 markers = []; 37504 } 37505 $asset.find('.map__loader').hide(); 37506 $asset.find('.map__noResults').hide(); 37507 $asset.find('.map__displayResult h3').show(); 37508 $asset.find('.map__form button[type="submit"]').prop('disabled', false); 37509 37510 if(data.length === 0) { 37511 map[id].setZoom(6); 37512 map[id].panTo(new L.LatLng(initialCoordinates.lat, initialCoordinates.lng)); 37513 //workaround in case panTo doesn't fire 37514 setTimeout(function() { 37515 map[id].panTo(new L.LatLng(initialCoordinates.lat, initialCoordinates.lng)); 37516 }, 1000); 37517 37518 $asset.find('.count').text(data.length); 37519 $asset.find('.plural').show(); 37520 37521 $asset.find('.map__noResults').fadeIn(); 37522 37523 return; 37524 } 37525 37526 // create icon 37527 let icon = L.icon({ 37528 iconUrl: $asset.find('[id^=mapMap]').data('map-pin-icon'), 37529 iconSize: [14, 22], 37530 iconAnchor: [11, 32], 37531 popupAnchor: [0, -32] 37532 }); 37533 37534 // create markerCluster 37535 let markerCluster = L.markerClusterGroup({ 37536 maxClusterRadius: 80, 37537 iconCreateFunction: function(cluster) { 37538 return L.divIcon({ 37539 html: ` 37540 <div class="clusterIcon"> 37541 <svg xmlns="http://www.w3.org/2000/svg" width="22" height="32" viewBox="0 0 24 34"> 37542 <g fill="none" fill-rule="evenodd"> 37543 <path fill="#fff" d="M10.8623901,0 C13.763601,0 16.4906543,1.16647262 37544 18.5423159,3.28189043 C22.3390934,7.19373446 22.8091774,14.5560892 19.5518637,19.0358404 37545 L19.5518637,19.0358404 L10.8623901,31.975803 L2.15946526,19.0190514 C-1.08722906,14.5560892 37546 -0.61431327,7.19373446 3.18317219,3.27897059 C5.23200196,1.16647262 7.96188711,0 37547 10.8623901,0 Z" stroke="#000" class="clusterIconPath"/> 37548 </g> 37549 </svg> 37550 <span>${cluster.getChildCount()}</span> 37551 </div> 37552 `, 37553 iconSize: [24, 32], 37554 className: 'map-divIcon' 37555 }); 37556 } 37557 }); 37558 37559 // create locations 37560 data.forEach((location) => { 37561 // create infowindow 37562 const $contentString = $contentStringTemplate.clone(); 37563 if(location.header) { 37564 $contentString.find('h3').text(location.header); 37565 } 37566 else if(location.address) { 37567 $contentString.find('h3').text(location.address); 37568 } 37569 if(location.detail.length) { 37570 $contentString.find('a').attr('href', location.detail); 37571 $contentString.find('a').attr('target', '_blank'); 37572 } 37573 else { 37574 $contentString.find('a').remove(); 37575 } 37576 37577 // const infowindow = new google.maps.InfoWindow({ 37578 // content: $contentString[0] 37579 // }); 37580 37581 // create marker 37582 let marker = L.marker(new L.LatLng(location.lat, location.lng), {icon: icon}); 37583 marker.bindPopup($contentString[0]); 37584 37585 markers.push(marker); 37586 37587 // create listItem 37588 if($list.length > 0) { 37589 const $listItem = $listItemTemplate.clone(); 37590 37591 (location.header) ? $listItem.find('button').text(location.header) : $listItem.find('button').text(location.address); 37592 (location.header) ? $listItem.find('.street').text(location.address) : $listItem.find('.street').remove(); 37593 $listItem.find('.postalCode').text(location.zip); 37594 $listItem.find('.city').text(location.city); 37595 if(location.detail.length) { 37596 $listItem.find('.link').attr('href', location.detail); 37597 $listItem.find('.link').attr('target', '_blank'); 37598 } 37599 else { 37600 $listItem.find('.link').remove(); 37601 } 37602 $listItem.find('button').on('click', function() {
37603 map[id].setView([location.lat, location.lng], 16); 37604 marker.fire('click'); 37605 if(!$listItem.hasClass('active')) { 37606 $list.find('.map__listItem.active .map__listItem-link').slideUp(); 37607 $list.find('.map__listItem.active').removeClass('active'); 37608 37609 $listItem.addClass('active'); 37610 $listItem.find('.map__listItem-link').slideDown(); 37611 } 37612 }); 37613 listContent.push($listItem); 37614 } 37615 }); 37616 // end create locations 37617 37618 // markerCluster.eachLayer(layer => { 37619 // markerCluster.removeLayer(layer); 37620 // }); 37621 markerCluster.clearLayers(); 37622 markers.forEach(marker => { 37623 markerCluster.addLayer(marker); 37624 }); 37625 37626 // add markers 37627 tileLayer[id].on('tileload, loading', function(e) { 37628 markerCluster.clearLayers(); 37629 currentMarkers = markers.filter(marker => 37630 marker instanceof L.Marker && map[id].getBounds().contains(marker.getLatLng()) 37631 ); 37632 currentMarkers.forEach(marker => { 37633 markerCluster.addLayer(marker); 37634 }); 37635 }); 37636 37637 // add listitems 37638 if($list.length > 0) { 37639 const $listUl = $list.find('ul'); 37640 $listUl.empty(); 37641 $listUl.on('scroll', function() { 37642 if( $listUl[0].scrollTop >= ($listUl[0].scrollHeight - $listUl[0].offsetHeight - 400)) { 37643 addListItems(50, $asset); 37644 } 37645 }); 37646 addListItems(50, $asset); 37647 } 37648 37649 map[id].on('zoom', function() { 37650 map[id].closePopup(); 37651 }); 37652 37653 // position map 37654 map[id].fitBounds(markerCluster.getBounds()); 37655 37656 // add cluster 37657 map[id].addLayer(markerCluster); 37658 37659 // init list 37660 37661 $asset.find('.count').text(data.length); 37662 if(data.length === 1) { 37663 $asset.find('.plural').hide(); 37664 } 37665 else { 37666 $asset.find('.plural').show(); 37667 } 37668} 37669 37670function getData(e = null, $asset) { 37671 if(e) { 37672 e.preventDefault(); 37673 } 37674 37675 eventType = e; 37676 37677 $asset.find('.map__loader').show(); 37678 const id = $asset.attr('id').replace('c', ''); 37679 37680 if(window['mapAddress' + id]) { 37681 createMapContent([window['mapAddress' + id]], $asset); 37682 } 37683 else { 37684 const $form = $asset.find('[id^=mapForm]'); 37685 37686 if ($form.length) { 37687 $form.find('button[type="submit"]').prop('disabled', true); 37688 37689 external_$_default().ajax({ 37690 type: 'POST', 37691 url: $form.attr('action'), 37692 data: $form.serialize(), 37693 dataType: 'json', 37694 success: function(data) { 37695 createMapContent(data, $asset); 37696 }, 37697 error: function() { 37698 createMapContent([], $asset); 37699 } 37700 }); 37701 } 37702 else { 37703 external_$_default().ajax({ 37704 type: 'GET', 37705 url: $asset.find('[id^=mapMap]').data('map-locations'), 37706 dataType: 'json', 37707 success: function(data) { 37708 createMapContent(data, $asset); 37709 }, 37710 error: function() { 37711 createMapContent([], $asset); 37712 } 37713 }); 37714 } 37715 } 37716} 37717 37718function initMap($asset, id) { 37719 const mapId = `mapMap${id}`; 37720 let mapInstance = L.map(mapId).setView({lon: initialCoordinates.lng, lat: initialCoordinates.lat}, 6); 37721 let tileLayerInstance = L.tileLayer('https://tile.openstreetmap.de/{z}/{x}/{y}.png', { 37722 maxZoom: 16, 37723 attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' 37724 }).addTo(mapInstance); 37725 37726 map['instance' + id] = mapInstance; 37727 tileLayer['instance' + id] = tileLayerInstance; 37728 37729 getData(null, $asset); 37730} 37731 37732external_$_default().when((external_$_default()).ready).then(() => { 37733 console.log('map leaflet initialized'); 37734 37735 const $assets = external_$_default()('.coMap'); 37736 if(!$assets.length) { 37737 return; 37738 } 37739 37740 const $list = external_$_default()('.map__list'); 37741 if($list.length > 0) { 37742 $assets.find('.map__openList, .map__closeList').on('click', function() { 37743 $assets.toggleClass('list-open'); 37744 if($assets.hasClass('list-open')) { 37745 $assets.attr('aria-expanded', 'true'); 37746 $assets.find('.map__list').find('a, button').attr('tabindex', '-1'); 37747 } 37748 else { 37749 $assets.attr('aria-expanded', 'false'); 37750 $assets.find('.map__list').find('a, button').attr('tabindex', '0'); 37751 } 37752 }) 37753 } 37754 37755 const $form = external_$_default()('.map__form'); 37756 if($form.length > 0) { 37757 const $formFields = external_$_default()('.map__form .f-form__fields'); 37758 $formFields.find('button[type="reset"]').on('click', function(e) { 37759 e.preventDefault(); 37760 37761 $formFields.find('input[value]').removeAttr('value'); 37762 $formFields.find('option[selected="selected"]').removeAttr('selected'); 37763 $formFields.find('input[checked="checked"]').removeAttr('checked'); 37764 37765 $form.trigger('reset'); 37766 }); 37767 } 37768 37769 $assets.find('[id^="mapMap"]').children().remove(); 37770 $assets.each(function() { 37771 const $asset = external_$_default()(this); 37772 const id = $asset.attr('id').replace('c', ''); 37773 37774 initMap($asset, id); 37775 if($form.length > 0) { 37776 $asset.find('[id^="mapForm"]').on('submit', (e) => getData(e, $asset)); 37777 } 37778 }) 37779}); 37780 37781// EXTERNAL MODULE: ./src/js/_imports/organisationOrganigram.js 37782var organisationOrganigram = __webpack_require__(9002); 37783// EXTERNAL MODULE: ./src/js/_imports/organisationMap.js 37784var organisationMap = __webpack_require__(8624); 37785;// CONCATENATED MODULE: ./src/js/_imports/main.js 37786 37787 37788 37789 37790 37791 37792 37793 37794 37795 37796 37797 37798 37799 37800 37801 37802 37803 37804 37805 37806 37807 37808 37809 37810 37811 37812 37813// import "Src/modules/contentObjects/coBreaking/variants/coBreaking5050/coBreaking5050.main.js"; 37814 37815 37816 37817// Activate only leaflet or gmaps 37818 37819//import "Src/modules/contentObjects/coMap/coMap.main.js"; 37820 37821 37822 37823 37824}(); 37825/******/ })() 37826; 37827/******/ (function() { // webpackBootstrap 37828var __webpack_exports__ = {}; 37829 37830/******/ })() 37831;
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.