vendor: 8,196 bytes, lines 1-329
1 2var vfb = {}; 3 4vfbRecaptchaCallback = function () { 5 // noop - remove me after verification that this is not used anymore 6}; 7 8;// /var/www/www.vfb.de/httpdocs/current/?proxy=components/jquery/jquery.js 9/*! 10 * jQuery JavaScript Library v2.1.4 11 * http://jquery.com/ 12 * 13 * Includes Sizzle.js 14 * http://sizzlejs.com/ 15 * 16 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors 17 * Released under the MIT license 18 * http://jquery.org/license 19 * 20 * Date: 2015-04-28T16:01Z 21 */ 22 23(function( global, factory ) { 24 25 if ( typeof module === "object" && typeof module.exports === "object" ) { 26 // For CommonJS and CommonJS-like environments where a proper `window` 27 // is present, execute the factory and get jQuery. 28 // For environments that do not have a `window` with a `document` 29 // (such as Node.js), expose a factory as module.exports. 30 // This accentuates the need for the creation of a real `window`. 31 // e.g. var jQuery = require("jquery")(window); 32 // See ticket #14549 for more info. 33 module.exports = global.document ? 34 factory( global, true ) : 35 function( w ) { 36 if ( !w.document ) { 37 throw new Error( "jQuery requires a window with a document" ); 38 } 39 return factory( w ); 40 }; 41 } else { 42 factory( global ); 43 } 44 45// Pass this if window is not defined yet 46}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 47 48// Support: Firefox 18+ 49// Can't be in strict mode, several libs including ASP.NET trace 50// the stack via arguments.caller.callee and Firefox dies if 51// you try to trace through call chains. (#13335) 52// 53 54var arr = []; 55 56var slice = arr.slice; 57 58var concat = arr.concat; 59 60var push = arr.push; 61 62var indexOf = arr.indexOf; 63 64var class2type = {}; 65 66var toString = class2type.toString; 67 68var hasOwn = class2type.hasOwnProperty; 69 70var support = {}; 71 72 73 74var 75 // Use the correct document accordingly with window argument (sandbox) 76 document = window.document, 77 78 version = "2.1.4", 79 80 // Define a local copy of jQuery 81 jQuery = function( selector, context ) { 82 // The jQuery object is actually just the init constructor 'enhanced' 83 // Need init if jQuery is called (just allow error to be thrown if not included) 84 return new jQuery.fn.init( selector, context ); 85 }, 86 87 // Support: Android<4.1 88 // Make sure we trim BOM and NBSP 89 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 90 91 // Matches dashed string for camelizing 92 rmsPrefix = /^-ms-/, 93 rdashAlpha = /-([\da-z])/gi, 94 95 // Used by jQuery.camelCase as callback to replace() 96 fcamelCase = function( all, letter ) { 97 return letter.toUpperCase(); 98 }; 99 100jQuery.fn = jQuery.prototype = { 101 // The current version of jQuery being used 102 jquery: version, 103 104 constructor: jQuery, 105 106 // Start with an empty selector 107 selector: "", 108 109 // The default length of a jQuery object is 0 110 length: 0, 111 112 toArray: function() { 113 return slice.call( this ); 114 }, 115 116 // Get the Nth element in the matched element set OR 117 // Get the whole matched element set as a clean array 118 get: function( num ) { 119 return num != null ? 120 121 // Return just the one element from the set 122 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 123 124 // Return all the elements in a clean array 125 slice.call( this ); 126 }, 127 128 // Take an array of elements and push it onto the stack 129 // (returning the new matched element set) 130 pushStack: function( elems ) { 131 132 // Build a new jQuery matched element set 133 var ret = jQuery.merge( this.constructor(), elems ); 134 135 // Add the old object onto the stack (as a reference) 136 ret.prevObject = this; 137 ret.context = this.context; 138 139 // Return the newly-formed element set 140 return ret; 141 }, 142 143 // Execute a callback for every element in the matched set. 144 // (You can seed the arguments with an array of args, but this is 145 // only used internally.) 146 each: function( callback, args ) { 147 return jQuery.each( this, callback, args ); 148 }, 149 150 map: function( callback ) { 151 return this.pushStack( jQuery.map(this, function( elem, i ) { 152 return callback.call( elem, i, elem ); 153 })); 154 }, 155 156 slice: function() { 157 return this.pushStack( slice.apply( this, arguments ) ); 158 }, 159 160 first: function() { 161 return this.eq( 0 ); 162 }, 163 164 last: function() { 165 return this.eq( -1 ); 166 }, 167 168 eq: function( i ) { 169 var len = this.length, 170 j = +i + ( i < 0 ? len : 0 ); 171 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); 172 }, 173 174 end: function() { 175 return this.prevObject || this.constructor(null); 176 }, 177 178 // For internal use only. 179 // Behaves like an Array's method, not like a jQuery method. 180 push: push, 181 sort: arr.sort, 182 splice: arr.splice 183}; 184 185jQuery.extend = jQuery.fn.extend = function() { 186 var options, name, src, copy, copyIsArray, clone, 187 target = arguments[0] || {}, 188 i = 1, 189 length = arguments.length, 190 deep = false; 191 192 // Handle a deep copy situation 193 if ( typeof target === "boolean" ) { 194 deep = target; 195 196 // Skip the boolean and the target 197 target = arguments[ i ] || {}; 198 i++; 199 } 200 201 // Handle case when target is a string or something (possible in deep copy) 202 if ( typeof target !== "object" && !jQuery.isFunction(target) ) { 203 target = {}; 204 } 205 206 // Extend jQuery itself if only one argument is passed 207 if ( i === length ) { 208 target = this; 209 i--; 210 } 211 212 for ( ; i < length; i++ ) { 213 // Only deal with non-null/undefined values 214 if ( (options = arguments[ i ]) != null ) { 215 // Extend the base object 216 for ( name in options ) { 217 src = target[ name ]; 218 copy = options[ name ]; 219 220 // Prevent never-ending loop 221 if ( target === copy ) { 222 continue; 223 } 224 225 // Recurse if we're merging plain objects or arrays 226 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { 227 if ( copyIsArray ) { 228 copyIsArray = false; 229 clone = src && jQuery.isArray(src) ? src : []; 230 231 } else { 232 clone = src && jQuery.isPlainObject(src) ? src : {}; 233 } 234 235 // Never move original objects, clone them 236 target[ name ] = jQuery.extend( deep, clone, copy ); 237 238 // Don't bring in undefined values 239 } else if ( copy !== undefined ) { 240 target[ name ] = copy; 241 } 242 } 243 } 244 } 245 246 // Return the modified object 247 return target; 248}; 249 250jQuery.extend({ 251 // Unique for each copy of jQuery on the page 252 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 253 254 // Assume jQuery is ready without the ready module 255 isReady: true, 256 257 error: function( msg ) { 258 throw new Error( msg ); 259 }, 260 261 noop: function() {}, 262 263 isFunction: function( obj ) { 264 return jQuery.type(obj) === "function"; 265 }, 266 267 isArray: Array.isArray, 268 269 isWindow: function( obj ) { 270 return obj != null && obj === obj.window; 271 }, 272 273 isNumeric: function( obj ) { 274 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 275 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 276 // subtraction forces infinities to NaN 277 // adding 1 corrects loss of precision from parseFloat (#15100) 278 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; 279 }, 280 281 isPlainObject: function( obj ) { 282 // Not plain objects: 283 // - Any object or value whose internal [[Class]] property is not "[object Object]" 284 // - DOM nodes 285 // - window 286 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 287 return false; 288 } 289 290 if ( obj.constructor && 291 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { 292 return false; 293 } 294 295 // If the function hasn't returned already, we're confident that 296 // |obj| is a plain object, created by {} or constructed with new Object 297 return true; 298 }, 299 300 isEmptyObject: function( obj ) { 301 var name; 302 for ( name in obj ) { 303 return false; 304 } 305 return true; 306 }, 307 308 type: function( obj ) { 309 if ( obj == null ) { 310 return obj + ""; 311 } 312 // Support: Android<4.0, iOS<6 (functionish RegExp) 313 return typeof obj === "object" || typeof obj === "function" ? 314 class2type[ toString.call(obj) ] || "object" : 315 typeof obj; 316 }, 317 318 // Evaluates a script in a global context 319 globalEval: function( code ) { 320 var script, 321 indirect = eval; 322 323 code = jQuery.trim( code ); 324 325 if ( code ) { 326 // If the code includes a valid, prologue position 327 // strict mode pragma, execute code by injecting a 328 // script tag into the document. 329 if ( code.indexOf(
vendor: 32,570 bytes, lines 329-1514
329) === 1 ) { 330 script = document.createElement("script"); 331 script.text = code; 332 document.head.appendChild( script ).parentNode.removeChild( script ); 333 } else { 334 // Otherwise, avoid the DOM node creation, insertion 335 // and removal by using an indirect global eval 336 indirect( code ); 337 } 338 } 339 }, 340 341 // Convert dashed to camelCase; used by the css and data modules 342 // Support: IE9-11+ 343 // Microsoft forgot to hump their vendor prefix (#9572) 344 camelCase: function( string ) { 345 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 346 }, 347 348 nodeName: function( elem, name ) { 349 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 350 }, 351 352 // args is for internal usage only 353 each: function( obj, callback, args ) { 354 var value, 355 i = 0, 356 length = obj.length, 357 isArray = isArraylike( obj ); 358 359 if ( args ) { 360 if ( isArray ) { 361 for ( ; i < length; i++ ) { 362 value = callback.apply( obj[ i ], args ); 363 364 if ( value === false ) { 365 break; 366 } 367 } 368 } else { 369 for ( i in obj ) { 370 value = callback.apply( obj[ i ], args ); 371 372 if ( value === false ) { 373 break; 374 } 375 } 376 } 377 378 // A special, fast, case for the most common use of each 379 } else { 380 if ( isArray ) { 381 for ( ; i < length; i++ ) { 382 value = callback.call( obj[ i ], i, obj[ i ] ); 383 384 if ( value === false ) { 385 break; 386 } 387 } 388 } else { 389 for ( i in obj ) { 390 value = callback.call( obj[ i ], i, obj[ i ] ); 391 392 if ( value === false ) { 393 break; 394 } 395 } 396 } 397 } 398 399 return obj; 400 }, 401 402 // Support: Android<4.1 403 trim: function( text ) { 404 return text == null ? 405 "" : 406 ( text + "" ).replace( rtrim, "" ); 407 }, 408 409 // results is for internal usage only 410 makeArray: function( arr, results ) { 411 var ret = results || []; 412 413 if ( arr != null ) { 414 if ( isArraylike( Object(arr) ) ) { 415 jQuery.merge( ret, 416 typeof arr === "string" ? 417 [ arr ] : arr 418 ); 419 } else { 420 push.call( ret, arr ); 421 } 422 } 423 424 return ret; 425 }, 426 427 inArray: function( elem, arr, i ) { 428 return arr == null ? -1 : indexOf.call( arr, elem, i ); 429 }, 430 431 merge: function( first, second ) { 432 var len = +second.length, 433 j = 0, 434 i = first.length; 435 436 for ( ; j < len; j++ ) { 437 first[ i++ ] = second[ j ]; 438 } 439 440 first.length = i; 441 442 return first; 443 }, 444 445 grep: function( elems, callback, invert ) { 446 var callbackInverse, 447 matches = [], 448 i = 0, 449 length = elems.length, 450 callbackExpect = !invert; 451 452 // Go through the array, only saving the items 453 // that pass the validator function 454 for ( ; i < length; i++ ) { 455 callbackInverse = !callback( elems[ i ], i ); 456 if ( callbackInverse !== callbackExpect ) { 457 matches.push( elems[ i ] ); 458 } 459 } 460 461 return matches; 462 }, 463 464 // arg is for internal usage only 465 map: function( elems, callback, arg ) { 466 var value, 467 i = 0, 468 length = elems.length, 469 isArray = isArraylike( elems ), 470 ret = []; 471 472 // Go through the array, translating each of the items to their new values 473 if ( isArray ) { 474 for ( ; i < length; i++ ) { 475 value = callback( elems[ i ], i, arg ); 476 477 if ( value != null ) { 478 ret.push( value ); 479 } 480 } 481 482 // Go through every key on the object, 483 } else { 484 for ( i in elems ) { 485 value = callback( elems[ i ], i, arg ); 486 487 if ( value != null ) { 488 ret.push( value ); 489 } 490 } 491 } 492 493 // Flatten any nested arrays 494 return concat.apply( [], ret ); 495 }, 496 497 // A global GUID counter for objects 498 guid: 1, 499 500 // Bind a function to a context, optionally partially applying any 501 // arguments. 502 proxy: function( fn, context ) { 503 var tmp, args, proxy; 504 505 if ( typeof context === "string" ) { 506 tmp = fn[ context ]; 507 context = fn; 508 fn = tmp; 509 } 510 511 // Quick check to determine if target is callable, in the spec 512 // this throws a TypeError, but we will just return undefined. 513 if ( !jQuery.isFunction( fn ) ) { 514 return undefined; 515 } 516 517 // Simulated bind 518 args = slice.call( arguments, 2 ); 519 proxy = function() { 520 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 521 }; 522 523 // Set the guid of unique handler to the same of original handler, so it can be removed 524 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 525 526 return proxy; 527 }, 528 529 now: Date.now, 530 531 // jQuery.support is not used in Core but other projects attach their 532 // properties to it so it needs to exist. 533 support: support 534}); 535 536// Populate the class2type map 537jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { 538 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 539}); 540 541function isArraylike( obj ) { 542 543 // Support: iOS 8.2 (not reproducible in simulator) 544 // `in` check used to prevent JIT error (gh-2145) 545 // hasOwn isn't used here due to false negatives 546 // regarding Nodelist length in IE 547 var length = "length" in obj && obj.length, 548 type = jQuery.type( obj ); 549 550 if ( type === "function" || jQuery.isWindow( obj ) ) { 551 return false; 552 } 553 554 if ( obj.nodeType === 1 && length ) { 555 return true; 556 } 557 558 return type === "array" || length === 0 || 559 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 560} 561var Sizzle = 562/*! 563 * Sizzle CSS Selector Engine v2.2.0-pre 564 * http://sizzlejs.com/ 565 * 566 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors 567 * Released under the MIT license 568 * http://jquery.org/license 569 * 570 * Date: 2014-12-16 571 */ 572(function( window ) { 573 574var i, 575 support, 576 Expr, 577 getText, 578 isXML, 579 tokenize, 580 compile, 581 select, 582 outermostContext, 583 sortInput, 584 hasDuplicate, 585 586 // Local document vars 587 setDocument, 588 document, 589 docElem, 590 documentIsHTML, 591 rbuggyQSA, 592 rbuggyMatches, 593 matches, 594 contains, 595 596 // Instance-specific data 597 expando = "sizzle" + 1 * new Date(), 598 preferredDoc = window.document, 599 dirruns = 0, 600 done = 0, 601 classCache = createCache(), 602 tokenCache = createCache(), 603 compilerCache = createCache(), 604 sortOrder = function( a, b ) { 605 if ( a === b ) { 606 hasDuplicate = true; 607 } 608 return 0; 609 }, 610 611 // General-purpose constants 612 MAX_NEGATIVE = 1 << 31, 613 614 // Instance methods 615 hasOwn = ({}).hasOwnProperty, 616 arr = [], 617 pop = arr.pop, 618 push_native = arr.push, 619 push = arr.push, 620 slice = arr.slice, 621 // Use a stripped-down indexOf as it's faster than native 622 // http://jsperf.com/thor-indexof-vs-for/5 623 indexOf = function( list, elem ) { 624 var i = 0, 625 len = list.length; 626 for ( ; i < len; i++ ) { 627 if ( list[i] === elem ) { 628 return i; 629 } 630 } 631 return -1; 632 }, 633 634 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 635 636 // Regular expressions 637 638 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace 639 whitespace = "[\\x20\\t\\r\\n\\f]", 640 // http://www.w3.org/TR/css3-syntax/#characters 641 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 642 643 // Loosely modeled on CSS identifier characters 644 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors 645 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 646 identifier = characterEncoding.replace( "w", "w#" ), 647 648 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 649 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + 650 // Operator (capture 2) 651 "*([*^$|!~]?=)" + whitespace + 652 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 653 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 654 "*\\]", 655 656 pseudos = ":(" + characterEncoding + ")(?:\\((" + 657 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 658 // 1. quoted (capture 3; capture 4 or capture 5) 659 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 660 // 2. simple (capture 6) 661 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 662 // 3. anything else (capture 2) 663 ".*" + 664 ")\\)|)", 665 666 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 667 rwhitespace = new RegExp( whitespace + "+", "g" ), 668 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 669 670 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 671 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 672 673 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 674 675 rpseudo = new RegExp( pseudos ), 676 ridentifier = new RegExp( "^" + identifier + "$" ), 677 678 matchExpr = { 679 "ID": new RegExp( "^#(" + characterEncoding + ")" ), 680 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), 681 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), 682 "ATTR": new RegExp( "^" + attributes ), 683 "PSEUDO": new RegExp( "^" + pseudos ), 684 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 685 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 686 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 687 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 688 // For use in libraries implementing .is() 689 // We use this for POS matching in `select` 690 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 691 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 692 }, 693 694 rinputs = /^(?:input|select|textarea|button)$/i, 695 rheader = /^h\d$/i, 696 697 rnative = /^[^{]+\{\s*\[native \w/, 698 699 // Easily-parseable/retrievable ID or TAG or CLASS selectors 700 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 701 702 rsibling = /[+~]/, 703 rescape = /'|\\/g, 704 705 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 706 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 707 funescape = function( _, escaped, escapedWhitespace ) { 708 var high = "0x" + escaped - 0x10000; 709 // NaN means non-codepoint 710 // Support: Firefox<24 711 // Workaround erroneous numeric interpretation of +"0x" 712 return high !== high || escapedWhitespace ? 713 escaped : 714 high < 0 ? 715 // BMP codepoint 716 String.fromCharCode( high + 0x10000 ) : 717 // Supplemental Plane codepoint (surrogate pair) 718 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 719 }, 720 721 // Used for iframes 722 // See setDocument() 723 // Removing the function wrapper causes a "Permission Denied" 724 // error in IE 725 unloadHandler = function() { 726 setDocument(); 727 }; 728 729// Optimize for push.apply( _, NodeList ) 730try { 731 push.apply( 732 (arr = slice.call( preferredDoc.childNodes )), 733 preferredDoc.childNodes 734 ); 735 // Support: Android<4.0 736 // Detect silently failing push.apply 737 arr[ preferredDoc.childNodes.length ].nodeType; 738} catch ( e ) { 739 push = { apply: arr.length ? 740 741 // Leverage slice if possible 742 function( target, els ) { 743 push_native.apply( target, slice.call(els) ); 744 } : 745 746 // Support: IE<9 747 // Otherwise append directly 748 function( target, els ) { 749 var j = target.length, 750 i = 0; 751 // Can't trust NodeList.length 752 while ( (target[j++] = els[i++]) ) {} 753 target.length = j - 1; 754 } 755 }; 756} 757 758function Sizzle( selector, context, results, seed ) { 759 var match, elem, m, nodeType, 760 // QSA vars 761 i, groups, old, nid, newContext, newSelector; 762 763 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 764 setDocument( context ); 765 } 766 767 context = context || document; 768 results = results || []; 769 nodeType = context.nodeType; 770 771 if ( typeof selector !== "string" || !selector || 772 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 773 774 return results; 775 } 776 777 if ( !seed && documentIsHTML ) { 778 779 // Try to shortcut find operations when possible (e.g., not under DocumentFragment) 780 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 781 // Speed-up: Sizzle("#ID") 782 if ( (m = match[1]) ) { 783 if ( nodeType === 9 ) { 784 elem = context.getElementById( m ); 785 // Check parentNode to catch when Blackberry 4.6 returns 786 // nodes that are no longer in the document (jQuery #6963) 787 if ( elem && elem.parentNode ) { 788 // Handle the case where IE, Opera, and Webkit return items 789 // by name instead of ID 790 if ( elem.id === m ) { 791 results.push( elem ); 792 return results; 793 } 794 } else { 795 return results; 796 } 797 } else { 798 // Context is not a document 799 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && 800 contains( context, elem ) && elem.id === m ) { 801 results.push( elem ); 802 return results; 803 } 804 } 805 806 // Speed-up: Sizzle("TAG") 807 } else if ( match[2] ) { 808 push.apply( results, context.getElementsByTagName( selector ) ); 809 return results; 810 811 // Speed-up: Sizzle(".CLASS") 812 } else if ( (m = match[3]) && support.getElementsByClassName ) { 813 push.apply( results, context.getElementsByClassName( m ) ); 814 return results; 815 } 816 } 817 818 // QSA path 819 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 820 nid = old = expando; 821 newContext = context; 822 newSelector = nodeType !== 1 && selector; 823 824 // qSA works strangely on Element-rooted queries 825 // We can work around this by specifying an extra ID on the root 826 // and working up from there (Thanks to Andrew Dupont for the technique) 827 // IE 8 doesn't work on object elements 828 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { 829 groups = tokenize( selector ); 830 831 if ( (old = context.getAttribute("id")) ) { 832 nid = old.replace( rescape, "\\$&" ); 833 } else { 834 context.setAttribute( "id", nid ); 835 } 836 nid = "[id='" + nid + "'] "; 837 838 i = groups.length; 839 while ( i-- ) { 840 groups[i] = nid + toSelector( groups[i] ); 841 } 842 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; 843 newSelector = groups.join(","); 844 } 845 846 if ( newSelector ) { 847 try { 848 push.apply( results, 849 newContext.querySelectorAll( newSelector ) 850 ); 851 return results; 852 } catch(qsaError) { 853 } finally { 854 if ( !old ) { 855 context.removeAttribute("id"); 856 } 857 } 858 } 859 } 860 } 861 862 // All others 863 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 864} 865 866/** 867 * Create key-value caches of limited size 868 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with 869 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 870 * deleting the oldest entry 871 */ 872function createCache() { 873 var keys = []; 874 875 function cache( key, value ) { 876 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 877 if ( keys.push( key + " " ) > Expr.cacheLength ) { 878 // Only keep the most recent entries 879 delete cache[ keys.shift() ]; 880 } 881 return (cache[ key + " " ] = value); 882 } 883 return cache; 884} 885 886/** 887 * Mark a function for special use by Sizzle 888 * @param {Function} fn The function to mark 889 */ 890function markFunction( fn ) { 891 fn[ expando ] = true; 892 return fn; 893} 894 895/** 896 * Support testing using an element 897 * @param {Function} fn Passed the created div and expects a boolean result 898 */ 899function assert( fn ) { 900 var div = document.createElement("div"); 901 902 try { 903 return !!fn( div ); 904 } catch (e) { 905 return false; 906 } finally { 907 // Remove from its parent by default 908 if ( div.parentNode ) { 909 div.parentNode.removeChild( div ); 910 } 911 // release memory in IE 912 div = null; 913 } 914} 915 916/** 917 * Adds the same handler for all of the specified attrs 918 * @param {String} attrs Pipe-separated list of attributes 919 * @param {Function} handler The method that will be applied 920 */ 921function addHandle( attrs, handler ) { 922 var arr = attrs.split("|"), 923 i = attrs.length; 924 925 while ( i-- ) { 926 Expr.attrHandle[ arr[i] ] = handler; 927 } 928} 929 930/** 931 * Checks document order of two siblings 932 * @param {Element} a 933 * @param {Element} b 934 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 935 */ 936function siblingCheck( a, b ) { 937 var cur = b && a, 938 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 939 ( ~b.sourceIndex || MAX_NEGATIVE ) - 940 ( ~a.sourceIndex || MAX_NEGATIVE ); 941 942 // Use IE sourceIndex if available on both nodes 943 if ( diff ) { 944 return diff; 945 } 946 947 // Check if b follows a 948 if ( cur ) { 949 while ( (cur = cur.nextSibling) ) { 950 if ( cur === b ) { 951 return -1; 952 } 953 } 954 } 955 956 return a ? 1 : -1; 957} 958 959/** 960 * Returns a function to use in pseudos for input types 961 * @param {String} type 962 */ 963function createInputPseudo( type ) { 964 return function( elem ) { 965 var name = elem.nodeName.toLowerCase(); 966 return name === "input" && elem.type === type; 967 }; 968} 969 970/** 971 * Returns a function to use in pseudos for buttons 972 * @param {String} type 973 */ 974function createButtonPseudo( type ) { 975 return function( elem ) { 976 var name = elem.nodeName.toLowerCase(); 977 return (name === "input" || name === "button") && elem.type === type; 978 }; 979} 980 981/** 982 * Returns a function to use in pseudos for positionals 983 * @param {Function} fn 984 */ 985function createPositionalPseudo( fn ) { 986 return markFunction(function( argument ) { 987 argument = +argument; 988 return markFunction(function( seed, matches ) { 989 var j, 990 matchIndexes = fn( [], seed.length, argument ), 991 i = matchIndexes.length; 992 993 // Match elements found at the specified indexes 994 while ( i-- ) { 995 if ( seed[ (j = matchIndexes[i]) ] ) { 996 seed[j] = !(matches[j] = seed[j]); 997 } 998 } 999 }); 1000 }); 1001} 1002 1003/** 1004 * Checks a node for validity as a Sizzle context 1005 * @param {Element|Object=} context 1006 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1007 */ 1008function testContext( context ) { 1009 return context && typeof context.getElementsByTagName !== "undefined" && context; 1010} 1011 1012// Expose support vars for convenience 1013support = Sizzle.support = {}; 1014 1015/** 1016 * Detects XML nodes 1017 * @param {Element|Object} elem An element or a document 1018 * @returns {Boolean} True iff elem is a non-HTML XML node 1019 */ 1020isXML = Sizzle.isXML = function( elem ) { 1021 // documentElement is verified for cases where it doesn't yet exist 1022 // (such as loading iframes in IE - #4833) 1023 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1024 return documentElement ? documentElement.nodeName !== "HTML" : false; 1025}; 1026 1027/** 1028 * Sets document-related variables once based on the current document 1029 * @param {Element|Object} [doc] An element or document object to use to set the document 1030 * @returns {Object} Returns the current document 1031 */ 1032setDocument = Sizzle.setDocument = function( node ) { 1033 var hasCompare, parent, 1034 doc = node ? node.ownerDocument || node : preferredDoc; 1035 1036 // If no document and documentElement is available, return 1037 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1038 return document; 1039 } 1040 1041 // Set our document 1042 document = doc; 1043 docElem = doc.documentElement; 1044 parent = doc.defaultView; 1045 1046 // Support: IE>8 1047 // If iframe document is assigned to "document" variable and if iframe has been reloaded, 1048 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 1049 // IE6-8 do not support the defaultView property so parent will be undefined 1050 if ( parent && parent !== parent.top ) { 1051 // IE11 does not have attachEvent, so all must suffer 1052 if ( parent.addEventListener ) { 1053 parent.addEventListener( "unload", unloadHandler, false ); 1054 } else if ( parent.attachEvent ) { 1055 parent.attachEvent( "onunload", unloadHandler ); 1056 } 1057 } 1058 1059 /* Support tests 1060 ---------------------------------------------------------------------- */ 1061 documentIsHTML = !isXML( doc ); 1062 1063 /* Attributes 1064 ---------------------------------------------------------------------- */ 1065 1066 // Support: IE<8 1067 // Verify that getAttribute really returns attributes and not properties 1068 // (excepting IE8 booleans) 1069 support.attributes = assert(function( div ) { 1070 div.className = "i"; 1071 return !div.getAttribute("className"); 1072 }); 1073 1074 /* getElement(s)By* 1075 ---------------------------------------------------------------------- */ 1076 1077 // Check if getElementsByTagName("*") returns only elements 1078 support.getElementsByTagName = assert(function( div ) { 1079 div.appendChild( doc.createComment("") ); 1080 return !div.getElementsByTagName("*").length; 1081 }); 1082 1083 // Support: IE<9 1084 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); 1085 1086 // Support: IE<10 1087 // Check if getElementById returns elements by name 1088 // The broken getElementById methods don't pick up programatically-set names, 1089 // so use a roundabout getElementsByName test 1090 support.getById = assert(function( div ) { 1091 docElem.appendChild( div ).id = expando; 1092 return !doc.getElementsByName || !doc.getElementsByName( expando ).length; 1093 }); 1094 1095 // ID find and filter 1096 if ( support.getById ) { 1097 Expr.find["ID"] = function( id, context ) { 1098 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1099 var m = context.getElementById( id ); 1100 // Check parentNode to catch when Blackberry 4.6 returns 1101 // nodes that are no longer in the document #6963 1102 return m && m.parentNode ? [ m ] : []; 1103 } 1104 }; 1105 Expr.filter["ID"] = function( id ) { 1106 var attrId = id.replace( runescape, funescape ); 1107 return function( elem ) { 1108 return elem.getAttribute("id") === attrId; 1109 }; 1110 }; 1111 } else { 1112 // Support: IE6/7 1113 // getElementById is not reliable as a find shortcut 1114 delete Expr.find["ID"]; 1115 1116 Expr.filter["ID"] = function( id ) { 1117 var attrId = id.replace( runescape, funescape ); 1118 return function( elem ) { 1119 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 1120 return node && node.value === attrId; 1121 }; 1122 }; 1123 } 1124 1125 // Tag 1126 Expr.find["TAG"] = support.getElementsByTagName ? 1127 function( tag, context ) { 1128 if ( typeof context.getElementsByTagName !== "undefined" ) { 1129 return context.getElementsByTagName( tag ); 1130 1131 // DocumentFragment nodes don't have gEBTN 1132 } else if ( support.qsa ) { 1133 return context.querySelectorAll( tag ); 1134 } 1135 } : 1136 1137 function( tag, context ) { 1138 var elem, 1139 tmp = [], 1140 i = 0, 1141 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1142 results = context.getElementsByTagName( tag ); 1143 1144 // Filter out possible comments 1145 if ( tag === "*" ) { 1146 while ( (elem = results[i++]) ) { 1147 if ( elem.nodeType === 1 ) { 1148 tmp.push( elem ); 1149 } 1150 } 1151 1152 return tmp; 1153 } 1154 return results; 1155 }; 1156 1157 // Class 1158 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1159 if ( documentIsHTML ) { 1160 return context.getElementsByClassName( className ); 1161 } 1162 }; 1163 1164 /* QSA/matchesSelector 1165 ---------------------------------------------------------------------- */ 1166 1167 // QSA and matchesSelector support 1168 1169 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1170 rbuggyMatches = []; 1171 1172 // qSa(:focus) reports false when true (Chrome 21) 1173 // We allow this because of a bug in IE8/9 that throws an error 1174 // whenever `document.activeElement` is accessed on an iframe 1175 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1176 // See http://bugs.jquery.com/ticket/13378 1177 rbuggyQSA = []; 1178 1179 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { 1180 // Build QSA regex 1181 // Regex strategy adopted from Diego Perini 1182 assert(function( div ) { 1183 // Select is set to empty string on purpose 1184 // This is to test IE's treatment of not explicitly 1185 // setting a boolean content attribute, 1186 // since its presence should be enough 1187 // http://bugs.jquery.com/ticket/12359 1188 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 1189 "<select id='" + expando + "-\f]' msallowcapture=''>" + 1190 "<option selected=''></option></select>"; 1191 1192 // Support: IE8, Opera 11-12.16 1193 // Nothing should be selected when empty strings follow ^= or $= or *= 1194 // The test attribute must be unknown in Opera but "safe" for WinRT 1195 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1196 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 1197 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1198 } 1199 1200 // Support: IE8 1201 // Boolean attributes and "value" are not treated correctly 1202 if ( !div.querySelectorAll("[selected]").length ) { 1203 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1204 } 1205 1206 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ 1207 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1208 rbuggyQSA.push("~="); 1209 } 1210 1211 // Webkit/Opera - :checked should return selected option elements 1212 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1213 // IE8 throws error here and will not see later tests 1214 if ( !div.querySelectorAll(":checked").length ) { 1215 rbuggyQSA.push(":checked"); 1216 } 1217 1218 // Support: Safari 8+, iOS 8+ 1219 // https://bugs.webkit.org/show_bug.cgi?id=136851 1220 // In-page `selector#id sibing-combinator selector` fails 1221 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 1222 rbuggyQSA.push(".#.+[+~]"); 1223 } 1224 }); 1225 1226 assert(function( div ) { 1227 // Support: Windows 8 Native Apps 1228 // The type and name attributes are restricted during .innerHTML assignment 1229 var input = doc.createElement("input"); 1230 input.setAttribute( "type", "hidden" ); 1231 div.appendChild( input ).setAttribute( "name", "D" ); 1232 1233 // Support: IE8 1234 // Enforce case-sensitivity of name attribute 1235 if ( div.querySelectorAll("[name=d]").length ) { 1236 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1237 } 1238 1239 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1240 // IE8 throws error here and will not see later tests 1241 if ( !div.querySelectorAll(":enabled").length ) { 1242 rbuggyQSA.push( ":enabled", ":disabled" ); 1243 } 1244 1245 // Opera 10-11 does not throw on post-comma invalid pseudos 1246 div.querySelectorAll("*,:x"); 1247 rbuggyQSA.push(",.*:"); 1248 }); 1249 } 1250 1251 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1252 docElem.webkitMatchesSelector || 1253 docElem.mozMatchesSelector || 1254 docElem.oMatchesSelector || 1255 docElem.msMatchesSelector) )) ) { 1256 1257 assert(function( div ) { 1258 // Check to see if it's possible to do matchesSelector 1259 // on a disconnected node (IE 9) 1260 support.disconnectedMatch = matches.call( div, "div" ); 1261 1262 // This should fail with an exception 1263 // Gecko does not error, returns false instead 1264 matches.call( div, "[s!='']:x" ); 1265 rbuggyMatches.push( "!=", pseudos ); 1266 }); 1267 } 1268 1269 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1270 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1271 1272 /* Contains 1273 ---------------------------------------------------------------------- */ 1274 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1275 1276 // Element contains another 1277 // Purposefully does not implement inclusive descendent 1278 // As in, an element does not contain itself 1279 contains = hasCompare || rnative.test( docElem.contains ) ? 1280 function( a, b ) { 1281 var adown = a.nodeType === 9 ? a.documentElement : a, 1282 bup = b && b.parentNode; 1283 return a === bup || !!( bup && bup.nodeType === 1 && ( 1284 adown.contains ? 1285 adown.contains( bup ) : 1286 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1287 )); 1288 } : 1289 function( a, b ) { 1290 if ( b ) { 1291 while ( (b = b.parentNode) ) { 1292 if ( b === a ) { 1293 return true; 1294 } 1295 } 1296 } 1297 return false; 1298 }; 1299 1300 /* Sorting 1301 ---------------------------------------------------------------------- */ 1302 1303 // Document order sorting 1304 sortOrder = hasCompare ? 1305 function( a, b ) { 1306 1307 // Flag for duplicate removal 1308 if ( a === b ) { 1309 hasDuplicate = true; 1310 return 0; 1311 } 1312 1313 // Sort on method existence if only one input has compareDocumentPosition 1314 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1315 if ( compare ) { 1316 return compare; 1317 } 1318 1319 // Calculate position if both inputs belong to the same document 1320 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1321 a.compareDocumentPosition( b ) : 1322 1323 // Otherwise we know they are disconnected 1324 1; 1325 1326 // Disconnected nodes 1327 if ( compare & 1 || 1328 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1329 1330 // Choose the first element that is related to our preferred document 1331 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1332 return -1; 1333 } 1334 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1335 return 1; 1336 } 1337 1338 // Maintain original order 1339 return sortInput ? 1340 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1341 0; 1342 } 1343 1344 return compare & 4 ? -1 : 1; 1345 } : 1346 function( a, b ) { 1347 // Exit early if the nodes are identical 1348 if ( a === b ) { 1349 hasDuplicate = true; 1350 return 0; 1351 } 1352 1353 var cur, 1354 i = 0, 1355 aup = a.parentNode, 1356 bup = b.parentNode, 1357 ap = [ a ], 1358 bp = [ b ]; 1359 1360 // Parentless nodes are either documents or disconnected 1361 if ( !aup || !bup ) { 1362 return a === doc ? -1 : 1363 b === doc ? 1 : 1364 aup ? -1 : 1365 bup ? 1 : 1366 sortInput ? 1367 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1368 0; 1369 1370 // If the nodes are siblings, we can do a quick check 1371 } else if ( aup === bup ) { 1372 return siblingCheck( a, b ); 1373 } 1374 1375 // Otherwise we need full lists of their ancestors for comparison 1376 cur = a; 1377 while ( (cur = cur.parentNode) ) { 1378 ap.unshift( cur ); 1379 } 1380 cur = b; 1381 while ( (cur = cur.parentNode) ) { 1382 bp.unshift( cur ); 1383 } 1384 1385 // Walk down the tree looking for a discrepancy 1386 while ( ap[i] === bp[i] ) { 1387 i++; 1388 } 1389 1390 return i ? 1391 // Do a sibling check if the nodes have a common ancestor 1392 siblingCheck( ap[i], bp[i] ) : 1393 1394 // Otherwise nodes in our document sort first 1395 ap[i] === preferredDoc ? -1 : 1396 bp[i] === preferredDoc ? 1 : 1397 0; 1398 }; 1399 1400 return doc; 1401}; 1402 1403Sizzle.matches = function( expr, elements ) { 1404 return Sizzle( expr, null, null, elements ); 1405}; 1406 1407Sizzle.matchesSelector = function( elem, expr ) { 1408 // Set document vars if needed 1409 if ( ( elem.ownerDocument || elem ) !== document ) { 1410 setDocument( elem ); 1411 } 1412 1413 // Make sure that attribute selectors are quoted 1414 expr = expr.replace( rattributeQuotes, "='$1']" ); 1415 1416 if ( support.matchesSelector && documentIsHTML && 1417 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1418 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1419 1420 try { 1421 var ret = matches.call( elem, expr ); 1422 1423 // IE 9's matchesSelector returns false on disconnected nodes 1424 if ( ret || support.disconnectedMatch || 1425 // As well, disconnected nodes are said to be in a document 1426 // fragment in IE 9 1427 elem.document && elem.document.nodeType !== 11 ) { 1428 return ret; 1429 } 1430 } catch (e) {} 1431 } 1432 1433 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1434}; 1435 1436Sizzle.contains = function( context, elem ) { 1437 // Set document vars if needed 1438 if ( ( context.ownerDocument || context ) !== document ) { 1439 setDocument( context ); 1440 } 1441 return contains( context, elem ); 1442}; 1443 1444Sizzle.attr = function( elem, name ) { 1445 // Set document vars if needed 1446 if ( ( elem.ownerDocument || elem ) !== document ) { 1447 setDocument( elem ); 1448 } 1449 1450 var fn = Expr.attrHandle[ name.toLowerCase() ], 1451 // Don't get fooled by Object.prototype properties (jQuery #13807) 1452 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1453 fn( elem, name, !documentIsHTML ) : 1454 undefined; 1455 1456 return val !== undefined ? 1457 val : 1458 support.attributes || !documentIsHTML ? 1459 elem.getAttribute( name ) : 1460 (val = elem.getAttributeNode(name)) && val.specified ? 1461 val.value : 1462 null; 1463}; 1464 1465Sizzle.error = function( msg ) { 1466 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1467}; 1468 1469/** 1470 * Document sorting and removing duplicates 1471 * @param {ArrayLike} results 1472 */ 1473Sizzle.uniqueSort = function( results ) { 1474 var elem, 1475 duplicates = [], 1476 j = 0, 1477 i = 0; 1478 1479 // Unless we *know* we can detect duplicates, assume their presence 1480 hasDuplicate = !support.detectDuplicates; 1481 sortInput = !support.sortStable && results.slice( 0 ); 1482 results.sort( sortOrder ); 1483 1484 if ( hasDuplicate ) { 1485 while ( (elem = results[i++]) ) { 1486 if ( elem === results[ i ] ) { 1487 j = duplicates.push( i ); 1488 } 1489 } 1490 while ( j-- ) { 1491 results.splice( duplicates[ j ], 1 ); 1492 } 1493 } 1494 1495 // Clear input after sorting to release objects 1496 // See https://github.com/jquery/sizzle/pull/225 1497 sortInput = null; 1498 1499 return results; 1500}; 1501 1502/** 1503 * Utility function for retrieving the text value of an array of DOM nodes 1504 * @param {Array|Element} elem 1505 */ 1506getText = Sizzle.getText = function( elem ) { 1507 var node, 1508 ret = "", 1509 i = 0, 1510 nodeType = elem.nodeType; 1511 1512 if ( !nodeType ) { 1513 // If no nodeType, this is expected to be an array 1514 while ( (node = elem[i++]) ) {
vendor: 4,161 bytes, lines 1515-1667
1515 // Do not traverse comment nodes 1516 ret += getText( node ); 1517 } 1518 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1519 // Use textContent for elements 1520 // innerText usage removed for consistency of new lines (jQuery #11153) 1521 if ( typeof elem.textContent === "string" ) { 1522 return elem.textContent; 1523 } else { 1524 // Traverse its children 1525 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1526 ret += getText( elem ); 1527 } 1528 } 1529 } else if ( nodeType === 3 || nodeType === 4 ) { 1530 return elem.nodeValue; 1531 } 1532 // Do not include comment or processing instruction nodes 1533 1534 return ret; 1535}; 1536 1537Expr = Sizzle.selectors = { 1538 1539 // Can be adjusted by the user 1540 cacheLength: 50, 1541 1542 createPseudo: markFunction, 1543 1544 match: matchExpr, 1545 1546 attrHandle: {}, 1547 1548 find: {}, 1549 1550 relative: { 1551 ">": { dir: "parentNode", first: true }, 1552 " ": { dir: "parentNode" }, 1553 "+": { dir: "previousSibling", first: true }, 1554 "~": { dir: "previousSibling" } 1555 }, 1556 1557 preFilter: { 1558 "ATTR": function( match ) { 1559 match[1] = match[1].replace( runescape, funescape ); 1560 1561 // Move the given value to match[3] whether quoted or unquoted 1562 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1563 1564 if ( match[2] === "~=" ) { 1565 match[3] = " " + match[3] + " "; 1566 } 1567 1568 return match.slice( 0, 4 ); 1569 }, 1570 1571 "CHILD": function( match ) { 1572 /* matches from matchExpr["CHILD"] 1573 1 type (only|nth|...) 1574 2 what (child|of-type) 1575 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1576 4 xn-component of xn+y argument ([+-]?\d*n|) 1577 5 sign of xn-component 1578 6 x of xn-component 1579 7 sign of y-component 1580 8 y of y-component 1581 */ 1582 match[1] = match[1].toLowerCase(); 1583 1584 if ( match[1].slice( 0, 3 ) === "nth" ) { 1585 // nth-* requires argument 1586 if ( !match[3] ) { 1587 Sizzle.error( match[0] ); 1588 } 1589 1590 // numeric x and y parameters for Expr.filter.CHILD 1591 // remember that false/true cast respectively to 0/1 1592 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1593 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1594 1595 // other types prohibit arguments 1596 } else if ( match[3] ) { 1597 Sizzle.error( match[0] ); 1598 } 1599 1600 return match; 1601 }, 1602 1603 "PSEUDO": function( match ) { 1604 var excess, 1605 unquoted = !match[6] && match[2]; 1606 1607 if ( matchExpr["CHILD"].test( match[0] ) ) { 1608 return null; 1609 } 1610 1611 // Accept quoted arguments as-is 1612 if ( match[3] ) { 1613 match[2] = match[4] || match[5] || ""; 1614 1615 // Strip excess characters from unquoted arguments 1616 } else if ( unquoted && rpseudo.test( unquoted ) && 1617 // Get excess from tokenize (recursively) 1618 (excess = tokenize( unquoted, true )) && 1619 // advance to the next closing parenthesis 1620 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1621 1622 // excess is a negative index 1623 match[0] = match[0].slice( 0, excess ); 1624 match[2] = unquoted.slice( 0, excess ); 1625 } 1626 1627 // Return only captures needed by the pseudo filter method (type and argument) 1628 return match.slice( 0, 3 ); 1629 } 1630 }, 1631 1632 filter: { 1633 1634 "TAG": function( nodeNameSelector ) { 1635 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1636 return nodeNameSelector === "*" ? 1637 function() { return true; } : 1638 function( elem ) { 1639 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1640 }; 1641 }, 1642 1643 "CLASS": function( className ) { 1644 var pattern = classCache[ className + " " ]; 1645 1646 return pattern || 1647 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1648 classCache( className, function( elem ) { 1649 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1650 }); 1651 }, 1652 1653 "ATTR": function( name, operator, check ) { 1654 return function( elem ) { 1655 var result = Sizzle.attr( elem, name ); 1656 1657 if ( result == null ) { 1658 return operator === "!="; 1659 } 1660 if ( !operator ) { 1661 return true; 1662 } 1663 1664 result += ""; 1665 1666 return operator === "=" ? result === check : 1667 operator === "!=" ? result !== check :
vendor: 6,854 bytes, lines 1668-1873
1668 operator === "^=" ? check && result.indexOf( check ) === 0 : 1669 operator === "*=" ? check && result.indexOf( check ) > -1 : 1670 operator === "$=" ? check && result.slice( -check.length ) === check : 1671 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1672 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1673 false; 1674 }; 1675 }, 1676 1677 "CHILD": function( type, what, argument, first, last ) { 1678 var simple = type.slice( 0, 3 ) !== "nth", 1679 forward = type.slice( -4 ) !== "last", 1680 ofType = what === "of-type"; 1681 1682 return first === 1 && last === 0 ? 1683 1684 // Shortcut for :nth-*(n) 1685 function( elem ) { 1686 return !!elem.parentNode; 1687 } : 1688 1689 function( elem, context, xml ) { 1690 var cache, outerCache, node, diff, nodeIndex, start, 1691 dir = simple !== forward ? "nextSibling" : "previousSibling", 1692 parent = elem.parentNode, 1693 name = ofType && elem.nodeName.toLowerCase(), 1694 useCache = !xml && !ofType; 1695 1696 if ( parent ) { 1697 1698 // :(first|last|only)-(child|of-type) 1699 if ( simple ) { 1700 while ( dir ) { 1701 node = elem; 1702 while ( (node = node[ dir ]) ) { 1703 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { 1704 return false; 1705 } 1706 } 1707 // Reverse direction for :only-* (if we haven't yet done so) 1708 start = dir = type === "only" && !start && "nextSibling"; 1709 } 1710 return true; 1711 } 1712 1713 start = [ forward ? parent.firstChild : parent.lastChild ]; 1714 1715 // non-xml :nth-child(...) stores cache data on `parent` 1716 if ( forward && useCache ) { 1717 // Seek `elem` from a previously-cached index 1718 outerCache = parent[ expando ] || (parent[ expando ] = {}); 1719 cache = outerCache[ type ] || []; 1720 nodeIndex = cache[0] === dirruns && cache[1]; 1721 diff = cache[0] === dirruns && cache[2]; 1722 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1723 1724 while ( (node = ++nodeIndex && node && node[ dir ] || 1725 1726 // Fallback to seeking `elem` from the start 1727 (diff = nodeIndex = 0) || start.pop()) ) { 1728 1729 // When found, cache indexes on `parent` and break 1730 if ( node.nodeType === 1 && ++diff && node === elem ) { 1731 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 1732 break; 1733 } 1734 } 1735 1736 // Use previously-cached element index if available 1737 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { 1738 diff = cache[1]; 1739 1740 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) 1741 } else { 1742 // Use the same loop as above to seek `elem` from the start 1743 while ( (node = ++nodeIndex && node && node[ dir ] || 1744 (diff = nodeIndex = 0) || start.pop()) ) { 1745 1746 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { 1747 // Cache the index of each encountered element 1748 if ( useCache ) { 1749 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; 1750 } 1751 1752 if ( node === elem ) { 1753 break; 1754 } 1755 } 1756 } 1757 } 1758 1759 // Incorporate the offset, then check against cycle size 1760 diff -= last; 1761 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1762 } 1763 }; 1764 }, 1765 1766 "PSEUDO": function( pseudo, argument ) { 1767 // pseudo-class names are case-insensitive 1768 // http://www.w3.org/TR/selectors/#pseudo-classes 1769 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1770 // Remember that setFilters inherits from pseudos 1771 var args, 1772 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1773 Sizzle.error( "unsupported pseudo: " + pseudo ); 1774 1775 // The user may use createPseudo to indicate that 1776 // arguments are needed to create the filter function 1777 // just as Sizzle does 1778 if ( fn[ expando ] ) { 1779 return fn( argument ); 1780 } 1781 1782 // But maintain support for old signatures 1783 if ( fn.length > 1 ) { 1784 args = [ pseudo, pseudo, "", argument ]; 1785 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1786 markFunction(function( seed, matches ) { 1787 var idx, 1788 matched = fn( seed, argument ), 1789 i = matched.length; 1790 while ( i-- ) { 1791 idx = indexOf( seed, matched[i] ); 1792 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1793 } 1794 }) : 1795 function( elem ) { 1796 return fn( elem, 0, args ); 1797 }; 1798 } 1799 1800 return fn; 1801 } 1802 }, 1803 1804 pseudos: { 1805 // Potentially complex pseudos 1806 "not": markFunction(function( selector ) { 1807 // Trim the selector passed to compile 1808 // to avoid treating leading and trailing 1809 // spaces as combinators 1810 var input = [], 1811 results = [], 1812 matcher = compile( selector.replace( rtrim, "$1" ) ); 1813 1814 return matcher[ expando ] ? 1815 markFunction(function( seed, matches, context, xml ) { 1816 var elem, 1817 unmatched = matcher( seed, null, xml, [] ), 1818 i = seed.length; 1819 1820 // Match elements unmatched by `matcher` 1821 while ( i-- ) { 1822 if ( (elem = unmatched[i]) ) { 1823 seed[i] = !(matches[i] = elem); 1824 } 1825 } 1826 }) : 1827 function( elem, context, xml ) { 1828 input[0] = elem; 1829 matcher( input, null, xml, results ); 1830 // Don't keep the element (issue #299) 1831 input[0] = null; 1832 return !results.pop(); 1833 }; 1834 }), 1835 1836 "has": markFunction(function( selector ) { 1837 return function( elem ) { 1838 return Sizzle( selector, elem ).length > 0; 1839 }; 1840 }), 1841 1842 "contains": markFunction(function( text ) { 1843 text = text.replace( runescape, funescape ); 1844 return function( elem ) { 1845 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 1846 }; 1847 }), 1848 1849 // "Whether an element is represented by a :lang() selector 1850 // is based solely on the element's language value 1851 // being equal to the identifier C, 1852 // or beginning with the identifier C immediately followed by "-". 1853 // The matching of C against the element's language value is performed case-insensitively. 1854 // The identifier C does not have to be a valid language name." 1855 // http://www.w3.org/TR/selectors/#lang-pseudo 1856 "lang": markFunction( function( lang ) { 1857 // lang value must be a valid identifier 1858 if ( !ridentifier.test(lang || "") ) { 1859 Sizzle.error( "unsupported lang: " + lang ); 1860 } 1861 lang = lang.replace( runescape, funescape ).toLowerCase(); 1862 return function( elem ) { 1863 var elemLang; 1864 do { 1865 if ( (elemLang = documentIsHTML ? 1866 elem.lang : 1867 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 1868 1869 elemLang = elemLang.toLowerCase(); 1870 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1871 } 1872 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 1873 return false;
vendor: 4,543 bytes, lines 1874-2045
1874 }; 1875 }), 1876 1877 // Miscellaneous 1878 "target": function( elem ) { 1879 var hash = window.location && window.location.hash; 1880 return hash && hash.slice( 1 ) === elem.id; 1881 }, 1882 1883 "root": function( elem ) { 1884 return elem === docElem; 1885 }, 1886 1887 "focus": function( elem ) { 1888 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1889 }, 1890 1891 // Boolean properties 1892 "enabled": function( elem ) { 1893 return elem.disabled === false; 1894 }, 1895 1896 "disabled": function( elem ) { 1897 return elem.disabled === true; 1898 }, 1899 1900 "checked": function( elem ) { 1901 // In CSS3, :checked should return both checked and selected elements 1902 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1903 var nodeName = elem.nodeName.toLowerCase(); 1904 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 1905 }, 1906 1907 "selected": function( elem ) { 1908 // Accessing this property makes selected-by-default 1909 // options in Safari work properly 1910 if ( elem.parentNode ) { 1911 elem.parentNode.selectedIndex; 1912 } 1913 1914 return elem.selected === true; 1915 }, 1916 1917 // Contents 1918 "empty": function( elem ) { 1919 // http://www.w3.org/TR/selectors/#empty-pseudo 1920 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1921 // but not by others (comment: 8; processing instruction: 7; etc.) 1922 // nodeType < 6 works because attributes (2) do not appear as children 1923 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1924 if ( elem.nodeType < 6 ) { 1925 return false; 1926 } 1927 } 1928 return true; 1929 }, 1930 1931 "parent": function( elem ) { 1932 return !Expr.pseudos["empty"]( elem ); 1933 }, 1934 1935 // Element/input types 1936 "header": function( elem ) { 1937 return rheader.test( elem.nodeName ); 1938 }, 1939 1940 "input": function( elem ) { 1941 return rinputs.test( elem.nodeName ); 1942 }, 1943 1944 "button": function( elem ) { 1945 var name = elem.nodeName.toLowerCase(); 1946 return name === "input" && elem.type === "button" || name === "button"; 1947 }, 1948 1949 "text": function( elem ) { 1950 var attr; 1951 return elem.nodeName.toLowerCase() === "input" && 1952 elem.type === "text" && 1953 1954 // Support: IE<8 1955 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 1956 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 1957 }, 1958 1959 // Position-in-collection 1960 "first": createPositionalPseudo(function() { 1961 return [ 0 ]; 1962 }), 1963 1964 "last": createPositionalPseudo(function( matchIndexes, length ) { 1965 return [ length - 1 ]; 1966 }), 1967 1968 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 1969 return [ argument < 0 ? argument + length : argument ]; 1970 }), 1971 1972 "even": createPositionalPseudo(function( matchIndexes, length ) { 1973 var i = 0; 1974 for ( ; i < length; i += 2 ) { 1975 matchIndexes.push( i ); 1976 } 1977 return matchIndexes; 1978 }), 1979 1980 "odd": createPositionalPseudo(function( matchIndexes, length ) { 1981 var i = 1; 1982 for ( ; i < length; i += 2 ) { 1983 matchIndexes.push( i ); 1984 } 1985 return matchIndexes; 1986 }), 1987 1988 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 1989 var i = argument < 0 ? argument + length : argument; 1990 for ( ; --i >= 0; ) { 1991 matchIndexes.push( i ); 1992 } 1993 return matchIndexes; 1994 }), 1995 1996 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 1997 var i = argument < 0 ? argument + length : argument; 1998 for ( ; ++i < length; ) { 1999 matchIndexes.push( i ); 2000 } 2001 return matchIndexes; 2002 }) 2003 } 2004}; 2005 2006Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2007 2008// Add button/input type pseudos 2009for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2010 Expr.pseudos[ i ] = createInputPseudo( i ); 2011} 2012for ( i in { submit: true, reset: true } ) { 2013 Expr.pseudos[ i ] = createButtonPseudo( i ); 2014} 2015 2016// Easy API for creating new setFilters 2017function setFilters() {} 2018setFilters.prototype = Expr.filters = Expr.pseudos; 2019Expr.setFilters = new setFilters(); 2020 2021tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2022 var matched, match, tokens, type, 2023 soFar, groups, preFilters, 2024 cached = tokenCache[ selector + " " ]; 2025 2026 if ( cached ) { 2027 return parseOnly ? 0 : cached.slice( 0 ); 2028 } 2029 2030 soFar = selector; 2031 groups = []; 2032 preFilters = Expr.preFilter; 2033 2034 while ( soFar ) { 2035 2036 // Comma and first run 2037 if ( !matched || (match = rcomma.exec( soFar )) ) { 2038 if ( match ) { 2039 // Don't consume trailing commas as valid 2040 soFar = soFar.slice( match[0].length ) || soFar; 2041 } 2042 groups.push( (tokens = []) ); 2043 } 2044 2045 matched = false;
vendor: 171,208 bytes, lines 2046-8465
2046 2047 // Combinators 2048 if ( (match = rcombinators.exec( soFar )) ) { 2049 matched = match.shift(); 2050 tokens.push({ 2051 value: matched, 2052 // Cast descendant combinators to space 2053 type: match[0].replace( rtrim, " " ) 2054 }); 2055 soFar = soFar.slice( matched.length ); 2056 } 2057 2058 // Filters 2059 for ( type in Expr.filter ) { 2060 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2061 (match = preFilters[ type ]( match ))) ) { 2062 matched = match.shift(); 2063 tokens.push({ 2064 value: matched, 2065 type: type, 2066 matches: match 2067 }); 2068 soFar = soFar.slice( matched.length ); 2069 } 2070 } 2071 2072 if ( !matched ) { 2073 break; 2074 } 2075 } 2076 2077 // Return the length of the invalid excess 2078 // if we're just parsing 2079 // Otherwise, throw an error or return tokens 2080 return parseOnly ? 2081 soFar.length : 2082 soFar ? 2083 Sizzle.error( selector ) : 2084 // Cache the tokens 2085 tokenCache( selector, groups ).slice( 0 ); 2086}; 2087 2088function toSelector( tokens ) { 2089 var i = 0, 2090 len = tokens.length, 2091 selector = ""; 2092 for ( ; i < len; i++ ) { 2093 selector += tokens[i].value; 2094 } 2095 return selector; 2096} 2097 2098function addCombinator( matcher, combinator, base ) { 2099 var dir = combinator.dir, 2100 checkNonElements = base && dir === "parentNode", 2101 doneName = done++; 2102 2103 return combinator.first ? 2104 // Check against closest ancestor/preceding element 2105 function( elem, context, xml ) { 2106 while ( (elem = elem[ dir ]) ) { 2107 if ( elem.nodeType === 1 || checkNonElements ) { 2108 return matcher( elem, context, xml ); 2109 } 2110 } 2111 } : 2112 2113 // Check against all ancestor/preceding elements 2114 function( elem, context, xml ) { 2115 var oldCache, outerCache, 2116 newCache = [ dirruns, doneName ]; 2117 2118 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching 2119 if ( xml ) { 2120 while ( (elem = elem[ dir ]) ) { 2121 if ( elem.nodeType === 1 || checkNonElements ) { 2122 if ( matcher( elem, context, xml ) ) { 2123 return true; 2124 } 2125 } 2126 } 2127 } else { 2128 while ( (elem = elem[ dir ]) ) { 2129 if ( elem.nodeType === 1 || checkNonElements ) { 2130 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2131 if ( (oldCache = outerCache[ dir ]) && 2132 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2133 2134 // Assign to newCache so results back-propagate to previous elements 2135 return (newCache[ 2 ] = oldCache[ 2 ]); 2136 } else { 2137 // Reuse newcache so results back-propagate to previous elements 2138 outerCache[ dir ] = newCache; 2139 2140 // A match means we're done; a fail means we have to keep checking 2141 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2142 return true; 2143 } 2144 } 2145 } 2146 } 2147 } 2148 }; 2149} 2150 2151function elementMatcher( matchers ) { 2152 return matchers.length > 1 ? 2153 function( elem, context, xml ) { 2154 var i = matchers.length; 2155 while ( i-- ) { 2156 if ( !matchers[i]( elem, context, xml ) ) { 2157 return false; 2158 } 2159 } 2160 return true; 2161 } : 2162 matchers[0]; 2163} 2164 2165function multipleContexts( selector, contexts, results ) { 2166 var i = 0, 2167 len = contexts.length; 2168 for ( ; i < len; i++ ) { 2169 Sizzle( selector, contexts[i], results ); 2170 } 2171 return results; 2172} 2173 2174function condense( unmatched, map, filter, context, xml ) { 2175 var elem, 2176 newUnmatched = [], 2177 i = 0, 2178 len = unmatched.length, 2179 mapped = map != null; 2180 2181 for ( ; i < len; i++ ) { 2182 if ( (elem = unmatched[i]) ) { 2183 if ( !filter || filter( elem, context, xml ) ) { 2184 newUnmatched.push( elem ); 2185 if ( mapped ) { 2186 map.push( i ); 2187 } 2188 } 2189 } 2190 } 2191 2192 return newUnmatched; 2193} 2194 2195function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2196 if ( postFilter && !postFilter[ expando ] ) { 2197 postFilter = setMatcher( postFilter ); 2198 } 2199 if ( postFinder && !postFinder[ expando ] ) { 2200 postFinder = setMatcher( postFinder, postSelector ); 2201 } 2202 return markFunction(function( seed, results, context, xml ) { 2203 var temp, i, elem, 2204 preMap = [], 2205 postMap = [], 2206 preexisting = results.length, 2207 2208 // Get initial elements from seed or context 2209 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2210 2211 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2212 matcherIn = preFilter && ( seed || !selector ) ? 2213 condense( elems, preMap, preFilter, context, xml ) : 2214 elems, 2215 2216 matcherOut = matcher ? 2217 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2218 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2219 2220 // ...intermediate processing is necessary 2221 [] : 2222 2223 // ...otherwise use results directly 2224 results : 2225 matcherIn; 2226 2227 // Find primary matches 2228 if ( matcher ) { 2229 matcher( matcherIn, matcherOut, context, xml ); 2230 } 2231 2232 // Apply postFilter 2233 if ( postFilter ) { 2234 temp = condense( matcherOut, postMap ); 2235 postFilter( temp, [], context, xml ); 2236 2237 // Un-match failing elements by moving them back to matcherIn 2238 i = temp.length; 2239 while ( i-- ) { 2240 if ( (elem = temp[i]) ) { 2241 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2242 } 2243 } 2244 } 2245 2246 if ( seed ) { 2247 if ( postFinder || preFilter ) { 2248 if ( postFinder ) { 2249 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2250 temp = []; 2251 i = matcherOut.length; 2252 while ( i-- ) { 2253 if ( (elem = matcherOut[i]) ) { 2254 // Restore matcherIn since elem is not yet a final match 2255 temp.push( (matcherIn[i] = elem) ); 2256 } 2257 } 2258 postFinder( null, (matcherOut = []), temp, xml ); 2259 } 2260 2261 // Move matched elements from seed to results to keep them synchronized 2262 i = matcherOut.length; 2263 while ( i-- ) { 2264 if ( (elem = matcherOut[i]) && 2265 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2266 2267 seed[temp] = !(results[temp] = elem); 2268 } 2269 } 2270 } 2271 2272 // Add elements to results, through postFinder if defined 2273 } else { 2274 matcherOut = condense( 2275 matcherOut === results ? 2276 matcherOut.splice( preexisting, matcherOut.length ) : 2277 matcherOut 2278 ); 2279 if ( postFinder ) { 2280 postFinder( null, results, matcherOut, xml ); 2281 } else { 2282 push.apply( results, matcherOut ); 2283 } 2284 } 2285 }); 2286} 2287 2288function matcherFromTokens( tokens ) { 2289 var checkContext, matcher, j, 2290 len = tokens.length, 2291 leadingRelative = Expr.relative[ tokens[0].type ], 2292 implicitRelative = leadingRelative || Expr.relative[" "], 2293 i = leadingRelative ? 1 : 0, 2294 2295 // The foundational matcher ensures that elements are reachable from top-level context(s) 2296 matchContext = addCombinator( function( elem ) { 2297 return elem === checkContext; 2298 }, implicitRelative, true ), 2299 matchAnyContext = addCombinator( function( elem ) { 2300 return indexOf( checkContext, elem ) > -1; 2301 }, implicitRelative, true ), 2302 matchers = [ function( elem, context, xml ) { 2303 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2304 (checkContext = context).nodeType ? 2305 matchContext( elem, context, xml ) : 2306 matchAnyContext( elem, context, xml ) ); 2307 // Avoid hanging onto element (issue #299) 2308 checkContext = null; 2309 return ret; 2310 } ]; 2311 2312 for ( ; i < len; i++ ) { 2313 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2314 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2315 } else { 2316 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2317 2318 // Return special upon seeing a positional matcher 2319 if ( matcher[ expando ] ) { 2320 // Find the next relative operator (if any) for proper handling 2321 j = ++i; 2322 for ( ; j < len; j++ ) { 2323 if ( Expr.relative[ tokens[j].type ] ) { 2324 break; 2325 } 2326 } 2327 return setMatcher( 2328 i > 1 && elementMatcher( matchers ), 2329 i > 1 && toSelector( 2330 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2331 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2332 ).replace( rtrim, "$1" ), 2333 matcher, 2334 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2335 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2336 j < len && toSelector( tokens ) 2337 ); 2338 } 2339 matchers.push( matcher ); 2340 } 2341 } 2342 2343 return elementMatcher( matchers ); 2344} 2345 2346function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2347 var bySet = setMatchers.length > 0, 2348 byElement = elementMatchers.length > 0, 2349 superMatcher = function( seed, context, xml, results, outermost ) { 2350 var elem, j, matcher, 2351 matchedCount = 0, 2352 i = "0", 2353 unmatched = seed && [], 2354 setMatched = [], 2355 contextBackup = outermostContext, 2356 // We must always have either seed elements or outermost context 2357 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2358 // Use integer dirruns iff this is the outermost matcher 2359 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2360 len = elems.length; 2361 2362 if ( outermost ) { 2363 outermostContext = context !== document && context; 2364 } 2365 2366 // Add elements passing elementMatchers directly to results 2367 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below 2368 // Support: IE<9, Safari 2369 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2370 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2371 if ( byElement && elem ) { 2372 j = 0; 2373 while ( (matcher = elementMatchers[j++]) ) { 2374 if ( matcher( elem, context, xml ) ) { 2375 results.push( elem ); 2376 break; 2377 } 2378 } 2379 if ( outermost ) { 2380 dirruns = dirrunsUnique; 2381 } 2382 } 2383 2384 // Track unmatched elements for set filters 2385 if ( bySet ) { 2386 // They will have gone through all possible matchers 2387 if ( (elem = !matcher && elem) ) { 2388 matchedCount--; 2389 } 2390 2391 // Lengthen the array for every element, matched or not 2392 if ( seed ) { 2393 unmatched.push( elem ); 2394 } 2395 } 2396 } 2397 2398 // Apply set filters to unmatched elements 2399 matchedCount += i; 2400 if ( bySet && i !== matchedCount ) { 2401 j = 0; 2402 while ( (matcher = setMatchers[j++]) ) { 2403 matcher( unmatched, setMatched, context, xml ); 2404 } 2405 2406 if ( seed ) { 2407 // Reintegrate element matches to eliminate the need for sorting 2408 if ( matchedCount > 0 ) { 2409 while ( i-- ) { 2410 if ( !(unmatched[i] || setMatched[i]) ) { 2411 setMatched[i] = pop.call( results ); 2412 } 2413 } 2414 } 2415 2416 // Discard index placeholder values to get only actual matches 2417 setMatched = condense( setMatched ); 2418 } 2419 2420 // Add matches to results 2421 push.apply( results, setMatched ); 2422 2423 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2424 if ( outermost && !seed && setMatched.length > 0 && 2425 ( matchedCount + setMatchers.length ) > 1 ) { 2426 2427 Sizzle.uniqueSort( results ); 2428 } 2429 } 2430 2431 // Override manipulation of globals by nested matchers 2432 if ( outermost ) { 2433 dirruns = dirrunsUnique; 2434 outermostContext = contextBackup; 2435 } 2436 2437 return unmatched; 2438 }; 2439 2440 return bySet ? 2441 markFunction( superMatcher ) : 2442 superMatcher; 2443} 2444 2445compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2446 var i, 2447 setMatchers = [], 2448 elementMatchers = [], 2449 cached = compilerCache[ selector + " " ]; 2450 2451 if ( !cached ) { 2452 // Generate a function of recursive functions that can be used to check each element 2453 if ( !match ) { 2454 match = tokenize( selector ); 2455 } 2456 i = match.length; 2457 while ( i-- ) { 2458 cached = matcherFromTokens( match[i] ); 2459 if ( cached[ expando ] ) { 2460 setMatchers.push( cached ); 2461 } else { 2462 elementMatchers.push( cached ); 2463 } 2464 } 2465 2466 // Cache the compiled function 2467 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2468 2469 // Save selector and tokenization 2470 cached.selector = selector; 2471 } 2472 return cached; 2473}; 2474 2475/** 2476 * A low-level selection function that works with Sizzle's compiled 2477 * selector functions 2478 * @param {String|Function} selector A selector or a pre-compiled 2479 * selector function built with Sizzle.compile 2480 * @param {Element} context 2481 * @param {Array} [results] 2482 * @param {Array} [seed] A set of elements to match against 2483 */ 2484select = Sizzle.select = function( selector, context, results, seed ) { 2485 var i, tokens, token, type, find, 2486 compiled = typeof selector === "function" && selector, 2487 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2488 2489 results = results || []; 2490 2491 // Try to minimize operations if there is no seed and only one group 2492 if ( match.length === 1 ) { 2493 2494 // Take a shortcut and set the context if the root selector is an ID 2495 tokens = match[0] = match[0].slice( 0 ); 2496 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2497 support.getById && context.nodeType === 9 && documentIsHTML && 2498 Expr.relative[ tokens[1].type ] ) { 2499 2500 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2501 if ( !context ) { 2502 return results; 2503 2504 // Precompiled matchers will still verify ancestry, so step up a level 2505 } else if ( compiled ) { 2506 context = context.parentNode; 2507 } 2508 2509 selector = selector.slice( tokens.shift().value.length ); 2510 } 2511 2512 // Fetch a seed set for right-to-left matching 2513 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2514 while ( i-- ) { 2515 token = tokens[i]; 2516 2517 // Abort if we hit a combinator 2518 if ( Expr.relative[ (type = token.type) ] ) { 2519 break; 2520 } 2521 if ( (find = Expr.find[ type ]) ) { 2522 // Search, expanding context for leading sibling combinators 2523 if ( (seed = find( 2524 token.matches[0].replace( runescape, funescape ), 2525 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2526 )) ) { 2527 2528 // If seed is empty or no tokens remain, we can return early 2529 tokens.splice( i, 1 ); 2530 selector = seed.length && toSelector( tokens ); 2531 if ( !selector ) { 2532 push.apply( results, seed ); 2533 return results; 2534 } 2535 2536 break; 2537 } 2538 } 2539 } 2540 } 2541 2542 // Compile and execute a filtering function if one is not provided 2543 // Provide `match` to avoid retokenization if we modified the selector above 2544 ( compiled || compile( selector, match ) )( 2545 seed, 2546 context, 2547 !documentIsHTML, 2548 results, 2549 rsibling.test( selector ) && testContext( context.parentNode ) || context 2550 ); 2551 return results; 2552}; 2553 2554// One-time assignments 2555 2556// Sort stability 2557support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2558 2559// Support: Chrome 14-35+ 2560// Always assume duplicates if they aren't passed to the comparison function 2561support.detectDuplicates = !!hasDuplicate; 2562 2563// Initialize against the default document 2564setDocument(); 2565 2566// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2567// Detached nodes confoundingly follow *each other* 2568support.sortDetached = assert(function( div1 ) { 2569 // Should return 1, but returns 4 (following) 2570 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 2571}); 2572 2573// Support: IE<8 2574// Prevent attribute/property "interpolation" 2575// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2576if ( !assert(function( div ) { 2577 div.innerHTML = "<a href='#'></a>"; 2578 return div.firstChild.getAttribute("href") === "#" ; 2579}) ) { 2580 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2581 if ( !isXML ) { 2582 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2583 } 2584 }); 2585} 2586 2587// Support: IE<9 2588// Use defaultValue in place of getAttribute("value") 2589if ( !support.attributes || !assert(function( div ) { 2590 div.innerHTML = "<input/>"; 2591 div.firstChild.setAttribute( "value", "" ); 2592 return div.firstChild.getAttribute( "value" ) === ""; 2593}) ) { 2594 addHandle( "value", function( elem, name, isXML ) { 2595 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2596 return elem.defaultValue; 2597 } 2598 }); 2599} 2600 2601// Support: IE<9 2602// Use getAttributeNode to fetch booleans when getAttribute lies 2603if ( !assert(function( div ) { 2604 return div.getAttribute("disabled") == null; 2605}) ) { 2606 addHandle( booleans, function( elem, name, isXML ) { 2607 var val; 2608 if ( !isXML ) { 2609 return elem[ name ] === true ? name.toLowerCase() : 2610 (val = elem.getAttributeNode( name )) && val.specified ? 2611 val.value : 2612 null; 2613 } 2614 }); 2615} 2616 2617return Sizzle; 2618 2619})( window ); 2620 2621 2622 2623jQuery.find = Sizzle; 2624jQuery.expr = Sizzle.selectors; 2625jQuery.expr[":"] = jQuery.expr.pseudos; 2626jQuery.unique = Sizzle.uniqueSort; 2627jQuery.text = Sizzle.getText; 2628jQuery.isXMLDoc = Sizzle.isXML; 2629jQuery.contains = Sizzle.contains; 2630 2631 2632 2633var rneedsContext = jQuery.expr.match.needsContext; 2634 2635var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); 2636 2637 2638 2639var risSimple = /^.[^:#\[\.,]*$/; 2640 2641// Implement the identical functionality for filter and not 2642function winnow( elements, qualifier, not ) { 2643 if ( jQuery.isFunction( qualifier ) ) { 2644 return jQuery.grep( elements, function( elem, i ) { 2645 /* jshint -W018 */ 2646 return !!qualifier.call( elem, i, elem ) !== not; 2647 }); 2648 2649 } 2650 2651 if ( qualifier.nodeType ) { 2652 return jQuery.grep( elements, function( elem ) { 2653 return ( elem === qualifier ) !== not; 2654 }); 2655 2656 } 2657 2658 if ( typeof qualifier === "string" ) { 2659 if ( risSimple.test( qualifier ) ) { 2660 return jQuery.filter( qualifier, elements, not ); 2661 } 2662 2663 qualifier = jQuery.filter( qualifier, elements ); 2664 } 2665 2666 return jQuery.grep( elements, function( elem ) { 2667 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; 2668 }); 2669} 2670 2671jQuery.filter = function( expr, elems, not ) { 2672 var elem = elems[ 0 ]; 2673 2674 if ( not ) { 2675 expr = ":not(" + expr + ")"; 2676 } 2677 2678 return elems.length === 1 && elem.nodeType === 1 ? 2679 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 2680 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2681 return elem.nodeType === 1; 2682 })); 2683}; 2684 2685jQuery.fn.extend({ 2686 find: function( selector ) { 2687 var i, 2688 len = this.length, 2689 ret = [], 2690 self = this; 2691 2692 if ( typeof selector !== "string" ) { 2693 return this.pushStack( jQuery( selector ).filter(function() { 2694 for ( i = 0; i < len; i++ ) { 2695 if ( jQuery.contains( self[ i ], this ) ) { 2696 return true; 2697 } 2698 } 2699 }) ); 2700 } 2701 2702 for ( i = 0; i < len; i++ ) { 2703 jQuery.find( selector, self[ i ], ret ); 2704 } 2705 2706 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2707 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 2708 ret.selector = this.selector ? this.selector + " " + selector : selector; 2709 return ret; 2710 }, 2711 filter: function( selector ) { 2712 return this.pushStack( winnow(this, selector || [], false) ); 2713 }, 2714 not: function( selector ) { 2715 return this.pushStack( winnow(this, selector || [], true) ); 2716 }, 2717 is: function( selector ) { 2718 return !!winnow( 2719 this, 2720 2721 // If this is a positional/relative selector, check membership in the returned set 2722 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2723 typeof selector === "string" && rneedsContext.test( selector ) ? 2724 jQuery( selector ) : 2725 selector || [], 2726 false 2727 ).length; 2728 } 2729}); 2730 2731 2732// Initialize a jQuery object 2733 2734 2735// A central reference to the root jQuery(document) 2736var rootjQuery, 2737 2738 // A simple way to check for HTML strings 2739 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2740 // Strict HTML recognition (#11290: must start with <) 2741 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2742 2743 init = jQuery.fn.init = function( selector, context ) { 2744 var match, elem; 2745 2746 // HANDLE: $(""), $(null), $(undefined), $(false) 2747 if ( !selector ) { 2748 return this; 2749 } 2750 2751 // Handle HTML strings 2752 if ( typeof selector === "string" ) { 2753 if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { 2754 // Assume that strings that start and end with <> are HTML and skip the regex check 2755 match = [ null, selector, null ]; 2756 2757 } else { 2758 match = rquickExpr.exec( selector ); 2759 } 2760 2761 // Match html or make sure no context is specified for #id 2762 if ( match && (match[1] || !context) ) { 2763 2764 // HANDLE: $(html) -> $(array) 2765 if ( match[1] ) { 2766 context = context instanceof jQuery ? context[0] : context; 2767 2768 // Option to run scripts is true for back-compat 2769 // Intentionally let the error be thrown if parseHTML is not present 2770 jQuery.merge( this, jQuery.parseHTML( 2771 match[1], 2772 context && context.nodeType ? context.ownerDocument || context : document, 2773 true 2774 ) ); 2775 2776 // HANDLE: $(html, props) 2777 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { 2778 for ( match in context ) { 2779 // Properties of context are called as methods if possible 2780 if ( jQuery.isFunction( this[ match ] ) ) { 2781 this[ match ]( context[ match ] ); 2782 2783 // ...and otherwise set as attributes 2784 } else { 2785 this.attr( match, context[ match ] ); 2786 } 2787 } 2788 } 2789 2790 return this; 2791 2792 // HANDLE: $(#id) 2793 } else { 2794 elem = document.getElementById( match[2] ); 2795 2796 // Support: Blackberry 4.6 2797 // gEBID returns nodes no longer in the document (#6963) 2798 if ( elem && elem.parentNode ) { 2799 // Inject the element directly into the jQuery object 2800 this.length = 1; 2801 this[0] = elem; 2802 } 2803 2804 this.context = document; 2805 this.selector = selector; 2806 return this; 2807 } 2808 2809 // HANDLE: $(expr, $(...)) 2810 } else if ( !context || context.jquery ) { 2811 return ( context || rootjQuery ).find( selector ); 2812 2813 // HANDLE: $(expr, context) 2814 // (which is just equivalent to: $(context).find(expr) 2815 } else { 2816 return this.constructor( context ).find( selector ); 2817 } 2818 2819 // HANDLE: $(DOMElement) 2820 } else if ( selector.nodeType ) { 2821 this.context = this[0] = selector; 2822 this.length = 1; 2823 return this; 2824 2825 // HANDLE: $(function) 2826 // Shortcut for document ready 2827 } else if ( jQuery.isFunction( selector ) ) { 2828 return typeof rootjQuery.ready !== "undefined" ? 2829 rootjQuery.ready( selector ) : 2830 // Execute immediately if ready is not present 2831 selector( jQuery ); 2832 } 2833 2834 if ( selector.selector !== undefined ) { 2835 this.selector = selector.selector; 2836 this.context = selector.context; 2837 } 2838 2839 return jQuery.makeArray( selector, this ); 2840 }; 2841 2842// Give the init function the jQuery prototype for later instantiation 2843init.prototype = jQuery.fn; 2844 2845// Initialize central reference 2846rootjQuery = jQuery( document ); 2847 2848 2849var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2850 // Methods guaranteed to produce a unique set when starting from a unique set 2851 guaranteedUnique = { 2852 children: true, 2853 contents: true, 2854 next: true, 2855 prev: true 2856 }; 2857 2858jQuery.extend({ 2859 dir: function( elem, dir, until ) { 2860 var matched = [], 2861 truncate = until !== undefined; 2862 2863 while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { 2864 if ( elem.nodeType === 1 ) { 2865 if ( truncate && jQuery( elem ).is( until ) ) { 2866 break; 2867 } 2868 matched.push( elem ); 2869 } 2870 } 2871 return matched; 2872 }, 2873 2874 sibling: function( n, elem ) { 2875 var matched = []; 2876 2877 for ( ; n; n = n.nextSibling ) { 2878 if ( n.nodeType === 1 && n !== elem ) { 2879 matched.push( n ); 2880 } 2881 } 2882 2883 return matched; 2884 } 2885}); 2886 2887jQuery.fn.extend({ 2888 has: function( target ) { 2889 var targets = jQuery( target, this ), 2890 l = targets.length; 2891 2892 return this.filter(function() { 2893 var i = 0; 2894 for ( ; i < l; i++ ) { 2895 if ( jQuery.contains( this, targets[i] ) ) { 2896 return true; 2897 } 2898 } 2899 }); 2900 }, 2901 2902 closest: function( selectors, context ) { 2903 var cur, 2904 i = 0, 2905 l = this.length, 2906 matched = [], 2907 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 2908 jQuery( selectors, context || this.context ) : 2909 0; 2910 2911 for ( ; i < l; i++ ) { 2912 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { 2913 // Always skip document fragments 2914 if ( cur.nodeType < 11 && (pos ? 2915 pos.index(cur) > -1 : 2916 2917 // Don't pass non-elements to Sizzle 2918 cur.nodeType === 1 && 2919 jQuery.find.matchesSelector(cur, selectors)) ) { 2920 2921 matched.push( cur ); 2922 break; 2923 } 2924 } 2925 } 2926 2927 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); 2928 }, 2929 2930 // Determine the position of an element within the set 2931 index: function( elem ) { 2932 2933 // No argument, return index in parent 2934 if ( !elem ) { 2935 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 2936 } 2937 2938 // Index in selector 2939 if ( typeof elem === "string" ) { 2940 return indexOf.call( jQuery( elem ), this[ 0 ] ); 2941 } 2942 2943 // Locate the position of the desired element 2944 return indexOf.call( this, 2945 2946 // If it receives a jQuery object, the first element is used 2947 elem.jquery ? elem[ 0 ] : elem 2948 ); 2949 }, 2950 2951 add: function( selector, context ) { 2952 return this.pushStack( 2953 jQuery.unique( 2954 jQuery.merge( this.get(), jQuery( selector, context ) ) 2955 ) 2956 ); 2957 }, 2958 2959 addBack: function( selector ) { 2960 return this.add( selector == null ? 2961 this.prevObject : this.prevObject.filter(selector) 2962 ); 2963 } 2964}); 2965 2966function sibling( cur, dir ) { 2967 while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} 2968 return cur; 2969} 2970 2971jQuery.each({ 2972 parent: function( elem ) { 2973 var parent = elem.parentNode; 2974 return parent && parent.nodeType !== 11 ? parent : null; 2975 }, 2976 parents: function( elem ) { 2977 return jQuery.dir( elem, "parentNode" ); 2978 }, 2979 parentsUntil: function( elem, i, until ) { 2980 return jQuery.dir( elem, "parentNode", until ); 2981 }, 2982 next: function( elem ) { 2983 return sibling( elem, "nextSibling" ); 2984 }, 2985 prev: function( elem ) { 2986 return sibling( elem, "previousSibling" ); 2987 }, 2988 nextAll: function( elem ) { 2989 return jQuery.dir( elem, "nextSibling" ); 2990 }, 2991 prevAll: function( elem ) { 2992 return jQuery.dir( elem, "previousSibling" ); 2993 }, 2994 nextUntil: function( elem, i, until ) { 2995 return jQuery.dir( elem, "nextSibling", until ); 2996 }, 2997 prevUntil: function( elem, i, until ) { 2998 return jQuery.dir( elem, "previousSibling", until ); 2999 }, 3000 siblings: function( elem ) { 3001 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); 3002 }, 3003 children: function( elem ) { 3004 return jQuery.sibling( elem.firstChild ); 3005 }, 3006 contents: function( elem ) { 3007 return elem.contentDocument || jQuery.merge( [], elem.childNodes ); 3008 } 3009}, function( name, fn ) { 3010 jQuery.fn[ name ] = function( until, selector ) { 3011 var matched = jQuery.map( this, fn, until ); 3012 3013 if ( name.slice( -5 ) !== "Until" ) { 3014 selector = until; 3015 } 3016 3017 if ( selector && typeof selector === "string" ) { 3018 matched = jQuery.filter( selector, matched ); 3019 } 3020 3021 if ( this.length > 1 ) { 3022 // Remove duplicates 3023 if ( !guaranteedUnique[ name ] ) { 3024 jQuery.unique( matched ); 3025 } 3026 3027 // Reverse order for parents* and prev-derivatives 3028 if ( rparentsprev.test( name ) ) { 3029 matched.reverse(); 3030 } 3031 } 3032 3033 return this.pushStack( matched ); 3034 }; 3035}); 3036var rnotwhite = (/\S+/g); 3037 3038 3039 3040// String to Object options format cache 3041var optionsCache = {}; 3042 3043// Convert String-formatted options into Object-formatted ones and store in cache 3044function createOptions( options ) { 3045 var object = optionsCache[ options ] = {}; 3046 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 3047 object[ flag ] = true; 3048 }); 3049 return object; 3050} 3051 3052/* 3053 * Create a callback list using the following parameters: 3054 * 3055 * options: an optional list of space-separated options that will change how 3056 * the callback list behaves or a more traditional option object 3057 * 3058 * By default a callback list will act like an event callback list and can be 3059 * "fired" multiple times. 3060 * 3061 * Possible options: 3062 * 3063 * once: will ensure the callback list can only be fired once (like a Deferred) 3064 * 3065 * memory: will keep track of previous values and will call any callback added 3066 * after the list has been fired right away with the latest "memorized" 3067 * values (like a Deferred) 3068 * 3069 * unique: will ensure a callback can only be added once (no duplicate in the list) 3070 * 3071 * stopOnFalse: interrupt callings when a callback returns false 3072 * 3073 */ 3074jQuery.Callbacks = function( options ) { 3075 3076 // Convert options from String-formatted to Object-formatted if needed 3077 // (we check in cache first) 3078 options = typeof options === "string" ? 3079 ( optionsCache[ options ] || createOptions( options ) ) : 3080 jQuery.extend( {}, options ); 3081 3082 var // Last fire value (for non-forgettable lists) 3083 memory, 3084 // Flag to know if list was already fired 3085 fired, 3086 // Flag to know if list is currently firing 3087 firing, 3088 // First callback to fire (used internally by add and fireWith) 3089 firingStart, 3090 // End of the loop when firing 3091 firingLength, 3092 // Index of currently firing callback (modified by remove if needed) 3093 firingIndex, 3094 // Actual callback list 3095 list = [], 3096 // Stack of fire calls for repeatable lists 3097 stack = !options.once && [], 3098 // Fire callbacks 3099 fire = function( data ) { 3100 memory = options.memory && data; 3101 fired = true; 3102 firingIndex = firingStart || 0; 3103 firingStart = 0; 3104 firingLength = list.length; 3105 firing = true; 3106 for ( ; list && firingIndex < firingLength; firingIndex++ ) { 3107 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { 3108 memory = false; // To prevent further calls using add 3109 break; 3110 } 3111 } 3112 firing = false; 3113 if ( list ) { 3114 if ( stack ) { 3115 if ( stack.length ) { 3116 fire( stack.shift() ); 3117 } 3118 } else if ( memory ) { 3119 list = []; 3120 } else { 3121 self.disable(); 3122 } 3123 } 3124 }, 3125 // Actual Callbacks object 3126 self = { 3127 // Add a callback or a collection of callbacks to the list 3128 add: function() { 3129 if ( list ) { 3130 // First, we save the current length 3131 var start = list.length; 3132 (function add( args ) { 3133 jQuery.each( args, function( _, arg ) { 3134 var type = jQuery.type( arg ); 3135 if ( type === "function" ) { 3136 if ( !options.unique || !self.has( arg ) ) { 3137 list.push( arg ); 3138 } 3139 } else if ( arg && arg.length && type !== "string" ) { 3140 // Inspect recursively 3141 add( arg ); 3142 } 3143 }); 3144 })( arguments ); 3145 // Do we need to add the callbacks to the 3146 // current firing batch? 3147 if ( firing ) { 3148 firingLength = list.length; 3149 // With memory, if we're not firing then 3150 // we should call right away 3151 } else if ( memory ) { 3152 firingStart = start; 3153 fire( memory ); 3154 } 3155 } 3156 return this; 3157 }, 3158 // Remove a callback from the list 3159 remove: function() { 3160 if ( list ) { 3161 jQuery.each( arguments, function( _, arg ) { 3162 var index; 3163 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3164 list.splice( index, 1 ); 3165 // Handle firing indexes 3166 if ( firing ) { 3167 if ( index <= firingLength ) { 3168 firingLength--; 3169 } 3170 if ( index <= firingIndex ) { 3171 firingIndex--; 3172 } 3173 } 3174 } 3175 }); 3176 } 3177 return this; 3178 }, 3179 // Check if a given callback is in the list. 3180 // If no argument is given, return whether or not list has callbacks attached. 3181 has: function( fn ) { 3182 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); 3183 }, 3184 // Remove all callbacks from the list 3185 empty: function() { 3186 list = []; 3187 firingLength = 0; 3188 return this; 3189 }, 3190 // Have the list do nothing anymore 3191 disable: function() { 3192 list = stack = memory = undefined; 3193 return this; 3194 }, 3195 // Is it disabled? 3196 disabled: function() { 3197 return !list; 3198 }, 3199 // Lock the list in its current state 3200 lock: function() { 3201 stack = undefined; 3202 if ( !memory ) { 3203 self.disable(); 3204 } 3205 return this; 3206 }, 3207 // Is it locked? 3208 locked: function() { 3209 return !stack; 3210 }, 3211 // Call all callbacks with the given context and arguments 3212 fireWith: function( context, args ) { 3213 if ( list && ( !fired || stack ) ) { 3214 args = args || []; 3215 args = [ context, args.slice ? args.slice() : args ]; 3216 if ( firing ) { 3217 stack.push( args ); 3218 } else { 3219 fire( args ); 3220 } 3221 } 3222 return this; 3223 }, 3224 // Call all the callbacks with the given arguments 3225 fire: function() { 3226 self.fireWith( this, arguments ); 3227 return this; 3228 }, 3229 // To know if the callbacks have already been called at least once 3230 fired: function() { 3231 return !!fired; 3232 } 3233 }; 3234 3235 return self; 3236}; 3237 3238 3239jQuery.extend({ 3240 3241 Deferred: function( func ) { 3242 var tuples = [ 3243 // action, add listener, listener list, final state 3244 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], 3245 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], 3246 [ "notify", "progress", jQuery.Callbacks("memory") ] 3247 ], 3248 state = "pending", 3249 promise = { 3250 state: function() { 3251 return state; 3252 }, 3253 always: function() { 3254 deferred.done( arguments ).fail( arguments ); 3255 return this; 3256 }, 3257 then: function( /* fnDone, fnFail, fnProgress */ ) { 3258 var fns = arguments; 3259 return jQuery.Deferred(function( newDefer ) { 3260 jQuery.each( tuples, function( i, tuple ) { 3261 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 3262 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3263 deferred[ tuple[1] ](function() { 3264 var returned = fn && fn.apply( this, arguments ); 3265 if ( returned && jQuery.isFunction( returned.promise ) ) { 3266 returned.promise() 3267 .done( newDefer.resolve ) 3268 .fail( newDefer.reject ) 3269 .progress( newDefer.notify ); 3270 } else { 3271 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); 3272 } 3273 }); 3274 }); 3275 fns = null; 3276 }).promise(); 3277 }, 3278 // Get a promise for this deferred 3279 // If obj is provided, the promise aspect is added to the object 3280 promise: function( obj ) { 3281 return obj != null ? jQuery.extend( obj, promise ) : promise; 3282 } 3283 }, 3284 deferred = {}; 3285 3286 // Keep pipe for back-compat 3287 promise.pipe = promise.then; 3288 3289 // Add list-specific methods 3290 jQuery.each( tuples, function( i, tuple ) { 3291 var list = tuple[ 2 ], 3292 stateString = tuple[ 3 ]; 3293 3294 // promise[ done | fail | progress ] = list.add 3295 promise[ tuple[1] ] = list.add; 3296 3297 // Handle state 3298 if ( stateString ) { 3299 list.add(function() { 3300 // state = [ resolved | rejected ] 3301 state = stateString; 3302 3303 // [ reject_list | resolve_list ].disable; progress_list.lock 3304 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 3305 } 3306 3307 // deferred[ resolve | reject | notify ] 3308 deferred[ tuple[0] ] = function() { 3309 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); 3310 return this; 3311 }; 3312 deferred[ tuple[0] + "With" ] = list.fireWith; 3313 }); 3314 3315 // Make the deferred a promise 3316 promise.promise( deferred ); 3317 3318 // Call given func if any 3319 if ( func ) { 3320 func.call( deferred, deferred ); 3321 } 3322 3323 // All done! 3324 return deferred; 3325 }, 3326 3327 // Deferred helper 3328 when: function( subordinate /* , ..., subordinateN */ ) { 3329 var i = 0, 3330 resolveValues = slice.call( arguments ), 3331 length = resolveValues.length, 3332 3333 // the count of uncompleted subordinates 3334 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 3335 3336 // the master Deferred. If resolveValues consist of only a single Deferred, just use that. 3337 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3338 3339 // Update function for both resolve and progress values 3340 updateFunc = function( i, contexts, values ) { 3341 return function( value ) { 3342 contexts[ i ] = this; 3343 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3344 if ( values === progressValues ) { 3345 deferred.notifyWith( contexts, values ); 3346 } else if ( !( --remaining ) ) { 3347 deferred.resolveWith( contexts, values ); 3348 } 3349 }; 3350 }, 3351 3352 progressValues, progressContexts, resolveContexts; 3353 3354 // Add listeners to Deferred subordinates; treat others as resolved 3355 if ( length > 1 ) { 3356 progressValues = new Array( length ); 3357 progressContexts = new Array( length ); 3358 resolveContexts = new Array( length ); 3359 for ( ; i < length; i++ ) { 3360 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 3361 resolveValues[ i ].promise() 3362 .done( updateFunc( i, resolveContexts, resolveValues ) ) 3363 .fail( deferred.reject ) 3364 .progress( updateFunc( i, progressContexts, progressValues ) ); 3365 } else { 3366 --remaining; 3367 } 3368 } 3369 } 3370 3371 // If we're not waiting on anything, resolve the master 3372 if ( !remaining ) { 3373 deferred.resolveWith( resolveContexts, resolveValues ); 3374 } 3375 3376 return deferred.promise(); 3377 } 3378}); 3379 3380 3381// The deferred used on DOM ready 3382var readyList; 3383 3384jQuery.fn.ready = function( fn ) { 3385 // Add the callback 3386 jQuery.ready.promise().done( fn ); 3387 3388 return this; 3389}; 3390 3391jQuery.extend({ 3392 // Is the DOM ready to be used? Set to true once it occurs. 3393 isReady: false, 3394 3395 // A counter to track how many items to wait for before 3396 // the ready event fires. See #6781 3397 readyWait: 1, 3398 3399 // Hold (or release) the ready event 3400 holdReady: function( hold ) { 3401 if ( hold ) { 3402 jQuery.readyWait++; 3403 } else { 3404 jQuery.ready( true ); 3405 } 3406 }, 3407 3408 // Handle when the DOM is ready 3409 ready: function( wait ) { 3410 3411 // Abort if there are pending holds or we're already ready 3412 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3413 return; 3414 } 3415 3416 // Remember that the DOM is ready 3417 jQuery.isReady = true; 3418 3419 // If a normal DOM Ready event fired, decrement, and wait if need be 3420 if ( wait !== true && --jQuery.readyWait > 0 ) { 3421 return; 3422 } 3423 3424 // If there are functions bound, to execute 3425 readyList.resolveWith( document, [ jQuery ] ); 3426 3427 // Trigger any bound ready events 3428 if ( jQuery.fn.triggerHandler ) { 3429 jQuery( document ).triggerHandler( "ready" ); 3430 jQuery( document ).off( "ready" ); 3431 } 3432 } 3433}); 3434 3435/** 3436 * The ready event handler and self cleanup method 3437 */ 3438function completed() { 3439 document.removeEventListener( "DOMContentLoaded", completed, false ); 3440 window.removeEventListener( "load", completed, false ); 3441 jQuery.ready(); 3442} 3443 3444jQuery.ready.promise = function( obj ) { 3445 if ( !readyList ) { 3446 3447 readyList = jQuery.Deferred(); 3448 3449 // Catch cases where $(document).ready() is called after the browser event has already occurred. 3450 // We once tried to use readyState "interactive" here, but it caused issues like the one 3451 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 3452 if ( document.readyState === "complete" ) { 3453 // Handle it asynchronously to allow scripts the opportunity to delay ready 3454 setTimeout( jQuery.ready ); 3455 3456 } else { 3457 3458 // Use the handy event callback 3459 document.addEventListener( "DOMContentLoaded", completed, false ); 3460 3461 // A fallback to window.onload, that will always work 3462 window.addEventListener( "load", completed, false ); 3463 } 3464 } 3465 return readyList.promise( obj ); 3466}; 3467 3468// Kick off the DOM ready check even if the user does not 3469jQuery.ready.promise(); 3470 3471 3472 3473 3474// Multifunctional method to get and set values of a collection 3475// The value/s can optionally be executed if it's a function 3476var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 3477 var i = 0, 3478 len = elems.length, 3479 bulk = key == null; 3480 3481 // Sets many values 3482 if ( jQuery.type( key ) === "object" ) { 3483 chainable = true; 3484 for ( i in key ) { 3485 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); 3486 } 3487 3488 // Sets one value 3489 } else if ( value !== undefined ) { 3490 chainable = true; 3491 3492 if ( !jQuery.isFunction( value ) ) { 3493 raw = true; 3494 } 3495 3496 if ( bulk ) { 3497 // Bulk operations run against the entire set 3498 if ( raw ) { 3499 fn.call( elems, value ); 3500 fn = null; 3501 3502 // ...except when executing function values 3503 } else { 3504 bulk = fn; 3505 fn = function( elem, key, value ) { 3506 return bulk.call( jQuery( elem ), value ); 3507 }; 3508 } 3509 } 3510 3511 if ( fn ) { 3512 for ( ; i < len; i++ ) { 3513 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 3514 } 3515 } 3516 } 3517 3518 return chainable ? 3519 elems : 3520 3521 // Gets 3522 bulk ? 3523 fn.call( elems ) : 3524 len ? fn( elems[0], key ) : emptyGet; 3525}; 3526 3527 3528/** 3529 * Determines whether an object can have data 3530 */ 3531jQuery.acceptData = function( owner ) { 3532 // Accepts only: 3533 // - Node 3534 // - Node.ELEMENT_NODE 3535 // - Node.DOCUMENT_NODE 3536 // - Object 3537 // - Any 3538 /* jshint -W018 */ 3539 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 3540}; 3541 3542 3543function Data() { 3544 // Support: Android<4, 3545 // Old WebKit does not have Object.preventExtensions/freeze method, 3546 // return new empty object instead with no [[set]] accessor 3547 Object.defineProperty( this.cache = {}, 0, { 3548 get: function() { 3549 return {}; 3550 } 3551 }); 3552 3553 this.expando = jQuery.expando + Data.uid++; 3554} 3555 3556Data.uid = 1; 3557Data.accepts = jQuery.acceptData; 3558 3559Data.prototype = { 3560 key: function( owner ) { 3561 // We can accept data for non-element nodes in modern browsers, 3562 // but we should not, see #8335. 3563 // Always return the key for a frozen object. 3564 if ( !Data.accepts( owner ) ) { 3565 return 0; 3566 } 3567 3568 var descriptor = {}, 3569 // Check if the owner object already has a cache key 3570 unlock = owner[ this.expando ]; 3571 3572 // If not, create one 3573 if ( !unlock ) { 3574 unlock = Data.uid++; 3575 3576 // Secure it in a non-enumerable, non-writable property 3577 try { 3578 descriptor[ this.expando ] = { value: unlock }; 3579 Object.defineProperties( owner, descriptor ); 3580 3581 // Support: Android<4 3582 // Fallback to a less secure definition 3583 } catch ( e ) { 3584 descriptor[ this.expando ] = unlock; 3585 jQuery.extend( owner, descriptor ); 3586 } 3587 } 3588 3589 // Ensure the cache object 3590 if ( !this.cache[ unlock ] ) { 3591 this.cache[ unlock ] = {}; 3592 } 3593 3594 return unlock; 3595 }, 3596 set: function( owner, data, value ) { 3597 var prop, 3598 // There may be an unlock assigned to this node, 3599 // if there is no entry for this "owner", create one inline 3600 // and set the unlock as though an owner entry had always existed 3601 unlock = this.key( owner ), 3602 cache = this.cache[ unlock ]; 3603 3604 // Handle: [ owner, key, value ] args 3605 if ( typeof data === "string" ) { 3606 cache[ data ] = value; 3607 3608 // Handle: [ owner, { properties } ] args 3609 } else { 3610 // Fresh assignments by object are shallow copied 3611 if ( jQuery.isEmptyObject( cache ) ) { 3612 jQuery.extend( this.cache[ unlock ], data ); 3613 // Otherwise, copy the properties one-by-one to the cache object 3614 } else { 3615 for ( prop in data ) { 3616 cache[ prop ] = data[ prop ]; 3617 } 3618 } 3619 } 3620 return cache; 3621 }, 3622 get: function( owner, key ) { 3623 // Either a valid cache is found, or will be created. 3624 // New caches will be created and the unlock returned, 3625 // allowing direct access to the newly created 3626 // empty data object. A valid owner object must be provided. 3627 var cache = this.cache[ this.key( owner ) ]; 3628 3629 return key === undefined ? 3630 cache : cache[ key ]; 3631 }, 3632 access: function( owner, key, value ) { 3633 var stored; 3634 // In cases where either: 3635 // 3636 // 1. No key was specified 3637 // 2. A string key was specified, but no value provided 3638 // 3639 // Take the "read" path and allow the get method to determine 3640 // which value to return, respectively either: 3641 // 3642 // 1. The entire cache object 3643 // 2. The data stored at the key 3644 // 3645 if ( key === undefined || 3646 ((key && typeof key === "string") && value === undefined) ) { 3647 3648 stored = this.get( owner, key ); 3649 3650 return stored !== undefined ? 3651 stored : this.get( owner, jQuery.camelCase(key) ); 3652 } 3653 3654 // [*]When the key is not a string, or both a key and value 3655 // are specified, set or extend (existing objects) with either: 3656 // 3657 // 1. An object of properties 3658 // 2. A key and value 3659 // 3660 this.set( owner, key, value ); 3661 3662 // Since the "set" path can have two possible entry points 3663 // return the expected data based on which path was taken[*] 3664 return value !== undefined ? value : key; 3665 }, 3666 remove: function( owner, key ) { 3667 var i, name, camel, 3668 unlock = this.key( owner ), 3669 cache = this.cache[ unlock ]; 3670 3671 if ( key === undefined ) { 3672 this.cache[ unlock ] = {}; 3673 3674 } else { 3675 // Support array or space separated string of keys 3676 if ( jQuery.isArray( key ) ) { 3677 // If "name" is an array of keys... 3678 // When data is initially created, via ("key", "val") signature, 3679 // keys will be converted to camelCase. 3680 // Since there is no way to tell _how_ a key was added, remove 3681 // both plain key and camelCase key. #12786 3682 // This will only penalize the array argument path. 3683 name = key.concat( key.map( jQuery.camelCase ) ); 3684 } else { 3685 camel = jQuery.camelCase( key ); 3686 // Try the string as a key before any manipulation 3687 if ( key in cache ) { 3688 name = [ key, camel ]; 3689 } else { 3690 // If a key with the spaces exists, use it. 3691 // Otherwise, create an array by matching non-whitespace 3692 name = camel; 3693 name = name in cache ? 3694 [ name ] : ( name.match( rnotwhite ) || [] ); 3695 } 3696 } 3697 3698 i = name.length; 3699 while ( i-- ) { 3700 delete cache[ name[ i ] ]; 3701 } 3702 } 3703 }, 3704 hasData: function( owner ) { 3705 return !jQuery.isEmptyObject( 3706 this.cache[ owner[ this.expando ] ] || {} 3707 ); 3708 }, 3709 discard: function( owner ) { 3710 if ( owner[ this.expando ] ) { 3711 delete this.cache[ owner[ this.expando ] ]; 3712 } 3713 } 3714}; 3715var data_priv = new Data(); 3716 3717var data_user = new Data(); 3718 3719 3720 3721// Implementation Summary 3722// 3723// 1. Enforce API surface and semantic compatibility with 1.9.x branch 3724// 2. Improve the module's maintainability by reducing the storage 3725// paths to a single mechanism. 3726// 3. Use the same single mechanism to support "private" and "user" data. 3727// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 3728// 5. Avoid exposing implementation details on user objects (eg. expando properties) 3729// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 3730 3731var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3732 rmultiDash = /([A-Z])/g; 3733 3734function dataAttr( elem, key, data ) { 3735 var name; 3736 3737 // If nothing was found internally, try to fetch any 3738 // data from the HTML5 data-* attribute 3739 if ( data === undefined && elem.nodeType === 1 ) { 3740 name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 3741 data = elem.getAttribute( name ); 3742 3743 if ( typeof data === "string" ) { 3744 try { 3745 data = data === "true" ? true : 3746 data === "false" ? false : 3747 data === "null" ? null : 3748 // Only convert to a number if it doesn't change the string 3749 +data + "" === data ? +data : 3750 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3751 data; 3752 } catch( e ) {} 3753 3754 // Make sure we set the data so it isn't changed later 3755 data_user.set( elem, key, data ); 3756 } else { 3757 data = undefined; 3758 } 3759 } 3760 return data; 3761} 3762 3763jQuery.extend({ 3764 hasData: function( elem ) { 3765 return data_user.hasData( elem ) || data_priv.hasData( elem ); 3766 }, 3767 3768 data: function( elem, name, data ) { 3769 return data_user.access( elem, name, data ); 3770 }, 3771 3772 removeData: function( elem, name ) { 3773 data_user.remove( elem, name ); 3774 }, 3775 3776 // TODO: Now that all calls to _data and _removeData have been replaced 3777 // with direct calls to data_priv methods, these can be deprecated. 3778 _data: function( elem, name, data ) { 3779 return data_priv.access( elem, name, data ); 3780 }, 3781 3782 _removeData: function( elem, name ) { 3783 data_priv.remove( elem, name ); 3784 } 3785}); 3786 3787jQuery.fn.extend({ 3788 data: function( key, value ) { 3789 var i, name, data, 3790 elem = this[ 0 ], 3791 attrs = elem && elem.attributes; 3792 3793 // Gets all values 3794 if ( key === undefined ) { 3795 if ( this.length ) { 3796 data = data_user.get( elem ); 3797 3798 if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { 3799 i = attrs.length; 3800 while ( i-- ) { 3801 3802 // Support: IE11+ 3803 // The attrs elements can be null (#14894) 3804 if ( attrs[ i ] ) { 3805 name = attrs[ i ].name; 3806 if ( name.indexOf( "data-" ) === 0 ) { 3807 name = jQuery.camelCase( name.slice(5) ); 3808 dataAttr( elem, name, data[ name ] ); 3809 } 3810 } 3811 } 3812 data_priv.set( elem, "hasDataAttrs", true ); 3813 } 3814 } 3815 3816 return data; 3817 } 3818 3819 // Sets multiple values 3820 if ( typeof key === "object" ) { 3821 return this.each(function() { 3822 data_user.set( this, key ); 3823 }); 3824 } 3825 3826 return access( this, function( value ) { 3827 var data, 3828 camelKey = jQuery.camelCase( key ); 3829 3830 // The calling jQuery object (element matches) is not empty 3831 // (and therefore has an element appears at this[ 0 ]) and the 3832 // `value` parameter was not undefined. An empty jQuery object 3833 // will result in `undefined` for elem = this[ 0 ] which will 3834 // throw an exception if an attempt to read a data cache is made. 3835 if ( elem && value === undefined ) { 3836 // Attempt to get data from the cache 3837 // with the key as-is 3838 data = data_user.get( elem, key ); 3839 if ( data !== undefined ) { 3840 return data; 3841 } 3842 3843 // Attempt to get data from the cache 3844 // with the key camelized 3845 data = data_user.get( elem, camelKey ); 3846 if ( data !== undefined ) { 3847 return data; 3848 } 3849 3850 // Attempt to "discover" the data in 3851 // HTML5 custom data-* attrs 3852 data = dataAttr( elem, camelKey, undefined ); 3853 if ( data !== undefined ) { 3854 return data; 3855 } 3856 3857 // We tried really hard, but the data doesn't exist. 3858 return; 3859 } 3860 3861 // Set the data... 3862 this.each(function() { 3863 // First, attempt to store a copy or reference of any 3864 // data that might've been store with a camelCased key. 3865 var data = data_user.get( this, camelKey ); 3866 3867 // For HTML5 data-* attribute interop, we have to 3868 // store property names with dashes in a camelCase form. 3869 // This might not apply to all properties...* 3870 data_user.set( this, camelKey, value ); 3871 3872 // *... In the case of properties that might _actually_ 3873 // have dashes, we need to also store a copy of that 3874 // unchanged property. 3875 if ( key.indexOf("-") !== -1 && data !== undefined ) { 3876 data_user.set( this, key, value ); 3877 } 3878 }); 3879 }, null, value, arguments.length > 1, null, true ); 3880 }, 3881 3882 removeData: function( key ) { 3883 return this.each(function() { 3884 data_user.remove( this, key ); 3885 }); 3886 } 3887}); 3888 3889 3890jQuery.extend({ 3891 queue: function( elem, type, data ) { 3892 var queue; 3893 3894 if ( elem ) { 3895 type = ( type || "fx" ) + "queue"; 3896 queue = data_priv.get( elem, type ); 3897 3898 // Speed up dequeue by getting out quickly if this is just a lookup 3899 if ( data ) { 3900 if ( !queue || jQuery.isArray( data ) ) { 3901 queue = data_priv.access( elem, type, jQuery.makeArray(data) ); 3902 } else { 3903 queue.push( data ); 3904 } 3905 } 3906 return queue || []; 3907 } 3908 }, 3909 3910 dequeue: function( elem, type ) { 3911 type = type || "fx"; 3912 3913 var queue = jQuery.queue( elem, type ), 3914 startLength = queue.length, 3915 fn = queue.shift(), 3916 hooks = jQuery._queueHooks( elem, type ), 3917 next = function() { 3918 jQuery.dequeue( elem, type ); 3919 }; 3920 3921 // If the fx queue is dequeued, always remove the progress sentinel 3922 if ( fn === "inprogress" ) { 3923 fn = queue.shift(); 3924 startLength--; 3925 } 3926 3927 if ( fn ) { 3928 3929 // Add a progress sentinel to prevent the fx queue from being 3930 // automatically dequeued 3931 if ( type === "fx" ) { 3932 queue.unshift( "inprogress" ); 3933 } 3934 3935 // Clear up the last queue stop function 3936 delete hooks.stop; 3937 fn.call( elem, next, hooks ); 3938 } 3939 3940 if ( !startLength && hooks ) { 3941 hooks.empty.fire(); 3942 } 3943 }, 3944 3945 // Not public - generate a queueHooks object, or return the current one 3946 _queueHooks: function( elem, type ) { 3947 var key = type + "queueHooks"; 3948 return data_priv.get( elem, key ) || data_priv.access( elem, key, { 3949 empty: jQuery.Callbacks("once memory").add(function() { 3950 data_priv.remove( elem, [ type + "queue", key ] ); 3951 }) 3952 }); 3953 } 3954}); 3955 3956jQuery.fn.extend({ 3957 queue: function( type, data ) { 3958 var setter = 2; 3959 3960 if ( typeof type !== "string" ) { 3961 data = type; 3962 type = "fx"; 3963 setter--; 3964 } 3965 3966 if ( arguments.length < setter ) { 3967 return jQuery.queue( this[0], type ); 3968 } 3969 3970 return data === undefined ? 3971 this : 3972 this.each(function() { 3973 var queue = jQuery.queue( this, type, data ); 3974 3975 // Ensure a hooks for this queue 3976 jQuery._queueHooks( this, type ); 3977 3978 if ( type === "fx" && queue[0] !== "inprogress" ) { 3979 jQuery.dequeue( this, type ); 3980 } 3981 }); 3982 }, 3983 dequeue: function( type ) { 3984 return this.each(function() { 3985 jQuery.dequeue( this, type ); 3986 }); 3987 }, 3988 clearQueue: function( type ) { 3989 return this.queue( type || "fx", [] ); 3990 }, 3991 // Get a promise resolved when queues of a certain type 3992 // are emptied (fx is the type by default) 3993 promise: function( type, obj ) { 3994 var tmp, 3995 count = 1, 3996 defer = jQuery.Deferred(), 3997 elements = this, 3998 i = this.length, 3999 resolve = function() { 4000 if ( !( --count ) ) { 4001 defer.resolveWith( elements, [ elements ] ); 4002 } 4003 }; 4004 4005 if ( typeof type !== "string" ) { 4006 obj = type; 4007 type = undefined; 4008 } 4009 type = type || "fx"; 4010 4011 while ( i-- ) { 4012 tmp = data_priv.get( elements[ i ], type + "queueHooks" ); 4013 if ( tmp && tmp.empty ) { 4014 count++; 4015 tmp.empty.add( resolve ); 4016 } 4017 } 4018 resolve(); 4019 return defer.promise( obj ); 4020 } 4021}); 4022var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 4023 4024var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4025 4026var isHidden = function( elem, el ) { 4027 // isHidden might be called from jQuery#filter function; 4028 // in that case, element will be second argument 4029 elem = el || elem; 4030 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); 4031 }; 4032 4033var rcheckableType = (/^(?:checkbox|radio)$/i); 4034 4035 4036 4037(function() { 4038 var fragment = document.createDocumentFragment(), 4039 div = fragment.appendChild( document.createElement( "div" ) ), 4040 input = document.createElement( "input" ); 4041 4042 // Support: Safari<=5.1 4043 // Check state lost if the name is set (#11217) 4044 // Support: Windows Web Apps (WWA) 4045 // `name` and `type` must use .setAttribute for WWA (#14901) 4046 input.setAttribute( "type", "radio" ); 4047 input.setAttribute( "checked", "checked" ); 4048 input.setAttribute( "name", "t" ); 4049 4050 div.appendChild( input ); 4051 4052 // Support: Safari<=5.1, Android<4.2 4053 // Older WebKit doesn't clone checked state correctly in fragments 4054 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4055 4056 // Support: IE<=11+ 4057 // Make sure textarea (and checkbox) defaultValue is properly cloned 4058 div.innerHTML = "<textarea>x</textarea>"; 4059 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4060})(); 4061var strundefined = typeof undefined; 4062 4063 4064 4065support.focusinBubbles = "onfocusin" in window; 4066 4067 4068var 4069 rkeyEvent = /^key/, 4070 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, 4071 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 4072 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; 4073 4074function returnTrue() { 4075 return true; 4076} 4077 4078function returnFalse() { 4079 return false; 4080} 4081 4082function safeActiveElement() { 4083 try { 4084 return document.activeElement; 4085 } catch ( err ) { } 4086} 4087 4088/* 4089 * Helper functions for managing events -- not part of the public interface. 4090 * Props to Dean Edwards' addEvent library for many of the ideas. 4091 */ 4092jQuery.event = { 4093 4094 global: {}, 4095 4096 add: function( elem, types, handler, data, selector ) { 4097 4098 var handleObjIn, eventHandle, tmp, 4099 events, t, handleObj, 4100 special, handlers, type, namespaces, origType, 4101 elemData = data_priv.get( elem ); 4102 4103 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4104 if ( !elemData ) { 4105 return; 4106 } 4107 4108 // Caller can pass in an object of custom data in lieu of the handler 4109 if ( handler.handler ) { 4110 handleObjIn = handler; 4111 handler = handleObjIn.handler; 4112 selector = handleObjIn.selector; 4113 } 4114 4115 // Make sure that the handler has a unique ID, used to find/remove it later 4116 if ( !handler.guid ) { 4117 handler.guid = jQuery.guid++; 4118 } 4119 4120 // Init the element's event structure and main handler, if this is the first 4121 if ( !(events = elemData.events) ) { 4122 events = elemData.events = {}; 4123 } 4124 if ( !(eventHandle = elemData.handle) ) { 4125 eventHandle = elemData.handle = function( e ) { 4126 // Discard the second event of a jQuery.event.trigger() and 4127 // when an event is called after a page has unloaded 4128 return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? 4129 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 4130 }; 4131 } 4132 4133 // Handle multiple events separated by a space 4134 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4135 t = types.length; 4136 while ( t-- ) { 4137 tmp = rtypenamespace.exec( types[t] ) || []; 4138 type = origType = tmp[1]; 4139 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 4140 4141 // There *must* be a type, no attaching namespace-only handlers 4142 if ( !type ) { 4143 continue; 4144 } 4145 4146 // If event changes its type, use the special event handlers for the changed type 4147 special = jQuery.event.special[ type ] || {}; 4148 4149 // If selector defined, determine special event api type, otherwise given type 4150 type = ( selector ? special.delegateType : special.bindType ) || type; 4151 4152 // Update special based on newly reset type 4153 special = jQuery.event.special[ type ] || {}; 4154 4155 // handleObj is passed to all event handlers 4156 handleObj = jQuery.extend({ 4157 type: type, 4158 origType: origType, 4159 data: data, 4160 handler: handler, 4161 guid: handler.guid, 4162 selector: selector, 4163 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4164 namespace: namespaces.join(".") 4165 }, handleObjIn ); 4166 4167 // Init the event handler queue if we're the first 4168 if ( !(handlers = events[ type ]) ) { 4169 handlers = events[ type ] = []; 4170 handlers.delegateCount = 0; 4171 4172 // Only use addEventListener if the special events handler returns false 4173 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4174 if ( elem.addEventListener ) { 4175 elem.addEventListener( type, eventHandle, false ); 4176 } 4177 } 4178 } 4179 4180 if ( special.add ) { 4181 special.add.call( elem, handleObj ); 4182 4183 if ( !handleObj.handler.guid ) { 4184 handleObj.handler.guid = handler.guid; 4185 } 4186 } 4187 4188 // Add to the element's handler list, delegates in front 4189 if ( selector ) { 4190 handlers.splice( handlers.delegateCount++, 0, handleObj ); 4191 } else { 4192 handlers.push( handleObj ); 4193 } 4194 4195 // Keep track of which events have ever been used, for event optimization 4196 jQuery.event.global[ type ] = true; 4197 } 4198 4199 }, 4200 4201 // Detach an event or set of events from an element 4202 remove: function( elem, types, handler, selector, mappedTypes ) { 4203 4204 var j, origCount, tmp, 4205 events, t, handleObj, 4206 special, handlers, type, namespaces, origType, 4207 elemData = data_priv.hasData( elem ) && data_priv.get( elem ); 4208 4209 if ( !elemData || !(events = elemData.events) ) { 4210 return; 4211 } 4212 4213 // Once for each type.namespace in types; type may be omitted 4214 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4215 t = types.length; 4216 while ( t-- ) { 4217 tmp = rtypenamespace.exec( types[t] ) || []; 4218 type = origType = tmp[1]; 4219 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 4220 4221 // Unbind all events (on this namespace, if provided) for the element 4222 if ( !type ) { 4223 for ( type in events ) { 4224 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 4225 } 4226 continue; 4227 } 4228 4229 special = jQuery.event.special[ type ] || {}; 4230 type = ( selector ? special.delegateType : special.bindType ) || type; 4231 handlers = events[ type ] || []; 4232 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); 4233 4234 // Remove matching events 4235 origCount = j = handlers.length; 4236 while ( j-- ) { 4237 handleObj = handlers[ j ]; 4238 4239 if ( ( mappedTypes || origType === handleObj.origType ) && 4240 ( !handler || handler.guid === handleObj.guid ) && 4241 ( !tmp || tmp.test( handleObj.namespace ) ) && 4242 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { 4243 handlers.splice( j, 1 ); 4244 4245 if ( handleObj.selector ) { 4246 handlers.delegateCount--; 4247 } 4248 if ( special.remove ) { 4249 special.remove.call( elem, handleObj ); 4250 } 4251 } 4252 } 4253 4254 // Remove generic event handler if we removed something and no more handlers exist 4255 // (avoids potential for endless recursion during removal of special event handlers) 4256 if ( origCount && !handlers.length ) { 4257 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 4258 jQuery.removeEvent( elem, type, elemData.handle ); 4259 } 4260 4261 delete events[ type ]; 4262 } 4263 } 4264 4265 // Remove the expando if it's no longer used 4266 if ( jQuery.isEmptyObject( events ) ) { 4267 delete elemData.handle; 4268 data_priv.remove( elem, "events" ); 4269 } 4270 }, 4271 4272 trigger: function( event, data, elem, onlyHandlers ) { 4273 4274 var i, cur, tmp, bubbleType, ontype, handle, special, 4275 eventPath = [ elem || document ], 4276 type = hasOwn.call( event, "type" ) ? event.type : event, 4277 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; 4278 4279 cur = tmp = elem = elem || document; 4280 4281 // Don't do events on text and comment nodes 4282 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 4283 return; 4284 } 4285 4286 // focus/blur morphs to focusin/out; ensure we're not firing them right now 4287 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 4288 return; 4289 } 4290 4291 if ( type.indexOf(".") >= 0 ) { 4292 // Namespaced trigger; create a regexp to match event type in handle() 4293 namespaces = type.split("."); 4294 type = namespaces.shift(); 4295 namespaces.sort(); 4296 } 4297 ontype = type.indexOf(":") < 0 && "on" + type; 4298 4299 // Caller can pass in a jQuery.Event object, Object, or just an event type string 4300 event = event[ jQuery.expando ] ? 4301 event : 4302 new jQuery.Event( type, typeof event === "object" && event ); 4303 4304 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 4305 event.isTrigger = onlyHandlers ? 2 : 3; 4306 event.namespace = namespaces.join("."); 4307 event.namespace_re = event.namespace ? 4308 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : 4309 null; 4310 4311 // Clean up the event in case it is being reused 4312 event.result = undefined; 4313 if ( !event.target ) { 4314 event.target = elem; 4315 } 4316 4317 // Clone any incoming data and prepend the event, creating the handler arg list 4318 data = data == null ? 4319 [ event ] : 4320 jQuery.makeArray( data, [ event ] ); 4321 4322 // Allow special events to draw outside the lines 4323 special = jQuery.event.special[ type ] || {}; 4324 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 4325 return; 4326 } 4327 4328 // Determine event propagation path in advance, per W3C events spec (#9951) 4329 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 4330 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 4331 4332 bubbleType = special.delegateType || type; 4333 if ( !rfocusMorph.test( bubbleType + type ) ) { 4334 cur = cur.parentNode; 4335 } 4336 for ( ; cur; cur = cur.parentNode ) { 4337 eventPath.push( cur ); 4338 tmp = cur; 4339 } 4340 4341 // Only add window if we got to document (e.g., not plain obj or detached DOM) 4342 if ( tmp === (elem.ownerDocument || document) ) { 4343 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 4344 } 4345 } 4346 4347 // Fire handlers on the event path 4348 i = 0; 4349 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { 4350 4351 event.type = i > 1 ? 4352 bubbleType : 4353 special.bindType || type; 4354 4355 // jQuery handler 4356 handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); 4357 if ( handle ) { 4358 handle.apply( cur, data ); 4359 } 4360 4361 // Native handler 4362 handle = ontype && cur[ ontype ]; 4363 if ( handle && handle.apply && jQuery.acceptData( cur ) ) { 4364 event.result = handle.apply( cur, data ); 4365 if ( event.result === false ) { 4366 event.preventDefault(); 4367 } 4368 } 4369 } 4370 event.type = type; 4371 4372 // If nobody prevented the default action, do it now 4373 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 4374 4375 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && 4376 jQuery.acceptData( elem ) ) { 4377 4378 // Call a native DOM method on the target with the same name name as the event. 4379 // Don't do default actions on window, that's where global variables be (#6170) 4380 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { 4381 4382 // Don't re-trigger an onFOO event when we call its FOO() method 4383 tmp = elem[ ontype ]; 4384 4385 if ( tmp ) { 4386 elem[ ontype ] = null; 4387 } 4388 4389 // Prevent re-triggering of the same event, since we already bubbled it above 4390 jQuery.event.triggered = type; 4391 elem[ type ](); 4392 jQuery.event.triggered = undefined; 4393 4394 if ( tmp ) { 4395 elem[ ontype ] = tmp; 4396 } 4397 } 4398 } 4399 } 4400 4401 return event.result; 4402 }, 4403 4404 dispatch: function( event ) { 4405 4406 // Make a writable jQuery.Event from the native event object 4407 event = jQuery.event.fix( event ); 4408 4409 var i, j, ret, matched, handleObj, 4410 handlerQueue = [], 4411 args = slice.call( arguments ), 4412 handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], 4413 special = jQuery.event.special[ event.type ] || {}; 4414 4415 // Use the fix-ed jQuery.Event rather than the (read-only) native event 4416 args[0] = event; 4417 event.delegateTarget = this; 4418 4419 // Call the preDispatch hook for the mapped type, and let it bail if desired 4420 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 4421 return; 4422 } 4423 4424 // Determine handlers 4425 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 4426 4427 // Run delegates first; they may want to stop propagation beneath us 4428 i = 0; 4429 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { 4430 event.currentTarget = matched.elem; 4431 4432 j = 0; 4433 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { 4434 4435 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 4436 // a subset or equal to those in the bound event (both can have no namespace). 4437 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { 4438 4439 event.handleObj = handleObj; 4440 event.data = handleObj.data; 4441 4442 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 4443 .apply( matched.elem, args ); 4444 4445 if ( ret !== undefined ) { 4446 if ( (event.result = ret) === false ) { 4447 event.preventDefault(); 4448 event.stopPropagation(); 4449 } 4450 } 4451 } 4452 } 4453 } 4454 4455 // Call the postDispatch hook for the mapped type 4456 if ( special.postDispatch ) { 4457 special.postDispatch.call( this, event ); 4458 } 4459 4460 return event.result; 4461 }, 4462 4463 handlers: function( event, handlers ) { 4464 var i, matches, sel, handleObj, 4465 handlerQueue = [], 4466 delegateCount = handlers.delegateCount, 4467 cur = event.target; 4468 4469 // Find delegate handlers 4470 // Black-hole SVG <use> instance trees (#13180) 4471 // Avoid non-left-click bubbling in Firefox (#3861) 4472 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { 4473 4474 for ( ; cur !== this; cur = cur.parentNode || this ) { 4475 4476 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 4477 if ( cur.disabled !== true || event.type !== "click" ) { 4478 matches = []; 4479 for ( i = 0; i < delegateCount; i++ ) { 4480 handleObj = handlers[ i ]; 4481 4482 // Don't conflict with Object.prototype properties (#13203) 4483 sel = handleObj.selector + " "; 4484 4485 if ( matches[ sel ] === undefined ) { 4486 matches[ sel ] = handleObj.needsContext ? 4487 jQuery( sel, this ).index( cur ) >= 0 : 4488 jQuery.find( sel, this, null, [ cur ] ).length; 4489 } 4490 if ( matches[ sel ] ) { 4491 matches.push( handleObj ); 4492 } 4493 } 4494 if ( matches.length ) { 4495 handlerQueue.push({ elem: cur, handlers: matches }); 4496 } 4497 } 4498 } 4499 } 4500 4501 // Add the remaining (directly-bound) handlers 4502 if ( delegateCount < handlers.length ) { 4503 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); 4504 } 4505 4506 return handlerQueue; 4507 }, 4508 4509 // Includes some event props shared by KeyEvent and MouseEvent 4510 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), 4511 4512 fixHooks: {}, 4513 4514 keyHooks: { 4515 props: "char charCode key keyCode".split(" "), 4516 filter: function( event, original ) { 4517 4518 // Add which for key events 4519 if ( event.which == null ) { 4520 event.which = original.charCode != null ? original.charCode : original.keyCode; 4521 } 4522 4523 return event; 4524 } 4525 }, 4526 4527 mouseHooks: { 4528 props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), 4529 filter: function( event, original ) { 4530 var eventDoc, doc, body, 4531 button = original.button; 4532 4533 // Calculate pageX/Y if missing and clientX/Y available 4534 if ( event.pageX == null && original.clientX != null ) { 4535 eventDoc = event.target.ownerDocument || document; 4536 doc = eventDoc.documentElement; 4537 body = eventDoc.body; 4538 4539 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 4540 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); 4541 } 4542 4543 // Add which for click: 1 === left; 2 === middle; 3 === right 4544 // Note: button is not normalized, so don't use it 4545 if ( !event.which && button !== undefined ) { 4546 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 4547 } 4548 4549 return event; 4550 } 4551 }, 4552 4553 fix: function( event ) { 4554 if ( event[ jQuery.expando ] ) { 4555 return event; 4556 } 4557 4558 // Create a writable copy of the event object and normalize some properties 4559 var i, prop, copy, 4560 type = event.type, 4561 originalEvent = event, 4562 fixHook = this.fixHooks[ type ]; 4563 4564 if ( !fixHook ) { 4565 this.fixHooks[ type ] = fixHook = 4566 rmouseEvent.test( type ) ? this.mouseHooks : 4567 rkeyEvent.test( type ) ? this.keyHooks : 4568 {}; 4569 } 4570 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 4571 4572 event = new jQuery.Event( originalEvent ); 4573 4574 i = copy.length; 4575 while ( i-- ) { 4576 prop = copy[ i ]; 4577 event[ prop ] = originalEvent[ prop ]; 4578 } 4579 4580 // Support: Cordova 2.5 (WebKit) (#13255) 4581 // All events should have a target; Cordova deviceready doesn't 4582 if ( !event.target ) { 4583 event.target = document; 4584 } 4585 4586 // Support: Safari 6.0+, Chrome<28 4587 // Target should not be a text node (#504, #13143) 4588 if ( event.target.nodeType === 3 ) { 4589 event.target = event.target.parentNode; 4590 } 4591 4592 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 4593 }, 4594 4595 special: { 4596 load: { 4597 // Prevent triggered image.load events from bubbling to window.load 4598 noBubble: true 4599 }, 4600 focus: { 4601 // Fire native event if possible so blur/focus sequence is correct 4602 trigger: function() { 4603 if ( this !== safeActiveElement() && this.focus ) { 4604 this.focus(); 4605 return false; 4606 } 4607 }, 4608 delegateType: "focusin" 4609 }, 4610 blur: { 4611 trigger: function() { 4612 if ( this === safeActiveElement() && this.blur ) { 4613 this.blur(); 4614 return false; 4615 } 4616 }, 4617 delegateType: "focusout" 4618 }, 4619 click: { 4620 // For checkbox, fire native event so checked state will be right 4621 trigger: function() { 4622 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { 4623 this.click(); 4624 return false; 4625 } 4626 }, 4627 4628 // For cross-browser consistency, don't fire native .click() on links 4629 _default: function( event ) { 4630 return jQuery.nodeName( event.target, "a" ); 4631 } 4632 }, 4633 4634 beforeunload: { 4635 postDispatch: function( event ) { 4636 4637 // Support: Firefox 20+ 4638 // Firefox doesn't alert if the returnValue field is not set. 4639 if ( event.result !== undefined && event.originalEvent ) { 4640 event.originalEvent.returnValue = event.result; 4641 } 4642 } 4643 } 4644 }, 4645 4646 simulate: function( type, elem, event, bubble ) { 4647 // Piggyback on a donor event to simulate a different one. 4648 // Fake originalEvent to avoid donor's stopPropagation, but if the 4649 // simulated event prevents default then we do the same on the donor. 4650 var e = jQuery.extend( 4651 new jQuery.Event(), 4652 event, 4653 { 4654 type: type, 4655 isSimulated: true, 4656 originalEvent: {} 4657 } 4658 ); 4659 if ( bubble ) { 4660 jQuery.event.trigger( e, null, elem ); 4661 } else { 4662 jQuery.event.dispatch.call( elem, e ); 4663 } 4664 if ( e.isDefaultPrevented() ) { 4665 event.preventDefault(); 4666 } 4667 } 4668}; 4669 4670jQuery.removeEvent = function( elem, type, handle ) { 4671 if ( elem.removeEventListener ) { 4672 elem.removeEventListener( type, handle, false ); 4673 } 4674}; 4675 4676jQuery.Event = function( src, props ) { 4677 // Allow instantiation without the 'new' keyword 4678 if ( !(this instanceof jQuery.Event) ) { 4679 return new jQuery.Event( src, props ); 4680 } 4681 4682 // Event object 4683 if ( src && src.type ) { 4684 this.originalEvent = src; 4685 this.type = src.type; 4686 4687 // Events bubbling up the document may have been marked as prevented 4688 // by a handler lower down the tree; reflect the correct value. 4689 this.isDefaultPrevented = src.defaultPrevented || 4690 src.defaultPrevented === undefined && 4691 // Support: Android<4.0 4692 src.returnValue === false ? 4693 returnTrue : 4694 returnFalse; 4695 4696 // Event type 4697 } else { 4698 this.type = src; 4699 } 4700 4701 // Put explicitly provided properties onto the event object 4702 if ( props ) { 4703 jQuery.extend( this, props ); 4704 } 4705 4706 // Create a timestamp if incoming event doesn't have one 4707 this.timeStamp = src && src.timeStamp || jQuery.now(); 4708 4709 // Mark it as fixed 4710 this[ jQuery.expando ] = true; 4711}; 4712 4713// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 4714// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 4715jQuery.Event.prototype = { 4716 isDefaultPrevented: returnFalse, 4717 isPropagationStopped: returnFalse, 4718 isImmediatePropagationStopped: returnFalse, 4719 4720 preventDefault: function() { 4721 var e = this.originalEvent; 4722 4723 this.isDefaultPrevented = returnTrue; 4724 4725 if ( e && e.preventDefault ) { 4726 e.preventDefault(); 4727 } 4728 }, 4729 stopPropagation: function() { 4730 var e = this.originalEvent; 4731 4732 this.isPropagationStopped = returnTrue; 4733 4734 if ( e && e.stopPropagation ) { 4735 e.stopPropagation(); 4736 } 4737 }, 4738 stopImmediatePropagation: function() { 4739 var e = this.originalEvent; 4740 4741 this.isImmediatePropagationStopped = returnTrue; 4742 4743 if ( e && e.stopImmediatePropagation ) { 4744 e.stopImmediatePropagation(); 4745 } 4746 4747 this.stopPropagation(); 4748 } 4749}; 4750 4751// Create mouseenter/leave events using mouseover/out and event-time checks 4752// Support: Chrome 15+ 4753jQuery.each({ 4754 mouseenter: "mouseover", 4755 mouseleave: "mouseout", 4756 pointerenter: "pointerover", 4757 pointerleave: "pointerout" 4758}, function( orig, fix ) { 4759 jQuery.event.special[ orig ] = { 4760 delegateType: fix, 4761 bindType: fix, 4762 4763 handle: function( event ) { 4764 var ret, 4765 target = this, 4766 related = event.relatedTarget, 4767 handleObj = event.handleObj; 4768 4769 // For mousenter/leave call the handler if related is outside the target. 4770 // NB: No relatedTarget if the mouse left/entered the browser window 4771 if ( !related || (related !== target && !jQuery.contains( target, related )) ) { 4772 event.type = handleObj.origType; 4773 ret = handleObj.handler.apply( this, arguments ); 4774 event.type = fix; 4775 } 4776 return ret; 4777 } 4778 }; 4779}); 4780 4781// Support: Firefox, Chrome, Safari 4782// Create "bubbling" focus and blur events 4783if ( !support.focusinBubbles ) { 4784 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { 4785 4786 // Attach a single capturing handler on the document while someone wants focusin/focusout 4787 var handler = function( event ) { 4788 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); 4789 }; 4790 4791 jQuery.event.special[ fix ] = { 4792 setup: function() { 4793 var doc = this.ownerDocument || this, 4794 attaches = data_priv.access( doc, fix ); 4795 4796 if ( !attaches ) { 4797 doc.addEventListener( orig, handler, true ); 4798 } 4799 data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); 4800 }, 4801 teardown: function() { 4802 var doc = this.ownerDocument || this, 4803 attaches = data_priv.access( doc, fix ) - 1; 4804 4805 if ( !attaches ) { 4806 doc.removeEventListener( orig, handler, true ); 4807 data_priv.remove( doc, fix ); 4808 4809 } else { 4810 data_priv.access( doc, fix, attaches ); 4811 } 4812 } 4813 }; 4814 }); 4815} 4816 4817jQuery.fn.extend({ 4818 4819 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { 4820 var origFn, type; 4821 4822 // Types can be a map of types/handlers 4823 if ( typeof types === "object" ) { 4824 // ( types-Object, selector, data ) 4825 if ( typeof selector !== "string" ) { 4826 // ( types-Object, data ) 4827 data = data || selector; 4828 selector = undefined; 4829 } 4830 for ( type in types ) { 4831 this.on( type, selector, data, types[ type ], one ); 4832 } 4833 return this; 4834 } 4835 4836 if ( data == null && fn == null ) { 4837 // ( types, fn ) 4838 fn = selector; 4839 data = selector = undefined; 4840 } else if ( fn == null ) { 4841 if ( typeof selector === "string" ) { 4842 // ( types, selector, fn ) 4843 fn = data; 4844 data = undefined; 4845 } else { 4846 // ( types, data, fn ) 4847 fn = data; 4848 data = selector; 4849 selector = undefined; 4850 } 4851 } 4852 if ( fn === false ) { 4853 fn = returnFalse; 4854 } else if ( !fn ) { 4855 return this; 4856 } 4857 4858 if ( one === 1 ) { 4859 origFn = fn; 4860 fn = function( event ) { 4861 // Can use an empty set, since event contains the info 4862 jQuery().off( event ); 4863 return origFn.apply( this, arguments ); 4864 }; 4865 // Use same guid so caller can remove using origFn 4866 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4867 } 4868 return this.each( function() { 4869 jQuery.event.add( this, types, fn, data, selector ); 4870 }); 4871 }, 4872 one: function( types, selector, data, fn ) { 4873 return this.on( types, selector, data, fn, 1 ); 4874 }, 4875 off: function( types, selector, fn ) { 4876 var handleObj, type; 4877 if ( types && types.preventDefault && types.handleObj ) { 4878 // ( event ) dispatched jQuery.Event 4879 handleObj = types.handleObj; 4880 jQuery( types.delegateTarget ).off( 4881 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, 4882 handleObj.selector, 4883 handleObj.handler 4884 ); 4885 return this; 4886 } 4887 if ( typeof types === "object" ) { 4888 // ( types-object [, selector] ) 4889 for ( type in types ) { 4890 this.off( type, selector, types[ type ] ); 4891 } 4892 return this; 4893 } 4894 if ( selector === false || typeof selector === "function" ) { 4895 // ( types [, fn] ) 4896 fn = selector; 4897 selector = undefined; 4898 } 4899 if ( fn === false ) { 4900 fn = returnFalse; 4901 } 4902 return this.each(function() { 4903 jQuery.event.remove( this, types, fn, selector ); 4904 }); 4905 }, 4906 4907 trigger: function( type, data ) { 4908 return this.each(function() { 4909 jQuery.event.trigger( type, data, this ); 4910 }); 4911 }, 4912 triggerHandler: function( type, data ) { 4913 var elem = this[0]; 4914 if ( elem ) { 4915 return jQuery.event.trigger( type, data, elem, true ); 4916 } 4917 } 4918}); 4919 4920 4921var 4922 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, 4923 rtagName = /<([\w:]+)/, 4924 rhtml = /<|&#?\w+;/, 4925 rnoInnerhtml = /<(?:script|style|link)/i, 4926 // checked="checked" or checked 4927 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 4928 rscriptType = /^$|\/(?:java|ecma)script/i, 4929 rscriptTypeMasked = /^true\/(.*)/, 4930 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 4931 4932 // We have to close these tags to support XHTML (#13200) 4933 wrapMap = { 4934 4935 // Support: IE9 4936 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4937 4938 thead: [ 1, "<table>", "</table>" ], 4939 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4940 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4941 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4942 4943 _default: [ 0, "", "" ] 4944 }; 4945 4946// Support: IE9 4947wrapMap.optgroup = wrapMap.option; 4948 4949wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4950wrapMap.th = wrapMap.td; 4951 4952// Support: 1.x compatibility 4953// Manipulating tables requires a tbody 4954function manipulationTarget( elem, content ) { 4955 return jQuery.nodeName( elem, "table" ) && 4956 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 4957 4958 elem.getElementsByTagName("tbody")[0] || 4959 elem.appendChild( elem.ownerDocument.createElement("tbody") ) : 4960 elem; 4961} 4962 4963// Replace/restore the type attribute of script elements for safe DOM manipulation 4964function disableScript( elem ) { 4965 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; 4966 return elem; 4967} 4968function restoreScript( elem ) { 4969 var match = rscriptTypeMasked.exec( elem.type ); 4970 4971 if ( match ) { 4972 elem.type = match[ 1 ]; 4973 } else { 4974 elem.removeAttribute("type"); 4975 } 4976 4977 return elem; 4978} 4979 4980// Mark scripts as having already been evaluated 4981function setGlobalEval( elems, refElements ) { 4982 var i = 0, 4983 l = elems.length; 4984 4985 for ( ; i < l; i++ ) { 4986 data_priv.set( 4987 elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) 4988 ); 4989 } 4990} 4991 4992function cloneCopyEvent( src, dest ) { 4993 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 4994 4995 if ( dest.nodeType !== 1 ) { 4996 return; 4997 } 4998 4999 // 1. Copy private data: events, handlers, etc. 5000 if ( data_priv.hasData( src ) ) { 5001 pdataOld = data_priv.access( src ); 5002 pdataCur = data_priv.set( dest, pdataOld ); 5003 events = pdataOld.events; 5004 5005 if ( events ) { 5006 delete pdataCur.handle; 5007 pdataCur.events = {}; 5008 5009 for ( type in events ) { 5010 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5011 jQuery.event.add( dest, type, events[ type ][ i ] ); 5012 } 5013 } 5014 } 5015 } 5016 5017 // 2. Copy user data 5018 if ( data_user.hasData( src ) ) { 5019 udataOld = data_user.access( src ); 5020 udataCur = jQuery.extend( {}, udataOld ); 5021 5022 data_user.set( dest, udataCur ); 5023 } 5024} 5025 5026function getAll( context, tag ) { 5027 var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : 5028 context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : 5029 []; 5030 5031 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 5032 jQuery.merge( [ context ], ret ) : 5033 ret; 5034} 5035 5036// Fix IE bugs, see support tests 5037function fixInput( src, dest ) { 5038 var nodeName = dest.nodeName.toLowerCase(); 5039 5040 // Fails to persist the checked state of a cloned checkbox or radio button. 5041 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5042 dest.checked = src.checked; 5043 5044 // Fails to return the selected option to the default selected state when cloning options 5045 } else if ( nodeName === "input" || nodeName === "textarea" ) { 5046 dest.defaultValue = src.defaultValue; 5047 } 5048} 5049 5050jQuery.extend({ 5051 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 5052 var i, l, srcElements, destElements, 5053 clone = elem.cloneNode( true ), 5054 inPage = jQuery.contains( elem.ownerDocument, elem ); 5055 5056 // Fix IE cloning issues 5057 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 5058 !jQuery.isXMLDoc( elem ) ) { 5059 5060 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 5061 destElements = getAll( clone ); 5062 srcElements = getAll( elem ); 5063 5064 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5065 fixInput( srcElements[ i ], destElements[ i ] ); 5066 } 5067 } 5068 5069 // Copy the events from the original to the clone 5070 if ( dataAndEvents ) { 5071 if ( deepDataAndEvents ) { 5072 srcElements = srcElements || getAll( elem ); 5073 destElements = destElements || getAll( clone ); 5074 5075 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5076 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 5077 } 5078 } else { 5079 cloneCopyEvent( elem, clone ); 5080 } 5081 } 5082 5083 // Preserve script evaluation history 5084 destElements = getAll( clone, "script" ); 5085 if ( destElements.length > 0 ) { 5086 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 5087 } 5088 5089 // Return the cloned set 5090 return clone; 5091 }, 5092 5093 buildFragment: function( elems, context, scripts, selection ) { 5094 var elem, tmp, tag, wrap, contains, j, 5095 fragment = context.createDocumentFragment(), 5096 nodes = [], 5097 i = 0, 5098 l = elems.length; 5099 5100 for ( ; i < l; i++ ) { 5101 elem = elems[ i ]; 5102 5103 if ( elem || elem === 0 ) { 5104 5105 // Add nodes directly 5106 if ( jQuery.type( elem ) === "object" ) { 5107 // Support: QtWebKit, PhantomJS 5108 // push.apply(_, arraylike) throws on ancient WebKit 5109 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 5110 5111 // Convert non-html into a text node 5112 } else if ( !rhtml.test( elem ) ) { 5113 nodes.push( context.createTextNode( elem ) ); 5114 5115 // Convert html into DOM nodes 5116 } else { 5117 tmp = tmp || fragment.appendChild( context.createElement("div") ); 5118 5119 // Deserialize a standard representation 5120 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 5121 wrap = wrapMap[ tag ] || wrapMap._default; 5122 tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ]; 5123 5124 // Descend through wrappers to the right content 5125 j = wrap[ 0 ]; 5126 while ( j-- ) { 5127 tmp = tmp.lastChild; 5128 } 5129 5130 // Support: QtWebKit, PhantomJS 5131 // push.apply(_, arraylike) throws on ancient WebKit 5132 jQuery.merge( nodes, tmp.childNodes ); 5133 5134 // Remember the top-level container 5135 tmp = fragment.firstChild; 5136 5137 // Ensure the created nodes are orphaned (#12392) 5138 tmp.textContent = ""; 5139 } 5140 } 5141 } 5142 5143 // Remove wrapper from fragment 5144 fragment.textContent = ""; 5145 5146 i = 0; 5147 while ( (elem = nodes[ i++ ]) ) { 5148 5149 // #4087 - If origin and destination elements are the same, and this is 5150 // that element, do not do anything 5151 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { 5152 continue; 5153 } 5154 5155 contains = jQuery.contains( elem.ownerDocument, elem ); 5156 5157 // Append to fragment 5158 tmp = getAll( fragment.appendChild( elem ), "script" ); 5159 5160 // Preserve script evaluation history 5161 if ( contains ) { 5162 setGlobalEval( tmp ); 5163 } 5164 5165 // Capture executables 5166 if ( scripts ) { 5167 j = 0; 5168 while ( (elem = tmp[ j++ ]) ) { 5169 if ( rscriptType.test( elem.type || "" ) ) { 5170 scripts.push( elem ); 5171 } 5172 } 5173 } 5174 } 5175 5176 return fragment; 5177 }, 5178 5179 cleanData: function( elems ) { 5180 var data, elem, type, key, 5181 special = jQuery.event.special, 5182 i = 0; 5183 5184 for ( ; (elem = elems[ i ]) !== undefined; i++ ) { 5185 if ( jQuery.acceptData( elem ) ) { 5186 key = elem[ data_priv.expando ]; 5187 5188 if ( key && (data = data_priv.cache[ key ]) ) { 5189 if ( data.events ) { 5190 for ( type in data.events ) { 5191 if ( special[ type ] ) { 5192 jQuery.event.remove( elem, type ); 5193 5194 // This is a shortcut to avoid jQuery.event.remove's overhead 5195 } else { 5196 jQuery.removeEvent( elem, type, data.handle ); 5197 } 5198 } 5199 } 5200 if ( data_priv.cache[ key ] ) { 5201 // Discard any remaining `private` data 5202 delete data_priv.cache[ key ]; 5203 } 5204 } 5205 } 5206 // Discard any remaining `user` data 5207 delete data_user.cache[ elem[ data_user.expando ] ]; 5208 } 5209 } 5210}); 5211 5212jQuery.fn.extend({ 5213 text: function( value ) { 5214 return access( this, function( value ) { 5215 return value === undefined ? 5216 jQuery.text( this ) : 5217 this.empty().each(function() { 5218 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5219 this.textContent = value; 5220 } 5221 }); 5222 }, null, value, arguments.length ); 5223 }, 5224 5225 append: function() { 5226 return this.domManip( arguments, function( elem ) { 5227 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5228 var target = manipulationTarget( this, elem ); 5229 target.appendChild( elem ); 5230 } 5231 }); 5232 }, 5233 5234 prepend: function() { 5235 return this.domManip( arguments, function( elem ) { 5236 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5237 var target = manipulationTarget( this, elem ); 5238 target.insertBefore( elem, target.firstChild ); 5239 } 5240 }); 5241 }, 5242 5243 before: function() { 5244 return this.domManip( arguments, function( elem ) { 5245 if ( this.parentNode ) { 5246 this.parentNode.insertBefore( elem, this ); 5247 } 5248 }); 5249 }, 5250 5251 after: function() { 5252 return this.domManip( arguments, function( elem ) { 5253 if ( this.parentNode ) { 5254 this.parentNode.insertBefore( elem, this.nextSibling ); 5255 } 5256 }); 5257 }, 5258 5259 remove: function( selector, keepData /* Internal Use Only */ ) { 5260 var elem, 5261 elems = selector ? jQuery.filter( selector, this ) : this, 5262 i = 0; 5263 5264 for ( ; (elem = elems[i]) != null; i++ ) { 5265 if ( !keepData && elem.nodeType === 1 ) { 5266 jQuery.cleanData( getAll( elem ) ); 5267 } 5268 5269 if ( elem.parentNode ) { 5270 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { 5271 setGlobalEval( getAll( elem, "script" ) ); 5272 } 5273 elem.parentNode.removeChild( elem ); 5274 } 5275 } 5276 5277 return this; 5278 }, 5279 5280 empty: function() { 5281 var elem, 5282 i = 0; 5283 5284 for ( ; (elem = this[i]) != null; i++ ) { 5285 if ( elem.nodeType === 1 ) { 5286 5287 // Prevent memory leaks 5288 jQuery.cleanData( getAll( elem, false ) ); 5289 5290 // Remove any remaining nodes 5291 elem.textContent = ""; 5292 } 5293 } 5294 5295 return this; 5296 }, 5297 5298 clone: function( dataAndEvents, deepDataAndEvents ) { 5299 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 5300 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 5301 5302 return this.map(function() { 5303 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 5304 }); 5305 }, 5306 5307 html: function( value ) { 5308 return access( this, function( value ) { 5309 var elem = this[ 0 ] || {}, 5310 i = 0, 5311 l = this.length; 5312 5313 if ( value === undefined && elem.nodeType === 1 ) { 5314 return elem.innerHTML; 5315 } 5316 5317 // See if we can take a shortcut and just use innerHTML 5318 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5319 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 5320 5321 value = value.replace( rxhtmlTag, "<$1></$2>" ); 5322 5323 try { 5324 for ( ; i < l; i++ ) { 5325 elem = this[ i ] || {}; 5326 5327 // Remove element nodes and prevent memory leaks 5328 if ( elem.nodeType === 1 ) { 5329 jQuery.cleanData( getAll( elem, false ) ); 5330 elem.innerHTML = value; 5331 } 5332 } 5333 5334 elem = 0; 5335 5336 // If using innerHTML throws an exception, use the fallback method 5337 } catch( e ) {} 5338 } 5339 5340 if ( elem ) { 5341 this.empty().append( value ); 5342 } 5343 }, null, value, arguments.length ); 5344 }, 5345 5346 replaceWith: function() { 5347 var arg = arguments[ 0 ]; 5348 5349 // Make the changes, replacing each context element with the new content 5350 this.domManip( arguments, function( elem ) { 5351 arg = this.parentNode; 5352 5353 jQuery.cleanData( getAll( this ) ); 5354 5355 if ( arg ) { 5356 arg.replaceChild( elem, this ); 5357 } 5358 }); 5359 5360 // Force removal if there was no new content (e.g., from empty arguments) 5361 return arg && (arg.length || arg.nodeType) ? this : this.remove(); 5362 }, 5363 5364 detach: function( selector ) { 5365 return this.remove( selector, true ); 5366 }, 5367 5368 domManip: function( args, callback ) { 5369 5370 // Flatten any nested arrays 5371 args = concat.apply( [], args ); 5372 5373 var fragment, first, scripts, hasScripts, node, doc, 5374 i = 0, 5375 l = this.length, 5376 set = this, 5377 iNoClone = l - 1, 5378 value = args[ 0 ], 5379 isFunction = jQuery.isFunction( value ); 5380 5381 // We can't cloneNode fragments that contain checked, in WebKit 5382 if ( isFunction || 5383 ( l > 1 && typeof value === "string" && 5384 !support.checkClone && rchecked.test( value ) ) ) { 5385 return this.each(function( index ) { 5386 var self = set.eq( index ); 5387 if ( isFunction ) { 5388 args[ 0 ] = value.call( this, index, self.html() ); 5389 } 5390 self.domManip( args, callback ); 5391 }); 5392 } 5393 5394 if ( l ) { 5395 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); 5396 first = fragment.firstChild; 5397 5398 if ( fragment.childNodes.length === 1 ) { 5399 fragment = first; 5400 } 5401 5402 if ( first ) { 5403 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 5404 hasScripts = scripts.length; 5405 5406 // Use the original fragment for the last item instead of the first because it can end up 5407 // being emptied incorrectly in certain situations (#8070). 5408 for ( ; i < l; i++ ) { 5409 node = fragment; 5410 5411 if ( i !== iNoClone ) { 5412 node = jQuery.clone( node, true, true ); 5413 5414 // Keep references to cloned scripts for later restoration 5415 if ( hasScripts ) { 5416 // Support: QtWebKit 5417 // jQuery.merge because push.apply(_, arraylike) throws 5418 jQuery.merge( scripts, getAll( node, "script" ) ); 5419 } 5420 } 5421 5422 callback.call( this[ i ], node, i ); 5423 } 5424 5425 if ( hasScripts ) { 5426 doc = scripts[ scripts.length - 1 ].ownerDocument; 5427 5428 // Reenable scripts 5429 jQuery.map( scripts, restoreScript ); 5430 5431 // Evaluate executable scripts on first document insertion 5432 for ( i = 0; i < hasScripts; i++ ) { 5433 node = scripts[ i ]; 5434 if ( rscriptType.test( node.type || "" ) && 5435 !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { 5436 5437 if ( node.src ) { 5438 // Optional AJAX dependency, but won't run scripts if not present 5439 if ( jQuery._evalUrl ) { 5440 jQuery._evalUrl( node.src ); 5441 } 5442 } else { 5443 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); 5444 } 5445 } 5446 } 5447 } 5448 } 5449 } 5450 5451 return this; 5452 } 5453}); 5454 5455jQuery.each({ 5456 appendTo: "append", 5457 prependTo: "prepend", 5458 insertBefore: "before", 5459 insertAfter: "after", 5460 replaceAll: "replaceWith" 5461}, function( name, original ) { 5462 jQuery.fn[ name ] = function( selector ) { 5463 var elems, 5464 ret = [], 5465 insert = jQuery( selector ), 5466 last = insert.length - 1, 5467 i = 0; 5468 5469 for ( ; i <= last; i++ ) { 5470 elems = i === last ? this : this.clone( true ); 5471 jQuery( insert[ i ] )[ original ]( elems ); 5472 5473 // Support: QtWebKit 5474 // .get() because push.apply(_, arraylike) throws 5475 push.apply( ret, elems.get() ); 5476 } 5477 5478 return this.pushStack( ret ); 5479 }; 5480}); 5481 5482 5483var iframe, 5484 elemdisplay = {}; 5485 5486/** 5487 * Retrieve the actual display of a element 5488 * @param {String} name nodeName of the element 5489 * @param {Object} doc Document object 5490 */ 5491// Called only from within defaultDisplay 5492function actualDisplay( name, doc ) { 5493 var style, 5494 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 5495 5496 // getDefaultComputedStyle might be reliably used only on attached element 5497 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? 5498 5499 // Use of this method is a temporary fix (more like optimization) until something better comes along, 5500 // since it was removed from specification and supported only in FF 5501 style.display : jQuery.css( elem[ 0 ], "display" ); 5502 5503 // We don't have any data stored on the element, 5504 // so use "detach" method as fast way to get rid of the element 5505 elem.detach(); 5506 5507 return display; 5508} 5509 5510/** 5511 * Try to determine the default display value of an element 5512 * @param {String} nodeName 5513 */ 5514function defaultDisplay( nodeName ) { 5515 var doc = document, 5516 display = elemdisplay[ nodeName ]; 5517 5518 if ( !display ) { 5519 display = actualDisplay( nodeName, doc ); 5520 5521 // If the simple way fails, read from inside an iframe 5522 if ( display === "none" || !display ) { 5523 5524 // Use the already-created iframe if possible 5525 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); 5526 5527 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 5528 doc = iframe[ 0 ].contentDocument; 5529 5530 // Support: IE 5531 doc.write(); 5532 doc.close(); 5533 5534 display = actualDisplay( nodeName, doc ); 5535 iframe.detach(); 5536 } 5537 5538 // Store the correct default display 5539 elemdisplay[ nodeName ] = display; 5540 } 5541 5542 return display; 5543} 5544var rmargin = (/^margin/); 5545 5546var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5547 5548var getStyles = function( elem ) { 5549 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 5550 // IE throws on elements created in popups 5551 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 5552 if ( elem.ownerDocument.defaultView.opener ) { 5553 return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 5554 } 5555 5556 return window.getComputedStyle( elem, null ); 5557 }; 5558 5559 5560 5561function curCSS( elem, name, computed ) { 5562 var width, minWidth, maxWidth, ret, 5563 style = elem.style; 5564 5565 computed = computed || getStyles( elem ); 5566 5567 // Support: IE9 5568 // getPropertyValue is only needed for .css('filter') (#12537) 5569 if ( computed ) { 5570 ret = computed.getPropertyValue( name ) || computed[ name ]; 5571 } 5572 5573 if ( computed ) { 5574 5575 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 5576 ret = jQuery.style( elem, name ); 5577 } 5578 5579 // Support: iOS < 6 5580 // A tribute to the "awesome hack by Dean Edwards" 5581 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels 5582 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 5583 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { 5584 5585 // Remember the original values 5586 width = style.width; 5587 minWidth = style.minWidth; 5588 maxWidth = style.maxWidth; 5589 5590 // Put in the new values to get a computed value out 5591 style.minWidth = style.maxWidth = style.width = ret; 5592 ret = computed.width; 5593 5594 // Revert the changed values 5595 style.width = width; 5596 style.minWidth = minWidth; 5597 style.maxWidth = maxWidth; 5598 } 5599 } 5600 5601 return ret !== undefined ? 5602 // Support: IE 5603 // IE returns zIndex value as an integer. 5604 ret + "" : 5605 ret; 5606} 5607 5608 5609function addGetHookIf( conditionFn, hookFn ) { 5610 // Define the hook, we'll check on the first run if it's really needed. 5611 return { 5612 get: function() { 5613 if ( conditionFn() ) { 5614 // Hook not needed (or it's not possible to use it due 5615 // to missing dependency), remove it. 5616 delete this.get; 5617 return; 5618 } 5619 5620 // Hook needed; redefine it so that the support test is not executed again. 5621 return (this.get = hookFn).apply( this, arguments ); 5622 } 5623 }; 5624} 5625 5626 5627(function() { 5628 var pixelPositionVal, boxSizingReliableVal, 5629 docElem = document.documentElement, 5630 container = document.createElement( "div" ), 5631 div = document.createElement( "div" ); 5632 5633 if ( !div.style ) { 5634 return; 5635 } 5636 5637 // Support: IE9-11+ 5638 // Style of cloned element affects source element cloned (#8908) 5639 div.style.backgroundClip = "content-box"; 5640 div.cloneNode( true ).style.backgroundClip = ""; 5641 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 5642 5643 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + 5644 "position:absolute"; 5645 container.appendChild( div ); 5646 5647 // Executing both pixelPosition & boxSizingReliable tests require only one layout 5648 // so they're executed at the same time to save the second computation. 5649 function computePixelPositionAndBoxSizingReliable() { 5650 div.style.cssText = 5651 // Support: Firefox<29, Android 2.3 5652 // Vendor-prefix box-sizing 5653 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + 5654 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + 5655 "border:1px;padding:1px;width:4px;position:absolute"; 5656 div.innerHTML = ""; 5657 docElem.appendChild( container ); 5658 5659 var divStyle = window.getComputedStyle( div, null ); 5660 pixelPositionVal = divStyle.top !== "1%"; 5661 boxSizingReliableVal = divStyle.width === "4px"; 5662 5663 docElem.removeChild( container ); 5664 } 5665 5666 // Support: node.js jsdom 5667 // Don't assume that getComputedStyle is a property of the global object 5668 if ( window.getComputedStyle ) { 5669 jQuery.extend( support, { 5670 pixelPosition: function() { 5671 5672 // This test is executed only once but we still do memoizing 5673 // since we can use the boxSizingReliable pre-computing. 5674 // No need to check if the test was already performed, though. 5675 computePixelPositionAndBoxSizingReliable(); 5676 return pixelPositionVal; 5677 }, 5678 boxSizingReliable: function() { 5679 if ( boxSizingReliableVal == null ) { 5680 computePixelPositionAndBoxSizingReliable(); 5681 } 5682 return boxSizingReliableVal; 5683 }, 5684 reliableMarginRight: function() { 5685 5686 // Support: Android 2.3 5687 // Check if div with explicit width and no margin-right incorrectly 5688 // gets computed margin-right based on width of container. (#3333) 5689 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 5690 // This support function is only executed once so no memoizing is needed. 5691 var ret, 5692 marginDiv = div.appendChild( document.createElement( "div" ) ); 5693 5694 // Reset CSS: box-sizing; display; margin; border; padding 5695 marginDiv.style.cssText = div.style.cssText = 5696 // Support: Firefox<29, Android 2.3 5697 // Vendor-prefix box-sizing 5698 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 5699 "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 5700 marginDiv.style.marginRight = marginDiv.style.width = "0"; 5701 div.style.width = "1px"; 5702 docElem.appendChild( container ); 5703 5704 ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); 5705 5706 docElem.removeChild( container ); 5707 div.removeChild( marginDiv ); 5708 5709 return ret; 5710 } 5711 }); 5712 } 5713})(); 5714 5715 5716// A method for quickly swapping in/out CSS properties to get correct calculations. 5717jQuery.swap = function( elem, options, callback, args ) { 5718 var ret, name, 5719 old = {}; 5720 5721 // Remember the old values, and insert the new ones 5722 for ( name in options ) { 5723 old[ name ] = elem.style[ name ]; 5724 elem.style[ name ] = options[ name ]; 5725 } 5726 5727 ret = callback.apply( elem, args || [] ); 5728 5729 // Revert the old values 5730 for ( name in options ) { 5731 elem.style[ name ] = old[ name ]; 5732 } 5733 5734 return ret; 5735}; 5736 5737 5738var 5739 // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption" 5740 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 5741 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 5742 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 5743 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), 5744 5745 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 5746 cssNormalTransform = { 5747 letterSpacing: "0", 5748 fontWeight: "400" 5749 }, 5750 5751 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; 5752 5753// Return a css property mapped to a potentially vendor prefixed property 5754function vendorPropName( style, name ) { 5755 5756 // Shortcut for names that are not vendor prefixed 5757 if ( name in style ) { 5758 return name; 5759 } 5760 5761 // Check for vendor prefixed names 5762 var capName = name[0].toUpperCase() + name.slice(1), 5763 origName = name, 5764 i = cssPrefixes.length; 5765 5766 while ( i-- ) { 5767 name = cssPrefixes[ i ] + capName; 5768 if ( name in style ) { 5769 return name; 5770 } 5771 } 5772 5773 return origName; 5774} 5775 5776function setPositiveNumber( elem, value, subtract ) { 5777 var matches = rnumsplit.exec( value ); 5778 return matches ? 5779 // Guard against undefined "subtract", e.g., when used as in cssHooks 5780 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 5781 value; 5782} 5783 5784function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 5785 var i = extra === ( isBorderBox ? "border" : "content" ) ? 5786 // If we already have the right measurement, avoid augmentation 5787 4 : 5788 // Otherwise initialize for horizontal or vertical properties 5789 name === "width" ? 1 : 0, 5790 5791 val = 0; 5792 5793 for ( ; i < 4; i += 2 ) { 5794 // Both box models exclude margin, so add it if we want it 5795 if ( extra === "margin" ) { 5796 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 5797 } 5798 5799 if ( isBorderBox ) { 5800 // border-box includes padding, so remove it if we want content 5801 if ( extra === "content" ) { 5802 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5803 } 5804 5805 // At this point, extra isn't border nor margin, so remove border 5806 if ( extra !== "margin" ) { 5807 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5808 } 5809 } else { 5810 // At this point, extra isn't content, so add padding 5811 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5812 5813 // At this point, extra isn't content nor padding, so add border 5814 if ( extra !== "padding" ) { 5815 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5816 } 5817 } 5818 } 5819 5820 return val; 5821} 5822 5823function getWidthOrHeight( elem, name, extra ) { 5824 5825 // Start with offset property, which is equivalent to the border-box value 5826 var valueIsBorderBox = true, 5827 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 5828 styles = getStyles( elem ), 5829 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 5830 5831 // Some non-html elements return undefined for offsetWidth, so check for null/undefined 5832 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 5833 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 5834 if ( val <= 0 || val == null ) { 5835 // Fall back to computed then uncomputed css if necessary 5836 val = curCSS( elem, name, styles ); 5837 if ( val < 0 || val == null ) { 5838 val = elem.style[ name ]; 5839 } 5840 5841 // Computed unit is not pixels. Stop here and return. 5842 if ( rnumnonpx.test(val) ) { 5843 return val; 5844 } 5845 5846 // Check for style in case a browser which returns unreliable values 5847 // for getComputedStyle silently falls back to the reliable elem.style 5848 valueIsBorderBox = isBorderBox && 5849 ( support.boxSizingReliable() || val === elem.style[ name ] ); 5850 5851 // Normalize "", auto, and prepare for extra 5852 val = parseFloat( val ) || 0; 5853 } 5854 5855 // Use the active box-sizing model to add/subtract irrelevant styles 5856 return ( val + 5857 augmentWidthOrHeight( 5858 elem, 5859 name, 5860 extra || ( isBorderBox ? "border" : "content" ), 5861 valueIsBorderBox, 5862 styles 5863 ) 5864 ) + "px"; 5865} 5866 5867function showHide( elements, show ) { 5868 var display, elem, hidden, 5869 values = [], 5870 index = 0, 5871 length = elements.length; 5872 5873 for ( ; index < length; index++ ) { 5874 elem = elements[ index ]; 5875 if ( !elem.style ) { 5876 continue; 5877 } 5878 5879 values[ index ] = data_priv.get( elem, "olddisplay" ); 5880 display = elem.style.display; 5881 if ( show ) { 5882 // Reset the inline display of this element to learn if it is 5883 // being hidden by cascaded rules or not 5884 if ( !values[ index ] && display === "none" ) { 5885 elem.style.display = ""; 5886 } 5887 5888 // Set elements which have been overridden with display: none 5889 // in a stylesheet to whatever the default browser style is 5890 // for such an element 5891 if ( elem.style.display === "" && isHidden( elem ) ) { 5892 values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) ); 5893 } 5894 } else { 5895 hidden = isHidden( elem ); 5896 5897 if ( display !== "none" || !hidden ) { 5898 data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); 5899 } 5900 } 5901 } 5902 5903 // Set the display of most of the elements in a second loop 5904 // to avoid the constant reflow 5905 for ( index = 0; index < length; index++ ) { 5906 elem = elements[ index ]; 5907 if ( !elem.style ) { 5908 continue; 5909 } 5910 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 5911 elem.style.display = show ? values[ index ] || "" : "none"; 5912 } 5913 } 5914 5915 return elements; 5916} 5917 5918jQuery.extend({ 5919 5920 // Add in style property hooks for overriding the default 5921 // behavior of getting and setting a style property 5922 cssHooks: { 5923 opacity: { 5924 get: function( elem, computed ) { 5925 if ( computed ) { 5926 5927 // We should always get a number back from opacity 5928 var ret = curCSS( elem, "opacity" ); 5929 return ret === "" ? "1" : ret; 5930 } 5931 } 5932 } 5933 }, 5934 5935 // Don't automatically add "px" to these possibly-unitless properties 5936 cssNumber: { 5937 "columnCount": true, 5938 "fillOpacity": true, 5939 "flexGrow": true, 5940 "flexShrink": true, 5941 "fontWeight": true, 5942 "lineHeight": true, 5943 "opacity": true, 5944 "order": true, 5945 "orphans": true, 5946 "widows": true, 5947 "zIndex": true, 5948 "zoom": true 5949 }, 5950 5951 // Add in properties whose names you wish to fix before 5952 // setting or getting the value 5953 cssProps: { 5954 "float": "cssFloat" 5955 }, 5956 5957 // Get and set the style property on a DOM Node 5958 style: function( elem, name, value, extra ) { 5959 5960 // Don't set styles on text and comment nodes 5961 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 5962 return; 5963 } 5964 5965 // Make sure that we're working with the right name 5966 var ret, type, hooks, 5967 origName = jQuery.camelCase( name ), 5968 style = elem.style; 5969 5970 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); 5971 5972 // Gets hook for the prefixed version, then unprefixed version 5973 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 5974 5975 // Check if we're setting a value 5976 if ( value !== undefined ) { 5977 type = typeof value; 5978 5979 // Convert "+=" or "-=" to relative numbers (#7345) 5980 if ( type === "string" && (ret = rrelNum.exec( value )) ) { 5981 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); 5982 // Fixes bug #9237 5983 type = "number"; 5984 } 5985 5986 // Make sure that null and NaN values aren't set (#7116) 5987 if ( value == null || value !== value ) { 5988 return; 5989 } 5990 5991 // If a number, add 'px' to the (except for certain CSS properties) 5992 if ( type === "number" && !jQuery.cssNumber[ origName ] ) { 5993 value += "px"; 5994 } 5995 5996 // Support: IE9-11+ 5997 // background-* props affect original clone's values 5998 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 5999 style[ name ] = "inherit"; 6000 } 6001 6002 // If a hook was provided, use that value, otherwise just set the specified value 6003 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { 6004 style[ name ] = value; 6005 } 6006 6007 } else { 6008 // If a hook was provided get the non-computed value from there 6009 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { 6010 return ret; 6011 } 6012 6013 // Otherwise just get the value from the style object 6014 return style[ name ]; 6015 } 6016 }, 6017 6018 css: function( elem, name, extra, styles ) { 6019 var val, num, hooks, 6020 origName = jQuery.camelCase( name ); 6021 6022 // Make sure that we're working with the right name 6023 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); 6024 6025 // Try prefixed name followed by the unprefixed name 6026 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6027 6028 // If a hook was provided get the computed value from there 6029 if ( hooks && "get" in hooks ) { 6030 val = hooks.get( elem, true, extra ); 6031 } 6032 6033 // Otherwise, if a way to get the computed value exists, use that 6034 if ( val === undefined ) { 6035 val = curCSS( elem, name, styles ); 6036 } 6037 6038 // Convert "normal" to computed value 6039 if ( val === "normal" && name in cssNormalTransform ) { 6040 val = cssNormalTransform[ name ]; 6041 } 6042 6043 // Make numeric if forced or a qualifier was provided and val looks numeric 6044 if ( extra === "" || extra ) { 6045 num = parseFloat( val ); 6046 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; 6047 } 6048 return val; 6049 } 6050}); 6051 6052jQuery.each([ "height", "width" ], function( i, name ) { 6053 jQuery.cssHooks[ name ] = { 6054 get: function( elem, computed, extra ) { 6055 if ( computed ) { 6056 6057 // Certain elements can have dimension info if we invisibly show them 6058 // but it must have a current display style that would benefit 6059 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? 6060 jQuery.swap( elem, cssShow, function() { 6061 return getWidthOrHeight( elem, name, extra ); 6062 }) : 6063 getWidthOrHeight( elem, name, extra ); 6064 } 6065 }, 6066 6067 set: function( elem, value, extra ) { 6068 var styles = extra && getStyles( elem ); 6069 return setPositiveNumber( elem, value, extra ? 6070 augmentWidthOrHeight( 6071 elem, 6072 name, 6073 extra, 6074 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6075 styles 6076 ) : 0 6077 ); 6078 } 6079 }; 6080}); 6081 6082// Support: Android 2.3 6083jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 6084 function( elem, computed ) { 6085 if ( computed ) { 6086 return jQuery.swap( elem, { "display": "inline-block" }, 6087 curCSS, [ elem, "marginRight" ] ); 6088 } 6089 } 6090); 6091 6092// These hooks are used by animate to expand properties 6093jQuery.each({ 6094 margin: "", 6095 padding: "", 6096 border: "Width" 6097}, function( prefix, suffix ) { 6098 jQuery.cssHooks[ prefix + suffix ] = { 6099 expand: function( value ) { 6100 var i = 0, 6101 expanded = {}, 6102 6103 // Assumes a single number if not a string 6104 parts = typeof value === "string" ? value.split(" ") : [ value ]; 6105 6106 for ( ; i < 4; i++ ) { 6107 expanded[ prefix + cssExpand[ i ] + suffix ] = 6108 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6109 } 6110 6111 return expanded; 6112 } 6113 }; 6114 6115 if ( !rmargin.test( prefix ) ) { 6116 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 6117 } 6118}); 6119 6120jQuery.fn.extend({ 6121 css: function( name, value ) { 6122 return access( this, function( elem, name, value ) { 6123 var styles, len, 6124 map = {}, 6125 i = 0; 6126 6127 if ( jQuery.isArray( name ) ) { 6128 styles = getStyles( elem ); 6129 len = name.length; 6130 6131 for ( ; i < len; i++ ) { 6132 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 6133 } 6134 6135 return map; 6136 } 6137 6138 return value !== undefined ? 6139 jQuery.style( elem, name, value ) : 6140 jQuery.css( elem, name ); 6141 }, name, value, arguments.length > 1 ); 6142 }, 6143 show: function() { 6144 return showHide( this, true ); 6145 }, 6146 hide: function() { 6147 return showHide( this ); 6148 }, 6149 toggle: function( state ) { 6150 if ( typeof state === "boolean" ) { 6151 return state ? this.show() : this.hide(); 6152 } 6153 6154 return this.each(function() { 6155 if ( isHidden( this ) ) { 6156 jQuery( this ).show(); 6157 } else { 6158 jQuery( this ).hide(); 6159 } 6160 }); 6161 } 6162}); 6163 6164 6165function Tween( elem, options, prop, end, easing ) { 6166 return new Tween.prototype.init( elem, options, prop, end, easing ); 6167} 6168jQuery.Tween = Tween; 6169 6170Tween.prototype = { 6171 constructor: Tween, 6172 init: function( elem, options, prop, end, easing, unit ) { 6173 this.elem = elem; 6174 this.prop = prop; 6175 this.easing = easing || "swing"; 6176 this.options = options; 6177 this.start = this.now = this.cur(); 6178 this.end = end; 6179 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 6180 }, 6181 cur: function() { 6182 var hooks = Tween.propHooks[ this.prop ]; 6183 6184 return hooks && hooks.get ? 6185 hooks.get( this ) : 6186 Tween.propHooks._default.get( this ); 6187 }, 6188 run: function( percent ) { 6189 var eased, 6190 hooks = Tween.propHooks[ this.prop ]; 6191 6192 if ( this.options.duration ) { 6193 this.pos = eased = jQuery.easing[ this.easing ]( 6194 percent, this.options.duration * percent, 0, 1, this.options.duration 6195 ); 6196 } else { 6197 this.pos = eased = percent; 6198 } 6199 this.now = ( this.end - this.start ) * eased + this.start; 6200 6201 if ( this.options.step ) { 6202 this.options.step.call( this.elem, this.now, this ); 6203 } 6204 6205 if ( hooks && hooks.set ) { 6206 hooks.set( this ); 6207 } else { 6208 Tween.propHooks._default.set( this ); 6209 } 6210 return this; 6211 } 6212}; 6213 6214Tween.prototype.init.prototype = Tween.prototype; 6215 6216Tween.propHooks = { 6217 _default: { 6218 get: function( tween ) { 6219 var result; 6220 6221 if ( tween.elem[ tween.prop ] != null && 6222 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { 6223 return tween.elem[ tween.prop ]; 6224 } 6225 6226 // Passing an empty string as a 3rd parameter to .css will automatically 6227 // attempt a parseFloat and fallback to a string if the parse fails. 6228 // Simple values such as "10px" are parsed to Float; 6229 // complex values such as "rotate(1rad)" are returned as-is. 6230 result = jQuery.css( tween.elem, tween.prop, "" ); 6231 // Empty strings, null, undefined and "auto" are converted to 0. 6232 return !result || result === "auto" ? 0 : result; 6233 }, 6234 set: function( tween ) { 6235 // Use step hook for back compat. 6236 // Use cssHook if its there. 6237 // Use .style if available and use plain properties where available. 6238 if ( jQuery.fx.step[ tween.prop ] ) { 6239 jQuery.fx.step[ tween.prop ]( tween ); 6240 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { 6241 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 6242 } else { 6243 tween.elem[ tween.prop ] = tween.now; 6244 } 6245 } 6246 } 6247}; 6248 6249// Support: IE9 6250// Panic based approach to setting things on disconnected nodes 6251Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 6252 set: function( tween ) { 6253 if ( tween.elem.nodeType && tween.elem.parentNode ) { 6254 tween.elem[ tween.prop ] = tween.now; 6255 } 6256 } 6257}; 6258 6259jQuery.easing = { 6260 linear: function( p ) { 6261 return p; 6262 }, 6263 swing: function( p ) { 6264 return 0.5 - Math.cos( p * Math.PI ) / 2; 6265 } 6266}; 6267 6268jQuery.fx = Tween.prototype.init; 6269 6270// Back Compat <1.8 extension point 6271jQuery.fx.step = {}; 6272 6273 6274 6275 6276var 6277 fxNow, timerId, 6278 rfxtypes = /^(?:toggle|show|hide)$/, 6279 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), 6280 rrun = /queueHooks$/, 6281 animationPrefilters = [ defaultPrefilter ], 6282 tweeners = { 6283 "*": [ function( prop, value ) { 6284 var tween = this.createTween( prop, value ), 6285 target = tween.cur(), 6286 parts = rfxnum.exec( value ), 6287 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 6288 6289 // Starting value computation is required for potential unit mismatches 6290 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && 6291 rfxnum.exec( jQuery.css( tween.elem, prop ) ), 6292 scale = 1, 6293 maxIterations = 20; 6294 6295 if ( start && start[ 3 ] !== unit ) { 6296 // Trust units reported by jQuery.css 6297 unit = unit || start[ 3 ]; 6298 6299 // Make sure we update the tween properties later on 6300 parts = parts || []; 6301 6302 // Iteratively approximate from a nonzero starting point 6303 start = +target || 1; 6304 6305 do { 6306 // If previous iteration zeroed out, double until we get *something*. 6307 // Use string for doubling so we don't accidentally see scale as unchanged below 6308 scale = scale || ".5"; 6309 6310 // Adjust and apply 6311 start = start / scale; 6312 jQuery.style( tween.elem, prop, start + unit ); 6313 6314 // Update scale, tolerating zero or NaN from tween.cur(), 6315 // break the loop if scale is unchanged or perfect, or if we've just had enough 6316 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); 6317 } 6318 6319 // Update tween properties 6320 if ( parts ) { 6321 start = tween.start = +start || +target || 0; 6322 tween.unit = unit; 6323 // If a +=/-= token was provided, we're doing a relative animation 6324 tween.end = parts[ 1 ] ? 6325 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : 6326 +parts[ 2 ]; 6327 } 6328 6329 return tween; 6330 } ] 6331 }; 6332 6333// Animations created synchronously will run synchronously 6334function createFxNow() { 6335 setTimeout(function() { 6336 fxNow = undefined; 6337 }); 6338 return ( fxNow = jQuery.now() ); 6339} 6340 6341// Generate parameters to create a standard animation 6342function genFx( type, includeWidth ) { 6343 var which, 6344 i = 0, 6345 attrs = { height: type }; 6346 6347 // If we include width, step value is 1 to do all cssExpand values, 6348 // otherwise step value is 2 to skip over Left and Right 6349 includeWidth = includeWidth ? 1 : 0; 6350 for ( ; i < 4 ; i += 2 - includeWidth ) { 6351 which = cssExpand[ i ]; 6352 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 6353 } 6354 6355 if ( includeWidth ) { 6356 attrs.opacity = attrs.width = type; 6357 } 6358 6359 return attrs; 6360} 6361 6362function createTween( value, prop, animation ) { 6363 var tween, 6364 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), 6365 index = 0, 6366 length = collection.length; 6367 for ( ; index < length; index++ ) { 6368 if ( (tween = collection[ index ].call( animation, prop, value )) ) { 6369 6370 // We're done with this property 6371 return tween; 6372 } 6373 } 6374} 6375 6376function defaultPrefilter( elem, props, opts ) { 6377 /* jshint validthis: true */ 6378 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 6379 anim = this, 6380 orig = {}, 6381 style = elem.style, 6382 hidden = elem.nodeType && isHidden( elem ), 6383 dataShow = data_priv.get( elem, "fxshow" ); 6384 6385 // Handle queue: false promises 6386 if ( !opts.queue ) { 6387 hooks = jQuery._queueHooks( elem, "fx" ); 6388 if ( hooks.unqueued == null ) { 6389 hooks.unqueued = 0; 6390 oldfire = hooks.empty.fire; 6391 hooks.empty.fire = function() { 6392 if ( !hooks.unqueued ) { 6393 oldfire(); 6394 } 6395 }; 6396 } 6397 hooks.unqueued++; 6398 6399 anim.always(function() { 6400 // Ensure the complete handler is called before this completes 6401 anim.always(function() { 6402 hooks.unqueued--; 6403 if ( !jQuery.queue( elem, "fx" ).length ) { 6404 hooks.empty.fire(); 6405 } 6406 }); 6407 }); 6408 } 6409 6410 // Height/width overflow pass 6411 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 6412 // Make sure that nothing sneaks out 6413 // Record all 3 overflow attributes because IE9-10 do not 6414 // change the overflow attribute when overflowX and 6415 // overflowY are set to the same value 6416 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 6417 6418 // Set display property to inline-block for height/width 6419 // animations on inline elements that are having width/height animated 6420 display = jQuery.css( elem, "display" ); 6421 6422 // Test default display if display is currently "none" 6423 checkDisplay = display === "none" ? 6424 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 6425 6426 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 6427 style.display = "inline-block"; 6428 } 6429 } 6430 6431 if ( opts.overflow ) { 6432 style.overflow = "hidden"; 6433 anim.always(function() { 6434 style.overflow = opts.overflow[ 0 ]; 6435 style.overflowX = opts.overflow[ 1 ]; 6436 style.overflowY = opts.overflow[ 2 ]; 6437 }); 6438 } 6439 6440 // show/hide pass 6441 for ( prop in props ) { 6442 value = props[ prop ]; 6443 if ( rfxtypes.exec( value ) ) { 6444 delete props[ prop ]; 6445 toggle = toggle || value === "toggle"; 6446 if ( value === ( hidden ? "hide" : "show" ) ) { 6447 6448 // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden 6449 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 6450 hidden = true; 6451 } else { 6452 continue; 6453 } 6454 } 6455 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 6456 6457 // Any non-fx value stops us from restoring the original display value 6458 } else { 6459 display = undefined; 6460 } 6461 } 6462 6463 if ( !jQuery.isEmptyObject( orig ) ) { 6464 if ( dataShow ) { 6465 if ( "hidden" in dataShow ) { 6466 hidden = dataShow.hidden; 6467 } 6468 } else { 6469 dataShow = data_priv.access( elem, "fxshow", {} ); 6470 } 6471 6472 // Store state if its toggle - enables .stop().toggle() to "reverse" 6473 if ( toggle ) { 6474 dataShow.hidden = !hidden; 6475 } 6476 if ( hidden ) { 6477 jQuery( elem ).show(); 6478 } else { 6479 anim.done(function() { 6480 jQuery( elem ).hide(); 6481 }); 6482 } 6483 anim.done(function() { 6484 var prop; 6485 6486 data_priv.remove( elem, "fxshow" ); 6487 for ( prop in orig ) { 6488 jQuery.style( elem, prop, orig[ prop ] ); 6489 } 6490 }); 6491 for ( prop in orig ) { 6492 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 6493 6494 if ( !( prop in dataShow ) ) { 6495 dataShow[ prop ] = tween.start; 6496 if ( hidden ) { 6497 tween.end = tween.start; 6498 tween.start = prop === "width" || prop === "height" ? 1 : 0; 6499 } 6500 } 6501 } 6502 6503 // If this is a noop like .hide().hide(), restore an overwritten display value 6504 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { 6505 style.display = display; 6506 } 6507} 6508 6509function propFilter( props, specialEasing ) { 6510 var index, name, easing, value, hooks; 6511 6512 // camelCase, specialEasing and expand cssHook pass 6513 for ( index in props ) { 6514 name = jQuery.camelCase( index ); 6515 easing = specialEasing[ name ]; 6516 value = props[ index ]; 6517 if ( jQuery.isArray( value ) ) { 6518 easing = value[ 1 ]; 6519 value = props[ index ] = value[ 0 ]; 6520 } 6521 6522 if ( index !== name ) { 6523 props[ name ] = value; 6524 delete props[ index ]; 6525 } 6526 6527 hooks = jQuery.cssHooks[ name ]; 6528 if ( hooks && "expand" in hooks ) { 6529 value = hooks.expand( value ); 6530 delete props[ name ]; 6531 6532 // Not quite $.extend, this won't overwrite existing keys. 6533 // Reusing 'index' because we have the correct "name" 6534 for ( index in value ) { 6535 if ( !( index in props ) ) { 6536 props[ index ] = value[ index ]; 6537 specialEasing[ index ] = easing; 6538 } 6539 } 6540 } else { 6541 specialEasing[ name ] = easing; 6542 } 6543 } 6544} 6545 6546function Animation( elem, properties, options ) { 6547 var result, 6548 stopped, 6549 index = 0, 6550 length = animationPrefilters.length, 6551 deferred = jQuery.Deferred().always( function() { 6552 // Don't match elem in the :animated selector 6553 delete tick.elem; 6554 }), 6555 tick = function() { 6556 if ( stopped ) { 6557 return false; 6558 } 6559 var currentTime = fxNow || createFxNow(), 6560 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 6561 // Support: Android 2.3 6562 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 6563 temp = remaining / animation.duration || 0, 6564 percent = 1 - temp, 6565 index = 0, 6566 length = animation.tweens.length; 6567 6568 for ( ; index < length ; index++ ) { 6569 animation.tweens[ index ].run( percent ); 6570 } 6571 6572 deferred.notifyWith( elem, [ animation, percent, remaining ]); 6573 6574 if ( percent < 1 && length ) { 6575 return remaining; 6576 } else { 6577 deferred.resolveWith( elem, [ animation ] ); 6578 return false; 6579 } 6580 }, 6581 animation = deferred.promise({ 6582 elem: elem, 6583 props: jQuery.extend( {}, properties ), 6584 opts: jQuery.extend( true, { specialEasing: {} }, options ), 6585 originalProperties: properties, 6586 originalOptions: options, 6587 startTime: fxNow || createFxNow(), 6588 duration: options.duration, 6589 tweens: [], 6590 createTween: function( prop, end ) { 6591 var tween = jQuery.Tween( elem, animation.opts, prop, end, 6592 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 6593 animation.tweens.push( tween ); 6594 return tween; 6595 }, 6596 stop: function( gotoEnd ) { 6597 var index = 0, 6598 // If we are going to the end, we want to run all the tweens 6599 // otherwise we skip this part 6600 length = gotoEnd ? animation.tweens.length : 0; 6601 if ( stopped ) { 6602 return this; 6603 } 6604 stopped = true; 6605 for ( ; index < length ; index++ ) { 6606 animation.tweens[ index ].run( 1 ); 6607 } 6608 6609 // Resolve when we played the last frame; otherwise, reject 6610 if ( gotoEnd ) { 6611 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 6612 } else { 6613 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 6614 } 6615 return this; 6616 } 6617 }), 6618 props = animation.props; 6619 6620 propFilter( props, animation.opts.specialEasing ); 6621 6622 for ( ; index < length ; index++ ) { 6623 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); 6624 if ( result ) { 6625 return result; 6626 } 6627 } 6628 6629 jQuery.map( props, createTween, animation ); 6630 6631 if ( jQuery.isFunction( animation.opts.start ) ) { 6632 animation.opts.start.call( elem, animation ); 6633 } 6634 6635 jQuery.fx.timer( 6636 jQuery.extend( tick, { 6637 elem: elem, 6638 anim: animation, 6639 queue: animation.opts.queue 6640 }) 6641 ); 6642 6643 // attach callbacks from options 6644 return animation.progress( animation.opts.progress ) 6645 .done( animation.opts.done, animation.opts.complete ) 6646 .fail( animation.opts.fail ) 6647 .always( animation.opts.always ); 6648} 6649 6650jQuery.Animation = jQuery.extend( Animation, { 6651 6652 tweener: function( props, callback ) { 6653 if ( jQuery.isFunction( props ) ) { 6654 callback = props; 6655 props = [ "*" ]; 6656 } else { 6657 props = props.split(" "); 6658 } 6659 6660 var prop, 6661 index = 0, 6662 length = props.length; 6663 6664 for ( ; index < length ; index++ ) { 6665 prop = props[ index ]; 6666 tweeners[ prop ] = tweeners[ prop ] || []; 6667 tweeners[ prop ].unshift( callback ); 6668 } 6669 }, 6670 6671 prefilter: function( callback, prepend ) { 6672 if ( prepend ) { 6673 animationPrefilters.unshift( callback ); 6674 } else { 6675 animationPrefilters.push( callback ); 6676 } 6677 } 6678}); 6679 6680jQuery.speed = function( speed, easing, fn ) { 6681 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 6682 complete: fn || !fn && easing || 6683 jQuery.isFunction( speed ) && speed, 6684 duration: speed, 6685 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 6686 }; 6687 6688 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 6689 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 6690 6691 // Normalize opt.queue - true/undefined/null -> "fx" 6692 if ( opt.queue == null || opt.queue === true ) { 6693 opt.queue = "fx"; 6694 } 6695 6696 // Queueing 6697 opt.old = opt.complete; 6698 6699 opt.complete = function() { 6700 if ( jQuery.isFunction( opt.old ) ) { 6701 opt.old.call( this ); 6702 } 6703 6704 if ( opt.queue ) { 6705 jQuery.dequeue( this, opt.queue ); 6706 } 6707 }; 6708 6709 return opt; 6710}; 6711 6712jQuery.fn.extend({ 6713 fadeTo: function( speed, to, easing, callback ) { 6714 6715 // Show any hidden elements after setting opacity to 0 6716 return this.filter( isHidden ).css( "opacity", 0 ).show() 6717 6718 // Animate to the value specified 6719 .end().animate({ opacity: to }, speed, easing, callback ); 6720 }, 6721 animate: function( prop, speed, easing, callback ) { 6722 var empty = jQuery.isEmptyObject( prop ), 6723 optall = jQuery.speed( speed, easing, callback ), 6724 doAnimation = function() { 6725 // Operate on a copy of prop so per-property easing won't be lost 6726 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 6727 6728 // Empty animations, or finishing resolves immediately 6729 if ( empty || data_priv.get( this, "finish" ) ) { 6730 anim.stop( true ); 6731 } 6732 }; 6733 doAnimation.finish = doAnimation; 6734 6735 return empty || optall.queue === false ? 6736 this.each( doAnimation ) : 6737 this.queue( optall.queue, doAnimation ); 6738 }, 6739 stop: function( type, clearQueue, gotoEnd ) { 6740 var stopQueue = function( hooks ) { 6741 var stop = hooks.stop; 6742 delete hooks.stop; 6743 stop( gotoEnd ); 6744 }; 6745 6746 if ( typeof type !== "string" ) { 6747 gotoEnd = clearQueue; 6748 clearQueue = type; 6749 type = undefined; 6750 } 6751 if ( clearQueue && type !== false ) { 6752 this.queue( type || "fx", [] ); 6753 } 6754 6755 return this.each(function() { 6756 var dequeue = true, 6757 index = type != null && type + "queueHooks", 6758 timers = jQuery.timers, 6759 data = data_priv.get( this ); 6760 6761 if ( index ) { 6762 if ( data[ index ] && data[ index ].stop ) { 6763 stopQueue( data[ index ] ); 6764 } 6765 } else { 6766 for ( index in data ) { 6767 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 6768 stopQueue( data[ index ] ); 6769 } 6770 } 6771 } 6772 6773 for ( index = timers.length; index--; ) { 6774 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { 6775 timers[ index ].anim.stop( gotoEnd ); 6776 dequeue = false; 6777 timers.splice( index, 1 ); 6778 } 6779 } 6780 6781 // Start the next in the queue if the last step wasn't forced. 6782 // Timers currently will call their complete callbacks, which 6783 // will dequeue but only if they were gotoEnd. 6784 if ( dequeue || !gotoEnd ) { 6785 jQuery.dequeue( this, type ); 6786 } 6787 }); 6788 }, 6789 finish: function( type ) { 6790 if ( type !== false ) { 6791 type = type || "fx"; 6792 } 6793 return this.each(function() { 6794 var index, 6795 data = data_priv.get( this ), 6796 queue = data[ type + "queue" ], 6797 hooks = data[ type + "queueHooks" ], 6798 timers = jQuery.timers, 6799 length = queue ? queue.length : 0; 6800 6801 // Enable finishing flag on private data 6802 data.finish = true; 6803 6804 // Empty the queue first 6805 jQuery.queue( this, type, [] ); 6806 6807 if ( hooks && hooks.stop ) { 6808 hooks.stop.call( this, true ); 6809 } 6810 6811 // Look for any active animations, and finish them 6812 for ( index = timers.length; index--; ) { 6813 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 6814 timers[ index ].anim.stop( true ); 6815 timers.splice( index, 1 ); 6816 } 6817 } 6818 6819 // Look for any animations in the old queue and finish them 6820 for ( index = 0; index < length; index++ ) { 6821 if ( queue[ index ] && queue[ index ].finish ) { 6822 queue[ index ].finish.call( this ); 6823 } 6824 } 6825 6826 // Turn off finishing flag 6827 delete data.finish; 6828 }); 6829 } 6830}); 6831 6832jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { 6833 var cssFn = jQuery.fn[ name ]; 6834 jQuery.fn[ name ] = function( speed, easing, callback ) { 6835 return speed == null || typeof speed === "boolean" ? 6836 cssFn.apply( this, arguments ) : 6837 this.animate( genFx( name, true ), speed, easing, callback ); 6838 }; 6839}); 6840 6841// Generate shortcuts for custom animations 6842jQuery.each({ 6843 slideDown: genFx("show"), 6844 slideUp: genFx("hide"), 6845 slideToggle: genFx("toggle"), 6846 fadeIn: { opacity: "show" }, 6847 fadeOut: { opacity: "hide" }, 6848 fadeToggle: { opacity: "toggle" } 6849}, function( name, props ) { 6850 jQuery.fn[ name ] = function( speed, easing, callback ) { 6851 return this.animate( props, speed, easing, callback ); 6852 }; 6853}); 6854 6855jQuery.timers = []; 6856jQuery.fx.tick = function() { 6857 var timer, 6858 i = 0, 6859 timers = jQuery.timers; 6860 6861 fxNow = jQuery.now(); 6862 6863 for ( ; i < timers.length; i++ ) { 6864 timer = timers[ i ]; 6865 // Checks the timer has not already been removed 6866 if ( !timer() && timers[ i ] === timer ) { 6867 timers.splice( i--, 1 ); 6868 } 6869 } 6870 6871 if ( !timers.length ) { 6872 jQuery.fx.stop(); 6873 } 6874 fxNow = undefined; 6875}; 6876 6877jQuery.fx.timer = function( timer ) { 6878 jQuery.timers.push( timer ); 6879 if ( timer() ) { 6880 jQuery.fx.start(); 6881 } else { 6882 jQuery.timers.pop(); 6883 } 6884}; 6885 6886jQuery.fx.interval = 13; 6887 6888jQuery.fx.start = function() { 6889 if ( !timerId ) { 6890 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); 6891 } 6892}; 6893 6894jQuery.fx.stop = function() { 6895 clearInterval( timerId ); 6896 timerId = null; 6897}; 6898 6899jQuery.fx.speeds = { 6900 slow: 600, 6901 fast: 200, 6902 // Default speed 6903 _default: 400 6904}; 6905 6906 6907// Based off of the plugin by Clint Helfers, with permission. 6908// http://blindsignals.com/index.php/2009/07/jquery-delay/ 6909jQuery.fn.delay = function( time, type ) { 6910 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 6911 type = type || "fx"; 6912 6913 return this.queue( type, function( next, hooks ) { 6914 var timeout = setTimeout( next, time ); 6915 hooks.stop = function() { 6916 clearTimeout( timeout ); 6917 }; 6918 }); 6919}; 6920 6921 6922(function() { 6923 var input = document.createElement( "input" ), 6924 select = document.createElement( "select" ), 6925 opt = select.appendChild( document.createElement( "option" ) ); 6926 6927 input.type = "checkbox"; 6928 6929 // Support: iOS<=5.1, Android<=4.2+ 6930 // Default value for a checkbox should be "on" 6931 support.checkOn = input.value !== ""; 6932 6933 // Support: IE<=11+ 6934 // Must access selectedIndex to make default options select 6935 support.optSelected = opt.selected; 6936 6937 // Support: Android<=2.3 6938 // Options inside disabled selects are incorrectly marked as disabled 6939 select.disabled = true; 6940 support.optDisabled = !opt.disabled; 6941 6942 // Support: IE<=11+ 6943 // An input loses its value after becoming a radio 6944 input = document.createElement( "input" ); 6945 input.value = "t"; 6946 input.type = "radio"; 6947 support.radioValue = input.value === "t"; 6948})(); 6949 6950 6951var nodeHook, boolHook, 6952 attrHandle = jQuery.expr.attrHandle; 6953 6954jQuery.fn.extend({ 6955 attr: function( name, value ) { 6956 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 6957 }, 6958 6959 removeAttr: function( name ) { 6960 return this.each(function() { 6961 jQuery.removeAttr( this, name ); 6962 }); 6963 } 6964}); 6965 6966jQuery.extend({ 6967 attr: function( elem, name, value ) { 6968 var hooks, ret, 6969 nType = elem.nodeType; 6970 6971 // don't get/set attributes on text, comment and attribute nodes 6972 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 6973 return; 6974 } 6975 6976 // Fallback to prop when attributes are not supported 6977 if ( typeof elem.getAttribute === strundefined ) { 6978 return jQuery.prop( elem, name, value ); 6979 } 6980 6981 // All attributes are lowercase 6982 // Grab necessary hook if one is defined 6983 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 6984 name = name.toLowerCase(); 6985 hooks = jQuery.attrHooks[ name ] || 6986 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); 6987 } 6988 6989 if ( value !== undefined ) { 6990 6991 if ( value === null ) { 6992 jQuery.removeAttr( elem, name ); 6993 6994 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 6995 return ret; 6996 6997 } else { 6998 elem.setAttribute( name, value + "" ); 6999 return value; 7000 } 7001 7002 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 7003 return ret; 7004 7005 } else { 7006 ret = jQuery.find.attr( elem, name ); 7007 7008 // Non-existent attributes return null, we normalize to undefined 7009 return ret == null ? 7010 undefined : 7011 ret; 7012 } 7013 }, 7014 7015 removeAttr: function( elem, value ) { 7016 var name, propName, 7017 i = 0, 7018 attrNames = value && value.match( rnotwhite ); 7019 7020 if ( attrNames && elem.nodeType === 1 ) { 7021 while ( (name = attrNames[i++]) ) { 7022 propName = jQuery.propFix[ name ] || name; 7023 7024 // Boolean attributes get special treatment (#10870) 7025 if ( jQuery.expr.match.bool.test( name ) ) { 7026 // Set corresponding property to false 7027 elem[ propName ] = false; 7028 } 7029 7030 elem.removeAttribute( name ); 7031 } 7032 } 7033 }, 7034 7035 attrHooks: { 7036 type: { 7037 set: function( elem, value ) { 7038 if ( !support.radioValue && value === "radio" && 7039 jQuery.nodeName( elem, "input" ) ) { 7040 var val = elem.value; 7041 elem.setAttribute( "type", value ); 7042 if ( val ) { 7043 elem.value = val; 7044 } 7045 return value; 7046 } 7047 } 7048 } 7049 } 7050}); 7051 7052// Hooks for boolean attributes 7053boolHook = { 7054 set: function( elem, value, name ) { 7055 if ( value === false ) { 7056 // Remove boolean attributes when set to false 7057 jQuery.removeAttr( elem, name ); 7058 } else { 7059 elem.setAttribute( name, name ); 7060 } 7061 return name; 7062 } 7063}; 7064jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 7065 var getter = attrHandle[ name ] || jQuery.find.attr; 7066 7067 attrHandle[ name ] = function( elem, name, isXML ) { 7068 var ret, handle; 7069 if ( !isXML ) { 7070 // Avoid an infinite loop by temporarily removing this function from the getter 7071 handle = attrHandle[ name ]; 7072 attrHandle[ name ] = ret; 7073 ret = getter( elem, name, isXML ) != null ? 7074 name.toLowerCase() : 7075 null; 7076 attrHandle[ name ] = handle; 7077 } 7078 return ret; 7079 }; 7080}); 7081 7082 7083 7084 7085var rfocusable = /^(?:input|select|textarea|button)$/i; 7086 7087jQuery.fn.extend({ 7088 prop: function( name, value ) { 7089 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 7090 }, 7091 7092 removeProp: function( name ) { 7093 return this.each(function() { 7094 delete this[ jQuery.propFix[ name ] || name ]; 7095 }); 7096 } 7097}); 7098 7099jQuery.extend({ 7100 propFix: { 7101 "for": "htmlFor", 7102 "class": "className" 7103 }, 7104 7105 prop: function( elem, name, value ) { 7106 var ret, hooks, notxml, 7107 nType = elem.nodeType; 7108 7109 // Don't get/set properties on text, comment and attribute nodes 7110 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 7111 return; 7112 } 7113 7114 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 7115 7116 if ( notxml ) { 7117 // Fix name and attach hooks 7118 name = jQuery.propFix[ name ] || name; 7119 hooks = jQuery.propHooks[ name ]; 7120 } 7121 7122 if ( value !== undefined ) { 7123 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? 7124 ret : 7125 ( elem[ name ] = value ); 7126 7127 } else { 7128 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? 7129 ret : 7130 elem[ name ]; 7131 } 7132 }, 7133 7134 propHooks: { 7135 tabIndex: { 7136 get: function( elem ) { 7137 return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ? 7138 elem.tabIndex : 7139 -1; 7140 } 7141 } 7142 } 7143}); 7144 7145if ( !support.optSelected ) { 7146 jQuery.propHooks.selected = { 7147 get: function( elem ) { 7148 var parent = elem.parentNode; 7149 if ( parent && parent.parentNode ) { 7150 parent.parentNode.selectedIndex; 7151 } 7152 return null; 7153 } 7154 }; 7155} 7156 7157jQuery.each([ 7158 "tabIndex", 7159 "readOnly", 7160 "maxLength", 7161 "cellSpacing", 7162 "cellPadding", 7163 "rowSpan", 7164 "colSpan", 7165 "useMap", 7166 "frameBorder", 7167 "contentEditable" 7168], function() { 7169 jQuery.propFix[ this.toLowerCase() ] = this; 7170}); 7171 7172 7173 7174 7175var rclass = /[\t\r\n\f]/g; 7176 7177jQuery.fn.extend({ 7178 addClass: function( value ) { 7179 var classes, elem, cur, clazz, j, finalValue, 7180 proceed = typeof value === "string" && value, 7181 i = 0, 7182 len = this.length; 7183 7184 if ( jQuery.isFunction( value ) ) { 7185 return this.each(function( j ) { 7186 jQuery( this ).addClass( value.call( this, j, this.className ) ); 7187 }); 7188 } 7189 7190 if ( proceed ) { 7191 // The disjunction here is for better compressibility (see removeClass) 7192 classes = ( value || "" ).match( rnotwhite ) || []; 7193 7194 for ( ; i < len; i++ ) { 7195 elem = this[ i ]; 7196 cur = elem.nodeType === 1 && ( elem.className ? 7197 ( " " + elem.className + " " ).replace( rclass, " " ) : 7198 " " 7199 ); 7200 7201 if ( cur ) { 7202 j = 0; 7203 while ( (clazz = classes[j++]) ) { 7204 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 7205 cur += clazz + " "; 7206 } 7207 } 7208 7209 // only assign if different to avoid unneeded rendering. 7210 finalValue = jQuery.trim( cur ); 7211 if ( elem.className !== finalValue ) { 7212 elem.className = finalValue; 7213 } 7214 } 7215 } 7216 } 7217 7218 return this; 7219 }, 7220 7221 removeClass: function( value ) { 7222 var classes, elem, cur, clazz, j, finalValue, 7223 proceed = arguments.length === 0 || typeof value === "string" && value, 7224 i = 0, 7225 len = this.length; 7226 7227 if ( jQuery.isFunction( value ) ) { 7228 return this.each(function( j ) { 7229 jQuery( this ).removeClass( value.call( this, j, this.className ) ); 7230 }); 7231 } 7232 if ( proceed ) { 7233 classes = ( value || "" ).match( rnotwhite ) || []; 7234 7235 for ( ; i < len; i++ ) { 7236 elem = this[ i ]; 7237 // This expression is here for better compressibility (see addClass) 7238 cur = elem.nodeType === 1 && ( elem.className ? 7239 ( " " + elem.className + " " ).replace( rclass, " " ) : 7240 "" 7241 ); 7242 7243 if ( cur ) { 7244 j = 0; 7245 while ( (clazz = classes[j++]) ) { 7246 // Remove *all* instances 7247 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { 7248 cur = cur.replace( " " + clazz + " ", " " ); 7249 } 7250 } 7251 7252 // Only assign if different to avoid unneeded rendering. 7253 finalValue = value ? jQuery.trim( cur ) : ""; 7254 if ( elem.className !== finalValue ) { 7255 elem.className = finalValue; 7256 } 7257 } 7258 } 7259 } 7260 7261 return this; 7262 }, 7263 7264 toggleClass: function( value, stateVal ) { 7265 var type = typeof value; 7266 7267 if ( typeof stateVal === "boolean" && type === "string" ) { 7268 return stateVal ? this.addClass( value ) : this.removeClass( value ); 7269 } 7270 7271 if ( jQuery.isFunction( value ) ) { 7272 return this.each(function( i ) { 7273 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); 7274 }); 7275 } 7276 7277 return this.each(function() { 7278 if ( type === "string" ) { 7279 // Toggle individual class names 7280 var className, 7281 i = 0, 7282 self = jQuery( this ), 7283 classNames = value.match( rnotwhite ) || []; 7284 7285 while ( (className = classNames[ i++ ]) ) { 7286 // Check each className given, space separated list 7287 if ( self.hasClass( className ) ) { 7288 self.removeClass( className ); 7289 } else { 7290 self.addClass( className ); 7291 } 7292 } 7293 7294 // Toggle whole class name 7295 } else if ( type === strundefined || type === "boolean" ) { 7296 if ( this.className ) { 7297 // store className if set 7298 data_priv.set( this, "__className__", this.className ); 7299 } 7300 7301 // If the element has a class name or if we're passed `false`, 7302 // then remove the whole classname (if there was one, the above saved it). 7303 // Otherwise bring back whatever was previously saved (if anything), 7304 // falling back to the empty string if nothing was stored. 7305 this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || ""; 7306 } 7307 }); 7308 }, 7309 7310 hasClass: function( selector ) { 7311 var className = " " + selector + " ", 7312 i = 0, 7313 l = this.length; 7314 for ( ; i < l; i++ ) { 7315 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { 7316 return true; 7317 } 7318 } 7319 7320 return false; 7321 } 7322}); 7323 7324 7325 7326 7327var rreturn = /\r/g; 7328 7329jQuery.fn.extend({ 7330 val: function( value ) { 7331 var hooks, ret, isFunction, 7332 elem = this[0]; 7333 7334 if ( !arguments.length ) { 7335 if ( elem ) { 7336 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 7337 7338 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { 7339 return ret; 7340 } 7341 7342 ret = elem.value; 7343 7344 return typeof ret === "string" ? 7345 // Handle most common string cases 7346 ret.replace(rreturn, "") : 7347 // Handle cases where value is null/undef or number 7348 ret == null ? "" : ret; 7349 } 7350 7351 return; 7352 } 7353 7354 isFunction = jQuery.isFunction( value ); 7355 7356 return this.each(function( i ) { 7357 var val; 7358 7359 if ( this.nodeType !== 1 ) { 7360 return; 7361 } 7362 7363 if ( isFunction ) { 7364 val = value.call( this, i, jQuery( this ).val() ); 7365 } else { 7366 val = value; 7367 } 7368 7369 // Treat null/undefined as ""; convert numbers to string 7370 if ( val == null ) { 7371 val = ""; 7372 7373 } else if ( typeof val === "number" ) { 7374 val += ""; 7375 7376 } else if ( jQuery.isArray( val ) ) { 7377 val = jQuery.map( val, function( value ) { 7378 return value == null ? "" : value + ""; 7379 }); 7380 } 7381 7382 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 7383 7384 // If set returns undefined, fall back to normal setting 7385 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 7386 this.value = val; 7387 } 7388 }); 7389 } 7390}); 7391 7392jQuery.extend({ 7393 valHooks: { 7394 option: { 7395 get: function( elem ) { 7396 var val = jQuery.find.attr( elem, "value" ); 7397 return val != null ? 7398 val : 7399 // Support: IE10-11+ 7400 // option.text throws exceptions (#14686, #14858) 7401 jQuery.trim( jQuery.text( elem ) ); 7402 } 7403 }, 7404 select: { 7405 get: function( elem ) { 7406 var value, option, 7407 options = elem.options, 7408 index = elem.selectedIndex, 7409 one = elem.type === "select-one" || index < 0, 7410 values = one ? null : [], 7411 max = one ? index + 1 : options.length, 7412 i = index < 0 ? 7413 max : 7414 one ? index : 0; 7415 7416 // Loop through all the selected options 7417 for ( ; i < max; i++ ) { 7418 option = options[ i ]; 7419 7420 // IE6-9 doesn't update selected after form reset (#2551) 7421 if ( ( option.selected || i === index ) && 7422 // Don't return options that are disabled or in a disabled optgroup 7423 ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && 7424 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 7425 7426 // Get the specific value for the option 7427 value = jQuery( option ).val(); 7428 7429 // We don't need an array for one selects 7430 if ( one ) { 7431 return value; 7432 } 7433 7434 // Multi-Selects return an array 7435 values.push( value ); 7436 } 7437 } 7438 7439 return values; 7440 }, 7441 7442 set: function( elem, value ) { 7443 var optionSet, option, 7444 options = elem.options, 7445 values = jQuery.makeArray( value ), 7446 i = options.length; 7447 7448 while ( i-- ) { 7449 option = options[ i ]; 7450 if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) { 7451 optionSet = true; 7452 } 7453 } 7454 7455 // Force browsers to behave consistently when non-matching value is set 7456 if ( !optionSet ) { 7457 elem.selectedIndex = -1; 7458 } 7459 return values; 7460 } 7461 } 7462 } 7463}); 7464 7465// Radios and checkboxes getter/setter 7466jQuery.each([ "radio", "checkbox" ], function() { 7467 jQuery.valHooks[ this ] = { 7468 set: function( elem, value ) { 7469 if ( jQuery.isArray( value ) ) { 7470 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); 7471 } 7472 } 7473 }; 7474 if ( !support.checkOn ) { 7475 jQuery.valHooks[ this ].get = function( elem ) { 7476 return elem.getAttribute("value") === null ? "on" : elem.value; 7477 }; 7478 } 7479}); 7480 7481 7482 7483 7484// Return jQuery for attributes-only inclusion 7485 7486 7487jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 7488 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 7489 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 7490 7491 // Handle event binding 7492 jQuery.fn[ name ] = function( data, fn ) { 7493 return arguments.length > 0 ? 7494 this.on( name, null, data, fn ) : 7495 this.trigger( name ); 7496 }; 7497}); 7498 7499jQuery.fn.extend({ 7500 hover: function( fnOver, fnOut ) { 7501 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 7502 }, 7503 7504 bind: function( types, data, fn ) { 7505 return this.on( types, null, data, fn ); 7506 }, 7507 unbind: function( types, fn ) { 7508 return this.off( types, null, fn ); 7509 }, 7510 7511 delegate: function( selector, types, data, fn ) { 7512 return this.on( types, selector, data, fn ); 7513 }, 7514 undelegate: function( selector, types, fn ) { 7515 // ( namespace ) or ( selector, types [, fn] ) 7516 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 7517 } 7518}); 7519 7520 7521var nonce = jQuery.now(); 7522 7523var rquery = (/\?/); 7524 7525 7526 7527// Support: Android 2.3 7528// Workaround failure to string-cast null input 7529jQuery.parseJSON = function( data ) { 7530 return JSON.parse( data + "" ); 7531}; 7532 7533 7534// Cross-browser xml parsing 7535jQuery.parseXML = function( data ) { 7536 var xml, tmp; 7537 if ( !data || typeof data !== "string" ) { 7538 return null; 7539 } 7540 7541 // Support: IE9 7542 try { 7543 tmp = new DOMParser(); 7544 xml = tmp.parseFromString( data, "text/xml" ); 7545 } catch ( e ) { 7546 xml = undefined; 7547 } 7548 7549 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 7550 jQuery.error( "Invalid XML: " + data ); 7551 } 7552 return xml; 7553}; 7554 7555 7556var 7557 rhash = /#.*$/, 7558 rts = /([?&])_=[^&]*/, 7559 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 7560 // #7653, #8125, #8152: local protocol detection 7561 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 7562 rnoContent = /^(?:GET|HEAD)$/, 7563 rprotocol = /^\/\//, 7564 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 7565 7566 /* Prefilters 7567 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 7568 * 2) These are called: 7569 * - BEFORE asking for a transport 7570 * - AFTER param serialization (s.data is a string if s.processData is true) 7571 * 3) key is the dataType 7572 * 4) the catchall symbol "*" can be used 7573 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 7574 */ 7575 prefilters = {}, 7576 7577 /* Transports bindings 7578 * 1) key is the dataType 7579 * 2) the catchall symbol "*" can be used 7580 * 3) selection will start with transport dataType and THEN go to "*" if needed 7581 */ 7582 transports = {}, 7583 7584 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 7585 allTypes = "*/".concat( "*" ), 7586 7587 // Document location 7588 ajaxLocation = window.location.href, 7589 7590 // Segment location into parts 7591 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 7592 7593// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 7594function addToPrefiltersOrTransports( structure ) { 7595 7596 // dataTypeExpression is optional and defaults to "*" 7597 return function( dataTypeExpression, func ) { 7598 7599 if ( typeof dataTypeExpression !== "string" ) { 7600 func = dataTypeExpression; 7601 dataTypeExpression = "*"; 7602 } 7603 7604 var dataType, 7605 i = 0, 7606 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 7607 7608 if ( jQuery.isFunction( func ) ) { 7609 // For each dataType in the dataTypeExpression 7610 while ( (dataType = dataTypes[i++]) ) { 7611 // Prepend if requested 7612 if ( dataType[0] === "+" ) { 7613 dataType = dataType.slice( 1 ) || "*"; 7614 (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); 7615 7616 // Otherwise append 7617 } else { 7618 (structure[ dataType ] = structure[ dataType ] || []).push( func ); 7619 } 7620 } 7621 } 7622 }; 7623} 7624 7625// Base inspection function for prefilters and transports 7626function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 7627 7628 var inspected = {}, 7629 seekingTransport = ( structure === transports ); 7630 7631 function inspect( dataType ) { 7632 var selected; 7633 inspected[ dataType ] = true; 7634 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 7635 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 7636 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 7637 options.dataTypes.unshift( dataTypeOrTransport ); 7638 inspect( dataTypeOrTransport ); 7639 return false; 7640 } else if ( seekingTransport ) { 7641 return !( selected = dataTypeOrTransport ); 7642 } 7643 }); 7644 return selected; 7645 } 7646 7647 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 7648} 7649 7650// A special extend for ajax options 7651// that takes "flat" options (not to be deep extended) 7652// Fixes #9887 7653function ajaxExtend( target, src ) { 7654 var key, deep, 7655 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 7656 7657 for ( key in src ) { 7658 if ( src[ key ] !== undefined ) { 7659 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; 7660 } 7661 } 7662 if ( deep ) { 7663 jQuery.extend( true, target, deep ); 7664 } 7665 7666 return target; 7667} 7668 7669/* Handles responses to an ajax request: 7670 * - finds the right dataType (mediates between content-type and expected dataType) 7671 * - returns the corresponding response 7672 */ 7673function ajaxHandleResponses( s, jqXHR, responses ) { 7674 7675 var ct, type, finalDataType, firstDataType, 7676 contents = s.contents, 7677 dataTypes = s.dataTypes; 7678 7679 // Remove auto dataType and get content-type in the process 7680 while ( dataTypes[ 0 ] === "*" ) { 7681 dataTypes.shift(); 7682 if ( ct === undefined ) { 7683 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 7684 } 7685 } 7686 7687 // Check if we're dealing with a known content-type 7688 if ( ct ) { 7689 for ( type in contents ) { 7690 if ( contents[ type ] && contents[ type ].test( ct ) ) { 7691 dataTypes.unshift( type ); 7692 break; 7693 } 7694 } 7695 } 7696 7697 // Check to see if we have a response for the expected dataType 7698 if ( dataTypes[ 0 ] in responses ) { 7699 finalDataType = dataTypes[ 0 ]; 7700 } else { 7701 // Try convertible dataTypes 7702 for ( type in responses ) { 7703 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { 7704 finalDataType = type; 7705 break; 7706 } 7707 if ( !firstDataType ) { 7708 firstDataType = type; 7709 } 7710 } 7711 // Or just use first one 7712 finalDataType = finalDataType || firstDataType; 7713 } 7714 7715 // If we found a dataType 7716 // We add the dataType to the list if needed 7717 // and return the corresponding response 7718 if ( finalDataType ) { 7719 if ( finalDataType !== dataTypes[ 0 ] ) { 7720 dataTypes.unshift( finalDataType ); 7721 } 7722 return responses[ finalDataType ]; 7723 } 7724} 7725 7726/* Chain conversions given the request and the original response 7727 * Also sets the responseXXX fields on the jqXHR instance 7728 */ 7729function ajaxConvert( s, response, jqXHR, isSuccess ) { 7730 var conv2, current, conv, tmp, prev, 7731 converters = {}, 7732 // Work with a copy of dataTypes in case we need to modify it for conversion 7733 dataTypes = s.dataTypes.slice(); 7734 7735 // Create converters map with lowercased keys 7736 if ( dataTypes[ 1 ] ) { 7737 for ( conv in s.converters ) { 7738 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 7739 } 7740 } 7741 7742 current = dataTypes.shift(); 7743 7744 // Convert to each sequential dataType 7745 while ( current ) { 7746 7747 if ( s.responseFields[ current ] ) { 7748 jqXHR[ s.responseFields[ current ] ] = response; 7749 } 7750 7751 // Apply the dataFilter if provided 7752 if ( !prev && isSuccess && s.dataFilter ) { 7753 response = s.dataFilter( response, s.dataType ); 7754 } 7755 7756 prev = current; 7757 current = dataTypes.shift(); 7758 7759 if ( current ) { 7760 7761 // There's only work to do if current dataType is non-auto 7762 if ( current === "*" ) { 7763 7764 current = prev; 7765 7766 // Convert response if prev dataType is non-auto and differs from current 7767 } else if ( prev !== "*" && prev !== current ) { 7768 7769 // Seek a direct converter 7770 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 7771 7772 // If none found, seek a pair 7773 if ( !conv ) { 7774 for ( conv2 in converters ) { 7775 7776 // If conv2 outputs current 7777 tmp = conv2.split( " " ); 7778 if ( tmp[ 1 ] === current ) { 7779 7780 // If prev can be converted to accepted input 7781 conv = converters[ prev + " " + tmp[ 0 ] ] || 7782 converters[ "* " + tmp[ 0 ] ]; 7783 if ( conv ) { 7784 // Condense equivalence converters 7785 if ( conv === true ) { 7786 conv = converters[ conv2 ]; 7787 7788 // Otherwise, insert the intermediate dataType 7789 } else if ( converters[ conv2 ] !== true ) { 7790 current = tmp[ 0 ]; 7791 dataTypes.unshift( tmp[ 1 ] ); 7792 } 7793 break; 7794 } 7795 } 7796 } 7797 } 7798 7799 // Apply converter (if not an equivalence) 7800 if ( conv !== true ) { 7801 7802 // Unless errors are allowed to bubble, catch and return them 7803 if ( conv && s[ "throws" ] ) { 7804 response = conv( response ); 7805 } else { 7806 try { 7807 response = conv( response ); 7808 } catch ( e ) { 7809 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; 7810 } 7811 } 7812 } 7813 } 7814 } 7815 } 7816 7817 return { state: "success", data: response }; 7818} 7819 7820jQuery.extend({ 7821 7822 // Counter for holding the number of active queries 7823 active: 0, 7824 7825 // Last-Modified header cache for next request 7826 lastModified: {}, 7827 etag: {}, 7828 7829 ajaxSettings: { 7830 url: ajaxLocation, 7831 type: "GET", 7832 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 7833 global: true, 7834 processData: true, 7835 async: true, 7836 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 7837 /* 7838 timeout: 0, 7839 data: null, 7840 dataType: null, 7841 username: null, 7842 password: null, 7843 cache: null, 7844 throws: false, 7845 traditional: false, 7846 headers: {}, 7847 */ 7848 7849 accepts: { 7850 "*": allTypes, 7851 text: "text/plain", 7852 html: "text/html", 7853 xml: "application/xml, text/xml", 7854 json: "application/json, text/javascript" 7855 }, 7856 7857 contents: { 7858 xml: /xml/, 7859 html: /html/, 7860 json: /json/ 7861 }, 7862 7863 responseFields: { 7864 xml: "responseXML", 7865 text: "responseText", 7866 json: "responseJSON" 7867 }, 7868 7869 // Data converters 7870 // Keys separate source (or catchall "*") and destination types with a single space 7871 converters: { 7872 7873 // Convert anything to text 7874 "* text": String, 7875 7876 // Text to html (true = no transformation) 7877 "text html": true, 7878 7879 // Evaluate text as a json expression 7880 "text json": jQuery.parseJSON, 7881 7882 // Parse text as xml 7883 "text xml": jQuery.parseXML 7884 }, 7885 7886 // For options that shouldn't be deep extended: 7887 // you can add your own custom options here if 7888 // and when you create one that shouldn't be 7889 // deep extended (see ajaxExtend) 7890 flatOptions: { 7891 url: true, 7892 context: true 7893 } 7894 }, 7895 7896 // Creates a full fledged settings object into target 7897 // with both ajaxSettings and settings fields. 7898 // If target is omitted, writes into ajaxSettings. 7899 ajaxSetup: function( target, settings ) { 7900 return settings ? 7901 7902 // Building a settings object 7903 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 7904 7905 // Extending ajaxSettings 7906 ajaxExtend( jQuery.ajaxSettings, target ); 7907 }, 7908 7909 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 7910 ajaxTransport: addToPrefiltersOrTransports( transports ), 7911 7912 // Main method 7913 ajax: function( url, options ) { 7914 7915 // If url is an object, simulate pre-1.5 signature 7916 if ( typeof url === "object" ) { 7917 options = url; 7918 url = undefined; 7919 } 7920 7921 // Force options to be an object 7922 options = options || {}; 7923 7924 var transport, 7925 // URL without anti-cache param 7926 cacheURL, 7927 // Response headers 7928 responseHeadersString, 7929 responseHeaders, 7930 // timeout handle 7931 timeoutTimer, 7932 // Cross-domain detection vars 7933 parts, 7934 // To know if global events are to be dispatched 7935 fireGlobals, 7936 // Loop variable 7937 i, 7938 // Create the final options object 7939 s = jQuery.ajaxSetup( {}, options ), 7940 // Callbacks context 7941 callbackContext = s.context || s, 7942 // Context for global events is callbackContext if it is a DOM node or jQuery collection 7943 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? 7944 jQuery( callbackContext ) : 7945 jQuery.event, 7946 // Deferreds 7947 deferred = jQuery.Deferred(), 7948 completeDeferred = jQuery.Callbacks("once memory"), 7949 // Status-dependent callbacks 7950 statusCode = s.statusCode || {}, 7951 // Headers (they are sent all at once) 7952 requestHeaders = {}, 7953 requestHeadersNames = {}, 7954 // The jqXHR state 7955 state = 0, 7956 // Default abort message 7957 strAbort = "canceled", 7958 // Fake xhr 7959 jqXHR = { 7960 readyState: 0, 7961 7962 // Builds headers hashtable if needed 7963 getResponseHeader: function( key ) { 7964 var match; 7965 if ( state === 2 ) { 7966 if ( !responseHeaders ) { 7967 responseHeaders = {}; 7968 while ( (match = rheaders.exec( responseHeadersString )) ) { 7969 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; 7970 } 7971 } 7972 match = responseHeaders[ key.toLowerCase() ]; 7973 } 7974 return match == null ? null : match; 7975 }, 7976 7977 // Raw string 7978 getAllResponseHeaders: function() { 7979 return state === 2 ? responseHeadersString : null; 7980 }, 7981 7982 // Caches the header 7983 setRequestHeader: function( name, value ) { 7984 var lname = name.toLowerCase(); 7985 if ( !state ) { 7986 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 7987 requestHeaders[ name ] = value; 7988 } 7989 return this; 7990 }, 7991 7992 // Overrides response content-type header 7993 overrideMimeType: function( type ) { 7994 if ( !state ) { 7995 s.mimeType = type; 7996 } 7997 return this; 7998 }, 7999 8000 // Status-dependent callbacks 8001 statusCode: function( map ) { 8002 var code; 8003 if ( map ) { 8004 if ( state < 2 ) { 8005 for ( code in map ) { 8006 // Lazy-add the new callback in a way that preserves old ones 8007 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 8008 } 8009 } else { 8010 // Execute the appropriate callbacks 8011 jqXHR.always( map[ jqXHR.status ] ); 8012 } 8013 } 8014 return this; 8015 }, 8016 8017 // Cancel the request 8018 abort: function( statusText ) { 8019 var finalText = statusText || strAbort; 8020 if ( transport ) { 8021 transport.abort( finalText ); 8022 } 8023 done( 0, finalText ); 8024 return this; 8025 } 8026 }; 8027 8028 // Attach deferreds 8029 deferred.promise( jqXHR ).complete = completeDeferred.add; 8030 jqXHR.success = jqXHR.done; 8031 jqXHR.error = jqXHR.fail; 8032 8033 // Remove hash character (#7531: and string promotion) 8034 // Add protocol if not provided (prefilters might expect it) 8035 // Handle falsy url in the settings object (#10093: consistency with old signature) 8036 // We also use the url parameter if available 8037 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ) 8038 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 8039 8040 // Alias method option to type as per ticket #12004 8041 s.type = options.method || options.type || s.method || s.type; 8042 8043 // Extract dataTypes list 8044 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 8045 8046 // A cross-domain request is in order when we have a protocol:host:port mismatch 8047 if ( s.crossDomain == null ) { 8048 parts = rurl.exec( s.url.toLowerCase() ); 8049 s.crossDomain = !!( parts && 8050 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 8051 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== 8052 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) 8053 ); 8054 } 8055 8056 // Convert data if not already a string 8057 if ( s.data && s.processData && typeof s.data !== "string" ) { 8058 s.data = jQuery.param( s.data, s.traditional ); 8059 } 8060 8061 // Apply prefilters 8062 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 8063 8064 // If request was aborted inside a prefilter, stop there 8065 if ( state === 2 ) { 8066 return jqXHR; 8067 } 8068 8069 // We can fire global events as of now if asked to 8070 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 8071 fireGlobals = jQuery.event && s.global; 8072 8073 // Watch for a new set of requests 8074 if ( fireGlobals && jQuery.active++ === 0 ) { 8075 jQuery.event.trigger("ajaxStart"); 8076 } 8077 8078 // Uppercase the type 8079 s.type = s.type.toUpperCase(); 8080 8081 // Determine if request has content 8082 s.hasContent = !rnoContent.test( s.type ); 8083 8084 // Save the URL in case we're toying with the If-Modified-Since 8085 // and/or If-None-Match header later on 8086 cacheURL = s.url; 8087 8088 // More options handling for requests with no content 8089 if ( !s.hasContent ) { 8090 8091 // If data is available, append data to url 8092 if ( s.data ) { 8093 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 8094 // #9682: remove data so that it's not used in an eventual retry 8095 delete s.data; 8096 } 8097 8098 // Add anti-cache in url if needed 8099 if ( s.cache === false ) { 8100 s.url = rts.test( cacheURL ) ? 8101 8102 // If there is already a '_' parameter, set its value 8103 cacheURL.replace( rts, "$1_=" + nonce++ ) : 8104 8105 // Otherwise add one to the end 8106 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 8107 } 8108 } 8109 8110 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8111 if ( s.ifModified ) { 8112 if ( jQuery.lastModified[ cacheURL ] ) { 8113 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 8114 } 8115 if ( jQuery.etag[ cacheURL ] ) { 8116 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 8117 } 8118 } 8119 8120 // Set the correct header, if data is being sent 8121 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 8122 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 8123 } 8124 8125 // Set the Accepts header for the server, depending on the dataType 8126 jqXHR.setRequestHeader( 8127 "Accept", 8128 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? 8129 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 8130 s.accepts[ "*" ] 8131 ); 8132 8133 // Check for headers option 8134 for ( i in s.headers ) { 8135 jqXHR.setRequestHeader( i, s.headers[ i ] ); 8136 } 8137 8138 // Allow custom headers/mimetypes and early abort 8139 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 8140 // Abort if not done already and return 8141 return jqXHR.abort(); 8142 } 8143 8144 // Aborting is no longer a cancellation 8145 strAbort = "abort"; 8146 8147 // Install callbacks on deferreds 8148 for ( i in { success: 1, error: 1, complete: 1 } ) { 8149 jqXHR[ i ]( s[ i ] ); 8150 } 8151 8152 // Get transport 8153 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 8154 8155 // If no transport, we auto-abort 8156 if ( !transport ) { 8157 done( -1, "No Transport" ); 8158 } else { 8159 jqXHR.readyState = 1; 8160 8161 // Send global event 8162 if ( fireGlobals ) { 8163 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 8164 } 8165 // Timeout 8166 if ( s.async && s.timeout > 0 ) { 8167 timeoutTimer = setTimeout(function() { 8168 jqXHR.abort("timeout"); 8169 }, s.timeout ); 8170 } 8171 8172 try { 8173 state = 1; 8174 transport.send( requestHeaders, done ); 8175 } catch ( e ) { 8176 // Propagate exception as error if not done 8177 if ( state < 2 ) { 8178 done( -1, e ); 8179 // Simply rethrow otherwise 8180 } else { 8181 throw e; 8182 } 8183 } 8184 } 8185 8186 // Callback for when everything is done 8187 function done( status, nativeStatusText, responses, headers ) { 8188 var isSuccess, success, error, response, modified, 8189 statusText = nativeStatusText; 8190 8191 // Called once 8192 if ( state === 2 ) { 8193 return; 8194 } 8195 8196 // State is "done" now 8197 state = 2; 8198 8199 // Clear timeout if it exists 8200 if ( timeoutTimer ) { 8201 clearTimeout( timeoutTimer ); 8202 } 8203 8204 // Dereference transport for early garbage collection 8205 // (no matter how long the jqXHR object will be used) 8206 transport = undefined; 8207 8208 // Cache response headers 8209 responseHeadersString = headers || ""; 8210 8211 // Set readyState 8212 jqXHR.readyState = status > 0 ? 4 : 0; 8213 8214 // Determine if successful 8215 isSuccess = status >= 200 && status < 300 || status === 304; 8216 8217 // Get response data 8218 if ( responses ) { 8219 response = ajaxHandleResponses( s, jqXHR, responses ); 8220 } 8221 8222 // Convert no matter what (that way responseXXX fields are always set) 8223 response = ajaxConvert( s, response, jqXHR, isSuccess ); 8224 8225 // If successful, handle type chaining 8226 if ( isSuccess ) { 8227 8228 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8229 if ( s.ifModified ) { 8230 modified = jqXHR.getResponseHeader("Last-Modified"); 8231 if ( modified ) { 8232 jQuery.lastModified[ cacheURL ] = modified; 8233 } 8234 modified = jqXHR.getResponseHeader("etag"); 8235 if ( modified ) { 8236 jQuery.etag[ cacheURL ] = modified; 8237 } 8238 } 8239 8240 // if no content 8241 if ( status === 204 || s.type === "HEAD" ) { 8242 statusText = "nocontent"; 8243 8244 // if not modified 8245 } else if ( status === 304 ) { 8246 statusText = "notmodified"; 8247 8248 // If we have data, let's convert it 8249 } else { 8250 statusText = response.state; 8251 success = response.data; 8252 error = response.error; 8253 isSuccess = !error; 8254 } 8255 } else { 8256 // Extract error from statusText and normalize for non-aborts 8257 error = statusText; 8258 if ( status || !statusText ) { 8259 statusText = "error"; 8260 if ( status < 0 ) { 8261 status = 0; 8262 } 8263 } 8264 } 8265 8266 // Set data for the fake xhr object 8267 jqXHR.status = status; 8268 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 8269 8270 // Success/Error 8271 if ( isSuccess ) { 8272 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 8273 } else { 8274 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 8275 } 8276 8277 // Status-dependent callbacks 8278 jqXHR.statusCode( statusCode ); 8279 statusCode = undefined; 8280 8281 if ( fireGlobals ) { 8282 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 8283 [ jqXHR, s, isSuccess ? success : error ] ); 8284 } 8285 8286 // Complete 8287 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 8288 8289 if ( fireGlobals ) { 8290 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 8291 // Handle the global AJAX counter 8292 if ( !( --jQuery.active ) ) { 8293 jQuery.event.trigger("ajaxStop"); 8294 } 8295 } 8296 } 8297 8298 return jqXHR; 8299 }, 8300 8301 getJSON: function( url, data, callback ) { 8302 return jQuery.get( url, data, callback, "json" ); 8303 }, 8304 8305 getScript: function( url, callback ) { 8306 return jQuery.get( url, undefined, callback, "script" ); 8307 } 8308}); 8309 8310jQuery.each( [ "get", "post" ], function( i, method ) { 8311 jQuery[ method ] = function( url, data, callback, type ) { 8312 // Shift arguments if data argument was omitted 8313 if ( jQuery.isFunction( data ) ) { 8314 type = type || callback; 8315 callback = data; 8316 data = undefined; 8317 } 8318 8319 return jQuery.ajax({ 8320 url: url, 8321 type: method, 8322 dataType: type, 8323 data: data, 8324 success: callback 8325 }); 8326 }; 8327}); 8328 8329 8330jQuery._evalUrl = function( url ) { 8331 return jQuery.ajax({ 8332 url: url, 8333 type: "GET", 8334 dataType: "script", 8335 async: false, 8336 global: false, 8337 "throws": true 8338 }); 8339}; 8340 8341 8342jQuery.fn.extend({ 8343 wrapAll: function( html ) { 8344 var wrap; 8345 8346 if ( jQuery.isFunction( html ) ) { 8347 return this.each(function( i ) { 8348 jQuery( this ).wrapAll( html.call(this, i) ); 8349 }); 8350 } 8351 8352 if ( this[ 0 ] ) { 8353 8354 // The elements to wrap the target around 8355 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 8356 8357 if ( this[ 0 ].parentNode ) { 8358 wrap.insertBefore( this[ 0 ] ); 8359 } 8360 8361 wrap.map(function() { 8362 var elem = this; 8363 8364 while ( elem.firstElementChild ) { 8365 elem = elem.firstElementChild; 8366 } 8367 8368 return elem; 8369 }).append( this ); 8370 } 8371 8372 return this; 8373 }, 8374 8375 wrapInner: function( html ) { 8376 if ( jQuery.isFunction( html ) ) { 8377 return this.each(function( i ) { 8378 jQuery( this ).wrapInner( html.call(this, i) ); 8379 }); 8380 } 8381 8382 return this.each(function() { 8383 var self = jQuery( this ), 8384 contents = self.contents(); 8385 8386 if ( contents.length ) { 8387 contents.wrapAll( html ); 8388 8389 } else { 8390 self.append( html ); 8391 } 8392 }); 8393 }, 8394 8395 wrap: function( html ) { 8396 var isFunction = jQuery.isFunction( html ); 8397 8398 return this.each(function( i ) { 8399 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); 8400 }); 8401 }, 8402 8403 unwrap: function() { 8404 return this.parent().each(function() { 8405 if ( !jQuery.nodeName( this, "body" ) ) { 8406 jQuery( this ).replaceWith( this.childNodes ); 8407 } 8408 }).end(); 8409 } 8410}); 8411 8412 8413jQuery.expr.filters.hidden = function( elem ) { 8414 // Support: Opera <= 12.12 8415 // Opera reports offsetWidths and offsetHeights less than zero on some elements 8416 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; 8417}; 8418jQuery.expr.filters.visible = function( elem ) { 8419 return !jQuery.expr.filters.hidden( elem ); 8420}; 8421 8422 8423 8424 8425var r20 = /%20/g, 8426 rbracket = /\[\]$/, 8427 rCRLF = /\r?\n/g, 8428 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8429 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8430 8431function buildParams( prefix, obj, traditional, add ) { 8432 var name; 8433 8434 if ( jQuery.isArray( obj ) ) { 8435 // Serialize array item. 8436 jQuery.each( obj, function( i, v ) { 8437 if ( traditional || rbracket.test( prefix ) ) { 8438 // Treat each array item as a scalar. 8439 add( prefix, v ); 8440 8441 } else { 8442 // Item is non-scalar (array or object), encode its numeric index. 8443 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); 8444 } 8445 }); 8446 8447 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 8448 // Serialize object item. 8449 for ( name in obj ) { 8450 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8451 } 8452 8453 } else { 8454 // Serialize scalar item. 8455 add( prefix, obj ); 8456 } 8457} 8458 8459// Serialize an array of form elements or a set of 8460// key/values into a query string 8461jQuery.param = function( a, traditional ) { 8462 var prefix, 8463 s = [], 8464 add = function( key, value ) { 8465 // If value is a function, invoke it and return its value
vendor: 2,100 bytes, lines 8466-8537
8466 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 8467 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 8468 }; 8469 8470 // Set traditional to true for jQuery <= 1.3.2 behavior. 8471 if ( traditional === undefined ) { 8472 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 8473 } 8474 8475 // If an array was passed in, assume that it is an array of form elements. 8476 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 8477 // Serialize the form elements 8478 jQuery.each( a, function() { 8479 add( this.name, this.value ); 8480 }); 8481 8482 } else { 8483 // If traditional, encode the "old" way (the way 1.3.2 or older 8484 // did it), otherwise encode params recursively. 8485 for ( prefix in a ) { 8486 buildParams( prefix, a[ prefix ], traditional, add ); 8487 } 8488 } 8489 8490 // Return the resulting serialization 8491 return s.join( "&" ).replace( r20, "+" ); 8492}; 8493 8494jQuery.fn.extend({ 8495 serialize: function() { 8496 return jQuery.param( this.serializeArray() ); 8497 }, 8498 serializeArray: function() { 8499 return this.map(function() { 8500 // Can add propHook for "elements" to filter or add form elements 8501 var elements = jQuery.prop( this, "elements" ); 8502 return elements ? jQuery.makeArray( elements ) : this; 8503 }) 8504 .filter(function() { 8505 var type = this.type; 8506 8507 // Use .is( ":disabled" ) so that fieldset[disabled] works 8508 return this.name && !jQuery( this ).is( ":disabled" ) && 8509 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 8510 ( this.checked || !rcheckableType.test( type ) ); 8511 }) 8512 .map(function( i, elem ) { 8513 var val = jQuery( this ).val(); 8514 8515 return val == null ? 8516 null : 8517 jQuery.isArray( val ) ? 8518 jQuery.map( val, function( val ) { 8519 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8520 }) : 8521 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 8522 }).get(); 8523 } 8524}); 8525 8526 8527jQuery.ajaxSettings.xhr = function() { 8528 try { 8529 return new XMLHttpRequest(); 8530 } catch( e ) {} 8531}; 8532 8533var xhrId = 0, 8534 xhrCallbacks = {}, 8535 xhrSuccessStatus = { 8536 // file protocol always yields status code 0, assume 200 8537 0: 200,
vendor: 1,492 bytes, lines 8538-8586
8538 // Support: IE9 8539 // #1450: sometimes IE returns 1223 when it should be 204 8540 1223: 204 8541 }, 8542 xhrSupported = jQuery.ajaxSettings.xhr(); 8543 8544// Support: IE9 8545// Open requests must be manually aborted on unload (#5280) 8546// See https://support.microsoft.com/kb/2856746 for more info 8547if ( window.attachEvent ) { 8548 window.attachEvent( "onunload", function() { 8549 for ( var key in xhrCallbacks ) { 8550 xhrCallbacks[ key ](); 8551 } 8552 }); 8553} 8554 8555support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 8556support.ajax = xhrSupported = !!xhrSupported; 8557 8558jQuery.ajaxTransport(function( options ) { 8559 var callback; 8560 8561 // Cross domain only allowed if supported through XMLHttpRequest 8562 if ( support.cors || xhrSupported && !options.crossDomain ) { 8563 return { 8564 send: function( headers, complete ) { 8565 var i, 8566 xhr = options.xhr(), 8567 id = ++xhrId; 8568 8569 xhr.open( options.type, options.url, options.async, options.username, options.password ); 8570 8571 // Apply custom fields if provided 8572 if ( options.xhrFields ) { 8573 for ( i in options.xhrFields ) { 8574 xhr[ i ] = options.xhrFields[ i ]; 8575 } 8576 } 8577 8578 // Override mime type if needed 8579 if ( options.mimeType && xhr.overrideMimeType ) { 8580 xhr.overrideMimeType( options.mimeType ); 8581 } 8582 8583 // X-Requested-With header 8584 // For cross-domain requests, seeing as conditions for a preflight are 8585 // akin to a jigsaw puzzle, we simply never set it to be sure. 8586 // (it can always be set on a per-request basis or even using ajaxSetup)
vendor: 5,725 bytes, lines 8587-8813
8587 // For same-domain requests, won't change header if already provided. 8588 if ( !options.crossDomain && !headers["X-Requested-With"] ) { 8589 headers["X-Requested-With"] = "XMLHttpRequest"; 8590 } 8591 8592 // Set headers 8593 for ( i in headers ) { 8594 xhr.setRequestHeader( i, headers[ i ] ); 8595 } 8596 8597 // Callback 8598 callback = function( type ) { 8599 return function() { 8600 if ( callback ) { 8601 delete xhrCallbacks[ id ]; 8602 callback = xhr.onload = xhr.onerror = null; 8603 8604 if ( type === "abort" ) { 8605 xhr.abort(); 8606 } else if ( type === "error" ) { 8607 complete( 8608 // file: protocol always yields status 0; see #8605, #14207 8609 xhr.status, 8610 xhr.statusText 8611 ); 8612 } else { 8613 complete( 8614 xhrSuccessStatus[ xhr.status ] || xhr.status, 8615 xhr.statusText, 8616 // Support: IE9 8617 // Accessing binary-data responseText throws an exception 8618 // (#11426) 8619 typeof xhr.responseText === "string" ? { 8620 text: xhr.responseText 8621 } : undefined, 8622 xhr.getAllResponseHeaders() 8623 ); 8624 } 8625 } 8626 }; 8627 }; 8628 8629 // Listen to events 8630 xhr.onload = callback(); 8631 xhr.onerror = callback("error"); 8632 8633 // Create the abort callback 8634 callback = xhrCallbacks[ id ] = callback("abort"); 8635 8636 try { 8637 // Do send the request (this may raise an exception) 8638 xhr.send( options.hasContent && options.data || null ); 8639 } catch ( e ) { 8640 // #14683: Only rethrow if this hasn't been notified as an error yet 8641 if ( callback ) { 8642 throw e; 8643 } 8644 } 8645 }, 8646 8647 abort: function() { 8648 if ( callback ) { 8649 callback(); 8650 } 8651 } 8652 }; 8653 } 8654}); 8655 8656 8657 8658 8659// Install script dataType 8660jQuery.ajaxSetup({ 8661 accepts: { 8662 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 8663 }, 8664 contents: { 8665 script: /(?:java|ecma)script/ 8666 }, 8667 converters: { 8668 "text script": function( text ) { 8669 jQuery.globalEval( text ); 8670 return text; 8671 } 8672 } 8673}); 8674 8675// Handle cache's special case and crossDomain 8676jQuery.ajaxPrefilter( "script", function( s ) { 8677 if ( s.cache === undefined ) { 8678 s.cache = false; 8679 } 8680 if ( s.crossDomain ) { 8681 s.type = "GET"; 8682 } 8683}); 8684 8685// Bind script tag hack transport 8686jQuery.ajaxTransport( "script", function( s ) { 8687 // This transport only deals with cross domain requests 8688 if ( s.crossDomain ) { 8689 var script, callback; 8690 return { 8691 send: function( _, complete ) { 8692 script = jQuery("<script>").prop({ 8693 async: true, 8694 charset: s.scriptCharset, 8695 src: s.url 8696 }).on( 8697 "load error", 8698 callback = function( evt ) { 8699 script.remove(); 8700 callback = null; 8701 if ( evt ) { 8702 complete( evt.type === "error" ? 404 : 200, evt.type ); 8703 } 8704 } 8705 ); 8706 document.head.appendChild( script[ 0 ] ); 8707 }, 8708 abort: function() { 8709 if ( callback ) { 8710 callback(); 8711 } 8712 } 8713 }; 8714 } 8715}); 8716 8717 8718 8719 8720var oldCallbacks = [], 8721 rjsonp = /(=)\?(?=&|$)|\?\?/; 8722 8723// Default jsonp settings 8724jQuery.ajaxSetup({ 8725 jsonp: "callback", 8726 jsonpCallback: function() { 8727 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 8728 this[ callback ] = true; 8729 return callback; 8730 } 8731}); 8732 8733// Detect, normalize options and install callbacks for jsonp requests 8734jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 8735 8736 var callbackName, overwritten, responseContainer, 8737 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 8738 "url" : 8739 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" 8740 ); 8741 8742 // Handle iff the expected data type is "jsonp" or we have a parameter to set 8743 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 8744 8745 // Get callback name, remembering preexisting value associated with it 8746 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 8747 s.jsonpCallback() : 8748 s.jsonpCallback; 8749 8750 // Insert callback into url or form data 8751 if ( jsonProp ) { 8752 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 8753 } else if ( s.jsonp !== false ) { 8754 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 8755 } 8756 8757 // Use data converter to retrieve json after script execution 8758 s.converters["script json"] = function() { 8759 if ( !responseContainer ) { 8760 jQuery.error( callbackName + " was not called" ); 8761 } 8762 return responseContainer[ 0 ]; 8763 }; 8764 8765 // force json dataType 8766 s.dataTypes[ 0 ] = "json"; 8767 8768 // Install callback 8769 overwritten = window[ callbackName ]; 8770 window[ callbackName ] = function() { 8771 responseContainer = arguments; 8772 }; 8773 8774 // Clean-up function (fires after converters) 8775 jqXHR.always(function() { 8776 // Restore preexisting value 8777 window[ callbackName ] = overwritten; 8778 8779 // Save back as free 8780 if ( s[ callbackName ] ) { 8781 // make sure that re-using the options doesn't screw things around 8782 s.jsonpCallback = originalSettings.jsonpCallback; 8783 8784 // save the callback name for future use 8785 oldCallbacks.push( callbackName ); 8786 } 8787 8788 // Call if it was a function and we have a response 8789 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 8790 overwritten( responseContainer[ 0 ] ); 8791 } 8792 8793 responseContainer = overwritten = undefined; 8794 }); 8795 8796 // Delegate to script 8797 return "script"; 8798 } 8799}); 8800 8801 8802 8803 8804// data: string of html 8805// context (optional): If specified, the fragment will be created in this context, defaults to document 8806// keepScripts (optional): If true, will include scripts passed in the html string 8807jQuery.parseHTML = function( data, context, keepScripts ) { 8808 if ( !data || typeof data !== "string" ) { 8809 return null; 8810 } 8811 if ( typeof context === "boolean" ) { 8812 keepScripts = context; 8813 context = false;
vendor: 10,932 bytes, lines 8814-9219
8814 } 8815 context = context || document; 8816 8817 var parsed = rsingleTag.exec( data ), 8818 scripts = !keepScripts && []; 8819 8820 // Single tag 8821 if ( parsed ) { 8822 return [ context.createElement( parsed[1] ) ]; 8823 } 8824 8825 parsed = jQuery.buildFragment( [ data ], context, scripts ); 8826 8827 if ( scripts && scripts.length ) { 8828 jQuery( scripts ).remove(); 8829 } 8830 8831 return jQuery.merge( [], parsed.childNodes ); 8832}; 8833 8834 8835// Keep a copy of the old load method 8836var _load = jQuery.fn.load; 8837 8838/** 8839 * Load a url into a page 8840 */ 8841jQuery.fn.load = function( url, params, callback ) { 8842 if ( typeof url !== "string" && _load ) { 8843 return _load.apply( this, arguments ); 8844 } 8845 8846 var selector, type, response, 8847 self = this, 8848 off = url.indexOf(" "); 8849 8850 if ( off >= 0 ) { 8851 selector = jQuery.trim( url.slice( off ) ); 8852 url = url.slice( 0, off ); 8853 } 8854 8855 // If it's a function 8856 if ( jQuery.isFunction( params ) ) { 8857 8858 // We assume that it's the callback 8859 callback = params; 8860 params = undefined; 8861 8862 // Otherwise, build a param string 8863 } else if ( params && typeof params === "object" ) { 8864 type = "POST"; 8865 } 8866 8867 // If we have elements to modify, make the request 8868 if ( self.length > 0 ) { 8869 jQuery.ajax({ 8870 url: url, 8871 8872 // if "type" variable is undefined, then "GET" method will be used 8873 type: type, 8874 dataType: "html", 8875 data: params 8876 }).done(function( responseText ) { 8877 8878 // Save response for use in complete callback 8879 response = arguments; 8880 8881 self.html( selector ? 8882 8883 // If a selector was specified, locate the right elements in a dummy div 8884 // Exclude scripts to avoid IE 'Permission Denied' errors 8885 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : 8886 8887 // Otherwise use the full result 8888 responseText ); 8889 8890 }).complete( callback && function( jqXHR, status ) { 8891 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 8892 }); 8893 } 8894 8895 return this; 8896}; 8897 8898 8899 8900 8901// Attach a bunch of functions for handling common AJAX events 8902jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { 8903 jQuery.fn[ type ] = function( fn ) { 8904 return this.on( type, fn ); 8905 }; 8906}); 8907 8908 8909 8910 8911jQuery.expr.filters.animated = function( elem ) { 8912 return jQuery.grep(jQuery.timers, function( fn ) { 8913 return elem === fn.elem; 8914 }).length; 8915}; 8916 8917 8918 8919 8920var docElem = window.document.documentElement; 8921 8922/** 8923 * Gets a window from an element 8924 */ 8925function getWindow( elem ) { 8926 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; 8927} 8928 8929jQuery.offset = { 8930 setOffset: function( elem, options, i ) { 8931 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 8932 position = jQuery.css( elem, "position" ), 8933 curElem = jQuery( elem ), 8934 props = {}; 8935 8936 // Set position first, in-case top/left are set even on static elem 8937 if ( position === "static" ) { 8938 elem.style.position = "relative"; 8939 } 8940 8941 curOffset = curElem.offset(); 8942 curCSSTop = jQuery.css( elem, "top" ); 8943 curCSSLeft = jQuery.css( elem, "left" ); 8944 calculatePosition = ( position === "absolute" || position === "fixed" ) && 8945 ( curCSSTop + curCSSLeft ).indexOf("auto") > -1; 8946 8947 // Need to be able to calculate position if either 8948 // top or left is auto and position is either absolute or fixed 8949 if ( calculatePosition ) { 8950 curPosition = curElem.position(); 8951 curTop = curPosition.top; 8952 curLeft = curPosition.left; 8953 8954 } else { 8955 curTop = parseFloat( curCSSTop ) || 0; 8956 curLeft = parseFloat( curCSSLeft ) || 0; 8957 } 8958 8959 if ( jQuery.isFunction( options ) ) { 8960 options = options.call( elem, i, curOffset ); 8961 } 8962 8963 if ( options.top != null ) { 8964 props.top = ( options.top - curOffset.top ) + curTop; 8965 } 8966 if ( options.left != null ) { 8967 props.left = ( options.left - curOffset.left ) + curLeft; 8968 } 8969 8970 if ( "using" in options ) { 8971 options.using.call( elem, props ); 8972 8973 } else { 8974 curElem.css( props ); 8975 } 8976 } 8977}; 8978 8979jQuery.fn.extend({ 8980 offset: function( options ) { 8981 if ( arguments.length ) { 8982 return options === undefined ? 8983 this : 8984 this.each(function( i ) { 8985 jQuery.offset.setOffset( this, options, i ); 8986 }); 8987 } 8988 8989 var docElem, win, 8990 elem = this[ 0 ], 8991 box = { top: 0, left: 0 }, 8992 doc = elem && elem.ownerDocument; 8993 8994 if ( !doc ) { 8995 return; 8996 } 8997 8998 docElem = doc.documentElement; 8999 9000 // Make sure it's not a disconnected DOM node 9001 if ( !jQuery.contains( docElem, elem ) ) { 9002 return box; 9003 } 9004 9005 // Support: BlackBerry 5, iOS 3 (original iPhone) 9006 // If we don't have gBCR, just use 0,0 rather than error 9007 if ( typeof elem.getBoundingClientRect !== strundefined ) { 9008 box = elem.getBoundingClientRect(); 9009 } 9010 win = getWindow( doc ); 9011 return { 9012 top: box.top + win.pageYOffset - docElem.clientTop, 9013 left: box.left + win.pageXOffset - docElem.clientLeft 9014 }; 9015 }, 9016 9017 position: function() { 9018 if ( !this[ 0 ] ) { 9019 return; 9020 } 9021 9022 var offsetParent, offset, 9023 elem = this[ 0 ], 9024 parentOffset = { top: 0, left: 0 }; 9025 9026 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent 9027 if ( jQuery.css( elem, "position" ) === "fixed" ) { 9028 // Assume getBoundingClientRect is there when computed position is fixed 9029 offset = elem.getBoundingClientRect(); 9030 9031 } else { 9032 // Get *real* offsetParent 9033 offsetParent = this.offsetParent(); 9034 9035 // Get correct offsets 9036 offset = this.offset(); 9037 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 9038 parentOffset = offsetParent.offset(); 9039 } 9040 9041 // Add offsetParent borders 9042 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 9043 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 9044 } 9045 9046 // Subtract parent offsets and element margins 9047 return { 9048 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 9049 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 9050 }; 9051 }, 9052 9053 offsetParent: function() { 9054 return this.map(function() { 9055 var offsetParent = this.offsetParent || docElem; 9056 9057 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { 9058 offsetParent = offsetParent.offsetParent; 9059 } 9060 9061 return offsetParent || docElem; 9062 }); 9063 } 9064}); 9065 9066// Create scrollLeft and scrollTop methods 9067jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 9068 var top = "pageYOffset" === prop; 9069 9070 jQuery.fn[ method ] = function( val ) { 9071 return access( this, function( elem, method, val ) { 9072 var win = getWindow( elem ); 9073 9074 if ( val === undefined ) { 9075 return win ? win[ prop ] : elem[ method ]; 9076 } 9077 9078 if ( win ) { 9079 win.scrollTo( 9080 !top ? val : window.pageXOffset, 9081 top ? val : window.pageYOffset 9082 ); 9083 9084 } else { 9085 elem[ method ] = val; 9086 } 9087 }, method, val, arguments.length, null ); 9088 }; 9089}); 9090 9091// Support: Safari<7+, Chrome<37+ 9092// Add the top/left cssHooks using jQuery.fn.position 9093// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 9094// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280 9095// getComputedStyle returns percent when specified for top/left/bottom/right; 9096// rather than make the css module depend on the offset module, just check for it here 9097jQuery.each( [ "top", "left" ], function( i, prop ) { 9098 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 9099 function( elem, computed ) { 9100 if ( computed ) { 9101 computed = curCSS( elem, prop ); 9102 // If curCSS returns percentage, fallback to offset 9103 return rnumnonpx.test( computed ) ? 9104 jQuery( elem ).position()[ prop ] + "px" : 9105 computed; 9106 } 9107 } 9108 ); 9109}); 9110 9111 9112// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 9113jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9114 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { 9115 // Margin is only for outerHeight, outerWidth 9116 jQuery.fn[ funcName ] = function( margin, value ) { 9117 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 9118 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 9119 9120 return access( this, function( elem, type, value ) { 9121 var doc; 9122 9123 if ( jQuery.isWindow( elem ) ) { 9124 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 9125 // isn't a whole lot we can do. See pull request at this URL for discussion: 9126 // https://github.com/jquery/jquery/pull/764 9127 return elem.document.documentElement[ "client" + name ]; 9128 } 9129 9130 // Get document width or height 9131 if ( elem.nodeType === 9 ) { 9132 doc = elem.documentElement; 9133 9134 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 9135 // whichever is greatest 9136 return Math.max( 9137 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 9138 elem.body[ "offset" + name ], doc[ "offset" + name ], 9139 doc[ "client" + name ] 9140 ); 9141 } 9142 9143 return value === undefined ? 9144 // Get width or height on the element, requesting but not forcing parseFloat 9145 jQuery.css( elem, type, extra ) : 9146 9147 // Set width or height on the element 9148 jQuery.style( elem, type, value, extra ); 9149 }, type, chainable ? margin : undefined, chainable, null ); 9150 }; 9151 }); 9152}); 9153 9154 9155// The number of elements contained in the matched element set 9156jQuery.fn.size = function() { 9157 return this.length; 9158}; 9159 9160jQuery.fn.andSelf = jQuery.fn.addBack; 9161 9162 9163 9164 9165// Register as a named AMD module, since jQuery can be concatenated with other 9166// files that may use define, but not via a proper concatenation script that 9167// understands anonymous AMD modules. A named AMD is safest and most robust 9168// way to register. Lowercase jquery is used because AMD module names are 9169// derived from file names, and jQuery is normally delivered in a lowercase 9170// file name. Do this after creating the global so that if an AMD module wants 9171// to call noConflict to hide this version of jQuery, it will work. 9172 9173// Note that for maximum portability, libraries that are not jQuery should 9174// declare themselves as anonymous modules, and avoid setting a global if an 9175// AMD loader is present. jQuery is a special case. For more information, see 9176// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 9177 9178if ( typeof define === "function" && define.amd ) { 9179 define( "jquery", [], function() { 9180 return jQuery; 9181 }); 9182} 9183 9184 9185 9186 9187var 9188 // Map over jQuery in case of overwrite 9189 _jQuery = window.jQuery, 9190 9191 // Map over the $ in case of overwrite 9192 _$ = window.$; 9193 9194jQuery.noConflict = function( deep ) { 9195 if ( window.$ === jQuery ) { 9196 window.$ = _$; 9197 } 9198 9199 if ( deep && window.jQuery === jQuery ) { 9200 window.jQuery = _jQuery; 9201 } 9202 9203 return jQuery; 9204}; 9205 9206// Expose jQuery and $ identifiers, even in AMD 9207// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 9208// and CommonJS for browser emulators (#13566) 9209if ( typeof noGlobal === strundefined ) { 9210 window.jQuery = window.$ = jQuery; 9211} 9212 9213 9214 9215 9216return jQuery; 9217 9218})); 9219
9220;// /var/www/www.vfb.de/httpdocs/current/static/js/iDangerousSwiper.js 9221/** 9222 * Swiper 3.3.1 9223 * Most modern mobile touch slider and framework with hardware accelerated transitions 9224 * 9225 * http://www.idangero.us/swiper/ 9226 * 9227 * Copyright 2016, Vladimir Kharlampidi 9228 * The iDangero.us 9229 * http://www.idangero.us/ 9230 * 9231 * Licensed under MIT 9232 * 9233 * Released on: February 7, 2016 9234 */ 9235(function () { 9236 'use strict'; 9237 var $; 9238 /*=========================== 9239 Swiper 9240 ===========================*/ 9241 var Swiper = function (container, params) { 9242 if (!(this instanceof Swiper)) return new Swiper(container, params); 9243 9244 var defaults = { 9245 direction: 'horizontal', 9246 touchEventsTarget: 'container', 9247 initialSlide: 0, 9248 speed: 300, 9249 // autoplay 9250 autoplay: false, 9251 autoplayDisableOnInteraction: true, 9252 autoplayStopOnLast: false, 9253 // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView). 9254 iOSEdgeSwipeDetection: false, 9255 iOSEdgeSwipeThreshold: 20, 9256 // Free mode 9257 freeMode: false, 9258 freeModeMomentum: true, 9259 freeModeMomentumRatio: 1, 9260 freeModeMomentumBounce: true, 9261 freeModeMomentumBounceRatio: 1, 9262 freeModeSticky: false, 9263 freeModeMinimumVelocity: 0.02, 9264 // Autoheight 9265 autoHeight: false, 9266 // Set wrapper width 9267 setWrapperSize: false, 9268 // Virtual Translate 9269 virtualTranslate: false, 9270 // Effects 9271 effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' 9272 coverflow: { 9273 rotate: 50, 9274 stretch: 0, 9275 depth: 100, 9276 modifier: 1, 9277 slideShadows : true 9278 }, 9279 flip: { 9280 slideShadows : true, 9281 limitRotation: true 9282 }, 9283 cube: { 9284 slideShadows: true, 9285 shadow: true, 9286 shadowOffset: 20, 9287 shadowScale: 0.94 9288 }, 9289 fade: { 9290 crossFade: false 9291 }, 9292 // Parallax 9293 parallax: false, 9294 // Scrollbar 9295 scrollbar: null, 9296 scrollbarHide: true, 9297 scrollbarDraggable: false, 9298 scrollbarSnapOnRelease: false, 9299 // Keyboard Mousewheel 9300 keyboardControl: false, 9301 mousewheelControl: false, 9302 mousewheelReleaseOnEdges: false, 9303 mousewheelInvert: false,
9304 mousewheelForceToAxis: false, 9305 mousewheelSensitivity: 1, 9306 // Hash Navigation 9307 hashnav: false, 9308 // Breakpoints 9309 breakpoints: undefined, 9310 // Slides grid 9311 spaceBetween: 0, 9312 slidesPerView: 1, 9313 slidesPerColumn: 1, 9314 slidesPerColumnFill: 'column', 9315 slidesPerGroup: 1, 9316 centeredSlides: false, 9317 slidesOffsetBefore: 0, // in px 9318 slidesOffsetAfter: 0, // in px 9319 // Round length 9320 roundLengths: false, 9321 // Touches 9322 touchRatio: 1, 9323 touchAngle: 45, 9324 simulateTouch: true, 9325 shortSwipes: true, 9326 longSwipes: true, 9327 longSwipesRatio: 0.5, 9328 longSwipesMs: 300, 9329 followFinger: true, 9330 onlyExternal: false, 9331 threshold: 0, 9332 touchMoveStopPropagation: true, 9333 // Unique Navigation Elements 9334 uniqueNavElements: true, 9335 // Pagination 9336 pagination: null, 9337 paginationElement: 'span', 9338 paginationClickable: false, 9339 paginationHide: false, 9340 paginationBulletRender: null, 9341 paginationProgressRender: null, 9342 paginationFractionRender: null, 9343 paginationCustomRender: null, 9344 paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom' 9345 // Resistance 9346 resistance: true, 9347 resistanceRatio: 0.85, 9348 // Next/prev buttons 9349 nextButton: null, 9350 prevButton: null, 9351 // Progress 9352 watchSlidesProgress: false, 9353 watchSlidesVisibility: false, 9354 // Cursor 9355 grabCursor: false, 9356 // Clicks 9357 preventClicks: true, 9358 preventClicksPropagation: true, 9359 slideToClickedSlide: false, 9360 // Lazy Loading 9361 lazyLoading: false, 9362 lazyLoadingInPrevNext: false, 9363 lazyLoadingInPrevNextAmount: 1, 9364 lazyLoadingOnTransitionStart: false, 9365 // Images 9366 preloadImages: true, 9367 updateOnImagesReady: true, 9368 // loop 9369 loop: false, 9370 loopAdditionalSlides: 0, 9371 loopedSlides: null, 9372 // Control 9373 control: undefined, 9374 controlInverse: false, 9375 controlBy: 'slide', //or 'container' 9376 // Swiping/no swiping 9377 allowSwipeToPrev: true, 9378 allowSwipeToNext: true, 9379 swipeHandler: null, //'.swipe-handler', 9380 noSwiping: true, 9381 noSwipingClass: 'swiper-no-swiping', 9382 // NS 9383 slideClass: 'swiper-slide', 9384 slideActiveClass: 'swiper-slide-active', 9385 slideVisibleClass: 'swiper-slide-visible', 9386 slideDuplicateClass: 'swiper-slide-duplicate', 9387 slideNextClass: 'swiper-slide-next', 9388 slidePrevClass: 'swiper-slide-prev', 9389 wrapperClass: 'swiper-wrapper', 9390 bulletClass: 'swiper-pagination-bullet', 9391 bulletActiveClass: 'swiper-pagination-bullet-active', 9392 buttonDisabledClass: 'swiper-button-disabled', 9393 paginationCurrentClass: 'swiper-pagination-current', 9394 paginationTotalClass: 'swiper-pagination-total', 9395 paginationHiddenClass: 'swiper-pagination-hidden', 9396 paginationProgressbarClass: 'swiper-pagination-progressbar', 9397 // Observer 9398 observer: false, 9399 observeParents: false, 9400 // Accessibility
9401 a11y: false, 9402 prevSlideMessage: 'Previous slide', 9403 nextSlideMessage: 'Next slide', 9404 firstSlideMessage: 'This is the first slide', 9405 lastSlideMessage: 'This is the last slide', 9406 paginationBulletMessage: 'Go to slide {{index}}', 9407 // Callbacks 9408 runCallbacksOnInit: true 9409 /* 9410 Callbacks: 9411 onInit: function (swiper) 9412 onDestroy: function (swiper) 9413 onClick: function (swiper, e) 9414 onTap: function (swiper, e) 9415 onDoubleTap: function (swiper, e) 9416 onSliderMove: function (swiper, e) 9417 onSlideChangeStart: function (swiper) 9418 onSlideChangeEnd: function (swiper) 9419 onTransitionStart: function (swiper) 9420 onTransitionEnd: function (swiper) 9421 onImagesReady: function (swiper) 9422 onProgress: function (swiper, progress) 9423 onTouchStart: function (swiper, e) 9424 onTouchMove: function (swiper, e) 9425 onTouchMoveOpposite: function (swiper, e) 9426 onTouchEnd: function (swiper, e) 9427 onReachBeginning: function (swiper) 9428 onReachEnd: function (swiper) 9429 onSetTransition: function (swiper, duration) 9430 onSetTranslate: function (swiper, translate) 9431 onAutoplayStart: function (swiper) 9432 onAutoplayStop: function (swiper), 9433 onLazyImageLoad: function (swiper, slide, image) 9434 onLazyImageReady: function (swiper, slide, image) 9435 */ 9436 9437 }; 9438 var initialVirtualTranslate = params && params.virtualTranslate; 9439 9440 params = params || {}; 9441 var originalParams = {}; 9442 for (var param in params) { 9443 if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) { 9444 originalParams[param] = {}; 9445 for (var deepParam in params[param]) { 9446 originalParams[param][deepParam] = params[param][deepParam]; 9447 } 9448 } 9449 else { 9450 originalParams[param] = params[param]; 9451 } 9452 } 9453 for (var def in defaults) { 9454 if (typeof params[def] === 'undefined') { 9455 params[def] = defaults[def]; 9456 } 9457 else if (typeof params[def] === 'object') { 9458 for (var deepDef in defaults[def]) { 9459 if (typeof params[def][deepDef] === 'undefined') { 9460 params[def][deepDef] = defaults[def][deepDef]; 9461 } 9462 } 9463 } 9464 } 9465 9466 // Swiper 9467 var s = this; 9468 9469 // Params 9470 s.params = params; 9471 s.originalParams = originalParams; 9472 9473 // Classname 9474 s.classNames = []; 9475 /*========================= 9476 Dom Library and plugins 9477 ===========================*/ 9478 if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){ 9479 $ = Dom7; 9480 } 9481 if (typeof $ === 'undefined') { 9482 if (typeof Dom7 === 'undefined') { 9483 $ = window.Dom7 || window.Zepto || window.jQuery; 9484 } 9485 else { 9486 $ = Dom7; 9487 } 9488 if (!$) return; 9489 } 9490 // Export it to Swiper instance 9491 s.$ = $; 9492 9493 /*========================= 9494 Breakpoints 9495 ===========================*/ 9496 s.currentBreakpoint = undefined; 9497 s.getActiveBreakpoint = function () { 9498 //Get breakpoint for window width 9499 if (!s.params.breakpoints) return false;
9500 var breakpoint = false; 9501 var points = [], point; 9502 for ( point in s.params.breakpoints ) { 9503 if (s.params.breakpoints.hasOwnProperty(point)) { 9504 points.push(point); 9505 } 9506 } 9507 points.sort(function (a, b) { 9508 return parseInt(a, 10) > parseInt(b, 10); 9509 }); 9510 for (var i = 0; i < points.length; i++) { 9511 point = points[i]; 9512 if (point >= window.innerWidth && !breakpoint) { 9513 breakpoint = point; 9514 } 9515 } 9516 return breakpoint || 'max'; 9517 }; 9518 s.setBreakpoint = function () { 9519 //Set breakpoint for window width and update parameters 9520 var breakpoint = s.getActiveBreakpoint(); 9521 if (breakpoint && s.currentBreakpoint !== breakpoint) { 9522 var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams; 9523 var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView); 9524 for ( var param in breakPointsParams ) { 9525 s.params[param] = breakPointsParams[param]; 9526 } 9527 s.currentBreakpoint = breakpoint; 9528 if(needsReLoop && s.destroyLoop) { 9529 s.reLoop(true); 9530 } 9531 } 9532 }; 9533 // Set breakpoint on load 9534 if (s.params.breakpoints) { 9535 s.setBreakpoint(); 9536 } 9537 9538 /*========================= 9539 Preparation - Define Container, Wrapper and Pagination 9540 ===========================*/ 9541 s.container = $(container); 9542 if (s.container.length === 0) return; 9543 if (s.container.length > 1) { 9544 var swipers = []; 9545 s.container.each(function () { 9546 var container = this; 9547 swipers.push(new Swiper(this, params)); 9548 }); 9549 return swipers; 9550 } 9551 9552 // Save instance in container HTML Element and in data 9553 s.container[0].swiper = s; 9554 s.container.data('swiper', s); 9555 9556 s.classNames.push('swiper-container-' + s.params.direction); 9557 9558 if (s.params.freeMode) { 9559 s.classNames.push('swiper-container-free-mode'); 9560 } 9561 if (!s.support.flexbox) { 9562 s.classNames.push('swiper-container-no-flexbox'); 9563 s.params.slidesPerColumn = 1; 9564 } 9565 if (s.params.autoHeight) { 9566 s.classNames.push('swiper-container-autoheight'); 9567 } 9568 // Enable slides progress when required 9569 if (s.params.parallax || s.params.watchSlidesVisibility) { 9570 s.params.watchSlidesProgress = true; 9571 } 9572 // Coverflow / 3D 9573 if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) { 9574 if (s.support.transforms3d) { 9575 s.params.watchSlidesProgress = true; 9576 s.classNames.push('swiper-container-3d'); 9577 } 9578 else { 9579 s.params.effect = 'slide'; 9580 } 9581 } 9582 if (s.params.effect !== 'slide') { 9583 s.classNames.push('swiper-container-' + s.params.effect); 9584 } 9585 if (s.params.effect === 'cube') { 9586 s.params.resistanceRatio = 0; 9587 s.params.slidesPerView = 1; 9588 s.params.slidesPerColumn = 1; 9589 s.params.slidesPerGroup = 1; 9590 s.params.centeredSlides = false;
9591 s.params.spaceBetween = 0; 9592 s.params.virtualTranslate = true; 9593 s.params.setWrapperSize = false; 9594 } 9595 if (s.params.effect === 'fade' || s.params.effect === 'flip') { 9596 s.params.slidesPerView = 1; 9597 s.params.slidesPerColumn = 1; 9598 s.params.slidesPerGroup = 1; 9599 s.params.watchSlidesProgress = true; 9600 s.params.spaceBetween = 0; 9601 s.params.setWrapperSize = false; 9602 if (typeof initialVirtualTranslate === 'undefined') { 9603 s.params.virtualTranslate = true; 9604 } 9605 } 9606 9607 // Grab Cursor 9608 if (s.params.grabCursor && s.support.touch) { 9609 s.params.grabCursor = false; 9610 } 9611 9612 // Wrapper 9613 s.wrapper = s.container.children('.' + s.params.wrapperClass); 9614 9615 // Pagination 9616 if (s.params.pagination) { 9617 s.paginationContainer = $(s.params.pagination); 9618 if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) { 9619 s.paginationContainer = s.container.find(s.params.pagination); 9620 } 9621 9622 if (s.params.paginationType === 'bullets' && s.params.paginationClickable) { 9623 s.paginationContainer.addClass('swiper-pagination-clickable'); 9624 } 9625 else { 9626 s.params.paginationClickable = false; 9627 } 9628 s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType); 9629 } 9630 // Next/Prev Buttons 9631 if (s.params.nextButton || s.params.prevButton) { 9632 if (s.params.nextButton) { 9633 s.nextButton = $(s.params.nextButton); 9634 if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) { 9635 s.nextButton = s.container.find(s.params.nextButton); 9636 } 9637 } 9638 if (s.params.prevButton) { 9639 s.prevButton = $(s.params.prevButton); 9640 if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) { 9641 s.prevButton = s.container.find(s.params.prevButton); 9642 } 9643 } 9644 } 9645 9646 // Is Horizontal 9647 s.isHorizontal = function () { 9648 return s.params.direction === 'horizontal'; 9649 }; 9650 // s.isH = isH; 9651 9652 // RTL 9653 s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl'); 9654 if (s.rtl) { 9655 s.classNames.push('swiper-container-rtl'); 9656 } 9657 9658 // Wrong RTL support 9659 if (s.rtl) { 9660 s.wrongRTL = s.wrapper.css('display') === '-webkit-box'; 9661 } 9662 9663 // Columns 9664 if (s.params.slidesPerColumn > 1) { 9665 s.classNames.push('swiper-container-multirow'); 9666 } 9667 9668 // Check for Android 9669 if (s.device.android) { 9670 s.classNames.push('swiper-container-android'); 9671 } 9672 9673 // Add classes 9674 s.container.addClass(s.classNames.join(' ')); 9675 9676 // Translate 9677 s.translate = 0; 9678 9679 // Progress 9680 s.progress = 0; 9681 9682 // Velocity 9683 s.velocity = 0; 9684 9685 /*========================= 9686 Locks, unlocks 9687 ===========================*/ 9688 s.lockSwipeToNext = function () { 9689 s.params.allowSwipeToNext = false;
9690 }; 9691 s.lockSwipeToPrev = function () { 9692 s.params.allowSwipeToPrev = false; 9693 }; 9694 s.lockSwipes = function () { 9695 s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false; 9696 }; 9697 s.unlockSwipeToNext = function () { 9698 s.params.allowSwipeToNext = true; 9699 }; 9700 s.unlockSwipeToPrev = function () { 9701 s.params.allowSwipeToPrev = true; 9702 }; 9703 s.unlockSwipes = function () { 9704 s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true; 9705 }; 9706 9707 /*========================= 9708 Round helper 9709 ===========================*/ 9710 function round(a) { 9711 return Math.floor(a); 9712 } 9713 /*========================= 9714 Set grab cursor 9715 ===========================*/ 9716 if (s.params.grabCursor) { 9717 s.container[0].style.cursor = 'move'; 9718 s.container[0].style.cursor = '-webkit-grab'; 9719 s.container[0].style.cursor = '-moz-grab'; 9720 s.container[0].style.cursor = 'grab'; 9721 } 9722 /*========================= 9723 Update on Images Ready 9724 ===========================*/ 9725 s.imagesToLoad = []; 9726 s.imagesLoaded = 0; 9727 9728 s.loadImage = function (imgElement, src, srcset, checkForComplete, callback) { 9729 var image; 9730 function onReady () { 9731 if (callback) callback(); 9732 } 9733 if (!imgElement.complete || !checkForComplete) { 9734 if (src) { 9735 image = new window.Image(); 9736 image.onload = onReady; 9737 image.onerror = onReady; 9738 if (srcset) { 9739 image.srcset = srcset; 9740 } 9741 if (src) { 9742 image.src = src; 9743 } 9744 } else { 9745 onReady(); 9746 } 9747 9748 } else {//image already loaded... 9749 onReady(); 9750 } 9751 }; 9752 s.preloadImages = function () { 9753 s.imagesToLoad = s.container.find('img'); 9754 function _onReady() { 9755 if (typeof s === 'undefined' || s === null) return; 9756 if (s.imagesLoaded !== undefined) s.imagesLoaded++; 9757 if (s.imagesLoaded === s.imagesToLoad.length) { 9758 if (s.params.updateOnImagesReady) s.update(); 9759 s.emit('onImagesReady', s); 9760 } 9761 } 9762 for (var i = 0; i < s.imagesToLoad.length; i++) { 9763 s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), true, _onReady); 9764 } 9765 }; 9766 9767 /*========================= 9768 Autoplay 9769 ===========================*/ 9770 s.autoplayTimeoutId = undefined; 9771 s.autoplaying = false; 9772 s.autoplayPaused = false; 9773 function autoplay() { 9774 s.autoplayTimeoutId = setTimeout(function () { 9775 if (s.params.loop) { 9776 s.fixLoop(); 9777 s._slideNext(); 9778 s.emit('onAutoplay', s); 9779 } 9780 else { 9781 if (!s.isEnd) { 9782 s._slideNext(); 9783 s.emit('onAutoplay', s); 9784 } 9785 else { 9786 if (!params.autoplayStopOnLast) { 9787 s._slideTo(0); 9788 s.emit('onAutoplay', s); 9789 } 9790 else { 9791 s.stopAutoplay(); 9792 } 9793 } 9794 } 9795 }, s.params.autoplay); 9796 } 9797 s.startAutoplay = function () { 9798 if (typeof s.autoplayTimeoutId !== 'undefined') return false;
9799 if (!s.params.autoplay) return false; 9800 if (s.autoplaying) return false; 9801 s.autoplaying = true; 9802 s.emit('onAutoplayStart', s); 9803 autoplay(); 9804 }; 9805 s.stopAutoplay = function (internal) { 9806 if (!s.autoplayTimeoutId) return; 9807 if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId); 9808 s.autoplaying = false; 9809 s.autoplayTimeoutId = undefined; 9810 s.emit('onAutoplayStop', s); 9811 }; 9812 s.pauseAutoplay = function (speed) { 9813 if (s.autoplayPaused) return; 9814 if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId); 9815 s.autoplayPaused = true; 9816 if (speed === 0) { 9817 s.autoplayPaused = false; 9818 autoplay(); 9819 } 9820 else { 9821 s.wrapper.transitionEnd(function () { 9822 if (!s) return; 9823 s.autoplayPaused = false; 9824 if (!s.autoplaying) { 9825 s.stopAutoplay(); 9826 } 9827 else { 9828 autoplay(); 9829 } 9830 }); 9831 } 9832 }; 9833 /*========================= 9834 Min/Max Translate 9835 ===========================*/ 9836 s.minTranslate = function () { 9837 return (-s.snapGrid[0]); 9838 }; 9839 s.maxTranslate = function () { 9840 return (-s.snapGrid[s.snapGrid.length - 1]); 9841 }; 9842 /*========================= 9843 Slider/slides sizes 9844 ===========================*/ 9845 s.updateAutoHeight = function () { 9846 // Update Height 9847 var slide = s.slides.eq(s.activeIndex)[0]; 9848 if (typeof slide !== 'undefined') { 9849 var newHeight = slide.offsetHeight; 9850 if (newHeight) s.wrapper.css('height', newHeight + 'px'); 9851 } 9852 }; 9853 s.updateContainerSize = function () { 9854 var width, height; 9855 if (typeof s.params.width !== 'undefined') { 9856 width = s.params.width; 9857 } 9858 else { 9859 width = s.container[0].clientWidth; 9860 } 9861 if (typeof s.params.height !== 'undefined') { 9862 height = s.params.height; 9863 } 9864 else { 9865 height = s.container[0].clientHeight; 9866 } 9867 if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) { 9868 return; 9869 } 9870 9871 //Subtract paddings 9872 width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10); 9873 height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10); 9874 9875 // Store values 9876 s.width = width; 9877 s.height = height; 9878 s.size = s.isHorizontal() ? s.width : s.height; 9879 }; 9880 9881 s.updateSlidesSize = function () { 9882 s.slides = s.wrapper.children('.' + s.params.slideClass); 9883 s.snapGrid = []; 9884 s.slidesGrid = []; 9885 s.slidesSizesGrid = []; 9886 9887 var spaceBetween = s.params.spaceBetween, 9888 slidePosition = -s.params.slidesOffsetBefore, 9889 i, 9890 prevSlideSize = 0, 9891 index = 0; 9892 if (typeof s.size === 'undefined') return; 9893 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 9894 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size; 9895 } 9896 9897 s.virtualSize = -spaceBetween; 9898 // reset margins 9899 if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''}); 9900 else s.slides.css({marginRight: '', marginBottom: ''}); 9901
9902 var slidesNumberEvenToRows; 9903 if (s.params.slidesPerColumn > 1) { 9904 if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) { 9905 slidesNumberEvenToRows = s.slides.length; 9906 } 9907 else { 9908 slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn; 9909 } 9910 if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') { 9911 slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn); 9912 } 9913 } 9914 9915 // Calc slides 9916 var slideSize; 9917 var slidesPerColumn = s.params.slidesPerColumn; 9918 var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn; 9919 var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length); 9920 for (i = 0; i < s.slides.length; i++) { 9921 slideSize = 0; 9922 var slide = s.slides.eq(i); 9923 if (s.params.slidesPerColumn > 1) { 9924 // Set slides order 9925 var newSlideOrderIndex; 9926 var column, row; 9927 if (s.params.slidesPerColumnFill === 'column') { 9928 column = Math.floor(i / slidesPerColumn); 9929 row = i - column * slidesPerColumn; 9930 if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) { 9931 if (++row >= slidesPerColumn) { 9932 row = 0; 9933 column++; 9934 } 9935 } 9936 newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn; 9937 slide 9938 .css({ 9939 '-webkit-box-ordinal-group': newSlideOrderIndex, 9940 '-moz-box-ordinal-group': newSlideOrderIndex, 9941 '-ms-flex-order': newSlideOrderIndex, 9942 '-webkit-order': newSlideOrderIndex, 9943 'order': newSlideOrderIndex 9944 }); 9945 } 9946 else { 9947 row = Math.floor(i / slidesPerRow); 9948 column = i - row * slidesPerRow; 9949 } 9950 slide 9951 .css({ 9952 'margin-top': (row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px') 9953 }) 9954 .attr('data-swiper-column', column) 9955 .attr('data-swiper-row', row); 9956 9957 } 9958 if (slide.css('display') === 'none') continue; 9959 if (s.params.slidesPerView === 'auto') { 9960 slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true); 9961 if (s.params.roundLengths) slideSize = round(sli
9961deSize); 9962 } 9963 else { 9964 slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView; 9965 if (s.params.roundLengths) slideSize = round(slideSize); 9966 9967 if (s.isHorizontal()) { 9968 s.slides[i].style.width = slideSize + 'px'; 9969 } 9970 else { 9971 s.slides[i].style.height = slideSize + 'px'; 9972 } 9973 } 9974 s.slides[i].swiperSlideSize = slideSize; 9975 s.slidesSizesGrid.push(slideSize); 9976 9977 9978 if (s.params.centeredSlides) { 9979 slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; 9980 if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween; 9981 if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; 9982 if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition); 9983 s.slidesGrid.push(slidePosition); 9984 } 9985 else { 9986 if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition); 9987 s.slidesGrid.push(slidePosition); 9988 slidePosition = slidePosition + slideSize + spaceBetween; 9989 } 9990 9991 s.virtualSize += slideSize + spaceBetween; 9992 9993 prevSlideSize = slideSize; 9994 9995 index ++; 9996 } 9997 s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter; 9998 var newSlidesGrid; 9999 10000 if ( 10001 s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) { 10002 s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'}); 10003 } 10004 if (!s.support.flexbox || s.params.setWrapperSize) { 10005 if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'}); 10006 else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'}); 10007 } 10008 10009 if (s.params.slidesPerColumn > 1) { 10010 s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows; 10011 s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween; 10012 s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'}); 10013 if (s.params.centeredSlides) { 10014 newSlidesGrid = []; 10015 for (i = 0; i < s.snapGrid.length; i++) { 10016 if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]); 10017 } 10018 s.snapGrid = newSlidesGrid; 10019 } 10020 } 10021 10022 // Remove last grid elements depending on width 10023 if (!s.params.centeredSlides) { 10024 newSlidesGrid = []; 10025 for (i = 0; i < s.snapGrid.length; i++) { 10026 if (s.snapGrid[i] <= s.virtualSize - s.size) { 10027 newSlidesGrid.push(s.snapGrid[i]); 10028 } 10029 } 10030 s.snapGrid = newSlidesGrid; 10031 if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) { 10032 s.snapGrid.push(s.virtualSize - s.size); 10033 } 10034 } 10035 if (s.snapGrid.length === 0) s.snapGrid = [0]; 10036 10037 if (s.params.spaceBetween !== 0) { 10038 if (s.isHorizontal()) { 10039 if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'}); 10040 else s.slides.css({marginRight: spaceBetween + 'px'}); 10041 } 10042 else s.slides.css({marginBottom: spaceBetween + 'px'}); 10043 } 10044 if (s.params.watchSlidesProgress) { 10045 s.updateSlidesOffset(); 10046 } 10047 }; 10048 s.updateSlidesOffset = function () { 10049 for (var i = 0; i < s.slides.length; i++) { 10050 s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop; 10051 } 10052 }; 10053 10054 /*========================= 10055 Slider/slides progress 10056 ===========================*/ 10057 s.updateSlidesProgress = function (translate) { 10058 if (typeof translate === 'undefined') { 10059 translate = s.translate || 0; 10060 } 10061 if (s.slides.length === 0) return; 10062 if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset(); 10063 10064 var offsetCenter = -translate; 10065 if (s.rtl) offsetCenter = translate; 10066 10067 // Visible Slides 10068 s.slides.removeClass(s.params.slideVisibleClass); 10069 for (var i = 0; i < s.slides.length; i++) { 10070 var slide = s.slides[i]; 10071 var slideProgress = (offsetCenter - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween); 10072 if (s.params.watchSlidesVisibility) { 10073 var slideBefore = -(offsetCenter - slide.swiperSlideOffset); 10074 var slideAfter = slideBefore + s.slidesSizesGrid[i]; 10075 var isVisible = 10076 (slideBefore >= 0 && slideBefore < s.size) || 10077 (slideAfter > 0 && slideAfter <= s.size) || 10078 (slideBefore <= 0 && slideAfter >= s.size); 10079 if (isVisible) { 10080 s.slides.eq(i).addClass(s.params.slideVisibleClass); 10081 } 10082 } 10083 slide.progress = s.rtl ? -slideProgress : slideProgress; 10084 } 10085 }; 10086 s.updateProgress = function (translate) { 10087 if (typeof translate === 'undefined') { 10088 translate = s.translate || 0; 10089 } 10090 var translatesDiff = s.maxTranslate() - s.minTranslate(); 10091 var wasBeginning = s.isBeginning; 10092 var wasEnd = s.isEnd; 10093 if (translatesDiff === 0) { 10094 s.progress = 0; 10095 s.isBeginning = s.isEnd = true; 10096 } 10097 else { 10098 s.progress = (translate - s.minTranslate()) / (translatesDiff); 10099 s.isBeginning = s.progress <= 0; 10100 s.isEnd = s.progress >= 1; 10101 } 10102 if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s); 10103 if (s.isEnd && !wasEnd) s.emit('onReachEnd', s); 10104 10105 if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate); 10106 s.emit('onProgress', s, s.progress); 10107 }; 10108 s.updateActiveIndex = function () { 10109 var translate = s.rtl ? s.translate : -s.translate; 10110 var newActiveIndex, i, snapIndex; 10111 for (i = 0; i < s.slidesGrid.length; i ++) { 10112 if (typeof s.slidesGrid[i + 1] !== 'undefined') { 10113 if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) { 10114 newActiveIndex = i; 10115 } 10116 else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) { 10117 newActiveIndex = i + 1; 10118 } 10119 } 10120 else { 10121 if (translate >= s.slidesGrid[i]) { 10122 newActiveIndex = i; 10123 } 10124 } 10125 } 10126 // Normalize slideIndex 10127 if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0; 10128 // for (i = 0; i < s.slidesGrid.length; i++) { 10129 // if (- translate >= s.slidesGrid[i]) { 10130 // newActiveIndex = i; 10131 // } 10132 // } 10133 snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup); 10134 if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1; 10135 10136 if (newActiveIndex === s.activeIndex) { 10137 return; 10138 } 10139 s.snapIndex = snapIndex; 10140 s.previousIndex = s.activeIndex; 10141 s.activeIndex = newActiveIndex; 10142 s.updateClasses(); 10143 }; 10144 10145 /*========================= 10146 Classes 10147 ===========================*/ 10148 s.updateClasses = function () { 10149 s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass); 10150 var activeSlide = s.slides.eq(s.activeIndex); 10151 // Active classes 10152 activeSlide.addClass(s.params.slideActiveClass); 10153 // Next Slide 10154 var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass); 10155 if (s.params.loop && nextSlide.length === 0) { 10156 s.slides.eq(0).addClass(s.params.slideNextClass); 10157 } 10158 // Prev Slide 10159 var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass); 10160 if (s.params.loop && prevSlide.length === 0) { 10161 s.slides.eq(-1).addClass(s.params.slidePrevClass); 10162 } 10163 10164 // Pagination 10165 if (s.paginationContainer && s.paginationContainer.length > 0) { 10166 // Current/Total 10167 var current, 10168 total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; 10169 if (s.params.loop) {
10170 current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup); 10171 if (current > s.slides.length - 1 - s.loopedSlides * 2) { 10172 current = current - (s.slides.length - s.loopedSlides * 2); 10173 } 10174 if (current > total - 1) current = current - total; 10175 if (current < 0 && s.params.paginationType !== 'bullets') current = total + current; 10176 } 10177 else { 10178 if (typeof s.snapIndex !== 'undefined') { 10179 current = s.snapIndex; 10180 } 10181 else { 10182 current = s.activeIndex || 0; 10183 } 10184 } 10185 // Types 10186 if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) { 10187 s.bullets.removeClass(s.params.bulletActiveClass); 10188 if (s.paginationContainer.length > 1) { 10189 s.bullets.each(function () { 10190 if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass); 10191 }); 10192 } 10193 else { 10194 s.bullets.eq(current).addClass(s.params.bulletActiveClass); 10195 } 10196 } 10197 if (s.params.paginationType === 'fraction') { 10198 s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1); 10199 s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total); 10200 } 10201 if (s.params.paginationType === 'progress') { 10202 var scale = (current + 1) / total, 10203 scaleX = scale, 10204 scaleY = 1; 10205 if (!s.isHorizontal()) { 10206 scaleY = scale; 10207 scaleX = 1; 10208 } 10209 s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed); 10210 } 10211 if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) { 10212 s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total)); 10213 s.emit('onPaginationRendered', s, s.paginationContainer[0]); 10214 } 10215 } 10216 10217 // Next/active buttons 10218 if (!s.params.loop) { 10219 if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) { 10220 if (s.isBeginning) { 10221 s.prevButton.addClass(s.params.buttonDisabledClass); 10222 if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton); 10223 } 10224 else { 10225 s.prevButton.removeClass(s.params.buttonDisabledClass); 10226 if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton); 10227 } 10228 } 10229 if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) { 10230 if (s.isEnd) { 10231 s.nextButton.addClass(s.params.buttonDisabledClass); 10232 if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton); 10233 } 10234 else { 10235 s.nextButton.removeClass(s.params.buttonDisabledClass); 10236 if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton); 10237 } 10238 } 10239 } 10240 }; 10241 10242 /*========================= 10243 Pagination 10244 ===========================*/ 10245 s.updatePagination = function () { 10246 if (!s.params.pagination) return; 10247 if (s.paginationContainer && s.paginationContainer.length > 0) { 10248 var paginationHTML = ''; 10249 if (s.params.paginationType === 'bullets') { 10250 var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; 10251 for (var i = 0; i < numberOfBullets; i++) { 10252 if (s.params.paginationBulletRender) { 10253 paginationHTML += s.params.paginationBulletRender(i, s.params.bulletClass); 10254 } 10255 else { 10256 paginationHTML += '<' + s.params.paginationElement+' class="' + s.params.bulletClass + '"></' + s.params.paginationElement + '>'; 10257 } 10258 } 10259 s.paginationContainer.html(paginationHTML); 10260 s.bullets = s.paginationContainer.find('.' + s.params.bulletClass); 10261 if (s.params.paginationClickable && s.params.a11y && s.a11y) { 10262 s.a11y.initPagination(); 10263 } 10264 } 10265 if (s.params.paginationType === 'fraction') { 10266 if (s.params.paginationFractionRender) { 10267 paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass); 10268 } 10269 else { 10270 paginationHTML = 10271 '<span class="' + s.params.paginationCurrentClass + '"></span>' + 10272 ' / ' + 10273 '<span class="' + s.params.paginationTotalClass+'"></span>'; 10274 } 10275 s.paginationContainer.html(paginationHTML); 10276 } 10277 if (s.params.paginationType === 'progress') { 10278 if (s.params.paginationProgressRender) { 10279 paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass); 10280 } 10281 else { 10282 paginationHTML = '<span class="' + s.params.paginationProgressbarClass + '"></span>'; 10283 } 10284 s.paginationContainer.html(paginationHTML); 10285 } 10286 if (s.params.paginationType !== 'custom') { 10287 s.emit('onPaginationRendered', s, s.paginationContainer[0]); 10288 } 10289 } 10290 }; 10291 /*========================= 10292 Common update method 10293 ===========================*/ 10294 s.update = function (updateTranslate) { 10295 s.updateContainerSize(); 10296 s.updateSlidesSize(); 10297 s.updateProgress(); 10298 s.updatePagination(); 10299 s.updateClasses(); 10300 if (s.params.scrollbar && s.scrollbar) { 10301 s.scrollbar.set(); 10302 } 10303 function forceSetTranslate() { 10304 newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); 10305 s.setWrapperTranslate(newTranslate); 10306 s.updateActiveIndex(); 10307 s.updateClasses(); 10308 } 10309 if (updateTranslate) { 10310 var translated, newTranslate; 10311 if (s.controller && s.controller.spline) { 10312 s.controller.spline = undefined; 10313 } 10314 if (s.params.freeMode) { 10315 forceSetTranslate(); 10316 if (s.params.autoHeight) { 10317 s.updateAutoHeight(); 10318 } 10319 } 10320 else { 10321 if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { 10322 translated = s.slideTo(s.slides.length - 1, 0, false, true); 10323 } 10324 else { 10325 translated = s.slideTo(s.activeIndex, 0, false, true); 10326 } 10327 if (!translated) { 10328 forceSetTranslate(); 10329 } 10330 } 10331 } 10332 else if (s.params.autoHeight) { 10333 s.updateAutoHeight(); 10334 } 10335 }; 10336 10337 /*========================= 10338 Resize Handler 10339 ===========================*/ 10340 s.onResize = function (forceUpdatePagination) { 10341 //Breakpoints 10342 if (s.params.breakpoints) { 10343 s.setBreakpoint(); 10344 } 10345 10346 // Disable locks on resize 10347 var allowSwipeToPrev = s.params.allowSwipeToPrev; 10348 var allowSwipeToNext = s.params.allowSwipeToNext; 10349 s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true; 10350 10351 s.updateContainerSize(); 10352 s.updateSlidesSize(); 10353 if (s.params.slidesPerView === 'auto' || s.params.freeMode || force
10353UpdatePagination) s.updatePagination(); 10354 if (s.params.scrollbar && s.scrollbar) { 10355 s.scrollbar.set(); 10356 } 10357 if (s.controller && s.controller.spline) { 10358 s.controller.spline = undefined; 10359 } 10360 var slideChangedBySlideTo = false; 10361 if (s.params.freeMode) { 10362 var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); 10363 s.setWrapperTranslate(newTranslate); 10364 s.updateActiveIndex(); 10365 s.updateClasses(); 10366 10367 if (s.params.autoHeight) { 10368 s.updateAutoHeight(); 10369 } 10370 } 10371 else { 10372 s.updateClasses(); 10373 if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { 10374 slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true); 10375 } 10376 else { 10377 slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true); 10378 } 10379 } 10380 if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) { 10381 s.lazy.load(); 10382 } 10383 // Return locks after resize 10384 s.params.allowSwipeToPrev = allowSwipeToPrev; 10385 s.params.allowSwipeToNext = allowSwipeToNext; 10386 }; 10387 10388 /*========================= 10389 Events 10390 ===========================*/ 10391 10392 //Define Touch Events 10393 var desktopEvents = ['mousedown', 'mousemove', 'mouseup']; 10394 if (window.navigator.pointerEnabled) desktopEvents = ['pointerdown', 'pointermove', 'pointerup']; 10395 else if (window.navigator.msPointerEnabled) desktopEvents = ['MSPointerDown', 'MSPointerMove', 'MSPointerUp']; 10396 s.touchEvents = { 10397 start : s.support.touch || !s.params.simulateTouch ? 'touchstart' : desktopEvents[0], 10398 move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : desktopEvents[1], 10399 end : s.support.touch || !s.params.simulateTouch ? 'touchend' : desktopEvents[2] 10400 }; 10401 10402 10403 // WP8 Touch Events Fix 10404 if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) { 10405 (s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction); 10406 } 10407 10408 // Attach/detach events 10409 s.initEvents = function (detach) { 10410 var actionDom = detach ? 'off' : 'on'; 10411 var action = detach ? 'removeEventListener' : 'addEventListener'; 10412 var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0]; 10413 var target = s.support.touch ? touchEventsTarget : document; 10414 10415 var moveCapture = s.params.nested ? true : false; 10416 10417 //Touch Events 10418 if (s.browser.ie) { 10419 touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false); 10420 target[action](s.touchEvents.move, s.onTouchMove, moveCapture); 10421 target[action](s.touchEvents.end, s.onTouchEnd, false); 10422 } 10423 else { 10424 if (s.support.touch) { 10425 touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false); 10426 touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture); 10427 touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, false); 10428 } 10429 if (params.simulateTouch && !s.device.ios && !s.device.android) { 10430 touchEventsTarget[action]('mousedown', s.onTouchStart, false); 10431 document[action]('mousemove', s.onTouchMove, moveCapture); 10432 document[action]('mouseup', s.onTouchEnd, false); 10433 } 10434 } 10435 window[action]('resize', s.onResize); 10436 10437 // Next, Prev, Index 10438 if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) { 10439 s.nextButton[actionDom]('click', s.onClickNext); 10440 if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey); 10441 } 10442 if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) { 10443 s.prevButton[actionDom]('click', s.onClickPrev); 10444 if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey); 10445 } 10446 if (s.params.pagination && s.params.paginationClickable) { 10447 s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex); 10448 if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey); 10449 } 10450 10451 // Prevent Links Clicks 10452 if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true); 10453 }; 10454 s.attachEvents = function () { 10455 s.initEvents(); 10456 }; 10457 s.detachEvents = function () { 10458 s.initEvents(true); 10459 }; 10460 10461 /*========================= 10462 Handle Clicks 10463 ===========================*/ 10464 // Prevent Clicks 10465 s.allowClick = true; 10466 s.preventClicks = function (e) { 10467 if (!s.allowClick) { 10468 if (s.params.preventClicks) e.preventDefault(); 10469 if (s.params.preventClicksPropagation && s.animating) { 10470 e.stopPropagation(); 10471 e.stopImmediatePropagation(); 10472 } 10473 } 10474 }; 10475 // Clicks 10476 s.onClickNext = function (e) { 10477 e.preventDefault(); 10478 if (s.isEnd && !s.params.loop) return; 10479 s.slideNext(); 10480 }; 10481 s.onClickPrev = function (e) { 10482 e.preventDefault(); 10483 if (s.isBeginning && !s.params.loop) return; 10484 s.slidePrev(); 10485 }; 10486 s.onClickIndex = function (e) { 10487 e.preventDefault(); 10488 var index = $(this).index() * s.params.slidesPerGroup; 10489 if (s.params.loop) index = index + s.loopedSlides; 10490 s.slideTo(index); 10491 }; 10492 10493 /*========================= 10494 Handle Touches 10495 ===========================*/ 10496 function findElementInEvent(e, selector) { 10497 var el = $(e.target); 10498 if (!el.is(selector)) { 10499 if (typeof selector === 'string') { 10500 el = el.parents(selector); 10501 } 10502 else if (selector.nodeType) { 10503 var found; 10504 el.parents().each(function (index, _el) { 10505 if (_el === selector) found = selector; 10506 }); 10507 if (!found) return undefined; 10508 else return selector; 10509 } 10510 } 10511 if (el.length === 0) { 10512 return undefined; 10513 } 10514 return el[0]; 10515 } 10516 s.updateClickedSlide = function (e) { 10517 var slide = findElementInEvent(e, '.' + s.params.slideClass); 10518 var slideFound = false;
10519 if (slide) { 10520 for (var i = 0; i < s.slides.length; i++) { 10521 if (s.slides[i] === slide) slideFound = true; 10522 } 10523 } 10524 10525 if (slide && slideFound) { 10526 s.clickedSlide = slide; 10527 s.clickedIndex = $(slide).index(); 10528 } 10529 else { 10530 s.clickedSlide = undefined; 10531 s.clickedIndex = undefined; 10532 return; 10533 } 10534 if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) { 10535 var slideToIndex = s.clickedIndex, 10536 realIndex, 10537 duplicatedSlides; 10538 if (s.params.loop) { 10539 if (s.animating) return; 10540 realIndex = $(s.clickedSlide).attr('data-swiper-slide-index'); 10541 if (s.params.centeredSlides) { 10542 if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) { 10543 s.fixLoop(); 10544 slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.swiper-slide-duplicate)').eq(0).index(); 10545 setTimeout(function () { 10546 s.slideTo(slideToIndex); 10547 }, 0); 10548 } 10549 else { 10550 s.slideTo(slideToIndex); 10551 } 10552 } 10553 else { 10554 if (slideToIndex > s.slides.length - s.params.slidesPerView) { 10555 s.fixLoop(); 10556 slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.swiper-slide-duplicate)').eq(0).index(); 10557 setTimeout(function () { 10558 s.slideTo(slideToIndex); 10559 }, 0); 10560 } 10561 else { 10562 s.slideTo(slideToIndex); 10563 } 10564 } 10565 } 10566 else { 10567 s.slideTo(slideToIndex); 10568 } 10569 } 10570 }; 10571 10572 var isTouched, 10573 isMoved, 10574 allowTouchCallbacks, 10575 touchStartTime, 10576 isScrolling, 10577 currentTranslate, 10578 startTranslate, 10579 allowThresholdMove, 10580 // Form elements to match 10581 formElements = 'input, select, textarea, button', 10582 // Last click time 10583 lastClickTime = Date.now(), clickTimeout, 10584 //Velocities 10585 velocities = [], 10586 allowMomentumBounce; 10587 10588 // Animating Flag 10589 s.animating = false; 10590 10591 // Touches information 10592 s.touches = { 10593 startX: 0, 10594 startY: 0, 10595 currentX: 0, 10596 currentY: 0, 10597 diff: 0 10598 }; 10599 10600 // Touch handlers 10601 var isTouchEvent, startMoving; 10602 s.onTouchStart = function (e) { 10603 if (e.originalEvent) e = e.originalEvent; 10604 isTouchEvent = e.type === 'touchstart'; 10605 if (!isTouchEvent && 'which' in e && e.which === 3) return; 10606 if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) { 10607 s.allowClick = true; 10608 return; 10609 } 10610 if (s.params.swipeHandler) { 10611 if (!findElementInEvent(e, s.params.swipeHandler)) return; 10612 } 10613 10614 var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; 10615 var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; 10616 10617 // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore 10618 if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) { 10619 return; 10620 } 10621 10622 isTouched = true; 10623 isMoved = false;
10624 allowTouchCallbacks = true; 10625 isScrolling = undefined; 10626 startMoving = undefined; 10627 s.touches.startX = startX; 10628 s.touches.startY = startY; 10629 touchStartTime = Date.now(); 10630 s.allowClick = true; 10631 s.updateContainerSize(); 10632 s.swipeDirection = undefined; 10633 if (s.params.threshold > 0) allowThresholdMove = false; 10634 if (e.type !== 'touchstart') { 10635 var preventDefault = true; 10636 if ($(e.target).is(formElements)) preventDefault = false; 10637 if (document.activeElement && $(document.activeElement).is(formElements)) { 10638 document.activeElement.blur(); 10639 } 10640 if (preventDefault) { 10641 e.preventDefault(); 10642 } 10643 } 10644 s.emit('onTouchStart', s, e); 10645 }; 10646 10647 s.onTouchMove = function (e) { 10648 if (e.originalEvent) e = e.originalEvent; 10649 if (isTouchEvent && e.type === 'mousemove') return; 10650 if (e.preventedByNestedSwiper) { 10651 s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; 10652 s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; 10653 return; 10654 } 10655 if (s.params.onlyExternal) { 10656 // isMoved = true; 10657 s.allowClick = false; 10658 if (isTouched) { 10659 s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; 10660 s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; 10661 touchStartTime = Date.now(); 10662 } 10663 return; 10664 } 10665 if (isTouchEvent && document.activeElement) { 10666 if (e.target === document.activeElement && $(e.target).is(formElements)) { 10667 isMoved = true; 10668 s.allowClick = false; 10669 return; 10670 } 10671 } 10672 if (allowTouchCallbacks) { 10673 s.emit('onTouchMove', s, e); 10674 } 10675 if (e.targetTouches && e.targetTouches.length > 1) return; 10676 10677 s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; 10678 s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; 10679 10680 if (typeof isScrolling === 'undefined') { 10681 var touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI; 10682 isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle); 10683 } 10684 if (isScrolling) { 10685 s.emit('onTouchMoveOpposite', s, e); 10686 } 10687 if (typeof startMoving === 'undefined' && s.browser.ieTouch) { 10688 if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) { 10689 startMoving = true; 10690 } 10691 } 10692 if (!isTouched) return; 10693 if (isScrolling) { 10694 isTouched = false;
10695 return; 10696 } 10697 if (!startMoving && s.browser.ieTouch) { 10698 return; 10699 } 10700 s.allowClick = false; 10701 s.emit('onSliderMove', s, e); 10702 e.preventDefault(); 10703 if (s.params.touchMoveStopPropagation && !s.params.nested) { 10704 e.stopPropagation(); 10705 } 10706 10707 if (!isMoved) { 10708 if (params.loop) { 10709 s.fixLoop(); 10710 } 10711 startTranslate = s.getWrapperTranslate(); 10712 s.setWrapperTransition(0); 10713 if (s.animating) { 10714 s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd'); 10715 } 10716 if (s.params.autoplay && s.autoplaying) { 10717 if (s.params.autoplayDisableOnInteraction) { 10718 s.stopAutoplay(); 10719 } 10720 else { 10721 s.pauseAutoplay(); 10722 } 10723 } 10724 allowMomentumBounce = false; 10725 //Grab Cursor 10726 if (s.params.grabCursor) { 10727 s.container[0].style.cursor = 'move'; 10728 s.container[0].style.cursor = '-webkit-grabbing'; 10729 s.container[0].style.cursor = '-moz-grabbin'; 10730 s.container[0].style.cursor = 'grabbing'; 10731 } 10732 } 10733 isMoved = true; 10734 10735 var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY; 10736 10737 diff = diff * s.params.touchRatio; 10738 if (s.rtl) diff = -diff; 10739 10740 s.swipeDirection = diff > 0 ? 'prev' : 'next'; 10741 currentTranslate = diff + startTranslate; 10742 10743 var disableParentSwiper = true; 10744 if ((diff > 0 && currentTranslate > s.minTranslate())) { 10745 disableParentSwiper = false;
10746 if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio); 10747 } 10748 else if (diff < 0 && currentTranslate < s.maxTranslate()) { 10749 disableParentSwiper = false; 10750 if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio); 10751 } 10752 10753 if (disableParentSwiper) { 10754 e.preventedByNestedSwiper = true; 10755 } 10756 10757 // Directions locks 10758 if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) { 10759 currentTranslate = startTranslate; 10760 } 10761 if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) { 10762 currentTranslate = startTranslate; 10763 } 10764 10765 if (!s.params.followFinger) return; 10766 10767 // Threshold 10768 if (s.params.threshold > 0) { 10769 if (Math.abs(diff) > s.params.threshold || allowThresholdMove) { 10770 if (!allowThresholdMove) { 10771 allowThresholdMove = true; 10772 s.touches.startX = s.touches.currentX; 10773 s.touches.startY = s.touches.currentY; 10774 currentTranslate = startTranslate; 10775 s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY; 10776 return; 10777 } 10778 } 10779 else { 10780 currentTranslate = startTranslate; 10781 return; 10782 } 10783 } 10784 // Update active index in free mode 10785 if (s.params.freeMode || s.params.watchSlidesProgress) { 10786 s.updateActiveIndex(); 10787 } 10788 if (s.params.freeMode) { 10789 //Velocity 10790 if (velocities.length === 0) { 10791 velocities.push({ 10792 position: s.touches[s.isHorizontal() ? 'startX' : 'startY'], 10793 time: touchStartTime 10794 }); 10795 } 10796 velocities.push({ 10797 position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'], 10798 time: (new window.Date()).getTime() 10799 }); 10800 } 10801 // Update progress 10802 s.updateProgress(currentTranslate); 10803 // Update translate 10804 s.setWrapperTranslate(currentTranslate); 10805 }; 10806 s.onTouchEnd = function (e) { 10807 if (e.originalEvent) e = e.originalEvent; 10808 if (allowTouchCallbacks) { 10809 s.emit('onTouchEnd', s, e); 10810 } 10811 allowTouchCallbacks = false; 10812 if (!isTouched) return; 10813 //Return Grab Cursor 10814 if (s.params.grabCursor && isMoved && isTouched) { 10815 s.container[0].style.cursor = 'move'; 10816 s.container[0].style.cursor = '-webkit-grab'; 10817 s.container[0].style.cursor = '-moz-grab'; 10818 s.container[0].style.cursor = 'grab'; 10819 } 10820 10821 // Time diff 10822 var touchEndTime = Date.now(); 10823 var timeDiff = touchEndTime - touchStartTime; 10824 10825 // Tap, doubleTap, Click 10826 if (s.allowClick) { 10827 s.updateClickedSlide(e); 10828 s.emit('onTap', s, e); 10829 if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) { 10830 if (clickTimeout) clearTimeout(clickTimeout); 10831 clickTimeout = setTimeout(function () { 10832 if (!s) return; 10833 if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) { 10834 s.paginationContainer.toggleClass(s.params.paginationHiddenClass); 10835 } 10836 s.emit('onClick', s, e); 10837 }, 300); 10838 10839 } 10840 if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) { 10841 if (clickTimeout) clearTimeout(clickTimeout); 10842 s.emit('onDoubleTap', s, e); 10843 } 10844 } 10845 10846 lastClickTime = Date.now(); 10847 setTimeout(function () { 10848 if (s) s.allowClick = true; 10849 }, 0); 10850 10851 if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) { 10852 isTouched = isMoved = false;
10853 return; 10854 } 10855 isTouched = isMoved = false; 10856 10857 var currentPos; 10858 if (s.params.followFinger) { 10859 currentPos = s.rtl ? s.translate : -s.translate; 10860 } 10861 else { 10862 currentPos = -currentTranslate; 10863 } 10864 if (s.params.freeMode) { 10865 if (currentPos < -s.minTranslate()) { 10866 s.slideTo(s.activeIndex); 10867 return; 10868 } 10869 else if (currentPos > -s.maxTranslate()) { 10870 if (s.slides.length < s.snapGrid.length) { 10871 s.slideTo(s.snapGrid.length - 1); 10872 } 10873 else { 10874 s.slideTo(s.slides.length - 1); 10875 } 10876 return; 10877 } 10878 10879 if (s.params.freeModeMomentum) { 10880 if (velocities.length > 1) { 10881 var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop(); 10882 10883 var distance = lastMoveEvent.position - velocityEvent.position; 10884 var time = lastMoveEvent.time - velocityEvent.time; 10885 s.velocity = distance / time; 10886 s.velocity = s.velocity / 2; 10887 if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) { 10888 s.velocity = 0; 10889 } 10890 // this implies that the user stopped moving a finger then released. 10891 // There would be no events with distance zero, so the last event is stale. 10892 if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) { 10893 s.velocity = 0; 10894 } 10895 } else { 10896 s.velocity = 0; 10897 } 10898 10899 velocities.length = 0; 10900 var momentumDuration = 1000 * s.params.freeModeMomentumRatio; 10901 var momentumDistance = s.velocity * momentumDuration; 10902 10903 var newPosition = s.translate + momentumDistance; 10904 if (s.rtl) newPosition = - newPosition; 10905 var doBounce = false; 10906 var afterBouncePosition; 10907 var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio; 10908 if (newPosition < s.maxTranslate()) { 10909 if (s.params.freeModeMomentumBounce) { 10910 if (newPosition + s.maxTranslate() < -bounceAmount) { 10911 newPosition = s.maxTranslate() - bounceAmount; 10912 } 10913 afterBouncePosition = s.maxTranslate(); 10914 doBounce = true; 10915 allowMomentumBounce = true; 10916 } 10917 else { 10918 newPosition = s.maxTranslate(); 10919 } 10920 } 10921 else if (newPosition > s.minTranslate()) { 10922 if (s.params.freeModeMomentumBounce) { 10923 if (newPosition - s.minTranslate() > bounceAmount) { 10924 newPosition = s.minTranslate() + bounceAmount; 10925 } 10926 afterBouncePosition = s.minTranslate(); 10927 doBounce = true; 10928 allowMomentumBounce = true; 10929 } 10930 else { 10931 newPosition = s.minTranslate(); 10932 } 10933 } 10934 else if (s.params.freeModeSticky) { 10935 var j = 0, 10936 nextSlide; 10937 for (j = 0; j < s.snapGrid.length; j += 1) { 10938 if (s.snapGrid[j] > -newPosition) { 10939 nextSlide = j; 10940 break; 10941 } 10942 10943 } 10944 if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') { 10945 newPosition = s.snapGrid[nextSlide]; 10946 } else { 10947 newPosition = s.snapGrid[nextSlide - 1]; 10948 } 10949 if (!s.rtl) newPosition = - newPosition; 10950 } 10951 //Fix duration 10952 if (s.velocity !== 0) { 10953 if (s.rtl) { 10954 momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity); 10955 } 10956 else { 10957 momentumDuration = Math.abs((newPosition - s.translate) / s.velocity); 10958 } 10959 } 10960 else if (s.params.freeModeSticky) { 10961 s.slideReset(); 10962 return; 10963 } 10964 10965 if (s.params.freeModeMomentumBounce && doBounce) { 10966 s.updateProgress(afterBouncePosition); 10967 s.setWrapperTransition(momentumDuration); 10968 s.setWrapperTranslate(newPosition); 10969 s.onTransitionStart(); 10970 s.animating = true; 10971 s.wrapper.transitionEnd(function () { 10972 if (!s || !allowMomentumBounce) return; 10973 s.emit('onMomentumBounce', s); 10974 10975 s.setWrapperTransition(s.params.speed); 10976 s.setWrapperTranslate(afterBouncePosition); 10977 s.wrapper.transitionEnd(function () { 10978 if (!s) return; 10979 s.onTransitionEnd(); 10980 }); 10981 }); 10982 } else if (s.velocity) { 10983 s.updateProgress(newPosition); 10984 s.setWrapperTransition(momentumDuration); 10985 s.setWrapperTranslate(newPosition); 10986 s.onTransitionStart(); 10987 if (!s.animating) { 10988 s.animating = true; 10989 s.wrapper.transitionEnd(function () { 10990 if (!s) return; 10991 s.onTransitionEnd(); 10992 }); 10993 } 10994 10995 } else { 10996 s.updateProgress(newPosition); 10997 } 10998 10999 s.updateActiveIndex(); 11000 } 11001 if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) { 11002 s.updateProgress(); 11003 s.updateActiveIndex(); 11004 } 11005 return; 11006 } 11007 11008 // Find current slide 11009 var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0]; 11010 for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) { 11011 if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') { 11012 if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) { 11013 stopIndex = i; 11014 groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i]; 11015 } 11016 } 11017 else { 11018 if (currentPos >= s.slidesGrid[i]) { 11019 stopIndex = i; 11020 groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2]; 11021 } 11022 } 11023 } 11024 11025 // Find current slide size 11026 var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize; 11027 11028 if (timeDiff > s.params.longSwipesMs) { 11029 // Long touches 11030 if (!s.params.longSwipes) { 11031 s.slideTo(s.activeIndex); 11032 return; 11033 } 11034 if (s.swipeDirection === 'next') { 11035 if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup); 11036 else s.slideTo(stopIndex); 11037 11038 } 11039 if (s.swipeDirection === 'prev') { 11040 if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup); 11041 else s.slideTo(stopIndex); 11042 } 11043 } 11044 else { 11045 // Short swipes 11046 if (!s.params.shortSwipes) { 11047 s.slideTo(s.activeIndex); 11048 return; 11049 } 11050 if (s.swipeDirection === 'next') { 11051 s.slideTo(stopIndex + s.params.slidesPerGroup); 11052 11053 } 11054 if (s.swipeDirection === 'prev') { 11055 s.slideTo(stopIndex); 11056 } 11057 } 11058 }; 11059 /*========================= 11060 Transitions 11061 ===========================*/ 11062 s._slideTo = function (slideIndex, speed) { 11063 return s.slideTo(slideIndex, speed, true, true); 11064 }; 11065 s.slideTo = function (slideIndex, speed, runCallbacks, internal) { 11066 if (typeof runCallbacks === 'undefined') runCallbacks = true; 11067 if (typeof slideIndex === 'undefined') slideIndex = 0; 11068 if (slideIndex < 0) slideIndex = 0; 11069 s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup); 11070 if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1; 11071 11072 var translate = - s.snapGrid[s.snapIndex]; 11073 // Stop autoplay 11074 if (s.params.autoplay && s.autoplaying) { 11075 if (internal || !s.params.autoplayDisableOnInteraction) { 11076 s.pauseAutoplay(speed); 11077 } 11078 else { 11079 s.stopAutoplay(); 11080 } 11081 } 11082 // Update progress 11083 s.updateProgress(translate); 11084 11085 // Normalize slideIndex 11086 for (var i = 0; i < s.slidesGrid.length; i++) { 11087 if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) { 11088 slideIndex = i; 11089 } 11090 } 11091 11092 // Directions locks 11093 if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) { 11094 return false;
11095 } 11096 if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) { 11097 if ((s.activeIndex || 0) !== slideIndex ) return false; 11098 } 11099 11100 // Update Index 11101 if (typeof speed === 'undefined') speed = s.params.speed; 11102 s.previousIndex = s.activeIndex || 0; 11103 s.activeIndex = slideIndex; 11104 11105 if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) { 11106 // Update Height 11107 if (s.params.autoHeight) { 11108 s.updateAutoHeight(); 11109 } 11110 s.updateClasses(); 11111 if (s.params.effect !== 'slide') { 11112 s.setWrapperTranslate(translate); 11113 } 11114 return false; 11115 } 11116 s.updateClasses(); 11117 s.onTransitionStart(runCallbacks); 11118 11119 if (speed === 0) { 11120 s.setWrapperTranslate(translate); 11121 s.setWrapperTransition(0); 11122 s.onTransitionEnd(runCallbacks); 11123 } 11124 else { 11125 s.setWrapperTranslate(translate); 11126 s.setWrapperTransition(speed); 11127 if (!s.animating) { 11128 s.animating = true; 11129 s.wrapper.transitionEnd(function () { 11130 if (!s) return; 11131 s.onTransitionEnd(runCallbacks); 11132 }); 11133 } 11134 11135 } 11136 11137 return true; 11138 }; 11139 11140 s.onTransitionStart = function (runCallbacks) { 11141 if (typeof runCallbacks === 'undefined') runCallbacks = true; 11142 if (s.params.autoHeight) { 11143 s.updateAutoHeight(); 11144 } 11145 if (s.lazy) s.lazy.onTransitionStart(); 11146 if (runCallbacks) { 11147 s.emit('onTransitionStart', s); 11148 if (s.activeIndex !== s.previousIndex) { 11149 s.emit('onSlideChangeStart', s); 11150 if (s.activeIndex > s.previousIndex) { 11151 s.emit('onSlideNextStart', s); 11152 } 11153 else { 11154 s.emit('onSlidePrevStart', s); 11155 } 11156 } 11157 11158 } 11159 }; 11160 s.onTransitionEnd = function (runCallbacks) { 11161 s.animating = false; 11162 s.setWrapperTransition(0); 11163 if (typeof runCallbacks === 'undefined') runCallbacks = true; 11164 if (s.lazy) s.lazy.onTransitionEnd(); 11165 if (runCallbacks) { 11166 s.emit('onTransitionEnd', s); 11167 if (s.activeIndex !== s.previousIndex) { 11168 s.emit('onSlideChangeEnd', s); 11169 if (s.activeIndex > s.previousIndex) { 11170 s.emit('onSlideNextEnd', s); 11171 } 11172 else { 11173 s.emit('onSlidePrevEnd', s); 11174 } 11175 } 11176 } 11177 if (s.params.hashnav && s.hashnav) { 11178 s.hashnav.setHash(); 11179 } 11180 11181 }; 11182 s.slideNext = function (runCallbacks, speed, internal) { 11183 if (s.params.loop) { 11184 if (s.animating) return false;
11185 s.fixLoop(); 11186 var clientLeft = s.container[0].clientLeft; 11187 return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal); 11188 } 11189 else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal); 11190 }; 11191 s._slideNext = function (speed) { 11192 return s.slideNext(true, speed, true); 11193 }; 11194 s.slidePrev = function (runCallbacks, speed, internal) { 11195 if (s.params.loop) { 11196 if (s.animating) return false; 11197 s.fixLoop(); 11198 var clientLeft = s.container[0].clientLeft; 11199 return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal); 11200 } 11201 else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal); 11202 }; 11203 s._slidePrev = function (speed) { 11204 return s.slidePrev(true, speed, true); 11205 }; 11206 s.slideReset = function (runCallbacks, speed, internal) { 11207 return s.slideTo(s.activeIndex, speed, runCallbacks); 11208 }; 11209 11210 /*========================= 11211 Translate/transition helpers 11212 ===========================*/ 11213 s.setWrapperTransition = function (duration, byController) { 11214 s.wrapper.transition(duration); 11215 if (s.params.effect !== 'slide' && s.effects[s.params.effect]) { 11216 s.effects[s.params.effect].setTransition(duration); 11217 } 11218 if (s.params.parallax && s.parallax) { 11219 s.parallax.setTransition(duration); 11220 } 11221 if (s.params.scrollbar && s.scrollbar) { 11222 s.scrollbar.setTransition(duration); 11223 } 11224 if (s.params.control && s.controller) { 11225 s.controller.setTransition(duration, byController); 11226 } 11227 s.emit('onSetTransition', s, duration); 11228 }; 11229 s.setWrapperTranslate = function (translate, updateActiveIndex, byController) { 11230 var x = 0, y = 0, z = 0; 11231 if (s.isHorizontal()) { 11232 x = s.rtl ? -translate : translate; 11233 } 11234 else { 11235 y = translate; 11236 } 11237 11238 if (s.params.roundLengths) { 11239 x = round(x); 11240 y = round(y); 11241 } 11242 11243 if (!s.params.virtualTranslate) { 11244 if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)'); 11245 else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)'); 11246 } 11247 11248 s.translate = s.isHorizontal() ? x : y; 11249 11250 // Check if we need to update progress 11251 var progress; 11252 var translatesDiff = s.maxTranslate() - s.minTranslate(); 11253 if (translatesDiff === 0) { 11254 progress = 0; 11255 } 11256 else { 11257 progress = (translate - s.minTranslate()) / (translatesDiff); 11258 } 11259 if (progress !== s.progress) { 11260 s.updateProgress(translate); 11261 } 11262 11263 if (updateActiveIndex) s.updateActiveIndex(); 11264 if (s.params.effect !== 'slide' && s.effects[s.params.effect]) { 11265 s.effects[s.params.effect].setTranslate(s.translate); 11266 } 11267 if (s.params.parallax && s.parallax) { 11268 s.parallax.setTranslate(s.translate); 11269 } 11270 if (s.params.scrollbar && s.scrollbar) { 11271 s.scrollbar.setTranslate(s.translate); 11272 } 11273 if (s.params.control && s.controller) { 11274 s.controller.setTranslate(s.translate, byController); 11275 } 11276 s.emit('onSetTranslate', s, s.translate); 11277 }; 11278 11279 s.getTranslate = function (el, axis) { 11280 var matrix, curTransform, curStyle, transformMatrix; 11281 11282 // automatic axis detection 11283 if (typeof axis === 'undefined') { 11284 axis = 'x'; 11285 } 11286 11287 if (s.params.virtualTranslate) { 11288 return s.rtl ? -s.translate : s.translate; 11289 } 11290 11291 curStyle = window.getComputedStyle(el, null); 11292 if (window.WebKitCSSMatrix) { 11293 curTransform = curStyle.transform || curStyle.webkitTransform; 11294 if (curTransform.split(',').length > 6) { 11295 curTransform = curTransform.split(', ').map(function(a){ 11296 return a.replace(',','.'); 11297 }).join(', '); 11298 } 11299 // Some old versions of Webkit choke when 'none' is passed; pass 11300 // empty string instead in this case 11301 transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); 11302 } 11303 else { 11304 transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); 11305 matrix = transformMatrix.toString().split(','); 11306 } 11307 11308 if (axis === 'x') { 11309 //Latest Chrome and webkits Fix 11310 if (window.WebKitCSSMatrix) 11311 curTransform = transformMatrix.m41; 11312 //Crazy IE10 Matrix 11313 else if (matrix.length === 16) 11314 curTransform = parseFloat(matrix[12]); 11315 //Normal Browsers 11316 else 11317 curTransform = parseFloat(matrix[4]); 11318 } 11319 if (axis === 'y') { 11320 //Latest Chrome and webkits Fix 11321 if (window.WebKitCSSMatrix) 11322 curTransform = transformMatrix.m42; 11323 //Crazy IE10 Matrix 11324 else if (matrix.length === 16) 11325 curTransform = parseFloat(matrix[13]); 11326 //Normal Browsers 11327 else 11328 curTransform = parseFloat(matrix[5]); 11329 } 11330 if (s.rtl && curTransform) curTransform = -curTransform; 11331 return curTransform || 0; 11332 }; 11333 s.getWrapperTranslate = function (axis) { 11334 if (typeof axis === 'undefined') { 11335 axis = s.isHorizontal() ? 'x' : 'y'; 11336 } 11337 return s.getTranslate(s.wrapper[0], axis); 11338 }; 11339 11340 /*========================= 11341 Observer 11342 ===========================*/ 11343 s.observers = []; 11344 function initObserver(target, options) { 11345 options = options || {}; 11346 // create an observer instance 11347 var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; 11348 var observer = new ObserverFunc(function (mutations) { 11349 mutations.forEach(function (mutation) { 11350 s.onResize(true); 11351 s.emit('onObserverUpdate', s, mutation); 11352 }); 11353 }); 11354 11355 observer.observe(target, { 11356 attributes: typeof options.attributes === 'undefined' ? true : options.attributes, 11357 childList: typeof options.childList === 'undefined' ? true : options.childList, 11358 characterData: typeof options.characterData === 'undefined' ? true : options.characterData 11359 }); 11360 11361 s.observers.push(observer); 11362 }
11363 s.initObservers = function () { 11364 if (s.params.observeParents) { 11365 var containerParents = s.container.parents(); 11366 for (var i = 0; i < containerParents.length; i++) { 11367 initObserver(containerParents[i]); 11368 } 11369 } 11370 11371 // Observe container 11372 initObserver(s.container[0], {childList: false}); 11373 11374 // Observe wrapper 11375 initObserver(s.wrapper[0], {attributes: false}); 11376 }; 11377 s.disconnectObservers = function () { 11378 for (var i = 0; i < s.observers.length; i++) { 11379 s.observers[i].disconnect(); 11380 } 11381 s.observers = []; 11382 }; 11383 /*========================= 11384 Loop 11385 ===========================*/ 11386 // Create looped slides 11387 s.createLoop = function () { 11388 // Remove duplicated slides 11389 s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); 11390 11391 var slides = s.wrapper.children('.' + s.params.slideClass); 11392 11393 if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length; 11394 11395 s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10); 11396 s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides; 11397 if (s.loopedSlides > slides.length) { 11398 s.loopedSlides = slides.length; 11399 } 11400 11401 var prependSlides = [], appendSlides = [], i; 11402 slides.each(function (index, el) { 11403 var slide = $(this); 11404 if (index < s.loopedSlides) appendSlides.push(el); 11405 if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el); 11406 slide.attr('data-swiper-slide-index', index); 11407 }); 11408 for (i = 0; i < appendSlides.length; i++) { 11409 s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass)); 11410 } 11411 for (i = prependSlides.length - 1; i >= 0; i--) { 11412 s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass)); 11413 } 11414 }; 11415 s.destroyLoop = function () { 11416 s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); 11417 s.slides.removeAttr('data-swiper-slide-index'); 11418 }; 11419 s.reLoop = function (updatePosition) { 11420 var oldIndex = s.activeIndex - s.loopedSlides; 11421 s.destroyLoop(); 11422 s.createLoop(); 11423 s.updateSlidesSize(); 11424 if (updatePosition) { 11425 s.slideTo(oldIndex + s.loopedSlides, 0, false); 11426 } 11427 11428 }; 11429 s.fixLoop = function () { 11430 var newIndex; 11431 //Fix For Negative Oversliding 11432 if (s.activeIndex < s.loopedSlides) { 11433 newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex; 11434 newIndex = newIndex + s.loopedSlides; 11435 s.slideTo(newIndex, 0, false, true); 11436 } 11437 //Fix For Positive Oversliding 11438 else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) { 11439 newIndex = -s.slides.length + s.activeIndex + s.loopedSlides; 11440 newIndex = newIndex + s.loopedSlides; 11441 s.slideTo(newIndex, 0, false, true); 11442 } 11443 }; 11444 /*========================= 11445 Append/Prepend/Remove Slides 11446 ===========================*/ 11447 s.appendSlide = function (slides) { 11448 if (s.params.loop) { 11449 s.destroyLoop(); 11450 } 11451 if (typeof slides === 'object' && slides.length) { 11452 for (var i = 0; i < slides.length; i++) { 11453 if (slides[i]) s.wrapper.append(slides[i]); 11454 } 11455 } 11456 else { 11457 s.wrapper.append(slides); 11458 } 11459 if (s.params.loop) { 11460 s.createLoop(); 11461 } 11462 if (!(s.params.observer && s.support.observer)) { 11463 s.update(true); 11464 } 11465 }; 11466 s.prependSlide = function (slides) { 11467 if (s.params.loop) { 11468 s.destroyLoop(); 11469 } 11470 var newActiveIndex = s.activeIndex + 1; 11471 if (typeof slides === 'object' && slides.length) { 11472 for (var i = 0; i < slides.length; i++) { 11473 if (slides[i]) s.wrapper.prepend(sli
11473des[i]); 11474 } 11475 newActiveIndex = s.activeIndex + slides.length; 11476 } 11477 else { 11478 s.wrapper.prepend(slides); 11479 } 11480 if (s.params.loop) { 11481 s.createLoop(); 11482 } 11483 if (!(s.params.observer && s.support.observer)) { 11484 s.update(true); 11485 } 11486 s.slideTo(newActiveIndex, 0, false); 11487 }; 11488 s.removeSlide = function (slidesIndexes) { 11489 if (s.params.loop) { 11490 s.destroyLoop(); 11491 s.slides = s.wrapper.children('.' + s.params.slideClass); 11492 } 11493 var newActiveIndex = s.activeIndex, 11494 indexToRemove; 11495 if (typeof slidesIndexes === 'object' && slidesIndexes.length) { 11496 for (var i = 0; i < slidesIndexes.length; i++) { 11497 indexToRemove = slidesIndexes[i]; 11498 if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove(); 11499 if (indexToRemove < newActiveIndex) newActiveIndex--; 11500 } 11501 newActiveIndex = Math.max(newActiveIndex, 0); 11502 } 11503 else { 11504 indexToRemove = slidesIndexes; 11505 if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove(); 11506 if (indexToRemove < newActiveIndex) newActiveIndex--; 11507 newActiveIndex = Math.max(newActiveIndex, 0); 11508 } 11509 11510 if (s.params.loop) { 11511 s.createLoop(); 11512 } 11513 11514 if (!(s.params.observer && s.support.observer)) { 11515 s.update(true); 11516 } 11517 if (s.params.loop) { 11518 s.slideTo(newActiveIndex + s.loopedSlides, 0, false); 11519 } 11520 else { 11521 s.slideTo(newActiveIndex, 0, false); 11522 } 11523 11524 }; 11525 s.removeAllSlides = function () { 11526 var slidesIndexes = []; 11527 for (var i = 0; i < s.slides.length; i++) { 11528 slidesIndexes.push(i); 11529 } 11530 s.removeSlide(slidesIndexes); 11531 }; 11532 11533 11534 /*=========================
11535 Effects 11536 ===========================*/ 11537 s.effects = { 11538 fade: { 11539 setTranslate: function () { 11540 for (var i = 0; i < s.slides.length; i++) { 11541 var slide = s.slides.eq(i); 11542 var offset = slide[0].swiperSlideOffset; 11543 var tx = -offset; 11544 if (!s.params.virtualTranslate) tx = tx - s.translate; 11545 var ty = 0; 11546 if (!s.isHorizontal()) { 11547 ty = tx; 11548 tx = 0; 11549 } 11550 var slideOpacity = s.params.fade.crossFade ? 11551 Math.max(1 - Math.abs(slide[0].progress), 0) : 11552 1 + Math.min(Math.max(slide[0].progress, -1), 0); 11553 slide 11554 .css({ 11555 opacity: slideOpacity 11556 }) 11557 .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)'); 11558 11559 } 11560 11561 }, 11562 setTransition: function (duration) { 11563 s.slides.transition(duration); 11564 if (s.params.virtualTranslate && duration !== 0) { 11565 var eventTriggered = false; 11566 s.slides.transitionEnd(function () { 11567 if (eventTriggered) return; 11568 if (!s) return; 11569 eventTriggered = true; 11570 s.animating = false; 11571 var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd']; 11572 for (var i = 0; i < triggerEvents.length; i++) { 11573 s.wrapper.trigger(triggerEvents[i]); 11574 } 11575 }); 11576 } 11577 } 11578 }, 11579 flip: { 11580 setTranslate: function () { 11581 for (var i = 0; i < s.slides.length; i++) { 11582 var slide = s.slides.eq(i); 11583 var progress = slide[0].progress; 11584 if (s.params.flip.limitRotation) { 11585 progress = Math.max(Math.min(slide[0].progress, 1), -1); 11586 } 11587 var offset = slide[0].swiperSlideOffset; 11588 var rotate = -180 * progress, 11589 rotateY = rotate, 11590 rotateX = 0, 11591 tx = -offset, 11592 ty = 0; 11593 if (!s.isHorizontal()) { 11594 ty = tx; 11595 tx = 0; 11596 rotateX = -rotateY; 11597 rotateY = 0; 11598 } 11599 else if (s.rtl) { 11600 rotateY = -rotateY; 11601 } 11602 11603 slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length; 11604 11605 if (s.params.flip.slideShadows) { 11606 //Set shadows 11607 var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top'); 11608 var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom'); 11609 if (shadowBefore.length === 0) { 11610 shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>'); 11611 slide.append(shadowBefore); 11612 } 11613 if (shadowAfter.length === 0) { 11614 shadowAfter = $('<
11614div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>'); 11615 slide.append(shadowAfter); 11616 } 11617 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 11618 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 11619 } 11620 11621 slide 11622 .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)'); 11623 } 11624 }, 11625 setTransition: function (duration) { 11626 s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 11627 if (s.params.virtualTranslate && duration !== 0) { 11628 var eventTriggered = false; 11629 s.slides.eq(s.activeIndex).transitionEnd(function () { 11630 if (eventTriggered) return; 11631 if (!s) return; 11632 if (!$(this).hasClass(s.params.slideActiveClass)) return; 11633 eventTriggered = true; 11634 s.animating = false; 11635 var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd']; 11636 for (var i = 0; i < triggerEvents.length; i++) { 11637 s.wrapper.trigger(triggerEvents[i]); 11638 } 11639 }); 11640 } 11641 } 11642 }, 11643 cube: { 11644 setTranslate: function () { 11645 var wrapperRotate = 0, cubeShadow; 11646 if (s.params.cube.shadow) { 11647 if (s.isHorizontal()) { 11648 cubeShadow = s.wrapper.find('.swiper-cube-shadow'); 11649 if (cubeShadow.length === 0) { 11650 cubeShadow = $('<div class="swiper-cube-shadow"></div>'); 11651 s.wrapper.append(cubeShadow); 11652 } 11653 cubeShadow.css({height: s.width + 'px'}); 11654 } 11655 else { 11656 cubeShadow = s.container.find('.swiper-cube-shadow'); 11657 if (cubeShadow.length === 0) { 11658 cubeShadow = $('<div class="swiper-cube-shadow"></div>'); 11659 s.container.append(cubeShadow); 11660 } 11661 } 11662 } 11663 for (var i = 0; i < s.slides.length; i++) { 11664 var slide = s.slides.eq(i); 11665 var slideAngle = i * 90; 11666 var round = Math.floor(slideAngle / 360); 11667 if (s.rtl) { 11668 slideAngle = -slideAngle; 11669 round = Math.floor(-slideAngle / 360); 11670 } 11671 var progress = Math.max(Math.min(slide[0].progress, 1), -1); 11672 var tx = 0, ty = 0, tz = 0; 11673 if (i % 4 === 0) { 11674 tx = - round * 4 * s.size; 11675 tz = 0; 11676 } 11677 else if ((i - 1) % 4 === 0) { 11678 tx = 0; 11679 tz = - round * 4 * s.size; 11680 } 11681 else if ((i - 2) % 4 === 0) { 11682 tx = s.size + round * 4 * s.size; 11683 tz = s.size; 11684 } 11685 else if ((i - 3) % 4 === 0) { 11686 tx = - s.size; 11687 tz = 3 * s.size + s.size * 4 * round; 11688 } 11689 if (s.rtl) { 11690 tx = -tx; 11691 } 11692 11693 if (!s.isHorizontal()) { 11694 ty = tx; 11695 tx = 0; 11696 } 11697 11698 var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)'; 11699 if (progress <= 1 && progress > -1) { 11700 wrapperRotate = i * 90 + progress * 90; 11701 if (s.rtl) wrapperRotate = -i * 90 - progress * 90; 11702 } 11703 slide.transform(transform); 11704 if (s.params.cube.slideShadows) { 11705 //Set shadows 11706 var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top'); 11707 var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom'); 11708 if (shadowBefore.length === 0) { 11709 shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>'); 11710 slide.append(shadowBefore); 11711 } 11712 if (shadowAfter.length === 0) { 11713 shadowAfter = $('<
11713div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>'); 11714 slide.append(shadowAfter); 11715 } 11716 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 11717 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 11718 } 11719 } 11720 s.wrapper.css({ 11721 '-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px', 11722 '-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px', 11723 '-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px', 11724 'transform-origin': '50% 50% -' + (s.size / 2) + 'px' 11725 }); 11726 11727 if (s.params.cube.shadow) { 11728 if (s.isHorizontal()) { 11729 cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')'); 11730 } 11731 else { 11732 var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; 11733 var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); 11734 var scale1 = s.params.cube.shadowScale, 11735 scale2 = s.params.cube.shadowScale / multiplier, 11736 offset = s.params.cube.shadowOffset; 11737 cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)'); 11738 } 11739 } 11740 var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0; 11741 s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)'); 11742 }, 11743 setTransition: function (duration) { 11744 s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 11745 if (s.params.cube.shadow && !s.isHorizontal()) { 11746 s.container.find('.swiper-cube-shadow').transition(duration); 11747 } 11748 } 11749 }, 11750 coverflow: { 11751 setTranslate: function () { 11752 var transform = s.translate; 11753 var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2; 11754 var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate; 11755 var translate = s.params.coverflow.depth; 11756 //Each slide offset from center 11757 for (var i = 0, length = s.slides.length; i < length; i++) { 11758 var slide = s.slides.eq(i); 11759 var slideSize = s.slidesSizesGrid[i]; 11760 var slideOffset = slide[0].swiperSlideOffset; 11761 var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier; 11762 11763 var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0; 11764 var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier; 11765 // var rotateZ = 0 11766 var translateZ = -translate * Math.abs(offsetMultiplier); 11767 11768 var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier); 11769 var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0; 11770 11771 //Fix for ultra small values 11772 if (Math.abs(translateX) < 0.001) translateX = 0; 11773 if (Math.abs(translateY) < 0.001) translateY = 0; 11774 if (Math.abs(translateZ) < 0.001) translateZ = 0; 11775 if (Math.abs(rotateY) < 0.001) rotateY = 0; 11776 if (Math.abs(rotateX) < 0.001) rotateX = 0; 11777 11778 var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)'; 11779 11780 slide.transform(slideTransform); 11781 slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; 11782 if (s.params.coverflow.slideShadows) { 11783 //Set shadows 11784 var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top'); 11785 var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom'); 11786 if (shadowBefore.length === 0) { 11787 shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>'); 11788 slide.append(shadowBefore); 11789 } 11790 if (shadowAfter.length === 0) { 11791 shadowAfter = $('<
11791div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>'); 11792 slide.append(shadowAfter); 11793 } 11794 if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; 11795 if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0; 11796 } 11797 } 11798 11799 //Set correct perspective for IE10 11800 if (s.browser.ie) { 11801 var ws = s.wrapper[0].style; 11802 ws.perspectiveOrigin = center + 'px 50%'; 11803 } 11804 }, 11805 setTransition: function (duration) { 11806 s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 11807 } 11808 } 11809 }; 11810 11811 /*========================= 11812 Images Lazy Loading 11813 ===========================*/ 11814 s.lazy = { 11815 initialImageLoaded: false, 11816 loadImageInSlide: function (index, loadInDuplicate) { 11817 if (typeof index === 'undefined') return; 11818 if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true; 11819 if (s.slides.length === 0) return; 11820 11821 var slide = s.slides.eq(index); 11822 var img = slide.find('.swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)'); 11823 if (slide.hasClass('swiper-lazy') && !slide.hasClass('swiper-lazy-loaded') && !slide.hasClass('swiper-lazy-loading')) { 11824 img = img.add(slide[0]); 11825 } 11826 if (img.length === 0) return; 11827 11828 img.each(function () { 11829 var _img = $(this); 11830 _img.addClass('swiper-lazy-loading'); 11831 var background = _img.attr('data-background'); 11832 var src = _img.attr('data-src'), 11833 srcset = _img.attr('data-srcset'); 11834 s.loadImage(_img[0], (src || background), srcset, false, function () { 11835 if (background) { 11836 _img.css('background-image', 'url("' + background + '")'); 11837 _img.removeAttr('data-background'); 11838 } 11839 else { 11840 if (srcset) { 11841 _img.attr('srcset', srcset); 11842 _img.removeAttr('data-srcset'); 11843 } 11844 if (src) { 11845 _img.attr('src', src); 11846 _img.removeAttr('data-src'); 11847 } 11848 11849 } 11850 11851 _img.addClass('swiper-lazy-loaded').removeClass('swiper-lazy-loading'); 11852 slide.find('.swiper-lazy-preloader, .preloader').remove(); 11853 if (s.params.loop && loadInDupl
11853icate) { 11854 var slideOriginalIndex = slide.attr('data-swiper-slide-index'); 11855 if (slide.hasClass(s.params.slideDuplicateClass)) { 11856 var originalSlide = s.wrapper.children('[data-swiper-slide-index="' + slideOriginalIndex + '"]:not(.' + s.params.slideDuplicateClass + ')'); 11857 s.lazy.loadImageInSlide(originalSlide.index(), false); 11858 } 11859 else { 11860 var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + slideOriginalIndex + '"]'); 11861 s.lazy.loadImageInSlide(duplicatedSlide.index(), false); 11862 } 11863 } 11864 s.emit('onLazyImageReady', s, slide[0], _img[0]); 11865 }); 11866 11867 s.emit('onLazyImageLoad', s, slide[0], _img[0]); 11868 }); 11869 11870 }, 11871 load: function () { 11872 var i; 11873 if (s.params.watchSlidesVisibility) { 11874 s.wrapper.children('.' + s.params.slideVisibleClass).each(function () { 11875 s.lazy.loadImageInSlide($(this).index()); 11876 }); 11877 } 11878 else { 11879 if (s.params.slidesPerView > 1) { 11880 for (i = s.activeIndex; i < s.activeIndex + s.params.slidesPerView ; i++) { 11881 if (s.slides[i]) s.lazy.loadImageInSlide(i); 11882 } 11883 } 11884 else { 11885 s.lazy.loadImageInSlide(s.activeIndex); 11886 } 11887 } 11888 if (s.params.lazyLoadingInPrevNext) { 11889 if (s.params.slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) { 11890 var amount = s.params.lazyLoadingInPrevNextAmount; 11891 var spv = s.params.slidesPerView; 11892 var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length); 11893 var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0); 11894 // Next Slides 11895 for (i = s.activeIndex + s.params.slidesPerView; i < maxIndex; i++) { 11896 if (s.slides[i]) s.lazy.loadImageInSlide(i); 11897 } 11898 // Prev Slides 11899 for (i = minIndex; i < s.activeIndex ; i++) { 11900 if (s.slides[i]) s.lazy.loadImageInSlide(i); 11901 } 11902 } 11903 else { 11904 var nextSlide = s.wrapper.children('.' + s.params.slideNextClass); 11905 if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index()); 11906 11907 var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass); 11908 if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index()); 11909 } 11910 } 11911 }, 11912 onTransitionStart: function () { 11913 if (s.params.lazyLoading) { 11914 if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) { 11915 s.lazy.load(); 11916 } 11917 } 11918 }, 11919 onTransitionEnd: function () { 11920 if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) { 11921 s.lazy.load(); 11922 } 11923 } 11924 }; 11925 11926 11927 /*========================= 11928 Scrollbar 11929 ===========================*/ 11930 s.scrollbar = { 11931 isTouched: false, 11932 setDragPosition: function (e) { 11933 var sb = s.scrollbar; 11934 var x = 0, y = 0; 11935 var translate; 11936 var pointerPosition = s.isHorizontal() ? 11937 ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) : 11938 ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ; 11939 var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2; 11940 var positionMin = -s.minTranslate() * sb.moveDivider; 11941 var positionMax = -s.maxTranslate() * sb.moveDivider; 11942 if (position < positionMin) { 11943 position = positionMin; 11944 } 11945 else if (position > positionMax) { 11946 position = positionMax; 11947 } 11948 position = -position / sb.moveDivider; 11949 s.updateProgress(position); 11950 s.setWrapperTranslate(position, true); 11951 }, 11952 dragStart: function (e) { 11953 var sb = s.scrollbar; 11954 sb.isTouched = true; 11955 e.preventDefault(); 11956 e.stopPropagation(); 11957 11958 sb.setDragPosition(e); 11959 clearTimeout(sb.dragTimeout); 11960 11961 sb.track.transition(0); 11962 if (s.params.scrollbarHide) { 11963 sb.track.css('opacity', 1); 11964 } 11965 s.wrapper.transition(100); 11966 sb.drag.transition(100); 11967 s.emit('onScrollbarDragStart', s); 11968 }, 11969 dragMove: function (e) { 11970 var sb = s.scrollbar; 11971 if (!sb.isTouched) return; 11972 if (e.preventDefault) e.preventDefault(); 11973 else e.returnValue = false;
11974 sb.setDragPosition(e); 11975 s.wrapper.transition(0); 11976 sb.track.transition(0); 11977 sb.drag.transition(0); 11978 s.emit('onScrollbarDragMove', s); 11979 }, 11980 dragEnd: function (e) { 11981 var sb = s.scrollbar; 11982 if (!sb.isTouched) return; 11983 sb.isTouched = false; 11984 if (s.params.scrollbarHide) { 11985 clearTimeout(sb.dragTimeout); 11986 sb.dragTimeout = setTimeout(function () { 11987 sb.track.css('opacity', 0); 11988 sb.track.transition(400); 11989 }, 1000); 11990 11991 } 11992 s.emit('onScrollbarDragEnd', s); 11993 if (s.params.scrollbarSnapOnRelease) { 11994 s.slideReset(); 11995 } 11996 }, 11997 enableDraggable: function () { 11998 var sb = s.scrollbar; 11999 var target = s.support.touch ? sb.track : document; 12000 $(sb.track).on(s.touchEvents.start, sb.dragStart); 12001 $(target).on(s.touchEvents.move, sb.dragMove); 12002 $(target).on(s.touchEvents.end, sb.dragEnd); 12003 }, 12004 disableDraggable: function () { 12005 var sb = s.scrollbar; 12006 var target = s.support.touch ? sb.track : document; 12007 $(sb.track).off(s.touchEvents.start, sb.dragStart); 12008 $(target).off(s.touchEvents.move, sb.dragMove); 12009 $(target).off(s.touchEvents.end, sb.dragEnd); 12010 }, 12011 set: function () { 12012 if (!s.params.scrollbar) return; 12013 var sb = s.scrollbar; 12014 sb.track = $(s.params.scrollbar); 12015 if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) { 12016 sb.track = s.container.find(s.params.scrollbar); 12017 } 12018 sb.drag = sb.track.find('.swiper-scrollbar-drag'); 12019 if (sb.drag.length === 0) { 12020 sb.drag = $('<div class="swiper-scrollbar-drag"></div>'); 12021 sb.track.append(sb.drag); 12022 } 12023 sb.drag[0].style.width = ''; 12024 sb.drag[0].style.height = ''; 12025 sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight; 12026 12027 sb.divider = s.size / s.virtualSize; 12028 sb.moveDivider = sb.divider * (sb.trackSize / s.size); 12029 sb.dragSize = sb.trackSize * sb.divider; 12030 12031 if (s.isHorizontal()) { 12032 sb.drag[0].style.width = sb.dragSize + 'px'; 12033 } 12034 else { 12035 sb.drag[0].style.height = sb.dragSize + 'px'; 12036 } 12037 12038 if (sb.divider >= 1) { 12039 sb.track[0].style.display = 'none'; 12040 } 12041 else { 12042 sb.track[0].style.display = ''; 12043 } 12044 if (s.params.scrollbarHide) { 12045 sb.track[0].style.opacity = 0; 12046 } 12047 }, 12048 setTranslate: function () { 12049 if (!s.params.scrollbar) return; 12050 var diff; 12051 var sb = s.scrollbar; 12052 var translate = s.translate || 0; 12053 var newPos; 12054 12055 var newSize = sb.dragSize; 12056 newPos = (sb.trackSize - sb.dragSize) * s.progress; 12057 if (s.rtl && s.isHorizontal()) { 12058 newPos = -newPos; 12059 if (newPos > 0) { 12060 newSize = sb.dragSize - newPos; 12061 newPos = 0; 12062 } 12063 else if (-newPos + sb.dragSize > sb.trackSize) { 12064 newSize = sb.trackSize + newPos; 12065 } 12066 } 12067 else { 12068 if (newPos < 0) { 12069 newSize = sb.dragSize + newPos; 12070 newPos = 0; 12071 } 12072 else if (newPos + sb.dragSize > sb.trackSize) { 12073 newSize = sb.trackSize - newPos; 12074 } 12075 } 12076 if (s.isHorizontal()) { 12077 if (s.support.transforms3d) { 12078 sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)'); 12079 } 12080 else { 12081 sb.drag.transform('translateX(' + (newPos) + 'px)'); 12082 } 12083 sb.drag[0].style.width = newSize + 'px'; 12084 } 12085 else { 12086 if (s.support.transforms3d) { 12087 sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)'); 12088 } 12089 else { 12090 sb.drag.transform('translateY(' + (newPos) + 'px)'); 12091 } 12092 sb.drag[0].style.height = newSize + 'px'; 12093 } 12094 if (s.params.scrollbarHide) { 12095 clearTimeout(sb.timeout); 12096 sb.track[0].style.opacity = 1; 12097 sb.timeout = setTimeout(function () { 12098 sb.track[0].style.opacity = 0; 12099 sb.track.transition(400); 12100 }, 1000); 12101 } 12102 }, 12103 setTransition: function (duration) { 12104 if (!s.params.scrollbar) return; 12105 s.scrollbar.drag.transition(duration); 12106 } 12107 }; 12108 12109 /*========================= 12110 Controller 12111 ===========================*/ 12112 s.controller = { 12113 LinearSpline: function (x, y) { 12114 this.x = x; 12115 this.y = y; 12116 this.lastIndex = x.length - 1; 12117 // Given an x value (x2), return the expected y2 value: 12118 // (x1,y1) is the known point before given value,
12119 // (x3,y3) is the known point after given value. 12120 var i1, i3; 12121 var l = this.x.length; 12122 12123 this.interpolate = function (x2) { 12124 if (!x2) return 0; 12125 12126 // Get the indexes of x1 and x3 (the array indexes before and after given x2): 12127 i3 = binarySearch(this.x, x2); 12128 i1 = i3 - 1; 12129 12130 // We have our indexes i1 & i3, so we can calculate already: 12131 // y2 := ((x2âx1) à (y3ây1)) ÷ (x3âx1) + y1 12132 return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1]; 12133 }; 12134 12135 var binarySearch = (function() { 12136 var maxIndex, minIndex, guess; 12137 return function(array, val) { 12138 minIndex = -1; 12139 maxIndex = array.length; 12140 while (maxIndex - minIndex > 1) 12141 if (array[guess = maxIndex + minIndex >> 1] <= val) { 12142 minIndex = guess; 12143 } else { 12144 maxIndex = guess; 12145 } 12146 return maxIndex; 12147 }; 12148 })(); 12149 }, 12150 //xxx: for now i will just save one spline function to to 12151 getInterpolateFunction: function(c){ 12152 if(!s.controller.spline) s.controller.spline = s.params.loop ? 12153 new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) : 12154 new s.controller.LinearSpline(s.snapGrid, c.snapGrid); 12155 }, 12156 setTranslate: function (translate, byController) { 12157 var controlled = s.params.control; 12158 var multiplier, controlledTranslate; 12159 function setControlledTranslate(c) { 12160 // this will create an Interpolate function based on the snapGrids 12161 // x is the Grid of the scrolled scroller and y will be the controlled scroller 12162 // it makes sense to create this only once and recall it for the interpolation 12163 // the function does a lot of value caching for performance 12164 translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate; 12165 if (s.params.controlBy === 'slide') { 12166 s.controller.getInterpolateFunction(c); 12167 // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid 12168 // but it did not work out 12169 controlledTranslate = -s.controller.spline.interpolate(-translate); 12170 } 12171 12172 if(!controlledTranslate || s.params.controlBy === 'container'){ 12173 multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate()); 12174 controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate(); 12175 } 12176 12177 if (s.params.controlInverse) { 12178 controlledTranslate = c.maxTranslate() - controlledTranslate; 12179 } 12180 c.updateProgress(controlledTranslate); 12181 c.setWrapperTranslate(controlledTranslate, false, s); 12182 c.updateActiveIndex(); 12183 } 12184 if (s.isArray(controlled)) { 12185 for (var i = 0; i < controlled.length; i++) { 12186 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 12187 setControlledTranslate(controlled[i]); 12188 } 12189 } 12190 } 12191 else if (controlled instanceof Swiper && byController !== controlled) { 12192 12193 setControlledTranslate(controlled); 12194 } 12195 }, 12196 setTransition: function (duration, byController) { 12197 var controlled = s.params.control; 12198 var i; 12199 function setControlledTransition(c) { 12200 c.setWrapperTransition(duration, s); 12201 if (duration !== 0) { 12202 c.onTransitionStart(); 12203 c.wrapper.transitionEnd(function(){ 12204 if (!controlled) return; 12205 if (c.params.loop && s.params.controlBy === 'slide') { 12206 c.fixLoop(); 12207 } 12208 c.onTransitionEnd(); 12209 12210 }); 12211 } 12212 } 12213 if (s.isArray(controlled)) { 12214 for (i = 0; i < controlled.length; i++) { 12215 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 12216 setControlledTransition(controlled[i]); 12217 } 12218 } 12219 } 12220 else if (controlled instanceof Swiper && byController !== controlled) { 12221 setControlledTransition(controlled); 12222 } 12223 } 12224 }; 12225 12226 /*========================= 12227 Hash Navigation 12228 ===========================*/ 12229 s.hashnav = { 12230 init: function () { 12231 if (!s.params.hashnav) return; 12232 s.hashnav.initialized = true; 12233 var hash = document.location.hash.replace('#', ''); 12234 if (!hash) return; 12235 var speed = 0; 12236 for (var i = 0, length = s.slides.length; i < length; i++) { 12237 var slide = s.slides.eq(i); 12238 var slideHash = slide.attr('data-hash'); 12239 if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) { 12240 var index = slide.index(); 12241 s.slideTo(index, speed, s.params.runCallbacksOnInit, true); 12242 } 12243 } 12244 }, 12245 setHash: function () { 12246 if (!s.hashnav.initialized || !s.params.hashnav) return; 12247 document.location.hash = s.slides.eq(s.activeIndex).attr('data-hash') || ''; 12248 } 12249 }; 12250 12251 /*========================= 12252 Keyboard Control 12253 ===========================*/ 12254 function handleKeyboard(e) { 12255 if (e.originalEvent) e = e.originalEvent; //jquery fix 12256 var kc = e.keyCode || e.charCode; 12257 // Directions locks 12258 if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) { 12259 return false;
12260 } 12261 if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) { 12262 return false; 12263 } 12264 if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { 12265 return; 12266 } 12267 if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { 12268 return; 12269 } 12270 if (kc === 37 || kc === 39 || kc === 38 || kc === 40) { 12271 var inView = false; 12272 //Check that swiper should be inside of visible area of window 12273 if (s.container.parents('.swiper-slide').length > 0 && s.container.parents('.swiper-slide-active').length === 0) { 12274 return; 12275 } 12276 var windowScroll = { 12277 left: window.pageXOffset, 12278 top: window.pageYOffset 12279 }; 12280 var windowWidth = window.innerWidth; 12281 var windowHeight = window.innerHeight; 12282 var swiperOffset = s.container.offset(); 12283 if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft; 12284 var swiperCoord = [ 12285 [swiperOffset.left, swiperOffset.top], 12286 [swiperOffset.left + s.width, swiperOffset.top], 12287 [swiperOffset.left, swiperOffset.top + s.height], 12288 [swiperOffset.left + s.width, swiperOffset.top + s.height] 12289 ]; 12290 for (var i = 0; i < swiperCoord.length; i++) { 12291 var point = swiperCoord[i]; 12292 if ( 12293 point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth && 12294 point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight 12295 ) { 12296 inView = true; 12297 } 12298 12299 } 12300 if (!inView) return; 12301 } 12302 if (s.isHorizontal()) { 12303 if (kc === 37 || kc === 39) { 12304 if (e.preventDefault) e.preventDefault(); 12305 else e.returnValue = false; 12306 } 12307 if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext(); 12308 if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev(); 12309 } 12310 else { 12311 if (kc === 38 || kc === 40) { 12312 if (e.preventDefault) e.preventDefault(); 12313 else e.returnValue = false; 12314 } 12315 if (kc === 40) s.slideNext(); 12316 if (kc === 38) s.slidePrev(); 12317 } 12318 } 12319 s.disableKeyboardControl = function () { 12320 s.params.keyboardControl = false; 12321 $(document).off('keydown', handleKeyboard); 12322 }; 12323 s.enableKeyboardControl = function () { 12324 s.params.keyboardControl = true; 12325 $(document).on('keydown', handleKeyboard); 12326 }; 12327 12328 12329 /*========================= 12330 Mousewheel Control 12331 ===========================*/ 12332 s.mousewheel = { 12333 event: false, 12334 lastScrollTime: (new window.Date()).getTime() 12335 }; 12336 if (s.params.mousewheelControl) { 12337 try { 12338 new window.WheelEvent('wheel'); 12339 s.mousewheel.event = 'wheel'; 12340 } catch (e) { 12341 if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) { 12342 s.mousewheel.event = 'wheel'; 12343 } 12344 } 12345 if (!s.mousewheel.event && window.WheelEvent) { 12346 12347 } 12348 if (!s.mousewheel.event && document.onmousewheel !== undefined) { 12349 s.mousewheel.event = 'mousewheel'; 12350 } 12351 if (!s.mousewheel.event) { 12352 s.mousewheel.event = 'DOMMouseScroll'; 12353 } 12354 } 12355 function handleMousewheel(e) { 12356 if (e.originalEvent) e = e.originalEvent; //jquery fix 12357 var we = s.mousewheel.event; 12358 var delta = 0; 12359 var rtlFactor = s.rtl ? -1 : 1; 12360 12361 //WebKits 12362 if (we === 'mousewheel') { 12363 if (s.params.mousewheelForceToAxis) { 12364 if (s.isHorizontal()) { 12365 if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor; 12366 else return; 12367 } 12368 else { 12369 if (Math.abs(e.wheelDeltaY) > Math.abs(e.wheelDeltaX)) delta = e.wheelDeltaY; 12370 else return; 12371 } 12372 } 12373 else { 12374 delta = Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY) ? - e.wheelDeltaX * rtlFactor : - e.wheelDeltaY; 12375 } 12376 } 12377 //Old FireFox 12378 else if (we === 'DOMMouseScroll') delta = -e.detail; 12379 //New FireFox 12380 else if (we === 'wheel') { 12381 if (s.params.mousewheelForceToAxis) { 12382 if (s.isHorizontal()) { 12383 if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) delta = -e.deltaX * rtlFactor; 12384 else return; 12385 } 12386 else { 12387 if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) delta = -e.deltaY; 12388 else return; 12389 } 12390 } 12391 else { 12392 delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? - e.deltaX * rtlFactor : - e.deltaY; 12393 } 12394 } 12395 if (delta === 0) return; 12396 12397 if (s.params.mousewheelInvert) delta = -delta; 12398 12399 if (!s.params.freeMode) { 12400 if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) { 12401 if (delta < 0) { 12402 if ((!s.isEnd || s.params.loop) && !s.animating) s.slideNext(); 12403 else if (s.params.mousewheelReleaseOnEdges) return true; 12404 } 12405 else {
12406 if ((!s.isBeginning || s.params.loop) && !s.animating) s.slidePrev(); 12407 else if (s.params.mousewheelReleaseOnEdges) return true; 12408 } 12409 } 12410 s.mousewheel.lastScrollTime = (new window.Date()).getTime(); 12411 12412 } 12413 else { 12414 //Freemode or scrollContainer: 12415 var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity; 12416 var wasBeginning = s.isBeginning, 12417 wasEnd = s.isEnd; 12418 12419 if (position >= s.minTranslate()) position = s.minTranslate(); 12420 if (position <= s.maxTranslate()) position = s.maxTranslate(); 12421 12422 s.setWrapperTransition(0); 12423 s.setWrapperTranslate(position); 12424 s.updateProgress(); 12425 s.updateActiveIndex(); 12426 12427 if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) { 12428 s.updateClasses(); 12429 } 12430 12431 if (s.params.freeModeSticky) { 12432 clearTimeout(s.mousewheel.timeout); 12433 s.mousewheel.timeout = setTimeout(function () { 12434 s.slideReset(); 12435 }, 300); 12436 } 12437 else { 12438 if (s.params.lazyLoading && s.lazy) { 12439 s.lazy.load(); 12440 } 12441 } 12442 12443 // Return page scroll on edge positions 12444 if (position === 0 || position === s.maxTranslate()) return; 12445 } 12446 if (s.params.autoplay) s.stopAutoplay(); 12447 12448 if (e.preventDefault) e.preventDefault(); 12449 else e.returnValue = false; 12450 return false; 12451 } 12452 s.disableMousewheelControl = function () { 12453 if (!s.mousewheel.event) return false; 12454 s.container.off(s.mousewheel.event, handleMousewheel); 12455 return true; 12456 }; 12457 12458 s.enableMousewheelControl = function () { 12459 if (!s.mousewheel.event) return false; 12460 s.container.on(s.mousewheel.event, handleMousewheel); 12461 return true; 12462 }; 12463 12464 12465 /*========================= 12466 Parallax 12467 ===========================*/ 12468 function setParallaxTransform(el, progress) { 12469 el = $(el); 12470 var p, pX, pY; 12471 var rtlFactor = s.rtl ? -1 : 1; 12472 12473 p = el.attr('data-swiper-parallax') || '0'; 12474 pX = el.attr('data-swiper-parallax-x'); 12475 pY = el.attr('data-swiper-parallax-y'); 12476 if (pX || pY) { 12477 pX = pX || '0'; 12478 pY = pY || '0'; 12479 } 12480 else { 12481 if (s.isHorizontal()) { 12482 pX = p; 12483 pY = '0'; 12484 } 12485 else { 12486 pY = p; 12487 pX = '0'; 12488 } 12489 } 12490 12491 if ((pX).indexOf('%') >= 0) { 12492 pX = parseInt(pX, 10) * progress * rtlFactor + '%'; 12493 } 12494 else { 12495 pX = pX * progress * rtlFactor + 'px' ; 12496 } 12497 if ((pY).indexOf('%') >= 0) { 12498 pY = parseInt(pY, 10) * progress + '%'; 12499 } 12500 else { 12501 pY = pY * progress + 'px' ; 12502 } 12503 12504 el.transform('translate3d(' + pX + ', ' + pY + ',0px)'); 12505 } 12506 s.parallax = { 12507 setTranslate: function () { 12508 s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){ 12509 setParallaxTransform(this, s.progress); 12510 12511 }); 12512 s.slides.each(function () { 12513 var slide = $(this); 12514 slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () { 12515 var progress = Math.min(Math.max(slide[0].progress, -1), 1); 12516 setParallaxTransform(this, progress); 12517 }); 12518 }); 12519 }, 12520 setTransition: function (duration) { 12521 if (typeof duration === 'undefined') duration = s.params.speed; 12522 s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){ 12523 var el = $(this); 12524 var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration; 12525 if (duration === 0) parallaxDuration = 0; 12526 el.transition(parallaxDuration); 12527 }); 12528 } 12529 }; 12530 12531 12532 /*========================= 12533 Plugins API. Collect all and init all plugins 12534 ===========================*/ 12535 s._plugins = []; 12536 for (var plugin in s.plugins) { 12537 var p = s.plugins[plugin](s, s.params[plugin]); 12538 if (p) s._plugins.push(p); 12539 } 12540 // Method to call all plugins event/method 12541 s.callPlugins = function (eventName) { 12542 for (var i = 0; i < s._plugins.length; i++) { 12543 if (eventName in s._plugins[i]) { 12544 s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); 12545 } 12546 } 12547 }; 12548 12549 /*========================= 12550 Events/Callbacks/Plugins Emitter 12551 ===========================*/ 12552 function normalizeEventName (eventName) { 12553 if (eventName.indexOf('on') !== 0) { 12554 if (eventName[0] !== eventName[0].toUpperCase()) { 12555 eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1); 12556 } 12557 else { 12558 eventName = 'on' + eventName; 12559 } 12560 } 12561 return eventName; 12562 } 12563 s.emitterEventListeners = { 12564 12565 }; 12566 s.emit = function (eventName) { 12567 // Trigger callbacks 12568 if (s.params[eventName]) { 12569 s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); 12570 } 12571 var i; 12572 // Trigger events 12573 if (s.emitterEventListeners[eventName]) { 12574 for (i = 0; i < s.emitterEventListeners[eventName].length; i++) { 12575 s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); 12576 } 12577 } 12578 // Trigger plugins 12579 if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); 12580 }; 12581 s.on = function (eventName, handler) { 12582 eventName = normalizeEventName(eventName); 12583 if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = []; 12584 s.emitterEventListeners[eventName].push(handler); 12585 return s; 12586 }; 12587 s.off = function (eventName, handler) { 12588 var i; 12589 eventName = normalizeEventName(eventName); 12590 if (typeof handler === 'undefined') { 12591 // Remove all handlers for such event 12592 s.emitterEventListeners[eventName] = []; 12593 return s; 12594 } 12595 if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return; 12596 for (i = 0; i < s.emitterEventListeners[eventName].length; i++) { 12597 if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1); 12598 } 12599 return s; 12600 }; 12601 s.once = function (eventName, handler) { 12602 eventName = normalizeEventName(eventName); 12603 var _handler = function () { 12604 handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); 12605 s.off(eventName, _handler); 12606 }; 12607 s.on(eventName, _handler); 12608 return s; 12609 }; 12610 12611 // Accessibility tools 12612 s.a11y = { 12613 makeFocusable: function ($el) { 12614 $el.attr('tabIndex', '0'); 12615 return $el; 12616 }, 12617 addRole: function ($el, role) { 12618 $el.attr('role', role); 12619 return $el; 12620 }, 12621 12622 addLabel: function ($el, label) { 12623 $el.attr('aria-label', label); 12624 return $el; 12625 }, 12626 12627 disable: function ($el) { 12628 $el.attr('aria-disabled', true); 12629 return $el; 12630 }, 12631 12632 enable: function ($el) { 12633 $el.attr('aria-disabled', false); 12634 return $el; 12635 }, 12636 12637 onEnterKey: function (event) { 12638 if (event.keyCode !== 13) return; 12639 if ($(event.target).is(s.params.nextButton)) { 12640 s.onClickNext(event); 12641 if (s.isEnd) { 12642 s.a11y.notify(s.params.lastSlideMessage); 12643 } 12644 else { 12645 s.a11y.notify(s.params.nextSlideMessage); 12646 } 12647 } 12648 else if ($(event.target).is(s.params.prevButton)) { 12649 s.onClickPrev(event); 12650 if (s.isBeginning) { 12651 s.a11y.notify(s.params.firstSlideMessage); 12652 } 12653 else { 12654 s.a11y.notify(s.params.prevSlideMessage); 12655 } 12656 } 12657 if ($(event.target).is('.' + s.params.bulletClass)) { 12658 $(event.target)[0].click(); 12659 } 12660 }, 12661 12662 liveRegion: $('<span class="swiper-notification" aria-l
12662ive="assertive" aria-atomic="true"></span>'), 12663 12664 notify: function (message) { 12665 var notification = s.a11y.liveRegion; 12666 if (notification.length === 0) return; 12667 notification.html(''); 12668 notification.html(message); 12669 }, 12670 init: function () { 12671 // Setup accessibility 12672 if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) { 12673 s.a11y.makeFocusable(s.nextButton); 12674 s.a11y.addRole(s.nextButton, 'button'); 12675 s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage); 12676 } 12677 if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) { 12678 s.a11y.makeFocusable(s.prevButton); 12679 s.a11y.addRole(s.prevButton, 'button'); 12680 s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage); 12681 } 12682 12683 $(s.container).append(s.a11y.liveRegion); 12684 }, 12685 initPagination: function () { 12686 if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) { 12687 s.bullets.each(function () { 12688 var bullet = $(this); 12689 s.a11y.makeFocusable(bullet); 12690 s.a11y.addRole(bullet, 'button'); 12691 s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1)); 12692 }); 12693 } 12694 }, 12695 destroy: function () { 12696 if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove(); 12697 } 12698 }; 12699 12700 12701 /*========================= 12702 Init/Destroy 12703 ===========================*/ 12704 s.init = function () { 12705 if (s.params.loop) s.createLoop(); 12706 s.updateContainerSize(); 12707 s.updateSlidesSize(); 12708 s.updatePagination(); 12709 if (s.params.scrollbar && s.scrollbar) { 12710 s.scrollbar.set(); 12711 if (s.params.scrollbarDraggable) { 12712 s.scrollbar.enableDraggable(); 12713 } 12714 } 12715 if (s.params.effect !== 'slide' && s.effects[s.params.effect]) { 12716 if (!s.params.loop) s.updateProgress(); 12717 s.effects[s.params.effect].setTranslate(); 12718 } 12719 if (s.params.loop) { 12720 s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit); 12721 } 12722 else { 12723 s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit); 12724 if (s.params.initialSlide === 0) { 12725 if (s.parallax && s.params.parallax) s.parallax.setTranslate(); 12726 if (s.lazy && s.params.lazyLoading) { 12727 s.lazy.load(); 12728 s.lazy.initialImageLoaded = true; 12729 } 12730 } 12731 } 12732 s.attachEvents(); 12733 if (s.params.observer && s.support.observer) {
12734 s.initObservers(); 12735 } 12736 if (s.params.preloadImages && !s.params.lazyLoading) { 12737 s.preloadImages(); 12738 } 12739 if (s.params.autoplay) { 12740 s.startAutoplay(); 12741 } 12742 if (s.params.keyboardControl) { 12743 if (s.enableKeyboardControl) s.enableKeyboardControl(); 12744 } 12745 if (s.params.mousewheelControl) { 12746 if (s.enableMousewheelControl) s.enableMousewheelControl(); 12747 } 12748 if (s.params.hashnav) { 12749 if (s.hashnav) s.hashnav.init(); 12750 } 12751 if (s.params.a11y && s.a11y) s.a11y.init(); 12752 s.emit('onInit', s); 12753 }; 12754 12755 // Cleanup dynamic styles 12756 s.cleanupStyles = function () { 12757 // Container 12758 s.container.removeClass(s.classNames.join(' ')).removeAttr('style'); 12759 12760 // Wrapper 12761 s.wrapper.removeAttr('style'); 12762 12763 // Slides 12764 if (s.slides && s.slides.length) { 12765 s.slides 12766 .removeClass([ 12767 s.params.slideVisibleClass, 12768 s.params.slideActiveClass, 12769 s.params.slideNextClass, 12770 s.params.slidePrevClass 12771 ].join(' ')) 12772 .removeAttr('style') 12773 .removeAttr('data-swiper-column') 12774 .removeAttr('data-swiper-row'); 12775 } 12776 12777 // Pagination/Bullets 12778 if (s.paginationContainer && s.paginationContainer.length) { 12779 s.paginationContainer.removeClass(s.params.paginationHiddenClass); 12780 } 12781 if (s.bullets && s.bullets.length) { 12782 s.bullets.removeClass(s.params.bulletActiveClass); 12783 } 12784 12785 // Buttons 12786 if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass); 12787 if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass); 12788 12789 // Scrollbar 12790 if (s.params.scrollbar && s.scrollbar) { 12791 if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style'); 12792 if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style'); 12793 } 12794 }; 12795 12796 // Destroy 12797 s.destroy = function (deleteInstance, cleanupStyles) { 12798 // Detach evebts 12799 s.detachEvents(); 12800 // Stop autoplay 12801 s.stopAutoplay(); 12802 // Disable draggable 12803 if (s.params.scrollbar && s.scrollbar) { 12804 if (s.params.scrollbarDraggable) { 12805 s.scrollbar.disableDraggable(); 12806 } 12807 } 12808 // Destroy loop 12809 if (s.params.loop) { 12810 s.destroyLoop(); 12811 } 12812 // Cleanup styles 12813 if (cleanupStyles) { 12814 s.cleanupStyles(); 12815 } 12816 // Disconnect observer 12817 s.disconnectObservers(); 12818 // Disable keyboard/mousewheel 12819 if (s.params.keyboardControl) { 12820 if (s.disableKeyboardControl) s.disableKeyboardControl(); 12821 } 12822 if (s.params.mousewheelControl) { 12823 if (s.disableMousewheelControl) s.disableMousewheelControl(); 12824 } 12825 // Disable a11y 12826 if (s.params.a11y && s.a11y) s.a11y.destroy(); 12827 // Destroy callback 12828 s.emit('onDestroy'); 12829 // Delete instance 12830 if (deleteInstance !== false) s = null; 12831 }; 12832 12833 s.init(); 12834 12835 12836 12837 // Return swiper instance 12838 return s; 12839 }; 12840 12841 12842 /*================================================== 12843 Prototype 12844 ====================================================*/ 12845 Swiper.prototype = { 12846 isSafari: (function () { 12847 var ua = navigator.userAgent.toLowerCase(); 12848 return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0); 12849 })(),
12850 isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent), 12851 isArray: function (arr) { 12852 return Object.prototype.toString.apply(arr) === '[object Array]'; 12853 }, 12854 /*================================================== 12855 Browser 12856 ====================================================*/ 12857 browser: { 12858 ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled, 12859 ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1) 12860 }, 12861 /*================================================== 12862 Devices 12863 ====================================================*/ 12864 device: (function () { 12865 var ua = navigator.userAgent; 12866 var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); 12867 var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 12868 var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); 12869 var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); 12870 return { 12871 ios: ipad || iphone || ipod, 12872 android: android 12873 }; 12874 })(), 12875 /*================================================== 12876 Feature Detection 12877 ====================================================*/ 12878 support: { 12879 touch : (window.Modernizr && Modernizr.touch === true) || (function () { 12880 return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch); 12881 })(), 12882 12883 transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () { 12884 var div = document.createElement('div').style; 12885 return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div); 12886 })(), 12887 12888 flexbox: (function () { 12889 var div = document.createElement('div').style; 12890 var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' '); 12891 for (var i = 0; i < styles.length; i++) { 12892 if (styles[i] in div) return true; 12893 } 12894 })(), 12895 12896 observer: (function () { 12897 return ('MutationObserver' in window || 'WebkitMutationObserver' in window); 12898 })() 12899 }, 12900 /*================================================== 12901 Plugins 12902 ====================================================*/ 12903 plugins: {} 12904 }; 12905 12906 12907 /*=========================== 12908 Dom7 Library 12909 ===========================*/ 12910 var Dom7 = (function () { 12911 var Dom7 = function (arr) { 12912 var _this = this, i = 0; 12913 // Create array-like object 12914 for (i = 0; i < arr.length; i++) { 12915 _this[i] = arr[i]; 12916 } 12917 _this.length = arr.length; 12918 // Return collection with methods 12919 return this; 12920 }; 12921 var $ = function (selector, context) { 12922 var arr = [], i = 0; 12923 if (selector && !context) { 12924 if (selector instanceof Dom7) { 12925 return selector; 12926 } 12927 } 12928 if (selector) { 12929 // String 12930 if (typeof selector === 'string') { 12931 var els, tempParent, html = selector.trim(); 12932 if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { 12933 var toCreate = 'div'; 12934 if (html.indexOf('<li') === 0) toCreate = 'ul'; 12935 if (html.indexOf('<tr') === 0) toCreate = 'tbody'; 12936 if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr'; 12937 if (html.indexOf('<tbody') === 0) toCreate = 'table'; 12938 if (html.indexOf('<option') === 0) toCreate = 'select'; 12939 tempParent = document.createElement(toCreate); 12940 tempParent.innerHTML = selector; 12941 for (i = 0; i < tempParent.childNodes.length; i++) { 12942 arr.push(tempParent.childNodes[i]); 12943 } 12944 } 12945 else { 12946 if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) { 12947 // Pure ID selector 12948 els = [document.getElementById(selector.split('#')[1])]; 12949 } 12950 else { 12951 // Other selectors 12952 els = (context || document).querySelectorAll(selector); 12953 } 12954 for (i = 0; i < els.length; i++) { 12955 if (els[i]) arr.push(els[i]); 12956 } 12957 } 12958 } 12959 // Node/element 12960 else if (selector.nodeType || selector === window || selector === document) { 12961 arr.push(selector); 12962 } 12963 //Array of elements or instance of Dom 12964 else if (selector.length > 0 && selector[0].nodeType) { 12965 for (i = 0; i < selector.length; i++) { 12966 arr.push(selector[i]); 12967 } 12968 } 12969 } 12970 return new Dom7(arr); 12971 }; 12972 Dom7.prototype = { 12973 // Classes and attriutes 12974 addClass: function (className) { 12975 if (typeof className === 'undefined') { 12976 return this; 12977 } 12978 var classes = className.split(' '); 12979 for (var i = 0; i < classes.length; i++) { 12980 for (var j = 0; j < this.length; j++) { 12981 if (this[j]) { 12982 this[j].classList.add(classes[i]); 12983 } 12984 } 12985 } 12986 return this; 12987 }, 12988 removeClass: function (className) { 12989 var classes = className.split(' '); 12990 for (var i = 0; i < classes.length; i++) { 12991 for (var j = 0; j < this.length; j++) { 12992 this[j].classList.remove(classes[i]); 12993 } 12994 } 12995 return this; 12996 }, 12997 hasClass: function (className) { 12998 if (!this[0]) return false;
12999 else return this[0].classList.contains(className); 13000 }, 13001 toggleClass: function (className) { 13002 var classes = className.split(' '); 13003 for (var i = 0; i < classes.length; i++) { 13004 for (var j = 0; j < this.length; j++) { 13005 this[j].classList.toggle(classes[i]); 13006 } 13007 } 13008 return this; 13009 }, 13010 attr: function (attrs, value) { 13011 if (arguments.length === 1 && typeof attrs === 'string') { 13012 // Get attr 13013 if (this[0]) return this[0].getAttribute(attrs); 13014 else return undefined; 13015 } 13016 else { 13017 // Set attrs 13018 for (var i = 0; i < this.length; i++) { 13019 if (arguments.length === 2) { 13020 // String 13021 this[i].setAttribute(attrs, value); 13022 } 13023 else { 13024 // Object 13025 for (var attrName in attrs) { 13026 this[i][attrName] = attrs[attrName]; 13027 this[i].setAttribute(attrName, attrs[attrName]); 13028 } 13029 } 13030 } 13031 return this; 13032 } 13033 }, 13034 removeAttr: function (attr) { 13035 for (var i = 0; i < this.length; i++) { 13036 this[i].removeAttribute(attr); 13037 } 13038 return this; 13039 }, 13040 data: function (key, value) { 13041 if (typeof value === 'undefined') { 13042 // Get value 13043 if (this[0]) { 13044 var dataKey = this[0].getAttribute('data-' + key); 13045 if (dataKey) return dataKey; 13046 else if (this[0].dom7ElementDataStorage && (key in this[0].dom7ElementDataStorage)) return this[0].dom7ElementDataStorage[key]; 13047 else return undefined; 13048 } 13049 else return undefined; 13050 } 13051 else { 13052 // Set value 13053 for (var i = 0; i < this.length; i++) { 13054 var el = this[i]; 13055 if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {}; 13056 el.dom7ElementDataStorage[key] = value; 13057 } 13058 return this; 13059 } 13060 }, 13061 // Transforms 13062 transform : function (transform) { 13063 for (var i = 0; i < this.length; i++) { 13064 var elStyle = this[i].style; 13065 elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform; 13066 } 13067 return this; 13068 }, 13069 transition: function (duration) { 13070 if (typeof duration !== 'string') { 13071 duration = duration + 'ms'; 13072 } 13073 for (var i = 0; i < this.length; i++) { 13074 var elStyle = this[i].style; 13075 elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration; 13076 } 13077 return this; 13078 }, 13079 //Events 13080 on: function (eventName, targetSelector, listener, capture) { 13081 function handleLiveEvent(e) { 13082 var target = e.target; 13083 if ($(target).is(targetSelector)) listener.call(target, e); 13084 else { 13085 var parents = $(target).parents(); 13086 for (var k = 0; k < parents.length; k++) { 13087 if ($(parents[k]).is(targetSelector)) listener.call(parents[k], e); 13088 } 13089 } 13090 } 13091 var events = eventName.split(' '); 13092 var i, j; 13093 for (i = 0; i < this.length; i++) { 13094 if (typeof targetSelector === 'function' || targetSelector === false) { 13095 // Usual events 13096 if (typeof targetSelector === 'function') { 13097 listener = arguments[1]; 13098 capture = arguments[2] || false; 13099 } 13100 for (j = 0; j < events.length; j++) { 13101 this[i].addEventListener(events[j], listener, capture); 13102 } 13103 } 13104 else { 13105 //Live events 13106 for (j = 0; j < events.length; j++) { 13107 if (!this[i].dom7LiveListeners) this[i].dom7LiveListeners = []; 13108 this[i].dom7LiveListeners.push({listener: listener, liveListener: handleLiveEvent}); 13109 this[i].addEventListener(events[j], handleLiveEvent, capture); 13110 } 13111 } 13112 } 13113 13114 return this; 13115 }, 13116 off: function (eventName, targetSelector, listener, capture) { 13117 var events = eventName.split(' '); 13118 for (var i = 0; i < events.length; i++) { 13119 for (var j = 0; j < this.length; j++) { 13120 if (typeof targetSelector === 'function' || targetSelector === false) { 13121 // Usual events 13122 if (typeof targetSelector === 'function') { 13123 listener = arguments[1]; 13124 capture = arguments[2] || false; 13125 } 13126 this[j].removeEventListener(events[i], listener, capture); 13127 } 13128 else { 13129 // Live event 13130 if (this[j].dom7LiveListeners) { 13131 for (var k = 0; k < this[j].dom7LiveListeners.length; k++) { 13132 if (this[j].dom7LiveListeners[k].listener === listener) { 13133 this[j].removeEventListener(events[i], this[j].dom7LiveListeners[k].liveListener, capture); 13134 } 13135 } 13136 } 13137 } 13138 } 13139 } 13140 return this; 13141 }, 13142 once: function (eventName, targetSelector, listener, capture) { 13143 var dom = this; 13144 if (typeof targetSelector === 'function') { 13145 targetSelector = false;
13146 listener = arguments[1]; 13147 capture = arguments[2]; 13148 } 13149 function proxy(e) { 13150 listener(e); 13151 dom.off(eventName, targetSelector, proxy, capture); 13152 } 13153 dom.on(eventName, targetSelector, proxy, capture); 13154 }, 13155 trigger: function (eventName, eventData) { 13156 for (var i = 0; i < this.length; i++) { 13157 var evt; 13158 try { 13159 evt = new window.CustomEvent(eventName, {detail: eventData, bubbles: true, cancelable: true}); 13160 } 13161 catch (e) { 13162 evt = document.createEvent('Event'); 13163 evt.initEvent(eventName, true, true); 13164 evt.detail = eventData; 13165 } 13166 this[i].dispatchEvent(evt); 13167 } 13168 return this; 13169 }, 13170 transitionEnd: function (callback) { 13171 var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], 13172 i, j, dom = this; 13173 function fireCallBack(e) { 13174 /*jshint validthis:true */ 13175 if (e.target !== this) return; 13176 callback.call(this, e); 13177 for (i = 0; i < events.length; i++) { 13178 dom.off(events[i], fireCallBack); 13179 } 13180 } 13181 if (callback) { 13182 for (i = 0; i < events.length; i++) { 13183 dom.on(events[i], fireCallBack); 13184 } 13185 } 13186 return this; 13187 }, 13188 // Sizing/Styles 13189 width: function () { 13190 if (this[0] === window) { 13191 return window.innerWidth; 13192 } 13193 else { 13194 if (this.length > 0) { 13195 return parseFloat(this.css('width')); 13196 } 13197 else { 13198 return null; 13199 } 13200 } 13201 }, 13202 outerWidth: function (includeMargins) { 13203 if (this.length > 0) { 13204 if (includeMargins) 13205 return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left')); 13206 else 13207 return this[0].offsetWidth; 13208 } 13209 else return null; 13210 }, 13211 height: function () { 13212 if (this[0] === window) { 13213 return window.innerHeight; 13214 } 13215 else { 13216 if (this.length > 0) { 13217 return parseFloat(this.css('height')); 13218 } 13219 else { 13220 return null; 13221 } 13222 } 13223 }, 13224 outerHeight: function (includeMargins) { 13225 if (this.length > 0) { 13226 if (includeMargins) 13227 return this[0].offsetHeight + parseFloat(this.css('margin-top')) + parseFloat(this.css('margin-bottom')); 13228 else 13229 return this[0].offsetHeight; 13230 } 13231 else return null; 13232 }, 13233 offset: function () { 13234 if (this.length > 0) { 13235 var el = this[0]; 13236 var box = el.getBoundingClientRect(); 13237 var body = document.body; 13238 var clientTop = el.clientTop || body.clientTop || 0; 13239 var clientLeft = el.clientLeft || body.clientLeft || 0; 13240 var scrollTop = window.pageYOffset || el.scrollTop; 13241 var scrollLeft = window.pageXOffset || el.scrollLeft; 13242 return { 13243 top: box.top + scrollTop - clientTop, 13244 left: box.left + scrollLeft - clientLeft 13245 }; 13246 } 13247 else { 13248 return null; 13249 } 13250 }, 13251 css: function (props, value) { 13252 var i; 13253 if (arguments.length === 1) { 13254 if (typeof props === 'string') { 13255 if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props); 13256 } 13257 else { 13258 for (i = 0; i < this.length; i++) { 13259 for (var prop in props) { 13260 this[i].style[prop] = props[prop]; 13261 } 13262 } 13263 return this; 13264 } 13265 } 13266 if (arguments.length === 2 && typeof props === 'string') { 13267 for (i = 0; i < this.length; i++) { 13268 this[i].style[props] = value; 13269 } 13270 return this; 13271 } 13272 return this; 13273 }, 13274 13275 //Dom manipulation 13276 each: function (callback) { 13277 for (var i = 0; i < this.length; i++) { 13278 callback.call(this[i], i, this[i]); 13279 } 13280 return this; 13281 }, 13282 html: function (html) { 13283 if (typeof html === 'undefined') { 13284 return this[0] ? this[0].innerHTML : undefined; 13285 } 13286 else { 13287 for (var i = 0; i < this.length; i++) { 13288 this[i].innerHTML = html; 13289 } 13290 return this; 13291 } 13292 }, 13293 text: function (text) { 13294 if (typeof text === 'undefined') { 13295 if (this[0]) { 13296 return this[0].textContent.trim(); 13297 } 13298 else return null; 13299 } 13300 else { 13301 for (var i = 0; i < this.length; i++) { 13302 this[i].textContent = text; 13303 } 13304 return this; 13305 } 13306 }, 13307 is: function (selector) { 13308 if (!this[0]) return false;
13309 var compareWith, i; 13310 if (typeof selector === 'string') { 13311 var el = this[0]; 13312 if (el === document) return selector === document; 13313 if (el === window) return selector === window; 13314 13315 if (el.matches) return el.matches(selector); 13316 else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector); 13317 else if (el.mozMatchesSelector) return el.mozMatchesSelector(selector); 13318 else if (el.msMatchesSelector) return el.msMatchesSelector(selector); 13319 else { 13320 compareWith = $(selector); 13321 for (i = 0; i < compareWith.length; i++) { 13322 if (compareWith[i] === this[0]) return true; 13323 } 13324 return false; 13325 } 13326 } 13327 else if (selector === document) return this[0] === document; 13328 else if (selector === window) return this[0] === window; 13329 else { 13330 if (selector.nodeType || selector instanceof Dom7) { 13331 compareWith = selector.nodeType ? [selector] : selector; 13332 for (i = 0; i < compareWith.length; i++) { 13333 if (compareWith[i] === this[0]) return true; 13334 } 13335 return false; 13336 } 13337 return false; 13338 } 13339 13340 }, 13341 index: function () { 13342 if (this[0]) { 13343 var child = this[0]; 13344 var i = 0; 13345 while ((child = child.previousSibling) !== null) { 13346 if (child.nodeType === 1) i++; 13347 } 13348 return i; 13349 } 13350 else return undefined; 13351 }, 13352 eq: function (index) { 13353 if (typeof index === 'undefined') return this; 13354 var length = this.length; 13355 var returnIndex; 13356 if (index > length - 1) { 13357 return new Dom7([]); 13358 } 13359 if (index < 0) { 13360 returnIndex = length + index; 13361 if (returnIndex < 0) return new Dom7([]); 13362 else return new Dom7([this[returnIndex]]); 13363 } 13364 return new Dom7([this[index]]); 13365 }, 13366 append: function (newChild) { 13367 var i, j; 13368 for (i = 0; i < this.length; i++) { 13369 if (typeof newChild === 'string') { 13370 var tempDiv = document.createElement('div'); 13371 tempDiv.innerHTML = newChild; 13372 while (tempDiv.firstChild) { 13373 this[i].appendChild(tempDiv.firstChild); 13374 } 13375 } 13376 else if (newChild instanceof Dom7) { 13377 for (j = 0; j < newChild.length; j++) { 13378 this[i].appendChild(newChild[j]); 13379 } 13380 } 13381 else { 13382 this[i].appendChild(newChild); 13383 } 13384 } 13385 return this; 13386 }, 13387 prepend: function (newChild) { 13388 var i, j; 13389 for (i = 0; i < this.length; i++) { 13390 if (typeof newChild === 'string') { 13391 var tempDiv = document.createElement('div'); 13392 tempDiv.innerHTML = newChild; 13393 for (j = tempDiv.childNodes.length - 1; j >= 0; j--) { 13394 this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]); 13395 } 13396 // this[i].insertAdjacentHTML('afterbegin', newChild); 13397 } 13398 else if (newChild instanceof Dom7) { 13399 for (j = 0; j < newChild.length; j++) { 13400 this[i].insertBefore(newChild[j], this[i].childNodes[0]); 13401 } 13402 } 13403 else { 13404 this[i].insertBefore(newChild, this[i].childNodes[0]); 13405 } 13406 } 13407 return this; 13408 }, 13409 insertBefore: function (selector) { 13410 var before = $(selector); 13411 for (var i = 0; i < this.length; i++) { 13412 if (before.length === 1) { 13413 before[0].parentNode.insertBefore(this[i], before[0]); 13414 } 13415 else if (before.length > 1) { 13416 for (var j = 0; j < before.length; j++) { 13417 before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]); 13418 } 13419 } 13420 } 13421 }, 13422 insertAfter: function (selector) { 13423 var after = $(selector); 13424 for (var i = 0; i < this.length; i++) { 13425 if (after.length === 1) { 13426 after[0].parentNode.insertBefore(this[i], after[0].nextSibling); 13427 } 13428 else if (after.length > 1) { 13429 for (var j = 0; j < after.length; j++) { 13430 after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling); 13431 } 13432 } 13433 } 13434 }, 13435 next: function (selector) { 13436 if (this.length > 0) { 13437 if (selector) { 13438 if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) return new Dom7([this[0].nextElementSibling]); 13439 else return new Dom7([]); 13440 } 13441 else { 13442 if (this[0].nextElementSibling) return new Dom7([this[0].nextElementSibling]); 13443 else return new Dom7([]); 13444 } 13445 } 13446 else return new Dom7([]); 13447 }, 13448 nextAll: function (selector) { 13449 var nextEls = []; 13450 var el = this[0]; 13451 if (!el) return new Dom7([]); 13452 while (el.nextElementSibling) { 13453 var next = el.nextElementSibling; 13454 if (selector) { 13455 if($(next).is(selector)) nextEls.push(next); 13456 } 13457 else nextEls.push(next); 13458 el = next; 13459 } 13460 return new Dom7(nextEls); 13461 }, 13462 prev: function (selector) { 13463 if (this.length > 0) { 13464 if (selector) { 13465 if (this[0].previousElementSibling && $(this[0].previousElementSibling).is(selector)) return new Dom7([this[0].previousElementSibling]); 13466 else return new Dom7([]); 13467 } 13468 else { 13469 if (this[0].previousElementSibling) return new Dom7([this[0].previousElementSibling]); 13470 else return new Dom7([]); 13471 } 13472 } 13473 else return new Dom7([]); 13474 }, 13475 prevAll: function (selector) { 13476 var prevEls = []; 13477 var el = this[0]; 13478 if (!el) return new Dom7([]); 13479 while (el.previousElementSibling) { 13480 var prev = el.previousElementSibling; 13481 if (selector) { 13482 if($(prev).is(selector)) prevEls.push(prev); 13483 } 13484 else prevEls.push(prev); 13485 el = prev; 13486 } 13487 return new Dom7(prevEls); 13488 }, 13489 parent: function (selector) { 13490 var parents = []; 13491 for (var i = 0; i < this.length; i++) { 13492 if (selector) { 13493 if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); 13494 } 13495 else { 13496 parents.push(this[i].parentNode); 13497 } 13498 } 13499 return $($.unique(parents)); 13500 }, 13501 parents: function (selector) { 13502 var parents = []; 13503 for (var i = 0; i < this.length; i++) { 13504 var parent = this[i].parentNode; 13505 while (parent) { 13506 if (selector) { 13507 if ($(parent).is(selector)) parents.push(parent); 13508 } 13509 else { 13510 parents.push(parent); 13511 } 13512 parent = parent.parentNode; 13513 } 13514 } 13515 return $($.unique(parents)); 13516 }, 13517 find : function (selector) { 13518 var foundElements = []; 13519 for (var i = 0; i < this.length; i++) { 13520 var found = this[i].querySelectorAll(selector); 13521 for (var j = 0; j < found.length; j++) { 13522 foundElements.push(found[j]); 13523 } 13524 } 13525 return new Dom7(foundElements); 13526 }, 13527 children: function (selector) { 13528 var children = []; 13529 for (var i = 0; i < this.length; i++) { 13530 var childNodes = this[i].childNodes; 13531 13532 for (var j = 0; j < childNodes.length; j++) { 13533 if (!selector) { 13534 if (childNodes[j].nodeType === 1) children.push(childNodes[j]); 13535 } 13536 else { 13537 if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) children.push(childNodes[j]); 13538 } 13539 } 13540 } 13541 return new Dom7($.unique(children)); 13542 }, 13543 remove: function () { 13544 for (var i = 0; i < this.length; i++) { 13545 if (this[i].parentNode) this[i].parentNode.removeChild(this[i]); 13546 } 13547 return this; 13548 }, 13549 add: function () { 13550 var dom = this; 13551 var i, j; 13552 for (i = 0; i < arguments.length; i++) { 13553 var toAdd = $(arguments[i]); 13554 for (j = 0; j < toAdd.length; j++) { 13555 dom[dom.length] = toAdd[j]; 13556 dom.length++; 13557 } 13558 } 13559 return dom; 13560 } 13561 }; 13562 $.fn = Dom7.prototype; 13563 $.unique = function (arr) { 13564 var unique = []; 13565 for (var i = 0; i < arr.length; i++) {
13566 if (unique.indexOf(arr[i]) === -1) unique.push(arr[i]); 13567 } 13568 return unique; 13569 }; 13570 13571 return $; 13572 })(); 13573 13574 13575 /*=========================== 13576 Get Dom libraries 13577 ===========================*/ 13578 var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7']; 13579 for (var i = 0; i < swiperDomPlugins.length; i++) { 13580 if (window[swiperDomPlugins[i]]) { 13581 addLibraryPlugin(window[swiperDomPlugins[i]]); 13582 } 13583 } 13584 // Required DOM Plugins 13585 var domLib; 13586 if (typeof Dom7 === 'undefined') { 13587 domLib = window.Dom7 || window.Zepto || window.jQuery; 13588 } 13589 else { 13590 domLib = Dom7; 13591 } 13592 13593 /*=========================== 13594 Add .swiper plugin from Dom libraries 13595 ===========================*/ 13596 function addLibraryPlugin(lib) { 13597 lib.fn.swiper = function (params) { 13598 var firstInstance; 13599 lib(this).each(function () { 13600 var s = new Swiper(this, params); 13601 if (!firstInstance) firstInstance = s; 13602 }); 13603 return firstInstance; 13604 }; 13605 } 13606 13607 if (domLib) { 13608 if (!('transitionEnd' in domLib.fn)) { 13609 domLib.fn.transitionEnd = function (callback) { 13610 var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], 13611 i, j, dom = this; 13612 function fireCallBack(e) { 13613 /*jshint validthis:true */ 13614 if (e.target !== this) return; 13615 callback.call(this, e); 13616 for (i = 0; i < events.length; i++) { 13617 dom.off(events[i], fireCallBack); 13618 } 13619 } 13620 if (callback) { 13621 for (i = 0; i < events.length; i++) { 13622 dom.on(events[i], fireCallBack); 13623 } 13624 } 13625 return this; 13626 }; 13627 } 13628 if (!('transform' in domLib.fn)) { 13629 domLib.fn.transform = function (transform) { 13630 for (var i = 0; i < this.length; i++) { 13631 var elStyle = this[i].style; 13632 elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform; 13633 } 13634 return this; 13635 }; 13636 } 13637 if (!('transition' in domLib.fn)) { 13638 domLib.fn.transition = function (duration) { 13639 if (typeof duration !== 'string') { 13640 duration = duration + 'ms'; 13641 } 13642 for (var i = 0; i < this.length; i++) { 13643 var elStyle = this[i].style; 13644 elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration; 13645 } 13646 return this; 13647 }; 13648 } 13649 } 13650 13651 window.Swiper = Swiper; 13652})(); 13653/*=========================== 13654 Swiper AMD Export 13655 ===========================*/ 13656if (typeof(module) !== 'undefined') 13657{ 13658 module.exports = window.Swiper; 13659} 13660else if (typeof define === 'function' && define.amd) { 13661 define([], function () { 13662 'use strict'; 13663 return window.Swiper; 13664 }); 13665} 13666//# sourceMappingURL=maps/swiper.js.map 13667;// /var/www/www.vfb.de/httpdocs/current/static/js/iDangerousElementBreakpoints.js 13668if (Swiper) { 13669 Swiper.prototype.plugins.elementBreakpoints = function(s) { 13670 s.getActiveBreakpoint = function() { 13671 //Get breakpoint for window width 13672 if (!s.params.breakpoints) return false;
13673 var breakpoint = false; 13674 var $container = $(s.container[0]); 13675 var containerWidth = $container.width(); 13676 var points = [], point; 13677 for ( point in s.params.breakpoints ) { 13678 if (s.params.breakpoints.hasOwnProperty(point)) { 13679 points.push(point); 13680 } 13681 } 13682 points.sort(function (a, b) { 13683 return parseInt(a, 10) > parseInt(b, 10); 13684 }); 13685 for (var i = 0; i < points.length; i++) { 13686 point = points[i]; 13687 if (s.params.useElementBreakpoints) { 13688 if (point >= containerWidth && !breakpoint) { 13689 breakpoint = point; 13690 } 13691 } else { 13692 if (point >= window.innerWidth && !breakpoint) { 13693 breakpoint = point; 13694 } 13695 } 13696 } 13697 13698 return breakpoint || 'max'; 13699 }; 13700 s.onResize = function (forceUpdatePagination) { 13701 //Breakpoints 13702 if (s.params.breakpoints) { 13703 s.setBreakpoint(); 13704 } 13705 13706 // Disable locks on resize 13707 var allowSwipeToPrev = s.params.allowSwipeToPrev; 13708 var allowSwipeToNext = s.params.allowSwipeToNext; 13709 s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true; 13710 13711 s.updateContainerSize(); 13712 s.updateSlidesSize(); 13713 if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination(); 13714 if (s.params.scrollbar && s.scrollbar) { 13715 s.scrollbar.set(); 13716 } 13717 if (s.controller && s.controller.spline) { 13718 s.controller.spline = undefined; 13719 } 13720 var slideChangedBySlideTo = false; 13721 if (s.params.freeMode) { 13722 var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); 13723 s.setWrapperTranslate(newTranslate); 13724 s.updateActiveIndex(); 13725 s.updateClasses(); 13726 13727 if (s.params.autoHeight) { 13728 s.updateAutoHeight(); 13729 } 13730 } 13731 else { 13732 s.updateClasses(); 13733 if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { 13734 slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true); 13735 } 13736 else { 13737 slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true); 13738 } 13739 } 13740 if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) { 13741 s.lazy.load(); 13742 } 13743 // Return locks after resize 13744 s.params.allowSwipeToPrev = allowSwipeToPrev; 13745 s.params.allowSwipeToNext = allowSwipeToNext; 13746 setTimeout(function() { 13747 s.update(true); 13748 }, 500); 13749 }; 13750 $(function() { 13751 if (s.params.breakpoints) { 13752 s.setBreakpoint(); 13753 } 13754 }); 13755 } 13756} 13757;// /var/www/www.vfb.de/httpdocs/current/static/js/jquery.sharrre.js 13758var SharrrePlatform = SharrrePlatform || function() { 13759 var a = {}; 13760 return { 13761 register: function(b, c) { 13762 a[b] = c 13763 }, 13764 get: function(b, c) { 13765 return a[b] ? new a[b](c) : (console.error("Sharrre - No platform found for " + b), !1) 13766 } 13767 } 13768}(); 13769SharrrePlatform.register("delicious", function(a) { 13770 return defaultSettings = { 13771 url: "", 13772 urlCount: !1, 13773 layout: "1", 13774 count: !0, 13775 popup: { 13776 width: 550, 13777 height: 550 13778 } 13779 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13780 settings: defaultSettings, 13781 url: function(a) { 13782 return "http://feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?" 13783 }, 13784 trackingAction: { 13785 site: "delicious", 13786 action: "add" 13787 }, 13788 load: function(a) { 13789 if ("tall" == a.options.buttons.delicious.size) var b = "width:50px;", 13790 c = "height:35px;width:50px;font-size:15px;line-height:35px;", 13791 d = "height:18px;line-height:18px;margin-top:3px;"; 13792 else var b = "width:93px;", 13793 c = "float:right;padding:0 3px;
13793height:20px;width:26px;line-height:20px;", 13794 d = "float:left;height:20px;line-height:20px;"; 13795 var e = a.shorterTotal(a.options.count.delicious); 13796 "undefined" == typeof e && (e = 0), $(a.element).find(".buttons").append('<div class="button delicious"><div style="' + b + 'font:12px Arial,Helvetica,sans-serif;cursor:pointer;color:#666666;display:inline-block;float:none;height:20px;line-height:normal;margin:0;padding:0;text-indent:0;vertical-align:baseline;"><div style="' + c + 'background-color:#fff;margin-bottom:5px;overflow:hidden;text-align:center;border:1px solid #ccc;border-radius:3px;">' + e + '</div><div style="' + d + 'display:block;padding:0;text-align:center;text-decoration:none;width:50px;background-color:#7EACEE;border:1px solid #40679C;border-radius:3px;color:#fff;"><img src="https://www.delicious.com/?proxy=img/delicious.small.gif" height="10" width="10" alt="Delicious" /> Add</div></div></div>'), $(a.element).find(".delicious").on("click", function() { 13797 a.openPopup("delicious") 13798 }) 13799 }, 13800 tracking: function() {}, 13801 popup: function(a) { 13802 window.open("https://www.delicious.com/save?v=5&noui&jump=close&url=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url) + "&title=" + a.text, "delicious", "toolbar=no,width=" + this.settings.popup.width + ", height=" + this.settings.popup.height) 13803 } 13804 } 13805 }), SharrrePlatform.register("digg", function(a) { 13806 return defaultSettings = { 13807 url: "", 13808 urlCount: !1, 13809 type: "DiggCompact", 13810 count: !0, 13811 popup: { 13812 width: 650, 13813 height: 360 13814 } 13815 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13816 settings: defaultSettings, 13817 url: function(a) { 13818 return "http://services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?" 13819 }, 13820 trackingAction: { 13821 site: "digg", 13822 action: "add" 13823 }, 13824 load: function(a) { 13825 var b = this.settings; 13826 $(a.element).find(".buttons").append('<div class="button digg"><a class="DiggThisButton ' + b.type + '" rel="nofollow external" href="http://digg.com/submit?url=' + encodeURIComponent("" !== b.url ? b.url : a.options.url) + '"></a></div>'); 13827 var c = 0; 13828 "undefined" == typeof __DBW && 0 == c && (c = 1, function() { 13829 var a = document.createElement("SCRIPT"), 13830 b = document.getElementsByTagName("SCRIPT")[0]; 13831 a.type = "text/javascript", a.async = !0, a.src = "http://widgets.digg.com/buttons.js", b.parentNode.insertBefore(a, b) 13832 }()) 13833 }, 13834 tracking: function() {}, 13835 popup: function(a) { 13836 window.open("http://digg.com/tools/diggthis/submit?url=" + encodeURIComponent("" !== a.buttons.digg.url ? a.buttons.digg.url : a.url) + "&title=" + a.text + "&related=true&style=true", "", "toolbar=0, status=0, width="
13836+ this.settings.popup.width + ", height=" + this.settings.popup.height) 13837 } 13838 } 13839 }), SharrrePlatform.register("facebook", function(a) { 13840 return defaultSettings = { 13841 url: "", 13842 urlCount: !1, 13843 action: "like", 13844 layout: "button_count", 13845 count: !0, 13846 width: "", 13847 send: "false", 13848 faces: "false", 13849 colorscheme: "", 13850 font: "", 13851 lang: "en_US", 13852 share: "", 13853 appId: "", 13854 popup: { 13855 width: 900, 13856 height: 500 13857 } 13858 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13859 settings: defaultSettings, 13860 url: function(a) { 13861 return "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?" 13862 }, 13863 trackingAction: { 13864 site: "facebook", 13865 action: "like" 13866 }, 13867 load: function(a) { 13868 var b = this.settings; 13869 $(a.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="' + ("" !== b.url ? b.url : a.options.url) + '" data-send="' + b.send + '" data-layout="' + b.layout + '" data-width="' + b.width + '" data-show-faces="' + b.faces + '" data-action="' + b.action + '" data-colorscheme="' + b.colorscheme + '" data-font="' + b.font + '" data-via="' + b.via + '" data-share="' + b.share + '"></div></div>'); 13870 var c = 0; 13871 "undefined" == typeof FB && 0 == c ? (c = 1, function(a, c, d) { 13872 var e, f = a.getElementsByTagName(c)[0]; 13873 a.getElementById(d) || (e = a.createElement(c), e.id = d, e.src = "https://connect.facebook.net/" + b.lang + "/all.js#xfbml=1", b.appId && (e.src += "&appId=" + b.appId), f.parentNode.insertBefore(e, f)) 13874 }(document, "script", "facebook-jssdk")) : FB.XFBML.parse() 13875 }, 13876 tracking: function() { 13877 fb = window.setInterval(function() { 13878 "undefined" != typeof FB && (FB.Event.subscribe("edge.create", function(a) { 13879 _gaq.push(["_trackSocial", "facebook", "like", a]) 13880 }), FB.Event.subscribe("edge.remove", function(a) { 13881 _gaq.push(["_trackSocial", "facebook", "unlike", a]) 13882 }), FB.Event.subscribe("message.send", function(a) { 13883 _gaq.push(["_trackSocial", "facebook", "send", a]) 13884 }), clearInterval(fb)) 13885 }, 1e3) 13886 }, 13887 popup: function(a) { 13888 window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url) + "&t=" + a.text, "", "toolbar=0, status=0, width="
13888+ this.settings.popup.width + ", height=" + this.settings.popup.height) 13889 } 13890 } 13891 }), SharrrePlatform.register("googlePlus", function(a) { 13892 return defaultSettings = { 13893 url: "", 13894 urlCount: !1, 13895 size: "medium", 13896 lang: "en-US", 13897 annotation: "", 13898 count: !0, 13899 popup: { 13900 width: 900, 13901 height: 500 13902 } 13903 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13904 settings: defaultSettings, 13905 url: function(a) { 13906 return a + "?url={url}&type=googlePlus" 13907 }, 13908 trackingAction: { 13909 site: "Google", 13910 action: "+1" 13911 }, 13912 load: function(a) { 13913 var b = this.settings; 13914 $(a.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="' + b.size + '" data-href="' + ("" !== b.url ? b.url : a.options.url) + '" data-annotation="' + b.annotation + '"></div></div>'), window.___gcfg = { 13915 lang: b.lang 13916 }; 13917 var c = 0; 13918 "undefined" != typeof gapi && "undefined" != typeof gapi.plusone || 0 != c ? gapi.plusone.go() : (c = 1, function() { 13919 var a = document.createElement("script"); 13920 a.type = "text/javascript", a.async = !0, a.src = "https://apis.google.com/js/plusone.js"; 13921 var b = document.getElementsByTagName("script")[0]; 13922 b.parentNode.insertBefore(a, b) 13923 }()) 13924 }, 13925 tracking: function() {}, 13926 popup: function(a) { 13927 window.open("https://plus.google.com/share?hl=" + this.settings.lang + "&url=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url), "", "toolbar=0, status=0, width="
13927+ this.settings.popup.width + ", height=" + this.settings.popup.height) 13928 } 13929 } 13930 }), SharrrePlatform.register("linkedin", function(a) { 13931 return defaultSettings = { 13932 url: "", 13933 urlCount: !1, 13934 counter: "", 13935 count: !0, 13936 popup: { 13937 width: 550, 13938 height: 550 13939 } 13940 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13941 settings: defaultSettings, 13942 url: function(a) { 13943 return "https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?" 13944 }, 13945 trackingAction: { 13946 site: "linkedin", 13947 action: "share" 13948 }, 13949 load: function(a) { 13950 var b = this.settings; 13951 $(a.element).find(".buttons").append('<div class="button linkedin"><script type="IN/share" data-url="' + ("" !== b.url ? b.url : a.options.url) + '" data-counter="' + b.counter + '"></script></div>'); 13952 var c = 0; 13953 "undefined" == typeof window.IN && 0 == c ? (c = 1, function() { 13954 var a = document.createElement("script"); 13955 a.type = "text/javascript", a.async = !0, a.src = "https://platform.linkedin.com/in.js"; 13956 var b = document.getElementsByTagName("script")[0]; 13957 b.parentNode.insertBefore(a, b) 13958 }()) : "undefined" != typeof window.IN && window.IN.parse && IN.parse(document) 13959 }, 13960 tracking: function() {}, 13961 popup: function(a) { 13962 window.open("https://www.linkedin.com/cws/share?url=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url) + "&token=&isFramed=true", "linkedin", "toolbar=no, width=" + this.settings.popup.width + ", height=" + this.settings.popup.height) 13963 } 13964 } 13965 }), SharrrePlatform.register("pinterest", function(a) { 13966 return defaultSettings = { 13967 url: "", 13968 media: "", 13969 description: "", 13970 layout: "horizontal", 13971 popup: { 13972 width: 700, 13973 height: 300 13974 } 13975 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 13976 settings: defaultSettings, 13977 url: function(a) { 13978 return "https://api.pinterest.com/v1/urls/count.json?url={url}&callback=?" 13979 }, 13980 trackingAction: { 13981 site: "pinterest", 13982 action: "pin" 13983 }, 13984 load: function(a) { 13985 var b = this.settings; 13986 $(a.element).find(".buttons").append('<div class="button pinterest"><a href="https://www.pinterest.com/pin/create/button/?url=' + ("" !== b.url ? b.url : a.options.url) + "&media=" + b.media + "&description=" + b.description + '" data-pin-do="buttonBookmark" count-layout="' + b.layout + '">Pin It</a></div>'), 13987 function() { 13988 var a = document.createElement("script"); 13989 a.type = "text/javascript", a.async = !0, a.src = "https://assets.pinterest.com/js/pinit.js", a.setAttribute("data-pin-build", "parsePinBtns"); 13990 var b = document.getElementsByTagName("script")[0]; 13991 b.parentNode.insertBefore(a, b) 13992 }(), window.parsePinBtns && window.parsePinBtns(), $(a.element).find(".pinterest").on("click", function() { 13993 a.openPopup("pinterest") 13994 }) 13995 }, 13996 tracking: function() {}, 13997 popup: function(a) { 13998 window.open("https://pinterest.com/pin/create/button/?url=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url) + "&media=" + encodeURIComponent(this.settings.media) + "&description=" + this.settings.description, "pinterest", "toolbar=no,width=" + this.settings.popup.width + ", height=" + this.settings.popup.height) 13999 } 14000 } 14001 }), SharrrePlatform.register("reddit", function(a) { 14002 return defaultSettings = { 14003 url: "", 14004 urlCount: !1, 14005 count: !1, 14006 popup: { 14007 width: 900, 14008 height: 550 14009 } 14010 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 14011 settings: defaultSettings, 14012 trackingAction: { 14013 site: "reddit", 14014 action: "share" 14015 }, 14016 url: function(a) { 14017 return "" 14018 }, 14019 load: function(a) { 14020 var b = this.settings, 14021 c = this; 14022 $(a.element).find(".buttons").append('<div class="button reddit"><a href="https://www.reddit.com/submit?url=' + ("" !== b.url ? b.url : a.options.url) + '"><img src="https://www.redditstatic.com/spreddit7.gif" alt="submit to reddit" border="0" /></a></div>'), $(a.element).find(".reddit").on("click", function() { 14023 c.popup(a.options) 14024 }) 14025 }, 14026 tracking: function() {}, 14027 popup: function(a) { 14028 window.open("https://www.reddit.com/submit?url=" + encodeURIComponent("" !== this.settings.url ? this.setting.url : a.url), "", "toolbar=0, status=0,width="
14028+ this.settings.popup.width + ", height=" + this.settings.popup.height) 14029 } 14030 } 14031 }), SharrrePlatform.register("stumbleupon", function(a) { 14032 return defaultSettings = { 14033 url: "", 14034 urlCount: !1, 14035 size: "medium", 14036 count: !0, 14037 popup: { 14038 width: 550, 14039 height: 550 14040 } 14041 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 14042 settings: defaultSettings, 14043 url: function(a) { 14044 return a + "?url={url}&type=stumbleupon" 14045 }, 14046 trackingAction: { 14047 site: "stumbleupon", 14048 action: "add" 14049 }, 14050 load: function(a) { 14051 var b = this.settings; 14052 $(a.element).find(".buttons").append('<div class="button stumbleupon"><su:badge layout="' + b.layout + '" location="' + ("" !== b.url ? b.url : a.options.url) + '"></su:badge></div>'); 14053 var c = 0; 14054 "undefined" == typeof STMBLPN && 0 == c ? (c = 1, function() { 14055 var a = document.createElement("script"); 14056 a.type = "text/javascript", a.async = !0, a.src = "https://platform.stumbleupon.com/1/widgets.js"; 14057 var b = document.getElementsByTagName("script")[0]; 14058 b.parentNode.insertBefore(a, b) 14059 }(), s = window.setTimeout(function() { 14060 "undefined" != typeof STMBLPN && (STMBLPN.processWidgets(), clearInterval(s)) 14061 }, 500)) : (STMBLPN.wasProcessLoaded = !1, STMBLPN.processWidgets()) 14062 }, 14063 tracking: function() {}, 14064 popup: function(a) { 14065 window.open("https://www.stumbleupon.com/badge/?url=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url), "stumbleupon", "toolbar=no, width=" + this.settings.popup.width + ", height=" + this.settings.popup.height) 14066 } 14067 } 14068 }), SharrrePlatform.register("tumblr", function(a) { 14069 return defaultSettings = { 14070 url: "", 14071 urlCount: !1, 14072 description: "", 14073 name: "", 14074 count: !1, 14075 title: "Share on Tumblr", 14076 color: "blue", 14077 notes: "none", 14078 popup: { 14079 width: 900, 14080 height: 500 14081 } 14082 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 14083 settings: defaultSettings, 14084 url: function(a) { 14085 return "" 14086 }, 14087 trackingAction: { 14088 site: "tumblr", 14089 action: "share" 14090 }, 14091 load: function(a) { 14092 var b = this.settings; 14093 $(a.element).find(".buttons").append('<div title="' + b.title + '" class="button tumblr"><a class="tumblr-share-button" data-color="' + b.color + '" data-notes="' + b.notes + '" data-href="' + ("" !== b.url ? b.url : a.options.url) + '" href="https://www.tumblr.com/share">' + b.title + "</a></div>"); 14094 var c = 0; 14095 "undefined" == typeof Tumblr && 0 == c ? (c = 1, function() { 14096 var a = document.createElement("script"), 14097 b = document.getElementsByTagName("script")[0]; 14098 a.src = "https://secure.assets.tumblr.com/share-button.js", b.parentNode.insertBefore(a, b) 14099 }()) : Tumblr.activate_share_on_tumblr_buttons() 14100 }, 14101 tracking: function() {}, 14102 popup: function(a) { 14103 window.open("https://www.tumblr.com/share/link?canonicalUrl=" + encodeURIComponent("" !== this.settings.url ? this.settings.url : a.url) + "&name=" + encodeURIComponent(this.settings.name) + "&description=" + encodeURIComponent(this.settings.description), "", "toolbar=0, status=0, width="
14103+ this.settings.popup.width + ", height=" + this.settings.popup.height) 14104 } 14105 } 14106 }), SharrrePlatform.register("twitter", function(a) { 14107 return defaultSettings = { 14108 url: "", 14109 urlCount: !1, 14110 count: !1, 14111 hashtags: "", 14112 via: "", 14113 related: "", 14114 lang: "en", 14115 popup: { 14116 width: 650, 14117 height: 360 14118 } 14119 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 14120 settings: defaultSettings, 14121 trackingAction: { 14122 site: "twitter", 14123 action: "tweet" 14124 }, 14125 url: function(a) { 14126 return "https://opensharecount.com/count.json?url={url}" 14127 }, 14128 load: function(a) { 14129 var b = this.settings; 14130 $(a.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="' + ("" !== b.url ? b.url : a.options.url) + '" data-count="' + b.count + '" data-text="' + a.options.text + '" data-via="' + b.via + '" data-hashtags="' + b.hashtags + '" data-related="' + b.related + '" data-lang="' + b.lang + '">Tweet</a></div>'); 14131 var c = 0; 14132 "undefined" == typeof twttr && 0 == c ? (c = 1, function() { 14133 var a = document.createElement("script"); 14134 a.type = "text/javascript", a.async = !0, a.src = "https://platform.twitter.com/widgets.js"; 14135 var b = document.getElementsByTagName("script")[0]; 14136 b.parentNode.insertBefore(a, b) 14137 }()) : $.ajax({ 14138 url: "https://platform.twitter.com/widgets.js", 14139 dataType: "script", 14140 cache: !0 14141 }) 14142 }, 14143 tracking: function() { 14144 tw = window.setInterval(function() { 14145 "undefined" != typeof twttr && (twttr.events.bind("tweet", function(a) { 14146 a && _gaq.push(["_trackSocial", "twitter", "tweet"]) 14147 }), clearInterval(tw)) 14148 }, 1e3) 14149 }, 14150 popup: function(a) { 14151 window.open("https://twitter.com/intent/tweet?text=" + encodeURIComponent(a.text) + "&url=" + encodeURIComponent("" !== this.settings.url ? this.setting.url : a.url) + ("" !== this.settings.via ? "&via=" + this.settings.via : ""), "", "toolbar=0, status=0,width=" + this.settings.popup.width + ", height=" + this.settings.popup.height) 14152 } 14153 } 14154 }), SharrrePlatform.register("twitterFollow", function(a) { 14155 return defaultSettings = { 14156 url: "", 14157 urlCount: !1, 14158 count: !0, 14159 display: "horizontal", 14160 lang: "en", 14161 popup: { 14162 width: 650, 14163 height: 360 14164 }, 14165 user: "", 14166 size: "default", 14167 showCount: "false" 14168 }, defaultSettings = $.extend(!0, {}, defaultSettings, a), { 14169 settings: defaultSettings, 14170 trackingAction: { 14171 site: "twitter", 14172 action: "follow" 14173 }, 14174 url: function(a) { 14175 return "" 14176 }, 14177 load: function(a) { 14178 var b = this.settings; 14179 $(a.element).find(".buttons").append('<div class="button twitterFollow"><a href="https://twitter.com/' + b.user + '" class="twitter-follow-button"" data-size="' + b.size + '" data-show-count="' + b.showCount + '" data-lang="' + b.lang + '">Follow @' + b.user + "</a></div>"); 14180 var c = 0; 14181 "undefined" == typeof twttr && 0 == c ? (c = 1, function() { 14182 var a = document.createElement("script"); 14183 a.type = "text/javascript", a.async = !0, a.src = "https://platform.twitter.com/widgets.js"; 14184 var b = document.getElementsByTagName("script")[0]; 14185 b.parentNode.insertBefore(a, b) 14186 }()) : $.ajax({ 14187 url: "https://platform.twitter.com/widgets.js", 14188 dataType: "script", 14189 cache: !0 14190 }) 14191 }, 14192 tracking: function() {}, 14193 popup: function(a) { 14194 window.open("https://twitter.com/intent/follow?screen_name=" + encodeURIComponent(this.settings.user), "", "toolbar=0, status=0, ,width="
14194+ this.settings.popup.width + ", height=" + this.settings.popup.height) 14195 } 14196 } 14197 }), 14198 /*! 14199 * Sharrre.com - Make your sharing widget! 14200 * Version: 2.0.1 14201 * Author: Julien Hany 14202 * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License 14203 */ 14204 function(a, b, c, d) { 14205 function f(b, c) { 14206 this.element = b, this.options = a.extend(!0, {}, h, c), this.options.share = c.share, this._defaults = h, this._name = g, this.platforms = {}, this.init() 14207 } 14208 var g = "sharrre", 14209 h = { 14210 className: "sharrre", 14211 share: {}, 14212 shareTotal: 0, 14213 template: "", 14214 title: "", 14215 url: c.location.href, 14216 text: c.title, 14217 urlCurl: "sharrre.php", 14218 count: {}, 14219 total: 0, 14220 shorterTotal: !0, 14221 enableHover: !0, 14222 enableCounter: !0, 14223 enableTracking: !1, 14224 defaultUrl: "javascript:void(0);", 14225 popup: { 14226 width: 900, 14227 height: 500 14228 }, 14229 hover: function() {}, 14230 hide: function() {}, 14231 click: function() {}, 14232 render: function() {} 14233 }; 14234 f.prototype.init = function() { 14235 var b = this; 14236 a.each(b.options.share, function(a, c) { 14237 c === !0 && (b.platforms[a] = SharrrePlatform.get(a, b.options.buttons[a])) 14238 }), a(this.element).addClass(this.options.className), "undefined" != typeof a(this.element).data("title") && (this.options.title = a(this.element).attr("data-title")), "undefined" != typeof a(this.element).data("url") && (this.options.url = a(this.element).data("url")), "undefined" != typeof a(this.element).data("text") && (this.options.text = a(this.element).data("text")), a.each(this.options.share, function(a, c) { 14239 c === !0 && b.options.shareTotal++ 14240 }), b.options.enableCounter === !0 ? a.each(this.options.share, function(a, c) { 14241 if (c === !0) try { 14242 b.getSocialJson(a) 14243 } catch (d) {} 14244 }) : "" !== b.options.template && (b.renderer(), b.options.count[name] = 0, b.rendererPerso()), "" !== b.options.template ? this.options.render(this, this.options) : this.loadButtons(), a(this.element).on("mouseenter", function() { 14245 0 === a(this).find(".buttons").length && b.options.enableHover === !0 && b.loadButtons(), b.options.hover(b, b.options) 14246 }).on("mouseleave", function() { 14247 b.options.hide(b, b.options) 14248 }), a(this.element).click(function(a) { 14249 return a.preventDefault(), b.options.click(b, b.options), !1 14250 }) 14251 }, f.prototype.loadButtons = function() { 14252 var b = this; 14253 a(this.element).append('<div class="buttons"></div>'), a.each(b.options.share, function(a, c) { 14254 1 == c && (b.platforms[a].load(b), b.options.enableTracking === !0 && b.platforms[a].tracking()) 14255 }) 14256 }, f.prototype.getSocialJson = function(b) { 14257 var c = this, 14258 d = 0, 14259 e = c.platforms[b].settings, 14260 f = c.platforms[b].url(this.options.urlCurl), 14261 g = encodeURIComponent(this.options.url); 14262 e.url.length && (f = e.url), e.urlCount === !0 && "" !== f && (g = f), e.count === !1 && (f = ""), url = f.replace("{url}", g), "" != url ? a.getJSON(url, function(a) { 14263 if ("undefined" != typeof a.count) { 14264 var e = a.count + ""; 14265 e = e.replace("Ã ", ""), d += parseInt(e, 10) 14266 } else a.data && a.data.length > 0 && "undefined" != typeof a.data[0].total_count ? d += parseInt(a.data[0].total_count, 10) : "undefined" != typeof a[0] ? d += parseInt(a[0].total_posts, 10) : "undefined" != typeof a[0]; 14267 c.options.count[b] = d, c.options.total += d, c.renderer(), c.rendererPerso() 14268 }).error(function() { 14269 c.options.count[b] = 0, c.rendererPerso() 14270 }) : (c.renderer(), c.options.count[b] = 0, c.rendererPerso()) 14271 }, f.prototype.rendererPerso = function() { 14272 var a = 0; 14273 for (e in this.options.count) a++; 14274 a === this.options.shareTotal && this.options.render(this, this.options) 14275 }, f.prototype.renderer = function() { 14276 var b = this.options.total, 14277 c = this.options.template; 14278 this.options.shorterTotal === !0 && (b = this.shorterTotal(b)), "" !== c ? (c = c.replace("{total}", b), a(this.element).html(c)) : a(this.element).html('<div class="box"><a class="count" href="' + this.options.defaultUrl + '">' + b + "</a>" + ("" !== this.options.title ? '<a class="share" href="' + this.options.defaultUrl + '">' + this.options.title + "</a>" : "") + "</div>") 14279 }, f.prototype.shorterTotal = function(a) { 14280 return a >= 1e6 ? a = (a / 1e6).toFixed(2) + "M" : a >= 1e3 && (a = (a / 1e3).toFixed(1) + "k"), a 14281 }, f.prototype.openPopup = function(a) { 14282 this.platforms[a].popup(this.options), this.options.enableTracking === !0 && (infos = this.platforms[a].trackingAction, _gaq.pu
14282sh(["_trackSocial", infos.site, infos.action])) 14283 }, f.prototype.simulateClick = function() { 14284 var b = a(this.element).html(); 14285 a(this.element).html(b.replace(this.options.total, this.options.total + 1)) 14286 }, f.prototype.update = function(a, b) { 14287 "" !== a && (this.options.url = a), "" !== b && (this.options.text = b) 14288 }, a.fn[g] = function(b) { 14289 var c = arguments; 14290 return b === d || "object" == typeof b ? this.each(function() { 14291 a(this).data("plugin_" + g) || a(this).data("plugin_" + g, new f(this, b)) 14292 }) : "string" == typeof b && "_" !== b[0] && "init" !== b ? this.each(function() { 14293 var d = a(this).data("plugin_" + g); 14294 d instanceof f && "function" == typeof d[b] && d[b].apply(d, Array.prototype.slice.call(c, 1)) 14295 }) : void 0 14296 } 14297 }(window.jQuery || window.Zepto, window, document); 14298;// /var/www/www.vfb.de/httpdocs/current/static/js/velocity.js 14299/*! VelocityJS.org (1.3.1). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ 14300 14301/************************* 14302 Velocity jQuery Shim 14303 *************************/ 14304 14305/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ 14306 14307/* This file contains the jQuery functions that Velocity relies on, thereby removing Velocity's dependency on a full copy of jQuery, and allowing it to work in any environment. */ 14308/* These shimmed functions are only used if jQuery isn't present. If both this shim and jQuery are loaded, Velocity defaults to jQuery proper. */ 14309/* Browser support: Using this shim instead of jQuery proper removes support for IE8. */ 14310 14311(function(window) { 14312 ; 14313 /*************** 14314 Setup 14315 ***************/ 14316 14317 /* If jQuery is already loaded, there's no point in loading this shim. */ 14318 if (window.jQuery) { 14319 return; 14320 } 14321 14322 /* jQuery base. */ 14323 var $ = function(selector, context) { 14324 return new $.fn.init(selector, context); 14325 }; 14326 14327 /******************** 14328 Private Methods 14329 ********************/ 14330 14331 /* jQuery */ 14332 $.isWindow = function(obj) { 14333 /* jshint eqeqeq: false */ 14334 return obj && obj === obj.window; 14335 }; 14336 14337 /* jQuery */ 14338 $.type = function(obj) { 14339 if (!obj) { 14340 return obj + ""; 14341 } 14342 14343 return typeof obj === "object" || typeof obj === "function" ? 14344 class2type[toString.call(obj)] || "object" : 14345 typeof obj; 14346 }; 14347 14348 /* jQuery */ 14349 $.isArray = Array.isArray || function(obj) { 14350 return $.type(obj) === "array"; 14351 }; 14352 14353 /* jQuery */ 14354 function isArraylike(obj) { 14355 var length = obj.length, 14356 type = $.type(obj); 14357 14358 if (type === "function" || $.isWindow(obj)) { 14359 return false; 14360 } 14361 14362 if (obj.nodeType === 1 && length) { 14363 return true; 14364 } 14365 14366 return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj; 14367 } 14368 14369 /*************** 14370 $ Methods 14371 ***************/ 14372 14373 /* jQuery: Support removed for IE<9. */ 14374 $.isPlainObject = function(obj) { 14375 var key; 14376 14377 if (!obj || $.type(obj) !== "object" || obj.nodeType || $.isWindow(obj)) { 14378 return false; 14379 } 14380 14381 try { 14382 if (obj.constructor && 14383 !hasOwn.call(obj, "constructor") && 14384 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) { 14385 return false; 14386 } 14387 } catch (e) { 14388 return false; 14389 } 14390 14391 for (key in obj) { 14392 } 14393 14394 return key === undefined || hasOwn.call(obj, key); 14395 }; 14396 14397 /* jQuery */ 14398 $.each = function(obj, callback, args) { 14399 var value, 14400 i = 0, 14401 length = obj.length, 14402 isArray = isArraylike(obj); 14403 14404 if (args) { 14405 if (isArray) { 14406 for (; i < length; i++) { 14407 value = callback.apply(obj[i], args); 14408 14409 if (value === false) { 14410 break; 14411 } 14412 } 14413 } else { 14414 for (i in obj) { 14415 if (!obj.hasOwnProperty(i)) { 14416 continue; 14417 } 14418 value = callback.apply(obj[i], args); 14419 14420 if (value === false) { 14421 break; 14422 } 14423 } 14424 } 14425 14426 } else { 14427 if (isArray) { 14428 for (; i < length; i++) { 14429 value = callback.call(obj[i], i, obj[i]); 14430 14431 if (value === false) { 14432 break; 14433 } 14434 } 14435 } else { 14436 for (i in obj) { 14437 if (!obj.hasOwnProperty(i)) { 14438 continue; 14439 } 14440 value = callback.call(obj[i], i, obj[i]); 14441 14442 if (value === false) { 14443 break; 14444 } 14445 } 14446 } 14447 } 14448 14449 return obj; 14450 }; 14451 14452 /* Custom */ 14453 $.data = function(node, key, value) { 14454 /* $.getData() */ 14455 if (value === undefined) { 14456 var getId = node[$.expando], 14457 store = getId && cache[getId]; 14458 14459 if (key === undefined) { 14460 return store; 14461 } else if (store) { 14462 if (key in store) { 14463 return store[key]; 14464 } 14465 } 14466 /* $.setData() */ 14467 } else if (key !== undefined) { 14468 var setId = node[$.expando] || (node[$.expando] = ++$.uuid); 14469 14470 cache[setId] = cache[setId] || {}; 14471 cache[setId][key] = value; 14472 14473 return value; 14474 } 14475 }; 14476 14477 /* Custom */ 14478 $.removeData = function(node, keys) { 14479 var id = node[$.expando],
vendor: 116,810 bytes, lines 14480-17169
14480 store = id && cache[id]; 14481 14482 if (store) { 14483 // Cleanup the entire store if no keys are provided. 14484 if (!keys) { 14485 delete cache[id]; 14486 } else { 14487 $.each(keys, function(_, key) { 14488 delete store[key]; 14489 }); 14490 } 14491 } 14492 }; 14493 14494 /* jQuery */ 14495 $.extend = function() { 14496 var src, copyIsArray, copy, name, options, clone, 14497 target = arguments[0] || {}, 14498 i = 1, 14499 length = arguments.length, 14500 deep = false; 14501 14502 if (typeof target === "boolean") { 14503 deep = target; 14504 14505 target = arguments[i] || {}; 14506 i++; 14507 } 14508 14509 if (typeof target !== "object" && $.type(target) !== "function") { 14510 target = {}; 14511 } 14512 14513 if (i === length) { 14514 target = this; 14515 i--; 14516 } 14517 14518 for (; i < length; i++) { 14519 if ((options = arguments[i])) { 14520 for (name in options) { 14521 if (!options.hasOwnProperty(name)) { 14522 continue; 14523 } 14524 src = target[name]; 14525 copy = options[name]; 14526 14527 if (target === copy) { 14528 continue; 14529 } 14530 14531 if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) { 14532 if (copyIsArray) { 14533 copyIsArray = false; 14534 clone = src && $.isArray(src) ? src : []; 14535 14536 } else { 14537 clone = src && $.isPlainObject(src) ? src : {}; 14538 } 14539 14540 target[name] = $.extend(deep, clone, copy); 14541 14542 } else if (copy !== undefined) { 14543 target[name] = copy; 14544 } 14545 } 14546 } 14547 } 14548 14549 return target; 14550 }; 14551 14552 /* jQuery 1.4.3 */ 14553 $.queue = function(elem, type, data) { 14554 function $makeArray(arr, results) { 14555 var ret = results || []; 14556 14557 if (arr) { 14558 if (isArraylike(Object(arr))) { 14559 /* $.merge */ 14560 (function(first, second) { 14561 var len = +second.length, 14562 j = 0, 14563 i = first.length; 14564 14565 while (j < len) { 14566 first[i++] = second[j++]; 14567 } 14568 14569 if (len !== len) { 14570 while (second[j] !== undefined) { 14571 first[i++] = second[j++]; 14572 } 14573 } 14574 14575 first.length = i; 14576 14577 return first; 14578 })(ret, typeof arr === "string" ? [arr] : arr); 14579 } else { 14580 [].push.call(ret, arr); 14581 } 14582 } 14583 14584 return ret; 14585 } 14586 14587 if (!elem) { 14588 return; 14589 } 14590 14591 type = (type || "fx") + "queue"; 14592 14593 var q = $.data(elem, type); 14594 14595 if (!data) { 14596 return q || []; 14597 } 14598 14599 if (!q || $.isArray(data)) { 14600 q = $.data(elem, type, $makeArray(data)); 14601 } else { 14602 q.push(data); 14603 } 14604 14605 return q; 14606 }; 14607 14608 /* jQuery 1.4.3 */ 14609 $.dequeue = function(elems, type) { 14610 /* Custom: Embed element iteration. */ 14611 $.each(elems.nodeType ? [elems] : elems, function(i, elem) { 14612 type = type || "fx"; 14613 14614 var queue = $.queue(elem, type), 14615 fn = queue.shift(); 14616 14617 if (fn === "inprogress") { 14618 fn = queue.shift(); 14619 } 14620 14621 if (fn) { 14622 if (type === "fx") { 14623 queue.unshift("inprogress"); 14624 } 14625 14626 fn.call(elem, function() { 14627 $.dequeue(elem, type); 14628 }); 14629 } 14630 }); 14631 }; 14632 14633 /****************** 14634 $.fn Methods 14635 ******************/ 14636 14637 /* jQuery */ 14638 $.fn = $.prototype = { 14639 init: function(selector) { 14640 /* Just return the element wrapped inside an array; don't proceed with the actual jQuery node wrapping process. */ 14641 if (selector.nodeType) { 14642 this[0] = selector; 14643 14644 return this; 14645 } else { 14646 throw new Error("Not a DOM node."); 14647 } 14648 }, 14649 offset: function() { 14650 /* jQuery altered code: Dropped disconnected DOM node checking. */ 14651 var box = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : {top: 0, left: 0}; 14652 14653 return { 14654 top: box.top + (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0), 14655 left: box.left + (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0) 14656 }; 14657 }, 14658 position: function() { 14659 /* jQuery */ 14660 function offsetParentFn(elem) { 14661 var offsetParent = elem.offsetParent || document; 14662 14663 while (offsetParent && (offsetParent.nodeType.toLowerCase !== "html" && offsetParent.style.position === "static")) { 14664 offsetParent = offsetParent.offsetParent; 14665 } 14666 14667 return offsetParent || document; 14668 } 14669 14670 /* Zepto */ 14671 var elem = this[0], 14672 offsetParent = offsetParentFn(elem), 14673 offset = this.offset(), 14674 parentOffset = /^(?:body|html)$/i.test(offsetParent.nodeName) ? {top: 0, left: 0} : $(offsetParent).offset(); 14675 14676 offset.top -= parseFloat(elem.style.marginTop) || 0; 14677 offset.left -= parseFloat(elem.style.marginLeft) || 0; 14678 14679 if (offsetParent.style) { 14680 parentOffset.top += parseFloat(offsetParent.style.borderTopWidth) || 0; 14681 parentOffset.left += parseFloat(offsetParent.style.borderLeftWidth) || 0; 14682 } 14683 14684 return { 14685 top: offset.top - parentOffset.top, 14686 left: offset.left - parentOffset.left 14687 }; 14688 } 14689 }; 14690 14691 /********************** 14692 Private Variables 14693 **********************/ 14694 14695 /* For $.data() */ 14696 var cache = {}; 14697 $.expando = "velocity" + (new Date().getTime()); 14698 $.uuid = 0; 14699 14700 /* For $.queue() */ 14701 var class2type = {}, 14702 hasOwn = class2type.hasOwnProperty, 14703 toString = class2type.toString; 14704 14705 var types = "Boolean Number String Function Array Date RegExp Object Error".split(" "); 14706 for (var i = 0; i < types.length; i++) { 14707 class2type["[object " + types[i] + "]"] = types[i].toLowerCase(); 14708 } 14709 14710 /* Makes $(node) possible, without having to call init. */ 14711 $.fn.init.prototype = $.fn; 14712 14713 /* Globalize Velocity onto the window, and assign its Utilities property. */ 14714 window.Velocity = {Utilities: $}; 14715})(window); 14716 14717/****************** 14718 Velocity.js 14719 ******************/ 14720 14721(function(factory) { 14722 ; 14723 /* CommonJS module. */ 14724 if (typeof module === "object" && typeof module.exports === "object") { 14725 module.exports = factory(); 14726 /* AMD module. */ 14727 } else if (typeof define === "function" && define.amd) { 14728 define(factory); 14729 /* Browser globals. */ 14730 } else { 14731 factory(); 14732 } 14733}(function() { 14734 ; 14735 return function(global, window, document, undefined) { 14736 14737 /*************** 14738 Summary 14739 ***************/ 14740 14741 /* 14742 - CSS: CSS stack that works independently from the rest of Velocity. 14743 - animate(): Core animation method that iterates over the targeted elements and queues the incoming call onto each element individually. 14744 - Pre-Queueing: Prepare the element for animation by instantiating its data cache and processing the call's options. 14745 - Queueing: The logic that runs once the call has reached its point of execution in the element's $.queue() stack. 14746 Most logic is placed here to avoid risking it becoming stale (if the element's properties have changed). 14747 - Pushing: Consolidation of the tween data followed by its push onto the global in-progress calls container. 14748 - tick(): The single requestAnimationFrame loop responsible for tweening all in-progress calls. 14749 - completeCall(): Handles the cleanup process for each Velocity call. 14750 */ 14751 14752 /********************* 14753 Helper Functions 14754 *********************/ 14755 14756 /* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */ 14757 var IE = (function() { 14758 if (document.documentMode) { 14759 return document.documentMode; 14760 } else { 14761 for (var i = 7; i > 4; i--) { 14762 var div = document.createElement("div"); 14763 14764 div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->"; 14765 14766 if (div.getElementsByTagName("span").length) { 14767 div = null; 14768 14769 return i; 14770 } 14771 } 14772 } 14773 14774 return undefined; 14775 })(); 14776 14777 /* rAF shim. Gist: https://gist.github.com/julianshapiro/9497513 */ 14778 var rAFShim = (function() { 14779 var timeLast = 0; 14780 14781 return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { 14782 var timeCurrent = (new Date()).getTime(), 14783 timeDelta; 14784 14785 /* Dynamically set delay on a per-tick basis to match 60fps. */ 14786 /* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671 */ 14787 timeDelta = Math.max(0, 16 - (timeCurrent - timeLast)); 14788 timeLast = timeCurrent + timeDelta; 14789 14790 return setTimeout(function() { 14791 callback(timeCurrent + timeDelta); 14792 }, timeDelta); 14793 }; 14794 })(); 14795 14796 /* Array compacting. Copyright Lo-Dash. MIT License: https://github.com/lodash/lodash/blob/master/LICENSE.txt */ 14797 function compactSparseArray(array) { 14798 var index = -1, 14799 length = array ? array.length : 0, 14800 result = []; 14801 14802 while (++index < length) { 14803 var value = array[index]; 14804 14805 if (value) { 14806 result.push(value); 14807 } 14808 } 14809 14810 return result; 14811 } 14812 14813 function sanitizeElements(elements) { 14814 /* Unwrap jQuery/Zepto objects. */ 14815 if (Type.isWrapped(elements)) { 14816 elements = [].slice.call(elements); 14817 /* Wrap a single element in an array so that $.each() can iterate with the element instead of its node's children. */ 14818 } else if (Type.isNode(elements)) { 14819 elements = [elements]; 14820 } 14821 14822 return elements; 14823 } 14824 14825 var Type = { 14826 isString: function(variable) { 14827 return (typeof variable === "string"); 14828 }, 14829 isArray: Array.isArray || function(variable) { 14830 return Object.prototype.toString.call(variable) === "[object Array]"; 14831 }, 14832 isFunction: function(variable) { 14833 return Object.prototype.toString.call(variable) === "[object Function]"; 14834 }, 14835 isNode: function(variable) { 14836 return variable && variable.nodeType; 14837 }, 14838 /* Copyright Martin Bohm. MIT License: https://gist.github.com/Tomalak/818a78a226a0738eaade */ 14839 isNodeList: function(variable) { 14840 return typeof variable === "object" && 14841 /^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(variable)) && 14842 variable.length !== undefined && 14843 (variable.length === 0 || (typeof variable[0] === "object" && variable[0].nodeType > 0)); 14844 }, 14845 /* Determine if variable is a wrapped jQuery or Zepto element. */ 14846 isWrapped: function(variable) { 14847 return variable && (variable.jquery || (window.Zepto && window.Zepto.zepto.isZ(variable))); 14848 }, 14849 isSVG: function(variable) { 14850 return window.SVGElement && (variable instanceof window.SVGElement); 14851 }, 14852 isEmptyObject: function(variable) { 14853 for (var name in variable) { 14854 if (variable.hasOwnProperty(name)) { 14855 return false; 14856 } 14857 } 14858 14859 return true; 14860 } 14861 }; 14862 14863 /***************** 14864 Dependencies 14865 *****************/ 14866 14867 var $, 14868 isJQuery = false; 14869 14870 if (global.fn && global.fn.jquery) { 14871 $ = global; 14872 isJQuery = true; 14873 } else { 14874 $ = window.Velocity.Utilities; 14875 } 14876 14877 if (IE <= 8 && !isJQuery) { 14878 throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity."); 14879 } else if (IE <= 7) { 14880 /* Revert to jQuery's $.animate(), and lose Velocity's extra features. */ 14881 jQuery.fn.velocity = jQuery.fn.animate; 14882 14883 /* Now that $.fn.velocity is aliased, abort this Velocity declaration. */ 14884 return; 14885 } 14886 14887 /***************** 14888 Constants 14889 *****************/ 14890 14891 var DURATION_DEFAULT = 400, 14892 EASING_DEFAULT = "swing"; 14893 14894 /************* 14895 State 14896 *************/ 14897 14898 var Velocity = { 14899 /* Container for page-wide Velocity state data. */ 14900 State: { 14901 /* Detect mobile devices to determine if mobileHA should be turned on. */ 14902 isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 14903 /* The mobileHA option's behavior changes on older Android devices (Gingerbread, versions 2.3.3-2.3.7). */ 14904 isAndroid: /Android/i.test(navigator.userAgent), 14905 isGingerbread: /Android 2\.3\.[3-7]/i.test(navigator.userAgent), 14906 isChrome: window.chrome, 14907 isFirefox: /Firefox/i.test(navigator.userAgent), 14908 /* Create a cached element for re-use when checking for CSS property prefixes. */ 14909 prefixElement: document.createElement("div"), 14910 /* Cache every prefix match to avoid repeating lookups. */ 14911 prefixMatches: {}, 14912 /* Cache the anchor used for animating window scrolling. */ 14913 scrollAnchor: null, 14914 /* Cache the browser-specific property names associated with the scroll anchor. */ 14915 scrollPropertyLeft: null, 14916 scrollPropertyTop: null, 14917 /* Keep track of whether our RAF tick is running. */ 14918 isTicking: false, 14919 /* Container for every in-progress call to Velocity. */ 14920 calls: [] 14921 }, 14922 /* Velocity's custom CSS stack. Made global for unit testing. */ 14923 CSS: { /* Defined below. */}, 14924 /* A shim of the jQuery utility functions used by Velocity -- provided by Velocity's optional jQuery shim. */ 14925 Utilities: $, 14926 /* Container for the user's custom animation redirects that are referenced by name in place of the properties map argument. */ 14927 Redirects: { /* Manually registered by the user. */}, 14928 Easings: { /* Defined below. */}, 14929 /* Attempt to use ES6 Promises by default. Users can override this with a third-party promises library. */ 14930 Promise: window.Promise, 14931 /* Velocity option defaults, which can be overriden by the user. */ 14932 defaults: { 14933 queue: "", 14934 duration: DURATION_DEFAULT, 14935 easing: EASING_DEFAULT, 14936 begin: undefined, 14937 complete: undefined, 14938 progress: undefined, 14939 display: undefined, 14940 visibility: undefined, 14941 loop: false, 14942 delay: false, 14943 mobileHA: true, 14944 /* Advanced: Set to false to prevent property values from being cached between consecutive Velocity-initiated chain calls. */ 14945 _cacheValues: true, 14946 /* Advanced: Set to false if the promise should always resolve on empty element lists. */ 14947 promiseRejectEmpty: true 14948 }, 14949 /* A design goal of Velocity is to cache data wherever possible in order to avoid DOM requerying. Accordingly, each element has a data cache. */ 14950 init: function(element) { 14951 $.data(element, "velocity", { 14952 /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */ 14953 isSVG: Type.isSVG(element), 14954 /* Keep track of whether the element is currently being animated by Velocity. 14955 This is used to ensure that property values are not transferred between non-consecutive (stale) calls. */ 14956 isAnimating: false, 14957 /* A reference to the element's live computedStyle object. Learn more here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */ 14958 computedStyle: null, 14959 /* Tween data is cached for each animation on the element so that data can be passed across calls -- 14960 in particular, end values are used as subsequent start values in consecutive Velocity calls. */ 14961 tweensContainer: null, 14962 /* The full root property values of each CSS hook being animated on this element are cached so that: 14963 1) Concurrently-animating hooks sharing the same root can have their root values' merged into one while tweening. 14964 2) Post-hook-injection root values can be transferred over to consecutively chained Velocity calls as starting root values. */ 14965 rootPropertyValueCache: {}, 14966 /* A cache for transform updates, which must be manually flushed via CSS.flushTransformCache(). */ 14967 transformCache: {} 14968 }); 14969 }, 14970 /* A parallel to jQuery's $.css(), used for getting/setting Velocity's hooked CSS properties. */ 14971 hook: null, /* Defined below. */ 14972 /* Velocity-wide animation time remapping for testing purposes. */ 14973 mock: false, 14974 version: {major: 1, minor: 3, patch: 1}, 14975 /* Set to 1 or 2 (most verbose) to output debug info to console. */ 14976 debug: false, 14977 /* Use rAF high resolution timestamp when available */ 14978 timestamp: true 14979 }; 14980 14981 /* Retrieve the appropriate scroll anchor and property name for the browser: https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY */ 14982 if (window.pageYOffset !== undefined) { 14983 Velocity.State.scrollAnchor = window; 14984 Velocity.State.scrollPropertyLeft = "pageXOffset"; 14985 Velocity.State.scrollPropertyTop = "pageYOffset"; 14986 } else { 14987 Velocity.State.scrollAnchor = document.documentElement || document.body.parentNode || document.body; 14988 Velocity.State.scrollPropertyLeft = "scrollLeft"; 14989 Velocity.State.scrollPropertyTop = "scrollTop"; 14990 } 14991 14992 /* Shorthand alias for jQuery's $.data() utility. */ 14993 function Data(element) { 14994 /* Hardcode a reference to the plugin name. */ 14995 var response = $.data(element, "velocity"); 14996 14997 /* jQuery <=1.4.2 returns null instead of undefined when no match is found. We normalize this behavior. */ 14998 return response === null ? undefined : response; 14999 } 15000 15001 /************** 15002 Easing 15003 **************/ 15004 15005 /* Step easing generator. */ 15006 function generateStep(steps) { 15007 return function(p) { 15008 return Math.round(p * steps) * (1 / steps); 15009 }; 15010 } 15011 15012 /* Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 15013 function generateBezier(mX1, mY1, mX2, mY2) { 15014 var NEWTON_ITERATIONS = 4, 15015 NEWTON_MIN_SLOPE = 0.001, 15016 SUBDIVISION_PRECISION = 0.0000001, 15017 SUBDIVISION_MAX_ITERATIONS = 10, 15018 kSplineTableSize = 11, 15019 kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), 15020 float32ArraySupported = "Float32Array" in window; 15021 15022 /* Must contain four arguments. */ 15023 if (arguments.length !== 4) { 15024 return false; 15025 } 15026 15027 /* Arguments must be numbers. */ 15028 for (var i = 0; i < 4; ++i) { 15029 if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { 15030 return false; 15031 } 15032 } 15033 15034 /* X values must be in the [0, 1] range. */ 15035 mX1 = Math.min(mX1, 1); 15036 mX2 = Math.min(mX2, 1); 15037 mX1 = Math.max(mX1, 0); 15038 mX2 = Math.max(mX2, 0); 15039 15040 var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); 15041 15042 function A(aA1, aA2) { 15043 return 1.0 - 3.0 * aA2 + 3.0 * aA1; 15044 } 15045 function B(aA1, aA2) { 15046 return 3.0 * aA2 - 6.0 * aA1; 15047 } 15048 function C(aA1) { 15049 return 3.0 * aA1; 15050 } 15051 15052 function calcBezier(aT, aA1, aA2) { 15053 return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; 15054 } 15055 15056 function getSlope(aT, aA1, aA2) { 15057 return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); 15058 } 15059 15060 function newtonRaphsonIterate(aX, aGuessT) { 15061 for (var i = 0; i < NEWTON_ITERATIONS; ++i) { 15062 var currentSlope = getSlope(aGuessT, mX1, mX2); 15063 15064 if (currentSlope === 0.0) { 15065 return aGuessT; 15066 } 15067 15068 var currentX = calcBezier(aGuessT, mX1, mX2) - aX; 15069 aGuessT -= currentX / currentSlope; 15070 } 15071 15072 return aGuessT; 15073 } 15074 15075 function calcSampleValues() { 15076 for (var i = 0; i < kSplineTableSize; ++i) { 15077 mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); 15078 } 15079 } 15080 15081 function binarySubdivide(aX, aA, aB) { 15082 var currentX, currentT, i = 0; 15083 15084 do { 15085 currentT = aA + (aB - aA) / 2.0; 15086 currentX = calcBezier(currentT, mX1, mX2) - aX; 15087 if (currentX > 0.0) { 15088 aB = currentT; 15089 } else { 15090 aA = currentT; 15091 } 15092 } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); 15093 15094 return currentT; 15095 } 15096 15097 function getTForX(aX) { 15098 var intervalStart = 0.0, 15099 currentSample = 1, 15100 lastSample = kSplineTableSize - 1; 15101 15102 for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { 15103 intervalStart += kSampleStepSize; 15104 } 15105 15106 --currentSample; 15107 15108 var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), 15109 guessForT = intervalStart + dist * kSampleStepSize, 15110 initialSlope = getSlope(guessForT, mX1, mX2); 15111 15112 if (initialSlope >= NEWTON_MIN_SLOPE) { 15113 return newtonRaphsonIterate(aX, guessForT); 15114 } else if (initialSlope === 0.0) { 15115 return guessForT; 15116 } else { 15117 return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); 15118 } 15119 } 15120 15121 var _precomputed = false; 15122 15123 function precompute() { 15124 _precomputed = true; 15125 if (mX1 !== mY1 || mX2 !== mY2) { 15126 calcSampleValues(); 15127 } 15128 } 15129 15130 var f = function(aX) { 15131 if (!_precomputed) { 15132 precompute(); 15133 } 15134 if (mX1 === mY1 && mX2 === mY2) { 15135 return aX; 15136 } 15137 if (aX === 0) { 15138 return 0; 15139 } 15140 if (aX === 1) { 15141 return 1; 15142 } 15143 15144 return calcBezier(getTForX(aX), mY1, mY2); 15145 }; 15146 15147 f.getControlPoints = function() { 15148 return [{x: mX1, y: mY1}, {x: mX2, y: mY2}]; 15149 }; 15150 15151 var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; 15152 f.toString = function() { 15153 return str; 15154 }; 15155 15156 return f; 15157 } 15158 15159 /* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 15160 /* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass 15161 then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ 15162 var generateSpringRK4 = (function() { 15163 function springAccelerationForState(state) { 15164 return (-state.tension * state.x) - (state.friction * state.v); 15165 } 15166 15167 function springEvaluateStateWithDerivative(initialState, dt, derivative) { 15168 var state = { 15169 x: initialState.x + derivative.dx * dt, 15170 v: initialState.v + derivative.dv * dt, 15171 tension: initialState.tension, 15172 friction: initialState.friction 15173 }; 15174 15175 return {dx: state.v, dv: springAccelerationForState(state)}; 15176 } 15177 15178 function springIntegrateState(state, dt) { 15179 var a = { 15180 dx: state.v, 15181 dv: springAccelerationForState(state) 15182 }, 15183 b = springEvaluateStateWithDerivative(state, dt * 0.5, a), 15184 c = springEvaluateStateWithDerivative(state, dt * 0.5, b), 15185 d = springEvaluateStateWithDerivative(state, dt, c), 15186 dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), 15187 dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); 15188 15189 state.x = state.x + dxdt * dt; 15190 state.v = state.v + dvdt * dt; 15191 15192 return state; 15193 } 15194 15195 return function springRK4Factory(tension, friction, duration) { 15196 15197 var initState = { 15198 x: -1, 15199 v: 0, 15200 tension: null, 15201 friction: null 15202 }, 15203 path = [0], 15204 time_lapsed = 0, 15205 tolerance = 1 / 10000, 15206 DT = 16 / 1000, 15207 have_duration, dt, last_state; 15208 15209 tension = parseFloat(tension) || 500; 15210 friction = parseFloat(friction) || 20; 15211 duration = duration || null; 15212 15213 initState.tension = tension; 15214 initState.friction = friction; 15215 15216 have_duration = duration !== null; 15217 15218 /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ 15219 if (have_duration) { 15220 /* Run the simulation without a duration. */ 15221 time_lapsed = springRK4Factory(tension, friction); 15222 /* Compute the adjusted time delta. */ 15223 dt = time_lapsed / duration * DT; 15224 } else { 15225 dt = DT; 15226 } 15227 15228 while (true) { 15229 /* Next/step function .*/ 15230 last_state = springIntegrateState(last_state || initState, dt); 15231 /* Store the position. */ 15232 path.push(1 + last_state.x); 15233 time_lapsed += 16; 15234 /* If the change threshold is reached, break. */ 15235 if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { 15236 break; 15237 } 15238 } 15239 15240 /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the 15241 computed path and returns a snapshot of the position according to a given percentComplete. */ 15242 return !have_duration ? time_lapsed : function(percentComplete) { 15243 return path[ (percentComplete * (path.length - 1)) | 0 ]; 15244 }; 15245 }; 15246 }()); 15247 15248 /* jQuery easings. */ 15249 Velocity.Easings = { 15250 linear: function(p) { 15251 return p; 15252 }, 15253 swing: function(p) { 15254 return 0.5 - Math.cos(p * Math.PI) / 2; 15255 }, 15256 /* Bonus "spring" easing, which is a less exaggerated version of easeInOutElastic. */ 15257 spring: function(p) { 15258 return 1 - (Math.cos(p * 4.5 * Math.PI) * Math.exp(-p * 6)); 15259 } 15260 }; 15261 15262 /* CSS3 and Robert Penner easings. */ 15263 $.each( 15264 [ 15265 ["ease", [0.25, 0.1, 0.25, 1.0]], 15266 ["ease-in", [0.42, 0.0, 1.00, 1.0]], 15267 ["ease-out", [0.00, 0.0, 0.58, 1.0]], 15268 ["ease-in-out", [0.42, 0.0, 0.58, 1.0]], 15269 ["easeInSine", [0.47, 0, 0.745, 0.715]], 15270 ["easeOutSine", [0.39, 0.575, 0.565, 1]], 15271 ["easeInOutSine", [0.445, 0.05, 0.55, 0.95]], 15272 ["easeInQuad", [0.55, 0.085, 0.68, 0.53]], 15273 ["easeOutQuad", [0.25, 0.46, 0.45, 0.94]], 15274 ["easeInOutQuad", [0.455, 0.03, 0.515, 0.955]], 15275 ["easeInCubic", [0.55, 0.055, 0.675, 0.19]], 15276 ["easeOutCubic", [0.215, 0.61, 0.355, 1]], 15277 ["easeInOutCubic", [0.645, 0.045, 0.355, 1]], 15278 ["easeInQuart", [0.895, 0.03, 0.685, 0.22]], 15279 ["easeOutQuart", [0.165, 0.84, 0.44, 1]], 15280 ["easeInOutQuart", [0.77, 0, 0.175, 1]], 15281 ["easeInQuint", [0.755, 0.05, 0.855, 0.06]], 15282 ["easeOutQuint", [0.23, 1, 0.32, 1]], 15283 ["easeInOutQuint", [0.86, 0, 0.07, 1]], 15284 ["easeInExpo", [0.95, 0.05, 0.795, 0.035]], 15285 ["easeOutExpo", [0.19, 1, 0.22, 1]], 15286 ["easeInOutExpo", [1, 0, 0, 1]], 15287 ["easeInCirc", [0.6, 0.04, 0.98, 0.335]], 15288 ["easeOutCirc", [0.075, 0.82, 0.165, 1]], 15289 ["easeInOutCirc", [0.785, 0.135, 0.15, 0.86]] 15290 ], function(i, easingArray) { 15291 Velocity.Easings[easingArray[0]] = generateBezier.apply(null, easingArray[1]); 15292 }); 15293 15294 /* Determine the appropriate easing type given an easing input. */ 15295 function getEasing(value, duration) { 15296 var easing = value; 15297 15298 /* The easing option can either be a string that references a pre-registered easing, 15299 or it can be a two-/four-item array of integers to be converted into a bezier/spring function. */ 15300 if (Type.isString(value)) { 15301 /* Ensure that the easing has been assigned to jQuery's Velocity.Easings object. */ 15302 if (!Velocity.Easings[value]) { 15303 easing = false; 15304 } 15305 } else if (Type.isArray(value) && value.length === 1) { 15306 easing = generateStep.apply(null, value); 15307 } else if (Type.isArray(value) && value.length === 2) { 15308 /* springRK4 must be passed the animation's duration. */ 15309 /* Note: If the springRK4 array contains non-numbers, generateSpringRK4() returns an easing 15310 function generated with default tension and friction values. */ 15311 easing = generateSpringRK4.apply(null, value.concat([duration])); 15312 } else if (Type.isArray(value) && value.length === 4) { 15313 /* Note: If the bezier array contains non-numbers, generateBezier() returns false. */ 15314 easing = generateBezier.apply(null, value); 15315 } else { 15316 easing = false; 15317 } 15318 15319 /* Revert to the Velocity-wide default easing type, or fall back to "swing" (which is also jQuery's default) 15320 if the Velocity-wide default has been incorrectly modified. */ 15321 if (easing === false) { 15322 if (Velocity.Easings[Velocity.defaults.easing]) { 15323 easing = Velocity.defaults.easing; 15324 } else { 15325 easing = EASING_DEFAULT; 15326 } 15327 } 15328 15329 return easing; 15330 } 15331 15332 /***************** 15333 CSS Stack 15334 *****************/ 15335 15336 /* The CSS object is a highly condensed and performant CSS stack that fully replaces jQuery's. 15337 It handles the validation, getting, and setting of both standard CSS properties and CSS property hooks. */ 15338 /* Note: A "CSS" shorthand is aliased so that our code is easier to read. */ 15339 var CSS = Velocity.CSS = { 15340 /************* 15341 RegEx 15342 *************/ 15343 15344 RegEx: { 15345 isHex: /^#([A-f\d]{3}){1,2}$/i, 15346 /* Unwrap a property value's surrounding text, e.g. "rgba(4, 3, 2, 1)" ==> "4, 3, 2, 1" and "rect(4px 3px 2px 1px)" ==> "4px 3px 2px 1px". */ 15347 valueUnwrap: /^[A-z]+\((.*)\)$/i, 15348 wrappedValueAlreadyExtracted: /[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/, 15349 /* Split a multi-value property into an array of subvalues, e.g. "rgba(4, 3, 2, 1) 4px 3px 2px 1px" ==> [ "rgba(4, 3, 2, 1)", "4px", "3px", "2px", "1px" ]. */ 15350 valueSplit: /([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/ig 15351 }, 15352 /************ 15353 Lists 15354 ************/ 15355 15356 Lists: { 15357 colors: ["fill", "stroke", "stopColor", "color", "backgroundColor", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "outlineColor"], 15358 transformsBase: ["translateX", "translateY", "scale", "scaleX", "scaleY", "skewX", "skewY", "rotateZ"], 15359 transforms3D: ["transformPerspective", "translateZ", "scaleZ", "rotateX", "rotateY"] 15360 }, 15361 /************ 15362 Hooks 15363 ************/ 15364 15365 /* Hooks allow a subproperty (e.g. "boxShadowBlur") of a compound-value CSS property 15366 (e.g. "boxShadow: X Y Blur Spread Color") to be animated as if it were a discrete property. */ 15367 /* Note: Beyond enabling fine-grained property animation, hooking is necessary since Velocity only 15368 tweens properties with single numeric values; unlike CSS transitions, Velocity does not interpolate compound-values. */ 15369 Hooks: { 15370 /******************** 15371 Registration 15372 ********************/ 15373 15374 /* Templates are a concise way of indicating which subproperties must be individually registered for each compound-value CSS property. */ 15375 /* Each template consists of the compound-value's base name, its constituent subproperty names, and those subproperties' default values. */ 15376 templates: { 15377 "textShadow": ["Color X Y Blur", "black 0px 0px 0px"], 15378 "boxShadow": ["Color X Y Blur Spread", "black 0px 0px 0px 0px"], 15379 "clip": ["Top Right Bottom Left", "0px 0px 0px 0px"], 15380 "backgroundPosition": ["X Y", "0% 0%"], 15381 "transformOrigin": ["X Y Z", "50% 50% 0px"], 15382 "perspectiveOrigin": ["X Y", "50% 50%"] 15383 }, 15384 /* A "registered" hook is one that has been converted from its template form into a live, 15385 tweenable property. It contains data to associate it with its root property. */ 15386 registered: { 15387 /* Note: A registered hook looks like this ==> textShadowBlur: [ "textShadow", 3 ], 15388 which consists of the subproperty's name, the associated root property's name, 15389 and the subproperty's position in the root's value. */ 15390 }, 15391 /* Convert the templates into individual hooks then append them to the registered object above. */ 15392 register: function() { 15393 /* Color hooks registration: Colors are defaulted to white -- as opposed to black -- since colors that are 15394 currently set to "transparent" default to their respective template below when color-animated, 15395 and white is typically a closer match to transparent than black is. An exception is made for text ("color"), 15396 which is almost always set closer to black than white. */ 15397 for (var i = 0; i < CSS.Lists.colors.length; i++) { 15398 var rgbComponents = (CSS.Lists.colors[i] === "color") ? "0 0 0 1" : "255 255 255 1"; 15399 CSS.Hooks.templates[CSS.Lists.colors[i]] = ["Red Green Blue Alpha", rgbComponents]; 15400 } 15401 15402 var rootProperty, 15403 hookTemplate, 15404 hookNames; 15405 15406 /* In IE, color values inside compound-value properties are positioned at the end the value instead of at the beginning. 15407 Thus, we re-arrange the templates accordingly. */ 15408 if (IE) { 15409 for (rootProperty in CSS.Hooks.templates) { 15410 if (!CSS.Hooks.templates.hasOwnProperty(rootProperty)) { 15411 continue; 15412 } 15413 hookTemplate = CSS.Hooks.templates[rootProperty]; 15414 hookNames = hookTemplate[0].split(" "); 15415 15416 var defaultValues = hookTemplate[1].match(CSS.RegEx.valueSplit); 15417 15418 if (hookNames[0] === "Color") { 15419 /* Reposition both the hook's name and its default value to the end of their respective strings. */ 15420 hookNames.push(hookNames.shift()); 15421 defaultValues.push(defaultValues.shift()); 15422 15423 /* Replace the existing template for the hook's root property. */ 15424 CSS.Hooks.templates[rootProperty] = [hookNames.join(" "), defaultValues.join(" ")]; 15425 } 15426 } 15427 } 15428 15429 /* Hook registration. */ 15430 for (rootProperty in CSS.Hooks.templates) { 15431 if (!CSS.Hooks.templates.hasOwnProperty(rootProperty)) { 15432 continue; 15433 } 15434 hookTemplate = CSS.Hooks.templates[rootProperty]; 15435 hookNames = hookTemplate[0].split(" "); 15436 15437 for (var j in hookNames) { 15438 if (!hookNames.hasOwnProperty(j)) { 15439 continue; 15440 } 15441 var fullHookName = rootProperty + hookNames[j], 15442 hookPosition = j; 15443 15444 /* For each hook, register its full name (e.g. textShadowBlur) with its root property (e.g. textShadow) 15445 and the hook's position in its template's default value string. */ 15446 CSS.Hooks.registered[fullHookName] = [rootProperty, hookPosition]; 15447 } 15448 } 15449 }, 15450 /***************************** 15451 Injection and Extraction 15452 *****************************/ 15453 15454 /* Look up the root property associated with the hook (e.g. return "textShadow" for "textShadowBlur"). */ 15455 /* Since a hook cannot be set directly (the browser won't recognize it), style updating for hooks is routed through the hook's root property. */ 15456 getRoot: function(property) { 15457 var hookData = CSS.Hooks.registered[property]; 15458 15459 if (hookData) { 15460 return hookData[0]; 15461 } else { 15462 /* If there was no hook match, return the property name untouched. */ 15463 return property; 15464 } 15465 }, 15466 /* Convert any rootPropertyValue, null or otherwise, into a space-delimited list of hook values so that 15467 the targeted hook can be injected or extracted at its standard position. */ 15468 cleanRootPropertyValue: function(rootProperty, rootPropertyValue) { 15469 /* If the rootPropertyValue is wrapped with "rgb()", "clip()", etc., remove the wrapping to normalize the value before manipulation. */ 15470 if (CSS.RegEx.valueUnwrap.test(rootPropertyValue)) { 15471 rootPropertyValue = rootPropertyValue.match(CSS.RegEx.valueUnwrap)[1]; 15472 } 15473 15474 /* If rootPropertyValue is a CSS null-value (from which there's inherently no hook value to extract), 15475 default to the root's default value as defined in CSS.Hooks.templates. */ 15476 /* Note: CSS null-values include "none", "auto", and "transparent". They must be converted into their 15477 zero-values (e.g. textShadow: "none" ==> textShadow: "0px 0px 0px black") for hook manipulation to proceed. */ 15478 if (CSS.Values.isCSSNullValue(rootPropertyValue)) { 15479 rootPropertyValue = CSS.Hooks.templates[rootProperty][1]; 15480 } 15481 15482 return rootPropertyValue; 15483 }, 15484 /* Extracted the hook's value from its root property's value. This is used to get the starting value of an animating hook. */ 15485 extractValue: function(fullHookName, rootPropertyValue) { 15486 var hookData = CSS.Hooks.registered[fullHookName]; 15487 15488 if (hookData) { 15489 var hookRoot = hookData[0], 15490 hookPosition = hookData[1]; 15491 15492 rootPropertyValue = CSS.Hooks.cleanRootPropertyValue(hookRoot, rootPropertyValue); 15493 15494 /* Split rootPropertyValue into its constituent hook values then grab the desired hook at its standard position. */ 15495 return rootPropertyValue.toString().match(CSS.RegEx.valueSplit)[hookPosition]; 15496 } else { 15497 /* If the provided fullHookName isn't a registered hook, return the rootPropertyValue that was passed in. */ 15498 return rootPropertyValue; 15499 } 15500 }, 15501 /* Inject the hook's value into its root property's value. This is used to piece back together the root property 15502 once Velocity has updated one of its individually hooked values through tweening. */ 15503 injectValue: function(fullHookName, hookValue, rootPropertyValue) { 15504 var hookData = CSS.Hooks.registered[fullHookName]; 15505 15506 if (hookData) { 15507 var hookRoot = hookData[0], 15508 hookPosition = hookData[1], 15509 rootPropertyValueParts, 15510 rootPropertyValueUpdated; 15511 15512 rootPropertyValue = CSS.Hooks.cleanRootPropertyValue(hookRoot, rootPropertyValue); 15513 15514 /* Split rootPropertyValue into its individual hook values, replace the targeted value with hookValue, 15515 then reconstruct the rootPropertyValue string. */ 15516 rootPropertyValueParts = rootPropertyValue.toString().match(CSS.RegEx.valueSplit); 15517 rootPropertyValueParts[hookPosition] = hookValue; 15518 rootPropertyValueUpdated = rootPropertyValueParts.join(" "); 15519 15520 return rootPropertyValueUpdated; 15521 } else { 15522 /* If the provided fullHookName isn't a registered hook, return the rootPropertyValue that was passed in. */ 15523 return rootPropertyValue; 15524 } 15525 } 15526 }, 15527 /******************* 15528 Normalizations 15529 *******************/ 15530 15531 /* Normalizations standardize CSS property manipulation by pollyfilling browser-specific implementations (e.g. opacity) 15532 and reformatting special properties (e.g. clip, rgba) to look like standard ones. */ 15533 Normalizations: { 15534 /* Normalizations are passed a normalization target (either the property's name, its extracted value, or its injected value), 15535 the targeted element (which may need to be queried), and the targeted property value. */ 15536 registered: { 15537 clip: function(type, element, propertyValue) { 15538 switch (type) { 15539 case "name": 15540 return "clip"; 15541 /* Clip needs to be unwrapped and stripped of its commas during extraction. */ 15542 case "extract": 15543 var extracted; 15544 15545 /* If Velocity also extracted this value, skip extraction. */ 15546 if (CSS.RegEx.wrappedValueAlreadyExtracted.test(propertyValue)) { 15547 extracted = propertyValue; 15548 } else { 15549 /* Remove the "rect()" wrapper. */ 15550 extracted = propertyValue.toString().match(CSS.RegEx.valueUnwrap); 15551 15552 /* Strip off commas. */ 15553 extracted = extracted ? extracted[1].replace(/,(\s+)?/g, " ") : propertyValue; 15554 } 15555 15556 return extracted; 15557 /* Clip needs to be re-wrapped during injection. */ 15558 case "inject": 15559 return "rect(" + propertyValue + ")"; 15560 } 15561 }, 15562 blur: function(type, element, propertyValue) { 15563 switch (type) { 15564 case "name": 15565 return Velocity.State.isFirefox ? "filter" : "-webkit-filter"; 15566 case "extract": 15567 var extracted = parseFloat(propertyValue); 15568 15569 /* If extracted is NaN, meaning the value isn't already extracted. */ 15570 if (!(extracted || extracted === 0)) { 15571 var blurComponent = propertyValue.toString().match(/blur\(([0-9]+[A-z]+)\)/i); 15572 15573 /* If the filter string had a blur component, return just the blur value and unit type. */ 15574 if (blurComponent) { 15575 extracted = blurComponent[1]; 15576 /* If the component doesn't exist, default blur to 0. */ 15577 } else { 15578 extracted = 0; 15579 } 15580 } 15581 15582 return extracted; 15583 /* Blur needs to be re-wrapped during injection. */ 15584 case "inject": 15585 /* For the blur effect to be fully de-applied, it needs to be set to "none" instead of 0. */ 15586 if (!parseFloat(propertyValue)) { 15587 return "none"; 15588 } else { 15589 return "blur(" + propertyValue + ")"; 15590 } 15591 } 15592 }, 15593 /* <=IE8 do not support the standard opacity property. They use filter:alpha(opacity=INT) instead. */ 15594 opacity: function(type, element, propertyValue) { 15595 if (IE <= 8) { 15596 switch (type) { 15597 case "name": 15598 return "filter"; 15599 case "extract": 15600 /* <=IE8 return a "filter" value of "alpha(opacity=\d{1,3})". 15601 Extract the value and convert it to a decimal value to match the standard CSS opacity property's formatting. */ 15602 var extracted = propertyValue.toString().match(/alpha\(opacity=(.*)\)/i); 15603 15604 if (extracted) { 15605 /* Convert to decimal value. */ 15606 propertyValue = extracted[1] / 100; 15607 } else { 15608 /* When extracting opacity, default to 1 since a null value means opacity hasn't been set. */ 15609 propertyValue = 1; 15610 } 15611 15612 return propertyValue; 15613 case "inject": 15614 /* Opacified elements are required to have their zoom property set to a non-zero value. */ 15615 element.style.zoom = 1; 15616 15617 /* Setting the filter property on elements with certain font property combinations can result in a 15618 highly unappealing ultra-bolding effect. There's no way to remedy this throughout a tween, but dropping the 15619 value altogether (when opacity hits 1) at leasts ensures that the glitch is gone post-tweening. */ 15620 if (parseFloat(propertyValue) >= 1) { 15621 return ""; 15622 } else { 15623 /* As per the filter property's spec, convert the decimal value to a whole number and wrap the value. */ 15624 return "alpha(opacity=" + parseInt(parseFloat(propertyValue) * 100, 10) + ")"; 15625 } 15626 } 15627 /* With all other browsers, normalization is not required; return the same values that were passed in. */ 15628 } else { 15629 switch (type) { 15630 case "name": 15631 return "opacity"; 15632 case "extract": 15633 return propertyValue; 15634 case "inject": 15635 return propertyValue; 15636 } 15637 } 15638 } 15639 }, 15640 /***************************** 15641 Batched Registrations 15642 *****************************/ 15643 15644 /* Note: Batched normalizations extend the CSS.Normalizations.registered object. */ 15645 register: function() { 15646 15647 /***************** 15648 Transforms 15649 *****************/ 15650 15651 /* Transforms are the subproperties contained by the CSS "transform" property. Transforms must undergo normalization 15652 so that they can be referenced in a properties map by their individual names. */ 15653 /* Note: When transforms are "set", they are actually assigned to a per-element transformCache. When all transform 15654 setting is complete complete, CSS.flushTransformCache() must be manually called to flush the values to the DOM. 15655 Transform setting is batched in this way to improve performance: the transform style only needs to be updated 15656 once when multiple transform subproperties are being animated simultaneously. */ 15657 /* Note: IE9 and Android Gingerbread have support for 2D -- but not 3D -- transforms. Since animating unsupported 15658 transform properties results in the browser ignoring the *entire* transform string, we prevent these 3D values 15659 from being normalized for these browsers so that tweening skips these properties altogether 15660 (since it will ignore them as being unsupported by the browser.) */ 15661 if ((!IE || IE > 9) && !Velocity.State.isGingerbread) { 15662 /* Note: Since the standalone CSS "perspective" property and the CSS transform "perspective" subproperty 15663 share the same name, the latter is given a unique token within Velocity: "transformPerspective". */ 15664 CSS.Lists.transformsBase = CSS.Lists.transformsBase.concat(CSS.Lists.transforms3D); 15665 } 15666 15667 for (var i = 0; i < CSS.Lists.transformsBase.length; i++) { 15668 /* Wrap the dynamically generated normalization function in a new scope so that transformName's value is 15669 paired with its respective function. (Otherwise, all functions would take the final for loop's transformName.) */ 15670 (function() { 15671 var transformName = CSS.Lists.transformsBase[i]; 15672 15673 CSS.Normalizations.registered[transformName] = function(type, element, propertyValue) { 15674 switch (type) { 15675 /* The normalized property name is the parent "transform" property -- the property that is actually set in CSS. */ 15676 case "name": 15677 return "transform"; 15678 /* Transform values are cached onto a per-element transformCache object. */ 15679 case "extract": 15680 /* If this transform has yet to be assigned a value, return its null value. */ 15681 if (Data(element) === undefined || Data(element).transformCache[transformName] === undefined) { 15682 /* Scale CSS.Lists.transformsBase default to 1 whereas all other transform properties default to 0. */ 15683 return /^scale/i.test(transformName) ? 1 : 0; 15684 /* When transform values are set, they are wrapped in parentheses as per the CSS spec. 15685 Thus, when extracting their values (for tween calculations), we strip off the parentheses. */ 15686 } 15687 return Data(element).transformCache[transformName].replace(/[()]/g, ""); 15688 case "inject": 15689 var invalid = false; 15690 15691 /* If an individual transform property contains an unsupported unit type, the browser ignores the *entire* transform property. 15692 Thus, protect users from themselves by skipping setting for transform values supplied with invalid unit types. */ 15693 /* Switch on the base transform type; ignore the axis by removing the last letter from the transform's name. */ 15694 switch (transformName.substr(0, transformName.length - 1)) { 15695 /* Whitelist unit types for each transform. */ 15696 case "translate": 15697 invalid = !/(%|px|em|rem|vw|vh|\d)$/i.test(propertyValue); 15698 break; 15699 /* Since an axis-free "scale" property is supported as well, a little hack is used here to detect it by chopping off its last letter. */ 15700 case "scal": 15701 case "scale": 15702 /* Chrome on Android has a bug in which scaled elements blur if their initial scale 15703 value is below 1 (which can happen with forcefeeding). Thus, we detect a yet-unset scale property 15704 and ensure that its first value is always 1. More info: http://stackoverflow.com/questions/10417890/css3-animations-with-transform-causes-blurred-elements-on-webkit/10417962#10417962 */ 15705 if (Velocity.State.isAndroid && Data(element).transformCache[transformName] === undefined && propertyValue < 1) { 15706 propertyValue = 1; 15707 } 15708 15709 invalid = !/(\d)$/i.test(propertyValue); 15710 break; 15711 case "skew": 15712 invalid = !/(deg|\d)$/i.test(propertyValue); 15713 break; 15714 case "rotate": 15715 invalid = !/(deg|\d)$/i.test(propertyValue); 15716 break; 15717 } 15718 15719 if (!invalid) { 15720 /* As per the CSS spec, wrap the value in parentheses. */ 15721 Data(element).transformCache[transformName] = "(" + propertyValue + ")"; 15722 } 15723 15724 /* Although the value is set on the transformCache object, return the newly-updated value for the calling code to process as normal. */ 15725 return Data(element).transformCache[transformName]; 15726 } 15727 }; 15728 })(); 15729 } 15730 15731 /************* 15732 Colors 15733 *************/ 15734 15735 /* Since Velocity only animates a single numeric value per property, color animation is achieved by hooking the individual RGBA components of CSS color properties. 15736 Accordingly, color values must be normalized (e.g. "#ff0000", "red", and "rgb(255, 0, 0)" ==> "255 0 0 1") so that their components can be injected/extracted by CSS.Hooks logic. */ 15737 for (var j = 0; j < CSS.Lists.colors.length; j++) { 15738 /* Wrap the dynamically generated normalization function in a new scope so that colorName's value is paired with its respective function. 15739 (Otherwise, all functions would take the final for loop's colorName.) */ 15740 (function() { 15741 var colorName = CSS.Lists.colors[j]; 15742 15743 /* Note: In IE<=8, which support rgb but not rgba, color properties are reverted to rgb by stripping off the alpha component. */ 15744 CSS.Normalizations.registered[colorName] = function(type, element, propertyValue) { 15745 switch (type) { 15746 case "name": 15747 return colorName; 15748 /* Convert all color values into the rgb format. (Old IE can return hex values and color names instead of rgb/rgba.) */ 15749 case "extract": 15750 var extracted; 15751 15752 /* If the color is already in its hookable form (e.g. "255 255 255 1") due to having been previously extracted, skip extraction. */ 15753 if (CSS.RegEx.wrappedValueAlreadyExtracted.test(propertyValue)) { 15754 extracted = propertyValue; 15755 } else { 15756 var converted, 15757 colorNames = { 15758 black: "rgb(0, 0, 0)", 15759 blue: "rgb(0, 0, 255)", 15760 gray: "rgb(128, 128, 128)", 15761 green: "rgb(0, 128, 0)", 15762 red: "rgb(255, 0, 0)", 15763 white: "rgb(255, 255, 255)" 15764 }; 15765 15766 /* Convert color names to rgb. */ 15767 if (/^[A-z]+$/i.test(propertyValue)) { 15768 if (colorNames[propertyValue] !== undefined) { 15769 converted = colorNames[propertyValue]; 15770 } else { 15771 /* If an unmatched color name is provided, default to black. */ 15772 converted = colorNames.black; 15773 } 15774 /* Convert hex values to rgb. */ 15775 } else if (CSS.RegEx.isHex.test(propertyValue)) { 15776 converted = "rgb(" + CSS.Values.hexToRgb(propertyValue).join(" ") + ")"; 15777 /* If the provided color doesn't match any of the accepted color formats, default to black. */ 15778 } else if (!(/^rgba?\(/i.test(propertyValue))) { 15779 converted = colorNames.black; 15780 } 15781 15782 /* Remove the surrounding "rgb/rgba()" string then replace commas with spaces and strip 15783 repeated spaces (in case the value included spaces to begin with). */ 15784 extracted = (converted || propertyValue).toString().match(CSS.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g, " "); 15785 } 15786 15787 /* So long as this isn't <=IE8, add a fourth (alpha) component if it's missing and default it to 1 (visible). */ 15788 if ((!IE || IE > 8) && extracted.split(" ").length === 3) { 15789 extracted += " 1"; 15790 } 15791 15792 return extracted; 15793 case "inject": 15794 /* If this is IE<=8 and an alpha component exists, strip it off. */ 15795 if (IE <= 8) { 15796 if (propertyValue.split(" ").length === 4) { 15797 propertyValue = propertyValue.split(/\s+/).slice(0, 3).join(" "); 15798 } 15799 /* Otherwise, add a fourth (alpha) component if it's missing and default it to 1 (visible). */ 15800 } else if (propertyValue.split(" ").length === 3) { 15801 propertyValue += " 1"; 15802 } 15803 15804 /* Re-insert the browser-appropriate wrapper("rgb/rgba()"), insert commas, and strip off decimal units 15805 on all values but the fourth (R, G, and B only accept whole numbers). */ 15806 return (IE <= 8 ? "rgb" : "rgba") + "(" + propertyValue.replace(/\s+/g, ",").replace(/\.(\d)+(?=,)/g, "") + ")"; 15807 } 15808 }; 15809 })(); 15810 } 15811 15812 /************** 15813 Dimensions 15814 **************/ 15815 function augmentDimension(name, element, wantInner) { 15816 var isBorderBox = CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box"; 15817 15818 if (isBorderBox === (wantInner || false)) { 15819 /* in box-sizing mode, the CSS width / height accessors already give the outerWidth / outerHeight. */ 15820 var i, 15821 value, 15822 augment = 0, 15823 sides = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"], 15824 fields = ["padding" + sides[0], "padding" + sides[1], "border" + sides[0] + "Width", "border" + sides[1] + "Width"]; 15825 15826 for (i = 0; i < fields.length; i++) { 15827 value = parseFloat(CSS.getPropertyValue(element, fields[i])); 15828 if (!isNaN(value)) { 15829 augment += value; 15830 } 15831 } 15832 return wantInner ? -augment : augment; 15833 } 15834 return 0; 15835 } 15836 function getDimension(name, wantInner) { 15837 return function(type, element, propertyValue) { 15838 switch (type) { 15839 case "name": 15840 return name; 15841 case "extract": 15842 return parseFloat(propertyValue) + augmentDimension(name, element, wantInner); 15843 case "inject": 15844 return (parseFloat(propertyValue) - augmentDimension(name, element, wantInner)) + "px"; 15845 } 15846 }; 15847 } 15848 CSS.Normalizations.registered.innerWidth = getDimension("width", true); 15849 CSS.Normalizations.registered.innerHeight = getDimension("height", true); 15850 CSS.Normalizations.registered.outerWidth = getDimension("width"); 15851 CSS.Normalizations.registered.outerHeight = getDimension("height"); 15852 } 15853 }, 15854 /************************ 15855 CSS Property Names 15856 ************************/ 15857 15858 Names: { 15859 /* Camelcase a property name into its JavaScript notation (e.g. "background-color" ==> "backgroundColor"). 15860 Camelcasing is used to normalize property names between and across calls. */ 15861 camelCase: function(property) { 15862 return property.replace(/-(\w)/g, function(match, subMatch) { 15863 return subMatch.toUpperCase(); 15864 }); 15865 }, 15866 /* For SVG elements, some properties (namely, dimensional ones) are GET/SET via the element's HTML attributes (instead of via CSS styles). */ 15867 SVGAttribute: function(property) { 15868 var SVGAttributes = "width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2"; 15869 15870 /* Certain browsers require an SVG transform to be applied as an attribute. (Otherwise, application via CSS is preferable due to 3D support.) */ 15871 if (IE || (Velocity.State.isAndroid && !Velocity.State.isChrome)) { 15872 SVGAttributes += "|transform"; 15873 } 15874 15875 return new RegExp("^(" + SVGAttributes + ")$", "i").test(property); 15876 }, 15877 /* Determine whether a property should be set with a vendor prefix. */ 15878 /* If a prefixed version of the property exists, return it. Otherwise, return the original property name. 15879 If the property is not at all supported by the browser, return a false flag. */ 15880 prefixCheck: function(property) { 15881 /* If this property has already been checked, return the cached value. */ 15882 if (Velocity.State.prefixMatches[property]) { 15883 return [Velocity.State.prefixMatches[property], true]; 15884 } else { 15885 var vendors = ["", "Webkit", "Moz", "ms", "O"]; 15886 15887 for (var i = 0, vendorsLength = vendors.length; i < vendorsLength; i++) { 15888 var propertyPrefixed; 15889 15890 if (i === 0) { 15891 propertyPrefixed = property; 15892 } else { 15893 /* Capitalize the first letter of the property to conform to JavaScript vendor prefix notation (e.g. webkitFilter). */ 15894 propertyPrefixed = vendors[i] + property.replace(/^\w/, function(match) { 15895 return match.toUpperCase(); 15896 }); 15897 } 15898 15899 /* Check if the browser supports this property as prefixed. */ 15900 if (Type.isString(Velocity.State.prefixElement.style[propertyPrefixed])) { 15901 /* Cache the match. */ 15902 Velocity.State.prefixMatches[property] = propertyPrefixed; 15903 15904 return [propertyPrefixed, true]; 15905 } 15906 } 15907 15908 /* If the browser doesn't support this property in any form, include a false flag so that the caller can decide how to proceed. */ 15909 return [property, false]; 15910 } 15911 } 15912 }, 15913 /************************ 15914 CSS Property Values 15915 ************************/ 15916 15917 Values: { 15918 /* Hex to RGB conversion. Copyright Tim Down: http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb */ 15919 hexToRgb: function(hex) { 15920 var shortformRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, 15921 longformRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, 15922 rgbParts; 15923 15924 hex = hex.replace(shortformRegex, function(m, r, g, b) { 15925 return r + r + g + g + b + b; 15926 }); 15927 15928 rgbParts = longformRegex.exec(hex); 15929 15930 return rgbParts ? [parseInt(rgbParts[1], 16), parseInt(rgbParts[2], 16), parseInt(rgbParts[3], 16)] : [0, 0, 0]; 15931 }, 15932 isCSSNullValue: function(value) { 15933 /* The browser defaults CSS values that have not been set to either 0 or one of several possible null-value strings. 15934 Thus, we check for both falsiness and these special strings. */ 15935 /* Null-value checking is performed to default the special strings to 0 (for the sake of tweening) or their hook 15936 templates as defined as CSS.Hooks (for the sake of hook injection/extraction). */ 15937 /* Note: Chrome returns "rgba(0, 0, 0, 0)" for an undefined color whereas IE returns "transparent". */ 15938 return (!value || /^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(value)); 15939 }, 15940 /* Retrieve a property's default unit type. Used for assigning a unit type when one is not supplied by the user. */ 15941 getUnitType: function(property) { 15942 if (/^(rotate|skew)/i.test(property)) { 15943 return "deg"; 15944 } else if (/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(property)) { 15945 /* The above properties are unitless. */ 15946 return ""; 15947 } else { 15948 /* Default to px for all other properties. */ 15949 return "px"; 15950 } 15951 }, 15952 /* HTML elements default to an associated display type when they're not set to display:none. */ 15953 /* Note: This function is used for correctly setting the non-"none" display value in certain Velocity redirects, such as fadeIn/Out. */ 15954 getDisplayType: function(element) { 15955 var tagName = element && element.tagName.toString().toLowerCase(); 15956 15957 if (/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(tagName)) { 15958 return "inline"; 15959 } else if (/^(li)$/i.test(tagName)) { 15960 return "list-item"; 15961 } else if (/^(tr)$/i.test(tagName)) { 15962 return "table-row"; 15963 } else if (/^(table)$/i.test(tagName)) { 15964 return "table"; 15965 } else if (/^(tbody)$/i.test(tagName)) { 15966 return "table-row-group"; 15967 /* Default to "block" when no match is found. */ 15968 } else { 15969 return "block"; 15970 } 15971 }, 15972 /* The class add/remove functions are used to temporarily apply a "velocity-animating" class to elements while they're animating. */ 15973 addClass: function(element, className) { 15974 if (element.classList) { 15975 element.classList.add(className); 15976 } else { 15977 element.className += (element.className.length ? " " : "") + className; 15978 } 15979 }, 15980 removeClass: function(element, className) { 15981 if (element.classList) { 15982 element.classList.remove(className); 15983 } else { 15984 element.className = element.className.toString().replace(new RegExp("(^|\\s)" + className.split(" ").join("|") + "(\\s|$)", "gi"), " "); 15985 } 15986 } 15987 }, 15988 /**************************** 15989 Style Getting & Setting 15990 ****************************/ 15991 15992 /* The singular getPropertyValue, which routes the logic for all normalizations, hooks, and standard CSS properties. */ 15993 getPropertyValue: function(element, property, rootPropertyValue, forceStyleLookup) { 15994 /* Get an element's computed property value. */ 15995 /* Note: Retrieving the value of a CSS property cannot simply be performed by checking an element's 15996 style attribute (which only reflects user-defined values). Instead, the browser must be queried for a property's 15997 *computed* value. You can read more about getComputedStyle here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */ 15998 function computePropertyValue(element, property) { 15999 /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an 16000 element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate 16001 offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar. 16002 We subtract border and padding to get the sum of interior + scrollbar. */ 16003 var computedValue = 0; 16004 16005 /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array 16006 of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the 16007 codebase for a dying browser. The performance repercussions of using jQuery here are minimal since 16008 Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */ 16009 if (IE <= 8) { 16010 computedValue = $.css(element, property); /* GET */ 16011 /* All other browsers support getComputedStyle. The returned live object reference is cached onto its 16012 associated element so that it does not need to be refetched upon every GET. */ 16013 } else { 16014 /* Browsers do not return height and width values for elements that are set to display:"none". Thus, we temporarily 16015 toggle display to the element type's default value. */ 16016 var toggleDisplay = false; 16017 16018 if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, "display") === 0) { 16019 toggleDisplay = true; 16020 CSS.setPropertyValue(element, "display", CSS.Values.getDisplayType(element)); 16021 } 16022 16023 var revertDisplay = function() { 16024 if (toggleDisplay) { 16025 CSS.setPropertyValue(element, "display", "none"); 16026 } 16027 }; 16028 16029 if (!forceStyleLookup) { 16030 if (property === "height" && CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() !== "border-box") { 16031 var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, "borderTopWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "borderBottomWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingTop")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingBottom")) || 0); 16032 revertDisplay(); 16033 16034 return contentBoxHeight; 16035 } else if (property === "width" && CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() !== "border-box") { 16036 var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, "borderLeftWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "borderRightWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingLeft")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingRight")) || 0); 16037 revertDisplay(); 16038 16039 return contentBoxWidth; 16040 } 16041 } 16042 16043 var computedStyle; 16044 16045 /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf 16046 of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */ 16047 if (Data(element) === undefined) { 16048 computedStyle = window.getComputedStyle(element, null); /* GET */ 16049 /* If the computedStyle object has yet to be cached, do so now. */ 16050 } else if (!Data(element).computedStyle) { 16051 computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */ 16052 /* If computedStyle is cached, use it. */ 16053 } else { 16054 computedStyle = Data(element).computedStyle; 16055 } 16056 16057 /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color. 16058 Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse. 16059 So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */ 16060 if (property === "borderColor") { 16061 property = "borderTopColor"; 16062 } 16063 16064 /* IE9 has a bug in which the "filter" property must be accessed from computedStyle using the getPropertyValue method 16065 instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */ 16066 if (IE === 9 && property === "filter") { 16067 computedValue = computedStyle.getPropertyValue(property); /* GET */ 16068 } else { 16069 computedValue = computedStyle[property]; 16070 } 16071 16072 /* Fall back to the property's style value (if defined) when computedValue returns nothing, 16073 which can happen when the element hasn't been painted. */ 16074 if (computedValue === "" || computedValue === null) { 16075 computedValue = element.style[property]; 16076 } 16077 16078 revertDisplay(); 16079 } 16080 16081 /* For top, right, bottom, and left (TRBL) values that are set to "auto" on elements of "fixed" or "absolute" position, 16082 defer to jQuery for converting "auto" to a numeric value. (For elements with a "static" or "relative" position, "auto" has the same 16083 effect as being set to 0, so no conversion is necessary.) */ 16084 /* An example of why numeric conversion is necessary: When an element with "position:absolute" has an untouched "left" 16085 property, which reverts to "auto", left's value is 0 relative to its parent element, but is often non-zero relative 16086 to its *containing* (not parent) element, which is the nearest "position:relative" ancestor or the viewport (and always the viewport in the case of "position:fixed"). */ 16087 if (computedValue === "auto" && /^(top|right|bottom|left)$/i.test(property)) { 16088 var position = computePropertyValue(element, "position"); /* GET */ 16089 16090 /* For absolute positioning, jQuery's $.position() only returns values for top and left; 16091 right and bottom will have their "auto" value reverted to 0. */ 16092 /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position(). 16093 Not a big deal since we're currently in a GET batch anyway. */ 16094 if (position === "fixed" || (position === "absolute" && /top|left/i.test(property))) { 16095 /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */ 16096 computedValue = $(element).position()[property] + "px"; /* GET */ 16097 } 16098 } 16099 16100 return computedValue; 16101 } 16102 16103 var propertyValue; 16104 16105 /* If this is a hooked property (e.g. "clipLeft" instead of the root property of "clip"), 16106 extract the hook's value from a normalized rootPropertyValue using CSS.Hooks.extractValue(). */ 16107 if (CSS.Hooks.registered[property]) { 16108 var hook = property, 16109 hookRoot = CSS.Hooks.getRoot(hook); 16110 16111 /* If a cached rootPropertyValue wasn't passed in (which Velocity always attempts to do in order to avoid requerying the DOM), 16112 query the DOM for the root property's value. */ 16113 if (rootPropertyValue === undefined) { 16114 /* Since the browser is now being directly queried, use the official post-prefixing property name for this lookup. */ 16115 rootPropertyValue = CSS.getPropertyValue(element, CSS.Names.prefixCheck(hookRoot)[0]); /* GET */ 16116 } 16117 16118 /* If this root has a normalization registered, peform the associated normalization extraction. */ 16119 if (CSS.Normalizations.registered[hookRoot]) { 16120 rootPropertyValue = CSS.Normalizations.registered[hookRoot]("extract", element, rootPropertyValue); 16121 } 16122 16123 /* Extract the hook's value. */ 16124 propertyValue = CSS.Hooks.extractValue(hook, rootPropertyValue); 16125 16126 /* If this is a normalized property (e.g. "opacity" becomes "filter" in <=IE8) or "translateX" becomes "transform"), 16127 normalize the property's name and value, and handle the special case of transforms. */ 16128 /* Note: Normalizing a property is mutually exclusive from hooking a property since hook-extracted values are strictly 16129 numerical and therefore do not require normalization extraction. */ 16130 } else if (CSS.Normalizations.registered[property]) { 16131 var normalizedPropertyName, 16132 normalizedPropertyValue; 16133 16134 normalizedPropertyName = CSS.Normalizations.registered[property]("name", element); 16135 16136 /* Transform values are calculated via normalization extraction (see below), which checks against the element's transformCache. 16137 At no point do transform GETs ever actually query the DOM; initial stylesheet values are never processed. 16138 This is because parsing 3D transform matrices is not always accurate and would bloat our codebase; 16139 thus, normalization extraction defaults initial transform values to their zero-values (e.g. 1 for scaleX and 0 for translateX). */ 16140 if (normalizedPropertyName !== "transform") { 16141 normalizedPropertyValue = computePropertyValue(element, CSS.Names.prefixCheck(normalizedPropertyName)[0]); /* GET */ 16142 16143 /* If the value is a CSS null-value and this property has a hook template, use that zero-value template so that hooks can be extracted from it. */ 16144 if (CSS.Values.isCSSNullValue(normalizedPropertyValue) && CSS.Hooks.templates[property]) { 16145 normalizedPropertyValue = CSS.Hooks.templates[property][1]; 16146 } 16147 } 16148 16149 propertyValue = CSS.Normalizations.registered[property]("extract", element, normalizedPropertyValue); 16150 } 16151 16152 /* If a (numeric) value wasn't produced via hook extraction or normalization, query the DOM. */ 16153 if (!/^[\d-]/.test(propertyValue)) { 16154 /* For SVG elements, dimensional properties (which SVGAttribute() detects) are tweened via 16155 their HTML attribute values instead of their CSS style values. */ 16156 var data = Data(element); 16157 16158 if (data && data.isSVG && CSS.Names.SVGAttribute(property)) { 16159 /* Since the height/width attribute values must be set manually, they don't reflect computed values. 16160 Thus, we use use getBBox() to ensure we always get values for elements with undefined height/width attributes. */ 16161 if (/^(height|width)$/i.test(property)) { 16162 /* Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM. */ 16163 try { 16164 propertyValue = element.getBBox()[property]; 16165 } catch (error) { 16166 propertyValue = 0; 16167 } 16168 /* Otherwise, access the attribute value directly. */ 16169 } else { 16170 propertyValue = element.getAttribute(property); 16171 } 16172 } else { 16173 propertyValue = computePropertyValue(element, CSS.Names.prefixCheck(property)[0]); /* GET */ 16174 } 16175 } 16176 16177 /* Since property lookups are for animation purposes (which entails computing the numeric delta between start and end values), 16178 convert CSS null-values to an integer of value 0. */ 16179 if (CSS.Values.isCSSNullValue(propertyValue)) { 16180 propertyValue = 0; 16181 } 16182 16183 if (Velocity.debug >= 2) { 16184 console.log("Get " + property + ": " + propertyValue); 16185 } 16186 16187 return propertyValue; 16188 }, 16189 /* The singular setPropertyValue, which routes the logic for all normalizations, hooks, and standard CSS properties. */ 16190 setPropertyValue: function(element, property, propertyValue, rootPropertyValue, scrollData) { 16191 var propertyName = property; 16192 16193 /* In order to be subjected to call options and element queueing, scroll animation is routed through Velocity as if it were a standard CSS property. */ 16194 if (property === "scroll") { 16195 /* If a container option is present, scroll the container instead of the browser window. */ 16196 if (scrollData.container) { 16197 scrollData.container["scroll" + scrollData.direction] = propertyValue; 16198 /* Otherwise, Velocity defaults to scrolling the browser window. */ 16199 } else { 16200 if (scrollData.direction === "Left") { 16201 window.scrollTo(propertyValue, scrollData.alternateValue); 16202 } else { 16203 window.scrollTo(scrollData.alternateValue, propertyValue); 16204 } 16205 } 16206 } else { 16207 /* Transforms (translateX, rotateZ, etc.) are applied to a per-element transformCache object, which is manually flushed via flushTransformCache(). 16208 Thus, for now, we merely cache transforms being SET. */ 16209 if (CSS.Normalizations.registered[property] && CSS.Normalizations.registered[property]("name", element) === "transform") { 16210 /* Perform a normalization injection. */ 16211 /* Note: The normalization logic handles the transformCache updating. */ 16212 CSS.Normalizations.registered[property]("inject", element, propertyValue); 16213 16214 propertyName = "transform"; 16215 propertyValue = Data(element).transformCache[property]; 16216 } else { 16217 /* Inject hooks. */ 16218 if (CSS.Hooks.registered[property]) { 16219 var hookName = property, 16220 hookRoot = CSS.Hooks.getRoot(property); 16221 16222 /* If a cached rootPropertyValue was not provided, query the DOM for the hookRoot's current value. */ 16223 rootPropertyValue = rootPropertyValue || CSS.getPropertyValue(element, hookRoot); /* GET */ 16224 16225 propertyValue = CSS.Hooks.injectValue(hookName, propertyValue, rootPropertyValue); 16226 property = hookRoot; 16227 } 16228 16229 /* Normalize names and values. */ 16230 if (CSS.Normalizations.registered[property]) { 16231 propertyValue = CSS.Normalizations.registered[property]("inject", element, propertyValue); 16232 property = CSS.Normalizations.registered[property]("name", element); 16233 } 16234 16235 /* Assign the appropriate vendor prefix before performing an official style update. */ 16236 propertyName = CSS.Names.prefixCheck(property)[0]; 16237 16238 /* A try/catch is used for IE<=8, which throws an error when "invalid" CSS values are set, e.g. a negative width. 16239 Try/catch is avoided for other browsers since it incurs a performance overhead. */ 16240 if (IE <= 8) { 16241 try { 16242 element.style[propertyName] = propertyValue; 16243 } catch (error) { 16244 if (Velocity.debug) { 16245 console.log("Browser does not support [" + propertyValue + "] for [" + propertyName + "]"); 16246 } 16247 } 16248 /* SVG elements have their dimensional properties (width, height, x, y, cx, etc.) applied directly as attributes instead of as styles. */ 16249 /* Note: IE8 does not support SVG elements, so it's okay that we skip it for SVG animation. */ 16250 } else { 16251 var data = Data(element); 16252 16253 if (data && data.isSVG && CSS.Names.SVGAttribute(property)) { 16254 /* Note: For SVG attributes, vendor-prefixed property names are never used. */ 16255 /* Note: Not all CSS properties can be animated via attributes, but the browser won't throw an error for unsupported properties. */ 16256 element.setAttribute(property, propertyValue); 16257 } else { 16258 element.style[propertyName] = propertyValue; 16259 } 16260 } 16261 16262 if (Velocity.debug >= 2) { 16263 console.log("Set " + property + " (" + propertyName + "): " + propertyValue); 16264 } 16265 } 16266 } 16267 16268 /* Return the normalized property name and value in case the caller wants to know how these values were modified before being applied to the DOM. */ 16269 return [propertyName, propertyValue]; 16270 }, 16271 /* To increase performance by batching transform updates into a single SET, transforms are not directly applied to an element until flushTransformCache() is called. */ 16272 /* Note: Velocity applies transform properties in the same order that they are chronogically introduced to the element's CSS styles. */ 16273 flushTransformCache: function(element) { 16274 var transformString = "", 16275 data = Data(element); 16276 16277 /* Certain browsers require that SVG transforms be applied as an attribute. However, the SVG transform attribute takes a modified version of CSS's transform string 16278 (units are dropped and, except for skewX/Y, subproperties are merged into their master property -- e.g. scaleX and scaleY are merged into scale(X Y). */ 16279 if ((IE || (Velocity.State.isAndroid && !Velocity.State.isChrome)) && data && data.isSVG) { 16280 /* Since transform values are stored in their parentheses-wrapped form, we use a helper function to strip out their numeric values. 16281 Further, SVG transform properties only take unitless (representing pixels) values, so it's okay that parseFloat() strips the unit suffixed to the float value. */ 16282 var getTransformFloat = function(transformProperty) { 16283 return parseFloat(CSS.getPropertyValue(element, transformProperty)); 16284 }; 16285 16286 /* Create an object to organize all the transforms that we'll apply to the SVG element. To keep the logic simple, 16287 we process *all* transform properties -- even those that may not be explicitly applied (since they default to their zero-values anyway). */ 16288 var SVGTransforms = { 16289 translate: [getTransformFloat("translateX"), getTransformFloat("translateY")], 16290 skewX: [getTransformFloat("skewX")], skewY: [getTransformFloat("skewY")], 16291 /* If the scale property is set (non-1), use that value for the scaleX and scaleY values 16292 (this behavior mimics the result of animating all these properties at once on HTML elements). */ 16293 scale: getTransformFloat("scale") !== 1 ? [getTransformFloat("scale"), getTransformFloat("scale")] : [getTransformFloat("scaleX"), getTransformFloat("scaleY")], 16294 /* Note: SVG's rotate transform takes three values: rotation degrees followed by the X and Y values 16295 defining the rotation's origin point. We ignore the origin values (default them to 0). */ 16296 rotate: [getTransformFloat("rotateZ"), 0, 0] 16297 }; 16298 16299 /* Iterate through the transform properties in the user-defined property map order. 16300 (This mimics the behavior of non-SVG transform animation.) */ 16301 $.each(Data(element).transformCache, function(transformName) { 16302 /* Except for with skewX/Y, revert the axis-specific transform subproperties to their axis-free master 16303 properties so that they match up with SVG's accepted transform properties. */ 16304 if (/^translate/i.test(transformName)) { 16305 transformName = "translate"; 16306 } else if (/^scale/i.test(transformName)) { 16307 transformName = "scale"; 16308 } else if (/^rotate/i.test(transformName)) { 16309 transformName = "rotate"; 16310 } 16311 16312 /* Check that we haven't yet deleted the property from the SVGTransforms container. */ 16313 if (SVGTransforms[transformName]) { 16314 /* Append the transform property in the SVG-supported transform format. As per the spec, surround the space-delimited values in parentheses. */ 16315 transformString += transformName + "(" + SVGTransforms[transformName].join(" ") + ")" + " "; 16316 16317 /* After processing an SVG transform property, delete it from the SVGTransforms container so we don't 16318 re-insert the same master property if we encounter another one of its axis-specific properties. */ 16319 delete SVGTransforms[transformName]; 16320 } 16321 }); 16322 } else { 16323 var transformValue, 16324 perspective; 16325 16326 /* Transform properties are stored as members of the transformCache object. Concatenate all the members into a string. */ 16327 $.each(Data(element).transformCache, function(transformName) { 16328 transformValue = Data(element).transformCache[transformName]; 16329 16330 /* Transform's perspective subproperty must be set first in order to take effect. Store it temporarily. */ 16331 if (transformName === "transformPerspective") { 16332 perspective = transformValue; 16333 return true; 16334 } 16335 16336 /* IE9 only supports one rotation type, rotateZ, which it refers to as "rotate". */ 16337 if (IE === 9 && transformName === "rotateZ") { 16338 transformName = "rotate"; 16339 } 16340 16341 transformString += transformName + transformValue + " "; 16342 }); 16343 16344 /* If present, set the perspective subproperty first. */ 16345 if (perspective) { 16346 transformString = "perspective" + perspective + " " + transformString; 16347 } 16348 } 16349 16350 CSS.setPropertyValue(element, "transform", transformString); 16351 } 16352 }; 16353 16354 /* Register hooks and normalizations. */ 16355 CSS.Hooks.register(); 16356 CSS.Normalizations.register(); 16357 16358 /* Allow hook setting in the same fashion as jQuery's $.css(). */ 16359 Velocity.hook = function(elements, arg2, arg3) { 16360 var value; 16361 16362 elements = sanitizeElements(elements); 16363 16364 $.each(elements, function(i, element) { 16365 /* Initialize Velocity's per-element data cache if this element hasn't previously been animated. */ 16366 if (Data(element) === undefined) { 16367 Velocity.init(element); 16368 } 16369 16370 /* Get property value. If an element set was passed in, only return the value for the first element. */ 16371 if (arg3 === undefined) { 16372 if (value === undefined) { 16373 value = CSS.getPropertyValue(element, arg2); 16374 } 16375 /* Set property value. */ 16376 } else { 16377 /* sPV returns an array of the normalized propertyName/propertyValue pair used to update the DOM. */ 16378 var adjustedSet = CSS.setPropertyValue(element, arg2, arg3); 16379 16380 /* Transform properties don't automatically set. They have to be flushed to the DOM. */ 16381 if (adjustedSet[0] === "transform") { 16382 Velocity.CSS.flushTransformCache(element); 16383 } 16384 16385 value = adjustedSet; 16386 } 16387 }); 16388 16389 return value; 16390 }; 16391 16392 /***************** 16393 Animation 16394 *****************/ 16395 16396 var animate = function() { 16397 var opts; 16398 16399 /****************** 16400 Call Chain 16401 ******************/ 16402 16403 /* Logic for determining what to return to the call stack when exiting out of Velocity. */ 16404 function getChain() { 16405 /* If we are using the utility function, attempt to return this call's promise. If no promise library was detected, 16406 default to null instead of returning the targeted elements so that utility function's return value is standardized. */ 16407 if (isUtility) { 16408 return promiseData.promise || null; 16409 /* Otherwise, if we're using $.fn, return the jQuery-/Zepto-wrapped element set. */ 16410 } else { 16411 return elementsWrapped; 16412 } 16413 } 16414 16415 /************************* 16416 Arguments Assignment 16417 *************************/ 16418 16419 /* To allow for expressive CoffeeScript code, Velocity supports an alternative syntax in which "elements" (or "e"), "properties" (or "p"), and "options" (or "o") 16420 objects are defined on a container object that's passed in as Velocity's sole argument. */ 16421 /* Note: Some browsers automatically populate arguments with a "properties" object. We detect it by checking for its default "names" property. */ 16422 var syntacticSugar = (arguments[0] && (arguments[0].p || (($.isPlainObject(arguments[0].properties) && !arguments[0].properties.names) || Type.isString(arguments[0].properties)))), 16423 /* Whether Velocity was called via the utility function (as opposed to on a jQuery/Zepto object). */ 16424 isUtility, 16425 /* When Velocity is called via the utility function ($.Velocity()/Velocity()), elements are explicitly 16426 passed in as the first parameter. Thus, argument positioning varies. We normalize them here. */ 16427 elementsWrapped, 16428 argumentIndex; 16429 16430 var elements, 16431 propertiesMap, 16432 options; 16433 16434 /* Detect jQuery/Zepto elements being animated via the $.fn method. */ 16435 if (Type.isWrapped(this)) { 16436 isUtility = false; 16437 16438 argumentIndex = 0; 16439 elements = this; 16440 elementsWrapped = this; 16441 /* Otherwise, raw elements are being animated via the utility function. */ 16442 } else { 16443 isUtility = true; 16444 16445 argumentIndex = 1; 16446 elements = syntacticSugar ? (arguments[0].elements || arguments[0].e) : arguments[0]; 16447 } 16448 16449 /*************** 16450 Promises 16451 ***************/ 16452 16453 var promiseData = { 16454 promise: null, 16455 resolver: null, 16456 rejecter: null 16457 }; 16458 16459 /* If this call was made via the utility function (which is the default method of invocation when jQuery/Zepto are not being used), and if 16460 promise support was detected, create a promise object for this call and store references to its resolver and rejecter methods. The resolve 16461 method is used when a call completes naturally or is prematurely stopped by the user. In both cases, completeCall() handles the associated 16462 call cleanup and promise resolving logic. The reject method is used when an invalid set of arguments is passed into a Velocity call. */ 16463 /* Note: Velocity employs a call-based queueing architecture, which means that stopping an animating element actually stops the full call that 16464 triggered it -- not that one element exclusively. Similarly, there is one promise per call, and all elements targeted by a Velocity call are 16465 grouped together for the purposes of resolving and rejecting a promise. */ 16466 if (isUtility && Velocity.Promise) { 16467 promiseData.promise = new Velocity.Promise(function(resolve, reject) { 16468 promiseData.resolver = resolve; 16469 promiseData.rejecter = reject; 16470 }); 16471 } 16472 16473 if (syntacticSugar) { 16474 propertiesMap = arguments[0].properties || arguments[0].p; 16475 options = arguments[0].options || arguments[0].o; 16476 } else { 16477 propertiesMap = arguments[argumentIndex]; 16478 options = arguments[argumentIndex + 1]; 16479 } 16480 16481 elements = sanitizeElements(elements); 16482 16483 if (!elements) { 16484 if (promiseData.promise) { 16485 if (!propertiesMap || !options || options.promiseRejectEmpty !== false) { 16486 promiseData.rejecter(); 16487 } else { 16488 promiseData.resolver(); 16489 } 16490 } 16491 return; 16492 } 16493 16494 /* The length of the element set (in the form of a nodeList or an array of elements) is defaulted to 1 in case a 16495 single raw DOM element is passed in (which doesn't contain a length property). */ 16496 var elementsLength = elements.length, 16497 elementsIndex = 0; 16498 16499 /*************************** 16500 Argument Overloading 16501 ***************************/ 16502 16503 /* Support is included for jQuery's argument overloading: $.animate(propertyMap [, duration] [, easing] [, complete]). 16504 Overloading is detected by checking for the absence of an object being passed into options. */ 16505 /* Note: The stop and finish actions do not accept animation options, and are therefore excluded from this check. */ 16506 if (!/^(stop|finish|finishAll)$/i.test(propertiesMap) && !$.isPlainObject(options)) { 16507 /* The utility function shifts all arguments one position to the right, so we adjust for that offset. */ 16508 var startingArgumentPosition = argumentIndex + 1; 16509 16510 options = {}; 16511 16512 /* Iterate through all options arguments */ 16513 for (var i = startingArgumentPosition; i < arguments.length; i++) { 16514 /* Treat a number as a duration. Parse it out. */ 16515 /* Note: The following RegEx will return true if passed an array with a number as its first item. 16516 Thus, arrays are skipped from this check. */ 16517 if (!Type.isArray(arguments[i]) && (/^(fast|normal|slow)$/i.test(arguments[i]) || /^\d/.test(arguments[i]))) { 16518 options.duration = arguments[i]; 16519 /* Treat strings and arrays as easings. */ 16520 } else if (Type.isString(arguments[i]) || Type.isArray(arguments[i])) { 16521 options.easing = arguments[i]; 16522 /* Treat a function as a complete callback. */ 16523 } else if (Type.isFunction(arguments[i])) { 16524 options.complete = arguments[i]; 16525 } 16526 } 16527 } 16528 16529 /********************* 16530 Action Detection 16531 *********************/ 16532 16533 /* Velocity's behavior is categorized into "actions": Elements can either be specially scrolled into view, 16534 or they can be started, stopped, or reversed. If a literal or referenced properties map is passed in as Velocity's 16535 first argument, the associated action is "start". Alternatively, "scroll", "reverse", or "stop" can be passed in instead of a properties map. */ 16536 var action; 16537 16538 switch (propertiesMap) { 16539 case "scroll": 16540 action = "scroll"; 16541 break; 16542 16543 case "reverse": 16544 action = "reverse"; 16545 break; 16546 16547 case "finish": 16548 case "finishAll": 16549 case "stop": 16550 /******************* 16551 Action: Stop 16552 *******************/ 16553 16554 /* Clear the currently-active delay on each targeted element. */ 16555 $.each(elements, function(i, element) { 16556 if (Data(element) && Data(element).delayTimer) { 16557 /* Stop the timer from triggering its cached next() function. */ 16558 clearTimeout(Data(element).delayTimer.setTimeout); 16559 16560 /* Manually call the next() function so that the subsequent queue items can progress. */ 16561 if (Data(element).delayTimer.next) { 16562 Data(element).delayTimer.next(); 16563 } 16564 16565 delete Data(element).delayTimer; 16566 } 16567 16568 /* If we want to finish everything in the queue, we have to iterate through it 16569 and call each function. This will make them active calls below, which will 16570 cause them to be applied via the duration setting. */ 16571 if (propertiesMap === "finishAll" && (options === true || Type.isString(options))) { 16572 /* Iterate through the items in the element's queue. */ 16573 $.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) { 16574 /* The queue array can contain an "inprogress" string, which we skip. */ 16575 if (Type.isFunction(item)) { 16576 item(); 16577 } 16578 }); 16579 16580 /* Clearing the $.queue() array is achieved by resetting it to []. */ 16581 $.queue(element, Type.isString(options) ? options : "", []); 16582 } 16583 }); 16584 16585 var callsToStop = []; 16586 16587 /* When the stop action is triggered, the elements' currently active call is immediately stopped. The active call might have 16588 been applied to multiple elements, in which case all of the call's elements will be stopped. When an element 16589 is stopped, the next item in its animation queue is immediately triggered. */ 16590 /* An additional argument may be passed in to clear an element's remaining queued calls. Either true (which defaults to the "fx" queue) 16591 or a custom queue string can be passed in. */ 16592 /* Note: The stop command runs prior to Velocity's Queueing phase since its behavior is intended to take effect *immediately*, 16593 regardless of the element's current queue state. */ 16594 16595 /* Iterate through every active call. */ 16596 $.each(Velocity.State.calls, function(i, activeCall) { 16597 /* Inactive calls are set to false by the logic inside completeCall(). Skip them. */ 16598 if (activeCall) { 16599 /* Iterate through the active call's targeted elements. */ 16600 $.each(activeCall[1], function(k, activeElement) { 16601 /* If true was passed in as a secondary argument, clear absolutely all calls on this element. Otherwise, only 16602 clear calls associated with the relevant queue. */ 16603 /* Call stopping logic works as follows: 16604 - options === true --> stop current default queue calls (and queue:false calls), including remaining queued ones. 16605 - options === undefined --> stop current queue:"" call and all queue:false calls. 16606 - options === false --> stop only queue:false calls. 16607 - options === "custom" --> stop current queue:"custom" call, including remaining queued ones (there is no functionality to only clear the currently-running queue:"custom" call). */ 16608 var queueName = (options === undefined) ? "" : options; 16609 16610 if (queueName !== true && (activeCall[2].queue !== queueName) && !(options === undefined && activeCall[2].queue === false)) { 16611 return true; 16612 } 16613 16614 /* Iterate through the calls targeted by the stop command. */ 16615 $.each(elements, function(l, element) { 16616 /* Check that this call was applied to the target element. */ 16617 if (element === activeElement) { 16618 /* Optionally clear the remaining queued calls. If we're doing "finishAll" this won't find anything, 16619 due to the queue-clearing above. */ 16620 if (options === true || Type.isString(options)) { 16621 /* Iterate through the items in the element's queue. */ 16622 $.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) { 16623 /* The queue array can contain an "inprogress" string, which we skip. */ 16624 if (Type.isFunction(item)) { 16625 /* Pass the item's callback a flag indicating that we want to abort from the queue call. 16626 (Specifically, the queue will resolve the call's associated promise then abort.) */ 16627 item(null, true); 16628 } 16629 }); 16630 16631 /* Clearing the $.queue() array is achieved by resetting it to []. */ 16632 $.queue(element, Type.isString(options) ? options : "", []); 16633 } 16634 16635 if (propertiesMap === "stop") { 16636 /* Since "reverse" uses cached start values (the previous call's endValues), these values must be 16637 changed to reflect the final value that the elements were actually tweened to. */ 16638 /* Note: If only queue:false animations are currently running on an element, it won't have a tweensContainer 16639 object. Also, queue:false animations can't be reversed. */ 16640 var data = Data(element); 16641 if (data && data.tweensContainer && queueName !== false) { 16642 $.each(data.tweensContainer, function(m, activeTween) { 16643 activeTween.endValue = activeTween.currentValue; 16644 }); 16645 } 16646 16647 callsToStop.push(i); 16648 } else if (propertiesMap === "finish" || propertiesMap === "finishAll") { 16649 /* To get active tweens to finish immediately, we forcefully shorten their durations to 1ms so that 16650 they finish upon the next rAf tick then proceed with normal call completion logic. */ 16651 activeCall[2].duration = 1; 16652 } 16653 } 16654 }); 16655 }); 16656 } 16657 }); 16658 16659 /* Prematurely call completeCall() on each matched active call. Pass an additional flag for "stop" to indicate 16660 that the complete callback and display:none setting should be skipped since we're completing prematurely. */ 16661 if (propertiesMap === "stop") { 16662 $.each(callsToStop, function(i, j) { 16663 completeCall(j, true); 16664 }); 16665 16666 if (promiseData.promise) { 16667 /* Immediately resolve the promise associated with this stop call since stop runs synchronously. */ 16668 promiseData.resolver(elements); 16669 } 16670 } 16671 16672 /* Since we're stopping, and not proceeding with queueing, exit out of Velocity. */ 16673 return getChain(); 16674 16675 default: 16676 /* Treat a non-empty plain object as a literal properties map. */ 16677 if ($.isPlainObject(propertiesMap) && !Type.isEmptyObject(propertiesMap)) { 16678 action = "start"; 16679 16680 /**************** 16681 Redirects 16682 ****************/ 16683 16684 /* Check if a string matches a registered redirect (see Redirects above). */ 16685 } else if (Type.isString(propertiesMap) && Velocity.Redirects[propertiesMap]) { 16686 opts = $.extend({}, options); 16687 16688 var durationOriginal = opts.duration, 16689 delayOriginal = opts.delay || 0; 16690 16691 /* If the backwards option was passed in, reverse the element set so that elements animate from the last to the first. */ 16692 if (opts.backwards === true) { 16693 elements = $.extend(true, [], elements).reverse(); 16694 } 16695 16696 /* Individually trigger the redirect for each element in the set to prevent users from having to handle iteration logic in their redirect. */ 16697 $.each(elements, function(elementIndex, element) { 16698 /* If the stagger option was passed in, successively delay each element by the stagger value (in ms). Retain the original delay value. */ 16699 if (parseFloat(opts.stagger)) { 16700 opts.delay = delayOriginal + (parseFloat(opts.stagger) * elementIndex); 16701 } else if (Type.isFunction(opts.stagger)) { 16702 opts.delay = delayOriginal + opts.stagger.call(element, elementIndex, elementsLength); 16703 } 16704 16705 /* If the drag option was passed in, successively increase/decrease (depending on the presense of opts.backwards) 16706 the duration of each element's animation, using floors to prevent producing very short durations. */ 16707 if (opts.drag) { 16708 /* Default the duration of UI pack effects (callouts and transitions) to 1000ms instead of the usual default duration of 400ms. */ 16709 opts.duration = parseFloat(durationOriginal) || (/^(callout|transition)/.test(propertiesMap) ? 1000 : DURATION_DEFAULT); 16710 16711 /* For each element, take the greater duration of: A) animation completion percentage relative to the original duration, 16712 B) 75% of the original duration, or C) a 200ms fallback (in case duration is already set to a low value). 16713 The end result is a baseline of 75% of the redirect's duration that increases/decreases as the end of the element set is approached. */ 16714 opts.duration = Math.max(opts.duration * (opts.backwards ? 1 - elementIndex / elementsLength : (elementIndex + 1) / elementsLength), opts.duration * 0.75, 200); 16715 } 16716 16717 /* Pass in the call's opts object so that the redirect can optionally extend it. It defaults to an empty object instead of null to 16718 reduce the opts checking logic required inside the redirect. */ 16719 Velocity.Redirects[propertiesMap].call(element, element, opts || {}, elementIndex, elementsLength, elements, promiseData.promise ? promiseData : undefined); 16720 }); 16721 16722 /* Since the animation logic resides within the redirect's own code, abort the remainder of this call. 16723 (The performance overhead up to this point is virtually non-existant.) */ 16724 /* Note: The jQuery call chain is kept intact by returning the complete element set. */ 16725 return getChain(); 16726 } else { 16727 var abortError = "Velocity: First argument (" + propertiesMap + ") was not a property map, a known action, or a registered redirect. Aborting."; 16728 16729 if (promiseData.promise) { 16730 promiseData.rejecter(new Error(abortError)); 16731 } else { 16732 console.log(abortError); 16733 } 16734 16735 return getChain(); 16736 } 16737 } 16738 16739 /************************** 16740 Call-Wide Variables 16741 **************************/ 16742 16743 /* A container for CSS unit conversion ratios (e.g. %, rem, and em ==> px) that is used to cache ratios across all elements 16744 being animated in a single Velocity call. Calculating unit ratios necessitates DOM querying and updating, and is therefore 16745 avoided (via caching) wherever possible. This container is call-wide instead of page-wide to avoid the risk of using stale 16746 conversion metrics across Velocity animations that are not immediately consecutively chained. */ 16747 var callUnitConversionData = { 16748 lastParent: null, 16749 lastPosition: null, 16750 lastFontSize: null, 16751 lastPercentToPxWidth: null, 16752 lastPercentToPxHeight: null, 16753 lastEmToPx: null, 16754 remToPx: null, 16755 vwToPx: null, 16756 vhToPx: null 16757 }; 16758 16759 /* A container for all the ensuing tween data and metadata associated with this call. This container gets pushed to the page-wide 16760 Velocity.State.calls array that is processed during animation ticking. */ 16761 var call = []; 16762 16763 /************************ 16764 Element Processing 16765 ************************/ 16766 16767 /* Element processing consists of three parts -- data processing that cannot go stale and data processing that *can* go stale (i.e. third-party style modifications): 16768 1) Pre-Queueing: Element-wide variables, including the element's data storage, are instantiated. Call options are prepared. If triggered, the Stop action is executed. 16769 2) Queueing: The logic that runs once this call has reached its point of execution in the element's $.queue() stack. Most logic is placed here to avoid risking it becoming stale. 16770 3) Pushing: Consolidation of the tween data followed by its push onto the global in-progress calls container. 16771 `elementArrayIndex` allows passing index of the element in the original array to value functions. 16772 If `elementsIndex` were used instead the index would be determined by the elements' per-element queue. 16773 */ 16774 function processElement(element, elementArrayIndex) { 16775 16776 /************************* 16777 Part I: Pre-Queueing 16778 *************************/ 16779 16780 /*************************** 16781 Element-Wide Variables 16782 ***************************/ 16783 16784 var /* The runtime opts object is the extension of the current call's options and Velocity's page-wide option defaults. */ 16785 opts = $.extend({}, Velocity.defaults, options), 16786 /* A container for the processed data associated with each property in the propertyMap. 16787 (Each property in the map produces its own "tween".) */ 16788 tweensContainer = {}, 16789 elementUnitConversionData; 16790 16791 /****************** 16792 Element Init 16793 ******************/ 16794 16795 if (Data(element) === undefined) { 16796 Velocity.init(element); 16797 } 16798 16799 /****************** 16800 Option: Delay 16801 ******************/ 16802 16803 /* Since queue:false doesn't respect the item's existing queue, we avoid injecting its delay here (it's set later on). */ 16804 /* Note: Velocity rolls its own delay function since jQuery doesn't have a utility alias for $.fn.delay() 16805 (and thus requires jQuery element creation, which we avoid since its overhead includes DOM querying). */ 16806 if (parseFloat(opts.delay) && opts.queue !== false) { 16807 $.queue(element, opts.queue, function(next) { 16808 /* This is a flag used to indicate to the upcoming completeCall() function that this queue entry was initiated by Velocity. See completeCall() for further details. */ 16809 Velocity.velocityQueueEntryFlag = true; 16810 16811 /* The ensuing queue item (which is assigned to the "next" argument that $.queue() automatically passes in) will be triggered after a setTimeout delay. 16812 The setTimeout is stored so that it can be subjected to clearTimeout() if this animation is prematurely stopped via Velocity's "stop" command. */ 16813 Data(element).delayTimer = { 16814 setTimeout: setTimeout(next, parseFloat(opts.delay)), 16815 next: next 16816 }; 16817 }); 16818 } 16819 16820 /********************* 16821 Option: Duration 16822 *********************/ 16823 16824 /* Support for jQuery's named durations. */ 16825 switch (opts.duration.toString().toLowerCase()) { 16826 case "fast": 16827 opts.duration = 200; 16828 break; 16829 16830 case "normal": 16831 opts.duration = DURATION_DEFAULT; 16832 break; 16833 16834 case "slow": 16835 opts.duration = 600; 16836 break; 16837 16838 default: 16839 /* Remove the potential "ms" suffix and default to 1 if the user is attempting to set a duration of 0 (in order to produce an immediate style change). */ 16840 opts.duration = parseFloat(opts.duration) || 1; 16841 } 16842 16843 /************************ 16844 Global Option: Mock 16845 ************************/ 16846 16847 if (Velocity.mock !== false) { 16848 /* In mock mode, all animations are forced to 1ms so that they occur immediately upon the next rAF tick. 16849 Alternatively, a multiplier can be passed in to time remap all delays and durations. */ 16850 if (Velocity.mock === true) { 16851 opts.duration = opts.delay = 1; 16852 } else { 16853 opts.duration *= parseFloat(Velocity.mock) || 1; 16854 opts.delay *= parseFloat(Velocity.mock) || 1; 16855 } 16856 } 16857 16858 /******************* 16859 Option: Easing 16860 *******************/ 16861 16862 opts.easing = getEasing(opts.easing, opts.duration); 16863 16864 /********************** 16865 Option: Callbacks 16866 **********************/ 16867 16868 /* Callbacks must functions. Otherwise, default to null. */ 16869 if (opts.begin && !Type.isFunction(opts.begin)) { 16870 opts.begin = null; 16871 } 16872 16873 if (opts.progress && !Type.isFunction(opts.progress)) { 16874 opts.progress = null; 16875 } 16876 16877 if (opts.complete && !Type.isFunction(opts.complete)) { 16878 opts.complete = null; 16879 } 16880 16881 /********************************* 16882 Option: Display & Visibility 16883 *********************************/ 16884 16885 /* Refer to Velocity's documentation (VelocityJS.org/#displayAndVisibility) for a description of the display and visibility options' behavior. */ 16886 /* Note: We strictly check for undefined instead of falsiness because display accepts an empty string value. */ 16887 if (opts.display !== undefined && opts.display !== null) { 16888 opts.display = opts.display.toString().toLowerCase(); 16889 16890 /* Users can pass in a special "auto" value to instruct Velocity to set the element to its default display value. */ 16891 if (opts.display === "auto") { 16892 opts.display = Velocity.CSS.Values.getDisplayType(element); 16893 } 16894 } 16895 16896 if (opts.visibility !== undefined && opts.visibility !== null) { 16897 opts.visibility = opts.visibility.toString().toLowerCase(); 16898 } 16899 16900 /********************** 16901 Option: mobileHA 16902 **********************/ 16903 16904 /* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack) 16905 on animating elements. HA is removed from the element at the completion of its animation. */ 16906 /* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */ 16907 /* Note: You can read more about the use of mobileHA in Velocity's documentation: VelocityJS.org/#mobileHA. */ 16908 opts.mobileHA = (opts.mobileHA && Velocity.State.isMobile && !Velocity.State.isGingerbread); 16909 16910 /*********************** 16911 Part II: Queueing 16912 ***********************/ 16913 16914 /* When a set of elements is targeted by a Velocity call, the set is broken up and each element has the current Velocity call individually queued onto it. 16915 In this way, each element's existing queue is respected; some elements may already be animating and accordingly should not have this current Velocity call triggered immediately. */ 16916 /* In each queue, tween data is processed for each animating property then pushed onto the call-wide calls array. When the last element in the set has had its tweens processed, 16917 the call array is pushed to Velocity.State.calls for live processing by the requestAnimationFrame tick. */ 16918 function buildQueue(next) { 16919 var data, lastTweensContainer; 16920 16921 /******************* 16922 Option: Begin 16923 *******************/ 16924 16925 /* The begin callback is fired once per call -- not once per elemenet -- and is passed the full raw DOM element set as both its context and its first argument. */ 16926 if (opts.begin && elementsIndex === 0) { 16927 /* We throw callbacks in a setTimeout so that thrown errors don't halt the execution of Velocity itself. */ 16928 try { 16929 opts.begin.call(elements, elements); 16930 } catch (error) { 16931 setTimeout(function() { 16932 throw error; 16933 }, 1); 16934 } 16935 } 16936 16937 /***************************************** 16938 Tween Data Construction (for Scroll) 16939 *****************************************/ 16940 16941 /* Note: In order to be subjected to chaining and animation options, scroll's tweening is routed through Velocity as if it were a standard CSS property animation. */ 16942 if (action === "scroll") { 16943 /* The scroll action uniquely takes an optional "offset" option -- specified in pixels -- that offsets the targeted scroll position. */ 16944 var scrollDirection = (/^x$/i.test(opts.axis) ? "Left" : "Top"), 16945 scrollOffset = parseFloat(opts.offset) || 0, 16946 scrollPositionCurrent, 16947 scrollPositionCurrentAlternate, 16948 scrollPositionEnd; 16949 16950 /* Scroll also uniquely takes an optional "container" option, which indicates the parent element that should be scrolled -- 16951 as opposed to the browser window itself. This is useful for scrolling toward an element that's inside an overflowing parent element. */ 16952 if (opts.container) { 16953 /* Ensure that either a jQuery object or a raw DOM element was passed in. */ 16954 if (Type.isWrapped(opts.container) || Type.isNode(opts.container)) { 16955 /* Extract the raw DOM element from the jQuery wrapper. */ 16956 opts.container = opts.container[0] || opts.container; 16957 /* Note: Unlike other properties in Velocity, the browser's scroll position is never cached since it so frequently changes 16958 (due to the user's natural interaction with the page). */ 16959 scrollPositionCurrent = opts.container["scroll" + scrollDirection]; /* GET */ 16960 16961 /* $.position() values are relative to the container's currently viewable area (without taking into account the container's true dimensions 16962 -- say, for example, if the container was not overflowing). Thus, the scroll end value is the sum of the child element's position *and* 16963 the scroll container's current scroll position. */ 16964 scrollPositionEnd = (scrollPositionCurrent + $(element).position()[scrollDirection.toLowerCase()]) + scrollOffset; /* GET */ 16965 /* If a value other than a jQuery object or a raw DOM element was passed in, default to null so that this option is ignored. */ 16966 } else { 16967 opts.container = null; 16968 } 16969 } else { 16970 /* If the window itself is being scrolled -- not a containing element -- perform a live scroll position lookup using 16971 the appropriate cached property names (which differ based on browser type). */ 16972 scrollPositionCurrent = Velocity.State.scrollAnchor[Velocity.State["scrollProperty" + scrollDirection]]; /* GET */ 16973 /* When scrolling the browser window, cache the alternate axis's current value since window.scrollTo() doesn't let us change only one value at a time. */ 16974 scrollPositionCurrentAlternate = Velocity.State.scrollAnchor[Velocity.State["scrollProperty" + (scrollDirection === "Left" ? "Top" : "Left")]]; /* GET */ 16975 16976 /* Unlike $.position(), $.offset() values are relative to the browser window's true dimensions -- not merely its currently viewable area -- 16977 and therefore end values do not need to be compounded onto current values. */ 16978 scrollPositionEnd = $(element).offset()[scrollDirection.toLowerCase()] + scrollOffset; /* GET */ 16979 } 16980 16981 /* Since there's only one format that scroll's associated tweensContainer can take, we create it manually. */ 16982 tweensContainer = { 16983 scroll: { 16984 rootPropertyValue: false, 16985 startValue: scrollPositionCurrent, 16986 currentValue: scrollPositionCurrent, 16987 endValue: scrollPositionEnd, 16988 unitType: "", 16989 easing: opts.easing, 16990 scrollData: { 16991 container: opts.container, 16992 direction: scrollDirection, 16993 alternateValue: scrollPositionCurrentAlternate 16994 } 16995 }, 16996 element: element 16997 }; 16998 16999 if (Velocity.debug) { 17000 console.log("tweensContainer (scroll): ", tweensContainer.scroll, element); 17001 } 17002 17003 /****************************************** 17004 Tween Data Construction (for Reverse) 17005 ******************************************/ 17006 17007 /* Reverse acts like a "start" action in that a property map is animated toward. The only difference is 17008 that the property map used for reverse is the inverse of the map used in the previous call. Thus, we manipulate 17009 the previous call to construct our new map: use the previous map's end values as our new map's start values. Copy over all other data. */ 17010 /* Note: Reverse can be directly called via the "reverse" parameter, or it can be indirectly triggered via the loop option. (Loops are composed of multiple reverses.) */ 17011 /* Note: Reverse calls do not need to be consecutively chained onto a currently-animating element in order to operate on cached values; 17012 there is no harm to reverse being called on a potentially stale data cache since reverse's behavior is simply defined 17013 as reverting to the element's values as they were prior to the previous *Velocity* call. */ 17014 } else if (action === "reverse") { 17015 data = Data(element); 17016 17017 /* Abort if there is no prior animation data to reverse to. */ 17018 if (!data) { 17019 return; 17020 } 17021 17022 if (!data.tweensContainer) { 17023 /* Dequeue the element so that this queue entry releases itself immediately, allowing subsequent queue entries to run. */ 17024 $.dequeue(element, opts.queue); 17025 17026 return; 17027 } else { 17028 /********************* 17029 Options Parsing 17030 *********************/ 17031 17032 /* If the element was hidden via the display option in the previous call, 17033 revert display to "auto" prior to reversal so that the element is visible again. */ 17034 if (data.opts.display === "none") { 17035 data.opts.display = "auto"; 17036 } 17037 17038 if (data.opts.visibility === "hidden") { 17039 data.opts.visibility = "visible"; 17040 } 17041 17042 /* If the loop option was set in the previous call, disable it so that "reverse" calls aren't recursively generated. 17043 Further, remove the previous call's callback options; typically, users do not want these to be refired. */ 17044 data.opts.loop = false; 17045 data.opts.begin = null; 17046 data.opts.complete = null; 17047 17048 /* Since we're extending an opts object that has already been extended with the defaults options object, 17049 we remove non-explicitly-defined properties that are auto-assigned values. */ 17050 if (!options.easing) { 17051 delete opts.easing; 17052 } 17053 17054 if (!options.duration) { 17055 delete opts.duration; 17056 } 17057 17058 /* The opts object used for reversal is an extension of the options object optionally passed into this 17059 reverse call plus the options used in the previous Velocity call. */ 17060 opts = $.extend({}, data.opts, opts); 17061 17062 /************************************* 17063 Tweens Container Reconstruction 17064 *************************************/ 17065 17066 /* Create a deepy copy (indicated via the true flag) of the previous call's tweensContainer. */ 17067 lastTweensContainer = $.extend(true, {}, data ? data.tweensContainer : null); 17068 17069 /* Manipulate the previous tweensContainer by replacing its end values and currentValues with its start values. */ 17070 for (var lastTween in lastTweensContainer) { 17071 /* In addition to tween data, tweensContainers contain an element property that we ignore here. */ 17072 if (lastTweensContainer.hasOwnProperty(lastTween) && lastTween !== "element") { 17073 var lastStartValue = lastTweensContainer[lastTween].startValue; 17074 17075 lastTweensContainer[lastTween].startValue = lastTweensContainer[lastTween].currentValue = lastTweensContainer[lastTween].endValue; 17076 lastTweensContainer[lastTween].endValue = lastStartValue; 17077 17078 /* Easing is the only option that embeds into the individual tween data (since it can be defined on a per-property basis). 17079 Accordingly, every property's easing value must be updated when an options object is passed in with a reverse call. 17080 The side effect of this extensibility is that all per-property easing values are forcefully reset to the new value. */ 17081 if (!Type.isEmptyObject(options)) { 17082 lastTweensContainer[lastTween].easing = opts.easing; 17083 } 17084 17085 if (Velocity.debug) { 17086 console.log("reverse tweensContainer (" + lastTween + "): " + JSON.stringify(lastTweensContainer[lastTween]), element); 17087 } 17088 } 17089 } 17090 17091 tweensContainer = lastTweensContainer; 17092 } 17093 17094 /***************************************** 17095 Tween Data Construction (for Start) 17096 *****************************************/ 17097 17098 } else if (action === "start") { 17099 17100 /************************* 17101 Value Transferring 17102 *************************/ 17103 17104 /* If this queue entry follows a previous Velocity-initiated queue entry *and* if this entry was created 17105 while the element was in the process of being animated by Velocity, then this current call is safe to use 17106 the end values from the prior call as its start values. Velocity attempts to perform this value transfer 17107 process whenever possible in order to avoid requerying the DOM. */ 17108 /* If values aren't transferred from a prior call and start values were not forcefed by the user (more on this below), 17109 then the DOM is queried for the element's current values as a last resort. */ 17110 /* Note: Conversely, animation reversal (and looping) *always* perform inter-call value transfers; they never requery the DOM. */ 17111 17112 data = Data(element); 17113 17114 /* The per-element isAnimating flag is used to indicate whether it's safe (i.e. the data isn't stale) 17115 to transfer over end values to use as start values. If it's set to true and there is a previous 17116 Velocity call to pull values from, do so. */ 17117 if (data && data.tweensContainer && data.isAnimating === true) { 17118 lastTweensContainer = data.tweensContainer; 17119 } 17120 17121 /*************************** 17122 Tween Data Calculation 17123 ***************************/ 17124 17125 /* This function parses property data and defaults endValue, easing, and startValue as appropriate. */ 17126 /* Property map values can either take the form of 1) a single value representing the end value, 17127 or 2) an array in the form of [ endValue, [, easing] [, startValue] ]. 17128 The optional third parameter is a forcefed startValue to be used instead of querying the DOM for 17129 the element's current value. Read Velocity's docmentation to learn more about forcefeeding: VelocityJS.org/#forcefeeding */ 17130 var parsePropertyValue = function(valueData, skipResolvingEasing) { 17131 var endValue, easing, startValue; 17132 17133 /* If we have a function as the main argument then resolve it first, in case it returns an array that needs to be split */ 17134 if (Type.isFunction(valueData)) { 17135 valueData = valueData.call(element, elementArrayIndex, elementsLength); 17136 } 17137 17138 /* Handle the array format, which can be structured as one of three potential overloads: 17139 A) [ endValue, easing, startValue ], B) [ endValue, easing ], or C) [ endValue, startValue ] */ 17140 if (Type.isArray(valueData)) { 17141 /* endValue is always the first item in the array. Don't bother validating endValue's value now 17142 since the ensuing property cycling logic does that. */ 17143 endValue = valueData[0]; 17144 17145 /* Two-item array format: If the second item is a number, function, or hex string, treat it as a 17146 start value since easings can only be non-hex strings or arrays. */ 17147 if ((!Type.isArray(valueData[1]) && /^[\d-]/.test(valueData[1])) || Type.isFunction(valueData[1]) || CSS.RegEx.isHex.test(valueData[1])) { 17148 startValue = valueData[1]; 17149 /* Two or three-item array: If the second item is a non-hex string or an array, treat it as an easing. */ 17150 } else if ((Type.isString(valueData[1]) && !CSS.RegEx.isHex.test(valueData[1])) || Type.isArray(valueData[1])) { 17151 easing = skipResolvingEasing ? valueData[1] : getEasing(valueData[1], opts.duration); 17152 17153 /* Don't bother validating startValue's value now since the ensuing property cycling logic inherently does that. */ 17154 if (valueData[2] !== undefined) { 17155 startValue = valueData[2]; 17156 } 17157 } 17158 /* Handle the single-value format. */ 17159 } else { 17160 endValue = valueData; 17161 } 17162 17163 /* Default to the call's easing if a per-property easing type was not defined. */ 17164 if (!skipResolvingEasing) { 17165 easing = easing || opts.easing; 17166 } 17167 17168 /* If functions were passed in as values, pass the function the current element as its context, 17169 plus the element's index and the element set's size as arguments. Then, assign the returned value. */
17170 if (Type.isFunction(endValue)) { 17171 endValue = endValue.call(element, elementArrayIndex, elementsLength); 17172 } 17173 17174 if (Type.isFunction(startValue)) { 17175 startValue = startValue.call(element, elementArrayIndex, elementsLength); 17176 } 17177 17178 /* Allow startValue to be left as undefined to indicate to the ensuing code that its value was not forcefed. */ 17179 return [endValue || 0, easing, startValue]; 17180 }; 17181 17182 /* Do a quick check of property data and return if the startValue and endValue are both 17183 functions (ie, don't split red/green/blue) */ 17184 var startAndEndFunction = function(valueData) { 17185 if (Type.isArray(valueData)) { 17186 return Type.isFunction(valueData[0]) && (valueData[1] === undefined || Type.isFunction(valueData[1])); 17187 } 17188 return false; 17189 }; 17190 17191 /* Cache RegExp as it's somewhat costly to create - but only for this iteration as it's a public value and might change */ 17192 var rxCSSListsColors; 17193 17194 /* Cycle through each property in the map, looking for shorthand color properties (e.g. "color" as opposed to "colorRed"). Inject the corresponding 17195 colorRed, colorGreen, and colorBlue RGB component tweens into the propertiesMap (which Velocity understands) and remove the shorthand property. */ 17196 $.each(propertiesMap, function(property, value) { 17197 if (!rxCSSListsColors) { 17198 rxCSSListsColors = RegExp("^" + CSS.Lists.colors.join("$|^") + "$"); 17199 } 17200 /* Find shorthand color properties that have been passed a hex string. */ 17201 /* Don't try to fix values if both startValue and endValue are a function */ 17202 /* Would be quicker to use CSS.Lists.colors.includes() if possible */ 17203 if (rxCSSListsColors.test(CSS.Names.camelCase(property)) && !startAndEndFunction(value)) { 17204 /* Parse the value data for each shorthand. */ 17205 var valueData = parsePropertyValue(value, true), 17206 endValue = valueData[0], 17207 easing = valueData[1], 17208 startValue = valueData[2]; 17209 17210 if (CSS.RegEx.isHex.test(endValue)) { 17211 /* Convert the hex strings into their RGB component arrays. */ 17212 var colorComponents = ["Red", "Green", "Blue"], 17213 endValueRGB = CSS.Values.hexToRgb(endValue), 17214 startValueRGB = startValue ? CSS.Values.hexToRgb(startValue) : undefined; 17215 17216 /* Inject the RGB component tweens into propertiesMap. */ 17217 for (var i = 0; i < colorComponents.length; i++) { 17218 var dataArray = [endValueRGB[i]]; 17219 17220 if (easing) { 17221 dataArray.push(easing); 17222 } 17223 17224 if (startValueRGB !== undefined) { 17225 dataArray.push(startValueRGB[i]); 17226 } 17227 17228 propertiesMap[CSS.Names.camelCase(property) + colorComponents[i]] = dataArray; 17229 } 17230 17231 /* Remove the intermediary shorthand property entry now that we've processed it. */ 17232 delete propertiesMap[property]; 17233 } 17234 } 17235 }); 17236 17237 /* Create a tween out of each property, and append its associated data to tweensContainer. */ 17238 for (var property in propertiesMap) { 17239 17240 if (!propertiesMap.hasOwnProperty(property)) { 17241 continue; 17242 } 17243 /************************** 17244 Start Value Sourcing 17245 **************************/ 17246 17247 /* Parse out endValue, easing, and startValue from the property's data. */ 17248 var valueData = parsePropertyValue(propertiesMap[property]), 17249 endValue = valueData[0], 17250 easing = valueData[1], 17251 startValue = valueData[2]; 17252 17253 /* Now that the original property name's format has been used for the parsePropertyValue() lookup above, 17254 we force the property to its camelCase styling to normalize it for manipulation. */ 17255 property = CSS.Names.camelCase(property); 17256 17257 /* In case this property is a hook, there are circumstances where we will intend to work on the hook's root property and not the hooked subproperty. */ 17258 var rootProperty = CSS.Hooks.getRoot(property), 17259 rootPropertyValue = false; 17260 17261 /* Other than for the dummy tween property, properties that are not supported by the browser (and do not have an associated normalization) will 17262 inherently produce no style changes when set, so they are skipped in order to decrease animation tick overhead. 17263 Property support is determined via prefixCheck(), which returns a fal
vendor: 25,571 bytes, lines 17263-17739
17263se flag when no supported is detected. */ 17264 /* Note: Since SVG elements have some of their properties directly applied as HTML attributes, 17265 there is no way to check for their explicit browser support, and so we skip skip this check for them. */ 17266 if ((!data || !data.isSVG) && rootProperty !== "tween" && CSS.Names.prefixCheck(rootProperty)[1] === false && CSS.Normalizations.registered[rootProperty] === undefined) { 17267 if (Velocity.debug) { 17268 console.log("Skipping [" + rootProperty + "] due to a lack of browser support."); 17269 } 17270 continue; 17271 } 17272 17273 /* If the display option is being set to a non-"none" (e.g. "block") and opacity (filter on IE<=8) is being 17274 animated to an endValue of non-zero, the user's intention is to fade in from invisible, thus we forcefeed opacity 17275 a startValue of 0 if its startValue hasn't already been sourced by value transferring or prior forcefeeding. */ 17276 if (((opts.display !== undefined && opts.display !== null && opts.display !== "none") || (opts.visibility !== undefined && opts.visibility !== "hidden")) && /opacity|filter/.test(property) && !startValue && endValue !== 0) { 17277 startValue = 0; 17278 } 17279 17280 /* If values have been transferred from the previous Velocity call, extract the endValue and rootPropertyValue 17281 for all of the current call's properties that were *also* animated in the previous call. */ 17282 /* Note: Value transferring can optionally be disabled by the user via the _cacheValues option. */ 17283 if (opts._cacheValues && lastTweensContainer && lastTweensContainer[property]) { 17284 if (startValue === undefined) { 17285 startValue = lastTweensContainer[property].endValue + lastTweensContainer[property].unitType; 17286 } 17287 17288 /* The previous call's rootPropertyValue is extracted from the element's data cache since that's the 17289 instance of rootPropertyValue that gets freshly updated by the tweening process, whereas the rootPropertyValue 17290 attached to the incoming lastTweensContainer is equal to the root property's value prior to any tweening. */ 17291 rootPropertyValue = data.rootPropertyValueCache[rootProperty]; 17292 /* If values were not transferred from a previous Velocity call, query the DOM as needed. */ 17293 } else { 17294 /* Handle hooked properties. */ 17295 if (CSS.Hooks.registered[property]) { 17296 if (startValue === undefined) { 17297 rootPropertyValue = CSS.getPropertyValue(element, rootProperty); /* GET */ 17298 /* Note: The following getPropertyValue() call does not actually trigger a DOM query; 17299 getPropertyValue() will extract the hook from rootPropertyValue. */ 17300 startValue = CSS.getPropertyValue(element, property, rootPropertyValue); 17301 /* If startValue is already defined via forcefeeding, do not query the DOM for the root property's value; 17302 just grab rootProperty's zero-value template from CSS.Hooks. This overwrites the element's actual 17303 root property value (if one is set), but this is acceptable since the primary reason users forcefeed is 17304 to avoid DOM queries, and thus we likewise avoid querying the DOM for the root property's value. */ 17305 } else { 17306 /* Grab this hook's zero-value template, e.g. "0px 0px 0px black". */ 17307 rootPropertyValue = CSS.Hooks.templates[rootProperty][1]; 17308 } 17309 /* Handle non-hooked properties that haven't already been defined via forcefeeding. */ 17310 } else if (startValue === undefined) { 17311 startValue = CSS.getPropertyValue(element, property); /* GET */ 17312 } 17313 } 17314 17315 /************************** 17316 Value Data Extraction 17317 **************************/ 17318 17319 var separatedValue, 17320 endValueUnitType, 17321 startValueUnitType, 17322 operator = false; 17323 17324 /* Separates a property value into its numeric value and its unit type. */ 17325 var separateValue = function(property, value) { 17326 var unitType, 17327 numericValue; 17328 17329 numericValue = (value || "0") 17330 .toString() 17331 .toLowerCase() 17332 /* Match the unit type at the end of the value. */ 17333 .replace(/[%A-z]+$/, function(match) { 17334 /* Grab the unit type. */ 17335 unitType = match; 17336 17337 /* Strip the unit type off of value. */ 17338 return ""; 17339 }); 17340 17341 /* If no unit type was supplied, assign one that is appropriate for this property (e.g. "deg" for rotateZ or "px" for width). */ 17342 if (!unitType) { 17343 unitType = CSS.Values.getUnitType(property); 17344 } 17345 17346 return [numericValue, unitType]; 17347 }; 17348 17349 /* Separate startValue. */ 17350 separatedValue = separateValue(property, startValue); 17351 startValue = separatedValue[0]; 17352 startValueUnitType = separatedValue[1]; 17353 17354 /* Separate endValue, and extract a value operator (e.g. "+=", "-=") if one exists. */ 17355 separatedValue = separateValue(property, endValue); 17356 endValue = separatedValue[0].replace(/^([+-\/*])=/, function(match, subMatch) { 17357 operator = subMatch; 17358 17359 /* Strip the operator off of the value. */ 17360 return ""; 17361 }); 17362 endValueUnitType = separatedValue[1]; 17363 17364 /* Parse float values from endValue and startValue. Default to 0 if NaN is returned. */ 17365 startValue = parseFloat(startValue) || 0; 17366 endValue = parseFloat(endValue) || 0; 17367 17368 /*************************************** 17369 Property-Specific Value Conversion 17370 ***************************************/ 17371 17372 /* Custom support for properties that don't actually accept the % unit type, but where pollyfilling is trivial and relatively foolproof. */ 17373 if (endValueUnitType === "%") { 17374 /* A %-value fontSize/lineHeight is relative to the parent's fontSize (as opposed to the parent's dimensions), 17375 which is identical to the em unit's behavior, so we piggyback off of that. */ 17376 if (/^(fontSize|lineHeight)$/.test(property)) { 17377 /* Convert % into an em decimal value. */ 17378 endValue = endValue / 100; 17379 endValueUnitType = "em"; 17380 /* For scaleX and scaleY, convert the value into its decimal format and strip off the unit type. */ 17381 } else if (/^scale/.test(property)) { 17382 endValue = endValue / 100; 17383 endValueUnitType = ""; 17384 /* For RGB components, take the defined percentage of 255 and strip off the unit type. */ 17385 } else if (/(Red|Green|Blue)$/i.test(property)) { 17386 endValue = (endValue / 100) * 255; 17387 endValueUnitType = ""; 17388 } 17389 } 17390 17391 /*************************** 17392 Unit Ratio Calculation 17393 ***************************/ 17394 17395 /* When queried, the browser returns (most) CSS property values in pixels. Therefore, if an endValue with a unit type of 17396 %, em, or rem is animated toward, startValue must be converted from pixels into the same unit type as endValue in order 17397 for value manipulation logic (increment/decrement) to proceed. Further, if the startValue was forcefed or transferred 17398 from a previous call, startValue may also not be in pixels. Unit conversion logic therefore consists of two steps: 17399 1) Calculating the ratio of %/em/rem/vh/vw relative to pixels 17400 2) Converting startValue into the same unit of measurement as endValue based on these ratios. */ 17401 /* Unit conversion ratios are calculated by inserting a sibling node next to the target node, copying over its position property, 17402 setting values with the target unit type then comparing the returned pixel value. */ 17403 /* Note: Even if only one of these unit types is being animated, all unit ratios are calculated at once since the overhead 17404 of batching the SETs and GETs together upfront outweights the potential overhead 17405 of layout thrashing caused by re-querying for uncalculated ratios for subsequently-processed properties. */ 17406 /* Todo: Shift this logic into the calls' first tick instance so that it's synced with RAF. */ 17407 var calculateUnitRatios = function() { 17408 17409 /************************ 17410 Same Ratio Checks 17411 ************************/ 17412 17413 /* The properties below are used to determine whether the element differs sufficiently from this call's 17414 previously iterated element to also differ in its unit conversion ratios. If the properties match up with those 17415 of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity, 17416 this is done to minimize DOM querying. */ 17417 var sameRatioIndicators = { 17418 myParent: element.parentNode || document.body, /* GET */ 17419 position: CSS.getPropertyValue(element, "position"), /* GET */ 17420 fontSize: CSS.getPropertyValue(element, "fontSize") /* GET */ 17421 }, 17422 /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */ 17423 samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)), 17424 /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */ 17425 sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize); 17426 17427 /* Store these ratio indicators call-wide for the next element to compare against. */ 17428 callUnitConversionData.lastParent = sameRatioIndicators.myParent; 17429 callUnitConversionData.lastPosition = sameRatioIndicators.position; 17430 callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize; 17431 17432 /*************************** 17433 Element-Specific Units 17434 ***************************/ 17435 17436 /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement 17437 of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */ 17438 var measurement = 100, 17439 unitRatios = {}; 17440 17441 if (!sameEmRatio || !samePercentRatio) { 17442 var dummy = data && data.isSVG ? document.createElementNS("http://www.w3.org/2000/svg", "rect") : document.createElement("div"); 17443 17444 Velocity.init(dummy); 17445 sameRatioIndicators.myParent.appendChild(dummy); 17446 17447 /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped. 17448 Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */ 17449 /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */ 17450 $.each(["overflow", "overflowX", "overflowY"], function(i, property) { 17451 Velocity.CSS.setPropertyValue(dummy, property, "hidden"); 17452 }); 17453 Velocity.CSS.setPropertyValue(dummy, "position", sameRatioIndicators.position); 17454 Velocity.CSS.setPropertyValue(dummy, "fontSize", sameRatioIndicators.fontSize); 17455 Velocity.CSS.setPropertyValue(dummy, "boxSizing", "content-box"); 17456 17457 /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */ 17458 $.each(["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height"], function(i, property) { 17459 Velocity.CSS.setPropertyValue(dummy, property, measurement + "%"); 17460 }); 17461 /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */ 17462 Velocity.CSS.setPropertyValue(dummy, "paddingLeft", measurement + "em"); 17463 17464 /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */ 17465 unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, "width", null, true)) || 1) / measurement; /* GET */ 17466 unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, "height", null, true)) || 1) / measurement; /* GET */ 17467 unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, "paddingLeft")) || 1) / measurement; /* GET */ 17468 17469 sameRatioIndicators.myParent.removeChild(dummy); 17470 } else { 17471 unitRatios.emToPx = callUnitConversionData.lastEmToPx; 17472 unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth; 17473 unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight; 17474 } 17475 17476 /*************************** 17477 Element-Agnostic Units 17478 ***************************/ 17479 17480 /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked 17481 once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time 17482 that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null, 17483 so we calculate it now. */ 17484 if (callUnitConversionData.remToPx === null) { 17485 /* Default to browsers' default fontSize of 16px in the case of 0. */ 17486 callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, "fontSize")) || 16; /* GET */ 17487 } 17488 17489 /* Similarly, viewport units are %-relative to the window's inner dimensions. */ 17490 if (callUnitConversionData.vwToPx === null) { 17491 callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */ 17492 callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */ 17493 } 17494 17495 unitRatios.remToPx = callUnitConversionData.remToPx; 17496 unitRatios.vwToPx = callUnitConversionData.vwToPx; 17497 unitRatios.vhToPx = callUnitConversionData.vhToPx; 17498 17499 if (Velocity.debug >= 1) { 17500 console.log("Unit ratios: " + JSON.stringify(unitRatios), element); 17501 } 17502 return unitRatios; 17503 }; 17504 17505 /******************** 17506 Unit Conversion 17507 ********************/ 17508 17509 /* The * and / operators, which are not passed in with an associated unit, inherently use startValue's unit. Skip value and unit conversion. */ 17510 if (/[\/*]/.test(operator)) { 17511 endValueUnitType = startValueUnitType; 17512 /* If startValue and endValue differ in unit type, convert startValue into the same unit type as endValue so that if endValueUnitType 17513 is a relative unit (%, em, rem), the values set during tweening will continue to be accurately relative even if the metrics they depend 17514 on are dynamically changing during the course of the animation. Conversely, if we always normalized into px and used px for setting values, the px ratio 17515 would become stale if the original unit being animated toward was relative and the underlying metrics change during the animation. */ 17516 /* Since 0 is 0 in any unit type, no conversion is necessary when startValue is 0 -- we just start at 0 with endValueUnitType. */ 17517 } else if ((startValueUnitType !== endValueUnitType) && startValue !== 0) { 17518 /* Unit conversion is also skipped when endValue is 0, but *startValueUnitType* must be used for tween values to remain accurate. */ 17519 /* Note: Skipping unit conversion here means that if endValueUnitType was originally a relative unit, the animation won't relatively 17520 match the underlying metrics if they change, but this is acceptable since we're animating toward invisibility instead of toward visibility, 17521 which remains past the point of the animation's completion. */ 17522 if (endValue === 0) { 17523 endValueUnitType = startValueUnitType; 17524 } else { 17525 /* By this point, we cannot avoid unit conversion (it's undesirable since it causes layout thrashing). 17526 If we haven't already, we trigger calculateUnitRatios(), which runs once per element per call. */ 17527 elementUnitConversionData = elementUnitConversionData || calculateUnitRatios(); 17528 17529 /* The following RegEx matches CSS properties that have their % values measured relative to the x-axis. */ 17530 /* Note: W3C spec mandates that all of margin and padding's properties (even top and bottom) are %-relative to the *width* of the parent element. */ 17531 var axis = (/margin|padding|left|right|width|text|word|letter/i.test(property) || /X$/.test(property) || property === "x") ? "x" : "y"; 17532 17533 /* In order to avoid generating n^2 bespoke conversion functions, unit conversion is a two-step process: 17534 1) Convert startValue into pixels. 2) Convert this new pixel value into endValue's unit type. */ 17535 switch (startValueUnitType) { 17536 case "%": 17537 /* Note: translateX and translateY are the only properties that are %-relative to an element's own dimensions -- not its parent's dimensions. 17538 Velocity does not include a special conversion process to account for this behavior. Therefore, animating translateX/Y from a % value 17539 to a non-% value will produce an incorrect start value. Fortunately, this sort of cross-unit conversion is rarely done by users in practice. */ 17540 startValue *= (axis === "x" ? elementUnitConversionData.percentToPxWidth : elementUnitConversionData.percentToPxHeight); 17541 break; 17542 17543 case "px": 17544 /* px acts as our midpoint in the unit conversion process; do nothing. */ 17545 break; 17546 17547 default: 17548 startValue *= elementUnitConversionData[startValueUnitType + "ToPx"]; 17549 } 17550 17551 /* Invert the px ratios to convert into to the target unit. */ 17552 switch (endValueUnitType) { 17553 case "%": 17554 startValue *= 1 / (axis === "x" ? elementUnitConversionData.percentToPxWidth : elementUnitConversionData.percentToPxHeight); 17555 break; 17556 17557 case "px": 17558 /* startValue is already in px, do nothing; we're done. */ 17559 break; 17560 17561 default: 17562 startValue *= 1 / elementUnitConversionData[endValueUnitType + "ToPx"]; 17563 } 17564 } 17565 } 17566 17567 /********************* 17568 Relative Values 17569 *********************/ 17570 17571 /* Operator logic must be performed last since it requires unit-normalized start and end values. */ 17572 /* Note: Relative *percent values* do not behave how most people think; while one would expect "+=50%" 17573 to increase the property 1.5x its current value, it in fact increases the percent units in absolute terms: 17574 50 points is added on top of the current % value. */ 17575 switch (operator) { 17576 case "+": 17577 endValue = startValue + endValue; 17578 break; 17579 17580 case "-": 17581 endValue = startValue - endValue; 17582 break; 17583 17584 case "*": 17585 endValue = startValue * endValue; 17586 break; 17587 17588 case "/": 17589 endValue = startValue / endValue; 17590 break; 17591 } 17592 17593 /************************** 17594 tweensContainer Push 17595 **************************/ 17596 17597 /* Construct the per-property tween object, and push it to the element's tweensContainer. */ 17598 tweensContainer[property] = { 17599 rootPropertyValue: rootPropertyValue, 17600 startValue: startValue, 17601 currentValue: startValue, 17602 endValue: endValue, 17603 unitType: endValueUnitType, 17604 easing: easing 17605 }; 17606 17607 if (Velocity.debug) { 17608 console.log("tweensContainer (" + property + "): " + JSON.stringify(tweensContainer[property]), element); 17609 } 17610 } 17611 17612 /* Along with its property data, store a reference to the element itself onto tweensContainer. */ 17613 tweensContainer.element = element; 17614 } 17615 17616 /***************** 17617 Call Push 17618 *****************/ 17619 17620 /* Note: tweensContainer can be empty if all of the properties in this call's property map were skipped due to not 17621 being supported by the browser. The element property is used for checking that the tweensContainer has been appended to. */ 17622 if (tweensContainer.element) { 17623 /* Apply the "velocity-animating" indicator class. */ 17624 CSS.Values.addClass(element, "velocity-animating"); 17625 17626 /* The call array houses the tweensContainers for each element being animated in the current call. */ 17627 call.push(tweensContainer); 17628 17629 data = Data(element); 17630 17631 if (data) { 17632 /* Store the tweensContainer and options if we're working on the default effects queue, so that they can be used by the reverse command. */ 17633 if (opts.queue === "") { 17634 17635 data.tweensContainer = tweensContainer; 17636 data.opts = opts; 17637 } 17638 17639 /* Switch on the element's animating flag. */ 17640 data.isAnimating = true; 17641 } 17642 17643 /* Once the final element in this call's element set has been processed, push the call array onto 17644 Velocity.State.calls for the animation tick to immediately begin processing. */ 17645 if (elementsIndex === elementsLength - 1) { 17646 /* Add the current call plus its associated metadata (the element set and the call's options) onto the global call container. 17647 Anything on this call container is subjected to tick() processing. */ 17648 Velocity.State.calls.push([call, elements, opts, null, promiseData.resolver]); 17649 17650 /* If the animation tick isn't running, start it. (Velocity shuts it off when there are no active calls to process.) */ 17651 if (Velocity.State.isTicking === false) { 17652 Velocity.State.isTicking = true; 17653 17654 /* Start the tick loop. */ 17655 tick(); 17656 } 17657 } else { 17658 elementsIndex++; 17659 } 17660 } 17661 } 17662 17663 /* When the queue option is set to false, the call skips the element's queue and fires immediately. */ 17664 if (opts.queue === false) { 17665 /* Since this buildQueue call doesn't respect the element's existing queue (which is where a delay option would have been appended), 17666 we manually inject the delay property here with an explicit setTimeout. */ 17667 if (opts.delay) { 17668 setTimeout(buildQueue, opts.delay); 17669 } else { 17670 buildQueue(); 17671 } 17672 /* Otherwise, the call undergoes element queueing as normal. */ 17673 /* Note: To interoperate with jQuery, Velocity uses jQuery's own $.queue() stack for queuing logic. */ 17674 } else { 17675 $.queue(element, opts.queue, function(next, clearQueue) { 17676 /* If the clearQueue flag was passed in by the stop command, resolve this call's promise. (Promises can only be resolved once, 17677 so it's fine if this is repeatedly triggered for each element in the associated call.) */ 17678 if (clearQueue === true) { 17679 if (promiseData.promise) { 17680 promiseData.resolver(elements); 17681 } 17682 17683 /* Do not continue with animation queueing. */ 17684 return true; 17685 } 17686 17687 /* This flag indicates to the upcoming completeCall() function that this queue entry was initiated by Velocity. 17688 See completeCall() for further details. */ 17689 Velocity.velocityQueueEntryFlag = true; 17690 17691 buildQueue(next); 17692 }); 17693 } 17694 17695 /********************* 17696 Auto-Dequeuing 17697 *********************/ 17698 17699 /* As per jQuery's $.queue() behavior, to fire the first non-custom-queue entry on an element, the element 17700 must be dequeued if its queue stack consists *solely* of the current call. (This can be determined by checking 17701 for the "inprogress" item that jQuery prepends to active queue stack arrays.) Regardless, whenever the element's 17702 queue is further appended with additional items -- including $.delay()'s or even $.animate() calls, the queue's 17703 first entry is automatically fired. This behavior contrasts that of custom queues, which never auto-fire. */ 17704 /* Note: When an element set is being subjected to a non-parallel Velocity call, the animation will not begin until 17705 each one of the elements in the set has reached the end of its individually pre-existing queue chain. */ 17706 /* Note: Unfortunately, most people don't fully grasp jQuery's powerful, yet quirky, $.queue() function. 17707 Lean more here: http://stackoverflow.com/questions/1058158/can-somebody-explain-jquery-queue-to-me */ 17708 if ((opts.queue === "" || opts.queue === "fx") && $.queue(element)[0] !== "inprogress") { 17709 $.dequeue(element); 17710 } 17711 } 17712 17713 /************************** 17714 Element Set Iteration 17715 **************************/ 17716 17717 /* If the "nodeType" property exists on the elements variable, we're animating a single element. 17718 Place it in an array so that $.each() can iterate over it. */ 17719 $.each(elements, function(i, element) { 17720 /* Ensure each element in a set has a nodeType (is a real element) to avoid throwing errors. */ 17721 if (Type.isNode(element)) { 17722 processElement(element, i); 17723 } 17724 }); 17725 17726 /****************** 17727 Option: Loop 17728 ******************/ 17729 17730 /* The loop option accepts an integer indicating how many times the element should loop between the values in the 17731 current call's properties map and the element's property values prior to this call. */ 17732 /* Note: The loop option's logic is performed here -- after element processing -- because the current call needs 17733 to undergo its queue insertion prior to the loop option generating its series of constituent "reverse" calls, 17734 which chain after the current call. Two reverse calls (two "alternations") constitute one loop. */ 17735 opts = $.extend({}, Velocity.defaults, options); 17736 opts.loop = parseInt(opts.loop, 10); 17737 var reverseCallsCount = (opts.loop * 2) - 1; 17738 17739 if (opts.loop) {
17740 /* Double the loop count to convert it into its appropriate number of "reverse" calls. 17741 Subtract 1 from the resulting value since the current call is included in the total alternation count. */ 17742 for (var x = 0; x < reverseCallsCount; x++) { 17743 /* Since the logic for the reverse action occurs inside Queueing and therefore this call's options object 17744 isn't parsed until then as well, the current call's delay option must be explicitly passed into the reverse 17745 call so that the delay logic that occurs inside *Pre-Queueing* can process it. */ 17746 var reverseOptions = { 17747 delay: opts.delay, 17748 progress: opts.progress 17749 }; 17750 17751 /* If a complete callback was passed into this call, transfer it to the loop redirect's final "reverse" call 17752 so that it's triggered when the entire redirect is complete (and not when the very first animation is complete). */ 17753 if (x === reverseCallsCount - 1) { 17754 reverseOptions.display = opts.display; 17755 reverseOptions.visibility = opts.visibility; 17756 reverseOptions.complete = opts.complete; 17757 } 17758 17759 animate(elements, "reverse", reverseOptions); 17760 } 17761 } 17762 17763 /*************** 17764 Chaining 17765 ***************/ 17766 17767 /* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */ 17768 return getChain(); 17769 }; 17770 17771 /* Turn Velocity into the animation function, extended with the pre-existing Velocity object. */ 17772 Velocity = $.extend(animate, Velocity); 17773 /* For legacy support, also expose the literal animate method. */ 17774 Velocity.animate = animate; 17775 17776 /************** 17777 Timing 17778 **************/ 17779 17780 /* Ticker function. */ 17781 var ticker = window.requestAnimationFrame || rAFShim; 17782 17783 /* Inactive browser tabs pause rAF, which results in all active animations immediately sprinting to their completion states when the tab refocuses. 17784 To get around this, we dynamically switch rAF to setTimeout (which the browser *doesn't* pause) when the tab loses focus. We skip this for mobile 17785 devices to avoid wasting battery power on inactive tabs. */ 17786 /* Note: Tab focus detection doesn't work on older versions of IE, but that's okay since they don't support rAF to begin with. */ 17787 if (!Velocity.State.isMobile && document.hidden !== undefined) { 17788 document.addEventListener("visibilitychange", function() { 17789 /* Reassign the rAF function (which the global tick() function uses) based on the tab's focus state. */ 17790 if (document.hidden) { 17791 ticker = function(callback) { 17792 /* The tick function needs a truthy first argument in order to pass its internal timestamp check. */ 17793 return setTimeout(function() { 17794 callback(true); 17795 }, 16); 17796 }; 17797 17798 /* The rAF loop has been paused by the browser, so we manually restart the tick. */ 17799 tick(); 17800 } else { 17801 ticker = window.requestAnimationFrame || rAFShim; 17802 } 17803 }); 17804 } 17805 17806 /************ 17807 Tick 17808 ************/ 17809 17810 /* Note: All calls to Velocity are pushed to the Velocity.State.calls array, which is fully iterated through upon each tick. */ 17811 function tick(timestamp) { 17812 /* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on. 17813 We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever 17814 the browser's next tick sync time occurs, which results in the first elements subjected to Velocity 17815 calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore 17816 the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated 17817 by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */ 17818 if (timestamp) { 17819 /* We normally use RAF's high resolution timestamp but as it can be significantly offset when the browser is 17820 under high stress we give the option for choppiness over allowing the browser to drop huge chunks of frames. */ 17821 var timeCurrent = Velocity.timestamp && timestamp !== true ? timestamp : (new Date()).getTime(); 17822 17823 /******************** 17824 Call Iteration 17825 ********************/ 17826 17827 var callsLength = Velocity.State.calls.length; 17828 17829 /* To speed up iterating over this array, it is compacted (falsey items -- calls that have completed -- are removed) 17830 when its length has ballooned to a point that can impact tick performance. This only becomes necessary when animation 17831 has been continuous with many elements over a long period of time; whenever all active calls are completed, completeCall() clears Velocity.State.calls. */ 17832 if (callsLength > 10000) { 17833 Velocity.State.calls = compactSparseArray(Velocity.State.calls); 17834 callsLength = Velocity.State.calls.length; 17835 } 17836 17837 /* Iterate through each active call. */ 17838 for (var i = 0; i < callsLength; i++) { 17839 /* When a Velocity call is completed, its Velocity.State.calls entry is set to false. Continue on to the next call. */ 17840 if (!Velocity.State.calls[i]) { 17841 continue; 17842 } 17843 17844 /************************ 17845 Call-Wide Variables 17846 ************************/ 17847 17848 var callContainer = Velocity.State.calls[i], 17849 call = callContainer[0], 17850 opts = callContainer[2], 17851 timeStart = callContainer[3], 17852 firstTick = !!timeStart, 17853 tweenDummyValue = null; 17854 17855 /* If timeStart is undefined, then this is the first time that this call has been processed by tick(). 17856 We assign timeStart now so that its value is as close to the real animation start time as possible. 17857 (Conversely, had timeStart been defined when this call was added to Velocity.State.calls, the delay 17858 between that time and now would cause the first few frames of the tween to be skipped since 17859 percentComplete is calculated relative to timeStart.) */ 17860 /* Further, subtract 16ms (the approximate resolution of RAF) from the current time value so that the 17861 first tick iteration isn't wasted by animating at 0% tween completion, which would produce the 17862 same style value as the element's current value. */ 17863 if (!timeStart) { 17864 timeStart = Velocity.State.calls[i][3] = timeCurrent - 16; 17865 } 17866 17867 /* The tween's completion percentage is relative to the tween's start time, not the tween's start value 17868 (which would result in unpredictable tween durations since JavaScript's timers are not particularly accurate). 17869 Accordingly, we ensure that percentComplete does not exceed 1. */ 17870 var percentComplete = Math.min((timeCurrent - timeStart) / opts.duration, 1); 17871 17872 /********************** 17873 Element Iteration 17874 **********************/ 17875 17876 /* For every call, iterate through each of the elements in its set. */ 17877 for (var j = 0, callLength = call.length; j < callLength; j++) { 17878 var tweensContainer = call[j], 17879 element = tweensContainer.element; 17880 17881 /* Check to see if this element has been deleted midway through the animation by checking for the 17882 continued existence of its data cache. If it's gone, skip animating this element. */ 17883 if (!Data(element)) { 17884 continue; 17885 } 17886 17887 var transformPropertyExists = false;
vendor: 14,767 bytes, lines 17888-18228
17888 17889 /********************************** 17890 Display & Visibility Toggling 17891 **********************************/ 17892 17893 /* If the display option is set to non-"none", set it upfront so that the element can become visible before tweening begins. 17894 (Otherwise, display's "none" value is set in completeCall() once the animation has completed.) */ 17895 if (opts.display !== undefined && opts.display !== null && opts.display !== "none") { 17896 if (opts.display === "flex") { 17897 var flexValues = ["-webkit-box", "-moz-box", "-ms-flexbox", "-webkit-flex"]; 17898 17899 $.each(flexValues, function(i, flexValue) { 17900 CSS.setPropertyValue(element, "display", flexValue); 17901 }); 17902 } 17903 17904 CSS.setPropertyValue(element, "display", opts.display); 17905 } 17906 17907 /* Same goes with the visibility option, but its "none" equivalent is "hidden". */ 17908 if (opts.visibility !== undefined && opts.visibility !== "hidden") { 17909 CSS.setPropertyValue(element, "visibility", opts.visibility); 17910 } 17911 17912 /************************ 17913 Property Iteration 17914 ************************/ 17915 17916 /* For every element, iterate through each property. */ 17917 for (var property in tweensContainer) { 17918 /* Note: In addition to property tween data, tweensContainer contains a reference to its associated element. */ 17919 if (tweensContainer.hasOwnProperty(property) && property !== "element") { 17920 var tween = tweensContainer[property], 17921 currentValue, 17922 /* Easing can either be a pre-genereated function or a string that references a pre-registered easing 17923 on the Velocity.Easings object. In either case, return the appropriate easing *function*. */ 17924 easing = Type.isString(tween.easing) ? Velocity.Easings[tween.easing] : tween.easing; 17925 17926 /****************************** 17927 Current Value Calculation 17928 ******************************/ 17929 17930 /* If this is the last tick pass (if we've reached 100% completion for this tween), 17931 ensure that currentValue is explicitly set to its target endValue so that it's not subjected to any rounding. */ 17932 if (percentComplete === 1) { 17933 currentValue = tween.endValue; 17934 /* Otherwise, calculate currentValue based on the current delta from startValue. */ 17935 } else { 17936 var tweenDelta = tween.endValue - tween.startValue; 17937 currentValue = tween.startValue + (tweenDelta * easing(percentComplete, opts, tweenDelta)); 17938 17939 /* If no value change is occurring, don't proceed with DOM updating. */ 17940 if (!firstTick && (currentValue === tween.currentValue)) { 17941 continue; 17942 } 17943 } 17944 17945 tween.currentValue = currentValue; 17946 17947 /* If we're tweening a fake 'tween' property in order to log transition values, update the one-per-call variable so that 17948 it can be passed into the progress callback. */ 17949 if (property === "tween") { 17950 tweenDummyValue = currentValue; 17951 } else { 17952 /****************** 17953 Hooks: Part I 17954 ******************/ 17955 var hookRoot; 17956 17957 /* For hooked properties, the newly-updated rootPropertyValueCache is cached onto the element so that it can be used 17958 for subsequent hooks in this call that are associated with the same root property. If we didn't cache the updated 17959 rootPropertyValue, each subsequent update to the root property in this tick pass would reset the previous hook's 17960 updates to rootPropertyValue prior to injection. A nice performance byproduct of rootPropertyValue caching is that 17961 subsequently chained animations using the same hookRoot but a different hook can use this cached rootPropertyValue. */ 17962 if (CSS.Hooks.registered[property]) { 17963 hookRoot = CSS.Hooks.getRoot(property); 17964 17965 var rootPropertyValueCache = Data(element).rootPropertyValueCache[hookRoot]; 17966 17967 if (rootPropertyValueCache) { 17968 tween.rootPropertyValue = rootPropertyValueCache; 17969 } 17970 } 17971 17972 /***************** 17973 DOM Update 17974 *****************/ 17975 17976 /* setPropertyValue() returns an array of the property name and property value post any normalization that may have been performed. */ 17977 /* Note: To solve an IE<=8 positioning bug, the unit type is dropped when setting a property value of 0. */ 17978 var adjustedSetData = CSS.setPropertyValue(element, /* SET */ 17979 property, 17980 tween.currentValue + (parseFloat(currentValue) === 0 ? "" : tween.unitType), 17981 tween.rootPropertyValue, 17982 tween.scrollData); 17983 17984 /******************* 17985 Hooks: Part II 17986 *******************/ 17987 17988 /* Now that we have the hook's updated rootPropertyValue (the post-processed value provided by adjustedSetData), cache it onto the element. */ 17989 if (CSS.Hooks.registered[property]) { 17990 /* Since adjustedSetData contains normalized data ready for DOM updating, the rootPropertyValue needs to be re-extracted from its normalized form. ?? */ 17991 if (CSS.Normalizations.registered[hookRoot]) { 17992 Data(element).rootPropertyValueCache[hookRoot] = CSS.Normalizations.registered[hookRoot]("extract", null, adjustedSetData[1]); 17993 } else { 17994 Data(element).rootPropertyValueCache[hookRoot] = adjustedSetData[1]; 17995 } 17996 } 17997 17998 /*************** 17999 Transforms 18000 ***************/ 18001 18002 /* Flag whether a transform property is being animated so that flushTransformCache() can be triggered once this tick pass is complete. */ 18003 if (adjustedSetData[0] === "transform") { 18004 transformPropertyExists = true; 18005 } 18006 18007 } 18008 } 18009 } 18010 18011 /**************** 18012 mobileHA 18013 ****************/ 18014 18015 /* If mobileHA is enabled, set the translate3d transform to null to force hardware acceleration. 18016 It's safe to override this property since Velocity doesn't actually support its animation (hooks are used in its place). */ 18017 if (opts.mobileHA) { 18018 /* Don't set the null transform hack if we've already done so. */ 18019 if (Data(element).transformCache.translate3d === undefined) { 18020 /* All entries on the transformCache object are later concatenated into a single transform string via flushTransformCache(). */ 18021 Data(element).transformCache.translate3d = "(0px, 0px, 0px)"; 18022 18023 transformPropertyExists = true; 18024 } 18025 } 18026 18027 if (transformPropertyExists) { 18028 CSS.flushTransformCache(element); 18029 } 18030 } 18031 18032 /* The non-"none" display value is only applied to an element once -- when its associated call is first ticked through. 18033 Accordingly, it's set to false so that it isn't re-processed by this call in the next tick. */ 18034 if (opts.display !== undefined && opts.display !== "none") { 18035 Velocity.State.calls[i][2].display = false; 18036 } 18037 if (opts.visibility !== undefined && opts.visibility !== "hidden") { 18038 Velocity.State.calls[i][2].visibility = false; 18039 } 18040 18041 /* Pass the elements and the timing data (percentComplete, msRemaining, timeStart, tweenDummyValue) into the progress callback. */ 18042 if (opts.progress) { 18043 opts.progress.call(callContainer[1], 18044 callContainer[1], 18045 percentComplete, 18046 Math.max(0, (timeStart + opts.duration) - timeCurrent), 18047 timeStart, 18048 tweenDummyValue); 18049 } 18050 18051 /* If this call has finished tweening, pass its index to completeCall() to handle call cleanup. */ 18052 if (percentComplete === 1) { 18053 completeCall(i); 18054 } 18055 } 18056 } 18057 18058 /* Note: completeCall() sets the isTicking flag to false when the last call on Velocity.State.calls has completed. */ 18059 if (Velocity.State.isTicking) { 18060 ticker(tick); 18061 } 18062 } 18063 18064 /********************** 18065 Call Completion 18066 **********************/ 18067 18068 /* Note: Unlike tick(), which processes all active calls at once, call completion is handled on a per-call basis. */ 18069 function completeCall(callIndex, isStopped) { 18070 /* Ensure the call exists. */ 18071 if (!Velocity.State.calls[callIndex]) { 18072 return false; 18073 } 18074 18075 /* Pull the metadata from the call. */ 18076 var call = Velocity.State.calls[callIndex][0], 18077 elements = Velocity.State.calls[callIndex][1], 18078 opts = Velocity.State.calls[callIndex][2], 18079 resolver = Velocity.State.calls[callIndex][4]; 18080 18081 var remainingCallsExist = false; 18082 18083 /************************* 18084 Element Finalization 18085 *************************/ 18086 18087 for (var i = 0, callLength = call.length; i < callLength; i++) { 18088 var element = call[i].element; 18089 18090 /* If the user set display to "none" (intending to hide the element), set it now that the animation has completed. */ 18091 /* Note: display:none isn't set when calls are manually stopped (via Velocity("stop"). */ 18092 /* Note: Display gets ignored with "reverse" calls and infinite loops, since this behavior would be undesirable. */ 18093 if (!isStopped && !opts.loop) { 18094 if (opts.display === "none") { 18095 CSS.setPropertyValue(element, "display", opts.display); 18096 } 18097 18098 if (opts.visibility === "hidden") { 18099 CSS.setPropertyValue(element, "visibility", opts.visibility); 18100 } 18101 } 18102 18103 /* If the element's queue is empty (if only the "inprogress" item is left at position 0) or if its queue is about to run 18104 a non-Velocity-initiated entry, turn off the isAnimating flag. A non-Velocity-initiatied queue entry's logic might alter 18105 an element's CSS values and thereby cause Velocity's cached value data to go stale. To detect if a queue entry was initiated by Velocity, 18106 we check for the existence of our special Velocity.queueEntryFlag declaration, which minifiers won't rename since the flag 18107 is assigned to jQuery's global $ object and thus exists out of Velocity's own scope. */ 18108 var data = Data(element); 18109 18110 if (opts.loop !== true && ($.queue(element)[1] === undefined || !/\.velocityQueueEntryFlag/i.test($.queue(element)[1]))) { 18111 /* The element may have been deleted. Ensure that its data cache still exists before acting on it. */ 18112 if (data) { 18113 data.isAnimating = false; 18114 /* Clear the element's rootPropertyValueCache, which will become stale. */ 18115 data.rootPropertyValueCache = {}; 18116 18117 var transformHAPropertyExists = false; 18118 /* If any 3D transform subproperty is at its default value (regardless of unit type), remove it. */ 18119 $.each(CSS.Lists.transforms3D, function(i, transformName) { 18120 var defaultValue = /^scale/.test(transformName) ? 1 : 0, 18121 currentValue = data.transformCache[transformName]; 18122 18123 if (data.transformCache[transformName] !== undefined && new RegExp("^\\(" + defaultValue + "[^.]").test(currentValue)) { 18124 transformHAPropertyExists = true; 18125 18126 delete data.transformCache[transformName]; 18127 } 18128 }); 18129 18130 /* Mobile devices have hardware acceleration removed at the end of the animation in order to avoid hogging the GPU's memory. */ 18131 if (opts.mobileHA) { 18132 transformHAPropertyExists = true; 18133 delete data.transformCache.translate3d; 18134 } 18135 18136 /* Flush the subproperty removals to the DOM. */ 18137 if (transformHAPropertyExists) { 18138 CSS.flushTransformCache(element); 18139 } 18140 18141 /* Remove the "velocity-animating" indicator class. */ 18142 CSS.Values.removeClass(element, "velocity-animating"); 18143 } 18144 } 18145 18146 /********************* 18147 Option: Complete 18148 *********************/ 18149 18150 /* Complete is fired once per call (not once per element) and is passed the full raw DOM element set as both its context and its first argument. */ 18151 /* Note: Callbacks aren't fired when calls are manually stopped (via Velocity("stop"). */ 18152 if (!isStopped && opts.complete && !opts.loop && (i === callLength - 1)) { 18153 /* We throw callbacks in a setTimeout so that thrown errors don't halt the execution of Velocity itself. */ 18154 try { 18155 opts.complete.call(elements, elements); 18156 } catch (error) { 18157 setTimeout(function() { 18158 throw error; 18159 }, 1); 18160 } 18161 } 18162 18163 /********************** 18164 Promise Resolving 18165 **********************/ 18166 18167 /* Note: Infinite loops don't return promises. */ 18168 if (resolver && opts.loop !== true) { 18169 resolver(elements); 18170 } 18171 18172 /**************************** 18173 Option: Loop (Infinite) 18174 ****************************/ 18175 18176 if (data && opts.loop === true && !isStopped) { 18177 /* If a rotateX/Y/Z property is being animated by 360 deg with loop:true, swap tween start/end values to enable 18178 continuous iterative rotation looping. (Otherise, the element would just rotate back and forth.) */ 18179 $.each(data.tweensContainer, function(propertyName, tweenContainer) { 18180 if (/^rotate/.test(propertyName) && ((parseFloat(tweenContainer.startValue) - parseFloat(tweenContainer.endValue)) % 360 === 0)) { 18181 var oldStartValue = tweenContainer.startValue; 18182 18183 tweenContainer.startValue = tweenContainer.endValue; 18184 tweenContainer.endValue = oldStartValue; 18185 } 18186 18187 if (/^backgroundPosition/.test(propertyName) && parseFloat(tweenContainer.endValue) === 100 && tweenContainer.unitType === "%") { 18188 tweenContainer.endValue = 0; 18189 tweenContainer.startValue = 100; 18190 } 18191 }); 18192 18193 Velocity(element, "reverse", {loop: true, delay: opts.delay}); 18194 } 18195 18196 /*************** 18197 Dequeueing 18198 ***************/ 18199 18200 /* Fire the next call in the queue so long as this call's queue wasn't set to false (to trigger a parallel animation), 18201 which would have already caused the next call to fire. Note: Even if the end of the animation queue has been reached, 18202 $.dequeue() must still be called in order to completely clear jQuery's animation queue. */ 18203 if (opts.queue !== false) { 18204 $.dequeue(element, opts.queue); 18205 } 18206 } 18207 18208 /************************ 18209 Calls Array Cleanup 18210 ************************/ 18211 18212 /* Since this call is complete, set it to false so that the rAF tick skips it. This array is later compacted via compactSparseArray(). 18213 (For performance reasons, the call is set to false instead of being deleted from the array: http://www.html5rocks.com/en/tutorials/speed/v8/) */ 18214 Velocity.State.calls[callIndex] = false; 18215 18216 /* Iterate through the calls array to determine if this was the final in-progress animation. 18217 If so, set a flag to end ticking and clear the calls array. */ 18218 for (var j = 0, callsLength = Velocity.State.calls.length; j < callsLength; j++) { 18219 if (Velocity.State.calls[j] !== false) { 18220 remainingCallsExist = true; 18221 18222 break; 18223 } 18224 } 18225 18226 if (remainingCallsExist === false) { 18227 /* tick() will detect this flag upon its next iteration and subsequently turn itself off. */ 18228 Velocity.State.isTicking = false;
18229 18230 /* Clear the calls array so that its length is reset. */ 18231 delete Velocity.State.calls; 18232 Velocity.State.calls = []; 18233 } 18234 } 18235 18236 /****************** 18237 Frameworks 18238 ******************/ 18239 18240 /* Both jQuery and Zepto allow their $.fn object to be extended to allow wrapped elements to be subjected to plugin calls. 18241 If either framework is loaded, register a "velocity" extension pointing to Velocity's core animate() method. Velocity 18242 also registers itself onto a global container (window.jQuery || window.Zepto || window) so that certain features are 18243 accessible beyond just a per-element scope. This master object contains an .animate() method, which is later assigned to $.fn 18244 (if jQuery or Zepto are present). Accordingly, Velocity can both act on wrapped DOM elements and stand alone for targeting raw DOM elements. */ 18245 global.Velocity = Velocity; 18246 18247 if (global !== window) { 18248 /* Assign the element function to Velocity's core animate() method. */ 18249 global.fn.velocity = animate; 18250 /* Assign the object function's defaults to Velocity's global defaults object. */ 18251 global.fn.velocity.defaults = Velocity.defaults; 18252 } 18253 18254 /*********************** 18255 Packaged Redirects 18256 ***********************/ 18257 18258 /* slideUp, slideDown */ 18259 $.each(["Down", "Up"], function(i, direction) { 18260 Velocity.Redirects["slide" + direction] = function(element, options, elementsIndex, elementsSize, elements, promiseData) { 18261 var opts = $.extend({}, options), 18262 begin = opts.begin, 18263 complete = opts.complete, 18264 inlineValues = {}, 18265 computedValues = {height: "", marginTop: "", marginBottom: "", paddingTop: "", paddingBottom: ""}; 18266 18267 if (opts.display === undefined) { 18268 /* Show the element before slideDown begins and hide the element after slideUp completes. */ 18269 /* Note: Inline elements cannot have dimensions animated, so they're reverted to inline-block. */ 18270 opts.display = (direction === "Down" ? (Velocity.CSS.Values.getDisplayType(element) === "inline" ? "inline-block" : "block") : "none"); 18271 } 18272 18273 opts.begin = function() { 18274 /* If the user passed in a begin callback, fire it now. */ 18275 if (elementsIndex === 0 && begin) { 18276 begin.call(elements, elements); 18277 } 18278 18279 /* Cache the elements' original vertical dimensional property values so that we can animate back to them. */ 18280 for (var property in computedValues) { 18281 if (!computedValues.hasOwnProperty(property)) { 18282 continue; 18283 } 18284 inlineValues[property] = element.style[property]; 18285 18286 /* For slideDown, use forcefeeding to animate all vertical properties from 0. For slideUp, 18287 use forcefeeding to start from computed values and animate down to 0. */ 18288 var propertyValue = CSS.getPropertyValue(element, property); 18289 computedValues[property] = (direction === "Down") ? [propertyValue, 0] : [0, propertyValue]; 18290 } 18291 18292 /* Force vertical overflow content to clip so that sliding works as expected. */ 18293 inlineValues.overflow = element.style.overflow; 18294 element.style.overflow = "hidden"; 18295 }; 18296 18297 opts.complete = function() { 18298 /* Reset element to its pre-slide inline values once its slide animation is complete. */ 18299 for (var property in inlineValues) { 18300 if (inlineValues.hasOwnProperty(property)) { 18301 element.style[property] = inlineValues[property]; 18302 } 18303 } 18304 18305 /* If the user passed in a complete callback, fire it now. */ 18306 if (elementsIndex === elementsSize - 1) { 18307 if (complete) { 18308 complete.call(elements, elements); 18309 } 18310 if (promiseData) { 18311 promiseData.resolver(elements); 18312 } 18313 } 18314 }; 18315 18316 Velocity(element, computedValues, opts); 18317 }; 18318 }); 18319 18320 /* fadeIn, fadeOut */ 18321 $.each(["In", "Out"], function(i, direction) { 18322 Velocity.Redirects["fade" + direction] = function(element, options, elementsIndex, elementsSize, elements, promiseData) { 18323 var opts = $.extend({}, options), 18324 complete = opts.complete, 18325 propertiesMap = {opacity: (direction === "In") ? 1 : 0}; 18326 18327 /* Since redirects are triggered individually for each element in the animated set, avoid repeatedly triggering 18328 callbacks by firing them only when the final element has been reached. */ 18329 if (elementsIndex !== 0) { 18330 opts.begin = null; 18331 } 18332 if (elementsIndex !== elementsSize - 1) { 18333 opts.complete = null; 18334 } else { 18335 opts.complete = function() { 18336 if (complete) { 18337 complete.call(elements, elements); 18338 } 18339 if (promiseData) { 18340 promiseData.resolver(elements); 18341 } 18342 }; 18343 } 18344 18345 /* If a display was passed in, use it. Otherwise, default to "none" for fadeOut or the element-specific default for fadeIn. */ 18346 /* Note: We allow users to pass in "null" to skip display setting altogether. */ 18347 if (opts.display === undefined) { 18348 opts.display = (direction === "In" ? "auto" : "none"); 18349 } 18350 18351 Velocity(this, propertiesMap, opts); 18352 }; 18353 }); 18354 18355 return Velocity; 18356 }((window.jQuery || window.Zepto || window), window, document); 18357})); 18358 18359/****************** 18360 Known Issues 18361 ******************/ 18362 18363/* The CSS spec mandates that the translateX/Y/Z transforms are %-relative to the element itself -- not its parent. 18364 Velocity, however, doesn't make this distinction. Thus, converting to or from the % unit with these subproperties 18365 will produce an inaccurate conversion value. The same issue exists with the cx/cy attributes of SVG circles and ellipses. */ 18366;// /var/www/www.vfb.de/httpdocs/current/static/js/masonry.js 18367/*! 18368 * Masonry PACKAGED v4.1.0 18369 * Cascading grid layout library 18370 * http://masonry.desandro.com 18371 * MIT License 18372 * by David DeSandro 18373 */ 18374 18375/** 18376 * Bridget makes jQuery widgets 18377 * v2.0.0 18378 * MIT license 18379 */ 18380 18381/* jshint browser: true, strict: true, undef: true, unused: true */ 18382 18383( function( window, factory ) { 18384 'use strict'; 18385 /* globals define: false, module: false, require: false */ 18386 18387 if ( typeof define == 'function' && define.amd ) { 18388 // AMD 18389 define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) { 18390 factory( window, jQuery ); 18391 }); 18392 } else if ( typeof module == 'object' && module.exports ) { 18393 // CommonJS 18394 module.exports = factory( 18395 window, 18396 require('jquery') 18397 ); 18398 } else { 18399 // browser global 18400 window.jQueryBridget = factory( 18401 window, 18402 window.jQuery 18403 ); 18404 } 18405 18406}( window, function factory( window, jQuery ) { 18407 'use strict'; 18408 18409// ----- utils ----- // 18410 18411 var arraySlice = Array.prototype.slice; 18412 18413// helper function for logging errors 18414// $.error breaks jQuery chaining 18415 var console = window.console; 18416 var logError = typeof console == 'undefined' ? function() {} : 18417 function( message ) { 18418 console.error( message ); 18419 }; 18420 18421// ----- jQueryBridget ----- // 18422 18423 function jQueryBridget( namespace, PluginClass, $ ) { 18424 $ = $ || jQuery || window.jQuery; 18425 if ( !$ ) { 18426 return; 18427 } 18428 18429 // add option method -> $().plugin('option', {...}) 18430 if ( !PluginClass.prototype.option ) { 18431 // option setter 18432 PluginClass.prototype.option = function( opts ) { 18433 // bail out if not an object 18434 if ( !$.isPlainObject( opts ) ){ 18435 return; 18436 } 18437 this.options = $.extend( true, this.options, opts ); 18438 }; 18439 } 18440 18441 // make jQuery plugin 18442 $.fn[ namespace ] = function( arg0 /*, arg1 */ ) { 18443 if ( typeof arg0 == 'string' ) { 18444 // method call $().plugin( 'methodName', { options } ) 18445 // shift arguments by 1 18446 var args = arraySlice.call( arguments, 1 ); 18447 return methodCall( this, arg0, args ); 18448 } 18449 // just $().plugin({ options }) 18450 plainCall( this, arg0 ); 18451 return this; 18452 }; 18453 18454 // $().plugin('methodName') 18455 function methodCall( $elems, methodName, args ) { 18456 var returnValue; 18457 var pluginMethodStr = '$().' + namespace + '("' + methodName + '")'; 18458 18459 $elems.each( function( i, elem ) { 18460 // get instance 18461 var instance = $.data( elem, namespace ); 18462 if ( !instance ) { 18463 logError( namespace + ' not initialized. Cannot call methods, i.e. ' + 18464 pluginMethodStr ); 18465 return; 18466 } 18467 18468 var method = instance[ methodName ]; 18469 if ( !method || methodName.charAt(0) == '_' ) { 18470 logError( pluginMethodStr + ' is not a valid method' ); 18471 return; 18472 } 18473 18474 // apply method, get return value 18475 var value = method.apply( instance, args ); 18476 // set return value if value is returned, use only first value 18477 returnValue = returnValue === undefined ? value : returnValue; 18478 }); 18479 18480 return returnValue !== undefined ? returnValue : $elems; 18481 } 18482 18483 function plainCall( $elems, options ) { 18484 $elems.each( function( i, elem ) { 18485 var instance = $.data( elem, namespace ); 18486 if ( instance ) { 18487 // set options & init 18488 instance.option( options ); 18489 instance._init(); 18490 } else { 18491 // initialize new instance 18492 instance = new PluginClass( elem, options ); 18493 $.data( elem, namespace, instance ); 18494 } 18495 }); 18496 } 18497 18498 updateJQuery( $ ); 18499 18500 } 18501
vendor: 41,970 bytes, lines 18502-19927
18502// ----- updateJQuery ----- // 18503 18504// set $.bridget for v1 backwards compatibility 18505 function updateJQuery( $ ) { 18506 if ( !$ || ( $ && $.bridget ) ) { 18507 return; 18508 } 18509 $.bridget = jQueryBridget; 18510 } 18511 18512 updateJQuery( jQuery || window.jQuery ); 18513 18514// ----- ----- // 18515 18516 return jQueryBridget; 18517 18518})); 18519 18520/** 18521 * EvEmitter v1.0.2 18522 * Lil' event emitter 18523 * MIT License 18524 */ 18525 18526/* jshint unused: true, undef: true, strict: true */ 18527 18528( function( global, factory ) { 18529 // universal module definition 18530 /* jshint strict: false */ /* globals define, module */ 18531 if ( typeof define == 'function' && define.amd ) { 18532 // AMD - RequireJS 18533 define( 'ev-emitter/ev-emitter',factory ); 18534 } else if ( typeof module == 'object' && module.exports ) { 18535 // CommonJS - Browserify, Webpack 18536 module.exports = factory(); 18537 } else { 18538 // Browser globals 18539 global.EvEmitter = factory(); 18540 } 18541 18542}( this, function() { 18543 18544 18545 18546 function EvEmitter() {} 18547 18548 var proto = EvEmitter.prototype; 18549 18550 proto.on = function( eventName, listener ) { 18551 if ( !eventName || !listener ) { 18552 return; 18553 } 18554 // set events hash 18555 var events = this._events = this._events || {}; 18556 // set listeners array 18557 var listeners = events[ eventName ] = events[ eventName ] || []; 18558 // only add once 18559 if ( listeners.indexOf( listener ) == -1 ) { 18560 listeners.push( listener ); 18561 } 18562 18563 return this; 18564 }; 18565 18566 proto.once = function( eventName, listener ) { 18567 if ( !eventName || !listener ) { 18568 return; 18569 } 18570 // add event 18571 this.on( eventName, listener ); 18572 // set once flag 18573 // set onceEvents hash 18574 var onceEvents = this._onceEvents = this._onceEvents || {}; 18575 // set onceListeners object 18576 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 18577 // set flag 18578 onceListeners[ listener ] = true; 18579 18580 return this; 18581 }; 18582 18583 proto.off = function( eventName, listener ) { 18584 var listeners = this._events && this._events[ eventName ]; 18585 if ( !listeners || !listeners.length ) { 18586 return; 18587 } 18588 var index = listeners.indexOf( listener ); 18589 if ( index != -1 ) { 18590 listeners.splice( index, 1 ); 18591 } 18592 18593 return this; 18594 }; 18595 18596 proto.emitEvent = function( eventName, args ) { 18597 var listeners = this._events && this._events[ eventName ]; 18598 if ( !listeners || !listeners.length ) { 18599 return; 18600 } 18601 var i = 0; 18602 var listener = listeners[i]; 18603 args = args || []; 18604 // once stuff 18605 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 18606 18607 while ( listener ) { 18608 var isOnce = onceListeners && onceListeners[ listener ]; 18609 if ( isOnce ) { 18610 // remove listener 18611 // remove before trigger to prevent recursion 18612 this.off( eventName, listener ); 18613 // unset once flag 18614 delete onceListeners[ listener ]; 18615 } 18616 // trigger listener 18617 listener.apply( this, args ); 18618 // get next listener 18619 i += isOnce ? 0 : 1; 18620 listener = listeners[i]; 18621 } 18622 18623 return this; 18624 }; 18625 18626 return EvEmitter; 18627 18628})); 18629 18630/*! 18631 * getSize v2.0.2 18632 * measure size of elements 18633 * MIT license 18634 */ 18635 18636/*jshint browser: true, strict: true, undef: true, unused: true */ 18637/*global define: false, module: false, console: false */ 18638 18639( function( window, factory ) { 18640 'use strict'; 18641 18642 if ( typeof define == 'function' && define.amd ) { 18643 // AMD 18644 define( 'get-size/get-size',[],function() { 18645 return factory(); 18646 }); 18647 } else if ( typeof module == 'object' && module.exports ) { 18648 // CommonJS 18649 module.exports = factory(); 18650 } else { 18651 // browser global 18652 window.getSize = factory(); 18653 } 18654 18655})( window, function factory() { 18656 'use strict'; 18657 18658// -------------------------- helpers -------------------------- // 18659 18660// get a number from a string, not a percentage 18661 function getStyleSize( value ) { 18662 var num = parseFloat( value ); 18663 // not a percent like '100%', and a number 18664 var isValid = value.indexOf('%') == -1 && !isNaN( num ); 18665 return isValid && num; 18666 } 18667 18668 function noop() {} 18669 18670 var logError = typeof console == 'undefined' ? noop : 18671 function( message ) { 18672 console.error( message ); 18673 }; 18674 18675// -------------------------- measurements -------------------------- // 18676 18677 var measurements = [ 18678 'paddingLeft', 18679 'paddingRight', 18680 'paddingTop', 18681 'paddingBottom', 18682 'marginLeft', 18683 'marginRight', 18684 'marginTop', 18685 'marginBottom', 18686 'borderLeftWidth', 18687 'borderRightWidth', 18688 'borderTopWidth', 18689 'borderBottomWidth' 18690 ]; 18691 18692 var measurementsLength = measurements.length; 18693 18694 function getZeroSize() { 18695 var size = { 18696 width: 0, 18697 height: 0, 18698 innerWidth: 0, 18699 innerHeight: 0, 18700 outerWidth: 0, 18701 outerHeight: 0 18702 }; 18703 for ( var i=0; i < measurementsLength; i++ ) { 18704 var measurement = measurements[i]; 18705 size[ measurement ] = 0; 18706 } 18707 return size; 18708 } 18709 18710// -------------------------- getStyle -------------------------- // 18711 18712 /** 18713 * getStyle, get style of element, check for Firefox bug 18714 * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 18715 */ 18716 function getStyle( elem ) { 18717 var style = getComputedStyle( elem ); 18718 if ( !style ) { 18719 logError( 'Style returned ' + style + 18720 '. Are you running this code in a hidden iframe on Firefox? ' + 18721 'See http://bit.ly/getsizebug1' ); 18722 } 18723 return style; 18724 } 18725 18726// -------------------------- setup -------------------------- // 18727 18728 var isSetup = false; 18729 18730 var isBoxSizeOuter; 18731 18732 /** 18733 * setup 18734 * check isBoxSizerOuter 18735 * do on first getSize() rather than on page load for Firefox bug 18736 */ 18737 function setup() { 18738 // setup once 18739 if ( isSetup ) { 18740 return; 18741 } 18742 isSetup = true; 18743 18744 // -------------------------- box sizing -------------------------- // 18745 18746 /** 18747 * WebKit measures the outer-width on style.width on border-box elems 18748 * IE & Firefox<29 measures the inner-width 18749 */ 18750 var div = document.createElement('div'); 18751 div.style.width = '200px'; 18752 div.style.padding = '1px 2px 3px 4px'; 18753 div.style.borderStyle = 'solid'; 18754 div.style.borderWidth = '1px 2px 3px 4px'; 18755 div.style.boxSizing = 'border-box'; 18756 18757 var body = document.body || document.documentElement; 18758 body.appendChild( div ); 18759 var style = getStyle( div ); 18760 18761 getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200; 18762 body.removeChild( div ); 18763 18764 } 18765 18766// -------------------------- getSize -------------------------- // 18767 18768 function getSize( elem ) { 18769 setup(); 18770 18771 // use querySeletor if elem is string 18772 if ( typeof elem == 'string' ) { 18773 elem = document.querySelector( elem ); 18774 } 18775 18776 // do not proceed on non-objects 18777 if ( !elem || typeof elem != 'object' || !elem.nodeType ) { 18778 return; 18779 } 18780 18781 var style = getStyle( elem ); 18782 18783 // if hidden, everything is 0 18784 if ( style.display == 'none' ) { 18785 return getZeroSize(); 18786 } 18787 18788 var size = {}; 18789 size.width = elem.offsetWidth; 18790 size.height = elem.offsetHeight; 18791 18792 var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; 18793 18794 // get all measurements 18795 for ( var i=0; i < measurementsLength; i++ ) { 18796 var measurement = measurements[i]; 18797 var value = style[ measurement ]; 18798 var num = parseFloat( value ); 18799 // any 'auto', 'medium' value will be 0 18800 size[ measurement ] = !isNaN( num ) ? num : 0; 18801 } 18802 18803 var paddingWidth = size.paddingLeft + size.paddingRight; 18804 var paddingHeight = size.paddingTop + size.paddingBottom; 18805 var marginWidth = size.marginLeft + size.marginRight; 18806 var marginHeight = size.marginTop + size.marginBottom; 18807 var borderWidth = size.borderLeftWidth + size.borderRightWidth; 18808 var borderHeight = size.borderTopWidth + size.borderBottomWidth; 18809 18810 var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; 18811 18812 // overwrite width and height if we can get it from style 18813 var styleWidth = getStyleSize( style.width ); 18814 if ( styleWidth !== false ) { 18815 size.width = styleWidth + 18816 // add padding and border unless it's already including it 18817 ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); 18818 } 18819 18820 var styleHeight = getStyleSize( style.height ); 18821 if ( styleHeight !== false ) { 18822 size.height = styleHeight + 18823 // add padding and border unless it's already including it 18824 ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); 18825 } 18826 18827 size.innerWidth = size.width - ( paddingWidth + borderWidth ); 18828 size.innerHeight = size.height - ( paddingHeight + borderHeight ); 18829 18830 size.outerWidth = size.width + marginWidth; 18831 size.outerHeight = size.height + marginHeight; 18832 18833 return size; 18834 } 18835 18836 return getSize; 18837 18838}); 18839 18840/** 18841 * matchesSelector v2.0.1 18842 * matchesSelector( element, '.selector' ) 18843 * MIT license 18844 */ 18845 18846/*jshint browser: true, strict: true, undef: true, unused: true */ 18847 18848( function( window, factory ) { 18849 /*global define: false, module: false */ 18850 'use strict'; 18851 // universal module definition 18852 if ( typeof define == 'function' && define.amd ) { 18853 // AMD 18854 define( 'desandro-matches-selector/matches-selector',factory ); 18855 } else if ( typeof module == 'object' && module.exports ) { 18856 // CommonJS 18857 module.exports = factory(); 18858 } else { 18859 // browser global 18860 window.matchesSelector = factory(); 18861 } 18862 18863}( window, function factory() { 18864 'use strict'; 18865 18866 var matchesMethod = ( function() { 18867 var ElemProto = Element.prototype; 18868 // check for the standard method name first 18869 if ( ElemProto.matches ) { 18870 return 'matches'; 18871 } 18872 // check un-prefixed 18873 if ( ElemProto.matchesSelector ) { 18874 return 'matchesSelector'; 18875 } 18876 // check vendor prefixes 18877 var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; 18878 18879 for ( var i=0; i < prefixes.length; i++ ) { 18880 var prefix = prefixes[i]; 18881 var method = prefix + 'MatchesSelector'; 18882 if ( ElemProto[ method ] ) { 18883 return method; 18884 } 18885 } 18886 })(); 18887 18888 return function matchesSelector( elem, selector ) { 18889 return elem[ matchesMethod ]( selector ); 18890 }; 18891 18892})); 18893 18894/** 18895 * Fizzy UI utils v2.0.1 18896 * MIT license 18897 */ 18898 18899/*jshint browser: true, undef: true, unused: true, strict: true */ 18900 18901( function( window, factory ) { 18902 // universal module definition 18903 /*jshint strict: false */ /*globals define, module, require */ 18904 18905 if ( typeof define == 'function' && define.amd ) { 18906 // AMD 18907 define( 'fizzy-ui-utils/utils',[ 18908 'desandro-matches-selector/matches-selector' 18909 ], function( matchesSelector ) { 18910 return factory( window, matchesSelector ); 18911 }); 18912 } else if ( typeof module == 'object' && module.exports ) { 18913 // CommonJS 18914 module.exports = factory( 18915 window, 18916 require('desandro-matches-selector') 18917 ); 18918 } else { 18919 // browser global 18920 window.fizzyUIUtils = factory( 18921 window, 18922 window.matchesSelector 18923 ); 18924 } 18925 18926}( window, function factory( window, matchesSelector ) { 18927 18928 18929 18930 var utils = {}; 18931 18932// ----- extend ----- // 18933 18934// extends objects 18935 utils.extend = function( a, b ) { 18936 for ( var prop in b ) { 18937 a[ prop ] = b[ prop ]; 18938 } 18939 return a; 18940 }; 18941 18942// ----- modulo ----- // 18943 18944 utils.modulo = function( num, div ) { 18945 return ( ( num % div ) + div ) % div; 18946 }; 18947 18948// ----- makeArray ----- // 18949 18950// turn element or nodeList into an array 18951 utils.makeArray = function( obj ) { 18952 var ary = []; 18953 if ( Array.isArray( obj ) ) { 18954 // use object if already an array 18955 ary = obj; 18956 } else if ( obj && typeof obj.length == 'number' ) { 18957 // convert nodeList to array 18958 for ( var i=0; i < obj.length; i++ ) { 18959 ary.push( obj[i] ); 18960 } 18961 } else { 18962 // array of single index 18963 ary.push( obj ); 18964 } 18965 return ary; 18966 }; 18967 18968// ----- removeFrom ----- // 18969 18970 utils.removeFrom = function( ary, obj ) { 18971 var index = ary.indexOf( obj ); 18972 if ( index != -1 ) { 18973 ary.splice( index, 1 ); 18974 } 18975 }; 18976 18977// ----- getParent ----- // 18978 18979 utils.getParent = function( elem, selector ) { 18980 while ( elem != document.body ) { 18981 elem = elem.parentNode; 18982 if ( matchesSelector( elem, selector ) ) { 18983 return elem; 18984 } 18985 } 18986 }; 18987 18988// ----- getQueryElement ----- // 18989 18990// use element as selector string 18991 utils.getQueryElement = function( elem ) { 18992 if ( typeof elem == 'string' ) { 18993 return document.querySelector( elem ); 18994 } 18995 return elem; 18996 }; 18997 18998// ----- handleEvent ----- // 18999 19000// enable .ontype to trigger from .addEventListener( elem, 'type' ) 19001 utils.handleEvent = function( event ) { 19002 var method = 'on' + event.type; 19003 if ( this[ method ] ) { 19004 this[ method ]( event ); 19005 } 19006 }; 19007 19008// ----- filterFindElements ----- // 19009 19010 utils.filterFindElements = function( elems, selector ) { 19011 // make array of elems 19012 elems = utils.makeArray( elems ); 19013 var ffElems = []; 19014 19015 elems.forEach( function( elem ) { 19016 // check that elem is an actual element 19017 if ( !( elem instanceof HTMLElement ) ) { 19018 return; 19019 } 19020 // add elem if no selector 19021 if ( !selector ) { 19022 ffElems.push( elem ); 19023 return; 19024 } 19025 // filter & find items if we have a selector 19026 // filter 19027 if ( matchesSelector( elem, selector ) ) { 19028 ffElems.push( elem ); 19029 } 19030 // find children 19031 var childElems = elem.querySelectorAll( selector ); 19032 // concat childElems to filterFound array 19033 for ( var i=0; i < childElems.length; i++ ) { 19034 ffElems.push( childElems[i] ); 19035 } 19036 }); 19037 19038 return ffElems; 19039 }; 19040 19041// ----- debounceMethod ----- // 19042 19043 utils.debounceMethod = function( _class, methodName, threshold ) { 19044 // original method 19045 var method = _class.prototype[ methodName ]; 19046 var timeoutName = methodName + 'Timeout'; 19047 19048 _class.prototype[ methodName ] = function() { 19049 var timeout = this[ timeoutName ]; 19050 if ( timeout ) { 19051 clearTimeout( timeout ); 19052 } 19053 var args = arguments; 19054 19055 var _this = this; 19056 this[ timeoutName ] = setTimeout( function() { 19057 method.apply( _this, args ); 19058 delete _this[ timeoutName ]; 19059 }, threshold || 100 ); 19060 }; 19061 }; 19062 19063// ----- docReady ----- // 19064 19065 utils.docReady = function( callback ) { 19066 if ( document.readyState == 'complete' ) { 19067 callback(); 19068 } else { 19069 document.addEventListener( 'DOMContentLoaded', callback ); 19070 } 19071 }; 19072 19073// ----- htmlInit ----- // 19074 19075// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ 19076 utils.toDashed = function( str ) { 19077 return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { 19078 return $1 + '-' + $2; 19079 }).toLowerCase(); 19080 }; 19081 19082 var console = window.console; 19083 /** 19084 * allow user to initialize classes via [data-namespace] or .js-namespace class 19085 * htmlInit( Widget, 'widgetName' ) 19086 * options are parsed from data-namespace-options 19087 */ 19088 utils.htmlInit = function( WidgetClass, namespace ) { 19089 utils.docReady( function() { 19090 var dashedNamespace = utils.toDashed( namespace ); 19091 var dataAttr = 'data-' + dashedNamespace; 19092 var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); 19093 var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); 19094 var elems = utils.makeArray( dataAttrElems ) 19095 .concat( utils.makeArray( jsDashElems ) ); 19096 var dataOptionsAttr = dataAttr + '-options'; 19097 var jQuery = window.jQuery; 19098 19099 elems.forEach( function( elem ) { 19100 var attr = elem.getAttribute( dataAttr ) || 19101 elem.getAttribute( dataOptionsAttr ); 19102 var options; 19103 try { 19104 options = attr && JSON.parse( attr ); 19105 } catch ( error ) { 19106 // log error, do not initialize 19107 if ( console ) { 19108 console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + 19109 ': ' + error ); 19110 } 19111 return; 19112 } 19113 // initialize 19114 var instance = new WidgetClass( elem, options ); 19115 // make available via $().data('layoutname') 19116 if ( jQuery ) { 19117 jQuery.data( elem, namespace, instance ); 19118 } 19119 }); 19120 19121 }); 19122 }; 19123 19124// ----- ----- // 19125 19126 return utils; 19127 19128})); 19129 19130/** 19131 * Outlayer Item 19132 */ 19133 19134( function( window, factory ) { 19135 // universal module definition 19136 /* jshint strict: false */ /* globals define, module, require */ 19137 if ( typeof define == 'function' && define.amd ) { 19138 // AMD - RequireJS 19139 define( 'outlayer/item',[ 19140 'ev-emitter/ev-emitter', 19141 'get-size/get-size' 19142 ], 19143 factory 19144 ); 19145 } else if ( typeof module == 'object' && module.exports ) { 19146 // CommonJS - Browserify, Webpack 19147 module.exports = factory( 19148 require('ev-emitter'), 19149 require('get-size') 19150 ); 19151 } else { 19152 // browser global 19153 window.Outlayer = {}; 19154 window.Outlayer.Item = factory( 19155 window.EvEmitter, 19156 window.getSize 19157 ); 19158 } 19159 19160}( window, function factory( EvEmitter, getSize ) { 19161 'use strict'; 19162 19163// ----- helpers ----- // 19164 19165 function isEmptyObj( obj ) { 19166 for ( var prop in obj ) { 19167 return false; 19168 } 19169 prop = null; 19170 return true; 19171 } 19172 19173// -------------------------- CSS3 support -------------------------- // 19174 19175 19176 var docElemStyle = document.documentElement.style; 19177 19178 var transitionProperty = typeof docElemStyle.transition == 'string' ? 19179 'transition' : 'WebkitTransition'; 19180 var transformProperty = typeof docElemStyle.transform == 'string' ? 19181 'transform' : 'WebkitTransform'; 19182 19183 var transitionEndEvent = { 19184 WebkitTransition: 'webkitTransitionEnd', 19185 transition: 'transitionend' 19186 }[ transitionProperty ]; 19187 19188// cache all vendor properties that could have vendor prefix 19189 var vendorProperties = { 19190 transform: transformProperty, 19191 transition: transitionProperty, 19192 transitionDuration: transitionProperty + 'Duration', 19193 transitionProperty: transitionProperty + 'Property', 19194 transitionDelay: transitionProperty + 'Delay' 19195 }; 19196 19197// -------------------------- Item -------------------------- // 19198 19199 function Item( element, layout ) { 19200 if ( !element ) { 19201 return; 19202 } 19203 19204 this.element = element; 19205 // parent layout class, i.e. Masonry, Isotope, or Packery 19206 this.layout = layout; 19207 this.position = { 19208 x: 0, 19209 y: 0 19210 }; 19211 19212 this._create(); 19213 } 19214 19215// inherit EvEmitter 19216 var proto = Item.prototype = Object.create( EvEmitter.prototype ); 19217 proto.constructor = Item; 19218 19219 proto._create = function() { 19220 // transition objects 19221 this._transn = { 19222 ingProperties: {}, 19223 clean: {}, 19224 onEnd: {} 19225 }; 19226 19227 this.css({ 19228 position: 'absolute' 19229 }); 19230 }; 19231 19232// trigger specified handler for event type 19233 proto.handleEvent = function( event ) { 19234 var method = 'on' + event.type; 19235 if ( this[ method ] ) { 19236 this[ method ]( event ); 19237 } 19238 }; 19239 19240 proto.getSize = function() { 19241 this.size = getSize( this.element ); 19242 }; 19243 19244 /** 19245 * apply CSS styles to element 19246 * @param {Object} style 19247 */ 19248 proto.css = function( style ) { 19249 var elemStyle = this.element.style; 19250 19251 for ( var prop in style ) { 19252 // use vendor property if available 19253 var supportedProp = vendorProperties[ prop ] || prop; 19254 elemStyle[ supportedProp ] = style[ prop ]; 19255 } 19256 }; 19257 19258 // measure position, and sets it 19259 proto.getPosition = function() { 19260 var style = getComputedStyle( this.element ); 19261 var isOriginLeft = this.layout._getOption('originLeft'); 19262 var isOriginTop = this.layout._getOption('originTop'); 19263 var xValue = style[ isOriginLeft ? 'left' : 'right' ]; 19264 var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; 19265 // convert percent to pixels 19266 var layoutSize = this.layout.size; 19267 var x = xValue.indexOf('%') != -1 ? 19268 ( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 ); 19269 var y = yValue.indexOf('%') != -1 ? 19270 ( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 ); 19271 19272 // clean up 'auto' or other non-integer values 19273 x = isNaN( x ) ? 0 : x; 19274 y = isNaN( y ) ? 0 : y; 19275 // remove padding from measurement 19276 x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; 19277 y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; 19278 19279 this.position.x = x; 19280 this.position.y = y; 19281 }; 19282 19283// set settled position, apply padding 19284 proto.layoutPosition = function() { 19285 var layoutSize = this.layout.size; 19286 var style = {}; 19287 var isOriginLeft = this.layout._getOption('originLeft'); 19288 var isOriginTop = this.layout._getOption('originTop'); 19289 19290 // x 19291 var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; 19292 var xProperty = isOriginLeft ? 'left' : 'right'; 19293 var xResetProperty = isOriginLeft ? 'right' : 'left'; 19294 19295 var x = this.position.x + layoutSize[ xPadding ]; 19296 // set in percentage or pixels 19297 style[ xProperty ] = this.getXValue( x ); 19298 // reset other property 19299 style[ xResetProperty ] = ''; 19300 19301 // y 19302 var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; 19303 var yProperty = isOriginTop ? 'top' : 'bottom'; 19304 var yResetProperty = isOriginTop ? 'bottom' : 'top'; 19305 19306 var y = this.position.y + layoutSize[ yPadding ]; 19307 // set in percentage or pixels 19308 style[ yProperty ] = this.getYValue( y ); 19309 // reset other property 19310 style[ yResetProperty ] = ''; 19311 19312 this.css( style ); 19313 this.emitEvent( 'layout', [ this ] ); 19314 }; 19315 19316 proto.getXValue = function( x ) { 19317 var isHorizontal = this.layout._getOption('horizontal'); 19318 return this.layout.options.percentPosition && !isHorizontal ? 19319 ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; 19320 }; 19321 19322 proto.getYValue = function( y ) { 19323 var isHorizontal = this.layout._getOption('horizontal'); 19324 return this.layout.options.percentPosition && isHorizontal ? 19325 ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; 19326 }; 19327 19328 proto._transitionTo = function( x, y ) { 19329 this.getPosition(); 19330 // get current x & y from top/left 19331 var curX = this.position.x; 19332 var curY = this.position.y; 19333 19334 var compareX = parseInt( x, 10 ); 19335 var compareY = parseInt( y, 10 ); 19336 var didNotMove = compareX === this.position.x && compareY === this.position.y; 19337 19338 // save end position 19339 this.setPosition( x, y ); 19340 19341 // if did not move and not transitioning, just go to layout 19342 if ( didNotMove && !this.isTransitioning ) { 19343 this.layoutPosition(); 19344 return; 19345 } 19346 19347 var transX = x - curX; 19348 var transY = y - curY; 19349 var transitionStyle = {}; 19350 transitionStyle.transform = this.getTranslate( transX, transY ); 19351 19352 this.transition({ 19353 to: transitionStyle, 19354 onTransitionEnd: { 19355 transform: this.layoutPosition 19356 }, 19357 isCleaning: true 19358 }); 19359 }; 19360 19361 proto.getTranslate = function( x, y ) { 19362 // flip cooridinates if origin on right or bottom 19363 var isOriginLeft = this.layout._getOption('originLeft'); 19364 var isOriginTop = this.layout._getOption('originTop'); 19365 x = isOriginLeft ? x : -x; 19366 y = isOriginTop ? y : -y; 19367 return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; 19368 }; 19369 19370// non transition + transform support 19371 proto.goTo = function( x, y ) { 19372 this.setPosition( x, y ); 19373 this.layoutPosition(); 19374 }; 19375 19376 proto.moveTo = proto._transitionTo; 19377 19378 proto.setPosition = function( x, y ) { 19379 this.position.x = parseInt( x, 10 ); 19380 this.position.y = parseInt( y, 10 ); 19381 }; 19382 19383// ----- transition ----- // 19384 19385 /** 19386 * @param {Object} style - CSS 19387 * @param {Function} onTransitionEnd 19388 */ 19389 19390// non transition, just trigger callback 19391 proto._nonTransition = function( args ) { 19392 this.css( args.to ); 19393 if ( args.isCleaning ) { 19394 this._removeStyles( args.to ); 19395 } 19396 for ( var prop in args.onTransitionEnd ) { 19397 args.onTransitionEnd[ prop ].call( this ); 19398 } 19399 }; 19400 19401 /** 19402 * proper transition 19403 * @param {Object} args - arguments 19404 * @param {Object} to - style to transition to 19405 * @param {Object} from - style to start transition from 19406 * @param {Boolean} isCleaning - removes transition styles after transition 19407 * @param {Function} onTransitionEnd - callback 19408 */ 19409 proto.transition = function( args ) { 19410 // redirect to nonTransition if no transition duration 19411 if ( !parseFloat( this.layout.options.transitionDuration ) ) { 19412 this._nonTransition( args ); 19413 return; 19414 } 19415 19416 var _transition = this._transn; 19417 // keep track of onTransitionEnd callback by css property 19418 for ( var prop in args.onTransitionEnd ) { 19419 _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; 19420 } 19421 // keep track of properties that are transitioning 19422 for ( prop in args.to ) { 19423 _transition.ingProperties[ prop ] = true; 19424 // keep track of properties to clean up when transition is done 19425 if ( args.isCleaning ) { 19426 _transition.clean[ prop ] = true; 19427 } 19428 } 19429 19430 // set from styles 19431 if ( args.from ) { 19432 this.css( args.from ); 19433 // force redraw. http://blog.alexmaccaw.com/css-transitions 19434 var h = this.element.offsetHeight; 19435 // hack for JSHint to hush about unused var 19436 h = null; 19437 } 19438 // enable transition 19439 this.enableTransition( args.to ); 19440 // set styles that are transitioning 19441 this.css( args.to ); 19442 19443 this.isTransitioning = true; 19444 19445 }; 19446 19447// dash before all cap letters, including first for 19448// WebkitTransform => -webkit-transform 19449 function toDashedAll( str ) { 19450 return str.replace( /([A-Z])/g, function( $1 ) { 19451 return '-' + $1.toLowerCase(); 19452 }); 19453 } 19454 19455 var transitionProps = 'opacity,' + toDashedAll( transformProperty ); 19456 19457 proto.enableTransition = function(/* style */) { 19458 // HACK changing transitionProperty during a transition 19459 // will cause transition to jump 19460 if ( this.isTransitioning ) { 19461 return; 19462 } 19463 19464 // make `transition: foo, bar, baz` from style object 19465 // HACK un-comment this when enableTransition can work 19466 // while a transition is happening 19467 // var transitionValues = []; 19468 // for ( var prop in style ) { 19469 // // dash-ify camelCased properties like WebkitTransition 19470 // prop = vendorProperties[ prop ] || prop; 19471 // transitionValues.push( toDashedAll( prop ) ); 19472 // } 19473 // munge number to millisecond, to match stagger 19474 var duration = this.layout.options.transitionDuration; 19475 duration = typeof duration == 'number' ? duration + 'ms' : duration; 19476 // enable transition styles 19477 this.css({ 19478 transitionProperty: transitionProps, 19479 transitionDuration: duration, 19480 transitionDelay: this.staggerDelay || 0 19481 }); 19482 // listen for transition end event 19483 this.element.addEventListener( transitionEndEvent, this, false ); 19484 }; 19485 19486// ----- events ----- // 19487 19488 proto.onwebkitTransitionEnd = function( event ) { 19489 this.ontransitionend( event ); 19490 }; 19491 19492 proto.onotransitionend = function( event ) { 19493 this.ontransitionend( event ); 19494 }; 19495 19496// properties that I munge to make my life easier 19497 var dashedVendorProperties = { 19498 '-webkit-transform': 'transform' 19499 }; 19500 19501 proto.ontransitionend = function( event ) { 19502 // disregard bubbled events from children 19503 if ( event.target !== this.element ) { 19504 return; 19505 } 19506 var _transition = this._transn; 19507 // get property name of transitioned property, convert to prefix-free 19508 var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; 19509 19510 // remove property that has completed transitioning 19511 delete _transition.ingProperties[ propertyName ]; 19512 // check if any properties are still transitioning 19513 if ( isEmptyObj( _transition.ingProperties ) ) { 19514 // all properties have completed transitioning 19515 this.disableTransition(); 19516 } 19517 // clean style 19518 if ( propertyName in _transition.clean ) { 19519 // clean up style 19520 this.element.style[ event.propertyName ] = ''; 19521 delete _transition.clean[ propertyName ]; 19522 } 19523 // trigger onTransitionEnd callback 19524 if ( propertyName in _transition.onEnd ) { 19525 var onTransitionEnd = _transition.onEnd[ propertyName ]; 19526 onTransitionEnd.call( this ); 19527 delete _transition.onEnd[ propertyName ]; 19528 } 19529 19530 this.emitEvent( 'transitionEnd', [ this ] ); 19531 }; 19532 19533 proto.disableTransition = function() { 19534 this.removeTransitionStyles(); 19535 this.element.removeEventListener( transitionEndEvent, this, false ); 19536 this.isTransitioning = false; 19537 }; 19538 19539 /** 19540 * removes style property from element 19541 * @param {Object} style 19542 **/ 19543 proto._removeStyles = function( style ) { 19544 // clean up transition styles 19545 var cleanStyle = {}; 19546 for ( var prop in style ) { 19547 cleanStyle[ prop ] = ''; 19548 } 19549 this.css( cleanStyle ); 19550 }; 19551 19552 var cleanTransitionStyle = { 19553 transitionProperty: '', 19554 transitionDuration: '', 19555 transitionDelay: '' 19556 }; 19557 19558 proto.removeTransitionStyles = function() { 19559 // remove transition 19560 this.css( cleanTransitionStyle ); 19561 }; 19562 19563// ----- stagger ----- // 19564 19565 proto.stagger = function( delay ) { 19566 delay = isNaN( delay ) ? 0 : delay; 19567 this.staggerDelay = delay + 'ms'; 19568 }; 19569 19570// ----- show/hide/remove ----- // 19571 19572// remove element from DOM 19573 proto.removeElem = function() { 19574 this.element.parentNode.removeChild( this.element ); 19575 // remove display: none 19576 this.css({ display: '' }); 19577 this.emitEvent( 'remove', [ this ] ); 19578 }; 19579 19580 proto.remove = function() { 19581 // just remove element if no transition support or no transition 19582 if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { 19583 this.removeElem(); 19584 return; 19585 } 19586 19587 // start transition 19588 this.once( 'transitionEnd', function() { 19589 this.removeElem(); 19590 }); 19591 this.hide(); 19592 }; 19593 19594 proto.reveal = function() { 19595 delete this.isHidden; 19596 // remove display: none 19597 this.css({ display: '' }); 19598 19599 var options = this.layout.options; 19600 19601 var onTransitionEnd = {}; 19602 var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); 19603 onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; 19604 19605 this.transition({ 19606 from: options.hiddenStyle, 19607 to: options.visibleStyle, 19608 isCleaning: true, 19609 onTransitionEnd: onTransitionEnd 19610 }); 19611 }; 19612 19613 proto.onRevealTransitionEnd = function() { 19614 // check if still visible 19615 // during transition, item may have been hidden 19616 if ( !this.isHidden ) { 19617 this.emitEvent('reveal'); 19618 } 19619 }; 19620 19621 /** 19622 * get style property use for hide/reveal transition end 19623 * @param {String} styleProperty - hiddenStyle/visibleStyle 19624 * @returns {String} 19625 */ 19626 proto.getHideRevealTransitionEndProperty = function( styleProperty ) { 19627 var optionStyle = this.layout.options[ styleProperty ]; 19628 // use opacity 19629 if ( optionStyle.opacity ) { 19630 return 'opacity'; 19631 } 19632 // get first property 19633 for ( var prop in optionStyle ) { 19634 return prop; 19635 } 19636 }; 19637 19638 proto.hide = function() { 19639 // set flag 19640 this.isHidden = true; 19641 // remove display: none 19642 this.css({ display: '' }); 19643 19644 var options = this.layout.options; 19645 19646 var onTransitionEnd = {}; 19647 var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); 19648 onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; 19649 19650 this.transition({ 19651 from: options.visibleStyle, 19652 to: options.hiddenStyle, 19653 // keep hidden stuff hidden 19654 isCleaning: true, 19655 onTransitionEnd: onTransitionEnd 19656 }); 19657 }; 19658 19659 proto.onHideTransitionEnd = function() { 19660 // check if still hidden 19661 // during transition, item may have been un-hidden 19662 if ( this.isHidden ) { 19663 this.css({ display: 'none' }); 19664 this.emitEvent('hide'); 19665 } 19666 }; 19667 19668 proto.destroy = function() { 19669 this.css({ 19670 position: '', 19671 left: '', 19672 right: '', 19673 top: '', 19674 bottom: '', 19675 transition: '', 19676 transform: '' 19677 }); 19678 }; 19679 19680 return Item; 19681 19682})); 19683 19684/*! 19685 * Outlayer v2.1.0 19686 * the brains and guts of a layout library 19687 * MIT license 19688 */ 19689 19690( function( window, factory ) { 19691 'use strict'; 19692 // universal module definition 19693 /* jshint strict: false */ /* globals define, module, require */ 19694 if ( typeof define == 'function' && define.amd ) { 19695 // AMD - RequireJS 19696 define( 'outlayer/outlayer',[ 19697 'ev-emitter/ev-emitter', 19698 'get-size/get-size', 19699 'fizzy-ui-utils/utils', 19700 './item' 19701 ], 19702 function( EvEmitter, getSize, utils, Item ) { 19703 return factory( window, EvEmitter, getSize, utils, Item); 19704 } 19705 ); 19706 } else if ( typeof module == 'object' && module.exports ) { 19707 // CommonJS - Browserify, Webpack 19708 module.exports = factory( 19709 window, 19710 require('ev-emitter'), 19711 require('get-size'), 19712 require('fizzy-ui-utils'), 19713 require('./item') 19714 ); 19715 } else { 19716 // browser global 19717 window.Outlayer = factory( 19718 window, 19719 window.EvEmitter, 19720 window.getSize, 19721 window.fizzyUIUtils, 19722 window.Outlayer.Item 19723 ); 19724 } 19725 19726}( window, function factory( window, EvEmitter, getSize, utils, Item ) { 19727 'use strict'; 19728 19729// ----- vars ----- // 19730 19731 var console = window.console; 19732 var jQuery = window.jQuery; 19733 var noop = function() {}; 19734 19735// -------------------------- Outlayer -------------------------- // 19736 19737// globally unique identifiers 19738 var GUID = 0; 19739// internal store of all Outlayer intances 19740 var instances = {}; 19741 19742 19743 /** 19744 * @param {Element, String} element 19745 * @param {Object} options 19746 * @constructor 19747 */ 19748 function Outlayer( element, options ) { 19749 var queryElement = utils.getQueryElement( element ); 19750 if ( !queryElement ) { 19751 if ( console ) { 19752 console.error( 'Bad element for ' + this.constructor.namespace + 19753 ': ' + ( queryElement || element ) ); 19754 } 19755 return; 19756 } 19757 this.element = queryElement; 19758 // add jQuery 19759 if ( jQuery ) { 19760 this.$element = jQuery( this.element ); 19761 } 19762 19763 // options 19764 this.options = utils.extend( {}, this.constructor.defaults ); 19765 this.option( options ); 19766 19767 // add id for Outlayer.getFromElement 19768 var id = ++GUID; 19769 this.element.outlayerGUID = id; // expando 19770 instances[ id ] = this; // associate via id 19771 19772 // kick it off 19773 this._create(); 19774 19775 var isInitLayout = this._getOption('initLayout'); 19776 if ( isInitLayout ) { 19777 this.layout(); 19778 } 19779 } 19780 19781// settings are for internal use only 19782 Outlayer.namespace = 'outlayer'; 19783 Outlayer.Item = Item; 19784 19785// default options 19786 Outlayer.defaults = { 19787 containerStyle: { 19788 position: 'relative' 19789 }, 19790 initLayout: true, 19791 originLeft: true, 19792 originTop: true, 19793 resize: true, 19794 resizeContainer: true, 19795 // item options 19796 transitionDuration: '0.4s', 19797 hiddenStyle: { 19798 opacity: 0, 19799 transform: 'scale(0.001)' 19800 }, 19801 visibleStyle: { 19802 opacity: 1, 19803 transform: 'scale(1)' 19804 } 19805 }; 19806 19807 var proto = Outlayer.prototype; 19808// inherit EvEmitter 19809 utils.extend( proto, EvEmitter.prototype ); 19810 19811 /** 19812 * set options 19813 * @param {Object} opts 19814 */ 19815 proto.option = function( opts ) { 19816 utils.extend( this.options, opts ); 19817 }; 19818 19819 /** 19820 * get backwards compatible option value, check old name 19821 */ 19822 proto._getOption = function( option ) { 19823 var oldOption = this.constructor.compatOptions[ option ]; 19824 return oldOption && this.options[ oldOption ] !== undefined ? 19825 this.options[ oldOption ] : this.options[ option ]; 19826 }; 19827 19828 Outlayer.compatOptions = { 19829 // currentName: oldName 19830 initLayout: 'isInitLayout', 19831 horizontal: 'isHorizontal', 19832 layoutInstant: 'isLayoutInstant', 19833 originLeft: 'isOriginLeft', 19834 originTop: 'isOriginTop', 19835 resize: 'isResizeBound', 19836 resizeContainer: 'isResizingContainer' 19837 }; 19838 19839 proto._create = function() { 19840 // get items from children 19841 this.reloadItems(); 19842 // elements that affect layout, but are not laid out 19843 this.stamps = []; 19844 this.stamp( this.options.stamp ); 19845 // set container style 19846 utils.extend( this.element.style, this.options.containerStyle ); 19847 19848 // bind resize method 19849 var canBindResize = this._getOption('resize'); 19850 if ( canBindResize ) { 19851 this.bindResize(); 19852 } 19853 }; 19854 19855// goes through all children again and gets bricks in proper order 19856 proto.reloadItems = function() { 19857 // collection of item elements 19858 this.items = this._itemize( this.element.children ); 19859 }; 19860 19861 19862 /** 19863 * turn elements into Outlayer.Items to be used in layout 19864 * @param {Array or NodeList or HTMLElement} elems 19865 * @returns {Array} items - collection of new Outlayer Items 19866 */ 19867 proto._itemize = function( elems ) { 19868 19869 var itemElems = this._filterFindItemElements( elems ); 19870 var Item = this.constructor.Item; 19871 19872 // create new Outlayer Items for collection 19873 var items = []; 19874 for ( var i=0; i < itemElems.length; i++ ) { 19875 var elem = itemElems[i]; 19876 var item = new Item( elem, this ); 19877 items.push( item ); 19878 } 19879 19880 return items; 19881 }; 19882 19883 /** 19884 * get item elements to be used in layout 19885 * @param {Array or NodeList or HTMLElement} elems 19886 * @returns {Array} items - item elements 19887 */ 19888 proto._filterFindItemElements = function( elems ) { 19889 return utils.filterFindElements( elems, this.options.itemSelector ); 19890 }; 19891 19892 /** 19893 * getter method for getting item elements 19894 * @returns {Array} elems - collection of item elements 19895 */ 19896 proto.getItemElements = function() { 19897 return this.items.map( function( item ) { 19898 return item.element; 19899 }); 19900 }; 19901 19902// ----- init & layout ----- // 19903 19904 /** 19905 * lays out all items 19906 */ 19907 proto.layout = function() { 19908 this._resetLayout(); 19909 this._manageStamps(); 19910 19911 // don't animate first layout 19912 var layoutInstant = this._getOption('layoutInstant'); 19913 var isInstant = layoutInstant !== undefined ? 19914 layoutInstant : !this._isLayoutInited; 19915 this.layoutItems( this.items, isInstant ); 19916 19917 // flag for initalized 19918 this._isLayoutInited = true; 19919 }; 19920 19921// _init is alias for layout 19922 proto._init = proto.layout; 19923 19924 /** 19925 * logic before any new layout 19926 */ 19927 proto._resetLayout = function() {
vendor: 15,615 bytes, lines 19928-20472
19928 this.getSize(); 19929 }; 19930 19931 19932 proto.getSize = function() { 19933 this.size = getSize( this.element ); 19934 }; 19935 19936 /** 19937 * get measurement from option, for columnWidth, rowHeight, gutter 19938 * if option is String -> get element from selector string, & get size of element 19939 * if option is Element -> get size of element 19940 * else use option as a number 19941 * 19942 * @param {String} measurement 19943 * @param {String} size - width or height 19944 * @private 19945 */ 19946 proto._getMeasurement = function( measurement, size ) { 19947 var option = this.options[ measurement ]; 19948 var elem; 19949 if ( !option ) { 19950 // default to 0 19951 this[ measurement ] = 0; 19952 } else { 19953 // use option as an element 19954 if ( typeof option == 'string' ) { 19955 elem = this.element.querySelector( option ); 19956 } else if ( option instanceof HTMLElement ) { 19957 elem = option; 19958 } 19959 // use size of element, if element 19960 this[ measurement ] = elem ? getSize( elem )[ size ] : option; 19961 } 19962 }; 19963 19964 /** 19965 * layout a collection of item elements 19966 * @api public 19967 */ 19968 proto.layoutItems = function( items, isInstant ) { 19969 items = this._getItemsForLayout( items ); 19970 19971 this._layoutItems( items, isInstant ); 19972 19973 this._postLayout(); 19974 }; 19975 19976 /** 19977 * get the items to be laid out 19978 * you may want to skip over some items 19979 * @param {Array} items 19980 * @returns {Array} items 19981 */ 19982 proto._getItemsForLayout = function( items ) { 19983 return items.filter( function( item ) { 19984 return !item.isIgnored; 19985 }); 19986 }; 19987 19988 /** 19989 * layout items 19990 * @param {Array} items 19991 * @param {Boolean} isInstant 19992 */ 19993 proto._layoutItems = function( items, isInstant ) { 19994 this._emitCompleteOnItems( 'layout', items ); 19995 19996 if ( !items || !items.length ) { 19997 // no items, emit event with empty array 19998 return; 19999 } 20000 20001 var queue = []; 20002 20003 items.forEach( function( item ) { 20004 // get x/y object from method 20005 var position = this._getItemLayoutPosition( item ); 20006 // enqueue 20007 position.item = item; 20008 position.isInstant = isInstant || item.isLayoutInstant; 20009 queue.push( position ); 20010 }, this ); 20011 20012 this._processLayoutQueue( queue ); 20013 }; 20014 20015 /** 20016 * get item layout position 20017 * @param {Outlayer.Item} item 20018 * @returns {Object} x and y position 20019 */ 20020 proto._getItemLayoutPosition = function( /* item */ ) { 20021 return { 20022 x: 0, 20023 y: 0 20024 }; 20025 }; 20026 20027 /** 20028 * iterate over array and position each item 20029 * Reason being - separating this logic prevents 'layout invalidation' 20030 * thx @paul_irish 20031 * @param {Array} queue 20032 */ 20033 proto._processLayoutQueue = function( queue ) { 20034 this.updateStagger(); 20035 queue.forEach( function( obj, i ) { 20036 this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); 20037 }, this ); 20038 }; 20039 20040// set stagger from option in milliseconds number 20041 proto.updateStagger = function() { 20042 var stagger = this.options.stagger; 20043 if ( stagger === null || stagger === undefined ) { 20044 this.stagger = 0; 20045 return; 20046 } 20047 this.stagger = getMilliseconds( stagger ); 20048 return this.stagger; 20049 }; 20050 20051 /** 20052 * Sets position of item in DOM 20053 * @param {Outlayer.Item} item 20054 * @param {Number} x - horizontal position 20055 * @param {Number} y - vertical position 20056 * @param {Boolean} isInstant - disables transitions 20057 */ 20058 proto._positionItem = function( item, x, y, isInstant, i ) { 20059 if ( isInstant ) { 20060 // if not transition, just set CSS 20061 item.goTo( x, y ); 20062 } else { 20063 item.stagger( i * this.stagger ); 20064 item.moveTo( x, y ); 20065 } 20066 }; 20067 20068 /** 20069 * Any logic you want to do after each layout, 20070 * i.e. size the container 20071 */ 20072 proto._postLayout = function() { 20073 this.resizeContainer(); 20074 }; 20075 20076 proto.resizeContainer = function() { 20077 var isResizingContainer = this._getOption('resizeContainer'); 20078 if ( !isResizingContainer ) { 20079 return; 20080 } 20081 var size = this._getContainerSize(); 20082 if ( size ) { 20083 this._setContainerMeasure( size.width, true ); 20084 this._setContainerMeasure( size.height, false ); 20085 } 20086 }; 20087 20088 /** 20089 * Sets width or height of container if returned 20090 * @returns {Object} size 20091 * @param {Number} width 20092 * @param {Number} height 20093 */ 20094 proto._getContainerSize = noop; 20095 20096 /** 20097 * @param {Number} measure - size of width or height 20098 * @param {Boolean} isWidth 20099 */ 20100 proto._setContainerMeasure = function( measure, isWidth ) { 20101 if ( measure === undefined ) { 20102 return; 20103 } 20104 20105 var elemSize = this.size; 20106 // add padding and border width if border box 20107 if ( elemSize.isBorderBox ) { 20108 measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + 20109 elemSize.borderLeftWidth + elemSize.borderRightWidth : 20110 elemSize.paddingBottom + elemSize.paddingTop + 20111 elemSize.borderTopWidth + elemSize.borderBottomWidth; 20112 } 20113 20114 measure = Math.max( measure, 0 ); 20115 this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; 20116 }; 20117 20118 /** 20119 * emit eventComplete on a collection of items events 20120 * @param {String} eventName 20121 * @param {Array} items - Outlayer.Items 20122 */ 20123 proto._emitCompleteOnItems = function( eventName, items ) { 20124 var _this = this; 20125 function onComplete() { 20126 _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); 20127 } 20128 20129 var count = items.length; 20130 if ( !items || !count ) { 20131 onComplete(); 20132 return; 20133 } 20134 20135 var doneCount = 0; 20136 function tick() { 20137 doneCount++; 20138 if ( doneCount == count ) { 20139 onComplete(); 20140 } 20141 } 20142 20143 // bind callback 20144 items.forEach( function( item ) { 20145 item.once( eventName, tick ); 20146 }); 20147 }; 20148 20149 /** 20150 * emits events via EvEmitter and jQuery events 20151 * @param {String} type - name of event 20152 * @param {Event} event - original event 20153 * @param {Array} args - extra arguments 20154 */ 20155 proto.dispatchEvent = function( type, event, args ) { 20156 // add original event to arguments 20157 var emitArgs = event ? [ event ].concat( args ) : args; 20158 this.emitEvent( type, emitArgs ); 20159 20160 if ( jQuery ) { 20161 // set this.$element 20162 this.$element = this.$element || jQuery( this.element ); 20163 if ( event ) { 20164 // create jQuery event 20165 var $event = jQuery.Event( event ); 20166 $event.type = type; 20167 this.$element.trigger( $event, args ); 20168 } else { 20169 // just trigger with type if no event available 20170 this.$element.trigger( type, args ); 20171 } 20172 } 20173 }; 20174 20175// -------------------------- ignore & stamps -------------------------- // 20176 20177 20178 /** 20179 * keep item in collection, but do not lay it out 20180 * ignored items do not get skipped in layout 20181 * @param {Element} elem 20182 */ 20183 proto.ignore = function( elem ) { 20184 var item = this.getItem( elem ); 20185 if ( item ) { 20186 item.isIgnored = true; 20187 } 20188 }; 20189 20190 /** 20191 * return item to layout collection 20192 * @param {Element} elem 20193 */ 20194 proto.unignore = function( elem ) { 20195 var item = this.getItem( elem ); 20196 if ( item ) { 20197 delete item.isIgnored; 20198 } 20199 }; 20200 20201 /** 20202 * adds elements to stamps 20203 * @param {NodeList, Array, Element, or String} elems 20204 */ 20205 proto.stamp = function( elems ) { 20206 elems = this._find( elems ); 20207 if ( !elems ) { 20208 return; 20209 } 20210 20211 this.stamps = this.stamps.concat( elems ); 20212 // ignore 20213 elems.forEach( this.ignore, this ); 20214 }; 20215 20216 /** 20217 * removes elements to stamps 20218 * @param {NodeList, Array, or Element} elems 20219 */ 20220 proto.unstamp = function( elems ) { 20221 elems = this._find( elems ); 20222 if ( !elems ){ 20223 return; 20224 } 20225 20226 elems.forEach( function( elem ) { 20227 // filter out removed stamp elements 20228 utils.removeFrom( this.stamps, elem ); 20229 this.unignore( elem ); 20230 }, this ); 20231 }; 20232 20233 /** 20234 * finds child elements 20235 * @param {NodeList, Array, Element, or String} elems 20236 * @returns {Array} elems 20237 */ 20238 proto._find = function( elems ) { 20239 if ( !elems ) { 20240 return; 20241 } 20242 // if string, use argument as selector string 20243 if ( typeof elems == 'string' ) { 20244 elems = this.element.querySelectorAll( elems ); 20245 } 20246 elems = utils.makeArray( elems ); 20247 return elems; 20248 }; 20249 20250 proto._manageStamps = function() { 20251 if ( !this.stamps || !this.stamps.length ) { 20252 return; 20253 } 20254 20255 this._getBoundingRect(); 20256 20257 this.stamps.forEach( this._manageStamp, this ); 20258 }; 20259 20260// update boundingLeft / Top 20261 proto._getBoundingRect = function() { 20262 // get bounding rect for container element 20263 var boundingRect = this.element.getBoundingClientRect(); 20264 var size = this.size; 20265 this._boundingRect = { 20266 left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, 20267 top: boundingRect.top + size.paddingTop + size.borderTopWidth, 20268 right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), 20269 bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) 20270 }; 20271 }; 20272 20273 /** 20274 * @param {Element} stamp 20275 **/ 20276 proto._manageStamp = noop; 20277 20278 /** 20279 * get x/y position of element relative to container element 20280 * @param {Element} elem 20281 * @returns {Object} offset - has left, top, right, bottom 20282 */ 20283 proto._getElementOffset = function( elem ) { 20284 var boundingRect = elem.getBoundingClientRect(); 20285 var thisRect = this._boundingRect; 20286 var size = getSize( elem ); 20287 var offset = { 20288 left: boundingRect.left - thisRect.left - size.marginLeft, 20289 top: boundingRect.top - thisRect.top - size.marginTop, 20290 right: thisRect.right - boundingRect.right - size.marginRight, 20291 bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom 20292 }; 20293 return offset; 20294 }; 20295 20296// -------------------------- resize -------------------------- // 20297 20298// enable event handlers for listeners 20299// i.e. resize -> onresize 20300 proto.handleEvent = utils.handleEvent; 20301 20302 /** 20303 * Bind layout to window resizing 20304 */ 20305 proto.bindResize = function() { 20306 window.addEventListener( 'resize', this ); 20307 this.isResizeBound = true; 20308 }; 20309 20310 /** 20311 * Unbind layout to window resizing 20312 */ 20313 proto.unbindResize = function() { 20314 window.removeEventListener( 'resize', this ); 20315 this.isResizeBound = false; 20316 }; 20317 20318 proto.onresize = function() { 20319 this.resize(); 20320 }; 20321 20322 utils.debounceMethod( Outlayer, 'onresize', 100 ); 20323 20324 proto.resize = function() { 20325 // don't trigger if size did not change 20326 // or if resize was unbound. See #9 20327 if ( !this.isResizeBound || !this.needsResizeLayout() ) { 20328 return; 20329 } 20330 20331 this.layout(); 20332 }; 20333 20334 /** 20335 * check if layout is needed post layout 20336 * @returns Boolean 20337 */ 20338 proto.needsResizeLayout = function() { 20339 var size = getSize( this.element ); 20340 // check that this.size and size are there 20341 // IE8 triggers resize on body size change, so they might not be 20342 var hasSizes = this.size && size; 20343 return hasSizes && size.innerWidth !== this.size.innerWidth; 20344 }; 20345 20346// -------------------------- methods -------------------------- // 20347 20348 /** 20349 * add items to Outlayer instance 20350 * @param {Array or NodeList or Element} elems 20351 * @returns {Array} items - Outlayer.Items 20352 **/ 20353 proto.addItems = function( elems ) { 20354 var items = this._itemize( elems ); 20355 // add items to collection 20356 if ( items.length ) { 20357 this.items = this.items.concat( items ); 20358 } 20359 return items; 20360 }; 20361 20362 /** 20363 * Layout newly-appended item elements 20364 * @param {Array or NodeList or Element} elems 20365 */ 20366 proto.appended = function( elems ) { 20367 var items = this.addItems( elems ); 20368 if ( !items.length ) { 20369 return; 20370 } 20371 // layout and reveal just the new items 20372 this.layoutItems( items, true ); 20373 this.reveal( items ); 20374 }; 20375 20376 /** 20377 * Layout prepended elements 20378 * @param {Array or NodeList or Element} elems 20379 */ 20380 proto.prepended = function( elems ) { 20381 var items = this._itemize( elems ); 20382 if ( !items.length ) { 20383 return; 20384 } 20385 // add items to beginning of collection 20386 var previousItems = this.items.slice(0); 20387 this.items = items.concat( previousItems ); 20388 // start new layout 20389 this._resetLayout(); 20390 this._manageStamps(); 20391 // layout new stuff without transition 20392 this.layoutItems( items, true ); 20393 this.reveal( items ); 20394 // layout previous items 20395 this.layoutItems( previousItems ); 20396 }; 20397 20398 /** 20399 * reveal a collection of items 20400 * @param {Array of Outlayer.Items} items 20401 */ 20402 proto.reveal = function( items ) { 20403 this._emitCompleteOnItems( 'reveal', items ); 20404 if ( !items || !items.length ) { 20405 return; 20406 } 20407 var stagger = this.updateStagger(); 20408 items.forEach( function( item, i ) { 20409 item.stagger( i * stagger ); 20410 item.reveal(); 20411 }); 20412 }; 20413 20414 /** 20415 * hide a collection of items 20416 * @param {Array of Outlayer.Items} items 20417 */ 20418 proto.hide = function( items ) { 20419 this._emitCompleteOnItems( 'hide', items ); 20420 if ( !items || !items.length ) { 20421 return; 20422 } 20423 var stagger = this.updateStagger(); 20424 items.forEach( function( item, i ) { 20425 item.stagger( i * stagger ); 20426 item.hide(); 20427 }); 20428 }; 20429 20430 /** 20431 * reveal item elements 20432 * @param {Array}, {Element}, {NodeList} items 20433 */ 20434 proto.revealItemElements = function( elems ) { 20435 var items = this.getItems( elems ); 20436 this.reveal( items ); 20437 }; 20438 20439 /** 20440 * hide item elements 20441 * @param {Array}, {Element}, {NodeList} items 20442 */ 20443 proto.hideItemElements = function( elems ) { 20444 var items = this.getItems( elems ); 20445 this.hide( items ); 20446 }; 20447 20448 /** 20449 * get Outlayer.Item, given an Element 20450 * @param {Element} elem 20451 * @param {Function} callback 20452 * @returns {Outlayer.Item} item 20453 */ 20454 proto.getItem = function( elem ) { 20455 // loop through items to get the one that matches 20456 for ( var i=0; i < this.items.length; i++ ) { 20457 var item = this.items[i]; 20458 if ( item.element == elem ) { 20459 // return item 20460 return item; 20461 } 20462 } 20463 }; 20464 20465 /** 20466 * get collection of Outlayer.Items, given Elements 20467 * @param {Array} elems 20468 * @returns {Array} items - Outlayer.Items 20469 */ 20470 proto.getItems = function( elems ) { 20471 elems = utils.makeArray( elems ); 20472 var items = [];
vendor: 4,944 bytes, lines 20473-20664
20473 elems.forEach( function( elem ) { 20474 var item = this.getItem( elem ); 20475 if ( item ) { 20476 items.push( item ); 20477 } 20478 }, this ); 20479 20480 return items; 20481 }; 20482 20483 /** 20484 * remove element(s) from instance and DOM 20485 * @param {Array or NodeList or Element} elems 20486 */ 20487 proto.remove = function( elems ) { 20488 var removeItems = this.getItems( elems ); 20489 20490 this._emitCompleteOnItems( 'remove', removeItems ); 20491 20492 // bail if no items to remove 20493 if ( !removeItems || !removeItems.length ) { 20494 return; 20495 } 20496 20497 removeItems.forEach( function( item ) { 20498 item.remove(); 20499 // remove item from collection 20500 utils.removeFrom( this.items, item ); 20501 }, this ); 20502 }; 20503 20504// ----- destroy ----- // 20505 20506// remove and disable Outlayer instance 20507 proto.destroy = function() { 20508 // clean up dynamic styles 20509 var style = this.element.style; 20510 style.height = ''; 20511 style.position = ''; 20512 style.width = ''; 20513 // destroy items 20514 this.items.forEach( function( item ) { 20515 item.destroy(); 20516 }); 20517 20518 this.unbindResize(); 20519 20520 var id = this.element.outlayerGUID; 20521 delete instances[ id ]; // remove reference to instance by id 20522 delete this.element.outlayerGUID; 20523 // remove data for jQuery 20524 if ( jQuery ) { 20525 jQuery.removeData( this.element, this.constructor.namespace ); 20526 } 20527 20528 }; 20529 20530// -------------------------- data -------------------------- // 20531 20532 /** 20533 * get Outlayer instance from element 20534 * @param {Element} elem 20535 * @returns {Outlayer} 20536 */ 20537 Outlayer.data = function( elem ) { 20538 elem = utils.getQueryElement( elem ); 20539 var id = elem && elem.outlayerGUID; 20540 return id && instances[ id ]; 20541 }; 20542 20543 20544// -------------------------- create Outlayer class -------------------------- // 20545 20546 /** 20547 * create a layout class 20548 * @param {String} namespace 20549 */ 20550 Outlayer.create = function( namespace, options ) { 20551 // sub-class Outlayer 20552 var Layout = subclass( Outlayer ); 20553 // apply new options and compatOptions 20554 Layout.defaults = utils.extend( {}, Outlayer.defaults ); 20555 utils.extend( Layout.defaults, options ); 20556 Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); 20557 20558 Layout.namespace = namespace; 20559 20560 Layout.data = Outlayer.data; 20561 20562 // sub-class Item 20563 Layout.Item = subclass( Item ); 20564 20565 // -------------------------- declarative -------------------------- // 20566 20567 utils.htmlInit( Layout, namespace ); 20568 20569 // -------------------------- jQuery bridge -------------------------- // 20570 20571 // make into jQuery plugin 20572 if ( jQuery && jQuery.bridget ) { 20573 jQuery.bridget( namespace, Layout ); 20574 } 20575 20576 return Layout; 20577 }; 20578 20579 function subclass( Parent ) { 20580 function SubClass() { 20581 Parent.apply( this, arguments ); 20582 } 20583 20584 SubClass.prototype = Object.create( Parent.prototype ); 20585 SubClass.prototype.constructor = SubClass; 20586 20587 return SubClass; 20588 } 20589 20590// ----- helpers ----- // 20591 20592// how many milliseconds are in each unit 20593 var msUnits = { 20594 ms: 1, 20595 s: 1000 20596 }; 20597 20598// munge time-like parameter into millisecond number 20599// '0.4s' -> 40 20600 function getMilliseconds( time ) { 20601 if ( typeof time == 'number' ) { 20602 return time; 20603 } 20604 var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); 20605 var num = matches && matches[1]; 20606 var unit = matches && matches[2]; 20607 if ( !num.length ) { 20608 return 0; 20609 } 20610 num = parseFloat( num ); 20611 var mult = msUnits[ unit ] || 1; 20612 return num * mult; 20613 } 20614 20615// ----- fin ----- // 20616 20617// back in global 20618 Outlayer.Item = Item; 20619 20620 return Outlayer; 20621 20622})); 20623 20624/*! 20625 * Masonry v4.1.0 20626 * Cascading grid layout library 20627 * http://masonry.desandro.com 20628 * MIT License 20629 * by David DeSandro 20630 */ 20631 20632( function( window, factory ) { 20633 // universal module definition 20634 /* jshint strict: false */ /*globals define, module, require */ 20635 if ( typeof define == 'function' && define.amd ) { 20636 // AMD 20637 define( [ 20638 'outlayer/outlayer', 20639 'get-size/get-size' 20640 ], 20641 factory ); 20642 } else if ( typeof module == 'object' && module.exports ) { 20643 // CommonJS 20644 module.exports = factory( 20645 require('outlayer'), 20646 require('get-size') 20647 ); 20648 } else { 20649 // browser global 20650 window.Masonry = factory( 20651 window.Outlayer, 20652 window.getSize 20653 ); 20654 } 20655 20656}( window, function factory( Outlayer, getSize ) { 20657 20658 20659 20660// -------------------------- masonryDefinition -------------------------- // 20661 20662 // create an Outlayer layout class 20663 var Masonry = Outlayer.create('masonry'); 20664 // isFitWidth -> fitWidth
20665 Masonry.compatOptions.fitWidth = 'isFitWidth'; 20666 20667 Masonry.prototype._resetLayout = function() { 20668 this.getSize(); 20669 this._getMeasurement( 'columnWidth', 'outerWidth' ); 20670 this._getMeasurement( 'gutter', 'outerWidth' ); 20671 this.measureColumns(); 20672 20673 // reset column Y 20674 this.colYs = []; 20675 for ( var i=0; i < this.cols; i++ ) { 20676 this.colYs.push( 0 ); 20677 } 20678 20679 this.maxY = 0; 20680 }; 20681 20682 Masonry.prototype.measureColumns = function() { 20683 this.getContainerWidth(); 20684 // if columnWidth is 0, default to outerWidth of first item 20685 if ( !this.columnWidth ) { 20686 var firstItem = this.items[0]; 20687 var firstItemElem = firstItem && firstItem.element; 20688 // columnWidth fall back to item of first element 20689 this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || 20690 // if first elem has no width, default to size of container 20691 this.containerWidth; 20692 } 20693 20694 var columnWidth = this.columnWidth += this.gutter; 20695 20696 // calculate columns 20697 var containerWidth = this.containerWidth + this.gutter; 20698 var cols = containerWidth / columnWidth; 20699 // fix rounding errors, typically with gutters 20700 var excess = columnWidth - containerWidth % columnWidth; 20701 // if overshoot is less than a pixel, round up, otherwise floor it 20702 var mathMethod = excess && excess < 1 ? 'round' : 'floor'; 20703 cols = Math[ mathMethod ]( cols ); 20704 this.cols = Math.max( cols, 1 ); 20705 }; 20706 20707 Masonry.prototype.getContainerWidth = function() { 20708 // container is parent if fit width 20709 var isFitWidth = this._getOption('fitWidth'); 20710 var container = isFitWidth ? this.element.parentNode : this.element; 20711 // check that this.size and size are there 20712 // IE8 triggers resize on body size change, so they might not be 20713 var size = getSize( container ); 20714 this.containerWidth = size && size.innerWidth; 20715 }; 20716 20717 Masonry.prototype._getItemLayoutPosition = function( item ) { 20718 item.getSize(); 20719 // how many columns does this brick span 20720 var remainder = item.size.outerWidth % this.columnWidth; 20721 var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; 20722 // round if off by 1 pixel, otherwise use ceil 20723 var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); 20724 colSpan = Math.min( colSpan, this.cols ); 20725 20726 var colGroup = this._getColGroup( colSpan ); 20727 // get the minimum Y value from the columns 20728 var minimumY = Math.min.apply( Math, colGroup ); 20729 var shortColIndex = colGroup.indexOf( minimumY ); 20730 20731 // position the brick 20732 var position = { 20733 x: this.columnWidth * shortColIndex, 20734 y: minimumY 20735 }; 20736 20737 // apply setHeight to necessary columns 20738 var setHeight = minimumY + item.size.outerHeight; 20739 var setSpan = this.cols + 1 - colGroup.length; 20740 for ( var i = 0; i < setSpan; i++ ) { 20741 this.colYs[ shortColIndex + i ] = setHeight; 20742 } 20743 20744 return position; 20745 }; 20746 20747 /** 20748 * @param {Number} colSpan - number of columns the element spans 20749 * @returns {Array} colGroup 20750 */ 20751 Masonry.prototype._getColGroup = function( colSpan ) { 20752 if ( colSpan < 2 ) { 20753 // if brick spans only one column, use all the column Ys 20754 return this.colYs; 20755 } 20756 20757 var colGroup = []; 20758 // how many different places could this brick fit horizontally 20759 var groupCount = this.cols + 1 - colSpan; 20760 // for each group potential horizontal position 20761 for ( var i = 0; i < groupCount; i++ ) { 20762 // make an array of colY values for that one group 20763 var groupColYs = this.colYs.slice( i, i + colSpan ); 20764 // and get the max value of the array 20765 colGroup[i] = Math.max.apply( Math, groupColYs ); 20766 } 20767 return colGroup; 20768 }; 20769 20770 Masonry.prototype._manageStamp = function( stamp ) { 20771 var stampSize = getSize( stamp ); 20772 var offset = this._getElementOffset( stamp ); 20773 // get the columns that this stamp affects 20774 var isOriginLeft = this._getOption('originLeft'); 20775 var firstX = isOriginLeft ? offset.left : offset.right; 20776 var lastX = firstX + stampSize.outerWidth; 20777 var firstCol = Math.floor( firstX / this.columnWidth ); 20778 firstCol = Math.max( 0, firstCol ); 20779 var lastCol = Math.floor( lastX / this.columnWidth ); 20780 // lastCol should not go over if multiple of columnWidth #425 20781 lastCol -= lastX % this.columnWidth ? 0 : 1; 20782 lastCol = Math.min( this.cols - 1, lastCol ); 20783 // set colYs to bottom of the stamp 20784 20785 var isOriginTop = this._getOption('originTop'); 20786 var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + 20787 stampSize.outerHeight; 20788 for ( var i = firstCol; i <= lastCol; i++ ) { 20789 this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); 20790 } 20791 }; 20792 20793 Masonry.prototype._getContainerSize = function() { 20794 this.maxY = Math.max.apply( Math, this.colYs ); 20795 var size = { 20796 height: this.maxY 20797 }; 20798 20799 if ( this._getOption('fitWidth') ) { 20800 size.width = this._getContainerFitWidth(); 20801 } 20802 20803 return size; 20804 }; 20805 20806 Masonry.prototype._getContainerFitWidth = function() { 20807 var unusedCols = 0; 20808 // count unused columns 20809 var i = this.cols; 20810 while ( --i ) { 20811 if ( this.colYs[i] !== 0 ) { 20812 break; 20813 } 20814 unusedCols++; 20815 } 20816 // fit container to columns that have been used 20817 return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; 20818 }; 20819 20820 Masonry.prototype.needsResizeLayout = function() { 20821 var previousWidth = this.containerWidth; 20822 this.getContainerWidth(); 20823 return previousWidth != this.containerWidth; 20824 }; 20825 20826 return Masonry; 20827 20828})); 20829 20830;// /var/www/www.vfb.de/httpdocs/current/static/js/imagesloaded.js 20831/*! 20832 * imagesLoaded v4.1.0 20833 * JavaScript is all like "You images are done yet or what?" 20834 * MIT License 20835 */ 20836 20837( function( window, factory ) { 'use strict'; 20838 // universal module definition 20839 20840 /*global define: false, module: false, require: false */ 20841 20842 if ( typeof define == 'function' && define.amd ) { 20843 // AMD 20844 define( [ 20845 'ev-emitter/ev-emitter' 20846 ], function( EvEmitter ) { 20847 return factory( window, EvEmitter ); 20848 }); 20849 } else if ( typeof module == 'object' && module.exports ) { 20850 // CommonJS 20851 module.exports = factory( 20852 window, 20853 require('ev-emitter') 20854 ); 20855 } else { 20856 // browser global 20857 window.imagesLoaded = factory( 20858 window, 20859 window.EvEmitter 20860 ); 20861 } 20862 20863})( window, 20864 20865// -------------------------- factory -------------------------- // 20866 20867 function factory( window, EvEmitter ) { 20868 20869 'use strict'; 20870 20871 var $ = window.jQuery; 20872 var console = window.console; 20873 20874// -------------------------- helpers -------------------------- // 20875 20876// extend objects 20877 function extend( a, b ) { 20878 for ( var prop in b ) { 20879 a[ prop ] = b[ prop ]; 20880 } 20881 return a; 20882 } 20883 20884// turn element or nodeList into an array 20885 function makeArray( obj ) { 20886 var ary = []; 20887 if ( Array.isArray( obj ) ) { 20888 // use object if already an array 20889 ary = obj; 20890 } else if ( typeof obj.length == 'number' ) { 20891 // convert nodeList to array 20892 for ( var i=0; i < obj.length; i++ ) { 20893 ary.push( obj[i] ); 20894 } 20895 } else { 20896 // array of single index 20897 ary.push( obj ); 20898 } 20899 return ary; 20900 } 20901 20902// -------------------------- imagesLoaded -------------------------- // 20903 20904 /** 20905 * @param {Array, Element, NodeList, String} elem 20906 * @param {Object or Function} options - if function, use as callback 20907 * @param {Function} onAlways - callback function 20908 */ 20909 function ImagesLoaded( elem, options, onAlways ) { 20910 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 20911 if ( !( this instanceof ImagesLoaded ) ) { 20912 return new ImagesLoaded( elem, options, onAlways ); 20913 } 20914 // use elem as selector string 20915 if ( typeof elem == 'string' ) { 20916 elem = document.querySelectorAll( elem ); 20917 } 20918 20919 this.elements = makeArray( elem ); 20920 this.options = extend( {}, this.options ); 20921 20922 if ( typeof options == 'function' ) { 20923 onAlways = options; 20924 } else { 20925 extend( this.options, options ); 20926 } 20927 20928 if ( onAlways ) { 20929 this.on( 'always', onAlways ); 20930 } 20931 20932 this.getImages(); 20933 20934 if ( $ ) { 20935 // add jQuery Deferred object 20936 this.jqDeferred = new $.Deferred(); 20937 } 20938 20939 // HACK check async to allow time to bind listeners 20940 setTimeout( function() { 20941 this.check(); 20942 }.bind( this )); 20943 } 20944 20945 ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); 20946 20947 ImagesLoaded.prototype.options = {}; 20948 20949 ImagesLoaded.prototype.getImages = function() { 20950 this.images = []; 20951 20952 // filter & find items if we have an item selector
vendor: 9,167 bytes, lines 20953-21215
20953 this.elements.forEach( this.addElementImages, this ); 20954 }; 20955 20956 /** 20957 * @param {Node} element 20958 */ 20959 ImagesLoaded.prototype.addElementImages = function( elem ) { 20960 // filter siblings 20961 if ( elem.nodeName == 'IMG' ) { 20962 this.addImage( elem ); 20963 } 20964 // get background image on element 20965 if ( this.options.background === true ) { 20966 this.addElementBackgroundImages( elem ); 20967 } 20968 20969 // find children 20970 // no non-element nodes, #143 20971 var nodeType = elem.nodeType; 20972 if ( !nodeType || !elementNodeTypes[ nodeType ] ) { 20973 return; 20974 } 20975 var childImgs = elem.querySelectorAll('img'); 20976 // concat childElems to filterFound array 20977 for ( var i=0; i < childImgs.length; i++ ) { 20978 var img = childImgs[i]; 20979 this.addImage( img ); 20980 } 20981 20982 // get child background images 20983 if ( typeof this.options.background == 'string' ) { 20984 var children = elem.querySelectorAll( this.options.background ); 20985 for ( i=0; i < children.length; i++ ) { 20986 var child = children[i]; 20987 this.addElementBackgroundImages( child ); 20988 } 20989 } 20990 }; 20991 20992 var elementNodeTypes = { 20993 1: true, 20994 9: true, 20995 11: true 20996 }; 20997 20998 ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { 20999 var style = getComputedStyle( elem ); 21000 if ( !style ) { 21001 // Firefox returns null if in a hidden iframe https://bugzil.la/548397 21002 return; 21003 } 21004 // get url inside url("...") 21005 var reURL = /url\((['"])?(.*?)\1\)/gi; 21006 var matches = reURL.exec( style.backgroundImage ); 21007 while ( matches !== null ) { 21008 var url = matches && matches[2]; 21009 if ( url ) { 21010 this.addBackground( url, elem ); 21011 } 21012 matches = reURL.exec( style.backgroundImage ); 21013 } 21014 }; 21015 21016 /** 21017 * @param {Image} img 21018 */ 21019 ImagesLoaded.prototype.addImage = function( img ) { 21020 var loadingImage = new LoadingImage( img ); 21021 this.images.push( loadingImage ); 21022 }; 21023 21024 ImagesLoaded.prototype.addBackground = function( url, elem ) { 21025 var background = new Background( url, elem ); 21026 this.images.push( background ); 21027 }; 21028 21029 ImagesLoaded.prototype.check = function() { 21030 var _this = this; 21031 this.progressedCount = 0; 21032 this.hasAnyBroken = false; 21033 // complete if no images 21034 if ( !this.images.length ) { 21035 this.complete(); 21036 return; 21037 } 21038 21039 function onProgress( image, elem, message ) { 21040 // HACK - Chrome triggers event before object properties have changed. #83 21041 setTimeout( function() { 21042 _this.progress( image, elem, message ); 21043 }); 21044 } 21045 21046 this.images.forEach( function( loadingImage ) { 21047 loadingImage.once( 'progress', onProgress ); 21048 loadingImage.check(); 21049 }); 21050 }; 21051 21052 ImagesLoaded.prototype.progress = function( image, elem, message ) { 21053 this.progressedCount++; 21054 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 21055 // progress event 21056 this.emitEvent( 'progress', [ this, image, elem ] ); 21057 if ( this.jqDeferred && this.jqDeferred.notify ) { 21058 this.jqDeferred.notify( this, image ); 21059 } 21060 // check if completed 21061 if ( this.progressedCount == this.images.length ) { 21062 this.complete(); 21063 } 21064 21065 if ( this.options.debug && console ) { 21066 console.log( 'progress: ' + message, image, elem ); 21067 } 21068 }; 21069 21070 ImagesLoaded.prototype.complete = function() { 21071 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 21072 this.isComplete = true; 21073 this.emitEvent( eventName, [ this ] ); 21074 this.emitEvent( 'always', [ this ] ); 21075 if ( this.jqDeferred ) { 21076 var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 21077 this.jqDeferred[ jqMethod ]( this ); 21078 } 21079 }; 21080 21081// -------------------------- -------------------------- // 21082 21083 function LoadingImage( img ) { 21084 this.img = img; 21085 } 21086 21087 LoadingImage.prototype = Object.create( EvEmitter.prototype ); 21088 21089 LoadingImage.prototype.check = function() { 21090 // If complete is true and browser supports natural sizes, 21091 // try to check for image status manually. 21092 var isComplete = this.getIsImageComplete(); 21093 if ( isComplete ) { 21094 // report based on naturalWidth 21095 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 21096 return; 21097 } 21098 21099 // If none of the checks above matched, simulate loading on detached element. 21100 this.proxyImage = new Image(); 21101 this.proxyImage.addEventListener( 'load', this ); 21102 this.proxyImage.addEventListener( 'error', this ); 21103 // bind to image as well for Firefox. #191 21104 this.img.addEventListener( 'load', this ); 21105 this.img.addEventListener( 'error', this ); 21106 this.proxyImage.src = this.img.src; 21107 }; 21108 21109 LoadingImage.prototype.getIsImageComplete = function() { 21110 return this.img.complete && this.img.naturalWidth !== undefined; 21111 }; 21112 21113 LoadingImage.prototype.confirm = function( isLoaded, message ) { 21114 this.isLoaded = isLoaded; 21115 this.emitEvent( 'progress', [ this, this.img, message ] ); 21116 }; 21117 21118// ----- events ----- // 21119 21120// trigger specified handler for event type 21121 LoadingImage.prototype.handleEvent = function( event ) { 21122 var method = 'on' + event.type; 21123 if ( this[ method ] ) { 21124 this[ method ]( event ); 21125 } 21126 }; 21127 21128 LoadingImage.prototype.onload = function() { 21129 this.confirm( true, 'onload' ); 21130 this.unbindEvents(); 21131 }; 21132 21133 LoadingImage.prototype.onerror = function() { 21134 this.confirm( false, 'onerror' ); 21135 this.unbindEvents(); 21136 }; 21137 21138 LoadingImage.prototype.unbindEvents = function() { 21139 this.proxyImage.removeEventListener( 'load', this ); 21140 this.proxyImage.removeEventListener( 'error', this ); 21141 this.img.removeEventListener( 'load', this ); 21142 this.img.removeEventListener( 'error', this ); 21143 }; 21144 21145// -------------------------- Background -------------------------- // 21146 21147 function Background( url, element ) { 21148 this.url = url; 21149 this.element = element; 21150 this.img = new Image(); 21151 } 21152 21153// inherit LoadingImage prototype 21154 Background.prototype = Object.create( LoadingImage.prototype ); 21155 21156 Background.prototype.check = function() { 21157 this.img.addEventListener( 'load', this ); 21158 this.img.addEventListener( 'error', this ); 21159 this.img.src = this.url; 21160 // check if image is already complete 21161 var isComplete = this.getIsImageComplete(); 21162 if ( isComplete ) { 21163 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 21164 this.unbindEvents(); 21165 } 21166 }; 21167 21168 Background.prototype.unbindEvents = function() { 21169 this.img.removeEventListener( 'load', this ); 21170 this.img.removeEventListener( 'error', this ); 21171 }; 21172 21173 Background.prototype.confirm = function( isLoaded, message ) { 21174 this.isLoaded = isLoaded; 21175 this.emitEvent( 'progress', [ this, this.element, message ] ); 21176 }; 21177 21178// -------------------------- jQuery -------------------------- // 21179 21180 ImagesLoaded.makeJQueryPlugin = function( jQuery ) { 21181 jQuery = jQuery || window.jQuery; 21182 if ( !jQuery ) { 21183 return; 21184 } 21185 // set local variable 21186 $ = jQuery; 21187 // $().imagesLoaded() 21188 $.fn.imagesLoaded = function( options, callback ) { 21189 var instance = new ImagesLoaded( this, options, callback ); 21190 return instance.jqDeferred.promise( $(this) ); 21191 }; 21192 }; 21193// try making plugin 21194 ImagesLoaded.makeJQueryPlugin(); 21195 21196// -------------------------- -------------------------- // 21197 21198 return ImagesLoaded; 21199 21200 }); 21201;// /var/www/www.vfb.de/httpdocs/current/?proxy=/sachinchoolur/lightgallery/src/js/lightgallery.js 21202(function($, window, document, undefined) { 21203 21204 'use strict'; 21205 21206 var defaults = { 21207 21208 mode: 'lg-slide', 21209 21210 // Ex : 'ease' 21211 cssEasing: 'ease', 21212 21213 //'for jquery animation' 21214 easing: 'linear', 21215 speed: 600,
21216 height: '100%', 21217 width: '100%', 21218 addClass: '', 21219 startClass: 'lg-start-zoom', 21220 backdropDuration: 150, 21221 hideBarsDelay: 6000, 21222 21223 useLeft: false, 21224 21225 closable: true, 21226 loop: true, 21227 escKey: true, 21228 keyPress: true, 21229 controls: true, 21230 slideEndAnimatoin: true, 21231 hideControlOnEnd: false, 21232 mousewheel: true, 21233 21234 // .lg-item || '.lg-sub-html' 21235 appendSubHtmlTo: '.lg-sub-html', 21236 21237 /** 21238 * @desc number of preload slides 21239 * will exicute only after the current slide is fully loaded. 21240 * 21241 * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th 21242 * slide will be loaded in the background after the 4th slide is fully loaded.. 21243 * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... 21244 * 21245 */ 21246 preload: 1, 21247 showAfterLoad: true, 21248 selector: '', 21249 selectWithin: '', 21250 nextHtml: '', 21251 prevHtml: '', 21252 21253 // 0, 1 21254 index: false, 21255 21256 iframeMaxWidth: '100%', 21257 21258 download: true, 21259 counter: true, 21260 appendCounterTo: '.lg-toolbar', 21261 21262 swipeThreshold: 50, 21263 enableSwipe: true, 21264 enableDrag: true, 21265 21266 dynamic: false, 21267 dynamicEl: [], 21268 galleryId: 1 21269 }; 21270 21271 function Plugin(element, options) { 21272 21273 // Current lightGallery element 21274 this.el = element; 21275 21276 // Current jquery element 21277 this.$el = $(element); 21278 21279 // lightGallery settings 21280 this.s = $.extend({}, defaults, options); 21281 21282 // When using dynamic mode, ensure dynamicEl is an array 21283 if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) { 21284 throw ('When using dynamic mode, you must also define dynamicEl as an Array.'); 21285 } 21286 21287 // lightGallery modules 21288 this.modules = {}; 21289 21290 // false when lightgallery complete first slide; 21291 this.lGalleryOn = false; 21292 21293 this.lgBusy = false; 21294 21295 // Timeout function for hiding controls; 21296 this.hideBartimeout = false; 21297 21298 // To determine browser supports for touch events; 21299 this.isTouch = ('ontouchstart' in document.documentElement); 21300 21301 // Disable hideControlOnEnd if sildeEndAnimation is true 21302 if (this.s.slideEndAnimatoin) { 21303 this.s.hideControlOnEnd = false; 21304 } 21305 21306 // Gallery items 21307 if (this.s.dynamic) { 21308 this.$items = this.s.dynamicEl; 21309 } else { 21310 if (this.s.selector === 'this') { 21311 this.$items = this.$el; 21312 } else if (this.s.selector !== '') { 21313 if (this.s.selectWithin) { 21314 this.$items = $(this.s.selectWithin).find(this.s.selector); 21315 } else { 21316 this.$items = this.$el.find($(this.s.selector)); 21317 } 21318 } else { 21319 this.$items = this.$el.children(); 21320 } 21321 } 21322 21323 // .lg-item 21324 this.$slide = ''; 21325 21326 // .lg-outer 21327 this.$outer = ''; 21328 21329 this.init(); 21330 21331 return this; 21332 } 21333 21334 Plugin.prototype.init = function() { 21335 21336 var _this = this; 21337 21338 // s.preload should not be more than $item.length 21339 if (_this.s.preload > _this.$items.length) { 21340 _this.s.preload = _this.$items.length; 21341 } 21342 21343 // if dynamic option is enabled execute immediately 21344 var _hash = window.location.hash; 21345 if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { 21346 21347 _this.index = parseInt(_hash.split('&slide=')[1], 10); 21348 21349 $('body').addClass('lg-from-hash'); 21350 if (!$('body').hasClass('lg-on')) { 21351 setTimeout(function() { 21352 _this.build(_this.index); 21353 $('body').addClass('lg-on'); 21354 }); 21355 } 21356 } 21357 21358 if (_this.s.dynamic) { 21359 21360 _this.$el.trigger('onBeforeOpen.lg'); 21361 21362 _this.index = _this.s.index || 0; 21363 21364 // prevent accidental double execution 21365 if (!$('body').hasClass('lg-on')) { 21366 setTimeout(function() { 21367 _this.build(_this.index); 21368 $('body').addClass('lg-on'); 21369 }); 21370 } 21371 } else { 21372 21373 // Using different namespace for click because click event should not unbind if selector is same object('this') 21374 _this.$items.on('click.lgcustom', function(event) { 21375 21376 // For IE8 21377 try { 21378 event.preventDefault(); 21379 event.preventDefault(); 21380 } catch (er) { 21381 event.returnValue = false;
21382 } 21383 21384 _this.$el.trigger('onBeforeOpen.lg'); 21385 21386 _this.index = _this.s.index || _this.$items.index(this); 21387 21388 // prevent accidental double execution 21389 if (!$('body').hasClass('lg-on')) { 21390 _this.build(_this.index); 21391 $('body').addClass('lg-on'); 21392 } 21393 }); 21394 } 21395 21396 }; 21397 21398 Plugin.prototype.build = function(index) { 21399 21400 var _this = this; 21401 21402 _this.structure(); 21403 21404 // module constructor 21405 $.each($.fn.lightGallery.modules, function(key) { 21406 _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); 21407 }); 21408 21409 // initiate slide function 21410 _this.slide(index, false, false); 21411 21412 if (_this.s.keyPress) { 21413 _this.keyPress(); 21414 } 21415 21416 if (_this.$items.length > 1) { 21417 21418 _this.arrow(); 21419 21420 setTimeout(function() { 21421 _this.enableDrag(); 21422 _this.enableSwipe(); 21423 }, 50); 21424 21425 if (_this.s.mousewheel) { 21426 _this.mousewheel(); 21427 } 21428 } 21429 21430 _this.counter(); 21431 21432 _this.closeGallery(); 21433 21434 _this.$el.trigger('onAfterOpen.lg'); 21435 21436 // Hide controllers if mouse doesn't move for some period 21437 _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { 21438 21439 _this.$outer.removeClass('lg-hide-items'); 21440 21441 clearTimeout(_this.hideBartimeout); 21442 21443 // Timeout will be cleared on each slide movement also 21444 _this.hideBartimeout = setTimeout(function() { 21445 _this.$outer.addClass('lg-hide-items'); 21446 }, _this.s.hideBarsDelay); 21447 21448 }); 21449 21450 }; 21451 21452 Plugin.prototype.structure = function() { 21453 var list = ''; 21454 var controls = ''; 21455 var i = 0; 21456 var subHtmlCont = ''; 21457 var template; 21458 var _this = this; 21459 21460 $('body').append('<div class="lg-backdrop"></div>'); 21461 $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); 21462 21463 // Create gallery items 21464 for (i = 0; i < this.$items.length; i++) { 21465 list += '<div class="lg-item"></div>'; 21466 } 21467 21468 // Create controlls 21469 if (this.s.controls && this.$items.length > 1) { 21470 controls = '<div class="lg-actions">' + 21471 '<div class="lg-prev lg-icon">' + this.s.prevHtml + '</div>' + 21472 '<div class="lg-next lg-icon">' + this.s.nextHtml + '</div>' + 21473 '</div>'; 21474 } 21475 21476 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 21477 subHtmlCont = '<div class="lg-sub-html"></div>'; 21478 } 21479 21480 template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' + 21481 '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' + 21482 '<div class="lg-inner">' + list + '</div>' + 21483 '<div class="lg-toolbar group">' + 21484 '<span class="lg-close lg-icon"></span>' + 21485 '</div>' + 21486 controls + 21487 subHtmlCont + 21488 '</div>' + 21489 '</div>'; 21490 21491 $('body').append(template); 21492 this.$outer = $('.lg-outer'); 21493 this.$slide = this.$outer.find('.lg-item'); 21494 21495 if (this.s.useLeft) { 21496 this.$outer.addClass('lg-use-left'); 21497 21498 // Set mode lg-slide if use left is true; 21499 this.s.mode = 'lg-slide'; 21500 } else { 21501 this.$outer.addClass('lg-use-css3'); 21502 } 21503 21504 // For fixed height gallery 21505 _this.setTop(); 21506 $(window).on('resize.lg orientationchange.lg', function() { 21507 setTimeout(function() { 21508 _this.setTop(); 21509 }, 100); 21510 }); 21511 21512 // add class lg-current to remove initial transition 21513 this.$slide.eq(this.index).addClass('lg-current'); 21514 21515 // add Class for css support and transition mode 21516 if (this.doCss()) { 21517 this.$outer.addClass('lg-css3'); 21518 } else { 21519 this.$outer.addClass('lg-css'); 21520 21521 // Set speed 0 because no animation will happen if browser doesn't support css3 21522 this.s.speed = 0; 21523 } 21524 21525 this.$outer.addClass(this.s.mode); 21526 21527 if (this.s.enableDrag && this.$items.length > 1) { 21528 this.$outer.addClass('lg-grab'); 21529 } 21530 21531 if (this.s.showAfterLoad) { 21532 this.$outer.addClass('lg-show-after-load'); 21533 } 21534 21535 if (this.doCss()) { 21536 var $inner = this.$outer.find('.lg-inner'); 21537 $inner.css('transition-timing-function', this.s.cssEasing); 21538 $inner.css('transition-duration', this.s.speed + 'ms'); 21539 } 21540 21541 $('.lg-backdrop').addClass('in'); 21542 21543 setTimeout(function() { 21544 _this.$outer.addClass('lg-visible'); 21545 }, this.s.backdropDuration); 21546 21547 if (this.s.download) { 21548 this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>'); 21549 } 21550 21551 // Store the current scroll top value to scroll back after closing the gallery.. 21552 this.prevScrollTop = $(window).scrollTop(); 21553 21554 }; 21555 21556 // For fixed height gallery 21557 Plugin.prototype.setTop = function() { 21558 if (this.s.height !== '100%') { 21559 var wH = $(window).height(); 21560 var top = (wH - parseInt(this.s.height, 10)) / 2; 21561 var $lGallery = this.$outer.find('.lg'); 21562 if (wH >= parseInt(this.s.height, 10)) { 21563 $lGallery.css('top', top + 'px'); 21564 } else { 21565 $lGallery.css('top', '0px'); 21566 } 21567 } 21568 }; 21569 21570 // Find css3 support 21571 Plugin.prototype.doCss = function() { 21572 // check for css animation support 21573 var support = function() { 21574 var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 21575 var root = document.documentElement; 21576 var i = 0; 21577 for (i = 0; i < transition.length; i++) { 21578 if (transition[i] in root.style) { 21579 return true; 21580 } 21581 } 21582 }; 21583 21584 if (support()) { 21585 return true; 21586 } 21587 21588 return false;
21589 }; 21590 21591 /** 21592 * @desc Check the given src is video 21593 * @param {String} src 21594 * @return {Object} video type 21595 * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } 21596 */ 21597 Plugin.prototype.isVideo = function(src, index) { 21598 21599 var html; 21600 if (this.s.dynamic) { 21601 html = this.s.dynamicEl[index].html; 21602 } else { 21603 html = this.$items.eq(index).attr('data-html'); 21604 } 21605 21606 if (!src && html) { 21607 return { 21608 html5: true 21609 }; 21610 } 21611 21612 var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); 21613 var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); 21614 var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); 21615 21616 if (youtube) { 21617 return { 21618 youtube: youtube 21619 }; 21620 } else if (vimeo) { 21621 return { 21622 vimeo: vimeo 21623 }; 21624 } else if (dailymotion) { 21625 return { 21626 dailymotion: dailymotion 21627 }; 21628 } 21629 }; 21630 21631 /** 21632 * @desc Create image counter 21633 * Ex: 1/10 21634 */ 21635 Plugin.prototype.counter = function() { 21636 if (this.s.counter) { 21637 $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>'); 21638 } 21639 }; 21640 21641 /** 21642 * @desc add sub-html into the slide 21643 * @param {Number} index - index of the slide 21644 */ 21645 Plugin.prototype.addHtml = function(index) { 21646 var subHtml = null; 21647 var subHtmlUrl; 21648 if (this.s.dynamic) { 21649 if (this.s.dynamicEl[index].subHtmlUrl) { 21650 subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl; 21651 } else { 21652 subHtml = this.s.dynamicEl[index].subHtml; 21653 } 21654 } else { 21655 if (this.$items.eq(index).attr('data-sub-html-url')) { 21656 subHtmlUrl = this.$items.eq(index).attr('data-sub-html-url'); 21657 } else { 21658 subHtml = this.$items.eq(index).attr('data-sub-html'); 21659 } 21660 } 21661 21662 if (!subHtmlUrl) { 21663 if (typeof subHtml !== 'undefined' && subHtml !== null) { 21664 21665 // get first letter of subhtml 21666 // if first letter starts with . or # get the html form the jQuery object 21667 var fL = subHtml.substring(0, 1); 21668 if (fL === '.' || fL === '#') { 21669 subHtml = $(subHtml).html(); 21670 } else { 21671 subHtml = subHtml; 21672 } 21673 } else { 21674 subHtml = ''; 21675 } 21676 } 21677 21678 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 21679 21680 if (subHtmlUrl) { 21681 this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl); 21682 } else { 21683 this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); 21684 } 21685 21686 } else { 21687 21688 if (subHtmlUrl) { 21689 this.$slide.eq(index).load(subHtmlUrl); 21690 } else { 21691 this.$slide.eq(index).append(subHtml); 21692 } 21693 } 21694 21695 // Add lg-empty-html class if title doesn't exist 21696 if (typeof subHtml !== 'undefined' && subHtml !== null) { 21697 if (subHtml === '') { 21698 this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); 21699 } else { 21700 this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); 21701 } 21702 } 21703 21704 this.$el.trigger('onAfterAppendSubHtml.lg', [index]); 21705 }; 21706 21707 /** 21708 * @desc Preload slides 21709 * @param {Number} index - index of the slide 21710 */ 21711 Plugin.prototype.preload = function(index) { 21712 var i = 1; 21713 var j = 1; 21714 for (i = 1; i <= this.s.preload; i++) { 21715 if (i >= this.$items.length - index) { 21716 break; 21717 } 21718 21719 this.loadContent(index + i, false, 0); 21720 } 21721 21722 for (j = 1; j <= this.s.preload; j++) { 21723 if (index - j < 0) { 21724 break; 21725 } 21726 21727 this.loadContent(index - j, false, 0); 21728 } 21729 }; 21730 21731 /**
21732 * @desc Load slide content into slide. 21733 * @param {Number} index - index of the slide. 21734 * @param {Boolean} rec - if true call loadcontent() function again. 21735 * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. 21736 */ 21737 Plugin.prototype.loadContent = function(index, rec, delay) { 21738 21739 var _this = this; 21740 var _hasPoster = false; 21741 var _$img; 21742 var _src; 21743 var _poster; 21744 var _srcset; 21745 var _sizes; 21746 var _html; 21747 var getResponsiveSrc = function(srcItms) { 21748 var rsWidth = []; 21749 var rsSrc = []; 21750 for (var i = 0; i < srcItms.length; i++) { 21751 var __src = srcItms[i].split(' '); 21752 21753 // Manage empty space 21754 if (__src[0] === '') { 21755 __src.splice(0, 1); 21756 } 21757 21758 rsSrc.push(__src[0]); 21759 rsWidth.push(__src[1]); 21760 } 21761 21762 var wWidth = $(window).width(); 21763 for (var j = 0; j < rsWidth.length; j++) { 21764 if (parseInt(rsWidth[j], 10) > wWidth) { 21765 _src = rsSrc[j]; 21766 break; 21767 } 21768 } 21769 }; 21770 21771 if (_this.s.dynamic) { 21772 21773 if (_this.s.dynamicEl[index].poster) { 21774 _hasPoster = true; 21775 _poster = _this.s.dynamicEl[index].poster; 21776 } 21777 21778 _html = _this.s.dynamicEl[index].html; 21779 _src = _this.s.dynamicEl[index].src; 21780 21781 if (_this.s.dynamicEl[index].responsive) { 21782 var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); 21783 getResponsiveSrc(srcDyItms); 21784 } 21785 21786 _srcset = _this.s.dynamicEl[index].srcset; 21787 _sizes = _this.s.dynamicEl[index].sizes; 21788 21789 } else { 21790 21791 if (_this.$items.eq(index).attr('data-poster')) { 21792 _hasPoster = true; 21793 _poster = _this.$items.eq(index).attr('data-poster'); 21794 } 21795 21796 _html = _this.$items.eq(index).attr('data-html'); 21797 _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); 21798 21799 if (_this.$items.eq(index).attr('data-responsive')) { 21800 var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); 21801 getResponsiveSrc(srcItms); 21802 } 21803 21804 _srcset = _this.$items.eq(index).attr('data-srcset'); 21805 _sizes = _this.$items.eq(index).attr('data-sizes'); 21806 21807 } 21808 21809 //if (_src || _srcset || _sizes || _poster) { 21810 21811 var iframe = false; 21812 if (_this.s.dynamic) { 21813 if (_this.s.dynamicEl[index].iframe) { 21814 iframe = true; 21815 } 21816 } else { 21817 if (_this.$items.eq(index).attr('data-iframe') === 'true') { 21818 iframe = true; 21819 } 21820 } 21821 21822 var _isVideo = _this.isVideo(_src, index); 21823 if (!_this.$slide.eq(index).hasClass('lg-loaded')) { 21824 if (iframe) { 21825 _this.$slide.eq(index).prepend('<div class="lg-video-cont" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>'); 21826 } else if (_hasPoster) { 21827 var videoClass = ''; 21828 if (_isVideo && _isVideo.youtube) { 21829 videoClass = 'lg-has-youtube'; 21830 } else if (_isVideo && _isVideo.vimeo) { 21831 videoClass = 'lg-has-vimeo'; 21832 } else { 21833 videoClass = 'lg-has-html5'; 21834 } 21835 21836 _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>'); 21837 21838 } else if (_isVideo) { 21839 _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'); 21840 _this.$el.trigger('hasVideo.lg', [index, _src, _html]); 21841 } else { 21842 _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>'); 21843 } 21844 21845 _this.$el.trigger('onAferAppendSlide.lg', [index]); 21846 21847 _$img = _this.$slide.eq(index).find('.lg-object'); 21848 if (_sizes) { 21849 _$img.attr('sizes', _sizes); 21850 } 21851 21852 if (_srcset) { 21853 _$img.attr('srcset', _srcset); 21854 try { 21855 picturefill({ 21856 elements: [_$img[0]] 21857 }); 21858 } catch (e) { 21859 console.error('Make sure you have included Picturefill version 2'); 21860 } 21861 } 21862 21863 if (this.s.appendSubHtmlTo !== '.lg-sub-html') { 21864 _this.addHtml(index); 21865 } 21866 21867 _this.$slide.eq(index).addClass('lg-loaded'); 21868 } 21869 21870 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 21871 21872 // For first time add some delay for displaying the start animation. 21873 var _speed = 0; 21874
21875 // Do not change the delay value because it is required for zoom plugin. 21876 // If gallery opened from direct url (hash) speed value should be 0 21877 if (delay && !$('body').hasClass('lg-from-hash')) { 21878 _speed = delay; 21879 } 21880 21881 setTimeout(function() { 21882 _this.$slide.eq(index).addClass('lg-complete'); 21883 _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); 21884 }, _speed); 21885 21886 }); 21887 21888 // @todo check load state for html5 videos 21889 if (_isVideo && _isVideo.html5 && !_hasPoster) { 21890 _this.$slide.eq(index).addClass('lg-complete'); 21891 } 21892 21893 if (rec === true) { 21894 if (!_this.$slide.eq(index).hasClass('lg-complete')) { 21895 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 21896 _this.preload(index); 21897 }); 21898 } else { 21899 _this.preload(index); 21900 } 21901 } 21902 21903 //} 21904 }; 21905 21906 /** 21907 * @desc slide function for lightgallery 21908 ** Slide() gets call on start 21909 ** ** Set lg.on true once slide() function gets called. 21910 ** Call loadContent() on slide() function inside setTimeout 21911 ** ** On first slide we do not want any animation like slide of fade 21912 ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately 21913 ** ** Else loadContent() should wait for the transition to complete. 21914 ** ** So set timeout s.speed + 50 21915 <=> ** loadContent() will load slide content in to the particular slide 21916 ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. 21917 ** ** preload will execute only when the previous slide is fully loaded (images iframe) 21918 ** ** avoid simultaneous image load 21919 <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value 21920 ** loadContent() <====> Preload(); 21921 21922 * @param {Number} index - index of the slide 21923 * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag 21924 * @param {Boolean} fromThumb - true if slide function called via thumbnail click 21925 */ 21926 Plugin.prototype.slide = function(index, fromTouch, fromThumb) { 21927 21928 var _prevIndex = this.$outer.find('.lg-current').index(); 21929 var _this = this; 21930 21931 // Prevent if multiple call 21932 // Required for hsh plugin 21933 if (_this.lGalleryOn && (_prevIndex === index)) { 21934 return; 21935 } 21936 21937 var _length = this.$slide.length; 21938 var _time = _this.lGalleryOn ? this.s.speed : 0; 21939 var _next = false; 21940 var _prev = false; 21941 21942 if (!_this.lgBusy) { 21943 21944 if (this.s.download) { 21945 var _src; 21946 if (_this.s.dynamic) { 21947 _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src); 21948 } else { 21949 _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src')); 21950 21951 } 21952 21953 if (_src) { 21954 $('#lg-download').attr('href', _src); 21955 _this.$outer.removeClass('lg-hide-download'); 21956 } else { 21957 _this.$outer.addClass('lg-hide-download'); 21958 } 21959 } 21960 21961 this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 21962 21963 _this.lgBusy = true; 21964 21965 clearTimeout(_this.hideBartimeout); 21966 21967 // Add title if this.s.appendSubHtmlTo === lg-sub-html 21968 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 21969 21970 // wait for slide animation to complete 21971 setTimeout(function() { 21972 _this.addHtml(index); 21973 }, _time); 21974 } 21975 21976 this.arrowDisable(index); 21977 21978 if (!fromTouch) { 21979 21980 // remove all transitions 21981 _this.$outer.addClass('lg-no-trans'); 21982 21983 this.$slide.removeClass('lg-prev-slide lg-next-slide'); 21984 21985 if (index < _prevIndex) { 21986 _prev = true; 21987 if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) { 21988 _prev = false;
21989 _next = true; 21990 } 21991 } else if (index > _prevIndex) { 21992 _next = true; 21993 if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) { 21994 _prev = true; 21995 _next = false; 21996 } 21997 } 21998 21999 if (_prev) { 22000 22001 //prevslide 22002 this.$slide.eq(index).addClass('lg-prev-slide'); 22003 this.$slide.eq(_prevIndex).addClass('lg-next-slide'); 22004 } else if (_next) { 22005 22006 // next slide 22007 this.$slide.eq(index).addClass('lg-next-slide'); 22008 this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); 22009 } 22010 22011 // give 50 ms for browser to add/remove class 22012 setTimeout(function() { 22013 _this.$slide.removeClass('lg-current'); 22014 22015 //_this.$slide.eq(_prevIndex).removeClass('lg-current'); 22016 _this.$slide.eq(index).addClass('lg-current'); 22017 22018 // reset all transitions 22019 _this.$outer.removeClass('lg-no-trans'); 22020 }, 50); 22021 } else { 22022 22023 var touchPrev = index - 1; 22024 var touchNext = index + 1; 22025 22026 if ((index === 0) && (_prevIndex === _length - 1)) { 22027 22028 // next slide 22029 touchNext = 0; 22030 touchPrev = _length - 1; 22031 } else if ((index === _length - 1) && (_prevIndex === 0)) { 22032 22033 // prev slide 22034 touchNext = 0; 22035 touchPrev = _length - 1; 22036 } 22037 22038 this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); 22039 _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); 22040 _this.$slide.eq(touchNext).addClass('lg-next-slide'); 22041 _this.$slide.eq(index).addClass('lg-current'); 22042 } 22043 22044 if (_this.lGalleryOn) { 22045 setTimeout(function() { 22046 _this.loadContent(index, true, 0); 22047 }, this.s.speed + 50); 22048 22049 setTimeout(function() { 22050 _this.lgBusy = false; 22051 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 22052 }, this.s.speed); 22053 22054 } else { 22055 _this.loadContent(index, true, _this.s.backdropDuration); 22056 22057 _this.lgBusy = false; 22058 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 22059 } 22060 22061 _this.lGalleryOn = true; 22062 22063 if (this.s.counter) { 22064 $('#lg-counter-current').text(index + 1); 22065 } 22066 22067 } 22068 22069 }; 22070 22071 /** 22072 * @desc Go to next slide 22073 * @param {Boolean} fromTouch - true if slide function called via touch event 22074 */ 22075 Plugin.prototype.goToNextSlide = function(fromTouch) { 22076 var _this = this; 22077 if (!_this.lgBusy) { 22078 if ((_this.index + 1) < _this.$slide.length) { 22079 _this.index++; 22080 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 22081 _this.slide(_this.index, fromTouch, false); 22082 } else { 22083 if (_this.s.loop) { 22084 _this.index = 0; 22085 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 22086 _this.slide(_this.index, fromTouch, false); 22087 } else if (_this.s.slideEndAnimatoin) { 22088 _this.$outer.addClass('lg-right-end'); 22089 setTimeout(function() { 22090 _this.$outer.removeClass('lg-right-end'); 22091 }, 400); 22092 } 22093 } 22094 } 22095 }; 22096 22097 /** 22098 * @desc Go to previous slide 22099 * @param {Boolean} fromTouch - true if slide function called via touch event 22100 */ 22101 Plugin.prototype.goToPrevSlide = function(fromTouch) { 22102 var _this = this; 22103 if (!_this.lgBusy) { 22104 if (_this.index > 0) { 22105 _this.index--; 22106 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 22107 _this.slide(_this.index, fromTouch, false); 22108 } else { 22109 if (_this.s.loop) { 22110 _this.index = _this.$items.length - 1; 22111 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 22112 _this.slide(_this.index, fromTouch, false); 22113 } else if (_this.s.slideEndAnimatoin) { 22114 _this.$outer.addClass('lg-left-end'); 22115 setTimeout(function() { 22116 _this.$outer.removeClass('lg-left-end'); 22117 }, 400); 22118 } 22119 } 22120 } 22121 }; 22122 22123 Plugin.prototype.keyPress = function() { 22124 var _this = this; 22125 if (this.$items.length > 1) { 22126 $(window).on('keyup.lg', function(e) { 22127 if (_this.$items.length > 1) { 22128 if (e.keyCode === 37) { 22129 e.preventDefault(); 22130 _this.goToPrevSlide(); 22131 } 22132 22133 if (e.keyCode === 39) { 22134 e.preventDefault(); 22135 _this.goToNextSlide(); 22136 } 22137 } 22138 }); 22139 } 22140 22141 $(window).on('keydown.lg', function(e) { 22142 if (_this.s.escKey === true && e.keyCode === 27) { 22143 e.preventDefault(); 22144 if (!_this.$outer.hasClass('lg-thumb-open')) { 22145 _this.destroy(); 22146 } else { 22147 _this.$outer.removeClass('lg-thumb-open'); 22148 } 22149 } 22150 }); 22151 }; 22152 22153 Plugin.prototype.arrow = function() { 22154 var _this = this; 22155 this.$outer.find('.lg-prev').on('click.lg', function() { 22156 _this.goToPrevSlide(); 22157 }); 22158 22159 this.$outer.find('.lg-next').on('click.lg', function() { 22160 _this.goToNextSlide(); 22161 }); 22162 }; 22163 22164 Plugin.prototype.arrowDisable = function(index) { 22165 22166 // Disable arrows if s.hideControlOnEnd is true 22167 if (!this.s.loop && this.s.hideControlOnEnd) { 22168 if ((index + 1) < this.$slide.length) { 22169 this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); 22170 } else { 22171 this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); 22172 } 22173 22174 if (index > 0) { 22175 this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); 22176 } else { 22177 this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); 22178 } 22179 } 22180 }; 22181 22182 Plugin.prototype.setTranslate = function($el, xValue, yValue) { 22183 // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 22184 if (this.s.useLeft) { 22185 $el.css('left', xValue); 22186 } else { 22187 $el.css({ 22188 transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' 22189 }); 22190 } 22191 }; 22192 22193 Plugin.prototype.touchMove = function(startCoords, endCoords) { 22194 22195 var distance = endCoords - startCoords; 22196 22197 if (Math.abs(distance) > 15) { 22198 // reset opacity and transition duration 22199 this.$outer.addClass('lg-dragging'); 22200 22201 // move current slide 22202 this.setTranslate(this.$slide.eq(this.index), distance, 0); 22203 22204 // move next and prev slide with current slide 22205 this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); 22206 this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); 22207 } 22208 }; 22209 22210 Plugin.prototype.touchEnd = function(distance) { 22211 var _this = this; 22212 22213 // keep slide animation for any mode while dragg/swipe 22214 if (_this.s.mode !== 'lg-slide') { 22215 _this.$outer.addClass('lg-slide'); 22216 } 22217 22218 this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); 22219 22220 // set transition duration 22221 setTimeout(function() { 22222 _this.$outer.removeClass('lg-dragging'); 22223 if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 22224 _this.goToNextSlide(true); 22225 } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 22226 _this.goToPrevSlide(true); 22227 } else if (Math.abs(distance) < 5) { 22228 22229 // Trigger click if distance is less than 5 pix 22230 _this.$el.trigger('onSlideClick.lg'); 22231 } 22232 22233 _this.$slide.removeAttr('style'); 22234 }); 22235 22236 // remove slide class once drag/swipe is completed if mode is not slide 22237 setTimeout(function() { 22238 if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { 22239 _this.$outer.removeClass('lg-slide'); 22240 } 22241 }, _this.s.speed + 100); 22242 22243 }; 22244 22245 Plugin.prototype.enableSwipe = function() { 22246 var _this = this; 22247 var startCoords = 0; 22248 var endCoords = 0; 22249 var isMoved = false;
22250 22251 if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) { 22252 22253 _this.$slide.on('touchstart.lg', function(e) { 22254 if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { 22255 e.preventDefault(); 22256 _this.manageSwipeClass(); 22257 startCoords = e.originalEvent.targetTouches[0].pageX; 22258 } 22259 }); 22260 22261 _this.$slide.on('touchmove.lg', function(e) { 22262 if (!_this.$outer.hasClass('lg-zoomed')) { 22263 e.preventDefault(); 22264 endCoords = e.originalEvent.targetTouches[0].pageX; 22265 _this.touchMove(startCoords, endCoords); 22266 isMoved = true; 22267 } 22268 }); 22269 22270 _this.$slide.on('touchend.lg', function() { 22271 if (!_this.$outer.hasClass('lg-zoomed')) { 22272 if (isMoved) { 22273 isMoved = false; 22274 _this.touchEnd(endCoords - startCoords); 22275 } else { 22276 _this.$el.trigger('onSlideClick.lg'); 22277 } 22278 } 22279 }); 22280 } 22281 22282 }; 22283 22284 Plugin.prototype.enableDrag = function() { 22285 var _this = this; 22286 var startCoords = 0; 22287 var endCoords = 0; 22288 var isDraging = false; 22289 var isMoved = false; 22290 if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) { 22291 _this.$slide.on('mousedown.lg', function(e) { 22292 // execute only on .lg-object 22293 if (!_this.$outer.hasClass('lg-zoomed')) { 22294 if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 22295 e.preventDefault(); 22296 22297 if (!_this.lgBusy) { 22298 _this.manageSwipeClass(); 22299 startCoords = e.pageX; 22300 isDraging = true; 22301 22302 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 22303 _this.$outer.scrollLeft += 1; 22304 _this.$outer.scrollLeft -= 1; 22305 22306 // * 22307 22308 _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); 22309 22310 _this.$el.trigger('onDragstart.lg'); 22311 } 22312 22313 } 22314 } 22315 }); 22316 22317 $(window).on('mousemove.lg', function(e) { 22318 if (isDraging) { 22319 isMoved = true; 22320 endCoords = e.pageX; 22321 _this.touchMove(startCoords, endCoords); 22322 _this.$el.trigger('onDragmove.lg'); 22323 } 22324 }); 22325 22326 $(window).on('mouseup.lg', function(e) { 22327 if (isMoved) { 22328 isMoved = false; 22329 _this.touchEnd(endCoords - startCoords); 22330 _this.$el.trigger('onDragend.lg'); 22331 } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 22332 _this.$el.trigger('onSlideClick.lg'); 22333 } 22334 22335 // Prevent execution on click 22336 if (isDraging) { 22337 isDraging = false; 22338 _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); 22339 } 22340 }); 22341 22342 } 22343 }; 22344 22345 Plugin.prototype.manageSwipeClass = function() { 22346 var touchNext = this.index + 1; 22347 var touchPrev = this.index - 1; 22348 var length = this.$slide.length; 22349 if (this.s.loop) { 22350 if (this.index === 0) { 22351 touchPrev = length - 1; 22352 } else if (this.index === length - 1) { 22353 touchNext = 0; 22354 } 22355 } 22356 22357 this.$slide.removeClass('lg-next-slide lg-prev-slide'); 22358 if (touchPrev > -1) { 22359 this.$slide.eq(touchPrev).addClass('lg-prev-slide'); 22360 } 22361 22362 this.$slide.eq(touchNext).addClass('lg-next-slide'); 22363 }; 22364 22365 Plugin.prototype.mousewheel = function() { 22366 var _this = this; 22367 _this.$outer.on('mousewheel.lg', function(e) { 22368 22369 if (!e.deltaY) { 22370 return; 22371 } 22372 22373 if (e.deltaY > 0) { 22374 _this.goToPrevSlide(); 22375 } else { 22376 _this.goToNextSlide(); 22377 } 22378 22379 e.preventDefault(); 22380 }); 22381 22382 }; 22383 22384 Plugin.prototype.closeGallery = function() { 22385 22386 var _this = this; 22387 var mousedown = false;
22388 this.$outer.find('.lg-close').on('click.lg', function() { 22389 _this.destroy(); 22390 }); 22391 22392 if (_this.s.closable) { 22393 22394 // If you drag the slide and release outside gallery gets close on chrome 22395 // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer 22396 _this.$outer.on('mousedown.lg', function(e) { 22397 22398 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { 22399 mousedown = true; 22400 } else { 22401 mousedown = false; 22402 } 22403 22404 }); 22405 22406 _this.$outer.on('mouseup.lg', function(e) { 22407 22408 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { 22409 if (!_this.$outer.hasClass('lg-dragging')) { 22410 _this.destroy(); 22411 } 22412 } 22413 22414 }); 22415 22416 } 22417 22418 }; 22419 22420 Plugin.prototype.destroy = function(d) { 22421 22422 var _this = this; 22423 22424 if (!d) { 22425 _this.$el.trigger('onBeforeClose.lg'); 22426 } 22427 22428 $(window).scrollTop(_this.prevScrollTop); 22429 22430 /** 22431 * if d is false or undefined destroy will only close the gallery 22432 * plugins instance remains with the element 22433 * 22434 * if d is true destroy will completely remove the plugin 22435 */ 22436 22437 if (d) { 22438 if (!_this.s.dynamic) { 22439 // only when not using dynamic mode is $items a jquery collection 22440 this.$items.off('click.lg click.lgcustom'); 22441 } 22442 22443 $.removeData(_this.el, 'lightGallery'); 22444 } 22445 22446 // Unbind all events added by lightGallery 22447 this.$el.off('.lg.tm'); 22448 22449 // Distroy all lightGallery modules 22450 $.each($.fn.lightGallery.modules, function(key) { 22451 if (_this.modules[key]) { 22452 _this.modules[key].destroy(); 22453 } 22454 }); 22455 22456 this.lGalleryOn = false; 22457 22458 clearTimeout(_this.hideBartimeout); 22459 this.hideBartimeout = false; 22460 $(window).off('.lg'); 22461 $('body').removeClass('lg-on lg-from-hash'); 22462 22463 if (_this.$outer) { 22464 _this.$outer.removeClass('lg-visible'); 22465 } 22466 22467 $('.lg-backdrop').removeClass('in'); 22468 22469 setTimeout(function() { 22470 if (_this.$outer) { 22471 _this.$outer.remove(); 22472 } 22473 22474 $('.lg-backdrop').remove(); 22475 22476 if (!d) { 22477 _this.$el.trigger('onCloseAfter.lg'); 22478 } 22479 22480 }, _this.s.backdropDuration + 50); 22481 }; 22482 22483 $.fn.lightGallery = function(options) { 22484 return this.each(function() { 22485 if (!$.data(this, 'lightGallery')) { 22486 $.data(this, 'lightGallery', new Plugin(this, options)); 22487 } else { 22488 try { 22489 $(this).data('lightGallery').init(); 22490 } catch (err) { 22491 console.error('lightGallery has not initiated properly'); 22492 } 22493 } 22494 }); 22495 }; 22496 22497 $.fn.lightGallery.modules = {}; 22498 22499})(jQuery, window, document); 22500 22501;// /var/www/www.vfb.de/httpdocs/current/static/js/lg-thumbnail.js 22502/*! lightgallery - v1.2.18 - 2016-04-13 22503 * http://sachinchoolur.github.io/lightGallery/ 22504 * Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ 22505(function($, window, document, undefined) { 22506 22507 'use strict'; 22508 22509 var defaults = { 22510 thumbnail: true, 22511 22512 animateThumb: true, 22513 currentPagerPosition: 'middle', 22514 22515 thumbWidth: 100, 22516 thumbContHeight: 100, 22517 thumbMargin: 5, 22518 22519 exThumbImage: false, 22520 showThumbByDefault: true, 22521 toogleThumb: true, 22522 pullCaptionUp: true, 22523 22524 enableThumbDrag: true, 22525 enableThumbSwipe: true, 22526 swipeThreshold: 50, 22527 22528 loadYoutubeThumbnail: true, 22529 youtubeThumbSize: 1, 22530 22531 loadVimeoThumbnail: true, 22532 vimeoThumbSize: 'thumbnail_small', 22533 22534 loadDailymotionThumbnail: true 22535 }; 22536 22537 var Thumbnail = function(element) { 22538 22539 // get lightGallery core plugin data 22540 this.core = $(element).data('lightGallery'); 22541 22542 // extend module default settings with lightGallery core settings 22543 this.core.s = $.extend({}, defaults, this.core.s); 22544 22545 this.$el = $(element); 22546 this.$thumbOuter = null; 22547 this.thumbOuterWidth = 0; 22548 this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)); 22549 this.thumbIndex = this.core.index; 22550 22551 // Thumbnail animation value 22552 this.left = 0; 22553 22554 this.init(); 22555 22556 return this; 22557 }; 22558 22559 Thumbnail.prototype.init = function() { 22560 var _this = this; 22561 if (this.core.s.thumbnail && this.core.$items.length > 1) { 22562 if (this.core.s.showThumbByDefault) { 22563 setTimeout(function(){ 22564 _this.core.$outer.addClass('lg-thumb-open'); 22565 }, 700); 22566 } 22567 22568 if (this.core.s.pullCaptionUp) { 22569 this.core.$outer.addClass('lg-pull-caption-up'); 22570 } 22571 22572 this.build(); 22573 if (this.core.s.animateThumb) { 22574 if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) { 22575 this.enableThumbDrag(); 22576 } 22577 22578 if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) { 22579 this.enableThumbSwipe(); 22580 } 22581 22582 this.thumbClickable = false;
vendor: 7,467 bytes, lines 22583-22789
22583 } else { 22584 this.thumbClickable = true; 22585 } 22586 22587 this.toogle(); 22588 this.thumbkeyPress(); 22589 } 22590 }; 22591 22592 Thumbnail.prototype.build = function() { 22593 var _this = this; 22594 var thumbList = ''; 22595 var vimeoErrorThumbSize = ''; 22596 var $thumb; 22597 var html = '<div class="lg-thumb-outer">' + 22598 '<div class="lg-thumb group">' + 22599 '</div>' + 22600 '</div>'; 22601 22602 switch (this.core.s.vimeoThumbSize) { 22603 case 'thumbnail_large': 22604 vimeoErrorThumbSize = '640'; 22605 break; 22606 case 'thumbnail_medium': 22607 vimeoErrorThumbSize = '200x150'; 22608 break; 22609 case 'thumbnail_small': 22610 vimeoErrorThumbSize = '100x75'; 22611 } 22612 22613 _this.core.$outer.addClass('lg-has-thumb'); 22614 22615 _this.core.$outer.find('.lg').append(html); 22616 22617 _this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer'); 22618 _this.thumbOuterWidth = _this.$thumbOuter.width(); 22619 22620 if (_this.core.s.animateThumb) { 22621 _this.core.$outer.find('.lg-thumb').css({ 22622 width: _this.thumbTotalWidth + 'px', 22623 position: 'relative' 22624 }); 22625 } 22626 22627 if (this.core.s.animateThumb) { 22628 _this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px'); 22629 } 22630 22631 function getThumb(src, thumb, index) { 22632 var isVideo = _this.core.isVideo(src, index) || {}; 22633 var thumbImg; 22634 var vimeoId = ''; 22635 22636 if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) { 22637 if (isVideo.youtube) { 22638 if (_this.core.s.loadYoutubeThumbnail) { 22639 thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg'; 22640 } else { 22641 thumbImg = thumb; 22642 } 22643 } else if (isVideo.vimeo) { 22644 if (_this.core.s.loadVimeoThumbnail) { 22645 thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg'; 22646 vimeoId = isVideo.vimeo[1]; 22647 } else { 22648 thumbImg = thumb; 22649 } 22650 } else if (isVideo.dailymotion) { 22651 if (_this.core.s.loadDailymotionThumbnail) { 22652 thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1]; 22653 } else { 22654 thumbImg = thumb; 22655 } 22656 } 22657 } else { 22658 thumbImg = thumb; 22659 } 22660 22661 thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>'; 22662 vimeoId = ''; 22663 } 22664 22665 if (_this.core.s.dynamic) { 22666 for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { 22667 getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i); 22668 } 22669 } else { 22670 _this.core.$items.each(function(i) { 22671 22672 if (!_this.core.s.exThumbImage) { 22673 getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i); 22674 } else { 22675 getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i); 22676 } 22677 22678 }); 22679 } 22680 22681 _this.core.$outer.find('.lg-thumb').html(thumbList); 22682 22683 $thumb = _this.core.$outer.find('.lg-thumb-item'); 22684 22685 // Load vimeo thumbnails 22686 $thumb.each(function() { 22687 var $this = $(this); 22688 var vimeoVideoId = $this.attr('data-vimeo-id'); 22689 22690 if (vimeoVideoId) { 22691 $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', { 22692 format: 'json' 22693 }, function(data) { 22694 $this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]); 22695 }); 22696 } 22697 }); 22698 22699 // manage active class for thumbnail 22700 $thumb.eq(_this.core.index).addClass('active'); 22701 _this.core.$el.on('onBeforeSlide.lg.tm', function() { 22702 $thumb.removeClass('active'); 22703 $thumb.eq(_this.core.index).addClass('active'); 22704 }); 22705 22706 $thumb.on('click.lg touchend.lg', function() { 22707 var _$this = $(this); 22708 setTimeout(function() { 22709 22710 // In IE9 and bellow touch does not support 22711 // Go to slide if browser does not support css transitions 22712 if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) { 22713 _this.core.index = _$this.index(); 22714 _this.core.slide(_this.core.index, false, true); 22715 } 22716 }, 50); 22717 }); 22718 22719 _this.core.$el.on('onBeforeSlide.lg.tm', function() { 22720 _this.animateThumb(_this.core.index); 22721 }); 22722 22723 $(window).on('resize.lg.thumb orientationchange.lg.thumb', function() { 22724 setTimeout(function() { 22725 _this.animateThumb(_this.core.index); 22726 _this.thumbOuterWidth = _this.$thumbOuter.width(); 22727 }, 200); 22728 }); 22729 22730 }; 22731 22732 Thumbnail.prototype.setTranslate = function(value) { 22733 // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 22734 this.core.$outer.find('.lg-thumb').css({ 22735 transform: 'translate3d(-' + (value) + 'px, 0px, 0px)' 22736 }); 22737 }; 22738 22739 Thumbnail.prototype.animateThumb = function(index) { 22740 var $thumb = this.core.$outer.find('.lg-thumb'); 22741 if (this.core.s.animateThumb) { 22742 var position; 22743 switch (this.core.s.currentPagerPosition) { 22744 case 'left': 22745 position = 0; 22746 break; 22747 case 'middle': 22748 position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2); 22749 break; 22750 case 'right': 22751 position = this.thumbOuterWidth - this.core.s.thumbWidth; 22752 } 22753 this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position; 22754 if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) { 22755 this.left = this.thumbTotalWidth - this.thumbOuterWidth; 22756 } 22757 22758 if (this.left < 0) { 22759 this.left = 0; 22760 } 22761 22762 if (this.core.lGalleryOn) { 22763 if (!$thumb.hasClass('on')) { 22764 this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms'); 22765 } 22766 22767 if (!this.core.doCss()) { 22768 $thumb.animate({ 22769 left: -this.left + 'px' 22770 }, this.core.s.speed); 22771 } 22772 } else { 22773 if (!this.core.doCss()) { 22774 $thumb.css('left', -this.left + 'px'); 22775 } 22776 } 22777 22778 this.setTranslate(this.left); 22779 22780 } 22781 }; 22782 22783 // Enable thumbnail dragging and swiping 22784 Thumbnail.prototype.enableThumbDrag = function() { 22785 22786 var _this = this; 22787 var startCoords = 0; 22788 var endCoords = 0; 22789 var isDraging = false;
22790 var isMoved = false; 22791 var tempLeft = 0; 22792 22793 _this.$thumbOuter.addClass('lg-grab'); 22794 22795 _this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) { 22796 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 22797 // execute only on .lg-object 22798 e.preventDefault(); 22799 startCoords = e.pageX; 22800 isDraging = true; 22801 22802 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 22803 _this.core.$outer.scrollLeft += 1; 22804 _this.core.$outer.scrollLeft -= 1; 22805 22806 // * 22807 _this.thumbClickable = false; 22808 _this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing'); 22809 } 22810 }); 22811 22812 $(window).on('mousemove.lg.thumb', function(e) { 22813 if (isDraging) { 22814 tempLeft = _this.left; 22815 isMoved = true; 22816 endCoords = e.pageX; 22817 22818 _this.$thumbOuter.addClass('lg-dragging'); 22819 22820 tempLeft = tempLeft - (endCoords - startCoords); 22821 22822 if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { 22823 tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; 22824 } 22825 22826 if (tempLeft < 0) { 22827 tempLeft = 0; 22828 } 22829 22830 // move current slide 22831 _this.setTranslate(tempLeft); 22832 22833 } 22834 }); 22835 22836 $(window).on('mouseup.lg.thumb', function() { 22837 if (isMoved) { 22838 isMoved = false; 22839 _this.$thumbOuter.removeClass('lg-dragging'); 22840 22841 _this.left = tempLeft; 22842 22843 if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { 22844 _this.thumbClickable = true; 22845 } 22846 22847 } else { 22848 _this.thumbClickable = true; 22849 } 22850 22851 if (isDraging) { 22852 isDraging = false; 22853 _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab'); 22854 } 22855 }); 22856 22857 }; 22858 22859 Thumbnail.prototype.enableThumbSwipe = function() { 22860 var _this = this; 22861 var startCoords = 0; 22862 var endCoords = 0; 22863 var isMoved = false; 22864 var tempLeft = 0; 22865 22866 _this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) { 22867 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 22868 e.preventDefault(); 22869 startCoords = e.originalEvent.targetTouches[0].pageX; 22870 _this.thumbClickable = false; 22871 } 22872 }); 22873 22874 _this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) { 22875 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 22876 e.preventDefault(); 22877 endCoords = e.originalEvent.targetTouches[0].pageX; 22878 isMoved = true; 22879 22880 _this.$thumbOuter.addClass('lg-dragging'); 22881 22882 tempLeft = _this.left; 22883 22884 tempLeft = tempLeft - (endCoords - startCoords); 22885 22886 if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { 22887 tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; 22888 } 22889 22890 if (tempLeft < 0) { 22891 tempLeft = 0; 22892 } 22893 22894 // move current slide 22895 _this.setTranslate(tempLeft); 22896 22897 } 22898 }); 22899 22900 _this.core.$outer.find('.lg-thumb').on('touchend.lg', function() { 22901 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 22902 22903 if (isMoved) { 22904 isMoved = false; 22905 _this.$thumbOuter.removeClass('lg-dragging'); 22906 if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { 22907 _this.thumbClickable = true; 22908 } 22909 22910 _this.left = tempLeft; 22911 } else { 22912 _this.thumbClickable = true; 22913 } 22914 } else { 22915 _this.thumbClickable = true; 22916 } 22917 }); 22918 22919 }; 22920 22921 Thumbnail.prototype.toogle = function() { 22922 var _this = this; 22923 if (_this.core.s.toogleThumb) { 22924 _this.core.$outer.addClass('lg-can-toggle'); 22925 _this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>'); 22926 _this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() { 22927 _this.core.$outer.toggleClass('lg-thumb-open'); 22928 }); 22929 } 22930 }; 22931 22932 Thumbnail.prototype.thumbkeyPress = function() { 22933 var _this = this; 22934 $(window).on('keydown.lg.thumb', function(e) { 22935 if (e.keyCode === 38) { 22936 e.preventDefault(); 22937 _this.core.$outer.addClass('lg-thumb-open'); 22938 } else if (e.keyCode === 40) { 22939 e.preventDefault(); 22940 _this.core.$outer.removeClass('lg-thumb-open'); 22941 } 22942 }); 22943 }; 22944 22945 Thumbnail.prototype.destroy = function() { 22946 if (this.core.s.thumbnail && this.core.$items.length > 1) { 22947 $(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb'); 22948 this.$thumbOuter.remove(); 22949 this.core.$outer.removeClass('lg-has-thumb'); 22950 } 22951 }; 22952 22953 $.fn.lightGallery.modules.Thumbnail = Thumbnail; 22954 22955})(jQuery, window, document); 22956;// /var/www/www.vfb.de/httpdocs/current/static/js/lightgallery.addHtml.js 22957(function () { 22958 var defaults = { 22959 addHtml: true 22960 }; 22961 22962 var AddHtml = function (element) { 22963 // get lightGallery core plugin data 22964 this.core = $(element).data('lightGallery'); 22965 22966 // extend module default settings with lightGallery core settings 22967 this.core.s = $.extend({}, defaults, this.core.s); 22968 22969 this.$el = $(element); 22970 this.core.addHtml = this.init; 22971 return this; 22972 }; 22973 22974 22975 AddHtml.prototype.init = function(index) { 22976 var subHtml = null, 22977 subHtmlUrl, 22978 subHtmlSelf, 22979 $currSlide = this.$items.eq(index); 22980 if (this.s.dynamic) { 22981 if (this.s.dynamicEl[index].subHtmlUrl) { 22982 subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl; 22983 } else { 22984 subHtml = this.s.dynamicEl[index].subHtml; 22985 } 22986 } else { 22987 if ($currSlide.attr('data-sub-html-url')) { 22988 subHtmlUrl = $currSlide.attr('data-sub-html-url'); 22989 } else { 22990 subHtml = $currSlide.attr('data-sub-html'); 22991 subHtmlSelf = $currSlide.attr('data-sub-html-self'); 22992 if (this.s.getCaptionFromTitleOrAlt && !subHtml) { 22993 subHtml = $currSlide.attr('title') || $currSlide.find('img').first().attr('alt'); 22994 } 22995 } 22996 } 22997 if (!subHtmlUrl) { 22998 if (typeof subHtml !== 'undefined' && subHtml !== null) { 22999 23000 // get first letter of subhtml 23001 // if first letter starts with . or # get the html form the jQuery object 23002 var fL = subHtml.substring(0, 1); 23003 if (fL === '.' || fL === '#') { 23004 if (subHtmlSelf) { 23005 subHtml = $currSlide.find(subHtml).html(); 23006 } else { 23007 subHtml = $(subHtml).html(); 23008 } 23009 } 23010 } else { 23011 subHtml = ''; 23012 } 23013 } 23014 23015 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 23016 23017 if (subHtmlUrl) { 23018 this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl); 23019 } else { 23020 this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); 23021 } 23022 23023 } else { 23024 23025 if (subHtmlUrl) { 23026 this.$slide.eq(index).load(subHtmlUrl); 23027 } else { 23028 this.$slide.eq(index).append(subHtml); 23029 } 23030 } 23031 23032 // Add lg-empty-html class if title doesn't exist 23033 if (typeof subHtml !== 'undefined' && subHtml !== null) { 23034 if (subHtml === '') { 23035 this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); 23036 } else { 23037 this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); 23038 } 23039 } 23040 23041 this.$el.trigger('onAfterAppendSubHtml.lg', [index]); 23042 }; 23043 23044 AddHtml.prototype.destroy = function() { 23045 }; 23046 23047 $.fn.lightGallery.modules.AddHtml = AddHtml; 23048}()); 23049;// /var/www/www.vfb.de/httpdocs/current/static/js/mediaelement-and-player.js 23050/*! 23051 * 23052 * MediaElement.js 23053 * HTML5 <video> and <audio> shim and player 23054 * http://mediaelementjs.com/ 23055 * 23056 * Creates a JavaScript object that mimics HTML5 MediaElement API 23057 * for browsers that don't understand HTML5 or can't play the provided codec 23058 * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 23059 * 23060 * Copyright 2010-2014, John Dyer (http://j.hn) 23061 * License: MIT 23062 * 23063 */ 23064// Namespace 23065var mejs = mejs || {}; 23066 23067// version number 23068mejs.version = '2.23.2'; 23069 23070 23071// player number (for missing, same id attr) 23072mejs.meIndex = 0; 23073 23074// media types accepted by plugins 23075mejs.plugins = { 23076 silverlight: [ 23077 {version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']} 23078 ], 23079 flash: [ 23080 {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a', 'audio/mp4', 'audio/mpeg', 'video/dailymotion', 'video/x-dailymotion', 'application/x-mpegURL', 'audio/ogg']} 23081 // 'video/youtube', 'video/x-youtube', 23082 // ,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!) 23083 ], 23084 youtube: [ 23085 {version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']} 23086 ], 23087 vimeo: [ 23088 {version: null, types: ['video/vimeo', 'video/x-vimeo']} 23089 ] 23090}; 23091 23092/* 23093Utility methods 23094*/ 23095mejs.Utility = { 23096 encodeUrl: function(url) { 23097 return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26'); 23098 }, 23099 escapeHTML: function(s) { 23100 return s.toString().split('&').join('&').split('<').join('<').split('"').join('"'); 23101 }, 23102 absolutizeUrl: function(url) { 23103 var el = document.createElement('div'); 23104 el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>'; 23105 return el.firstChild.href; 23106 }, 23107 getScriptPath: function(scriptNames) { 23108 var 23109 i = 0, 23110 j, 23111 codePath = '', 23112 testname = '', 23113 slashPos, 23114 filenamePos, 23115 scriptUrl, 23116 scriptPath, 23117 scriptFilename, 23118 scripts = document.getElementsByTagName('script'), 23119 il = scripts.length, 23120 jl = scriptNames.length; 23121 23122 // go through all <script> tags 23123 for (; i < il; i++) { 23124 scriptUrl = scripts[i].src; 23125 slashPos = scriptUrl.lastIndexOf('/'); 23126 if (slashPos > -1) { 23127 scriptFilename = scriptUrl.substring(slashPos + 1); 23128 scriptPath = scriptUrl.substring(0, slashPos + 1); 23129 } else { 23130 scriptFilename = scriptUrl; 23131 scriptPath = ''; 23132 } 23133 23134 // see if any <script> tags have a file name that matches the 23135 for (j = 0; j < jl; j++) { 23136 testname = scriptNames[j]; 23137 filenamePos = scriptFilename.indexOf(testname); 23138 if (filenamePos > -1) { 23139 codePath = scriptPath; 23140 break; 23141 } 23142 } 23143 23144 // if we found a path, then break and return it 23145 if (codePath !== '') { 23146 break; 23147 } 23148 } 23149 23150 // send the best path back 23151 return codePath; 23152 }, 23153 /* 23154 * Calculate the time format to use. We have a default format set in the 23155 * options but it can be imcomplete. We ajust it according to the media 23156 * duration. 23157 * 23158 * We support format like 'hh:mm:ss:ff'. 23159 */ 23160 calculateTimeFormat: function(time, options, fps) { 23161 if (time < 0) { 23162 time = 0; 23163 } 23164 23165 if(typeof fps == 'undefined') { 23166 fps = 25; 23167 } 23168 23169 var format = options.timeFormat, 23170 firstChar = format[0], 23171 firstTwoPlaces = (format[1] == format[0]), 23172 separatorIndex = firstTwoPlaces? 2: 1, 23173 separator = ':', 23174 hours = Math.floor(time / 3600) % 24, 23175 minutes = Math.floor(time / 60) % 60, 23176 seconds = Math.floor(time % 60), 23177 frames = Math.floor(((time % 1)*fps).toFixed(3)), 23178 lis = [ 23179 [frames, 'f'], 23180 [seconds, 's'], 23181 [minutes, 'm'], 23182 [hours, 'h'] 23183 ]; 23184 23185 // Try to get the separator from the format 23186 if (format.length < separatorIndex) { 23187 separator = format[separatorIndex]; 23188 } 23189 23190 var required = false;
23191 23192 for (var i=0, len=lis.length; i < len; i++) { 23193 if (format.indexOf(lis[i][1]) !== -1) { 23194 required=true; 23195 } 23196 else if (required) { 23197 var hasNextValue = false; 23198 for (var j=i; j < len; j++) { 23199 if (lis[j][0] > 0) { 23200 hasNextValue = true; 23201 break; 23202 } 23203 } 23204 23205 if (! hasNextValue) { 23206 break; 23207 } 23208 23209 if (!firstTwoPlaces) { 23210 format = firstChar + format; 23211 } 23212 format = lis[i][1] + separator + format; 23213 if (firstTwoPlaces) { 23214 format = lis[i][1] + format; 23215 } 23216 firstChar = lis[i][1]; 23217 } 23218 } 23219 options.currentTimeFormat = format; 23220 }, 23221 /* 23222 * Prefix the given number by zero if it is lower than 10. 23223 */ 23224 twoDigitsString: function(n) { 23225 if (n < 10) { 23226 return '0' + n; 23227 } 23228 return String(n); 23229 }, 23230 secondsToTimeCode: function(time, options) { 23231 if (time < 0) { 23232 time = 0; 23233 } 23234 23235 // Maintain backward compatibility with method signature before v2.18. 23236 if (typeof options !== 'object') { 23237 var format = 'm:ss'; 23238 format = arguments[1] ? 'hh:mm:ss' : format; // forceHours 23239 format = arguments[2] ? format + ':ff' : format; // showFrameCount 23240 23241 options = { 23242 currentTimeFormat: format, 23243 framesPerSecond: arguments[3] || 25 23244 }; 23245 } 23246 23247 var fps = options.framesPerSecond; 23248 if(typeof fps === 'undefined') { 23249 fps = 25; 23250 } 23251 23252 var format = options.currentTimeFormat, 23253 hours = Math.floor(time / 3600) % 24, 23254 minutes = Math.floor(time / 60) % 60, 23255 seconds = Math.floor(time % 60), 23256 frames = Math.floor(((time % 1)*fps).toFixed(3)); 23257 lis = [ 23258 [frames, 'f'], 23259 [seconds, 's'], 23260 [minutes, 'm'], 23261 [hours, 'h'] 23262 ]; 23263 23264 var res = format; 23265 for (i=0,len=lis.length; i < len; i++) { 23266 res = res.replace(lis[i][1]+lis[i][1], this.twoDigitsString(lis[i][0])); 23267 res = res.replace(lis[i][1], lis[i][0]); 23268 } 23269 return res; 23270 }, 23271 23272 timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){ 23273 if (typeof showFrameCount == 'undefined') { 23274 showFrameCount=false; 23275 } else if(typeof fps == 'undefined') { 23276 fps = 25; 23277 } 23278 23279 var tc_array = hh_mm_ss_ff.split(":"), 23280 tc_hh = parseInt(tc_array[0], 10), 23281 tc_mm = parseInt(tc_array[1], 10), 23282 tc_ss = parseInt(tc_array[2], 10), 23283 tc_ff = 0, 23284 tc_in_seconds = 0; 23285 23286 if (showFrameCount) { 23287 tc_ff = parseInt(tc_array[3])/fps; 23288 } 23289 23290 tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff; 23291 23292 return tc_in_seconds; 23293 }, 23294 23295 23296 convertSMPTEtoSeconds: function (SMPTE) { 23297 if (typeof SMPTE != 'string') 23298 return false; 23299 23300 SMPTE = SMPTE.replace(',', '.'); 23301 23302 var secs = 0, 23303 decimalLen = (SMPTE.indexOf('.') != -1) ? SMPTE.split('.')[1].length : 0, 23304 multiplier = 1; 23305 23306 SMPTE = SMPTE.split(':').reverse(); 23307 23308 for (var i = 0; i < SMPTE.length; i++) { 23309 multiplier = 1; 23310 if (i > 0) { 23311 multiplier = Math.pow(60, i); 23312 } 23313 secs += Number(SMPTE[i]) * multiplier; 23314 } 23315 return Number(secs.toFixed(decimalLen)); 23316 }, 23317 23318 /* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */ 23319 removeSwf: function(id) { 23320 var obj = document.getElementById(id); 23321 if (obj && /object|embed/i.test(obj.nodeName)) { 23322 if (mejs.MediaFeatures.isIE) { 23323 obj.style.display = "none"; 23324 (function(){ 23325 if (obj.readyState == 4) { 23326 mejs.Utility.removeObjectInIE(id); 23327 } else { 23328 setTimeout(arguments.callee, 10); 23329 } 23330 })(); 23331 } else { 23332 obj.parentNode.removeChild(obj); 23333 } 23334 } 23335 }, 23336 removeObjectInIE: function(id) { 23337 var obj = document.getElementById(id); 23338 if (obj) { 23339 for (var i in obj) { 23340 if (typeof obj[i] == "function") { 23341 obj[i] = null; 23342 } 23343 } 23344 obj.parentNode.removeChild(obj); 23345 } 23346 }, 23347 determineScheme: function(url) { 23348 if (url && url.indexOf("://") != -1) { 23349 return url.substr(0, url.indexOf("://")+3); 23350 } 23351 return "//"; // let user agent figure this out 23352 }, 23353 23354 // taken from underscore 23355 debounce: function(func, wait, immediate) { 23356 var timeout; 23357 return function() { 23358 var context = this, args = arguments; 23359 var later = function() { 23360 timeout = null; 23361 if (!immediate) func.apply(context, args); 23362 }; 23363 var callNow = immediate && !timeout; 23364 clearTimeout(timeout); 23365 timeout = setTimeout(later, wait);
23366 if (callNow) func.apply(context, args); 23367 }; 23368 } 23369}; 23370 23371 23372// Core detector, plugins are added below 23373mejs.PluginDetector = { 23374 23375 // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]); 23376 hasPluginVersion: function(plugin, v) { 23377 var pv = this.plugins[plugin]; 23378 v[1] = v[1] || 0; 23379 v[2] = v[2] || 0; 23380 return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; 23381 }, 23382 23383 // cached values 23384 nav: window.navigator, 23385 ua: window.navigator.userAgent.toLowerCase(), 23386 23387 // stored version numbers 23388 plugins: [], 23389 23390 // runs detectPlugin() and stores the version number 23391 addPlugin: function(p, pluginName, mimeType, activeX, axDetect) { 23392 this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect); 23393 }, 23394 23395 // get the version number from the mimetype (all but IE) or ActiveX (IE) 23396 detectPlugin: function(pluginName, mimeType, activeX, axDetect) { 23397 23398 var version = [0,0,0], 23399 description, 23400 i, 23401 ax; 23402 23403 // Firefox, Webkit, Opera 23404 if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') { 23405 description = this.nav.plugins[pluginName].description; 23406 if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) { 23407 version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.'); 23408 for (i=0; i<version.length; i++) { 23409 version[i] = parseInt(version[i].match(/\d+/), 10); 23410 } 23411 } 23412 // Internet Explorer / ActiveX 23413 } else if (typeof(window.ActiveXObject) != 'undefined') { 23414 try { 23415 ax = new ActiveXObject(activeX); 23416 if (ax) { 23417 version = axDetect(ax); 23418 } 23419 } 23420 catch (e) { } 23421 } 23422 return version; 23423 } 23424}; 23425 23426// Add Flash detection 23427mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) { 23428 // adapted from SWFObject 23429 var version = [], 23430 d = ax.GetVariable("$version"); 23431 if (d) { 23432 d = d.split(" ")[1].split(","); 23433 version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; 23434 } 23435 return version; 23436}); 23437 23438// Add Silverlight detection 23439mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) { 23440 // Silverlight cannot report its version number to IE 23441 // but it does have a isVersionSupported function, so we have to loop through it to get a version number. 23442 // adapted from http://www.silverlightversion.com/ 23443 var v = [0,0,0,0], 23444 loopMatch = function(ax, v, i, n) { 23445 while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){ 23446 v[i]+=n; 23447 } 23448 v[i] -= n; 23449 }; 23450 loopMatch(ax, v, 0, 1); 23451 loopMatch(ax, v, 1, 1); 23452 loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx) 23453 loopMatch(ax, v, 2, 1000); 23454 loopMatch(ax, v, 2, 100); 23455 loopMatch(ax, v, 2, 10); 23456 loopMatch(ax, v, 2, 1); 23457 loopMatch(ax, v, 3, 1); 23458 23459 return v; 23460}); 23461// add adobe acrobat 23462/* 23463PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) { 23464 var version = [], 23465 d = ax.GetVersions().split(',')[0].split('=')[1].split('.'); 23466 23467 if (d) { 23468 version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; 23469 } 23470 return version; 23471}); 23472*/ 23473// necessary detection (fixes for <IE9) 23474mejs.MediaFeatures = { 23475 init: function() { 23476 var 23477 t = this, 23478 d = document, 23479 nav = mejs.PluginDetector.nav, 23480 ua = mejs.PluginDetector.ua.toLowerCase(), 23481 i, 23482 v, 23483 html5Elements = ['source','track','audio','video']; 23484 23485 // detect browsers (only the ones that have some kind of quirk we need to work around) 23486 t.isiPad = (ua.match(/ipad/i) !== null); 23487 t.isiPhone = (ua.match(/iphone/i) !== null); 23488 t.isiOS = t.isiPhone || t.isiPad; 23489 t.isAndroid = (ua.match(/android/i) !== null); 23490 t.isBustedAndroid = (ua.match(/android 2\.[12]/) !== null); 23491 t.isBustedNativeHTTPS = (location.protocol === 'https:' && (ua.match(/android [12]\./) !== null || ua.match(/macintosh.* version.* safari/) !== null)); 23492 t.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1 || nav.appName.toLowerCase().match(/trident/gi) !== null); 23493 t.isChrome = (ua.match(/chrome/gi) !== null); 23494 t.isChromium = (ua.match(/chromium/gi) !== null); 23495 t.isFirefox = (ua.match(/firefox/gi) !== null); 23496 t.isWebkit = (ua.match(/webkit/gi) !== null); 23497 t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit && !t.isIE; 23498 t.isOpera = (ua.match(/opera/gi) !== null); 23499 t.hasTouch = ('ontouchstart' in window); // && window.ontouchstart != null); // this breaks iOS 7 23500 23501 // Borrowed from `Modernizr.svgasimg`, sources: 23502 // - https://github.com/Modernizr/Modernizr/issues/687 23503 // - https://github.com/Modernizr/Modernizr/pull/1209/files 23504 t.svgAsImg = !!document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'); 23505 23506 // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection 23507 for (i=0; i<html5Elements.length; i++) { 23508 v = document.createElement(html5Elements[i]); 23509 } 23510 23511 t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid); 23512 23513 // Fix for IE9 on Windows 7N / Windows 7KN (Media Player not installer) 23514 try{ 23515 v.canPlayType("video/mp4"); 23516 }catch(e){ 23517 t.supportsMediaTag = false;
23518 } 23519 23520 t.supportsPointerEvents = (function() { 23521 // TAKEN FROM MODERNIZR 23522 var element = document.createElement('x'), 23523 documentElement = document.documentElement, 23524 getComputedStyle = window.getComputedStyle, 23525 supports; 23526 if(!('pointerEvents' in element.style)){ 23527 return false; 23528 } 23529 element.style.pointerEvents = 'auto'; 23530 element.style.pointerEvents = 'x'; 23531 documentElement.appendChild(element); 23532 supports = getComputedStyle && 23533 getComputedStyle(element, '').pointerEvents === 'auto'; 23534 documentElement.removeChild(element); 23535 return !!supports; 23536 })(); 23537 23538 23539 // Older versions of Firefox can't move plugins around without it resetting, 23540 t.hasFirefoxPluginMovingProblem = false; 23541 23542 // detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails) 23543 23544 // iOS 23545 t.hasiOSFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined'); 23546 23547 // W3C 23548 t.hasNativeFullscreen = (typeof v.requestFullscreen !== 'undefined'); 23549 23550 // webkit/firefox/IE11+ 23551 t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined'); 23552 t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined'); 23553 t.hasMsNativeFullScreen = (typeof v.msRequestFullscreen !== 'undefined'); 23554 23555 t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen || t.hasMsNativeFullScreen); 23556 t.nativeFullScreenEnabled = t.hasTrueNativeFullScreen; 23557 23558 // Enabled? 23559 if (t.hasMozNativeFullScreen) { 23560 t.nativeFullScreenEnabled = document.mozFullScreenEnabled; 23561 } else if (t.hasMsNativeFullScreen) { 23562 t.nativeFullScreenEnabled = document.msFullscreenEnabled; 23563 } 23564 23565 if (t.isChrome) { 23566 t.hasiOSFullScreen = false; 23567 } 23568 23569 if (t.hasTrueNativeFullScreen) { 23570 23571 t.fullScreenEventName = ''; 23572 if (t.hasWebkitNativeFullScreen) { 23573 t.fullScreenEventName = 'webkitfullscreenchange'; 23574 23575 } else if (t.hasMozNativeFullScreen) { 23576 t.fullScreenEventName = 'mozfullscreenchange'; 23577 23578 } else if (t.hasMsNativeFullScreen) { 23579 t.fullScreenEventName = 'MSFullscreenChange'; 23580 } 23581 23582 t.isFullScreen = function() { 23583 if (t.hasMozNativeFullScreen) { 23584 return d.mozFullScreen; 23585 23586 } else if (t.hasWebkitNativeFullScreen) { 23587 return d.webkitIsFullScreen; 23588 23589 } else if (t.hasMsNativeFullScreen) { 23590 return d.msFullscreenElement !== null; 23591 } 23592 } 23593 23594 t.requestFullScreen = function(el) { 23595 23596 if (t.hasWebkitNativeFullScreen) { 23597 el.webkitRequestFullScreen(); 23598 23599 } else if (t.hasMozNativeFullScreen) { 23600 el.mozRequestFullScreen(); 23601 23602 } else if (t.hasMsNativeFullScreen) { 23603 el.msRequestFullscreen(); 23604 23605 } 23606 } 23607 23608 t.cancelFullScreen = function() { 23609 if (t.hasWebkitNativeFullScreen) { 23610 document.webkitCancelFullScreen(); 23611 23612 } else if (t.hasMozNativeFullScreen) { 23613 document.mozCancelFullScreen(); 23614 23615 } else if (t.hasMsNativeFullScreen) { 23616 document.msExitFullscreen(); 23617 23618 } 23619 } 23620 23621 } 23622 23623 23624 // OS X 10.5 can't do this even if it says it can :( 23625 if (t.hasiOSFullScreen && ua.match(/mac os x 10_5/i)) { 23626 t.hasNativeFullScreen = false; 23627 t.hasiOSFullScreen = false; 23628 } 23629 23630 } 23631}; 23632mejs.MediaFeatures.init(); 23633 23634/* 23635extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below) 23636*/ 23637mejs.HtmlMediaElement = { 23638 pluginType: 'native', 23639 isFullScreen: false, 23640 23641 setCurrentTime: function (time) { 23642 this.currentTime = time; 23643 }, 23644 23645 setMuted: function (muted) { 23646 this.muted = muted; 23647 }, 23648 23649 setVolume: function (volume) { 23650 this.volume = volume; 23651 }, 23652 23653 // for parity with the plugin versions 23654 stop: function () { 23655 this.pause(); 23656 }, 23657 23658 // This can be a url string 23659 // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] 23660 setSrc: function (url) { 23661 23662 // Fix for IE9 which can't set .src when there are <source> elements. Awesome, right? 23663 var 23664 existingSources = this.getElementsByTagName('source'); 23665 while (existingSources.length > 0){ 23666 this.removeChild(existingSources[0]); 23667 } 23668 23669 if (typeof url == 'string') { 23670 this.src = url; 23671 } else { 23672 var i, media; 23673 23674 for (i=0; i<url.length; i++) { 23675 media = url[i]; 23676 if (this.canPlayType(media.type)) { 23677 this.src = media.src; 23678 break; 23679 } 23680 } 23681 } 23682 }, 23683 23684 setVideoSize: function (width, height) { 23685 this.width = width; 23686 this.height = height; 23687 } 23688}; 23689 23690/* 23691Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember] 23692*/ 23693mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) { 23694 this.id = pluginid; 23695 this.pluginType = pluginType; 23696 this.src = mediaUrl; 23697 this.events = {}; 23698 this.attributes = {}; 23699}; 23700 23701// JavaScript values and ExternalInterface methods that match HTML5 video properties methods 23702// http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html 23703// http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html 23704mejs.PluginMediaElement.prototype = { 23705 23706 // special 23707 pluginElement: null, 23708 pluginType: '', 23709 isFullScreen: false, 23710 23711 // not implemented :( 23712 playbackRate: -1, 23713 defaultPlaybackRate: -1, 23714 seekable: [], 23715 played: [], 23716 23717 // HTML5 read-only properties 23718 paused: true, 23719 ended: false, 23720 seeking: false, 23721 duration: 0, 23722 error: null, 23723 tagName: '', 23724 23725 // HTML5 get/set properties, but only set (updated by event handlers) 23726 muted: false, 23727 volume: 1, 23728 currentTime: 0, 23729 23730 // HTML5 methods 23731 play: function () { 23732 if (this.pluginApi != null) { 23733 if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { 23734 this.pluginApi.playVideo(); 23735 } else { 23736 this.pluginApi.playMedia(); 23737 } 23738 this.paused = false;
23739 } 23740 }, 23741 load: function () { 23742 if (this.pluginApi != null) { 23743 if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { 23744 } else { 23745 this.pluginApi.loadMedia(); 23746 } 23747 23748 this.paused = false; 23749 } 23750 }, 23751 pause: function () { 23752 if (this.pluginApi != null) { 23753 if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { 23754 if( this.pluginApi.getPlayerState() == 1 ) { 23755 this.pluginApi.pauseVideo(); 23756 } 23757 } else { 23758 this.pluginApi.pauseMedia(); 23759 } 23760 23761 23762 this.paused = true; 23763 } 23764 }, 23765 stop: function () { 23766 if (this.pluginApi != null) { 23767 if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { 23768 this.pluginApi.stopVideo(); 23769 } else { 23770 this.pluginApi.stopMedia(); 23771 } 23772 this.paused = true; 23773 } 23774 }, 23775 canPlayType: function(type) { 23776 var i, 23777 j, 23778 pluginInfo, 23779 pluginVersions = mejs.plugins[this.pluginType]; 23780 23781 for (i=0; i<pluginVersions.length; i++) { 23782 pluginInfo = pluginVersions[i]; 23783 23784 // test if user has the correct plugin version 23785 if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) { 23786 23787 // test for plugin playback types 23788 for (j=0; j<pluginInfo.types.length; j++) { 23789 // find plugin that can play the type 23790 if (type == pluginInfo.types[j]) { 23791 return 'probably'; 23792 } 23793 } 23794 } 23795 } 23796 23797 return ''; 23798 }, 23799 23800 positionFullscreenButton: function(x,y,visibleAndAbove) { 23801 if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) { 23802 this.pluginApi.positionFullscreenButton(Math.floor(x),Math.floor(y),visibleAndAbove); 23803 } 23804 }, 23805 23806 hideFullscreenButton: function() { 23807 if (this.pluginApi != null && this.pluginApi.hideFullscreenButton) { 23808 this.pluginApi.hideFullscreenButton(); 23809 } 23810 }, 23811 23812 23813 // custom methods since not all JavaScript implementations support get/set 23814 23815 // This can be a url string 23816 // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] 23817 setSrc: function (url) { 23818 if (typeof url == 'string') { 23819 this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url)); 23820 this.src = mejs.Utility.absolutizeUrl(url); 23821 } else { 23822 var i, media; 23823 23824 for (i=0; i<url.length; i++) { 23825 media = url[i]; 23826 if (this.canPlayType(media.type)) { 23827 this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src)); 23828 this.src = mejs.Utility.absolutizeUrl(media.src); 23829 break; 23830 } 23831 } 23832 } 23833 23834 }, 23835 setCurrentTime: function (time) { 23836 if (this.pluginApi != null) { 23837 if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { 23838 this.pluginApi.seekTo(time); 23839 } else { 23840 this.pluginApi.setCurrentTime(time); 23841 } 23842 23843 23844 23845 this.currentTime = time; 23846 } 23847 }, 23848 setVolume: function (volume) { 23849 if (this.pluginApi != null) { 23850 // same on YouTube and MEjs 23851 if (this.pluginType == 'youtube') { 23852 this.pluginApi.setVolume(volume * 100); 23853 } else { 23854 this.pluginApi.setVolume(volume); 23855 } 23856 this.volume = volume; 23857 } 23858 }, 23859 setMuted: function (muted) { 23860 if (this.pluginApi != null) { 23861 if (this.pluginType == 'youtube') { 23862 if (muted) { 23863 this.pluginApi.mute(); 23864 } else { 23865 this.pluginApi.unMute(); 23866 } 23867 this.muted = muted; 23868 this.dispatchEvent({type:'volumechange'}); 23869 } else { 23870 this.pluginApi.setMuted(muted); 23871 } 23872 this.muted = muted; 23873 } 23874 }, 23875 23876 // additional non-HTML5 methods 23877 setVideoSize: function (width, height) { 23878 23879 //if (this.pluginType == 'flash' || this.pluginType == 'silverlight') { 23880 if (this.pluginElement && this.pluginElement.style) { 23881 this.pluginElement.style.width = width + 'px'; 23882 this.pluginElement.style.height = height + 'px'; 23883 } 23884 if (this.pluginApi != null && this.pluginApi.setVideoSize) { 23885 this.pluginApi.setVideoSize(width, height); 23886 } 23887 //} 23888 }, 23889 23890 setFullscreen: function (fullscreen) { 23891 if (this.pluginApi != null && this.pluginApi.setFullscreen) { 23892 this.pluginApi.setFullscreen(fullscreen); 23893 } 23894 }, 23895 23896 enterFullScreen: function() { 23897 if (this.pluginApi != null && this.pluginApi.setFullscreen) { 23898 this.setFullscreen(true); 23899 } 23900 23901 }, 23902 23903 exitFullScreen: function() { 23904 if (this.pluginApi != null && this.pluginApi.setFullscreen) { 23905 this.setFullscreen(false); 23906 } 23907 }, 23908 23909 // start: fake events 23910 addEventListener: function (eventName, callback, bubble) { 23911 this.events[eventName] = this.events[eventName] || []; 23912 this.events[eventName].push(callback); 23913 }, 23914 removeEventListener: function (eventName, callback) { 23915 if (!eventName) { this.events = {}; return true; } 23916 var callbacks = this.events[eventName]; 23917 if (!callbacks) return true; 23918 if (!callback) { this.events[eventName] = []; return true; } 23919 for (var i = 0; i < callbacks.length; i++) { 23920 if (callbacks[i] === callback) { 23921 this.events[eventName].splice(i, 1); 23922 return true; 23923 } 23924 } 23925 return false;
23926 }, 23927 dispatchEvent: function (event) { 23928 var i, 23929 args, 23930 callbacks = this.events[event.type]; 23931 23932 if (callbacks) { 23933 for (i = 0; i < callbacks.length; i++) { 23934 callbacks[i].apply(this, [event]); 23935 } 23936 } 23937 }, 23938 // end: fake events 23939 23940 // fake DOM attribute methods 23941 hasAttribute: function(name){ 23942 return (name in this.attributes); 23943 }, 23944 removeAttribute: function(name){ 23945 delete this.attributes[name]; 23946 }, 23947 getAttribute: function(name){ 23948 if (this.hasAttribute(name)) { 23949 return this.attributes[name]; 23950 } 23951 return null; 23952 }, 23953 setAttribute: function(name, value){ 23954 this.attributes[name] = value; 23955 }, 23956 23957 remove: function() { 23958 mejs.Utility.removeSwf(this.pluginElement.id); 23959 } 23960}; 23961 23962/* 23963Default options 23964*/ 23965mejs.MediaElementDefaults = { 23966 // allows testing on HTML5, flash, silverlight 23967 // auto: attempts to detect what the browser can do 23968 // auto_plugin: prefer plugins and then attempt native HTML5 23969 // native: forces HTML5 playback 23970 // shim: disallows HTML5, will attempt either Flash or Silverlight 23971 // none: forces fallback view 23972 mode: 'auto', 23973 // remove or reorder to change plugin priority and availability 23974 plugins: ['flash','silverlight','youtube','vimeo'], 23975 // shows debug errors on screen 23976 enablePluginDebug: false, 23977 // use plugin for browsers that have trouble with Basic Authentication on HTTPS sites 23978 httpsBasicAuthSite: false, 23979 // overrides the type specified, useful for dynamic instantiation 23980 type: '', 23981 // path to Flash and Silverlight plugins 23982 pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']), 23983 // name of flash file 23984 flashName: 'flashmediaelement.swf', 23985 // streamer for RTMP streaming 23986 flashStreamer: '', 23987 // set to 'always' for CDN version 23988 flashScriptAccess: 'sameDomain', 23989 // turns on the smoothing filter in Flash 23990 enablePluginSmoothing: false, 23991 // enabled pseudo-streaming (seek) on .mp4 files 23992 enablePseudoStreaming: false, 23993 // start query parameter sent to server for pseudo-streaming 23994 pseudoStreamingStartQueryParam: 'start', 23995 // name of silverlight file 23996 silverlightName: 'silverlightmediaelement.xap', 23997 // default if the <video width> is not specified 23998 defaultVideoWidth: 480, 23999 // default if the <video height> is not specified 24000 defaultVideoHeight: 270, 24001 // overrides <video width> 24002 pluginWidth: -1, 24003 // overrides <video height> 24004 pluginHeight: -1, 24005 // additional plugin variables in 'key=value' form 24006 pluginVars: [], 24007 // rate in milliseconds for Flash and Silverlight to fire the timeupdate event 24008 // larger number is less accurate, but less strain on plugin->JavaScript bridge 24009 timerRate: 250, 24010 // initial volume for player 24011 startVolume: 0.8, 24012 // custom error message in case media cannot be played; otherwise, Download File 24013 // link will be displayed 24014 customError: "", 24015 success: function () { }, 24016 error: function () { } 24017}; 24018 24019/* 24020Determines if a browser supports the <video> or <audio> element 24021and returns either the native element or a Flash/Silverlight version that 24022mimics HTML5 MediaElement 24023*/ 24024mejs.MediaElement = function (el, o) { 24025 return mejs.HtmlMediaElementShim.create(el,o); 24026}; 24027 24028mejs.HtmlMediaElementShim = { 24029 24030 create: function(el, o) { 24031 var 24032 options = {}, 24033 htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el, 24034 tagName = htmlMediaElement.tagName.toLowerCase(), 24035 isMediaTag = (tagName === 'audio' || tagName === 'video'), 24036 src = (isMediaTag) ? htmlMediaElement.getAttribute('src') : htmlMediaElement.getAttribute('href'), 24037 poster = htmlMediaElement.getAttribute('poster'), 24038 autoplay = htmlMediaElement.getAttribute('autoplay'), 24039 preload = htmlMediaElement.getAttribute('preload'), 24040 controls = htmlMediaElement.getAttribute('controls'), 24041 playback, 24042 prop; 24043 24044 // extend options 24045 for (prop in mejs.MediaElementDefaults) { 24046 options[prop] = mejs.MediaElementDefaults[prop]; 24047 } 24048 for (prop in o) { 24049 options[prop] = o[prop]; 24050 } 24051 24052 24053 // clean up attributes 24054 src = (typeof src == 'undefined' || src === null || src == '') ? null : src; 24055 poster = (typeof poster == 'undefined' || poster === null) ? '' : poster; 24056 preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload; 24057 autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false'); 24058 controls = !(typeof controls == 'undefined' || controls === null || controls === 'false'); 24059 24060 // test for HTML5 and plugin capabilities 24061 playback = this.determinePlayback(htmlMediaElement, options, mejs.MediaFeatures.supportsMediaTag, isMediaTag, src); 24062 playback.url = (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : ''; 24063 playback.scheme = mejs.Utility.determineScheme(playback.url); 24064 24065 if (playback.method == 'native') { 24066 // second fix for android 24067 if (mejs.MediaFeatures.isBustedAndroid) { 24068 htmlMediaElement.src = playback.url; 24069 htmlMediaElement.addEventListener('click', function() { 24070 htmlMediaElement.play(); 24071 }, false); 24072 } 24073 24074 // add methods to native HTMLMediaElement 24075 return this.updateNative(playback, options, autoplay, preload); 24076 } else if (playback.method !== '') { 24077 // create plugin to mimic HTMLMediaElement 24078 24079 return this.createPlugin( playback, options, poster, autoplay, preload, controls); 24080 } else { 24081 // boo, no HTML5, no Flash, no Silverlight. 24082 this.createErrorMessage( playback, options, poster ); 24083 24084 return this; 24085 } 24086 }, 24087 24088 determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) { 24089 var 24090 mediaFiles = [], 24091 i, 24092 j, 24093 k, 24094 l, 24095 n, 24096 type, 24097 result = { method: '', url: '', htmlMediaElement: htmlMediaElement, isVideo: (htmlMediaElement.tagName.toLowerCase() !== 'audio'), scheme: ''}, 24098 pluginName, 24099 pluginVersions, 24100 pluginInfo, 24101 dummy, 24102 media; 24103 24104 // STEP 1: Get URL and type from <video src> or <source src> 24105 24106 // supplied type overrides <video type> and <source type> 24107 if (typeof options.type != 'undefined' && options.type !== '') { 24108 24109 // accept either string or array of types 24110 if (typeof options.type == 'string') { 24111 mediaFiles.push({type:options.type, url:src}); 24112 } else { 24113 24114 for (i=0; i<options.type.length; i++) { 24115 mediaFiles.push({type:options.type[i], url:src}); 24116 } 24117 } 24118 24119 // test for src attribute first 24120 } else if (src !== null) { 24121 type = this.formatType(src, htmlMediaElement.getAttribute('type')); 24122 mediaFiles.push({type:type, url:src}); 24123 24124 // then test for <source> elements 24125 } else { 24126 // test <source> types to see if they are usable 24127 for (i = 0; i < htmlMediaElement.childNodes.length; i++) { 24128 n = htmlMediaElement.childNodes[i]; 24129 if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') { 24130 src = n.getAttribute('src'); 24131 type = this.formatType(src, n.getAttribute('type')); 24132 media = n.getAttribute('media'); 24133 24134 if (!media || !window.matchMedia || (window.matchMedia && window.matchMedia(media).matches)) { 24135 mediaFiles.push({type:type, url:src}); 24136 } 24137 } 24138 } 24139 } 24140 24141 // in the case of dynamicly created players 24142 // check for audio types 24143 if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) { 24144 result.isVideo = false;
24145 } 24146 24147 24148 // STEP 2: Test for playback method 24149 24150 // special case for Android which sadly doesn't implement the canPlayType function (always returns '') 24151 if (result.isVideo && mejs.MediaFeatures.isBustedAndroid) { 24152 htmlMediaElement.canPlayType = function(type) { 24153 return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : ''; 24154 }; 24155 } 24156 24157 // special case for Chromium to specify natively supported video codecs (i.e. WebM and Theora) 24158 if (result.isVideo && mejs.MediaFeatures.isChromium) { 24159 htmlMediaElement.canPlayType = function(type) { 24160 return (type.match(/video\/(webm|ogv|ogg)/gi) !== null) ? 'maybe' : ''; 24161 }; 24162 } 24163 24164 // test for native playback first 24165 if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'native') && !(mejs.MediaFeatures.isBustedNativeHTTPS && options.httpsBasicAuthSite === true)) { 24166 24167 if (!isMediaTag) { 24168 24169 // create a real HTML5 Media Element 24170 dummy = document.createElement( result.isVideo ? 'video' : 'audio'); 24171 htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement); 24172 htmlMediaElement.style.display = 'none'; 24173 24174 // use this one from now on 24175 result.htmlMediaElement = htmlMediaElement = dummy; 24176 } 24177 24178 for (i=0; i<mediaFiles.length; i++) { 24179 // normal check 24180 if (mediaFiles[i].type == "video/m3u8" || htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== '' 24181 // special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg') 24182 || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '' 24183 // special case for m4a supported by detecting mp4 support 24184 || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/m4a/,'mp4')).replace(/no/, '') !== '') { 24185 result.method = 'native'; 24186 result.url = mediaFiles[i].url; 24187 break; 24188 } 24189 } 24190 24191 if (result.method === 'native') { 24192 if (result.url !== null) { 24193 htmlMediaElement.src = result.url; 24194 } 24195 24196 // if `auto_plugin` mode, then cache the native result but try plugins. 24197 if (options.mode !== 'auto_plugin') { 24198 return result; 24199 } 24200 } 24201 } 24202 24203 // if native playback didn't work, then test plugins 24204 if (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'shim') { 24205 for (i=0; i<mediaFiles.length; i++) { 24206 type = mediaFiles[i].type; 24207 24208 // test all plugins in order of preference [silverlight, flash] 24209 for (j=0; j<options.plugins.length; j++) { 24210 24211 pluginName = options.plugins[j]; 24212 24213 // test version of plugin (for future features) 24214 pluginVersions = mejs.plugins[pluginName]; 24215 24216 for (k=0; k<pluginVersions.length; k++) { 24217 pluginInfo = pluginVersions[k]; 24218 24219 // test if user has the correct plugin version 24220 24221 // for youtube/vimeo 24222 if (pluginInfo.version == null || 24223 24224 mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) { 24225 24226 // test for plugin playback types 24227 for (l=0; l<pluginInfo.types.length; l++) { 24228 // find plugin that can play the type 24229 if (type.toLowerCase() == pluginInfo.types[l].toLowerCase()) { 24230 result.method = pluginName; 24231 result.url = mediaFiles[i].url; 24232 return result; 24233 } 24234 } 24235 } 24236 } 24237 } 24238 } 24239 } 24240 24241 // at this point, being in 'auto_plugin' mode implies that we tried plugins but failed. 24242 // if we have native support then return that. 24243 if (options.mode === 'auto_plugin' && result.method === 'native') { 24244 return result; 24245 } 24246 24247 // what if there's nothing to play? just grab the first available 24248 if (result.method === '' && mediaFiles.length > 0) { 24249 result.url = mediaFiles[0].url; 24250 } 24251 24252 return result; 24253 }, 24254 24255 formatType: function(url, type) { 24256 // if no type is supplied, fake it with the extension 24257 if (url && !type) { 24258 return this.getTypeFromFile(url); 24259 } else { 24260 // only return the mime part of the type in case the attribute contains the codec 24261 // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element 24262 // `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4` 24263 24264 if (type && ~type.indexOf(';')) { 24265 return type.substr(0, type.indexOf(';')); 24266 } else { 24267 return type; 24268 } 24269 } 24270 }, 24271 24272 getTypeFromFile: function(url) { 24273 url = url.split('?')[0]; 24274 var 24275 ext = url.substring(url.lastIndexOf('.') + 1).toLowerCase(), 24276 av = /(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video/' : 'audio/'; 24277 return this.getTypeFromExtension(ext, av); 24278 }, 24279 24280 getTypeFromExtension: function(ext, av) { 24281 av = av || ''; 24282 24283 switch (ext) { 24284 case 'mp4': 24285 case 'm4v': 24286 case 'm4a': 24287 case 'f4v': 24288 case 'f4a': 24289 return av + 'mp4'; 24290 case 'flv': 24291 return av + 'x-flv'; 24292 case 'webm': 24293 case 'webma': 24294 case 'webmv': 24295 return av + 'webm'; 24296 case 'ogg': 24297 case 'oga': 24298 case 'ogv': 24299 return av + 'ogg'; 24300 case 'm3u8': 24301 return 'application/x-mpegurl'; 24302 case 'ts': 24303 return av + 'mp2t'; 24304 default: 24305 return av + ext; 24306 } 24307 }, 24308 24309 createErrorMessage: function(playback, options, poster) { 24310 var 24311 htmlMediaElement = playback.htmlMediaElement, 24312 errorContainer = document.createElement('div'), 24313 errorContent = options.customError; 24314 24315 errorContainer.className = 'me-cannotplay'; 24316 24317 try { 24318 errorContainer.style.width = htmlMediaElement.width + 'px'; 24319 errorContainer.style.height = htmlMediaElement.height + 'px'; 24320 } catch (e) {} 24321 24322 if (!errorContent) { 24323 errorContent = '<a href="' + playback.url + '">'; 24324 24325 if (poster !== '') { 24326 errorContent += '<img src="' + poster + '" width="100%" height="100%" alt="" />'; 24327 } 24328 24329 errorContent += '<span>' + mejs.i18n.t('mejs.download-file') + '</span></a>'; 24330 } 24331 24332 errorContainer.innerHTML = errorContent; 24333 24334 htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement); 24335 htmlMediaElement.style.display = 'none'; 24336 24337 options.error(htmlMediaElement); 24338 }, 24339 24340 createPlugin:function(playback, options, poster, autoplay, preload, controls) { 24341 var 24342 htmlMediaElement = playback.htmlMediaElement, 24343 width = 1, 24344 height = 1, 24345 pluginid = 'me_' + playback.method + '_' + (mejs.meIndex++), 24346 pluginMediaElement = new mejs.PluginMediaElement(pluginid, playback.method, playback.url), 24347 container = document.createElement('div'), 24348 specialIEContainer, 24349 node, 24350 initVars; 24351 24352 // copy tagName from html media element 24353 pluginMediaElement.tagName = htmlMediaElement.tagName; 24354 24355 // copy attributes from html media element to plugin media element 24356 for (var i = 0; i < htmlMediaElement.attributes.length; i++) { 24357 var attribute = htmlMediaElement.attributes[i]; 24358 if (attribute.specified) { 24359 pluginMediaElement.setAttribute(attribute.name, attribute.value); 24360 } 24361 } 24362 24363 // check for placement inside a <p> tag (sometimes WYSIWYG editors do this) 24364 node = htmlMediaElement.parentNode; 24365 24366 while (node !== null && node.tagName != null && node.tagName.toLowerCase() !== 'body' && 24367 node.parentNode != null && node.parentNode.tagName != null && node.parentNode.constructor != null && node.parentNode.constructor.name === "ShadowRoot") { 24368 if (node.parentNode.tagName.toLowerCase() === 'p') { 24369 node.parentNode.parentNode.insertBefore(node, node.parentNode); 24370 break; 24371 } 24372 node = node.parentNode; 24373 } 24374 24375 if (playback.isVideo) { 24376 width = (options.pluginWidth > 0) ? options.pluginWidth : (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth; 24377 height = (options.pluginHeight > 0) ? options.pluginHeight : (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight; 24378 24379 // in case of '%' make sure it's encoded 24380 width = mejs.Utility.encodeUrl(width); 24381 height = mejs.Utility.encodeUrl(height); 24382 24383 } else { 24384 if (options.enablePluginDebug) { 24385 width = 320; 24386 height = 240; 24387 } 24388 } 24389 24390 // register plugin 24391 pluginMediaElement.success = options.success; 24392 24393 // add container (must be added to DOM before inserting HTML for IE) 24394 container.className = 'me-plugin'; 24395 container.id = pluginid + '_container'; 24396 24397 if (playback.isVideo) { 24398 htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement); 24399 } else { 24400 document.body.insertBefore(container, document.body.childNodes[0]); 24401 } 24402 24403 if (playback.method === 'flash' || playback.method === 'silverlight') { 24404 24405 var canPlayVideo = htmlMediaElement.getAttribute('type') === 'audio/mp4', 24406 childrenSources = htmlMediaElement.getElementsByTagName('source'); 24407 24408 if (childrenSources && !canPlayVideo) { 24409 for (var i = 0, total = childrenSources.length; i < total; i++) { 24410 if (childrenSources[i].getAttribute('type') === 'audio/mp4') { 24411 canPlayVideo = true; 24412 } 24413 } 24414 } 24415 24416 // flash/silverlight vars 24417 initVars = [
24418 'id=' + pluginid, 24419 'isvideo=' + ((playback.isVideo || canPlayVideo) ? "true" : "false"), 24420 'autoplay=' + ((autoplay) ? "true" : "false"), 24421 'preload=' + preload, 24422 'width=' + width, 24423 'startvolume=' + options.startVolume, 24424 'timerrate=' + options.timerRate, 24425 'flashstreamer=' + options.flashStreamer, 24426 'height=' + height, 24427 'pseudostreamstart=' + options.pseudoStreamingStartQueryParam]; 24428 24429 if (playback.url !== null) { 24430 if (playback.method == 'flash') { 24431 initVars.push('file=' + mejs.Utility.encodeUrl(playback.url)); 24432 } else { 24433 initVars.push('file=' + playback.url); 24434 } 24435 } 24436 if (options.enablePluginDebug) { 24437 initVars.push('debug=true'); 24438 } 24439 if (options.enablePluginSmoothing) { 24440 initVars.push('smoothing=true'); 24441 } 24442 if (options.enablePseudoStreaming) { 24443 initVars.push('pseudostreaming=true'); 24444 } 24445 if (controls) { 24446 initVars.push('controls=true'); // shows controls in the plugin if desired 24447 } 24448 if (options.pluginVars) { 24449 initVars = initVars.concat(options.pluginVars); 24450 } 24451 24452 // call from plugin 24453 window[pluginid + '_init'] = function() { 24454 switch (pluginMediaElement.pluginType) { 24455 case 'flash': 24456 pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(pluginid); 24457 break; 24458 case 'silverlight': 24459 pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id); 24460 pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS; 24461 break; 24462 } 24463 24464 if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) { 24465 pluginMediaElement.success(pluginMediaElement, htmlMediaElement); 24466 } 24467 }; 24468 24469 // event call from plugin 24470 window[pluginid + '_event'] = function(eventName, values) { 24471 24472 var 24473 e, 24474 i, 24475 bufferedTime; 24476 24477 // fake event object to mimic real HTML media event. 24478 e = { 24479 type: eventName, 24480 target: pluginMediaElement 24481 }; 24482 24483 // attach all values to element and event object 24484 for (i in values) { 24485 pluginMediaElement[i] = values[i]; 24486 e[i] = values[i]; 24487 } 24488 24489 // fake the newer W3C buffered TimeRange (loaded and total have been removed) 24490 bufferedTime = values.bufferedTime || 0; 24491 24492 e.target.buffered = e.buffered = { 24493 start: function(index) { 24494 return 0; 24495 }, 24496 end: function (index) { 24497 return bufferedTime; 24498 }, 24499 length: 1 24500 }; 24501 24502 pluginMediaElement.dispatchEvent(e); 24503 } 24504 24505 24506 } 24507 24508 switch (playback.method) { 24509 case 'silverlight': 24510 container.innerHTML = 24511'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + 24512'<param name="initParams" value="' + initVars.join(',') + '" />' + 24513'<param name="windowless" value="true" />' + 24514'<param name="background" value="black" />' + 24515'<param name="minRuntimeVersion" value="3.0.0.0" />' + 24516'<param name="autoUpgrade" value="true" />' + 24517'<param name="source" value="' + options.pluginPath + options.silverlightName + '" />' + 24518'</object>'; 24519 break; 24520 24521 case 'flash': 24522 24523 if (mejs.MediaFeatures.isIE) { 24524 specialIEContainer = document.createElement('div'); 24525 container.appendChild(specialIEContainer); 24526 specialIEContainer.outerHTML = 24527'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 24528'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + 24529'<param name="movie" value="' + options.pluginPath + options.flashName + '?' + (new Date().getTime()) + '" />' + 24530'<param name="flashvars" value="' + initVars.join('&') + '" />' + 24531'<param name="quality" value="high" />' + 24532'<param name="bgcolor" value="#000000" />' + 24533'<param name="wmode" value="transparent" />' + 24534'<param name="allowScriptAccess" value="' + options.flashScriptAccess + '" />' + 24535'<param name="allowFullScreen" value="true" />' + 24536'<param name="scale" value="default" />' + 24537'</object>'; 24538 24539 } else { 24540 24541 container.innerHTML = 24542'<embed id="' + pluginid + '" name="' + pluginid + '" ' + 24543'play="true" ' + 24544'loop="false" ' + 24545'quality="high" ' + 24546'bgcolor="#000000" ' + 24547'wmode="transparent" ' + 24548'allowScriptAccess="' + options.flashScriptAccess + '" ' + 24549'allowFullScreen="true" ' + 24550'type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" ' + 24551'src="' + options.pluginPath + options.flashName + '" ' + 24552'flashvars="' + initVars.join('&') + '" ' + 24553'width="' + width + '" ' + 24554'height="' + height + '" ' + 24555'scale="default"' + 24556'class="mejs-shim"></embed>'; 24557 } 24558 break; 24559 24560 case 'youtube': 24561 24562 24563 var videoId; 24564 // youtu.be url from share button 24565 if (playback.url.lastIndexOf("youtu.be") != -1) { 24566 videoId = playback.url.substr(playback.url.lastIndexOf('/')+1); 24567 if (videoId.indexOf('?') != -1) { 24568 videoId = videoId.substr(0, videoId.indexOf('?')); 24569 } 24570 } 24571 else { 24572 // https://www.youtube.com/watch?v= 24573 var videoIdMatch = playback.url.match( /[?&]v=([^&#]+)|&|#|$/ ); 24574 if ( videoIdMatch ) { 24575 videoId = videoIdMatch[1]; 24576 } 24577 } 24578 youtubeSettings = { 24579 container: container, 24580 containerId: container.id, 24581 pluginMediaElement: pluginMediaElement, 24582 pluginId: pluginid, 24583 videoId: videoId, 24584 height: height, 24585 width: width, 24586 scheme: playback.scheme, 24587 variables: options.youtubeIframeVars 24588 }; 24589 24590 // favor iframe version of YouTube 24591 if (window.postMessage) { 24592 mejs.YouTubeApi.enqueueIframe(youtubeSettings); 24593 } else if (mejs.PluginDetector.hasPluginVersion('flash', [10,0,0]) ) { 24594 mejs.YouTubeApi.createFlash(youtubeSettings, options); 24595 } 24596 break; 24597 24598 // DEMO Code. Does NOT work. 24599 case 'vimeo': 24600 var player_id = pluginid + "_player"; 24601 pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1); 24602 24603 container.innerHTML ='<iframe src="' + playback.scheme + 'player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?api=1&portrait=0&byline=0&title=0&player_id=' + player_id + '" width="' + width +'" height="' + height +'" frameborder="0" class="mejs-shim" id="' + player_id + '" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 24604 if (typeof($f) == 'function') { // froogaloop available 24605 var player = $f(container.childNodes[0]), 24606 playerState = -1; 24607 24608 player.addEvent('ready', function() { 24609 24610 player.playVideo = function() { 24611 player.api( 'play' ); 24612 }; 24613 player.stopVideo = function() { 24614 player.api( 'unload' ); 24615 }; 24616 player.pauseVideo = function() { 24617 player.api( 'pause' ); 24618 }; 24619 player.seekTo = function( seconds ) { 24620 player.api( 'seekTo', seconds ); 24621 }; 24622 player.setVolume = function( volume ) { 24623 player.api( 'setVolume', volume ); 24624 }; 24625 player.setMuted = function( muted ) { 24626 if( muted ) { 24627 player.lastVolume = player.api( 'getVolume' );
24628 player.api( 'setVolume', 0 ); 24629 } else { 24630 player.api( 'setVolume', player.lastVolume ); 24631 delete player.lastVolume; 24632 } 24633 }; 24634 // parity with YT player 24635 player.getPlayerState = function() { 24636 return playerState; 24637 }; 24638 24639 function createEvent(player, pluginMediaElement, eventName, e) { 24640 var event = { 24641 type: eventName, 24642 target: pluginMediaElement 24643 }; 24644 if (eventName == 'timeupdate') { 24645 pluginMediaElement.currentTime = event.currentTime = e.seconds; 24646 pluginMediaElement.duration = event.duration = e.duration; 24647 } 24648 pluginMediaElement.dispatchEvent(event); 24649 } 24650 24651 player.addEvent('play', function() { 24652 playerState = 1; 24653 createEvent(player, pluginMediaElement, 'play'); 24654 createEvent(player, pluginMediaElement, 'playing'); 24655 }); 24656 24657 player.addEvent('pause', function() { 24658 playerState = 2; 24659 createEvent(player, pluginMediaElement, 'pause'); 24660 }); 24661 24662 player.addEvent('finish', function() { 24663 playerState = 0; 24664 createEvent(player, pluginMediaElement, 'ended'); 24665 }); 24666 24667 player.addEvent('playProgress', function(e) { 24668 createEvent(player, pluginMediaElement, 'timeupdate', e); 24669 }); 24670 24671 player.addEvent('seek', function(e) { 24672 playerState = 3; 24673 createEvent(player, pluginMediaElement, 'seeked', e); 24674 }); 24675 24676 player.addEvent('loadProgress', function(e) { 24677 playerState = 3; 24678 createEvent(player, pluginMediaElement, 'progress', e); 24679 }); 24680 24681 pluginMediaElement.pluginElement = container; 24682 pluginMediaElement.pluginApi = player; 24683 24684 pluginMediaElement.success(pluginMediaElement, pluginMediaElement.pluginElement); 24685 }); 24686 } 24687 else { 24688 console.warn("You need to include froogaloop for vimeo to work"); 24689 } 24690 break; 24691 } 24692 // hide original element 24693 htmlMediaElement.style.display = 'none'; 24694 // prevent browser from autoplaying when using a plugin 24695 htmlMediaElement.removeAttribute('autoplay'); 24696 24697 return pluginMediaElement; 24698 }, 24699 24700 updateNative: function(playback, options, autoplay, preload) { 24701 24702 var htmlMediaElement = playback.htmlMediaElement, 24703 m; 24704 24705 24706 // add methods to video object to bring it into parity with Flash Object 24707 for (m in mejs.HtmlMediaElement) { 24708 htmlMediaElement[m] = mejs.HtmlMediaElement[m]; 24709 } 24710 24711 /* 24712 Chrome now supports preload="none" 24713 if (mejs.MediaFeatures.isChrome) { 24714 24715 // special case to enforce preload attribute (Chrome doesn't respect this) 24716 if (preload === 'none' && !autoplay) { 24717 24718 // forces the browser to stop loading (note: fails in IE9) 24719 htmlMediaElement.src = ''; 24720 htmlMediaElement.load(); 24721 htmlMediaElement.canceledPreload = true; 24722 24723 htmlMediaElement.addEventListener('play',function() { 24724 if (htmlMediaElement.canceledPreload) { 24725 htmlMediaElement.src = playback.url; 24726 htmlMediaElement.load(); 24727 htmlMediaElement.play(); 24728 htmlMediaElement.canceledPreload = false; 24729 } 24730 }, false); 24731 // for some reason Chrome forgets how to autoplay sometimes. 24732 } else if (autoplay) { 24733 htmlMediaElement.load(); 24734 htmlMediaElement.play(); 24735 } 24736 } 24737 */ 24738 24739 // fire success code 24740 options.success(htmlMediaElement, htmlMediaElement); 24741 24742 return htmlMediaElement; 24743 } 24744}; 24745 24746/* 24747 - test on IE (object vs. embed) 24748 - determine when to use iframe (Firefox, Safari, Mobile) vs. Flash (Chrome, IE) 24749 - fullscreen? 24750*/ 24751 24752// YouTube Flash and Iframe API 24753mejs.YouTubeApi = { 24754 isIframeStarted: false, 24755 isIframeLoaded: false, 24756 loadIframeApi: function(yt) { 24757 if (!this.isIframeStarted) { 24758 var tag = document.createElement('script'); 24759 tag.src = yt.scheme + "www.youtube.com/player_api"; 24760 var firstScriptTag = document.getElementsByTagName('script')[0]; 24761 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 24762 this.isIframeStarted = true; 24763 } 24764 }, 24765 iframeQueue: [], 24766 enqueueIframe: function(yt) { 24767 24768 if (this.isLoaded) { 24769 this.createIframe(yt); 24770 } else { 24771 this.loadIframeApi(yt); 24772 this.iframeQueue.push(yt); 24773 } 24774 }, 24775 createIframe: function(settings) { 24776 24777 var 24778 pluginMediaElement = settings.pluginMediaElement, 24779 defaultVars = {controls:0, wmode:'transparent'}, 24780 player = new YT.Player(settings.containerId, { 24781 height: settings.height, 24782 width: settings.width, 24783 videoId: settings.videoId, 24784 playerVars: $.extend({}, defaultVars, settings.variables), 24785 events: { 24786 'onReady': function(e) { 24787 24788 // wrapper to match 24789 player.setVideoSize = function(width, height) { 24790 player.setSize(width, height); 24791 }; 24792 24793 // hook up iframe object to MEjs 24794 settings.pluginMediaElement.pluginApi = player; 24795 settings.pluginMediaElement.pluginElement = document.getElementById(settings.containerId); 24796 24797 // init mejs 24798 pluginMediaElement.success(pluginMediaElement, pluginMediaElement.pluginElement); 24799 24800 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'canplay'); 24801 24802 // create timer 24803 setInterval(function() { 24804 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); 24805 }, 250); 24806 24807 if (typeof pluginMediaElement.attributes.autoplay !== 'undefined') { 24808 player.playVideo(); 24809 } 24810 }, 24811 'onStateChange': function(e) { 24812 24813 mejs.YouTubeApi.handleStateChange(e.data, player, pluginMediaElement); 24814 24815 } 24816 } 24817 }); 24818 }, 24819 24820 createEvent: function (player, pluginMediaElement, eventName) { 24821 var event = { 24822 type: eventName, 24823 target: pluginMediaElement 24824 }; 24825 24826 if (player && player.getDuration) { 24827 24828 // time 24829 pluginMediaElement.currentTime = event.currentTime = player.getCurrentTime(); 24830 pluginMediaElement.duration = event.duration = player.getDuration(); 24831 24832 // state 24833 event.paused = pluginMediaElement.paused; 24834 event.ended = pluginMediaElement.ended; 24835 24836 // sound 24837 event.muted = player.isMuted(); 24838 event.volume = player.getVolume() / 100; 24839 24840 // progress 24841 event.bytesTotal = player.getVideoBytesTotal(); 24842 event.bufferedBytes = player.getVideoBytesLoaded(); 24843 24844 // fake the W3C buffered TimeRange 24845 var bufferedTime = event.bufferedBytes / event.bytesTotal * event.duration; 24846 24847 event.target.buffered = event.buffered = { 24848 start: function(index) { 24849 return 0; 24850 }, 24851 end: function (index) { 24852 return bufferedTime; 24853 }, 24854 length: 1 24855 }; 24856 24857 } 24858 24859 // send event up the chain 24860 pluginMediaElement.dispatchEvent(event); 24861 }, 24862 24863 iFrameReady: function() { 24864 24865 this.isLoaded = true; 24866 this.isIframeLoaded = true; 24867 24868 while (this.iframeQueue.length > 0) { 24869 var settings = this.iframeQueue.pop(); 24870 this.createIframe(settings); 24871 } 24872 }, 24873 24874 // FLASH! 24875 flashPlayers: {}, 24876 createFlash: function(settings) { 24877 24878 this.flashPlayers[settings.pluginId] = settings; 24879 24880 /* 24881 settings.container.innerHTML = 24882 '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + settings.scheme + 'www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0" ' + 24883 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + 24884 '<param name="allowScriptAccess" value="sameDomain">' + 24885 '<param name="wmode" value="transparent">' + 24886 '</object>'; 24887 */ 24888 24889 var specialIEContainer, 24890 youtubeUrl = settings.scheme + 'www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0'; 24891 24892 if (mejs.MediaFeatures.isIE) { 24893 24894 specialIEContainer = document.createElement('div'); 24895 settings.container.appendChild(specialIEContainer); 24896 specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + settings.scheme + 'download.macromedia.com/pub/s
24896hockwave/cabs/flash/swflash.cab" ' + 24897'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '" class="mejs-shim">' + 24898 '<param name="movie" value="' + youtubeUrl + '" />' + 24899 '<param name="wmode" value="transparent" />' + 24900 '<param name="allowScriptAccess" value="' + options.flashScriptAccess + '" />' + 24901 '<param name="allowFullScreen" value="true" />' + 24902'</object>'; 24903 } else { 24904 settings.container.innerHTML = 24905 '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' + 24906 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + 24907 '<param name="allowScriptAccess" value="' + options.flashScriptAccess + '">' + 24908 '<param name="wmode" value="transparent">' + 24909 '</object>'; 24910 } 24911 24912 }, 24913 24914 flashReady: function(id) { 24915 var 24916 settings = this.flashPlayers[id], 24917 player = document.getElementById(id), 24918 pluginMediaElement = settings.pluginMediaElement; 24919 24920 // hook up and return to MediaELementPlayer.success 24921 pluginMediaElement.pluginApi = 24922 pluginMediaElement.pluginElement = player; 24923 24924 settings.success(pluginMediaElement, pluginMediaElement.pluginElement); 24925 24926 // load the youtube video 24927 player.cueVideoById(settings.videoId); 24928 24929 var callbackName = settings.containerId + '_callback'; 24930 24931 window[callbackName] = function(e) { 24932 mejs.YouTubeApi.handleStateChange(e, player, pluginMediaElement); 24933 }; 24934 24935 player.addEventListener('onStateChange', callbackName); 24936 24937 setInterval(function() { 24938 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); 24939 }, 250); 24940 24941 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'canplay'); 24942 }, 24943 24944 handleStateChange: function(youTubeState, player, pluginMediaElement) { 24945 switch (youTubeState) { 24946 case -1: // not started 24947 pluginMediaElement.paused = true; 24948 pluginMediaElement.ended = true; 24949 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'loadedmetadata'); 24950 //createYouTubeEvent(player, pluginMediaElement, 'loadeddata'); 24951 break; 24952 case 0: 24953 pluginMediaElement.paused = false; 24954 pluginMediaElement.ended = true; 24955 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'ended'); 24956 break; 24957 case 1: 24958 pluginMediaElement.paused = false; 24959 pluginMediaElement.ended = false; 24960 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'play'); 24961 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'playing'); 24962 break; 24963 case 2: 24964 pluginMediaElement.paused = true; 24965 pluginMediaElement.ended = false; 24966 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'pause'); 24967 break; 24968 case 3: // buffering 24969 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'progress'); 24970 break; 24971 case 5: 24972 // cued? 24973 break; 24974 24975 } 24976 24977 } 24978} 24979// IFRAME 24980window.onYouTubePlayerAPIReady = function() { 24981 mejs.YouTubeApi.iFrameReady(); 24982}; 24983// FLASH 24984window.onYouTubePlayerReady = function(id) { 24985 mejs.YouTubeApi.flashReady(id); 24986}; 24987 24988window.mejs = mejs; 24989window.MediaElement = mejs.MediaElement; 24990 24991/* 24992 * Adds Internationalization and localization to mediaelement. 24993 * 24994 * This file does not contain translations, you have to add them manually. 24995 * The schema is always the same: me-i18n-locale-[IETF-language-tag].js 24996 * 24997 * What is the concept beyond i18n? 24998 * http://en.wikipedia.org/wiki/Internationalization_and_localization 24999 * 25000 * What langcode should i use? 25001 * http://en.wikipedia.org/wiki/IETF_language_tag 25002 * https://tools.ietf.org/html/rfc5646 25003 * 25004 * 25005 * License? 25006 * 25007 * The i18n file uses methods from the Drupal project (drupal.js): 25008 * - i18n.methods.t() (modified) 25009 * - i18n.methods.checkPlain() (full copy) 25010 * 25011 * The Drupal project is (like mediaelementjs) licensed under GPLv2. 25012 * - http://drupal.org/licensing/faq/#q1 25013 * - https://github.com/johndyer/mediaelement 25014 * - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 25015 * 25016 * 25017 * @author 25018 * Tim Latz ([email protected]) 25019 * 25020 * 25021 * @params 25022 * - context - document, iframe .. 25023 * - exports - CommonJS, window .. 25024 * 25025 */ 25026;(function(context, exports, undefined) { 25027 ; 25028 25029 var i18n = { 25030 "default": 'en', 25031 "locale": { 25032 // Ensure previous values aren't overwritten. 25033 "language" : (exports.i18n && exports.i18n.locale.language) || '', 25034 "strings" : (exports.i18n && exports.i18n.locale.strings) || {} 25035 }, 25036 "ietf_lang_regex" : /^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/, 25037 "methods" : {} 25038 }; 25039// start i18n 25040 25041 25042 /** 25043 * Get language, fallback to browser's language if empty 25044 * 25045 * IETF: RFC 5646, https://tools.ietf.org/html/rfc5646 25046 * Examples: en, zh-CN, cmn-Hans-CN, sr-Latn-RS, es-419, x-private 25047 */ 25048 i18n.getLanguage = function () { 25049 var language = i18n.locale.language || window.navigator.userLanguage || window.navigator.language; 25050 return i18n.ietf_lang_regex.exec(language) ? language : null; 25051 25052 //(WAS: convert to iso 639-1 (2-letters, lower case)) 25053 //return language.substr(0, 2).toLowerCase(); 25054 }; 25055 25056 // i18n fixes for compatibility with WordPress 25057 if ( typeof mejsL10n != 'undefined' ) { 25058 i18n.locale.language = mejsL10n.language; 25059 } 25060 25061 25062 25063 /** 25064 * Encode special characters in a plain-text string for display as HTML. 25065 */ 25066 i18n.methods.checkPlain = function (str) { 25067 var character, regex, 25068 replace = { 25069 '&': '&', 25070 '"': '"', 25071 '<': '<', 25072 '>': '>' 25073 }; 25074 str = String(str); 25075 for (character in replace) { 25076 if (replace.hasOwnProperty(character)) { 25077 regex = new RegExp(character, 'g'); 25078 str = str.replace(regex, replace[character]); 25079 } 25080 } 25081 return str; 25082 }; 25083 25084 /** 25085 * Translate strings to the page language or a given language. 25086 * 25087 * 25088 * @param uid 25089 * A string containing a unique id of the translated text to retrieve. 25090 * 25091 * @param options 25092 * - 'context' (defaults to the default context): The context the source string 25093 * belongs to. 25094 * 25095 * @return 25096 * The translated string, escaped via i18n.methods.checkPlain() 25097 */ 25098 i18n.methods.t = function (uid, options) { 25099 var str; 25100 25101 // Fetch the localized version of the string. 25102 if (i18n.locale.strings && i18n.locale.strings[options.context]) { 25103 str = i18n.locale.strings[options.context][uid]; 25104 } 25105 25106 // Fallback to default language if requested uid is not translated 25107 if (!str && i18n.locale.strings && i18n.locale.strings[i18n["default"]]) { 25108 str = i18n.locale.strings[i18n["default"]][uid]; 25109 } 25110 25111 // As a last resort, use the requested uid, to mimic original behavior of i18n utils (in which uid was the english text) 25112 str = str || uid; 25113 25114 return i18n.methods.checkPlain(str); 25115 }; 25116 25117 25118 /** 25119 * Wrapper for i18n.methods.t() 25120 * 25121 * @see i18n.methods.t() 25122 * @throws InvalidArgumentException 25123 */ 25124 i18n.t = function(str, options) { 25125 25126 if (typeof str === 'string' && str.length > 0) { 25127 25128 // check every time due language can change for 25129 // different reasons (translation, lang switcher ..) 25130 var language = i18n.getLanguage(); 25131 25132 options = options || { 25133 "context" : language 25134 }; 25135 25136 return i18n.methods.t(str, options); 25137 } 25138 else { 25139 throw { 25140 "name" : 'InvalidArgumentException', 25141 "message" : 'First argument is either not a string or empty.' 25142 }; 25143 } 25144 }; 25145 25146// end i18n 25147 exports.i18n = i18n; 25148}(document, mejs)); 25149 25150// i18n fixes for compatibility with WordPress 25151;(function(exports, undefined) { 25152 25153 ; 25154 25155 if ( typeof mejsL10n != 'undefined' ) { 25156 exports[mejsL10n.language] = mejsL10n.strings; 25157 } 25158 25159}(mejs.i18n.locale.strings)); 25160 25161/*! 25162 * This is a i18n.locale language object. 25163 * 25164 * English; This can serve as a template for other languages to translate 25165 * 25166 * @author 25167 * TBD 25168 * 25169 * @see 25170 * me-i18n.js 25171 * 25172 * @params 25173 * - exports - CommonJS, window .. 25174 */ 25175;(function(exports, undefined) { 25176 25177 ; 25178 25179 if (typeof exports.en === 'undefined') { 25180 exports.en = { 25181 // me-shim 25182 'mejs.download-file': 'Download File', 25183 25184 // mep-feature-contextmenu
25185 'mejs.fullscreen-off': 'Turn off Fullscreen', 25186 'mejs.fullscreen-on' : 'Go Fullscreen', 25187 // Duplicated from mep-feature-volume 25188 // 'mejs.unmute' : 'Unmute', 25189 // 'mejs.mute' : 'Mute', 25190 'mejs.download-video' : 'Download Video', 25191 25192 // mep-feature-fullscreen 25193 'mejs.fullscreen' : 'Fullscreen', 25194 25195 // mep-feature-jumpforward 25196 'mejs.time-jump-forward': 'Jump forward %1 seconds', 25197 25198 // mep-feature-playpause 25199 'mejs.play': 'Play', 25200 'mejs.pause': 'Pause', 25201 25202 // mep-feature-postroll 25203 'mejs.close' : 'Close', 25204 25205 // mep-feature-progress 25206 'mejs.time-slider': 'Time Slider', 25207 'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.', 25208 25209 // mep-feature-skipback 25210 'mejs.time-skip-back': 'Skip back %1 seconds', 25211 25212 // mep-feature-tracks 25213 'mejs.captions-subtitles' : 'Captions/Subtitles', 25214 'mejs.none' : 'None', 25215 25216 // mep-feature-volume 25217 'mejs.mute-toggle' : 'Mute Toggle', 25218 'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.', 25219 'mejs.unmute' : 'Unmute', 25220 'mejs.mute' : 'Mute', 25221 'mejs.volume-slider': 'Volume Slider', 25222 25223 // mep-player 25224 'mejs.video-player': 'Video Player', 25225 'mejs.audio-player': 'Audio Player', 25226 25227 // mep-feature-ads 25228 'mejs.ad-skip': 'Skip ad', 25229 'mejs.ad-skip-info': 'Skip in %1 seconds', 25230 25231 'mejs.source-chooser': 'Source Chooser' 25232 }; 25233 } 25234 25235}(mejs.i18n.locale.strings)); 25236 25237/*! 25238 * 25239 * MediaElementPlayer 25240 * http://mediaelementjs.com/ 25241 * 25242 * Creates a controller bar for HTML5 <video> add <audio> tags 25243 * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) 25244 * 25245 * Copyright 2010-2013, John Dyer (http://j.hn/) 25246 * License: MIT 25247 * 25248 */ 25249if (typeof jQuery != 'undefined') { 25250 mejs.$ = jQuery; 25251} else if (typeof Zepto != 'undefined') { 25252 mejs.$ = Zepto; 25253 25254 // define `outerWidth` method which has not been realized in Zepto 25255 Zepto.fn.outerWidth = function(includeMargin) { 25256 var width = $(this).width(); 25257 if (includeMargin) { 25258 width += parseInt($(this).css('margin-right'), 10); 25259 width += parseInt($(this).css('margin-left'), 10); 25260 } 25261 return width 25262 } 25263 25264} else if (typeof ender != 'undefined') { 25265 mejs.$ = ender; 25266} 25267(function ($) { 25268 25269 // default player values 25270 mejs.MepDefaults = { 25271 // url to poster (to fix iOS 3.x) 25272 poster: '', 25273 // When the video is ended, we can show the poster. 25274 showPosterWhenEnded: false, 25275 // default if the <video width> is not specified 25276 defaultVideoWidth: 480, 25277 // default if the <video height> is not specified 25278 defaultVideoHeight: 270, 25279 // if set, overrides <video width> 25280 videoWidth: -1, 25281 // if set, overrides <video height> 25282 videoHeight: -1, 25283 // default if the user doesn't specify 25284 defaultAudioWidth: 400, 25285 // default if the user doesn't specify 25286 defaultAudioHeight: 30, 25287 // default amount to move back when back key is pressed 25288 defaultSeekBackwardInterval: function(media) { 25289 return (media.duration * 0.05); 25290 }, 25291 // default amount to move forward when forward key is pressed 25292 defaultSeekForwardInterval: function(media) { 25293 return (media.duration * 0.05); 25294 }, 25295 // set dimensions via JS instead of CSS 25296 setDimensions: true, 25297 // width of audio player 25298 audioWidth: -1, 25299 // height of audio player 25300 audioHeight: -1, 25301 // initial volume when the player starts (overrided by user cookie) 25302 startVolume: 0.8, 25303 // useful for <audio> player loops 25304 loop: false, 25305 // rewind to beginning when media ends 25306 autoRewind: true, 25307 // resize to media dimensions 25308 enableAutosize: true, 25309 /* 25310 * Time format to use. Default: 'mm:ss' 25311 * Supported units: 25312 * h: hour 25313 * m: minute 25314 * s: second 25315 * f: frame count 25316 * When using 'hh', 'mm', 'ss' or 'ff' we always display 2 digits. 25317 * If you use 'h', 'm', 's' or 'f' we display 1 digit if possible. 25318 * 25319 * Example to display 75 seconds: 25320 * Format 'mm:ss': 01:15 25321 * Format 'm:ss': 1:15 25322 * Format 'm:s': 1:15 25323 */ 25324 timeFormat: '', 25325 // forces the hour marker (##:00:00) 25326 alwaysShowHours: false, 25327 // show framecount in timecode (##:00:00:00)
25328 showTimecodeFrameCount: false, 25329 // used when showTimecodeFrameCount is set to true 25330 framesPerSecond: 25, 25331 // automatically calculate the width of the progress bar based on the sizes of other elements 25332 autosizeProgress : true, 25333 // Hide controls when playing and mouse is not over the video 25334 alwaysShowControls: false, 25335 // Display the video control 25336 hideVideoControlsOnLoad: false, 25337 // Enable click video element to toggle play/pause 25338 clickToPlayPause: true, 25339 // Time in ms to hide controls 25340 controlsTimeoutDefault: 1500, 25341 // Time in ms to trigger the timer when mouse moves 25342 controlsTimeoutMouseEnter: 2500, 25343 // Time in ms to trigger the timer when mouse leaves 25344 controlsTimeoutMouseLeave: 1000, 25345 // force iPad's native controls 25346 iPadUseNativeControls: false, 25347 // force iPhone's native controls 25348 iPhoneUseNativeControls: false, 25349 // force Android's native controls 25350 AndroidUseNativeControls: false, 25351 // features to show 25352 features: ['playpause','current','progress','duration','tracks','volume','fullscreen'], 25353 // only for dynamic 25354 isVideo: true, 25355 // stretching modes (auto, fill, responsive, none) 25356 stretching: 'auto', 25357 // turns keyboard support on and off for this instance 25358 enableKeyboard: true, 25359 // when this player starts, it will pause other players 25360 pauseOtherPlayers: true, 25361 // array of keyboard actions such as play pause 25362 keyActions: [ 25363 { 25364 keys: [ 25365 32, // SPACE 25366 179 // GOOGLE play/pause button 25367 ], 25368 action: function(player, media, key, event) { 25369 25370 if (!mejs.MediaFeatures.isFirefox) { 25371 if (media.paused || media.ended) { 25372 media.play(); 25373 } else { 25374 media.pause(); 25375 } 25376 } 25377 } 25378 }, 25379 { 25380 keys: [38], // UP 25381 action: function(player, media, key, event) { 25382 player.container.find('.mejs-volume-slider').css('display','block'); 25383 if (player.isVideo) { 25384 player.showControls(); 25385 player.startControlsTimer(); 25386 } 25387 25388 var newVolume = Math.min(media.volume + 0.1, 1); 25389 media.setVolume(newVolume); 25390 } 25391 }, 25392 { 25393 keys: [40], // DOWN 25394 action: function(player, media, key, event) { 25395 player.container.find('.mejs-volume-slider').css('display','block'); 25396 if (player.isVideo) { 25397 player.showControls(); 25398 player.startControlsTimer(); 25399 } 25400 25401 var newVolume = Math.max(media.volume - 0.1, 0); 25402 media.setVolume(newVolume); 25403 } 25404 }, 25405 { 25406 keys: [ 25407 37, // LEFT 25408 227 // Google TV rewind 25409 ], 25410 action: function(player, media, key, event) { 25411 if (!isNaN(media.duration) && media.duration > 0) { 25412 if (player.isVideo) { 25413 player.showControls(); 25414 player.startControlsTimer(); 25415 } 25416 25417 // 5% 25418 var newTime = Math.max(media.currentTime - player.options.defaultSeekBackwardInterval(media), 0); 25419 media.setCurrentTime(newTime); 25420 } 25421 } 25422 }, 25423 { 25424 keys: [ 25425 39, // RIGHT 25426 228 // Google TV forward 25427 ], 25428 action: function(player, media, key, event) { 25429 if (!isNaN(media.duration) && media.duration > 0) { 25430 if (player.isVideo) { 25431 player.showControls(); 25432 player.startControlsTimer(); 25433 } 25434 25435 // 5% 25436 var newTime = Math.min(media.currentTime + player.options.defaultSeekForwardInterval(media), media.duration); 25437 media.setCurrentTime(newTime); 25438 } 25439 } 25440 }, 25441 { 25442 keys: [70], // F 25443 action: function(player, media, key, event) { 25444 if (typeof player.enterFullScreen != 'undefined') { 25445 if (player.isFullScreen) { 25446 player.exitFullScreen(); 25447 } else { 25448 player.enterFullScreen(); 25449 } 25450 } 25451 } 25452 }, 25453 { 25454 keys: [77], // M 25455 action: function(player, media, key, event) { 25456 player.container.find('.mejs-volume-slider').css('display','block'); 25457 if (player.isVideo) { 25458 player.showControls(); 25459 player.startControlsTimer(); 25460 } 25461 if (player.media.muted) { 25462 player.setMuted(false); 25463 } else { 25464 player.setMuted(true); 25465 } 25466 } 25467 } 25468 ] 25469 }; 25470 25471 mejs.mepIndex = 0; 25472 25473 mejs.players = {}; 25474 25475 // wraps a MediaElement object in player controls 25476 mejs.MediaElementPlayer = function(node, o) { 25477 // enforce object, even without "new" (via John Resig) 25478 if ( !(this instanceof mejs.MediaElementPlayer) ) { 25479 return new mejs.MediaElementPlayer(node, o); 25480 } 25481 25482 var t = this; 25483 25484 // these will be reset after the MediaElement.success fires 25485 t.$media = t.$node = $(node); 25486 t.node = t.media = t.$media[0]; 25487 25488 if(!t.node) { 25489 return; 25490 } 25491 25492 // check for existing player 25493 if (typeof t.node.player != 'undefined') { 25494 return t.node.player; 25495 } 25496 25497 25498 // try to get options from data-mejsoptions 25499 if (typeof o == 'undefined') { 25500 o = t.$node.data('mejsoptions'); 25501 } 25502 25503 // extend default options 25504 t.options = $.extend({},mejs.MepDefaults,o); 25505 25506 if (!t.options.timeFormat) { 25507 // Generate the time format according to options 25508 t.options.timeFormat = 'mm:ss'; 25509 if (t.options.alwaysShowHours) { 25510 t.options.timeFormat = 'hh:mm:ss'; 25511 }
25512 if (t.options.showTimecodeFrameCount) { 25513 t.options.timeFormat += ':ff'; 25514 } 25515 } 25516 25517 mejs.Utility.calculateTimeFormat(0, t.options, t.options.framesPerSecond || 25); 25518 25519 // unique ID 25520 t.id = 'mep_' + mejs.mepIndex++; 25521 25522 // add to player array (for focus events) 25523 mejs.players[t.id] = t; 25524 25525 // start up 25526 t.init(); 25527 25528 return t; 25529 }; 25530 25531 // actual player 25532 mejs.MediaElementPlayer.prototype = { 25533 25534 hasFocus: false, 25535 25536 controlsAreVisible: true, 25537 25538 init: function() { 25539 25540 var 25541 t = this, 25542 mf = mejs.MediaFeatures, 25543 // options for MediaElement (shim) 25544 meOptions = $.extend(true, {}, t.options, { 25545 success: function(media, domNode) { t.meReady(media, domNode); }, 25546 error: function(e) { t.handleError(e);} 25547 }), 25548 tagName = t.media.tagName.toLowerCase(); 25549 25550 t.isDynamic = (tagName !== 'audio' && tagName !== 'video'); 25551 25552 if (t.isDynamic) { 25553 // get video from src or href? 25554 t.isVideo = t.options.isVideo; 25555 } else { 25556 t.isVideo = (tagName !== 'audio' && t.options.isVideo); 25557 } 25558 25559 // use native controls in iPad, iPhone, and Android 25560 if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) { 25561 25562 // add controls and stop 25563 t.$media.attr('controls', 'controls'); 25564 25565 // attempt to fix iOS 3 bug 25566 //t.$media.removeAttr('poster'); 25567 // no Issue found on iOS3 -ttroxell 25568 25569 // override Apple's autoplay override for iPads 25570 if (mf.isiPad && t.media.getAttribute('autoplay') !== null) { 25571 t.play(); 25572 } 25573 25574 } else if (mf.isAndroid && t.options.AndroidUseNativeControls) { 25575 25576 // leave default player 25577 25578 } else if (t.isVideo || (!t.isVideo && t.options.features.length)) { 25579 25580 // DESKTOP: use MediaElementPlayer controls 25581 25582 // remove native controls 25583 t.$media.removeAttr('controls'); 25584 var videoPlayerTitle = t.isVideo ? 25585 mejs.i18n.t('mejs.video-player') : mejs.i18n.t('mejs.audio-player'); 25586 // insert description for screen readers 25587 $('<span class="mejs-offscreen">' + videoPlayerTitle + '</span>').insertBefore(t.$media); 25588 // build container 25589 t.container = 25590 $('<div id="' + t.id + '" class="mejs-container ' + (mejs.MediaFeatures.svgAsImg ? 'svg' : 'no-svg') + 25591 '" tabindex="0" role="application" aria-label="' + videoPlayerTitle + '">'+ 25592 '<div class="mejs-inner">'+ 25593 '<div class="mejs-mediaelement"></div>'+ 25594 '<div class="mejs-layers"></div>'+ 25595 '<div class="mejs-controls"></div>'+ 25596 '<div class="mejs-clear"></div>'+ 25597 '</div>' + 25598 '</div>') 25599 .addClass(t.$media[0].className) 25600 .insertBefore(t.$media) 25601 .focus(function ( e ) { 25602 if( !t.controlsAreVisible && !t.hasFocus && t.controlsEnabled) { 25603 t.showControls(true); 25604 // In versions older than IE11, the focus causes the playbar to be displayed 25605 // if user clicks on the Play/Pause button in the control bar once it attempts 25606 // to hide it 25607 if (!t.hasMsNativeFullScreen) { 25608 var playButton = t.container.find('.mejs-playpause-button > button'); 25609 playButton.focus(); 25610 } 25611 } 25612 }); 25613 25614 // When no elements in controls, hide bar completely 25615 if (!t.options.features.length) { 25616 t.container.css('background', 'transparent').find('.mejs-controls').hide(); 25617 } 25618 25619 if (t.isVideo && t.options.stretching === 'fill' && !t.container.parent('mejs-fill-container').length) { 25620 // outer container 25621 t.outerContainer = t.$media.parent(); 25622 t.container.wrap('<div class="mejs-fill-container"/>'); 25623 } 25624 25625 // add classes for user and content 25626 t.container.addClass( 25627 (mf.isAndroid ? 'mejs-android ' : '') + 25628 (mf.isiOS ? 'mejs-ios ' : '') + 25629 (mf.isiPad ? 'mejs-ipad ' : '') + 25630 (mf.isiPhone ? 'mejs-iphone ' : '') + 25631 (t.isVideo ? 'mejs-video ' : 'mejs-audio ') 25632 ); 25633 25634 25635 // move the <video/video> tag into the right spot 25636 t.container.find('.mejs-mediaelement').append(t.$media); 25637 25638 // needs to be assigned here, after iOS remap 25639 t.node.player = t; 25640 25641 // find parts 25642 t.controls = t.container.find('.mejs-controls'); 25643 t.layers = t.container.find('.mejs-layers'); 25644 25645 // determine the size 25646 25647 /* size priority: 25648 (1) videoWidth (forced), 25649 (2) style="width;height;" 25650 (3) width attribute, 25651 (4) defaultVideoWidth (for unspecified cases) 25652 */ 25653 25654 var tagType = (t.isVideo ? 'video' : 'audio'), 25655 capsTagName = tagType.substring(0,1).toUpperCase() + tagType.substring(1); 25656 25657 25658 25659 if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) { 25660 t.width = t.options[tagType + 'Width']; 25661 } else if (t.media.style.width !== '' && t.media.style.width !== null) { 25662 t.width = t.media.style.width; 25663 } else if (t.media.getAttribute('width') !== null) { 25664 t.width = t.$media.attr('width'); 25665 } else { 25666 t.width = t.options['default' + capsTagName + 'Width']; 25667 } 25668 25669 if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) { 25670 t.height = t.options[tagType + 'Height']; 25671 } else if (t.media.style.height !== '' && t.media.style.height !== null) { 25672 t.height = t.media.style.height; 25673 } else if (t.$media[0].getAttribute('height') !== null) { 25674 t.height = t.$media.attr('height'); 25675 } else { 25676 t.height = t.options['default' + capsTagName + 'Height']; 25677 } 25678 25679 // set the size, while we wait for the plugins to load below 25680 t.setPlayerSize(t.width, t.height); 25681 25682 // create MediaElementShim 25683 meOptions.pluginWidth = t.width; 25684 meOptions.pluginHeight = t.height; 25685 } 25686 // Hide media completely for audio that doesn't have any features 25687 else if (!t.isVideo && !t.options.features.length) { 25688 t.$media.hide(); 25689 } 25690 25691 // create MediaElement shim 25692 mejs.MediaElement(t.$media[0], meOptions); 25693 25694 if (typeof(t.container) !== 'undefined' && t.options.features.length && t.controlsAreVisible) { 25695 // controls are shown when loaded 25696 t.container.trigger('controlsshown'); 25697 } 25698 }, 25699 25700 showControls: function(doAnimation) { 25701 var t = this; 25702 25703 doAnimation = typeof doAnimation == 'undefined' || doAnimation; 25704 25705 if (t.controlsAreVisible) 25706 return; 25707 25708 if (doAnimation) { 25709 t.controls 25710 .removeClass('mejs-offscreen') 25711 .stop(true, true).fadeIn(200, function() { 25712 t.controlsAreVisible = true; 25713 t.container.trigger('controlsshown'); 25714 }); 25715
25716 // any additional controls people might add and want to hide 25717 t.container.find('.mejs-control') 25718 .removeClass('mejs-offscreen') 25719 .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;}); 25720 25721 } else { 25722 t.controls 25723 .removeClass('mejs-offscreen') 25724 .css('display','block'); 25725 25726 // any additional controls people might add and want to hide 25727 t.container.find('.mejs-control') 25728 .removeClass('mejs-offscreen') 25729 .css('display','block'); 25730 25731 t.controlsAreVisible = true; 25732 t.container.trigger('controlsshown'); 25733 } 25734 25735 t.setControlsSize(); 25736 25737 }, 25738 25739 hideControls: function(doAnimation) { 25740 var t = this; 25741 25742 doAnimation = typeof doAnimation == 'undefined' || doAnimation; 25743 25744 if (!t.controlsAreVisible || t.options.alwaysShowControls || t.keyboardAction || t.media.paused || t.media.ended) 25745 return; 25746 25747 if (doAnimation) { 25748 // fade out main controls 25749 t.controls.stop(true, true).fadeOut(200, function() { 25750 $(this) 25751 .addClass('mejs-offscreen') 25752 .css('display','block'); 25753 25754 t.controlsAreVisible = false; 25755 t.container.trigger('controlshidden'); 25756 }); 25757 25758 // any additional controls people might add and want to hide 25759 t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() { 25760 $(this) 25761 .addClass('mejs-offscreen') 25762 .css('display','block'); 25763 }); 25764 } else { 25765 25766 // hide main controls 25767 t.controls 25768 .addClass('mejs-offscreen') 25769 .css('display','block'); 25770 25771 // hide others 25772 t.container.find('.mejs-control') 25773 .addClass('mejs-offscreen') 25774 .css('display','block'); 25775 25776 t.controlsAreVisible = false; 25777 t.container.trigger('controlshidden'); 25778 } 25779 }, 25780 25781 controlsTimer: null, 25782 25783 startControlsTimer: function(timeout) { 25784 25785 var t = this; 25786 25787 timeout = typeof timeout != 'undefined' ? timeout : t.options.controlsTimeoutDefault; 25788 25789 t.killControlsTimer('start'); 25790 25791 t.controlsTimer = setTimeout(function() { 25792 // 25793 t.hideControls(); 25794 t.killControlsTimer('hide'); 25795 }, timeout); 25796 }, 25797 25798 killControlsTimer: function(src) { 25799 25800 var t = this; 25801 25802 if (t.controlsTimer !== null) { 25803 clearTimeout(t.controlsTimer); 25804 delete t.controlsTimer; 25805 t.controlsTimer = null; 25806 } 25807 }, 25808 25809 controlsEnabled: true, 25810 25811 disableControls: function() { 25812 var t= this; 25813 25814 t.killControlsTimer(); 25815 t.hideControls(false); 25816 this.controlsEnabled = false; 25817 }, 25818 25819 enableControls: function() { 25820 var t= this; 25821 25822 t.showControls(false); 25823 25824 t.controlsEnabled = true; 25825 }, 25826 25827 // Sets up all controls and events 25828 meReady: function(media, domNode) { 25829 25830 var 25831 t = this, 25832 mf = mejs.MediaFeatures, 25833 autoplayAttr = domNode.getAttribute('autoplay'), 25834 autoplay = !(typeof autoplayAttr == 'undefined' || autoplayAttr === null || autoplayAttr === 'false'), 25835 featureIndex, 25836 feature; 25837 25838 // make sure it can't create itself again if a plugin reloads 25839 if (t.created) { 25840 return; 25841 } else { 25842 t.created = true; 25843 } 25844 25845 t.media = media; 25846 t.domNode = domNode; 25847 25848 if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) { 25849 25850 // In the event that no features are specified for audio, 25851 // create only MediaElement instance rather than 25852 // doing all the work to create a full player 25853 if (!t.isVideo && !t.options.features.length) { 25854 25855 // force autoplay for HTML5 25856 if (autoplay && media.pluginType == 'native') { 25857 t.play(); 25858 } 25859 25860 25861 if (t.options.success) { 25862 25863 if (typeof t.options.success == 'string') { 25864 window[t.options.success](t.media, t.domNode, t); 25865 } else { 25866 t.options.success(t.media, t.domNode, t); 25867 } 25868 } 25869 25870 return; 25871 } 25872 25873 // two built in features 25874 t.buildposter(t, t.controls, t.layers, t.media); 25875 t.buildkeyboard(t, t.controls, t.layers, t.media); 25876 t.buildoverlays(t, t.controls, t.layers, t.media); 25877 25878 // grab for use by features 25879 t.findTracks(); 25880 25881 // add user-defined features/controls 25882 for (featureIndex in t.options.features) { 25883 feature = t.options.features[featureIndex]; 25884 if (t['build' + feature]) { 25885 try { 25886 t['build' + feature](t, t.controls, t.layers, t.media); 25887 } catch (e) { 25888 // TODO: report control error 25889 //throw e; 25890 25891 25892 } 25893 } 25894 } 25895 25896 t.container.trigger('controlsready'); 25897 25898 // reset all layers and controls 25899 t.setPlayerSize(t.width, t.height); 25900 t.setControlsSize(); 25901 25902 25903 // controls fade 25904 if (t.isVideo) { 25905 25906 if (mejs.MediaFeatures.hasTouch && !t.options.alwaysShowControls) { 25907 25908 // for touch devices (iOS, Android) 25909 // show/hide without animation on touch 25910 25911 t.$media.bind('touchstart', function() { 25912 25913 // toggle controls 25914 if (t.controlsAreVisible) { 25915 t.hideControls(false); 25916 } else { 25917 if (t.controlsEnabled) { 25918 t.showControls(false); 25919 } 25920 } 25921 }); 25922 25923 } else { 25924 25925 // create callback here since it needs access to current 25926 // MediaElement object 25927 t.clickToPlayPauseCallback = function() { 25928 // 25929 25930 if (t.options.clickToPlayPause) { 25931 if (t.media.paused) { 25932 t.play(); 25933 } else { 25934 t.pause(); 25935 } 25936 25937 var button = t.$media.closest('.mejs-container').find('.mejs-overlay-button'), 25938 pressed = button.attr('aria-pressed'); 25939 button.attr('aria-pressed', !pressed); 25940 } 25941 }; 25942 25943 // click to play/pause 25944 t.media.addEventListener('click', t.clickToPlayPauseCallback, false); 25945 25946 // show/hide controls 25947 t.container 25948 .bind('mouseenter', function () { 25949 if (t.controlsEnabled) { 25950 if (!t.options.alwaysShowControls ) { 25951 t.killControlsTimer('enter'); 25952 t.showControls(); 25953 t.startControlsTimer(t.options.controlsTimeoutMouseEnter); 25954 } 25955 } 25956 }) 25957 .bind('mousemove', function() { 25958 if (t.controlsEnabled) { 25959 if (!t.controlsAreVisible) { 25960 t.showControls(); 25961 } 25962 if (!t.options.alwaysShowControls) { 25963 t.startControlsTimer(t.options.controlsTimeoutMouseEnter); 25964 } 25965 } 25966 }) 25967 .bind('mouseleave', function () { 25968 if (t.controlsEnabled) { 25969 if (!t.media.paused && !t.options.alwaysShowControls) { 25970 t.startControlsTimer(t.options.controlsTimeoutMouseLeave); 25971 } 25972 } 25973 }); 25974 } 25975 25976 if(t.options.hideVideoControlsOnLoad) { 25977 t.hideControls(false); 25978 } 25979 25980 // check for autoplay 25981 if (autoplay && !t.options.alwaysShowControls) { 25982 t.hideControls(); 25983 } 25984 25985 // resizer 25986 if (t.options.enableAutosize) { 25987 t.media.addEventListener('loadedmetadata', function(e) { 25988 // if the <video height> was not set and the options.videoHeight was not set 25989 // then resize to the real dimensions 25990 if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) { 25991 t.setPlayerSize(e.target.videoWidth, e.target.videoHeight); 25992 t.setControlsSize(); 25993 t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight); 25994 } 25995 }, false); 25996 } 25997 } 25998 25999 // EVENTS 26000 26001 // FOCUS: when a video starts playing, it takes focus from other players (possibly pausing them) 26002 t.media.addEventListener('play', function() { 26003 var playerIndex; 26004 26005 // go through all other players 26006 for (playerIndex in mejs.players) { 26007 var p = mejs.players[playerIndex]; 26008 if (p.id != t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) { 26009 p.pause(); 26010 } 26011 p.hasFocus = false;
26012 } 26013 26014 t.hasFocus = true; 26015 },false); 26016 26017 26018 // ended for all 26019 t.media.addEventListener('ended', function (e) { 26020 if(t.options.autoRewind) { 26021 try{ 26022 t.media.setCurrentTime(0); 26023 // Fixing an Android stock browser bug, where "seeked" isn't fired correctly after ending the video and jumping to the beginning 26024 window.setTimeout(function(){ 26025 $(t.container).find('.mejs-overlay-loading').parent().hide(); 26026 }, 20); 26027 } catch (exp) { 26028 26029 } 26030 } 26031 if (t.media.pluginType === 'youtube') { 26032 t.media.stop(); 26033 } else { 26034 t.media.pause(); 26035 } 26036 26037 if (t.setProgressRail) { 26038 t.setProgressRail(); 26039 } 26040 if (t.setCurrentRail) { 26041 t.setCurrentRail(); 26042 } 26043 26044 if (t.options.loop) { 26045 t.play(); 26046 } else if (!t.options.alwaysShowControls && t.controlsEnabled) { 26047 t.showControls(); 26048 } 26049 }, false); 26050 26051 // resize on the first play 26052 t.media.addEventListener('loadedmetadata', function() { 26053 26054 mejs.Utility.calculateTimeFormat(t.duration, t.options, t.options.framesPerSecond || 25); 26055 26056 if (t.updateDuration) { 26057 t.updateDuration(); 26058 } 26059 if (t.updateCurrent) { 26060 t.updateCurrent(); 26061 } 26062 26063 if (!t.isFullScreen) { 26064 t.setPlayerSize(t.width, t.height); 26065 t.setControlsSize(); 26066 } 26067 }, false); 26068 26069 // Only change the time format when necessary 26070 var duration = null; 26071 t.media.addEventListener('timeupdate',function() { 26072 if (duration !== this.duration) { 26073 duration = this.duration; 26074 mejs.Utility.calculateTimeFormat(duration, t.options, t.options.framesPerSecond || 25); 26075 26076 // make sure to fill in and resize the controls (e.g., 00:00 => 01:13:15 26077 if (t.updateDuration) { 26078 t.updateDuration(); 26079 } 26080 if (t.updateCurrent) { 26081 t.updateCurrent(); 26082 } 26083 t.setControlsSize(); 26084 26085 } 26086 }, false); 26087 26088 t.container.focusout(function (e) { 26089 if( e.relatedTarget ) { //FF is working on supporting focusout https://bugzilla.mozilla.org/show_bug.cgi?id=687787 26090 var $target = $(e.relatedTarget); 26091 if (t.keyboardAction && $target.parents('.mejs-container').length === 0) { 26092 t.keyboardAction = false; 26093 if (t.isVideo && !t.options.alwaysShowControls) { 26094 t.hideControls(true); 26095 } 26096 26097 } 26098 } 26099 }); 26100 26101 // webkit has trouble doing this without a delay 26102 setTimeout(function () { 26103 t.setPlayerSize(t.width, t.height); 26104 t.setControlsSize(); 26105 }, 50); 26106 26107 // adjust controls whenever window sizes (used to be in fullscreen only) 26108 t.globalBind('resize', function() { 26109 26110 // don't resize for fullscreen mode 26111 if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) { 26112 t.setPlayerSize(t.width, t.height); 26113 } 26114 26115 // always adjust controls 26116 t.setControlsSize(); 26117 }); 26118 26119 // This is a work-around for a bug in the YouTube iFrame player, which means 26120 // we can't use the play() API for the initial playback on iOS or Android; 26121 // user has to start playback directly by tapping on the iFrame. 26122 if (t.media.pluginType == 'youtube' && ( mf.isiOS || mf.isAndroid ) ) { 26123 t.container.find('.mejs-overlay-play').hide(); 26124 t.container.find('.mejs-poster').hide(); 26125 } 26126 } 26127 26128 // force autoplay for HTML5 26129 if (autoplay && media.pluginType == 'native') { 26130 t.play(); 26131 } 26132 26133 26134 if (t.options.success) { 26135 26136 if (typeof t.options.success == 'string') { 26137 window[t.options.success](t.media, t.domNode, t); 26138 } else { 26139 t.options.success(t.media, t.domNode, t); 26140 } 26141 } 26142 }, 26143 26144 handleError: function(e) { 26145 var t = this; 26146 26147 if (t.controls) { 26148 t.controls.hide(); 26149 } 26150 26151 // Tell user that the file cannot be played 26152 if (t.options.error) { 26153 t.options.error(e); 26154 } 26155 }, 26156 26157 setPlayerSize: function(width,height) { 26158 var t = this; 26159 26160 if( !t.options.setDimensions ) { 26161 return false; 26162 } 26163 26164 if (typeof width != 'undefined') { 26165 t.width = width; 26166 } 26167 26168 if (typeof height != 'undefined') { 26169 t.height = height; 26170 } 26171 26172 // check stretching modes 26173 switch (t.options.stretching) { 26174 case 'fill': 26175 // The 'fill' effect only makes sense on video; for audio we will set the dimensions 26176 if (t.isVideo) { 26177 this.setFillMode(); 26178 } else { 26179 this.setDimensions(t.width, t.height); 26180 } 26181 break; 26182 case 'responsive': 26183 this.setResponsiveMode(); 26184 break; 26185 case 'none': 26186 this.setDimensions(t.width, t.height); 26187 break; 26188 // This is the 'auto' mode 26189 default: 26190 if (this.hasFluidMode() === true) { 26191 this.setResponsiveMode(); 26192 } else { 26193 this.setDimensions(t.width, t.height); 26194 } 26195 break; 26196 } 26197 }, 26198 26199 hasFluidMode: function() { 26200 var t = this; 26201 26202 // detect 100% mode - use currentStyle for IE since css() doesn't return percentages 26203 return (t.height.toString().indexOf('%') > 0 || (t.$node.css('max-width') !== 'none' && t.$node.css('max-width') !== 't.width') || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')); 26204 }, 26205 26206 setResponsiveMode: function() { 26207 var t = this; 26208 26209 // do we have the native dimensions yet? 26210 var nativeWidth = (function() { 26211 if (t.isVideo) { 26212 if (t.media.videoWidth && t.media.videoWidth > 0) { 26213 return t.media.videoWidth; 26214 } else if (t.media.getAttribute('width') !== null) { 26215 return t.media.getAttribute('width'); 26216 } else { 26217 return t.options.defaultVideoWidth; 26218 } 26219 } else { 26220 return t.options.defaultAudioWidth; 26221 } 26222 })(); 26223 26224 var nativeHeight = (function() { 26225 if (t.isVideo) { 26226 if (t.media.videoHeight && t.media.videoHeight > 0) { 26227 return t.media.videoHeight; 26228 } else if (t.media.getAttribute('height') !== null) { 26229 return t.media.getAttribute('height'); 26230 } else { 26231 return t.options.defaultVideoHeight; 26232 } 26233 } else { 26234 return t.options.defaultAudioHeight; 26235 } 26236 })(); 26237 26238 var parentWidth = t.container.parent().closest(':visible').width(), 26239 parentHeight = t.container.parent().closest(':visible').height(), 26240 newHeight = t.isVideo || !t.options.autosizeProgress ? parseInt(parentWidth * nativeHeight/nativeWidth, 10) : nativeHeight; 26241 26242 // When we use percent, the newHeight can't be calculated so we get the container height 26243 if (isNaN(newHeight) || ( parentHeight !== 0 && newHeight > parentHeight && parentHeight > nativeHeight)) { 26244 newHeight = parentHeight; 26245 } 26246 26247 if (t.container.parent().length > 0 && t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) { 26248 parentWidth = $(window).width(); 26249 newHeight = $(window).height(); 26250 } 26251 26252 if ( newHeight && parentWidth ) { 26253 26254 // set outer container size 26255 t.container 26256 .width(parentWidth) 26257 .height(newHeight); 26258 26259 // set native <video> or <audio> and shims 26260 t.$media.add(t.container.find('.mejs-shim')) 26261 .width('100%') 26262 .height('100%'); 26263 26264 // if shim is ready, send the size to the embeded plugin 26265 if (t.isVideo) { 26266 if (t.media.setVideoSize) { 26267 t.media.setVideoSize(parentWidth, newHeight); 26268 } 26269 } 26270 26271 // set the layers 26272 t.layers.children('.mejs-layer') 26273 .width('100%') 26274 .height('100%'); 26275 } 26276 }, 26277 26278 setFillMode: function() { 26279 var t = this, 26280 parent = t.outerContainer; 26281 26282 if (!parent.width()) { 26283 parent.height(t.$media.width()); 26284 } 26285 26286 if (!parent.height()) { 26287 parent.height(t.$media.height()); 26288 } 26289 26290 var parentWidth = parent.width(), 26291 parentHeight = parent.height(); 26292 26293 t.setDimensions('100%', '100%'); 26294 26295 // This prevents an issue when displaying poster 26296 t.container.find('.mejs-poster img').css('display', 'block'); 26297 26298 targetElement = t.container.find('object, embed, iframe, video'); 26299 26300 // calculate new width and height 26301 var initHeight = t.height, 26302 initWidth = t.width, 26303 // scale to the target width 26304 scaleX1 = parentWidth, 26305 scaleY1 = (initHeight * parentWidth) / initWidth, 26306 // scale to the target height 26307 scaleX2 = (initWidth * parentHeight) / initHeight, 26308 scaleY2 = parentHeight, 26309 // now figure out which one we should use 26310 bScaleOnWidth = !(scaleX2 > parentWidth), 26311 finalWidth = bScaleOnWidth ? Math.floor(scaleX1) : Math.floor(scaleX2), 26312 finalHeight = bScaleOnWidth ? Math.floor(scaleY1) : Math.floor(scaleY2); 26313 26314 if (bScaleOnWidth) { 26315 targetElement.height(finalHeight).width(parentWidth); 26316 if (t.media.setVideoSize) { 26317 t.media.setVideoSize(parentWidth, finalHeight); 26318 } 26319 } else { 26320 targetElement.height(parentHeight).width(finalWidth); 26321 if (t.media.setVideoSize) { 26322 t.media.setVideoSize(finalWidth, parentHeight); 26323 } 26324 } 26325 26326 targetElement.css({
26327 'margin-left': Math.floor((parentWidth - finalWidth) / 2), 26328 'margin-top': 0 26329 }); 26330 }, 26331 26332 setDimensions: function(width, height) { 26333 var t = this; 26334 26335 t.container 26336 .width(width) 26337 .height(height); 26338 26339 t.layers.children('.mejs-layer') 26340 .width(width) 26341 .height(height); 26342 }, 26343 26344 setControlsSize: function() { 26345 var t = this, 26346 usedWidth = 0, 26347 railWidth = 0, 26348 rail = t.controls.find('.mejs-time-rail'), 26349 total = t.controls.find('.mejs-time-total'), 26350 others = rail.siblings(), 26351 lastControl = others.last(), 26352 lastControlPosition = null, 26353 avoidAutosizeProgress = t.options && !t.options.autosizeProgress; 26354 26355 // skip calculation if hidden 26356 if (!t.container.is(':visible') || !rail.length || !rail.is(':visible')) { 26357 return; 26358 } 26359 26360 // allow the size to come from custom CSS 26361 if (avoidAutosizeProgress) { 26362 // Also, frontends devs can be more flexible 26363 // due the opportunity of absolute positioning. 26364 railWidth = parseInt(rail.css('width'), 10); 26365 } 26366 26367 // attempt to autosize 26368 if (railWidth === 0 || !railWidth) { 26369 26370 // find the size of all the other controls besides the rail 26371 others.each(function() { 26372 var $this = $(this); 26373 if ($this.css('position') != 'absolute' && $this.is(':visible')) { 26374 usedWidth += $(this).outerWidth(true); 26375 } 26376 }); 26377 26378 // fit the rail into the remaining space 26379 railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.width()); 26380 } 26381 26382 // resize the rail, 26383 // but then check if the last control (say, the fullscreen button) got pushed down 26384 // this often happens when zoomed 26385 do { 26386 // outer area 26387 // we only want to set an inline style with the width of the rail 26388 // if we're trying to autosize. 26389 if (!avoidAutosizeProgress) { 26390 rail.width(railWidth); 26391 } 26392 26393 // dark space 26394 total.width(railWidth - (total.outerWidth(true) - total.width())); 26395 26396 if (lastControl.css('position') != 'absolute') { 26397 lastControlPosition = lastControl.length ? lastControl.position() : null; 26398 railWidth--; 26399 } 26400 } while (lastControlPosition !== null && lastControlPosition.top.toFixed(2) > 0 && railWidth > 0); 26401 26402 t.container.trigger('controlsresize'); 26403 }, 26404 26405 26406 buildposter: function(player, controls, layers, media) { 26407 var t = this, 26408 poster = 26409 $('<div class="mejs-poster mejs-layer">' + 26410 '</div>') 26411 .appendTo(layers), 26412 posterUrl = player.$media.attr('poster'); 26413 26414 // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster) 26415 if (player.options.poster !== '') { 26416 posterUrl = player.options.poster; 26417 } 26418 26419 // second, try the real poster 26420 if ( posterUrl ) { 26421 t.setPoster(posterUrl); 26422 } else { 26423 poster.hide(); 26424 } 26425 26426 media.addEventListener('play',function() { 26427 poster.hide(); 26428 }, false); 26429 26430 if(player.options.showPosterWhenEnded && player.options.autoRewind){ 26431 media.addEventListener('ended',function() { 26432 poster.show(); 26433 }, false); 26434 } 26435 }, 26436 26437 setPoster: function(url) { 26438 var t = this, 26439 posterDiv = t.container.find('.mejs-poster'), 26440 posterImg = posterDiv.find('img'); 26441 26442 if (posterImg.length === 0) { 26443 posterImg = $('<img width="100%" height="100%" alt="" />').appendTo(posterDiv); 26444 } 26445 26446 posterImg.attr('src', url); 26447 posterDiv.css({'background-image' : 'url(' + url + ')'}); 26448 }, 26449 26450 buildoverlays: function(player, controls, layers, media) { 26451 var t = this; 26452 if (!player.isVideo) 26453 return; 26454 26455 var 26456 loading = 26457 $('<div class="mejs-overlay mejs-layer">'+ 26458 '<div class="mejs-overlay-loading"><span></span></div>'+ 26459 '</div>') 26460 .hide() // start out hidden 26461 .appendTo(layers), 26462 error = 26463 $('<div class="mejs-overlay mejs-layer">'+ 26464 '<div class="mejs-overlay-error"></div>'+ 26465 '</div>') 26466 .hide() // start out hidden 26467 .appendTo(layers), 26468 // this needs to come last so it's on top 26469 bigPlay = 26470 $('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+ 26471 '<div class="mejs-overlay-button" role="button" aria-label="' + mejs.i18n.t('mejs.play') + '" aria-pressed="false"></div>'+ 26472 '</div>') 26473 .appendTo(layers) 26474 .bind('click', function() { // Removed 'touchstart' due issues on Samsung Android devices where a tap on bigPlay started and immediately stopped the video 26475 if (t.options.clickToPlayPause) { 26476 if (media.paused) { 26477 media.play(); 26478 } 26479 26480 var button = $(this).find('.mejs-overlay-button'), 26481 pressed = button.attr('aria-pressed'); 26482 button.attr('aria-pressed', !!pressed); 26483 } 26484 }); 26485 26486 /* 26487 if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) { 26488 bigPlay.remove(); 26489 loading.remove(); 26490 } 26491 */ 26492 26493 26494 // show/hide big play button 26495 media.addEventListener('play',function() { 26496 bigPlay.hide(); 26497 loading.hide(); 26498 controls.find('.mejs-time-buffering').hide(); 26499 error.hide(); 26500 }, false); 26501 26502 media.addEventListener('playing', function() { 26503 bigPlay.hide(); 26504 loading.hide(); 26505 controls.find('.mejs-time-buffering').hide(); 26506 error.hide(); 26507 }, false); 26508 26509 media.addEventListener('seeking', function() { 26510 loading.show(); 26511 controls.find('.mejs-time-buffering').show(); 26512 }, false); 26513 26514 media.addEventListener('seeked', function() { 26515 loading.hide(); 26516 controls.find('.mejs-time-buffering').hide(); 26517 }, false); 26518 26519 media.addEventListener('pause',function() { 26520 if (!mejs.MediaFeatures.isiPhone) { 26521 bigPlay.show(); 26522 } 26523 }, false); 26524 26525 media.addEventListener('waiting', function() { 26526 loading.show(); 26527 controls.find('.mejs-time-buffering').show(); 26528 }, false); 26529 26530 26531 // show/hide loading 26532 media.addEventListener('loadeddata',function() { 26533 // for some reason Chrome is firing this event 26534 //if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none') 26535 // return; 26536 26537 loading.show(); 26538 controls.find('.mejs-time-buffering').show(); 26539 // Firing the 'canplay' event after a timeout which isn't getting fired on some Android 4.1 devices (https://github.com/johndyer/mediaelement/issues/1305) 26540 if (mejs.MediaFeatures.isAndroid) { 26541 media.canplayTimeout = window.setTimeout( 26542 function() { 26543 if (document.createEvent) { 26544 var evt = document.createEvent('HTMLEvents'); 26545 evt.initEvent('canplay', true, true); 26546 return media.dispatchEvent(evt); 26547 } 26548 }, 300 26549 ); 26550 } 26551 }, false); 26552 media.addEventListener('canplay',function() { 26553 loading.hide(); 26554 controls.find('.mejs-time-buffering').hide(); 26555 clearTimeout(media.canplayTimeout); // Clear timeout inside 'loadeddata' to prevent 'canplay' to fire twice 26556 }, false); 26557 26558 // error handling 26559 media.addEventListener('error',function(e) { 26560 t.handleError(e); 26561 loading.hide(); 26562 bigPlay.hide(); 26563 error.show(); 26564 error.find('.mejs-overlay-error').html("Error loading this resource"); 26565 }, false); 26566 26567 media.addEventListener('keydown', function(e) { 26568 t.onkeydown(player, media, e); 26569 }, false); 26570 }, 26571 26572 buildkeyboard: function(player, controls, layers, media) { 26573 26574 var t = this; 26575 26576 t.container.keydown(function () { 26577 t.keyboardAction = true; 26578 }); 26579 26580 // listen for key presses 26581 t.globalBind('keydown', function(event) { 26582 player.hasFocus = $(event.target).closest('.mejs-container').length !== 0 26583 && $(event.target).closest('.mejs-container').attr('id') === player.$media.closest('.mejs-container').attr('id'); 26584 return t.onkeydown(player, media, event); 26585 }); 26586 26587 26588 // check if someone clicked outside a player region, then kill its focus 26589 t.globalBind('click', function(event) { 26590 player.hasFocus = $(event.target).closest('.mejs-container').length !== 0; 26591 }); 26592 26593 }, 26594 onkeydown: function(player, media, e) { 26595 if (player.hasFocus && player.options.enableKeyboard) { 26596 // find a matching key 26597 for (var i = 0, il = player.options.keyActions.length; i < il; i++) { 26598 var keyAction = player.options.keyActions[i]; 26599 26600 for (var j = 0, jl = keyAction.keys.length; j < jl; j++) { 26601 if (e.keyCode == keyAction.keys[j]) { 26602 if (typeof(e.preventDefault) == "function") e.preventDefault(); 26603 keyAction.action(player, media, e.keyCode, e); 26604 return false;
26605 } 26606 } 26607 } 26608 } 26609 26610 return true; 26611 }, 26612 26613 findTracks: function() { 26614 var t = this, 26615 tracktags = t.$media.find('track'); 26616 26617 // store for use by plugins 26618 t.tracks = []; 26619 tracktags.each(function(index, track) { 26620 26621 track = $(track); 26622 26623 t.tracks.push({ 26624 srclang: (track.attr('srclang')) ? track.attr('srclang').toLowerCase() : '', 26625 src: track.attr('src'), 26626 kind: track.attr('kind'), 26627 label: track.attr('label') || '', 26628 entries: [], 26629 isLoaded: false 26630 }); 26631 }); 26632 }, 26633 changeSkin: function(className) { 26634 this.container[0].className = 'mejs-container ' + className; 26635 this.setPlayerSize(this.width, this.height); 26636 this.setControlsSize(); 26637 }, 26638 play: function() { 26639 this.load(); 26640 this.media.play(); 26641 }, 26642 pause: function() { 26643 try { 26644 this.media.pause(); 26645 } catch (e) {} 26646 }, 26647 load: function() { 26648 if (!this.isLoaded) { 26649 this.media.load(); 26650 } 26651 26652 this.isLoaded = true; 26653 }, 26654 setMuted: function(muted) { 26655 this.media.setMuted(muted); 26656 }, 26657 setCurrentTime: function(time) { 26658 this.media.setCurrentTime(time); 26659 }, 26660 getCurrentTime: function() { 26661 return this.media.currentTime; 26662 }, 26663 setVolume: function(volume) { 26664 this.media.setVolume(volume); 26665 }, 26666 getVolume: function() { 26667 return this.media.volume; 26668 }, 26669 setSrc: function(src) { 26670 var 26671 t = this; 26672 26673 // If using YouTube, its API is different to load a specific source 26674 if (t.media.pluginType === 'youtube') { 26675 var videoId; 26676 26677 if (typeof src !== 'string') { 26678 var i, media; 26679 26680 for (i=0; i<src.length; i++) { 26681 media = src[i]; 26682 if (this.canPlayType(media.type)) { 26683 src = media.src; 26684 break; 26685 } 26686 } 26687 } 26688 26689 // youtu.be url from share button 26690 if (src.lastIndexOf('youtu.be') !== -1) { 26691 videoId = src.substr(src.lastIndexOf('/') + 1); 26692 26693 if (videoId.indexOf('?') !== -1) { 26694 videoId = videoId.substr(0, videoId.indexOf('?')); 26695 } 26696 26697 } else { 26698 // https://www.youtube.com/watch?v= 26699 var videoIdMatch = src.match(/[?&]v=([^&#]+)|&|#|$/); 26700 26701 if (videoIdMatch) { 26702 videoId = videoIdMatch[1]; 26703 } 26704 } 26705 26706 if (t.media.getAttribute('autoplay') !== null) { 26707 t.media.pluginApi.loadVideoById(videoId); 26708 } else { 26709 t.media.pluginApi.cueVideoById(videoId); 26710 } 26711 26712 } 26713 else { 26714 t.media.setSrc(src); 26715 } 26716 }, 26717 remove: function() { 26718 var t = this, featureIndex, feature; 26719 26720 t.container.prev('.mejs-offscreen').remove(); 26721 26722 // invoke features cleanup 26723 for (featureIndex in t.options.features) { 26724 feature = t.options.features[featureIndex]; 26725 if (t['clean' + feature]) { 26726 try { 26727 t['clean' + feature](t); 26728 } catch (e) { 26729 // TODO: report control error 26730 //throw e; 26731 // 26732 // 26733 } 26734 } 26735 } 26736 26737 // grab video and put it back in place 26738 if (!t.isDynamic) { 26739 t.$media.prop('controls', true); 26740 // detach events from the video 26741 // TODO: detach event listeners better than this; 26742 // also detach ONLY the events attached by this plugin! 26743 t.$node.clone().insertBefore(t.container).show(); 26744 t.$node.remove(); 26745 } else { 26746 t.$node.insertBefore(t.container); 26747 } 26748 26749 if (t.media.pluginType !== 'native') { 26750 t.media.remove(); 26751 } 26752 26753 // Remove the player from the mejs.players object so that pauseOtherPlayers doesn't blow up when trying to pause a non existance flash api. 26754 delete mejs.players[t.id]; 26755 26756 if (typeof t.container == 'object') { 26757 t.container.remove(); 26758 } 26759 t.globalUnbind(); 26760 delete t.node.player; 26761 }, 26762 rebuildtracks: function(){ 26763 var t = this; 26764 t.findTracks(); 26765 t.buildtracks(t, t.controls, t.layers, t.media); 26766 }, 26767 resetSize: function(){ 26768 var t = this; 26769 // webkit has trouble doing this without a delay 26770 setTimeout(function () { 26771 // 26772 t.setPlayerSize(t.width, t.height); 26773 t.setControlsSize(); 26774 }, 50); 26775 } 26776 }; 26777 26778 (function(){ 26779 var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/; 26780 26781 function splitEvents(events, id) { 26782 // add player ID as an event namespace so it's easier to unbind them all later 26783 var ret = {d: [], w: []}; 26784 $.each((events || '').split(' '), function(k, v){ 26785 var eventname = v + '.' + id; 26786 if (eventname.indexOf('.') === 0) { 26787 ret.d.push(eventname); 26788 ret.w.push(eventname); 26789 } 26790 else { 26791 ret[rwindow.test(v) ? 'w' : 'd'].push(eventname); 26792 } 26793 }); 26794 ret.d = ret.d.join(' '); 26795 ret.w = ret.w.join(' '); 26796 return ret; 26797 } 26798 26799 mejs.MediaElementPlayer.prototype.globalBind = function(events, data, callback) { 26800 var t = this; 26801 var doc = t.node ? t.node.ownerDocument : document; 26802 26803 events = splitEvents(events, t.id); 26804 if (events.d) $(doc).bind(events.d, data, callback); 26805 if (events.w) $(window).bind(events.w, data, callback); 26806 }; 26807 26808 mejs.MediaElementPlayer.prototype.globalUnbind = function(events, callback) { 26809 var t = this; 26810 var doc = t.node ? t.node.ownerDocument : document; 26811 26812 events = splitEvents(events, t.id); 26813 if (events.d) $(doc).unbind(events.d, callback); 26814 if (events.w) $(window).unbind(events.w, callback); 26815 }; 26816 })(); 26817 26818 // turn into jQuery plugin 26819 if (typeof $ != 'undefined') { 26820 $.fn.mediaelementplayer = function (options) { 26821 if (options === false) { 26822 this.each(function () { 26823 var player = $(this).data('mediaelementplayer'); 26824 if (player) { 26825 player.remove(); 26826 } 26827 $(this).removeData('mediaelementplayer'); 26828 }); 26829 } 26830 else { 26831 this.each(function () { 26832 $(this).data('mediaelementplayer', new mejs.MediaElementPlayer(this, options)); 26833 }); 26834 } 26835 return this; 26836 }; 26837 26838 26839 $(document).ready(function() { 26840 // auto enable using JSON attribute 26841 $('.mejs-player').mediaelementplayer(); 26842 }); 26843 } 26844 26845 // push out to window 26846 window.MediaElementPlayer = mejs.MediaElementPlayer; 26847 26848})(mejs.$); 26849 26850(function($) { 26851 26852 $.extend(mejs.MepDefaults, { 26853 playText: '', 26854 pauseText: '' 26855 }); 26856 26857 26858 // PLAY/pause BUTTON 26859 $.extend(MediaElementPlayer.prototype, { 26860 buildplaypause: function(player, controls, layers, media) { 26861 var 26862 t = this, 26863 op = t.options, 26864 playTitle = op.playText ? op.playText : mejs.i18n.t('mejs.play'), 26865 pauseTitle = op.pauseText ? op.pauseText : mejs.i18n.t('mejs.pause'), 26866 play = 26867 $('<div class="mejs-button mejs-playpause-button mejs-play" >' + 26868 '<button type="button" aria-controls="' + t.id + '" title="' + playTitle + '" aria-label="' + pauseTitle + '"></button>' + 26869 '</div>') 26870 .appendTo(controls) 26871 .click(function(e) { 26872 e.preventDefault(); 26873 26874 if (media.paused) { 26875 media.play(); 26876 } else { 26877 media.pause(); 26878 } 26879 26880 return false;
26881 }), 26882 play_btn = play.find('button'); 26883 26884 26885 function togglePlayPause(which) { 26886 if ('play' === which) { 26887 play.removeClass('mejs-play').addClass('mejs-pause'); 26888 play_btn.attr({ 26889 'title': pauseTitle, 26890 'aria-label': pauseTitle 26891 }); 26892 } else { 26893 play.removeClass('mejs-pause').addClass('mejs-play'); 26894 play_btn.attr({ 26895 'title': playTitle, 26896 'aria-label': playTitle 26897 }); 26898 } 26899 }; 26900 togglePlayPause('pse'); 26901 26902 26903 media.addEventListener('play',function() { 26904 togglePlayPause('play'); 26905 }, false); 26906 media.addEventListener('playing',function() { 26907 togglePlayPause('play'); 26908 }, false); 26909 26910 26911 media.addEventListener('pause',function() { 26912 togglePlayPause('pse'); 26913 }, false); 26914 media.addEventListener('paused',function() { 26915 togglePlayPause('pse'); 26916 }, false); 26917 } 26918 }); 26919 26920})(mejs.$); 26921 26922(function($) { 26923 26924 $.extend(mejs.MepDefaults, { 26925 stopText: 'Stop' 26926 }); 26927 26928 // STOP BUTTON 26929 $.extend(MediaElementPlayer.prototype, { 26930 buildstop: function(player, controls, layers, media) { 26931 var t = this; 26932 26933 $('<div class="mejs-button mejs-stop-button mejs-stop">' + 26934 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '" aria-label="' + t.options.stopText + '"></button>' + 26935 '</div>') 26936 .appendTo(controls) 26937 .click(function() { 26938 if (!media.paused) { 26939 media.pause(); 26940 } 26941 if (media.currentTime > 0) { 26942 media.setCurrentTime(0); 26943 media.pause(); 26944 controls.find('.mejs-time-current').width('0px'); 26945 controls.find('.mejs-time-handle').css('left', '0px'); 26946 controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0, player.options)); 26947 controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0, player.options)); 26948 layers.find('.mejs-poster').show(); 26949 } 26950 }); 26951 } 26952 }); 26953 26954})(mejs.$); 26955 26956(function($) { 26957 26958 $.extend(mejs.MepDefaults, { 26959 // Enable tooltip that shows time in progress bar 26960 enableProgressTooltip: true, 26961 progressHelpText: '' 26962 }); 26963 26964 // progress/loaded bar 26965 $.extend(MediaElementPlayer.prototype, { 26966 buildprogress: function(player, controls, layers, media) { 26967 26968 var 26969 t = this, 26970 mouseIsDown = false, 26971 mouseIsOver = false, 26972 lastKeyPressTime = 0, 26973 startedPaused = false, 26974 autoRewindInitial = player.options.autoRewind, 26975 progressTitle = t.options.progressHelpText ? t.options.progressHelpText : mejs.i18n.t('mejs.time-help-text'), 26976 tooltip = player.options.enableProgressTooltip ? '<span class="mejs-time-float">' + 26977 '<span class="mejs-time-float-current">00:00</span>' + 26978 '<span class="mejs-time-float-corner"></span>' + 26979 '</span>' : ""; 26980 26981 $('<div class="mejs-time-rail">' + 26982 '<span class="mejs-time-total mejs-time-slider">' + 26983 //'<span class="mejs-offscreen">' + progressTitle + '</span>' + 26984 '<span class="mejs-time-buffering"></span>' + 26985 '<span class="mejs-time-loaded"></span>' + 26986 '<span class="mejs-time-current"></span>' + 26987 '<span class="mejs-time-handle"></span>' + 26988 tooltip + 26989 '</span>' + 26990 '</div>') 26991 .appendTo(controls); 26992 controls.find('.mejs-time-buffering').hide(); 26993 26994 t.total = controls.find('.mejs-time-total'); 26995 t.loaded = controls.find('.mejs-time-loaded'); 26996 t.current = controls.find('.mejs-time-current'); 26997 t.handle = controls.find('.mejs-time-handle'); 26998 t.timefloat = controls.find('.mejs-time-float'); 26999 t.timefloatcurrent = controls.find('.mejs-time-float-current'); 27000 t.slider = controls.find('.mejs-time-slider'); 27001 27002 var handleMouseMove = function (e) { 27003 27004 var offset = t.total.offset(), 27005 width = t.total.width(), 27006 percentage = 0, 27007 newTime = 0, 27008 pos = 0, 27009 x; 27010 27011 // mouse or touch position relative to the object 27012 if (e.originalEvent && e.originalEvent.changedTouches) { 27013 x = e.originalEvent.changedTouches[0].pageX; 27014 } else if (e.changedTouches) { // for Zepto 27015 x = e.changedTouches[0].pageX; 27016 } else { 27017 x = e.pageX; 27018 } 27019 27020 if (media.duration) { 27021 if (x < offset.left) { 27022 x = offset.left; 27023 } else if (x > width + offset.left) { 27024 x = width + offset.left; 27025 } 27026 27027 pos = x - offset.left; 27028 percentage = (pos / width); 27029 newTime = (percentage <= 0.02) ? 0 : percentage * media.duration; 27030 27031 // seek to where the mouse is 27032 if (mouseIsDown && newTime !== media.currentTime) { 27033 media.setCurrentTime(newTime); 27034 } 27035 27036 // position floating time box 27037 if (!mejs.MediaFeatures.hasTouch) { 27038 t.timefloat.css('left', pos); 27039 t.timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime, player.options) ); 27040 t.timefloat.show(); 27041 } 27042 } 27043 }, 27044 // Accessibility for slider 27045 updateSlider = function (e) { 27046 27047 var seconds = media.currentTime, 27048 timeSliderText = mejs.i18n.t('mejs.time-slider'), 27049 time = mejs.Utility.secondsToTimeCode(seconds, player.options), 27050 duration = media.duration; 27051 27052 t.slider.attr({ 27053 'aria-label': timeSliderText, 27054 'aria-valuemin': 0, 27055 'aria-valuemax': duration, 27056 'aria-valuenow': seconds, 27057 'aria-valuetext': time, 27058 'role': 'slider', 27059 'tabindex': 0 27060 }); 27061 27062 }, 27063 restartPlayer = function () { 27064 var now = new Date(); 27065 if (now - lastKeyPressTime >= 1000) { 27066 media.play(); 27067 } 27068 }; 27069 27070 t.slider.bind('focus', function (e) { 27071 player.options.autoRewind = false;
27072 }); 27073 27074 t.slider.bind('blur', function (e) { 27075 player.options.autoRewind = autoRewindInitial; 27076 }); 27077 27078 t.slider.bind('keydown', function (e) { 27079 27080 if ((new Date() - lastKeyPressTime) >= 1000) { 27081 startedPaused = media.paused; 27082 } 27083 27084 var keyCode = e.keyCode, 27085 duration = media.duration, 27086 seekTime = media.currentTime, 27087 seekForward = player.options.defaultSeekForwardInterval(media), 27088 seekBackward = player.options.defaultSeekBackwardInterval(media); 27089 27090 switch (keyCode) { 27091 case 37: // left 27092 case 40: // Down 27093 seekTime -= seekBackward; 27094 break; 27095 case 39: // Right 27096 case 38: // Up 27097 seekTime += seekForward; 27098 break; 27099 case 36: // Home 27100 seekTime = 0; 27101 break; 27102 case 35: // end 27103 seekTime = duration; 27104 break; 27105 case 32: // space 27106 case 13: // enter 27107 media.paused ? media.play() : media.pause(); 27108 return; 27109 default: 27110 return; 27111 } 27112 27113 seekTime = seekTime < 0 ? 0 : (seekTime >= duration ? duration : Math.floor(seekTime)); 27114 lastKeyPressTime = new Date(); 27115 if (!startedPaused) { 27116 media.pause(); 27117 } 27118 27119 if (seekTime < media.duration && !startedPaused) { 27120 setTimeout(restartPlayer, 1100); 27121 } 27122 27123 media.setCurrentTime(seekTime); 27124 27125 e.preventDefault(); 27126 e.stopPropagation(); 27127 return false; 27128 }); 27129 27130 27131 // handle clicks 27132 //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove); 27133 t.total 27134 .bind('mousedown touchstart', function (e) { 27135 // only handle left clicks or touch 27136 if (e.which === 1 || e.which === 0) { 27137 mouseIsDown = true; 27138 handleMouseMove(e); 27139 t.globalBind('mousemove.dur touchmove.dur', function(e) { 27140 handleMouseMove(e); 27141 }); 27142 t.globalBind('mouseup.dur touchend.dur', function (e) { 27143 mouseIsDown = false; 27144 if (typeof t.timefloat !== 'undefined') { 27145 t.timefloat.hide(); 27146 } 27147 t.globalUnbind('.dur'); 27148 }); 27149 } 27150 }) 27151 .bind('mouseenter', function(e) { 27152 mouseIsOver = true; 27153 t.globalBind('mousemove.dur', function(e) { 27154 handleMouseMove(e); 27155 }); 27156 if (typeof t.timefloat !== 'undefined' && !mejs.MediaFeatures.hasTouch) { 27157 t.timefloat.show(); 27158 } 27159 }) 27160 .bind('mouseleave',function(e) { 27161 mouseIsOver = false; 27162 if (!mouseIsDown) { 27163 t.globalUnbind('.dur'); 27164 if (typeof t.timefloat !== 'undefined') { 27165 t.timefloat.hide(); 27166 } 27167 } 27168 }); 27169 27170 // loading 27171 media.addEventListener('progress', function (e) { 27172 player.setProgressRail(e); 27173 player.setCurrentRail(e); 27174 }, false); 27175 27176 // current time 27177 media.addEventListener('timeupdate', function(e) { 27178 player.setProgressRail(e); 27179 player.setCurrentRail(e); 27180 updateSlider(e); 27181 }, false); 27182 27183 t.container.on('controlsresize', function(e) { 27184 player.setProgressRail(e); 27185 player.setCurrentRail(e); 27186 }); 27187 }, 27188 setProgressRail: function(e) { 27189 27190 var 27191 t = this, 27192 target = (e !== undefined) ? e.target : t.media, 27193 percent = null; 27194 27195 // newest HTML5 spec has buffered array (FF4, Webkit) 27196 if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) { 27197 // account for a real array with multiple values - always read the end of the last buffer 27198 percent = target.buffered.end(target.buffered.length - 1) / target.duration; 27199 } 27200 // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end() 27201 // to be anything other than 0. If the byte count is available we use this instead. 27202 // Browsers that support the else if do not seem to have the bufferedBytes value and 27203 // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8. 27204 else if (target && target.bytesTotal !== undefined && target.bytesTotal > 0 && target.bufferedBytes !== undefined) { 27205 percent = target.bufferedBytes / target.bytesTotal; 27206 } 27207 // Firefox 3 with an Ogg file seems to go this way 27208 else if (e && e.lengthComputable && e.total !== 0) { 27209 percent = e.loaded / e.total; 27210 } 27211 27212 // finally update the progress bar 27213 if (percent !== null) { 27214 percent = Math.min(1, Math.max(0, percent)); 27215 // update loaded bar 27216 if (t.loaded && t.total) { 27217 t.loaded.width(t.total.width() * percent); 27218 } 27219 } 27220 }, 27221 setCurrentRail: function() { 27222 27223 var t = this; 27224 27225 if (t.media.currentTime !== undefined && t.media.duration) { 27226 27227 // update bar and handle 27228 if (t.total && t.handle) { 27229 var 27230 newWidth = Math.round(t.total.width() * t.media.currentTime / t.media.duration), 27231 handlePos = newWidth - Math.round(t.handle.outerWidth(true) / 2); 27232 27233 t.current.width(newWidth); 27234 t.handle.css('left', handlePos); 27235 } 27236 } 27237 27238 } 27239 }); 27240})(mejs.$); 27241 27242(function($) { 27243 27244 // options 27245 $.extend(mejs.MepDefaults, { 27246 duration: -1, 27247 timeAndDurationSeparator: '<span> | </span>' 27248 }); 27249 27250 27251 // current and duration 00:00 / 00:00 27252 $.extend(MediaElementPlayer.prototype, { 27253 buildcurrent: function(player, controls, layers, media) { 27254 var t = this; 27255 27256 $('<div class="mejs-time" role="timer" aria-live="off">' + 27257 '<span class="mejs-currenttime">' + 27258 mejs.Utility.secondsToTimeCode(0, player.options) + 27259 '</span>'+ 27260 '</div>') 27261 .appendTo(controls); 27262 27263 t.currenttime = t.controls.find('.mejs-currenttime'); 27264 27265 media.addEventListener('timeupdate',function() { 27266 if (t.controlsAreVisible) { 27267 player.updateCurrent(); 27268 } 27269 27270 }, false); 27271 }, 27272 27273 27274 buildduration: function(player, controls, layers, media) { 27275 var t = this; 27276
27277 if (controls.children().last().find('.mejs-currenttime').length > 0) { 27278 $(t.options.timeAndDurationSeparator + 27279 '<span class="mejs-duration">' + 27280 mejs.Utility.secondsToTimeCode(t.options.duration, t.options) + 27281 '</span>') 27282 .appendTo(controls.find('.mejs-time')); 27283 } else { 27284 27285 // add class to current time 27286 controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container'); 27287 27288 $('<div class="mejs-time mejs-duration-container">'+ 27289 '<span class="mejs-duration">' + 27290 mejs.Utility.secondsToTimeCode(t.options.duration, t.options) + 27291 '</span>' + 27292 '</div>') 27293 .appendTo(controls); 27294 } 27295 27296 t.durationD = t.controls.find('.mejs-duration'); 27297 27298 media.addEventListener('timeupdate',function() { 27299 if (t.controlsAreVisible) { 27300 player.updateDuration(); 27301 } 27302 }, false); 27303 }, 27304 27305 updateCurrent: function() { 27306 var t = this; 27307 27308 var currentTime = t.media.currentTime; 27309 27310 if (isNaN(currentTime)) { 27311 currentTime = 0; 27312 } 27313 27314 if (t.currenttime) { 27315 t.currenttime.html(mejs.Utility.secondsToTimeCode(currentTime, t.options)); 27316 } 27317 }, 27318 27319 updateDuration: function() { 27320 var t = this; 27321 27322 var duration = t.media.duration; 27323 if (t.options.duration > 0) { 27324 duration = t.options.duration; 27325 } 27326 27327 if (isNaN(duration)) { 27328 duration = 0; 27329 } 27330 27331 //Toggle the long video class if the video is longer than an hour. 27332 t.container.toggleClass("mejs-long-video", duration > 3600); 27333 27334 if (t.durationD && duration > 0) { 27335 t.durationD.html(mejs.Utility.secondsToTimeCode(duration, t.options)); 27336 } 27337 } 27338 }); 27339 27340})(mejs.$); 27341 27342(function ($) { 27343 27344 $.extend(mejs.MepDefaults, { 27345 muteText: mejs.i18n.t('mejs.mute-toggle'), 27346 allyVolumeControlText: mejs.i18n.t('mejs.volume-help-text'), 27347 hideVolumeOnTouchDevices: true, 27348 27349 audioVolume: 'horizontal', 27350 videoVolume: 'vertical' 27351 }); 27352 27353 $.extend(MediaElementPlayer.prototype, { 27354 buildvolume: function (player, controls, layers, media) { 27355 27356 // Android and iOS don't support volume controls 27357 if ((mejs.MediaFeatures.isAndroid || mejs.MediaFeatures.isiOS) && this.options.hideVolumeOnTouchDevices) 27358 return; 27359 27360 var t = this, 27361 mode = (t.isVideo) ? t.options.videoVolume : t.options.audioVolume, 27362 mute = (mode == 'horizontal') ? 27363 27364 // horizontal version 27365 $('<div class="mejs-button mejs-volume-button mejs-mute">' + 27366 '<button type="button" aria-controls="' + t.id + 27367 '" title="' + t.options.muteText + 27368 '" aria-label="' + t.options.muteText + 27369 '"></button>' + 27370 '</div>' + 27371 '<a href="javascript:void(0);" class="mejs-horizontal-volume-slider">' + // outer background 27372 '<span class="mejs-offscreen">' + t.options.allyVolumeControlText + '</span>' + 27373 '<div class="mejs-horizontal-volume-total"></div>' + // line background 27374 '<div class="mejs-horizontal-volume-current"></div>' + // current volume 27375 '<div class="mejs-horizontal-volume-handle"></div>' + // handle 27376 '</a>' 27377 ) 27378 .appendTo(controls) : 27379 27380 // vertical version 27381 $('<div class="mejs-button mejs-volume-button mejs-mute">' + 27382 '<button type="button" aria-controls="' + t.id + 27383 '" title="' + t.options.muteText + 27384 '" aria-label="' + t.options.muteText + 27385 '"></button>' + 27386 '<a href="javascript:void(0);" class="mejs-volume-slider">' + // outer background 27387 '<span class="mejs-offscreen">' + t.options.allyVolumeControlText + '</span>' + 27388 '<div class="mejs-volume-total"></div>' + // line background 27389 '<div class="mejs-volume-current"></div>' + // current volume 27390 '<div class="mejs-volume-handle"></div>' + // handle 27391 '</a>' + 27392 '</div>') 27393 .appendTo(controls), 27394 volumeSlider = t.container.find('.mejs-volume-slider, .mejs-horizontal-volume-slider'), 27395 volumeTotal = t.container.find('.mejs-volume-total, .mejs-horizontal-volume-total'), 27396 volumeCurrent = t.container.find('.mejs-volume-current, .mejs-horizontal-volume-current'), 27397 volumeHandle = t.container.find('.mejs-volume-handle, .mejs-horizontal-volume-handle'), 27398 27399 positionVolumeHandle = function (volume, secondTry) { 27400 27401 if (!volumeSlider.is(':visible') && typeof secondTry == 'undefined') { 27402 volumeSlider.show(); 27403 positionVolumeHandle(volume, true); 27404 volumeSlider.hide(); 27405 return; 27406 } 27407 27408 // correct to 0-1 27409 volume = Math.max(0, volume); 27410 volume = Math.min(volume, 1); 27411 27412 // adjust mute button style 27413 if (volume === 0) { 27414 mute.removeClass('mejs-mute').addClass('mejs-unmute'); 27415 mute.children('button').attr('title', mejs.i18n.t('mejs.unmute')).attr('aria-label', mejs.i18n.t('mejs.unmute')); 27416 } else { 27417 mute.removeClass('mejs-unmute').addClass('mejs-mute'); 27418 mute.children('button').attr('title', mejs.i18n.t('mejs.mute')).attr('aria-label', mejs.i18n.t('mejs.mute')); 27419 } 27420 27421 // top/left of full size volume slider background 27422 var totalPosition = volumeTotal.position(); 27423 // position slider 27424 if (mode == 'vertical') { 27425 var 27426 // height of the full size volume slider background 27427 totalHeight = volumeTotal.height(), 27428 27429 // the new top position based on the current volume 27430 // 70% volume on 100px height == top:30px 27431 newTop = totalHeight - (totalHeight * volume); 27432 27433 // handle 27434 volumeHandle.css('top', Math.round(totalPosition.top + newTop - (volumeHandle.height() / 2))); 27435 27436 // show the current visibility 27437 volumeCurrent.height(totalHeight - newTop); 27438 volumeCurrent.css('top', totalPosition.top + newTop); 27439 } else { 27440 var 27441 // height of the full size volume slider background 27442 totalWidth = volumeTotal.width(), 27443 27444 // the new left position based on the current volume 27445 newLeft = totalWidth * volume; 27446 27447 // handle 27448 volumeHandle.css('left', Math.round(totalPosition.left + newLeft - (volumeHandle.width() / 2))); 27449 27450 // rezize the current part of the volume bar 27451 volumeCurrent.width(Math.round(newLeft)); 27452 } 27453 }, 27454 handleVolumeMove = function (e) { 27455 27456 var volume = null, 27457 totalOffset = volumeTotal.offset(); 27458 27459 // calculate the new volume based on the moust position 27460 if (mode === 'vertical') { 27461 27462 var 27463 railHeight = volumeTotal.height(), 27464 newY = e.pageY - totalOffset.top; 27465 27466 volume = (railHeight - newY) / railHeight; 27467 27468 // the controls just hide themselves (usually when mouse moves too far up) 27469 if (totalOffset.top === 0 || totalOffset.left === 0) { 27470 return; 27471 } 27472 27473 } else { 27474 var 27475 railWidth = volumeTotal.width(), 27476 newX = e.pageX - totalOffset.left; 27477 27478 volume = newX / railWidth; 27479 } 27480 27481 // ensure the volume isn't outside 0-1 27482 volume = Math.max(0, volume); 27483 volume = Math.min(volume, 1); 27484 27485 // position the slider and handle 27486 positionVolumeHandle(volume); 27487 27488 // set the media object (this will trigger the volumechanged event) 27489 if (volume === 0) { 27490 media.setMuted(true); 27491 } else { 27492 media.setMuted(false); 27493 } 27494 media.setVolume(volume); 27495 }, 27496 mouseIsDown = false, 27497 mouseIsOver = false;
27498 27499 // SLIDER 27500 27501 mute 27502 .hover(function () { 27503 volumeSlider.show(); 27504 mouseIsOver = true; 27505 }, function () { 27506 mouseIsOver = false; 27507 27508 if (!mouseIsDown && mode == 'vertical') { 27509 volumeSlider.hide(); 27510 } 27511 }); 27512 27513 var updateVolumeSlider = function (e) { 27514 27515 var volume = Math.floor(media.volume * 100); 27516 27517 volumeSlider.attr({ 27518 'aria-label': mejs.i18n.t('mejs.volume-slider'), 27519 'aria-valuemin': 0, 27520 'aria-valuemax': 100, 27521 'aria-valuenow': volume, 27522 'aria-valuetext': volume + '%', 27523 'role': 'slider', 27524 'tabindex': 0 27525 }); 27526 27527 }; 27528 27529 volumeSlider 27530 .bind('mouseover', function () { 27531 mouseIsOver = true; 27532 }) 27533 .bind('mousedown', function (e) { 27534 handleVolumeMove(e); 27535 t.globalBind('mousemove.vol', function (e) { 27536 handleVolumeMove(e); 27537 }); 27538 t.globalBind('mouseup.vol', function () { 27539 mouseIsDown = false; 27540 t.globalUnbind('.vol'); 27541 27542 if (!mouseIsOver && mode == 'vertical') { 27543 volumeSlider.hide(); 27544 } 27545 }); 27546 mouseIsDown = true; 27547 27548 return false; 27549 }) 27550 .bind('keydown', function (e) { 27551 var keyCode = e.keyCode; 27552 var volume = media.volume; 27553 switch (keyCode) { 27554 case 38: // Up 27555 volume = Math.min(volume + 0.1, 1); 27556 break; 27557 case 40: // Down 27558 volume = Math.max(0, volume - 0.1); 27559 break; 27560 default: 27561 return true; 27562 } 27563 27564 mouseIsDown = false; 27565 positionVolumeHandle(volume); 27566 media.setVolume(volume); 27567 return false; 27568 }); 27569 27570 // MUTE button 27571 mute.find('button').click(function () { 27572 media.setMuted(!media.muted); 27573 }); 27574 27575 //Keyboard input 27576 mute.find('button').bind('focus', function () { 27577 volumeSlider.show(); 27578 }); 27579 27580 // listen for volume change events from other sources 27581 media.addEventListener('volumechange', function (e) { 27582 if (!mouseIsDown) { 27583 if (media.muted) { 27584 positionVolumeHandle(0); 27585 mute.removeClass('mejs-mute').addClass('mejs-unmute'); 27586 } else { 27587 positionVolumeHandle(media.volume); 27588 mute.removeClass('mejs-unmute').addClass('mejs-mute'); 27589 } 27590 } 27591 updateVolumeSlider(e); 27592 }, false); 27593 27594 // mutes the media and sets the volume icon muted if the initial volume is set to 0 27595 if (player.options.startVolume === 0) { 27596 media.setMuted(true); 27597 } 27598 27599 // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements 27600 if (media.pluginType === 'native') { 27601 media.setVolume(player.options.startVolume); 27602 } 27603 27604 t.container.on('controlsresize', function () { 27605 if (media.muted) { 27606 positionVolumeHandle(0); 27607 mute.removeClass('mejs-mute').addClass('mejs-unmute'); 27608 } else { 27609 positionVolumeHandle(media.volume); 27610 mute.removeClass('mejs-unmute').addClass('mejs-mute'); 27611 } 27612 }); 27613 } 27614 }); 27615 27616})(mejs.$); 27617 27618(function($) { 27619 27620 $.extend(mejs.MepDefaults, { 27621 usePluginFullScreen: true, 27622 newWindowCallback: function() { return '';}, 27623 fullscreenText: '' 27624 }); 27625 27626 $.extend(MediaElementPlayer.prototype, { 27627 27628 isFullScreen: false, 27629 27630 isNativeFullScreen: false, 27631 27632 isInIframe: false, 27633 27634 // Possible modes 27635 // (1) 'native-native' HTML5 video + browser fullscreen (IE10+, etc.) 27636 // (2) 'plugin-native' plugin video + browser fullscreen (fails in some versions of Firefox) 27637 // (3) 'fullwindow' Full window (retains all UI) 27638 // usePluginFullScreen = true 27639 // (4) 'plugin-click' Flash 1 - click through with pointer events 27640 // (5) 'plugin-hover' Flash 2 - hover popup in flash (IE6-8) 27641 fullscreenMode: '', 27642 27643 buildfullscreen: function(player, controls, layers, media) { 27644 27645 if (!player.isVideo) 27646 return; 27647 27648 player.isInIframe = (window.location != window.parent.location); 27649 27650 // detect on start 27651 media.addEventListener('loadstart', function() { player.detectFullscreenMode(); }); 27652 27653 // build button 27654 var t = this, 27655 hideTimeout = null, 27656 fullscreenTitle = t.options.fullscreenText ? t.options.fullscreenText : mejs.i18n.t('mejs.fullscreen'), 27657 fullscreenBtn = 27658 $('<div class="mejs-button mejs-fullscreen-button">' + 27659 '<button type="button" aria-controls="' + t.id + '" title="' + fullscreenTitle + '" aria-label="' + fullscreenTitle + '"></button>' + 27660 '</div>') 27661 .appendTo(controls) 27662 .on('click', function() { 27663 27664 // toggle fullscreen 27665 var isFullScreen = (mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || player.isFullScreen; 27666 27667 if (isFullScreen) { 27668 player.exitFullScreen(); 27669 } else { 27670 player.enterFullScreen(); 27671 } 27672 }) 27673 .on('mouseover', function() { 27674 27675 // very old browsers with a plugin 27676 if (t.fullscreenMode == 'plugin-hover') { 27677 if (hideTimeout !== null) { 27678 clearTimeout(hideTimeout); 27679 delete hideTimeout; 27680 } 27681 27682 var buttonPos = fullscreenBtn.offset(), 27683 containerPos = player.container.offset(); 27684 27685 media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, true); 27686 } 27687 27688 }) 27689 .on('mouseout', function() { 27690 27691 if (t.fullscreenMode == 'plugin-hover') { 27692 if (hideTimeout !== null) { 27693 clearTimeout(hideTimeout); 27694 delete hideTimeout; 27695 } 27696 27697 hideTimeout = setTimeout(function() { 27698 media.hideFullscreenButton(); 27699 }, 1500); 27700 } 27701 27702 }); 27703 27704 27705 27706 player.fullscreenBtn = fullscreenBtn; 27707 27708 t.globalBind('keydown',function (e) { 27709 if (e.keyCode == 27 && ((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen)) { 27710 player.exitFullScreen(); 27711 } 27712 }); 27713 27714 t.normalHeight = 0; 27715 t.normalWidth = 0; 27716 27717 // setup native fullscreen event 27718 if (mejs.MediaFeatures.hasTrueNativeFullScreen) { 27719 27720 // chrome doesn't alays fire this in an iframe 27721 var fullscreenChanged = function(e) { 27722 if (player.isFullScreen) { 27723 if (mejs.MediaFeatures.isFullScreen()) { 27724 player.isNativeFullScreen = true; 27725 // reset the controls once we are fully in full screen 27726 player.setControlsSize(); 27727 } else { 27728 player.isNativeFullScreen = false;
27729 // when a user presses ESC 27730 // make sure to put the player back into place 27731 player.exitFullScreen(); 27732 } 27733 } 27734 }; 27735 27736 player.globalBind(mejs.MediaFeatures.fullScreenEventName, fullscreenChanged); 27737 } 27738 27739 }, 27740 27741 detectFullscreenMode: function() { 27742 27743 var t = this, 27744 mode = '', 27745 features = mejs.MediaFeatures; 27746 27747 if (features.hasTrueNativeFullScreen && t.media.pluginType === 'native') { 27748 mode = 'native-native'; 27749 } else if (features.hasTrueNativeFullScreen && t.media.pluginType !== 'native' && !features.hasFirefoxPluginMovingProblem) { 27750 mode = 'plugin-native'; 27751 } else if (t.usePluginFullScreen) { 27752 if (mejs.MediaFeatures.supportsPointerEvents) { 27753 mode = 'plugin-click'; 27754 // this needs some special setup 27755 t.createPluginClickThrough(); 27756 } else { 27757 mode = 'plugin-hover'; 27758 } 27759 27760 } else { 27761 mode = 'fullwindow'; 27762 } 27763 27764 27765 t.fullscreenMode = mode; 27766 return mode; 27767 }, 27768 27769 isPluginClickThroughCreated: false, 27770 27771 createPluginClickThrough: function() { 27772 27773 var t = this; 27774 27775 // don't build twice 27776 if (t.isPluginClickThroughCreated) { 27777 return; 27778 } 27779 27780 // allows clicking through the fullscreen button and controls down directly to Flash 27781 27782 /* 27783 When a user puts his mouse over the fullscreen button, we disable the controls so that mouse events can go down to flash (pointer-events) 27784 We then put a divs over the video and on either side of the fullscreen button 27785 to capture mouse movement and restore the controls once the mouse moves outside of the fullscreen button 27786 */ 27787 27788 var fullscreenIsDisabled = false, 27789 restoreControls = function() { 27790 if (fullscreenIsDisabled) { 27791 // hide the hovers 27792 for (var i in hoverDivs) { 27793 hoverDivs[i].hide(); 27794 } 27795 27796 // restore the control bar 27797 t.fullscreenBtn.css('pointer-events', ''); 27798 t.controls.css('pointer-events', ''); 27799 27800 // prevent clicks from pausing video 27801 t.media.removeEventListener('click', t.clickToPlayPauseCallback); 27802 27803 // store for later 27804 fullscreenIsDisabled = false; 27805 } 27806 }, 27807 hoverDivs = {}, 27808 hoverDivNames = ['top', 'left', 'right', 'bottom'], 27809 i, len, 27810 positionHoverDivs = function() { 27811 var fullScreenBtnOffsetLeft = fullscreenBtn.offset().left - t.container.offset().left, 27812 fullScreenBtnOffsetTop = fullscreenBtn.offset().top - t.container.offset().top, 27813 fullScreenBtnWidth = fullscreenBtn.outerWidth(true), 27814 fullScreenBtnHeight = fullscreenBtn.outerHeight(true), 27815 containerWidth = t.container.width(), 27816 containerHeight = t.container.height(); 27817 27818 for (i in hoverDivs) { 27819 hoverDivs[i].css({position: 'absolute', top: 0, left: 0}); //, backgroundColor: '#f00'}); 27820 } 27821 27822 // over video, but not controls 27823 hoverDivs['top'] 27824 .width( containerWidth ) 27825 .height( fullScreenBtnOffsetTop ); 27826 27827 // over controls, but not the fullscreen button 27828 hoverDivs['left'] 27829 .width( fullScreenBtnOffsetLeft ) 27830 .height( fullScreenBtnHeight ) 27831 .css({top: fullScreenBtnOffsetTop}); 27832 27833 // after the fullscreen button 27834 hoverDivs['right'] 27835 .width( containerWidth - fullScreenBtnOffsetLeft - fullScreenBtnWidth ) 27836 .height( fullScreenBtnHeight ) 27837 .css({top: fullScreenBtnOffsetTop, 27838 left: fullScreenBtnOffsetLeft + fullScreenBtnWidth}); 27839 27840 // under the fullscreen button 27841 hoverDivs['bottom'] 27842 .width( containerWidth ) 27843 .height( containerHeight - fullScreenBtnHeight - fullScreenBtnOffsetTop ) 27844 .css({top: fullScreenBtnOffsetTop + fullScreenBtnHeight}); 27845 }; 27846 27847 t.globalBind('resize', function() { 27848 positionHoverDivs(); 27849 }); 27850 27851 for (i = 0, len = hoverDivNames.length; i < len; i++) { 27852 hoverDivs[hoverDivNames[i]] = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls).hide(); 27853 } 27854 27855 // on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash 27856 fullscreenBtn.on('mouseover',function() { 27857 27858 if (!t.isFullScreen) { 27859 27860 var buttonPos = fullscreenBtn.offset(), 27861 containerPos = player.container.offset(); 27862 27863 // move the button in Flash into place 27864 media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, false); 27865 27866 // allows click through
27867 t.fullscreenBtn.css('pointer-events', 'none'); 27868 t.controls.css('pointer-events', 'none'); 27869 27870 // restore click-to-play 27871 t.media.addEventListener('click', t.clickToPlayPauseCallback); 27872 27873 // show the divs that will restore things 27874 for (i in hoverDivs) { 27875 hoverDivs[i].show(); 27876 } 27877 27878 positionHoverDivs(); 27879 27880 fullscreenIsDisabled = true; 27881 } 27882 27883 }); 27884 27885 // restore controls anytime the user enters or leaves fullscreen 27886 media.addEventListener('fullscreenchange', function(e) { 27887 t.isFullScreen = !t.isFullScreen; 27888 // don't allow plugin click to pause video - messes with 27889 // plugin's controls 27890 if (t.isFullScreen) { 27891 t.media.removeEventListener('click', t.clickToPlayPauseCallback); 27892 } else { 27893 t.media.addEventListener('click', t.clickToPlayPauseCallback); 27894 } 27895 restoreControls(); 27896 }); 27897 27898 27899 // the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events 27900 // so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button 27901 27902 t.globalBind('mousemove', function(e) { 27903 27904 // if the mouse is anywhere but the fullsceen button, then restore it all 27905 if (fullscreenIsDisabled) { 27906 27907 var fullscreenBtnPos = fullscreenBtn.offset(); 27908 27909 27910 if (e.pageY < fullscreenBtnPos.top || e.pageY > fullscreenBtnPos.top + fullscreenBtn.outerHeight(true) || 27911 e.pageX < fullscreenBtnPos.left || e.pageX > fullscreenBtnPos.left + fullscreenBtn.outerWidth(true) 27912 ) { 27913 27914 fullscreenBtn.css('pointer-events', ''); 27915 t.controls.css('pointer-events', ''); 27916 27917 fullscreenIsDisabled = false; 27918 } 27919 } 27920 }); 27921 27922 27923 t.isPluginClickThroughCreated = true; 27924 }, 27925 27926 cleanfullscreen: function(player) { 27927 player.exitFullScreen(); 27928 }, 27929 27930 containerSizeTimeout: null, 27931 27932 enterFullScreen: function() { 27933 27934 var t = this; 27935 27936 if (mejs.MediaFeatures.isiOS && mejs.MediaFeatures.hasiOSFullScreen && typeof t.media.webkitEnterFullscreen === 'function') { 27937 t.media.webkitEnterFullscreen(); 27938 return; 27939 } 27940 27941 // set it to not show scroll bars so 100% will work 27942 $(document.documentElement).addClass('mejs-fullscreen'); 27943 27944 // store sizing 27945 t.normalHeight = t.container.height(); 27946 t.normalWidth = t.container.width(); 27947 27948 27949 27950 // attempt to do true fullscreen 27951 if (t.fullscreenMode === 'native-native' || t.fullscreenMode === 'plugin-native') { 27952 27953 mejs.MediaFeatures.requestFullScreen(t.container[0]); 27954 //return; 27955 27956 if (t.isInIframe) { 27957 // sometimes exiting from fullscreen doesn't work 27958 // notably in Chrome <iframe>. Fixed in version 17 27959 setTimeout(function checkFullscreen() { 27960 27961 if (t.isNativeFullScreen) { 27962 var percentErrorMargin = 0.002, // 0.2% 27963 windowWidth = $(window).width(), 27964 screenWidth = screen.width, 27965 absDiff = Math.abs(screenWidth - windowWidth), 27966 marginError = screenWidth * percentErrorMargin; 27967 27968 // check if the video is suddenly not really fullscreen 27969 if (absDiff > marginError) { 27970 // manually exit 27971 t.exitFullScreen(); 27972 } else { 27973 // test again 27974 setTimeout(checkFullscreen, 500); 27975 } 27976 } 27977 27978 }, 1000); 27979 } 27980 27981 } else if (t.fullscreeMode == 'fullwindow') { 27982 // move into position 27983 27984 } 27985 27986 // make full size 27987 t.container 27988 .addClass('mejs-container-fullscreen') 27989 .width('100%') 27990 .height('100%'); 27991 //.css({position: 'fixed', left: 0, top: 0, right: 0, bottom: 0, overflow: 'hidden', width: '100%', height: '100%', 'z-index': 1000}); 27992 27993 // Only needed for safari 5.1 native full screen, can cause display issues elsewhere 27994 // Actually, it seems to be needed for IE8, too 27995 //if (mejs.MediaFeatures.hasTrueNativeFullScreen) { 27996 t.containerSizeTimeout = setTimeout(function() { 27997 t.container.css({width: '100%', height: '100%'}); 27998 t.setControlsSize(); 27999 }, 500); 28000 //} 28001 28002 if (t.media.pluginType === 'native') { 28003 t.$media 28004 .width('100%') 28005 .height('100%'); 28006 } else { 28007 t.container.find('.mejs-shim') 28008 .width('100%') 28009 .height('100%'); 28010 28011 setTimeout(function() { 28012 var win = $(window), 28013 winW = win.width(), 28014 winH = win.height(); 28015 28016 t.media.setVideoSize(winW,winH); 28017 }, 500); 28018 } 28019 28020 t.layers.children('div') 28021 .width('100%') 28022 .height('100%'); 28023 28024 if (t.fullscreenBtn) { 28025 t.fullscreenBtn 28026 .removeClass('mejs-fullscreen') 28027 .addClass('mejs-unfullscreen'); 28028 } 28029 28030 t.setControlsSize(); 28031 t.isFullScreen = true; 28032 28033 t.container.find('.mejs-captions-text').css('font-size', screen.width / t.width * 1.00 * 100 + '%'); 28034 t.container.find('.mejs-captions-position').css('bottom', '45px'); 28035 28036 t.container.trigger('enteredfullscreen'); 28037 }, 28038 28039 exitFullScreen: function() { 28040 28041 var t = this; 28042 28043 // Prevent container from attempting to stretch a second time 28044 clearTimeout(t.containerSizeTimeout); 28045 28046 // firefox can't adjust plugins 28047 /* 28048 if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) { 28049 t.media.setFullscreen(false); 28050 //player.isFullScreen = false;
28051 return; 28052 } 28053 */ 28054 28055 // come out of native fullscreen 28056 if (mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || t.isFullScreen)) { 28057 mejs.MediaFeatures.cancelFullScreen(); 28058 } 28059 28060 // restore scroll bars to document 28061 $(document.documentElement).removeClass('mejs-fullscreen'); 28062 28063 t.container 28064 .removeClass('mejs-container-fullscreen') 28065 .width(t.normalWidth) 28066 .height(t.normalHeight); 28067 28068 if (t.media.pluginType === 'native') { 28069 t.$media 28070 .width(t.normalWidth) 28071 .height(t.normalHeight); 28072 } else { 28073 t.container.find('.mejs-shim') 28074 .width(t.normalWidth) 28075 .height(t.normalHeight); 28076 28077 t.media.setVideoSize(t.normalWidth, t.normalHeight); 28078 } 28079 28080 t.layers.children('div') 28081 .width(t.normalWidth) 28082 .height(t.normalHeight); 28083 28084 t.fullscreenBtn 28085 .removeClass('mejs-unfullscreen') 28086 .addClass('mejs-fullscreen'); 28087 28088 t.setControlsSize(); 28089 t.isFullScreen = false; 28090 28091 t.container.find('.mejs-captions-text').css('font-size',''); 28092 t.container.find('.mejs-captions-position').css('bottom', ''); 28093 28094 t.container.trigger('exitedfullscreen'); 28095 } 28096 }); 28097 28098})(mejs.$); 28099 28100(function($) { 28101 28102 // Speed 28103 $.extend(mejs.MepDefaults, { 28104 28105 // We also support to pass object like this: 28106 // [{name: 'Slow', value: '0.75'}, {name: 'Normal', value: '1.00'}, ...] 28107 speeds: ['2.00', '1.50', '1.25', '1.00', '0.75'], 28108 28109 defaultSpeed: '1.00', 28110 28111 speedChar: 'x' 28112 28113 }); 28114 28115 $.extend(MediaElementPlayer.prototype, { 28116 28117 buildspeed: function(player, controls, layers, media) { 28118 var t = this; 28119 28120 if (t.media.pluginType == 'native') { 28121 var 28122 speedButton = null, 28123 speedSelector = null, 28124 playbackSpeed = null, 28125 inputId = null; 28126 28127 var speeds = []; 28128 var defaultInArray = false; 28129 for (var i=0, len=t.options.speeds.length; i < len; i++) { 28130 var s = t.options.speeds[i]; 28131 if (typeof(s) === 'string'){ 28132 speeds.push({ 28133 name: s + t.options.speedChar, 28134 value: s 28135 }); 28136 if(s === t.options.defaultSpeed) { 28137 defaultInArray = true; 28138 } 28139 } 28140 else { 28141 speeds.push(s); 28142 if(s.value === t.options.defaultSpeed) { 28143 defaultInArray = true; 28144 } 28145 } 28146 } 28147 28148 if (!defaultInArray) { 28149 speeds.push({ 28150 name: t.options.defaultSpeed + t.options.speedChar, 28151 value: t.options.defaultSpeed 28152 }); 28153 } 28154 28155 speeds.sort(function(a, b) { 28156 return parseFloat(b.value) - parseFloat(a.value); 28157 }); 28158 28159 var getSpeedNameFromValue = function(value) { 28160 for(i=0,len=speeds.length; i <len; i++) { 28161 if (speeds[i].value === value) { 28162 return speeds[i].name; 28163 } 28164 } 28165 }; 28166 28167 var html = '<div class="mejs-button mejs-speed-button">' + 28168 '<button type="button">' + getSpeedNameFromValue(t.options.defaultSpeed) + '</button>' + 28169 '<div class="mejs-speed-selector">' + 28170 '<ul>'; 28171 28172 for (i = 0, il = speeds.length; i<il; i++) { 28173 inputId = t.id + '-speed-' + speeds[i].value; 28174 html += '<li>' + 28175 '<input type="radio" name="speed" ' + 28176 'value="' + speeds[i].value + '" ' + 28177 'id="' + inputId + '" ' + 28178 (speeds[i].value === t.options.defaultSpeed ? ' checked' : '') + 28179 ' />' + 28180 '<label for="' + inputId + '" ' + 28181 (speeds[i].value === t.options.defaultSpeed ? ' class="mejs-speed-selected"' : '') + 28182 '>' + speeds[i].name + '</label>' + 28183 '</li>'; 28184 } 28185 html += '</ul></div></div>'; 28186 28187 speedButton = $(html).appendTo(controls); 28188 speedSelector = speedButton.find('.mejs-speed-selector'); 28189 28190 playbackSpeed = t.options.defaultSpeed; 28191 28192 media.addEventListener('loadedmetadata', function(e) { 28193 if (playbackSpeed) { 28194 media.playbackRate = parseFloat(playbackSpeed); 28195 } 28196 }, true); 28197 28198 speedSelector 28199 .on('click', 'input[type="radio"]', function() { 28200 var newSpeed = $(this).attr('value'); 28201 playbackSpeed = newSpeed; 28202 media.playbackRate = parseFloat(newSpeed); 28203 speedButton.find('button').html(getSpeedNameFromValue(newSpeed)); 28204 speedButton.find('.mejs-speed-selected').removeClass('mejs-speed-selected'); 28205 speedButton.find('input[type="radio"]:checked').next().addClass('mejs-speed-selected'); 28206 }); 28207 speedButton 28208 .one( 'mouseenter focusin', function() { 28209 speedSelector 28210 .height( 28211 speedButton.find('.mejs-speed-selector ul').outerHeight(true) + 28212 speedButton.find('.mejs-speed-translations').outerHeight(true)) 28213 .css('top', (-1 * speedSelector.height()) + 'px'); 28214 }); 28215 } 28216 } 28217 }); 28218 28219})(mejs.$); 28220 28221(function($) { 28222 28223 // add extra default options 28224 $.extend(mejs.MepDefaults, { 28225 // this will automatically turn on a <track> 28226 startLanguage: '', 28227 28228 tracksText: '', 28229 28230 // By default, no WAI-ARIA live region - don't make a 28231 // screen reader speak captions over an audio track. 28232 tracksAriaLive: false, 28233 28234 // option to remove the [cc] button when no <track kind="subtitles"> are present 28235 hideCaptionsButtonWhenEmpty: true, 28236 28237 // If true and we only have one track, change captions to popup 28238 toggleCaptionsButtonWhenOnlyOne: false, 28239 28240 // #id or .class 28241 slidesSelector: '' 28242 }); 28243 28244 $.extend(MediaElementPlayer.prototype, { 28245 28246 hasChapters: false, 28247 28248 cleartracks: function(player, controls, layers, media){ 28249 if(player) { 28250 if(player.captions) player.captions.remove(); 28251 if(player.chapters) player.chapters.remove(); 28252 if(player.captionsText) player.captionsText.remove(); 28253 if(player.captionsButton) player.captionsButton.remove(); 28254 } 28255 }, 28256 buildtracks: function(player, controls, layers, media) { 28257 if (player.tracks.length === 0) 28258 return; 28259 28260 var t = this, 28261 attr = t.options.tracksAriaLive ? 28262 'role="log" aria-live="assertive" aria-atomic="false"' : '', 28263 tracksTitle = t.options.tracksText ? t.options.tracksText : mejs.i18n.t('mejs.captions-subtitles'), 28264 i, 28265 kind; 28266 28267 if (t.domNode.textTracks) { // if browser will do native captions, prefer mejs captions, loop through tracks and hide 28268 for (i = t.domNode.textTracks.length - 1; i >= 0; i--) { 28269 t.domNode.textTracks[i].mode = "hidden"; 28270 } 28271 } 28272 t.cleartracks(player, controls, layers, media); 28273 player.chapters = 28274 $('<div class="mejs-chapters mejs-layer"></div>') 28275 .prependTo(layers).hide(); 28276 player.captions = 28277 $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover" ' + 28278 attr + '><span class="mejs-captions-text"></span></div></div>') 28279 .prependTo(layers).hide(); 28280 player.captionsText = player.captions.find('.mejs-captions-text'); 28281 player.captionsButton = 28282 $('<div class="mejs-button mejs-captions-button">'+ 28283 '<button type="button" aria-controls="' + t.id + '" title="' + tracksTitle + '" aria-label="' + tracksTitle + '"></button>'+ 28284 '<div class="mejs-captions-selector">'+ 28285 '<ul>'+ 28286 '<li>'+ 28287 '<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' + 28288 '<label for="' + player.id + '_captions_none">' + mejs.i18n.t('mejs.none') +'</label>'+ 28289 '</li>' + 28290 '</ul>'+ 28291 '</div>'+ 28292 '</div>') 28293 .appendTo(controls); 28294 28295 28296 var subtitleCount = 0; 28297 for (i=0; i<player.tracks.length; i++) { 28298 kind = player.tracks[i].kind; 28299 if (kind === 'subtitles' || kind === 'captions') { 28300 subtitleCount++; 28301 } 28302 } 28303 28304 // if only one language then just make the button a toggle 28305 if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount == 1){ 28306 // click 28307 player.captionsButton.on('click',function() { 28308 if (player.selectedTrack === null) { 28309 lang = player.tracks[0].srclang; 28310 } else { 28311 lang = 'none'; 28312 } 28313 player.setTrack(lang); 28314 }); 28315 } else { 28316 // hover or keyboard focus 28317 player.captionsButton.on( 'mouseenter focusin', function() { 28318 $(this).find('.mejs-captions-selector').removeClass('mejs-offscreen'); 28319 }) 28320 28321 // handle clicks to the language radio buttons 28322 .on('click','input[type=radio]',function() { 28323 lang = this.value; 28324 player.setTrack(lang); 28325 }); 28326 28327 player.captionsButton.on( 'mouseleave focusout', function() { 28328 $(this).find(".mejs-captions-selector").addClass("mejs-offscreen"); 28329 }); 28330 28331 } 28332 28333 if (!player.options.alwaysShowControls) { 28334 // move with controls 28335 player.container 28336 .bind('controlsshown', function () { 28337 // push captions above controls 28338 player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover'); 28339 28340 }) 28341 .bind('controlshidden', function () { 28342 if (!media.paused) { 28343 // move back to normal place 28344 player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover'); 28345 } 28346 }); 28347 } else { 28348 player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover'); 28349 } 28350 28351 player.trackToLoad = -1; 28352 player.selectedTrack = null; 28353 player.isLoadingTrack = false;
28354 28355 // add to list 28356 for (i=0; i<player.tracks.length; i++) { 28357 kind = player.tracks[i].kind; 28358 if (kind === 'subtitles' || kind === 'captions') { 28359 player.addTrackButton(player.tracks[i].srclang, player.tracks[i].label); 28360 } 28361 } 28362 28363 // start loading tracks 28364 player.loadNextTrack(); 28365 28366 media.addEventListener('timeupdate',function() { 28367 player.displayCaptions(); 28368 }, false); 28369 28370 if (player.options.slidesSelector !== '') { 28371 player.slidesContainer = $(player.options.slidesSelector); 28372 28373 media.addEventListener('timeupdate',function() { 28374 player.displaySlides(); 28375 }, false); 28376 28377 } 28378 28379 media.addEventListener('loadedmetadata', function() { 28380 player.displayChapters(); 28381 }, false); 28382 28383 player.container.hover( 28384 function () { 28385 // chapters 28386 if (player.hasChapters) { 28387 player.chapters.removeClass('mejs-offscreen'); 28388 player.chapters.fadeIn(200).height(player.chapters.find('.mejs-chapter').outerHeight()); 28389 } 28390 }, 28391 function () { 28392 if (player.hasChapters && !media.paused) { 28393 player.chapters.fadeOut(200, function() { 28394 $(this).addClass('mejs-offscreen'); 28395 $(this).css('display','block'); 28396 }); 28397 } 28398 }); 28399 28400 t.container.on('controlsresize', function() { 28401 t.adjustLanguageBox(); 28402 }); 28403 28404 // check for autoplay 28405 if (player.node.getAttribute('autoplay') !== null) { 28406 player.chapters.addClass('mejs-offscreen'); 28407 } 28408 }, 28409 28410 setTrack: function(lang){ 28411 28412 var t = this, 28413 i; 28414 28415 if (lang == 'none') { 28416 t.selectedTrack = null; 28417 t.captionsButton.removeClass('mejs-captions-enabled'); 28418 } else { 28419 for (i=0; i<t.tracks.length; i++) { 28420 if (t.tracks[i].srclang == lang) { 28421 if (t.selectedTrack === null) 28422 t.captionsButton.addClass('mejs-captions-enabled'); 28423 t.selectedTrack = t.tracks[i]; 28424 t.captions.attr('lang', t.selectedTrack.srclang); 28425 t.displayCaptions(); 28426 break; 28427 } 28428 } 28429 } 28430 }, 28431 28432 loadNextTrack: function() { 28433 var t = this; 28434 28435 t.trackToLoad++; 28436 if (t.trackToLoad < t.tracks.length) { 28437 t.isLoadingTrack = true; 28438 t.loadTrack(t.trackToLoad); 28439 } else { 28440 // add done? 28441 t.isLoadingTrack = false; 28442 28443 t.checkForTracks(); 28444 } 28445 }, 28446 28447 loadTrack: function(index){ 28448 var 28449 t = this, 28450 track = t.tracks[index], 28451 after = function() { 28452 28453 track.isLoaded = true; 28454 28455 t.enableTrackButton(track.srclang, track.label); 28456 28457 t.loadNextTrack(); 28458 28459 }; 28460 28461 28462 $.ajax({ 28463 url: track.src, 28464 dataType: "text", 28465 success: function(d) { 28466 28467 // parse the loaded file 28468 if (typeof d == "string" && (/<tt\s+xml/ig).exec(d)) { 28469 track.entries = mejs.TrackFormatParser.dfxp.parse(d); 28470 } else { 28471 track.entries = mejs.TrackFormatParser.webvtt.parse(d); 28472 } 28473 28474 after(); 28475 28476 if (track.kind == 'chapters') { 28477 t.media.addEventListener('play', function() { 28478 if (t.media.duration > 0) { 28479 t.displayChapters(track); 28480 } 28481 }, false); 28482 } 28483 28484 if (track.kind == 'slides') { 28485 t.setupSlides(track); 28486 } 28487 }, 28488 error: function() { 28489 t.removeTrackButton(track.srclang); 28490 t.loadNextTrack(); 28491 } 28492 }); 28493 }, 28494 28495 enableTrackButton: function(lang, label) { 28496 var t = this; 28497 28498 if (label === '') { 28499 label = mejs.language.codes[lang] || lang; 28500 } 28501 28502 t.captionsButton 28503 .find('input[value=' + lang + ']') 28504 .prop('disabled',false) 28505 .siblings('label') 28506 .html( label ); 28507 28508 // auto select 28509 if (t.options.startLanguage == lang) { 28510 $('#' + t.id + '_captions_' + lang).prop('checked', true).trigger('click'); 28511 } 28512 28513 t.adjustLanguageBox(); 28514 }, 28515 28516 removeTrackButton: function(lang) { 28517 var t = this; 28518 28519 t.captionsButton.find('input[value=' + lang + ']').closest('li').remove(); 28520 28521 t.adjustLanguageBox(); 28522 }, 28523 28524 addTrackButton: function(lang, label) { 28525 var t = this; 28526 if (label === '') { 28527 label = mejs.language.codes[lang] || lang; 28528 } 28529 28530 t.captionsButton.find('ul').append( 28531 $('<li>'+ 28532 '<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' + 28533 '<label for="' + t.id + '_captions_' + lang + '">' + label + ' (loading)' + '</label>'+ 28534 '</li>') 28535 ); 28536 28537 t.adjustLanguageBox(); 28538 28539 // remove this from the dropdownlist (if it exists) 28540 t.container.find('.mejs-captions-translations option[value=' + lang + ']').remove(); 28541 }, 28542 28543 adjustLanguageBox:function() { 28544 var t = this; 28545 // adjust the size of the outer box 28546 t.captionsButton.find('.mejs-captions-selector').height( 28547 t.captionsButton.find('.mejs-captions-selector ul').outerHeight(true) + 28548 t.captionsButton.find('.mejs-captions-translations').outerHeight(true) 28549 ); 28550 }, 28551 28552 checkForTracks: function() { 28553 var 28554 t = this, 28555 hasSubtitles = false;
28556 28557 // check if any subtitles 28558 if (t.options.hideCaptionsButtonWhenEmpty) { 28559 for (var i=0; i<t.tracks.length; i++) { 28560 var kind = t.tracks[i].kind; 28561 if ((kind === 'subtitles' || kind === 'captions') && t.tracks[i].isLoaded) { 28562 hasSubtitles = true; 28563 break; 28564 } 28565 } 28566 28567 if (!hasSubtitles) { 28568 t.captionsButton.hide(); 28569 t.setControlsSize(); 28570 } 28571 } 28572 }, 28573 28574 displayCaptions: function() { 28575 28576 if (typeof this.tracks == 'undefined') 28577 return; 28578 28579 var 28580 t = this, 28581 i, 28582 track = t.selectedTrack; 28583 28584 if (track !== null && track.isLoaded) { 28585 for (i=0; i<track.entries.times.length; i++) { 28586 if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop) { 28587 // Set the line before the timecode as a class so the cue can be targeted if needed 28588 t.captionsText.html(track.entries.text[i]).attr('class', 'mejs-captions-text ' + (track.entries.times[i].identifier || '')); 28589 t.captions.show().height(0); 28590 return; // exit out if one is visible; 28591 } 28592 } 28593 t.captions.hide(); 28594 } else { 28595 t.captions.hide(); 28596 } 28597 }, 28598 28599 setupSlides: function(track) { 28600 var t = this; 28601 28602 t.slides = track; 28603 t.slides.entries.imgs = [t.slides.entries.text.length]; 28604 t.showSlide(0); 28605 28606 }, 28607 28608 showSlide: function(index) { 28609 if (typeof this.tracks == 'undefined' || typeof this.slidesContainer == 'undefined') { 28610 return; 28611 } 28612 28613 var t = this, 28614 url = t.slides.entries.text[index], 28615 img = t.slides.entries.imgs[index]; 28616 28617 if (typeof img == 'undefined' || typeof img.fadeIn == 'undefined') { 28618 28619 t.slides.entries.imgs[index] = img = $('<img src="' + url + '">') 28620 .on('load', function() { 28621 img.appendTo(t.slidesContainer) 28622 .hide() 28623 .fadeIn() 28624 .siblings(':visible') 28625 .fadeOut(); 28626 28627 }); 28628 28629 } else { 28630 28631 if (!img.is(':visible') && !img.is(':animated')) { 28632 28633 // 28634 28635 img.fadeIn() 28636 .siblings(':visible') 28637 .fadeOut(); 28638 } 28639 } 28640 28641 }, 28642 28643 displaySlides: function() { 28644 28645 if (typeof this.slides == 'undefined') 28646 return; 28647 28648 var 28649 t = this, 28650 slides = t.slides, 28651 i; 28652 28653 for (i=0; i<slides.entries.times.length; i++) { 28654 if (t.media.currentTime >= slides.entries.times[i].start && t.media.currentTime <= slides.entries.times[i].stop){ 28655 28656 t.showSlide(i); 28657 28658 return; // exit out if one is visible; 28659 } 28660 } 28661 }, 28662 28663 displayChapters: function() { 28664 var 28665 t = this, 28666 i; 28667 28668 for (i=0; i<t.tracks.length; i++) { 28669 if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) { 28670 t.drawChapters(t.tracks[i]); 28671 t.hasChapters = true; 28672 break; 28673 } 28674 } 28675 }, 28676 28677 drawChapters: function(chapters) { 28678 var 28679 t = this, 28680 i, 28681 dur, 28682 //width, 28683 //left, 28684 percent = 0, 28685 usedPercent = 0; 28686 28687 t.chapters.empty(); 28688 28689 for (i=0; i<chapters.entries.times.length; i++) { 28690 dur = chapters.entries.times[i].stop - chapters.entries.times[i].start; 28691 percent = Math.floor(dur / t.media.duration * 100); 28692 if (percent + usedPercent > 100 || // too large 28693 i == chapters.entries.times.length-1 && percent + usedPercent < 100) // not going to fill it in 28694 { 28695 percent = 100 - usedPercent; 28696 } 28697 //width = Math.floor(t.width * dur / t.media.duration); 28698 //left = Math.floor(t.width * chapters.entries.times[i].start / t.media.duration); 28699 //if (left + width > t.width) { 28700 // width = t.width - left; 28701 //} 28702 28703 t.chapters.append( $( 28704 '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' + 28705 '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' + 28706 '<span class="ch-title">' + chapters.entries.text[i] + '</span>' + 28707 '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start, t.options) + '–' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop, t.options) + '</span>' + 28708 '</div>' + 28709 '</div>')); 28710 usedPercent += percent; 28711 } 28712 28713 t.chapters.find('div.mejs-chapter').click(function() { 28714 t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) ); 28715 if (t.media.paused) { 28716 t.media.play(); 28717 } 28718 }); 28719 28720 t.chapters.show(); 28721 } 28722 }); 28723 28724 28725 28726 mejs.language = { 28727 codes: { 28728 af:'Afrikaans', 28729 sq:'Albanian', 28730 ar:'Arabic', 28731 be:'Belarusian', 28732 bg:'Bulgarian', 28733 ca:'Catalan', 28734 zh:'Chinese', 28735 'zh-cn':'Chinese Simplified', 28736 'zh-tw':'Chinese Traditional', 28737 hr:'Croatian', 28738 cs:'Czech', 28739 da:'Danish', 28740 nl:'Dutch', 28741 en:'English', 28742 et:'Estonian', 28743 fl:'Filipino', 28744 fi:'Finnish', 28745 fr:'French', 28746 gl:'Galician', 28747 de:'German', 28748 el:'Greek', 28749 ht:'Haitian Creole', 28750 iw:'Hebrew', 28751 hi:'Hindi', 28752 hu:'Hungarian', 28753 is:'Icelandic', 28754 id:'Indonesian', 28755 ga:'Irish', 28756 it:'Italian', 28757 ja:'Japanese', 28758 ko:'Korean', 28759 lv:'Latvian', 28760 lt:'Lithuanian', 28761 mk:'Macedonian', 28762 ms:'Malay', 28763 mt:'Maltese', 28764 no:'Norwegian', 28765 fa:'Persian', 28766 pl:'Polish', 28767 pt:'Portuguese', 28768 // 'pt-pt':'Portuguese (Portugal)', 28769 ro:'Romanian', 28770 ru:'Russian', 28771 sr:'Serbian', 28772 sk:'Slovak', 28773 sl:'Slovenian', 28774 es:'Spanish', 28775 sw:'Swahili', 28776 sv:'Swedish', 28777 tl:'Tagalog', 28778 th:'Thai', 28779 tr:'Turkish', 28780 uk:'Ukrainian', 28781 vi:'Vietnamese', 28782 cy:'Welsh', 28783 yi:'Yiddish' 28784 } 28785 }; 28786 28787 /* 28788 Parses WebVTT format which should be formatted as 28789 ================================ 28790 WEBVTT 28791 28792 1 28793 00:00:01,1 --> 00:00:05,000 28794 A line of text 28795 28796 2 28797 00:01:15,1 --> 00:02:05,000 28798 A second line of text 28799 28800 =============================== 28801 28802 Adapted from: http://www.delphiki.com/html5/playr 28803 */ 28804 mejs.TrackFormatParser = { 28805 webvtt: {
28806 pattern_timecode: /^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/, 28807 28808 parse: function(trackText) { 28809 var 28810 i = 0, 28811 lines = mejs.TrackFormatParser.split2(trackText, /\r?\n/), 28812 entries = {text:[], times:[]}, 28813 timecode, 28814 text, 28815 identifier; 28816 for(; i<lines.length; i++) { 28817 timecode = this.pattern_timecode.exec(lines[i]); 28818 28819 if (timecode && i<lines.length) { 28820 if ((i - 1) >= 0 && lines[i - 1] !== '') { 28821 identifier = lines[i - 1]; 28822 } 28823 i++; 28824 // grab all the (possibly multi-line) text that follows 28825 text = lines[i]; 28826 i++; 28827 while(lines[i] !== '' && i<lines.length){ 28828 text = text + '\n' + lines[i]; 28829 i++; 28830 } 28831 text = $.trim(text).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); 28832 // Text is in a different array so I can use .join 28833 entries.text.push(text); 28834 entries.times.push( 28835 { 28836 identifier: identifier, 28837 start: (mejs.Utility.convertSMPTEtoSeconds(timecode[1]) === 0) ? 0.200 : mejs.Utility.convertSMPTEtoSeconds(timecode[1]), 28838 stop: mejs.Utility.convertSMPTEtoSeconds(timecode[3]), 28839 settings: timecode[5] 28840 }); 28841 } 28842 identifier = ''; 28843 } 28844 return entries; 28845 } 28846 }, 28847 // Thanks to Justin Capella: https://github.com/johndyer/mediaelement/pull/420 28848 dfxp: { 28849 parse: function(trackText) { 28850 trackText = $(trackText).filter("tt"); 28851 var 28852 i = 0, 28853 container = trackText.children("div").eq(0), 28854 lines = container.find("p"), 28855 styleNode = trackText.find("#" + container.attr("style")), 28856 styles, 28857 text, 28858 entries = {text:[], times:[]}; 28859 28860 28861 if (styleNode.length) { 28862 var attributes = styleNode.removeAttr("id").get(0).attributes; 28863 if (attributes.length) { 28864 styles = {}; 28865 for (i = 0; i < attributes.length; i++) { 28866 styles[attributes[i].name.split(":")[1]] = attributes[i].value; 28867 } 28868 } 28869 } 28870 28871 for(i = 0; i<lines.length; i++) { 28872 var style; 28873 var _temp_times = { 28874 start: null, 28875 stop: null, 28876 style: null 28877 }; 28878 if (lines.eq(i).attr("begin")) _temp_times.start = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i).attr("begin")); 28879 if (!_temp_times.start && lines.eq(i-1).attr("end")) _temp_times.start = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i-1).attr("end")); 28880 if (lines.eq(i).attr("end")) _temp_times.stop = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i).attr("end")); 28881 if (!_temp_times.stop && lines.eq(i+1).attr("begin")) _temp_times.stop = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i+1).attr("begin")); 28882 if (styles) { 28883 style = ""; 28884 for (var _style in styles) { 28885 style += _style + ":" + styles[_style] + ";"; 28886 } 28887 } 28888 if (style) _temp_times.style = style; 28889 if (_temp_times.start === 0) _temp_times.start = 0.200; 28890 entries.times.push(_temp_times); 28891 text = $.trim(lines.eq(i).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); 28892 entries.text.push(text); 28893 } 28894 return entries; 28895 } 28896 }, 28897 split2: function (text, regex) { 28898 // normal version for compliant browsers 28899 // see below for IE fix 28900 return text.split(regex); 28901 } 28902 }; 28903 28904 // test for browsers with bad String.split method. 28905 if ('x\n\ny'.split(/\n/gi).length != 3) { 28906 // add super slow IE8 and below version 28907 mejs.TrackFormatParser.split2 = function(text, regex) { 28908 var 28909 parts = [], 28910 chunk = '', 28911 i; 28912 28913 for (i=0; i<text.length; i++) { 28914 chunk += text.substring(i,i+1); 28915 if (regex.test(chunk)) { 28916 parts.push(chunk.replace(regex, '')); 28917 chunk = ''; 28918 } 28919 } 28920 parts.push(chunk); 28921 return parts; 28922 }; 28923 } 28924 28925})(mejs.$); 28926 28927// Source Chooser Plugin 28928(function($) { 28929 28930 $.extend(mejs.MepDefaults, { 28931 sourcechooserText: '' 28932 }); 28933 28934 $.extend(MediaElementPlayer.prototype, { 28935 buildsourcechooser: function(player, controls, layers, media) { 28936 28937 var 28938 t = this, 28939 sourceTitle = t.options.sourcechooserText ? t.options.sourcechooserText : mejs.i18n.t('mejs.source-chooser'), 28940 hoverTimeout 28941 ; 28942 28943 player.sourcechooserButton = 28944 $('<div class="mejs-button mejs-sourcechooser-button">'+ 28945 '<button type="button" role="button" aria-haspopup="true" aria-owns="' + t.id + '" title="' + sourceTitle + '" aria-label="' + sourceTitle + '"></button>'+ 28946 '<div class="mejs-sourcechooser-selector mejs-offscreen" role="menu" aria-expanded="false" aria-hidden="true">'+ 28947 '<ul>'+ 28948 '</ul>'+ 28949 '</div>'+ 28950 '</div>') 28951 .appendTo(controls) 28952 28953 // hover 28954 .hover(function() { 28955 clearTimeout(hoverTimeout); 28956 player.showSourcechooserSelector(); 28957 }, function() { 28958 var self = $(this); 28959 hoverTimeout = setTimeout(function () { 28960 player.hideSourcechooserSelector(); 28961 }, 500); 28962 }) 28963 28964 // keyboard menu activation 28965 .on('keydown', function (e) { 28966 var keyCode = e.keyCode; 28967 28968 switch (keyCode) { 28969 case 32: // space 28970 if (!mejs.MediaFeatures.isFirefox) { // space sends the click event in Firefox 28971 player.showSourcechooserSelector(); 28972 } 28973 $(this).find('.mejs-sourcechooser-selector') 28974 .find('input[type=radio]:checked').first().focus(); 28975 break; 28976 case 13: // enter 28977 player.showSourcechooserSelector(); 28978 $(this).find('.mejs-sourcechooser-selector') 28979 .find('input[type=radio]:checked').first().focus(); 28980 break; 28981 case 27: // esc 28982 player.hideSourcechooserSelector(); 28983 $(this).find('button').focus(); 28984 break; 28985 default: 28986 return true; 28987 } 28988 }) 28989 28990 // close menu when tabbing away 28991 .on('focusout', mejs.Utility.debounce(function (e) { // Safari triggers focusout multiple times 28992 // Firefox does NOT support e.relatedTarget to see which element 28993 // just lost focus, so wait to find the next focused element 28994 setTimeout(function () { 28995 var parent = $(document.activeElement).closest('.mejs-sourcechooser-selector'); 28996 if (!parent.length) { 28997 // focus is outside the control; close menu 28998 player.hideSourcechooserSelector(); 28999 } 29000 }, 0); 29001 }, 100)) 29002 29003 // handle clicks to the source radio buttons 29004 .delegate('input[type=radio]', 'click', function() { 29005 // set aria states 29006 $(this).attr('aria-selected', true).attr('checked', 'checked'); 29007 $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').removeAttr('checked'); 29008 29009 var src = this.value; 29010 29011 if (media.currentSrc != src) { 29012 var currentTime = media.currentTime; 29013 var paused = media.paused; 29014 media.pause(); 29015 media.setSrc(src); 29016 29017 media.addEventListener('loadedmetadata', function(e) { 29018 media.currentTime = currentTime; 29019 }, true); 29020 29021 var canPlayAfterSourceSwitchHandler = function(e) { 29022 if (!paused) { 29023 media.play(); 29024 } 29025 media.removeEventListener("canplay", canPlayAfterSourceSwitchHandler, true); 29026 }; 29027 media.addEventListener('canplay', canPlayAfterSourceSwitchHandler, true); 29028 media.load(); 29029 } 29030 }) 29031 29032 // Handle click so that screen readers can toggle the menu 29033 .delegate('button', 'click', function (e) { 29034 if ($(this).siblings('.mejs-sourcechooser-selector').hasClass('mejs-offscreen')) { 29035 player.showSourcechooserSelector(); 29036 $(this).siblings('.mejs-sourcechooser-selector').find('input[type=radio]:checked').first().focus(); 29037 } else { 29038 player.hideSourcechooserSelector(); 29039 } 29040 }); 29041 29042 // add to list 29043 for (var i in this.node.children) { 29044 var src = this.node.children[i]; 29045 if (src.nodeName === 'SOURCE' && (media.canPlayType(src.type) == 'probably' || media.canPlayType(src.type) == 'maybe')) { 29046 player.addSourceButton(src.src, src.title, src.type, media.src == src.src); 29047 } 29048 } 29049 }, 29050 29051 addSourceButton: function(src, label, type, isCurrent) { 29052 var t = this; 29053 if (label === '' || label == undefined) { 29054 label = src; 29055 } 29056 type = type.split('/')[1]; 29057 29058 t.sourcechooserButton.find('ul').append( 29059 $('<li>'+ 29060 '<input type="radio" name="' + t.id + '_sourcechooser" id="' + t.id + '_sourcechooser_' + label + type + '" role="menuitemradio" value="' + src + '" ' + (isCurrent ? 'checked="checked"' : '') + 'aria-selected="' + isCurrent + '"' + ' />'+ 29061 '<label for="' + t.id + '_sourcechooser_' + label + type + '" aria-hidden="true">' + label + ' (' + type + ')</label>'+ 29062 '</li>') 29063 ); 29064 29065 t.adjustSourcechooserBox(); 29066 29067 }, 29068 29069 adjustSourcechooserBox: function() { 29070 var t = this; 29071 // adjust the size of the outer box 29072 t.sourcechooserButton.find('.mejs-sourcechooser-selector').height( 29073 t.sourcechooserButton.find('.mejs-sourcechooser-selector ul').outerHeight(true) 29074 ); 29075 }, 29076 29077 hideSourcechooserSelector: function () { 29078 this.sourcechooserButton.find('.mejs-sourcechooser-selector') 29079 .addClass('mejs-offscreen') 29080 .attr('aria-expanded', 'false') 29081 .attr('aria-hidden', 'true') 29082 .find('input[type=radio]') // make radios not fucusable 29083 .attr('tabindex', '-1'); 29084 }, 29085 29086 showSourcechooserSelector: function () { 29087 this.sourcechooserButton.find('.mejs-sourcechooser-selector') 29088 .removeClass('mejs-offscreen') 29089 .attr('aria-expanded', 'true') 29090 .attr('aria-hidden', 'false') 29091 .find('input[type=radio]') 29092 .attr('tabindex', '0'); 29093 } 29094 }); 29095 29096})(mejs.$); 29097 29098/* 29099* ContextMenu Plugin 29100* 29101* 29102*/ 29103 29104(function($) { 29105 29106$.extend(mejs.MepDefaults, 29107 { 'contextMenuItems': [ 29108 // demo of a fullscreen option 29109 { 29110 render: function(player) { 29111 29112 // check for fullscreen plugin 29113 if (typeof player.enterFullScreen == 'undefined') 29114 return null; 29115 29116 if (player.isFullScreen) { 29117 return mejs.i18n.t('mejs.fullscreen-off'); 29118 } else { 29119 return mejs.i18n.t('mejs.fullscreen-on'); 29120 } 29121 }, 29122 click: function(player) { 29123 if (player.isFullScreen) { 29124 player.exitFullScreen(); 29125 } else { 29126 player.enterFullScreen(); 29127 } 29128 } 29129 } 29130 , 29131 // demo of a mute/unmute button 29132 { 29133 render: function(player) { 29134 if (player.media.muted) { 29135 return mejs.i18n.t('mejs.unmute'); 29136 } else { 29137 return mejs.i18n.t('mejs.mute'); 29138 } 29139 }, 29140 click: function(player) { 29141 if (player.media.muted) { 29142 player.setMuted(false); 29143 } else { 29144 player.setMuted(true); 29145 } 29146 } 29147 }, 29148 // separator 29149 { 29150 isSeparator: true 29151 } 29152 , 29153 // demo of simple download video 29154 { 29155 render: function(player) { 29156 return mejs.i18n.t('mejs.download-video'); 29157 }, 29158 click: function(player) { 29159 window.location.href = player.media.currentSrc; 29160 } 29161 } 29162 ]} 29163); 29164 29165 29166 $.extend(MediaElementPlayer.prototype, { 29167 buildcontextmenu: function(player, controls, layers, media) { 29168 29169 // create context menu
29170 player.contextMenu = $('<div class="mejs-contextmenu"></div>') 29171 .appendTo($('body')) 29172 .hide(); 29173 29174 // create events for showing context menu 29175 player.container.bind('contextmenu', function(e) { 29176 if (player.isContextMenuEnabled) { 29177 e.preventDefault(); 29178 player.renderContextMenu(e.clientX-1, e.clientY-1); 29179 return false; 29180 } 29181 }); 29182 player.container.bind('click', function() { 29183 player.contextMenu.hide(); 29184 }); 29185 player.contextMenu.bind('mouseleave', function() { 29186 29187 // 29188 player.startContextMenuTimer(); 29189 29190 }); 29191 }, 29192 29193 cleancontextmenu: function(player) { 29194 player.contextMenu.remove(); 29195 }, 29196 29197 isContextMenuEnabled: true, 29198 enableContextMenu: function() { 29199 this.isContextMenuEnabled = true; 29200 }, 29201 disableContextMenu: function() { 29202 this.isContextMenuEnabled = false; 29203 }, 29204 29205 contextMenuTimeout: null, 29206 startContextMenuTimer: function() { 29207 // 29208 29209 var t = this; 29210 29211 t.killContextMenuTimer(); 29212 29213 t.contextMenuTimer = setTimeout(function() { 29214 t.hideContextMenu(); 29215 t.killContextMenuTimer(); 29216 }, 750); 29217 }, 29218 killContextMenuTimer: function() { 29219 var timer = this.contextMenuTimer; 29220 29221 // 29222 29223 if (timer != null) { 29224 clearTimeout(timer); 29225 delete timer; 29226 timer = null; 29227 } 29228 }, 29229 29230 hideContextMenu: function() { 29231 this.contextMenu.hide(); 29232 }, 29233 29234 renderContextMenu: function(x,y) { 29235 29236 // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly 29237 var t = this, 29238 html = '', 29239 items = t.options.contextMenuItems; 29240 29241 for (var i=0, il=items.length; i<il; i++) { 29242 29243 if (items[i].isSeparator) { 29244 html += '<div class="mejs-contextmenu-separator"></div>'; 29245 } else { 29246 29247 var rendered = items[i].render(t); 29248 29249 // render can return null if the item doesn't need to be used at the moment 29250 if (rendered != null) { 29251 html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>'; 29252 } 29253 } 29254 } 29255 29256 // position and show the context menu 29257 t.contextMenu 29258 .empty() 29259 .append($(html)) 29260 .css({top:y, left:x}) 29261 .show(); 29262 29263 // bind events 29264 t.contextMenu.find('.mejs-contextmenu-item').each(function() { 29265 29266 // which one is this? 29267 var $dom = $(this), 29268 itemIndex = parseInt( $dom.data('itemindex'), 10 ), 29269 item = t.options.contextMenuItems[itemIndex]; 29270 29271 // bind extra functionality? 29272 if (typeof item.show != 'undefined') 29273 item.show( $dom , t); 29274 29275 // bind click action 29276 $dom.click(function() { 29277 // perform click action 29278 if (typeof item.click != 'undefined') 29279 item.click(t); 29280 29281 // close 29282 t.contextMenu.hide(); 29283 }); 29284 }); 29285 29286 // stop the controls from hiding 29287 setTimeout(function() { 29288 t.killControlsTimer('rev3'); 29289 }, 100); 29290 29291 } 29292 }); 29293 29294})(mejs.$); 29295(function($) { 29296 // skip back button 29297 29298 $.extend(mejs.MepDefaults, { 29299 skipBackInterval: 30, 29300 // %1 will be replaced with skipBackInterval in this string 29301 skipBackText: '' 29302 }); 29303 29304 $.extend(MediaElementPlayer.prototype, { 29305 buildskipback: function(player, controls, layers, media) { 29306 var 29307 t = this, 29308 skipTitle = t.options.skipBackText ? t.options.skipBackText : mejs.i18n.t('mejs.time-skip-back'), 29309 // Replace %1 with skip back interval 29310 backText = skipTitle.replace('%1', t.options.skipBackInterval), 29311 // create the loop button 29312 loop = 29313 $('<div class="mejs-button mejs-skip-back-button">' + 29314 '<button type="button" aria-controls="' + t.id + '" title="' + backText + '" aria-label="' + backText + '">' + + '</button>' + 29315 '</div>') 29316 // append it to the toolbar 29317 .appendTo(controls) 29318 // add a click toggle event 29319 .click(function() { 29320 media.setCurrentTime(Math.max(media.currentTime - t.options.skipBackInterval, 0)); 29321 $(this).find('button').blur(); 29322 }); 29323 } 29324 }); 29325 29326})(mejs.$); 29327 29328/** 29329 * Postroll plugin 29330 */ 29331(function($) { 29332 29333 $.extend(mejs.MepDefaults, { 29334 postrollCloseText: '' 29335 }); 29336 29337 // Postroll 29338 $.extend(MediaElementPlayer.prototype, { 29339 buildpostroll: function(player, controls, layers, media) { 29340 var 29341 t = this, 29342 postrollTitle = t.options.postrollCloseText ? t.options.postrollCloseText : mejs.i18n.t('mejs.close'), 29343 postrollLink = t.container.find('link[rel="postroll"]').attr('href'); 29344 29345 if (typeof postrollLink !== 'undefined') { 29346 player.postroll = 29347 $('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">' + postrollTitle + '</a>
29347<div class="mejs-postroll-layer-content"></div></div>').prependTo(layers).hide(); 29348 29349 t.media.addEventListener('ended', function (e) { 29350 $.ajax({ 29351 dataType: 'html', 29352 url: postrollLink, 29353 success: function (data, textStatus) { 29354 layers.find('.mejs-postroll-layer-content').html(data); 29355 } 29356 }); 29357 player.postroll.show(); 29358 }, false); 29359 } 29360 } 29361 }); 29362 29363})(mejs.$); 29364/* 29365MediaElement-Markers is a MediaElement.js plugin that lets you add Visual Cues in the progress time rail. 29366This plugin also lets you register a custom callback function that will be called everytime the play position reaches a marker. 29367Marker position and a reference to the MediaElement Player object is passed to the registered callback function for any post processing. Marker color is configurable. 29368 29369*/ 29370 29371(function ($) { 29372 // markers 29373 29374 $.extend(mejs.MepDefaults, { 29375 markerColor: '#E9BC3D', //default marker color 29376 markers: [], 29377 markerCallback: function () { 29378 29379 } 29380 }); 29381 29382 $.extend(MediaElementPlayer.prototype, { 29383 buildmarkers: function (player, controls, layers, media) { 29384 var t = this, 29385 i = 0, 29386 currentPos = -1, 29387 currentMarker = -1, 29388 lastPlayPos = -1, //Track backward seek 29389 lastMarkerCallBack = -1; //Prevents successive firing of callbacks 29390 29391 for (i = 0; i < player.options.markers.length; ++i) { 29392 controls.find('.mejs-time-total').append('<span class="mejs-time-marker"></span>'); 29393 } 29394 29395 media.addEventListener('durationchange', function (e) { 29396 player.setmarkers(controls); 29397 }); 29398 media.addEventListener('timeupdate', function (e) { 29399 currentPos = Math.floor(media.currentTime); 29400 if (lastPlayPos > currentPos) { 29401 if (lastMarkerCallBack > currentPos) { 29402 lastMarkerCallBack = -1; 29403 } 29404 } else { 29405 lastPlayPos = currentPos; 29406 } 29407 29408 for (i = 0; i < player.options.markers.length; ++i) { 29409 currentMarker = Math.floor(player.options.markers[i]); 29410 if (currentPos === currentMarker && currentMarker !== lastMarkerCallBack) { 29411 player.options.markerCallback(media, media.currentTime); //Fires the callback function 29412 lastMarkerCallBack = currentMarker; 29413 } 29414 } 29415 29416 }, false); 29417 29418 }, 29419 setmarkers: function (controls) { 29420 var t = this, 29421 i = 0, 29422 left; 29423 29424 for (i = 0; i < t.options.markers.length; ++i) { 29425 if (Math.floor(t.options.markers[i]) <= t.media.duration && Math.floor(t.options.markers[i]) >= 0) { 29426 left = 100 * Math.floor(t.options.markers[i]) / t.media.duration; 29427 $(controls.find('.mejs-time-marker')[i]).css({ 29428 "width": "1px", 29429 "left": left+"%", 29430 "background": t.options.markerColor 29431 }); 29432 } 29433 } 29434 29435 } 29436 }); 29437})(mejs.$); 29438;// /var/www/www.vfb.de/httpdocs/current/static/js/footable.js 29439/* 29440* FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome. 29441* @version 3.0.9 29442* @link http://fooplugins.com 29443* @copyright Steven Usher & Brad Vincent 2015 29444* @license Released under the GPLv3 license. 29445*/ 29446(function($, F){ 29447 // add in console we use in case it's missing 29448 window.console = window.console || { log:function(){}, error:function(){} }; 29449 29450 /** 29451 * The jQuery plugin initializer. 29452 * @function jQuery.fn.footable 29453 * @param {(object|FooTable.Defaults)} [options] - The options to initialize the plugin with. 29454 * @param {function} [ready] - A callback function to execute for each initialized plugin. 29455 * @returns {jQuery} 29456 */ 29457 $.fn.footable = function (options, ready) { 29458 options = options || {}; 29459 // make sure we only work with tables 29460 return this.filter('table').each(function (i, tbl) { 29461 var ft = F.get(tbl); 29462 if (ft instanceof F.Table) ft.destroy(); 29463 F.init(tbl, options, ready); 29464 }); 29465 }; 29466 29467 var debug_defaults = { 29468 events: [] 29469 }; 29470 F.__debug__ = JSON.parse(localStorage.getItem('footable_debug')) || false; 29471 F.__debug_options__ = JSON.parse(localStorage.getItem('footable_debug_options')) || debug_defaults; 29472 29473 /** 29474 * Gets or sets the internal debug variable which enables some additional logging to the console. 29475 * When enabled this value is stored in the localStorage so it can persist across page reloads. 29476 * @param {boolean} value - Whether or not to enable additional logging. 29477 * @param {object} [options] - Any debug specific options. 29478 * @returns {(boolean|undefined)} 29479 */ 29480 F.debug = function(value, options){ 29481 if (!F.is.boolean(value)) return F.__debug__; 29482 F.__debug__ = value; 29483 if (F.__debug__){ 29484 localStorage.setItem('footable_debug', JSON.stringify(F.__debug__)); 29485 F.__debug_options__ = $.extend(true, {}, debug_defaults, options || {}); 29486 if (F.is.hash(options)){ 29487 localStorage.setItem('footable_debug_options', JSON.stringify(F.__debug_options__)); 29488 } 29489 } else { 29490 localStorage.removeItem('footable_debug'); 29491 localStorage.removeItem('footable_debug_options'); 29492 } 29493 }; 29494 29495 /** 29496 * Gets the FooTable instance of the supplied table if one exists. 29497 * @param {(jQuery|jQuery.selector|HTMLTableElement)} table - The jQuery table object, selector or the HTMLTableElement to retrieve FooTable from. 29498 * @returns {(FooTable.Table|undefined)} 29499 */ 29500 F.get = function(table){ 29501 return $(table).first().data('__FooTable__'); 29502 }; 29503 29504 /** 29505 * Initializes a new instance of FooTable on the supplied table. 29506 * @param {(jQuery|jQuery.selector|HTMLTableElement)} table - The jQuery table object, selector or the HTMLTableElement to initialize FooTable on. 29507 * @param {object} options - The options to initialize FooTable with. 29508 * @param {function} [ready] - A callback function to execute once the plugin is initialized. 29509 * @returns {FooTable.Table} 29510 */ 29511 F.init = function(table, options, ready){ 29512 return new F.Table(table, options, ready); 29513 }; 29514 29515 // The below are external type definitions mainly used as pointers to jQuery docs for important information 29516 /** 29517 * jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API 29518 * that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript. 29519 * @name jQuery 29520 * @constructor 29521 * @returns {jQuery} 29522 * @see {@link http://api.jquery.com/} 29523 */ 29524 29525 /** 29526 * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, and state) to prevent users from changing the state of the Deferred. 29527 * @typedef {object} jQuery.Promise 29528 * @see {@link http://api.jquery.com/Types/#Promise} 29529 */ 29530 29531 /** 29532 * As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, 29533 * and relay the success or failure state of any synchronous or asynchronous function. 29534 * @typedef {object} jQuery.Deferred 29535 * @see {@link http://api.jquery.com/Types/#Deferred} 29536 */ 29537 29538 /** 29539 * jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler. Most properties from 29540 * the original event are copied over and normalized to the new event object. 29541 * @typedef {object} jQuery.Event 29542 * @see {@link http://api.jquery.com/category/events/event-object/} 29543 */ 29544 29545 /** 29546 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. 29547 * @memberof jQuery 29548 * @function when 29549 * @param {...jQuery.Deferred} deferreds - Any number of deferred objects to wait for. 29550 * @returns {jQuery.Promise} 29551 * @see {@link http://api.jquery.com/jQuery.when/} 29552 */ 29553 29554 /**
29555 * The jQuery.fn namespace used to register plugins with jQuery. 29556 * @memberof jQuery 29557 * @namespace fn 29558 * @see {@link http://learn.jquery.com/plugins/basic-plugin-creation/} 29559 */ 29560})( 29561 jQuery, 29562 /** 29563 * The core FooTable namespace containing all the plugin code. 29564 * @namespace 29565 */ 29566 FooTable = window.FooTable || {} 29567); 29568(function(F){ 29569 var returnTrue = function(){ return true; }; 29570 29571 /** 29572 * This namespace contains commonly used array utility methods. 29573 * @namespace {object} FooTable.arr 29574 */ 29575 F.arr = {}; 29576 29577 /** 29578 * Iterates over each item in the supplied array and performs the supplied function passing in the current item as the first argument. 29579 * @memberof FooTable.arr 29580 * @function each 29581 * @param {Array} array - The array to iterate 29582 * @param {function} func - The function to execute for each item. The first argument supplied to this function is the current item and the second is the current index. 29583 */ 29584 F.arr.each = function (array, func) { 29585 if (!F.is.array(array) || !F.is.fn(func)) return; 29586 for (var i = 0, len = array.length; i < len; i++) { 29587 if (func(array[i], i) === false) break; 29588 } 29589 }; 29590 29591 /** 29592 * Get all items in the supplied array that optionally matches the supplied where function. If no items are found an empty array is returned. 29593 * @memberof FooTable.arr 29594 * @function get 29595 * @param {Array} array - The array to get items from. 29596 * @param {function} where - This function must return a boolean value, true includes the item in the result array. 29597 * @returns {Array} 29598 */ 29599 F.arr.get = function (array, where) { 29600 var result = []; 29601 if (!F.is.array(array)) return result; 29602 if (!F.is.fn(where)) return array; 29603 for (var i = 0, len = array.length; i < len; i++) { 29604 if (where(array[i], i)) result.push(array[i]); 29605 } 29606 return result; 29607 }; 29608 29609 /** 29610 * Get a boolean value indicating if any item exists in the supplied array that optionally matches the supplied where function. 29611 * @memberof FooTable.arr 29612 * @function any 29613 * @param {Array} array - The array to check. 29614 * @param {function} [where] - [Optional] This function must return a boolean value, true indicates that the current item is a valid match. 29615 * @returns {boolean} 29616 */ 29617 F.arr.any = function (array, where) { 29618 if (!F.is.array(array)) return false; 29619 where = F.is.fn(where) ? where : returnTrue; 29620 for (var i = 0, len = array.length; i < len; i++) { 29621 if (where(array[i], i)) return true; 29622 } 29623 return false; 29624 }; 29625 29626 /** 29627 * Checks if the supplied value exists in the array. 29628 * @memberof FooTable.arr 29629 * @function contains 29630 * @param {Array} array - The array to check. 29631 * @param {*} value - The value to check for. 29632 * @returns {boolean} 29633 */ 29634 F.arr.contains = function(array, value){ 29635 if (!F.is.array(array) || F.is.undef(value)) return false; 29636 for (var i = 0, len = array.length; i < len; i++) { 29637 if (array[i] == value) return true; 29638 } 29639 return false; 29640 }; 29641 29642 /** 29643 * Get the first item in the supplied array that optionally matches the supplied where function. If no item is found null is returned. 29644 * @memberof FooTable.arr 29645 * @function first 29646 * @param {Array} array - The array to get the item from. 29647 * @param {function} [where] - [Optional] This function must return a boolean value, true indicates that the current item can be returned. 29648 * @returns {(*|null)} 29649 */ 29650 F.arr.first = function (array, where) { 29651 if (!F.is.array(array)) return null; 29652 where = F.is.fn(where) ? where : returnTrue; 29653 for (var i = 0, len = array.length; i < len; i++) { 29654 if (where(array[i], i)) return array[i]; 29655 } 29656 return null; 29657 }; 29658 29659 /** 29660 * Creates a new array from the results of the supplied getter function. If no items are found an empty array is returned, to exclude an item from the results return null. 29661 * @memberof FooTable.arr 29662 * @function map 29663 * @param {Array} array - The array to iterate. 29664 * @param {function} getter - This function must return either a new value or null. 29665 * The first argument is the result being returned at this point in the iteration. The second argument is the current item being iterated. 29666 * @returns {(*|null)} 29667 */ 29668 F.arr.map = function (array, getter) { 29669 var result = [], returned = null; 29670 if (!F.is.array(array) || !F.is.fn(getter)) return result; 29671 for (var i = 0, len = array.length; i < len; i++) { 29672 if ((returned = getter(array[i], i)) != null) result.push(returned); 29673 } 29674 return result; 29675 }; 29676 29677 /** 29678 * Removes items from the array matching the supplied where function. All removed items are returned in a new array. 29679 * @memberof FooTable.arr 29680 * @function remove 29681 * @param {Array} array - The array to iterate and remove items from. 29682 * @param {function} where - This function must return a boolean value, true includes the item in the result array. 29683 * @returns {*} 29684 */ 29685 F.arr.remove = function (array, where) { 29686 var remove = [], removed = []; 29687 if (!F.is.array(array) || !F.is.fn(where)) return removed; 29688 var i = 0, len = array.length; 29689 for (; i < len; i++) { 29690 if (where(array[i], i, removed)){ 29691 remove.push(i); 29692 removed.push(array[i]); 29693 } 29694 } 29695 // sort the indexes to be removed from largest to smallest 29696 remove.sort(function(a, b){ return b - a; }); 29697 i = 0; len = remove.length; 29698 for(; i < len; i++){ 29699 var index = remove[i] - i; 29700 array.splice(index, 1); 29701 } 29702 return removed; 29703 }; 29704 29705 /** 29706 * Deletes a single item from the array. The item if removed is returned. 29707 * @memberof FooTable.arr 29708 * @function delete
29709 * @param {Array} array - The array to iterate and delete the item from. 29710 * @param {*} item - The item to find and delete. 29711 * @returns {(*|null)} 29712 */ 29713 F.arr.delete = function(array, item){ 29714 var remove = -1, removed = null; 29715 if (!F.is.array(array) || F.is.undef(item)) return removed; 29716 var i = 0, len = array.length; 29717 for (; i < len; i++) { 29718 if (array[i] == item){ 29719 remove = i; 29720 removed = array[i]; 29721 break; 29722 } 29723 } 29724 if (remove != -1) array.splice(remove, 1); 29725 return removed; 29726 }; 29727 29728 /** 29729 * Replaces a single item in the array with a new one. 29730 * @memberof FooTable.arr 29731 * @function replace 29732 * @param {Array} array - The array to iterate and replace the item in. 29733 * @param {*} oldItem - The item to be replaced. 29734 * @param {*} newItem - The item to be inserted. 29735 */ 29736 F.arr.replace = function(array, oldItem, newItem){ 29737 var index = array.indexOf(oldItem); 29738 if (index !== -1) array[index] = newItem; 29739 }; 29740 29741})(FooTable); 29742(function (F) { 29743 29744 /** 29745 * This namespace contains commonly used 'is' type methods that return boolean values. 29746 * @namespace FooTable.is 29747 */ 29748 F.is = {}; 29749 29750 /** 29751 * Checks if the type of the value is the same as that supplied.
29752 * @memberof FooTable.is 29753 * @function type 29754 * @param {*} value - The value to check the type of. 29755 * @param {string} type - The type to check for. 29756 * @returns {boolean} 29757 */ 29758 F.is.type = function (value, type) { 29759 return typeof value === type; 29760 }; 29761 29762 /** 29763 * Checks if the value is defined. 29764 * @memberof FooTable.is 29765 * @function defined 29766 * @param {*} value - The value to check is defined. 29767 * @returns {boolean} 29768 */ 29769 F.is.defined = function (value) { 29770 return typeof value !== 'undefined'; 29771 }; 29772 29773 /** 29774 * Checks if the value is undefined. 29775 * @memberof FooTable.is 29776 * @function undef 29777 * @param {*} value - The value to check is undefined. 29778 * @returns {boolean} 29779 */ 29780 F.is.undef = function (value) { 29781 return typeof value === 'undefined'; 29782 }; 29783 29784 /** 29785 * Checks if the value is an array. 29786 * @memberof FooTable.is 29787 * @function array 29788 * @param {*} value - The value to check. 29789 * @returns {boolean} 29790 */ 29791 F.is.array = function (value) { 29792 return '[object Array]' === Object.prototype.toString.call(value); 29793 }; 29794 29795 /** 29796 * Checks if the value is a date. 29797 * @memberof FooTable.is 29798 * @function date 29799 * @param {*} value - The value to check. 29800 * @returns {boolean} 29801 */ 29802 F.is.date = function (value) { 29803 return '[object Date]' === Object.prototype.toString.call(value) && !isNaN(value.getTime()); 29804 }; 29805 29806 /** 29807 * Checks if the value is a boolean. 29808 * @memberof FooTable.is 29809 * @function boolean 29810 * @param {*} value - The value to check. 29811 * @returns {boolean} 29812 */ 29813 F.is.boolean = function (value) { 29814 return '[object Boolean]' === Object.prototype.toString.call(value); 29815 }; 29816 29817 /** 29818 * Checks if the value is a string. 29819 * @memberof FooTable.is 29820 * @function string 29821 * @param {*} value - The value to check. 29822 * @returns {boolean} 29823 */ 29824 F.is.string = function (value) { 29825 return '[object String]' === Object.prototype.toString.call(value); 29826 }; 29827 29828 /** 29829 * Checks if the value is a number. 29830 * @memberof FooTable.is 29831 * @function number 29832 * @param {*} value - The value to check. 29833 * @returns {boolean} 29834 */ 29835 F.is.number = function (value) { 29836 return '[object Number]' === Object.prototype.toString.call(value) && !isNaN(value); 29837 }; 29838 29839 /** 29840 * Checks if the value is a function. 29841 * @memberof FooTable.is 29842 * @function fn 29843 * @param {*} value - The value to check. 29844 * @returns {boolean} 29845 */ 29846 F.is.fn = function (value) { 29847 return (F.is.defined(window) && value === window.alert) || '[object Function]' === Object.prototype.toString.call(value); 29848 }; 29849 29850 /** 29851 * Checks if the value is an error. 29852 * @memberof FooTable.is 29853 * @function error 29854 * @param {*} value - The value to check. 29855 * @returns {boolean} 29856 */ 29857 F.is.error = function (value) { 29858 return '[object Error]' === Object.prototype.toString.call(value); 29859 }; 29860 29861 /** 29862 * Checks if the value is an object. 29863 * @memberof FooTable.is 29864 * @function object 29865 * @param {*} value - The value to check. 29866 * @returns {boolean} 29867 */ 29868 F.is.object = function (value) { 29869 return '[object Object]' === Object.prototype.toString.call(value); 29870 }; 29871 29872 /** 29873 * Checks if the value is a hash. 29874 * @memberof FooTable.is 29875 * @function hash 29876 * @param {*} value - The value to check. 29877 * @returns {boolean} 29878 */ 29879 F.is.hash = function (value) { 29880 return F.is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval; 29881 }; 29882 29883 /** 29884 * Checks if the supplied object is an HTMLElement 29885 * @memberof FooTable.is 29886 * @function element 29887 * @param {object} obj - The object to check. 29888 * @returns {boolean} 29889 */ 29890 F.is.element = function (obj) { 29891 return typeof HTMLElement === 'object' 29892 ? obj instanceof HTMLElement 29893 : obj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'; 29894 }; 29895 29896 /** 29897 * This is a simple check to determine if an object is a jQuery promise object. It simply checks the object has a "then" and "promise" function defined. 29898 * The promise object is created as an object literal inside of jQuery.Deferred. 29899 * It has no prototype, nor any other truly unique properties that could be used to distinguish it. 29900 * This method should be a little more accurate than the internal jQuery one that simply checks for a "promise" method. 29901 * @memberof FooTable.is 29902 * @function promise 29903 * @param {object} obj - The object to check. 29904 * @returns {boolean} 29905 */ 29906 F.is.promise = function(obj){ 29907 return F.is.object(obj) && F.is.fn(obj.then) && F.is.fn(obj.promise); 29908 }; 29909 29910 /** 29911 * Checks if the supplied object is an instance of a jQuery object. 29912 * @memberof FooTable.is 29913 * @function jq 29914 * @param {object} obj - The object to check. 29915 * @returns {boolean} 29916 */ 29917 F.is.jq = function(obj){ 29918 return F.is.defined(window.jQuery) && obj instanceof jQuery && obj.length > 0; 29919 }; 29920 29921 /** 29922 * Checks if the supplied object is a moment.js date object. 29923 * @memberof FooTable.is 29924 * @function moment 29925 * @param {object} obj - The object to check. 29926 * @returns {boolean} 29927 */ 29928 F.is.moment = function(obj){ 29929 return F.is.defined(window.moment) && F.is.object(obj) && F.is.boolean(obj._isAMomentObject) 29930 }; 29931 29932 /** 29933 * Checks if the supplied value is an object and if it is empty. 29934 * @memberof FooTable.is 29935 * @function emptyObject 29936 * @param {*} value - The value to check. 29937 * @returns {boolean} 29938 */ 29939 F.is.emptyObject = function(value){ 29940 if (!F.is.hash(value)) return false;
29941 for(var prop in value) { 29942 if(value.hasOwnProperty(prop)) 29943 return false; 29944 } 29945 return true; 29946 }; 29947 29948 /** 29949 * Checks if the supplied value is an array and if it is empty. 29950 * @memberof FooTable.is 29951 * @function emptyArray 29952 * @param {*} value - The value to check. 29953 * @returns {boolean} 29954 */ 29955 F.is.emptyArray = function(value){ 29956 return F.is.array(value) ? value.length === 0 : true; 29957 }; 29958 29959 /** 29960 * Checks if the supplied value is a string and if it is empty. 29961 * @memberof FooTable.is 29962 * @function emptyString 29963 * @param {*} value - The value to check. 29964 * @returns {boolean} 29965 */ 29966 F.is.emptyString = function(value){ 29967 return F.is.string(value) ? value.length === 0 : true; 29968 }; 29969 29970 /** 29971 * Whether or not we are on a mobile device. 29972 */ 29973 F.is.mobile = (function(a){ 29974 return (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) 29975 ||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))); 29976 })(navigator.userAgent||navigator.vendor||window.opera); 29977 29978})(FooTable); 29979(function (F) { 29980 /** 29981 * This namespace contains commonly used string utility methods. 29982 * @namespace FooTable.str 29983 */ 29984 F.str = {}; 29985 29986 /** 29987 * Checks if the supplied string contains the given substring. 29988 * @memberof FooTable.str 29989 * @function contains 29990 * @param {string} str - The string to check. 29991 * @param {string} contains - The string to check for. 29992 * @param {boolean} [ignoreCase] - Whether or not to ignore casing when performing the check. 29993 * @returns {boolean} 29994 */ 29995 F.str.contains = function (str, contains, ignoreCase) { 29996 return !F.is.emptyString(str) 29997 && !F.is.emptyString(contains) && contains.length <= str.length 29998 && (ignoreCase ? str.toUpperCase().indexOf(contains.toUpperCase()) : str.indexOf(contains)) !== -1; 29999 }; 30000 30001 /** 30002 * Checks if the supplied string contains the given word. 30003 * @memberof FooTable.str 30004 * @function containsWord 30005 * @param {string} str - The string to check. 30006 * @param {string} word - The word to check for. 30007 * @param {boolean} [ignoreCase] - Whether or not to ignore casing when performing the check. 30008 * @returns {boolean} 30009 */ 30010 F.str.containsWord = function(str, word, ignoreCase){ 30011 if (F.is.emptyString(str) || F.is.emptyString(word) || str.length < word.length) 30012 return false; 30013 var parts = str.split(/\W/); 30014 for (var i = 0, len = parts.length; i < len; i++){ 30015 if (ignoreCase ? parts[i].toUpperCase() == word.toUpperCase() : parts[i] == word) return true; 30016 } 30017 return false;
30018 }; 30019 30020 /** 30021 * Returns the remainder of a string split on the first index of the given substring. 30022 * @memberof FooTable.str 30023 * @function from 30024 * @param {string} str - The string to split. 30025 * @param {string} from - The substring to split on. 30026 * @returns {string} 30027 */ 30028 F.str.from = function (str, from) { 30029 return this.contains(str, from) ? str.substring(str.indexOf(from) + 1) : str; 30030 }; 30031 30032 /** 30033 * Checks if a string starts with the supplied prefix. 30034 * @memberof FooTable.str 30035 * @function startsWith 30036 * @param {string} str - The string to check. 30037 * @param {string} prefix - The prefix to check for. 30038 * @returns {boolean} 30039 */ 30040 F.str.startsWith = function (str, prefix) { 30041 return str.slice(0, prefix.length) == prefix; 30042 }; 30043 30044 /** 30045 * Takes the supplied string and converts it to camel case. 30046 * @memberof FooTable.str 30047 * @function toCamelCase 30048 * @param {string} str - The string to camel case. 30049 * @returns {string} 30050 */ 30051 F.str.toCamelCase = function (str) { 30052 if (str.toUpperCase() === str) return str.toLowerCase(); 30053 return str.replace(/^([A-Z])|[-\s_](\w)/g, function (match, p1, p2) { 30054 if (p2) return p2.toUpperCase(); 30055 return p1.toLowerCase(); 30056 }); 30057 }; 30058 30059 /** 30060 * Generates a random string 9 characters long using the optional prefix if supplied.
30061 * @memberof FooTable.str 30062 * @function random 30063 * @param {string} [prefix] - The prefix to append to the 9 random characters. 30064 * @returns {string} 30065 */ 30066 F.str.random = function(prefix){ 30067 prefix = F.is.emptyString(prefix) ? '' : prefix; 30068 return prefix + Math.random().toString(36).substr(2, 9); 30069 }; 30070 30071 /** 30072 * Escapes a string for use in a regular expression. 30073 * @param {string} str - The string to escape. 30074 * @returns {string} 30075 */ 30076 F.str.escapeRegExp = function(str){ 30077 return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 30078 }; 30079 30080})(FooTable); 30081(function (F) { 30082 ; 30083 30084 if (!Object.create) { 30085 Object.create = (function () { 30086 var Object = function () {}; 30087 return function (prototype) { 30088 if (arguments.length > 1) 30089 throw Error('Second argument not supported'); 30090 30091 if (!F.is.object(prototype)) 30092 throw TypeError('Argument must be an object'); 30093 30094 Object.prototype = prototype; 30095 var result = new Object(); 30096 Object.prototype = null; 30097 return result; 30098 }; 30099 })(); 30100 } 30101 30102 /** 30103 * This base implementation does nothing except provide access to the {@link FooTable.Class#extend} method. 30104 * @constructs FooTable.Class 30105 * @classdesc This class is based off of John Resig's [Simple JavaScript Inheritance]{@link http://ejohn.org/blog/simple-javascript-inheritance} but it has been updated to be ES 5.1 30106 * compatible by implementing an [Object.create polyfill]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill} 30107 * for older browsers. 30108 * @see {@link http://ejohn.org/blog/simple-javascript-inheritance} 30109 * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill} 30110 * @returns {FooTable.Class} 30111 */ 30112 function Class() {} 30113 30114 var __extendable__ = /xyz/.test(function () {xyz;}) ? /\b_super\b/ : /.*/; 30115 30116 // this._super() within the context of the new function is a pointer to the original function 30117 // except if the hook param is specified then the this._super variable is the result of the original function 30118 Class.__extend__ = function(proto, name, func, original){ 30119 // to all who venture here, here be dragons! 30120 proto[name] = F.is.fn(original) && __extendable__.test(func) ? 30121 (function (name, fn) { 30122 return function () { 30123 var tmp, ret; 30124 tmp = this._super; 30125 this._super = original; 30126 ret = fn.apply(this, arguments); 30127 this._super = tmp; 30128 return ret; 30129 }; 30130 })(name, func) : func; 30131 }; 30132 30133 /** 30134 * Creates a new class that inherits from this class which in turn allows itself to be extended or if a name and function is supplied extends only that specific function on the class. 30135 * @param {(object|string)} arg1 - An object containing any new methods/members to implement or the name of the method to extend. 30136 * @param {function} arg2 - If the first argument is a method name then this is the new function to replace it with. 30137 * @returns {FooTable.Class} A new class that inherits from the base class. 30138 * @example <caption>The below shows an example of how to implement inheritance using this method.</caption> 30139 * var Person = FooTable.Class.extend({ 30140 * construct: function(isDancing){ 30141 * this.dancing = isDancing; 30142 * }, 30143 * dance: function(){ 30144 * return this.dancing; 30145 * } 30146 * }); 30147 * 30148 * var Ninja = Person.extend({ 30149 * construct: function(){ 30150 * this._super( false ); 30151 * }, 30152 * dance: function(){ 30153 * // Call the inherited version of dance() 30154 * return this._super(); 30155 * }, 30156 * swingSword: function(){ 30157 * return true; 30158 * } 30159 * }); 30160 *
30161 * var p = new Person(true); 30162 * p.dance(); // => true 30163 * 30164 * var n = new Ninja(); 30165 * n.dance(); // => false 30166 * n.swingSword(); // => true 30167 * 30168 * // Should all be true 30169 * p instanceof Person && p instanceof FooTable.Class && 30170 * n instanceof Ninja && n instanceof Person && n instanceof FooTable.Class 30171 */ 30172 Class.extend = function (arg1 , arg2) { 30173 var args = Array.prototype.slice.call(arguments); 30174 arg1 = args.shift(); 30175 arg2 = args.shift(); 30176 30177 function __extend__(proto, name, func, original){ 30178 // to all who venture here, here be dragons! 30179 proto[name] = F.is.fn(original) && __extendable__.test(func) ? 30180 (function (name, fn, ofn) { 30181 return function () { 30182 var tmp, ret; 30183 tmp = this._super; 30184 this._super = ofn; 30185 ret = fn.apply(this, arguments); 30186 this._super = tmp; 30187 return ret; 30188 }; 30189 })(name, func, original) : func; 30190 } 30191 30192 if (F.is.hash(arg1)){ 30193 var proto = Object.create(this.prototype), 30194 _super = this.prototype; 30195 for (var name in arg1) { 30196 if (name === '__ctor__') continue; 30197 __extend__(proto, name, arg1[name], _super[name]); 30198 } 30199 var obj = F.is.fn(proto.__ctor__) ? proto.__ctor__ : function () { 30200 if (!F.is.fn(this.construct)) 30201 throw new SyntaxError('FooTable class objects must be constructed with the "new" keyword.'); 30202 this.construct.apply(this, arguments); 30203 }; 30204 proto.construct = F.is.fn(proto.construct) ? proto.construct : function(){}; 30205 obj.prototype = proto; 30206 proto.constructor = obj; 30207 obj.extend = Class.extend; 30208 return obj; 30209 } else if (F.is.string(arg1) && F.is.fn(arg2)) { 30210 __extend__(this.prototype, arg1, arg2, this.prototype[arg1]); 30211 } 30212 }; 30213 30214 F.Class = Class; 30215 30216 F.ClassFactory = F.Class.extend(/** @lends FooTable.ClassFactory */{ 30217 /** 30218 * This is a simple factory for {@link FooTable.Class} objects allowing them to be registered using a friendly name 30219 * and then new instances can be created using this friendly name. 30220 * @constructs 30221 * @extends FooTable.Class 30222 * @returns {FooTable.ClassFactory} 30223 * @this FooTable.ClassFactory 30224 */ 30225 construct: function(){ 30226 /** 30227 * An object containing all registered classes. 30228 * @type {{}} 30229 */ 30230 this.registered = {}; 30231 }, 30232 /** 30233 * Checks if the factory contains a class registered using the supplied name. 30234 * @instance 30235 * @param {string} name - The name of the class to check. 30236 * @returns {boolean} 30237 * @this FooTable.ClassFactory 30238 */ 30239 contains: function(name){ 30240 return F.is.defined(this.registered[name]); 30241 }, 30242 /** 30243 * Gets an array of all registered names. 30244 * @instance 30245 * @returns {Array.<string>} 30246 * @this FooTable.ClassFactory 30247 */ 30248 names: function(){ 30249 var names = [], name; 30250 for (name in this.registered){ 30251 if (!this.registered.hasOwnProperty(name)) continue; 30252 names.push(name); 30253 } 30254 return names; 30255 }, 30256 /** 30257 * Registers a class object using the supplied friendly name and priority. The priority is only taken into account when loading all registered classes 30258 * using the {@link FooTable.ClassFactory#load} method. 30259 * @instance 30260 * @param {string} name - The friendly name of the class. 30261 * @param {function} klass - The class to register. 30262 * @param {number} priority - This determines the order that the class is created when using the {@link FooTable.ClassFactory#load} method, higher values are loaded first. 30263 * @this FooTable.ClassFactory 30264 */ 30265 register: function(name, klass, priority){ 30266 if (!F.is.string(name) || !F.is.fn(klass)) return; 30267 var current = this.registered[name]; 30268 this.registered[name] = { 30269 name: name, 30270 klass: klass, 30271 priority: F.is.number(priority) ? priority : (F.is.defined(current) ? current.priority : 0) 30272 }; 30273 }, 30274 /** 30275 * Creates new instances of all registered classes using there priority and the supplied arguments to return them in an array. 30276 * @instance 30277 * @param {*} arg1 - The first argument to supply when creating new instances of all registered classes. 30278 * @param {*} [argN...] - Any number of additional arguments to supply when creating new instances of all registered classes. 30279 * @returns {Array.<FooTable.Class>} 30280 * @this FooTable.ClassFactory 30281 */ 30282 load: function(arg1, argN){ 30283 var self = this, args = Array.prototype.slice.call(arguments), reg = [], loaded = []; 30284 for (var name in self.registered){ 30285 if (!self.registered.hasOwnProperty(name)) continue; 30286 reg.push(self.registered[name]); 30287 } 30288 reg.sort(function(a, b){ return b.priority - a.priority; }); 30289 F.arr.each(reg, function(r){ 30290 if (F.is.fn(r.klass)){ 30291 loaded.push(self._make(r.klass, args)); 30292 } 30293 }); 30294 return loaded; 30295 }, 30296 /** 30297 * Create a new instance of a single class using the supplied name and arguments. 30298 * @instance 30299 * @param {string} name - The name of the class to create. 30300 * @param {*} arg1 - The first argument to supply to the new instance. 30301 * @param {*} [argN...] - Any number of additional arguments to supply to the new instance. 30302 * @returns {FooTable.Class} 30303 * @this FooTable.ClassFactory 30304 */ 30305 make: function(name, arg1, argN){ 30306 var self = this, args = Array.prototype.slice.call(arguments), reg; 30307 name = args.shift(); 30308 reg = self.registered[name]; 30309 if (F.is.fn(reg.klass)){ 30310 return self._make(reg.klass, args); 30311 } 30312 return null; 30313 }, 30314 /** 30315 * This in effect lets us use the "apply" method on a function using the "new" keyword. 30316 * @instance 30317 * @private 30318 * @param {function} klass 30319 * @param args 30320 * @returns {FooTable.Class} 30321 * @this FooTable.ClassFactory 30322 */ 30323 _make: function(klass, args){ 30324 function Class() { 30325 return klass.apply(this, args); 30326 }
30327 Class.prototype = klass.prototype; 30328 return new Class(); 30329 } 30330 }); 30331 30332})(FooTable); 30333(function($, F){ 30334 30335 /** 30336 * Converts the supplied cssText string into JSON object. 30337 * @param {string} cssText - The cssText to convert to a JSON object. 30338 * @returns {object} 30339 */ 30340 F.css2json = function(cssText){ 30341 if (F.is.emptyString(cssText)) return {}; 30342 var json = {}, props = cssText.split(';'), pair, key, value; 30343 for (var i = 0, i_len = props.length; i < i_len; i++){ 30344 pair = props[i].split(':'); 30345 key = F.str.toCamelCase($.trim(pair[0])); 30346 value = $.trim(pair[1]); 30347 json[key] = value; 30348 } 30349 return json; 30350 }; 30351 30352 /** 30353 * Attempts to retrieve a function pointer using the given name. 30354 * @protected 30355 * @param {string} functionName - The name of the function to fetch a pointer to. 30356 * @returns {(function|object|null)} 30357 */ 30358 F.getFnPointer = function(functionName){ 30359 if (F.is.emptyString(functionName)) return null; 30360 if (F.is.fn(window[functionName])) return window[functionName]; 30361 return null; 30362 }; 30363 30364 /** 30365 * Checks the value for function properties such as the {@link FooTable.Column#formatter} option which could also be specified using just the name 30366 * and attempts to return the correct function pointer or null if none was found matching the value. 30367 * @param {FooTable.Class} self - The class to use as the 'this' keyword within the context of the function. 30368 * @param {(function|string)} value - The actual function or the name of the function for the property. 30369 * @param {function} [def] - A default function to return if none is found. 30370 * @returns {(function|null)} 30371 */ 30372 F.checkFnValue = function(self, value, def){ 30373 def = F.is.fn(def) ? def : null; 30374 function wrap(t, fn, d){ 30375 if (!F.is.fn(fn)) return d; 30376 return function(){ 30377 return fn.apply(t, arguments); 30378 }; 30379 } 30380 return F.is.fn(value) ? wrap(self, value, def) : (F.is.type(value, 'string') ? wrap(self, F.getFnPointer(value), def) : def); 30381 }; 30382 30383})(jQuery, FooTable); 30384(function($, F){ 30385 30386 F.Cell = F.Class.extend(/** @lends FooTable.Cell */{ 30387 /** 30388 * The cell class containing all the properties for cells. 30389 * @constructs 30390 * @extends FooTable.Class 30391 * @param {FooTable.Table} table - The root {@link FooTable.Table} this cell belongs to. 30392 * @param {FooTable.Row} row - The parent {@link FooTable.Row} this cell belongs to. 30393 * @param {FooTable.Column} column - The {@link FooTable.Column} this cell falls under. 30394 * @param {(*|HTMLElement|jQuery)} valueOrElement - Either the value or the element for the cell. 30395 * @returns {FooTable.Cell} 30396 * @this FooTable.Cell 30397 */ 30398 construct: function (table, row, column, valueOrElement) { 30399 /** 30400 * The root {@link FooTable.Table} for the cell. 30401 * @instance 30402 * @readonly 30403 * @type {FooTable.Table} 30404 */ 30405 this.ft = table; 30406 /** 30407 * The parent {@link FooTable.Row} for the cell. 30408 * @instance 30409 * @readonly 30410 * @type {FooTable.Row} 30411 */ 30412 this.row = row; 30413 /** 30414 * The {@link FooTable.Column} this cell falls under. 30415 * @instance 30416 * @readonly 30417 * @type {FooTable.Column} 30418 */ 30419 this.column = column; 30420 this.created = false; 30421 this.define(valueOrElement); 30422 }, 30423 /** 30424 * This is supplied either the value or the cell element/jQuery object if it exists. 30425 * If supplied the element we need set the $el property and parse the value from it. 30426 * @instance 30427 * @protected 30428 * @param {(*|jQuery)} valueOrElement - The value or element to define the cell. 30429 * @this FooTable.Cell 30430 */ 30431 define: function(valueOrElement){ 30432 /** 30433 * The jQuery table cell object this instance wraps. 30434 * @instance 30435 * @type {jQuery} 30436 */ 30437 this.$el = F.is.element(valueOrElement) || F.is.jq(valueOrElement) ? $(valueOrElement) : null; 30438 /** 30439 * The jQuery row object that represents this cell in the details table. 30440 * @type {jQuery} 30441 */ 30442 this.$detail = null; 30443 30444 var hasOptions = F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options) && F.is.defined(valueOrElement.value); 30445 30446 /** 30447 * The value of the cell. 30448 * @instance 30449 * @type {*} 30450 */ 30451 this.value = this.column.parser.call(this.column, F.is.jq(this.$el) ? this.$el : (hasOptions ? valueOrElement.value : valueOrElement), this.ft.o); 30452 30453 /** 30454 * Contains any options for the cell. These are the options supplied through the plugin constructor as part of the row object itself. 30455 * @type {object} 30456 */ 30457 this.o = $.extend(true, { 30458 classes: null, 30459 style: null 30460 }, hasOptions ? valueOrElement.options : {}); 30461 /** 30462 * An array of CSS classes for the cell. 30463 * @instance 30464 * @protected 30465 * @type {Array.<string>} 30466 */ 30467 this.classes = F.is.jq(this.$el) && this.$el.attr('class') ? this.$el.attr('class').match(/\S+/g) : (F.is.array(this.o.classes) ? this.o.classes : (F.is.string(this.o.classes) ? this.o.classes.match(/\S+/g) : [])); 30468 /** 30469 * The inline styles for the cell. 30470 * @instance 30471 * @protected 30472 * @type {object} 30473 */ 30474 this.style = F.is.jq(this.$el) && this.$el.attr('style') ? F.css2json(this.$el.attr('style')) : (F.is.hash(this.o.style) ? this.o.style : (F.is.string(this.o.style) ? F.css2json(this.o.style) : {})); 30475 }, 30476 /** 30477 * After the cell has been defined this ensures that the $el and #detail properties are jQuery objects by either creating or updating them. 30478 * @instance 30479 * @protected 30480 * @this FooTable.Cell 30481 */ 30482 $create: function(){ 30483 if (this.created) return; 30484 (this.$el = F.is.jq(this.$el) ? this.$el : $('<td/>')) 30485 .data('value', this.value) 30486 .contents().detach().end() 30487 .append(this.format(this.value)); 30488 30489 this._setClasses(this.$el); 30490 this._setStyle(this.$el); 30491 30492 this.$detail = $('<tr/>').addClass(this.row.classes.join(' ')) 30493 .data('__FooTableCell__', this) 30494 .append($('<th/>')) 30495 .append($('<td/>')); 30496 30497 this.created = true; 30498 }, 30499 /** 30500 * Collapses this cell and displays it in the details row. 30501 * @instance 30502 * @protected 30503 */ 30504 collapse: function(){ 30505 if (!this.created) return; 30506 this.$detail.children('th').html(this.column.title); 30507 this.$detail.children('td').first() 30508 .attr('class', this.$el.attr('class')) 30509 .attr('style', this.$el.attr('style')) 30510 .css('display', 'table-cell') 30511 .append(this.$el.contents().detach()); 30512 30513 if (!F.is.jq(this.$detail.parent())) 30514 this.$detail.appendTo(this.row.$details.find('.footable-details > tbody')); 30515 }, 30516 /** 30517 * Restores this cell from a detail row back into the normal row. 30518 * @instance 30519 * @protected 30520 */ 30521 restore: function(){ 30522 if (!this.created) return; 30523 if (F.is.jq(this.$detail.parent())){ 30524 var $cell = this.$detail.children('td').first(); 30525 this.$el 30526 .attr('class', $cell.attr('class')) 30527 .attr('style', $cell.attr('style')) 30528 .css('display', (this.column.hidden || !this.column.visible) ? 'none' : 'table-cell') 30529 .append($cell.contents().detach()); 30530 } 30531 this.$detail.detach(); 30532 }, 30533 /** 30534 * Helper method to call this cell's column parser function supplying the required parameters. 30535 * @instance 30536 * @protected 30537 * @returns {*} 30538 * @see FooTable.Column#parser 30539 * @this FooTable.Cell 30540 */ 30541 parse: function(){ 30542 return this.column.parser.call(this.column, this.$el, this.ft.o); 30543 }, 30544 /** 30545 * Helper method to call this cell's column formatter function using the supplied value and any additional required parameters. 30546 * @instance 30547 * @protected 30548 * @param {*} value - The value to format. 30549 * @returns {(string|HTMLElement|jQuery)} 30550 * @see FooTable.Column#formatter 30551 * @this FooTable.Cell 30552 */ 30553 format: function(value){ 30554 return this.column.formatter.call(this.column, value, this.ft.o); 30555 }, 30556 /** 30557 * Allows easy access to getting or setting the cell's value. If the value is set all associated properties are also updated along with the actual element.
30558 * Using this method also allows us to supply an object containing options and the value for the cell. 30559 * @instance 30560 * @param {*} [value] - The value to set for the cell. If not supplied the current value of the cell is returned. 30561 * @param {boolean} [redraw=true] - Whether or not to redraw the row once the value has been set. 30562 * @returns {(*|undefined)} 30563 * @this FooTable.Cell 30564 */ 30565 val: function(value, redraw){ 30566 if (F.is.undef(value)){ 30567 // get 30568 return this.value; 30569 } 30570 // set 30571 var self = this, hasOptions = F.is.hash(value) && F.is.hash(value.options) && F.is.defined(value.value); 30572 this.o = $.extend(true, { 30573 classes: self.classes, 30574 style: self.style 30575 }, hasOptions ? value.options : {}); 30576 30577 this.value = hasOptions ? value.value : value; 30578 this.classes = F.is.array(this.o.classes) ? this.o.classes : (F.is.string(this.o.classes) ? this.o.classes.match(/\S+/g) : []); 30579 this.style = F.is.hash(this.o.style) ? this.o.style : (F.is.string(this.o.style) ? F.css2json(this.o.style) : {}); 30580 30581 if (this.created){ 30582 this.$el.data('value', this.value).empty(); 30583 30584 var $detail = this.$detail.children('td').first().empty(), 30585 $target = F.is.jq(this.$detail.parent()) ? $detail : this.$el; 30586 30587 $target.append(this.format(this.value)); 30588 30589 this._setClasses($target); 30590 this._setStyle($target); 30591 30592 if (F.is.boolean(redraw) ? redraw : true) this.row.draw(); 30593 } 30594 }, 30595 _setClasses: function($el){ 30596 var hasColClasses = !F.is.emptyArray(this.column.classes), 30597 hasClasses = !F.is.emptyArray(this.classes), 30598 classes = null; 30599 $el.removeAttr('class'); 30600 if (!hasColClasses && !hasClasses) return; 30601 if (hasColClasses && hasClasses){ 30602 classes = this.classes.concat(this.column.classes).join(' '); 30603 } else if (hasColClasses) { 30604 classes = this.column.classes.join(' '); 30605 } else if (hasClasses){ 30606 classes = this.classes.join(' '); 30607 } 30608 if (!F.is.emptyString(classes)){
30609 $el.addClass(classes); 30610 } 30611 }, 30612 _setStyle: function($el){ 30613 var hasColStyle = !F.is.emptyObject(this.column.style), 30614 hasStyle = !F.is.emptyObject(this.style), 30615 style = null; 30616 $el.removeAttr('style'); 30617 if (!hasColStyle && !hasStyle) return; 30618 if (hasColStyle && hasStyle){ 30619 style = $.extend({}, this.column.style, this.style); 30620 } else if (hasColStyle) { 30621 style = this.column.style; 30622 } else if (hasStyle){ 30623 style = this.style; 30624 } 30625 if (F.is.hash(style)){ 30626 $el.css(style); 30627 } 30628 } 30629 }); 30630 30631})(jQuery, FooTable); 30632(function($, F){ 30633 30634 F.Column = F.Class.extend(/** @lends FooTable.Column */{ 30635 /** 30636 * The column class containing all the properties for columns. All members marked as "readonly" should not be used when defining {@link FooTable.Defaults#columns}. 30637 * @constructs 30638 * @extends FooTable.Class 30639 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this component belongs to. 30640 * @param {object} definition - An object containing all the properties to set for the column. 30641 * @param {string} [type] - The type of column, "text" by default. 30642 * @returns {FooTable.Column} 30643 * @this FooTable.Column 30644 */ 30645 construct: function(instance, definition, type){ 30646 /** 30647 * The root {@link FooTable.Table} for the column. 30648 * @instance 30649 * @readonly 30650 * @type {FooTable.Table} 30651 */ 30652 this.ft = instance; 30653 /** 30654 * The type of data displayed by the column. 30655 * @instance 30656 * @readonly 30657 * @type {string} 30658 */ 30659 this.type = F.is.emptyString(type) ? 'text' : type; 30660 /** 30661 * Whether or not the column was parsed from a standard table row containing data instead of from an actual header row. 30662 * @instance 30663 * @readonly 30664 * @type {boolean} 30665 */ 30666 this.virtual = F.is.boolean(definition.virtual) ? definition.virtual : false; 30667 /** 30668 * The jQuery cell object for the column header. 30669 * @instance 30670 * @readonly 30671 * @type {jQuery} 30672 */ 30673 this.$el = F.is.jq(definition.$el) ? definition.$el : null; 30674 /** 30675 * The index of the column in the table. This is set by the plugin during initialization. 30676 * @instance 30677 * @readonly 30678 * @type {number} 30679 * @default -1 30680 */ 30681 this.index = F.is.number(definition.index) ? definition.index : -1; 30682 this.define(definition); 30683 this.$create(); 30684 }, 30685 /** 30686 * This is supplied the column definition in the form of a simple object created by merging options supplied via the plugin constructor with those parsed from the DOM. 30687 * @instance 30688 * @protected 30689 * @param {object} definition - The object containing the column definition. 30690 * @this FooTable.Column 30691 */ 30692 define: function(definition){ 30693 /** 30694 * Whether or not this column is hidden from view and appears in the details row. 30695 * @type {boolean} 30696 * @default false 30697 */ 30698 this.hidden = F.is.boolean(definition.hidden) ? definition.hidden : false; 30699 /** 30700 * Whether or not this column is completely hidden from view and will not appear in the details row. 30701 * @type {boolean} 30702 * @default true 30703 */ 30704 this.visible = F.is.boolean(definition.visible) ? definition.visible : true; 30705 30706 /** 30707 * The name of the column. This name must correspond to the property name of the JSON row data. 30708 * @type {string} 30709 * @default null 30710 */ 30711 this.name = F.is.string(definition.name) ? definition.name : null; 30712 if (this.name == null) this.name = 'col'+(definition.index+1); 30713 /** 30714 * The title to display in the column header, this can be HTML. 30715 * @type {string} 30716 * @default null 30717 */ 30718 this.title = F.is.string(definition.title) ? definition.title : null; 30719 if (!this.virtual && this.title == null && F.is.jq(this.$el)) this.title = this.$el.html(); 30720 if (this.title == null) this.title = 'Column '+(definition.index+1); 30721 /** 30722 * The styles to apply to all cells in this column. 30723 * @type {object} 30724 */ 30725 this.style = F.is.hash(definition.style) ? definition.style : (F.is.string(definition.style) ? F.css2json(definition.style) : {}); 30726 /** 30727 * The classes to apply to all cells in this column. 30728 * @type {Array.<string>} 30729 */
30730 this.classes = F.is.array(definition.classes) ? definition.classes : (F.is.string(definition.classes) ? definition.classes.match(/\S+/g) : []); 30731 30732 // override any default functions ensuring when they are executed "this" within the context of the function points to the instance of this object. 30733 this.parser = F.checkFnValue(this, definition.parser, this.parser); 30734 this.formatter = F.checkFnValue(this, definition.formatter, this.formatter); 30735 }, 30736 /** 30737 * After the column has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value. 30738 * @instance 30739 * @protected 30740 * @this FooTable.Column 30741 */ 30742 $create: function(){ 30743 (this.$el = !this.virtual && F.is.jq(this.$el) ? this.$el : $('<th/>')).html(this.title); 30744 }, 30745 /** 30746 * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.Column#format} function 30747 * to generate the cell contents. 30748 * @instance 30749 * @protected 30750 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 30751 * @returns {string} 30752 * @this FooTable.Column 30753 */ 30754 parser: function(valueOrElement){ 30755 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)) return $(valueOrElement).data('value') || $(valueOrElement).text(); // use jQuery to get the value 30756 if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement+''; // use the native toString of the value 30757 return null; // otherwise we have no value so return null 30758 }, 30759 /** 30760 * This is supplied the value retrieved from the {@link FooTable.Column#parse} function and must return a string, HTMLElement or jQuery object. 30761 * The return value from this function is what is displayed in the cell in the table. 30762 * @instance 30763 * @protected 30764 * @param {string} value - The value to format. 30765 * @returns {(string|HTMLElement|jQuery)} 30766 * @this FooTable.Column 30767 */ 30768 formatter: function(value){ 30769 return value == null ? '' : value; 30770 }, 30771 /** 30772 * Creates a cell for this column from the supplied {@link FooTable.Row} object. This allows different column types to return different types of cells. 30773 * @instance 30774 * @protected 30775 * @param {FooTable.Row} row - The row to create the cell from. 30776 * @returns {FooTable.Cell} 30777 * @this FooTable.Column 30778 */ 30779 createCell: function(row){ 30780 var element = F.is.jq(row.$el) ? row.$el.children('td,th').get(this.index) : null, 30781 data = F.is.hash(row.value) ? row.value[this.name] : null; 30782 return new F.Cell(this.ft, row, this, element || data); 30783 } 30784 }); 30785 30786 F.columns = new F.ClassFactory(); 30787 30788 F.columns.register('text', F.Column); 30789 30790})(jQuery, FooTable); 30791(function ($, F) { 30792 /** 30793 * Contains all the available options for the FooTable plugin. 30794 * @name FooTable.Defaults 30795 * @function 30796 * @constructor 30797 * @returns {FooTable.Defaults} 30798 */ 30799 F.Defaults = function () { 30800 /** 30801 * Whether or not events raised using the {@link FooTable.Table#raise} method are propagated up the DOM. By default this is set to false and all events bubble up the DOM as per usual 30802 * however the reason for this option is if we have nested tables. If false the parent table would receive all the events raised by it's children and any handlers bound to both the 30803 * parent and child would be triggered which is not the desired behavior. 30804 * @type {boolean} 30805 * @default false 30806 */ 30807 this.stopPropagation = false; 30808 /** 30809 * An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). 30810 * @type {object.<string, function>} 30811 * @default NULL 30812 * @example <caption>
30812This example shows how to pass an object containing the events and handlers.</caption> 30813 * "on": { 30814 * "click": function(e){ 30815 * // bind a custom click event to do something whenever the table is clicked 30816 * }, 30817 * "init.ft.table": function(e, ft){ 30818 * // bind to the FooTable initialize event to do something 30819 * } 30820 * } 30821 */ 30822 this.on = null; 30823 }; 30824 30825 /** 30826 * Contains all the default options for the plugin. 30827 * @type {FooTable.Defaults} 30828 */ 30829 F.defaults = new F.Defaults(); 30830 30831})(jQuery, FooTable); 30832(function($, F){ 30833 30834 F.Row = F.Class.extend(/** @lends FooTable.Row */{ 30835 /** 30836 * The row class containing all the properties for a row and its' cells. 30837 * @constructs 30838 * @extends FooTable.Class 30839 * @param {FooTable.Table} table - The parent {@link FooTable.Table} this component belongs to. 30840 * @param {Array.<FooTable.Column>} columns - The array of {@link FooTable.Column} for this row. 30841 * @param {(*|HTMLElement|jQuery)} dataOrElement - Either the data for the row (create) or the element (parse) for the row. 30842 * @returns {FooTable.Row} 30843 */ 30844 construct: function (table, columns, dataOrElement) { 30845 /** 30846 * The {@link FooTable.Table} for the row. 30847 * @type {FooTable.Table} 30848 */ 30849 this.ft = table; 30850 /** 30851 * The array of {@link FooTable.Column} for this row. 30852 * @type {Array.<FooTable.Column>} 30853 */ 30854 this.columns = columns; 30855 30856 this.created = false; 30857 this.define(dataOrElement); 30858 }, 30859 /** 30860 * This is supplied either the object containing the values for the row or the row element/jQuery object if it exists. 30861 * If supplied the element we need to set the $el property and parse the cells from it using the column index. 30862 * If we have an object we parse the cells from it using the column name. 30863 * @param {(object|jQuery)} dataOrElement - The row object or element to define the row. 30864 */ 30865 define: function(dataOrElement){ 30866 /** 30867 * The jQuery table row object this instance wraps. 30868 * @instance 30869 * @protected 30870 * @type {jQuery} 30871 */ 30872 this.$el = F.is.element(dataOrElement) || F.is.jq(dataOrElement) ? $(dataOrElement) : null; 30873 /** 30874 * The jQuery toggle element for the row. 30875 * @instance 30876 * @protected 30877 * @type {jQuery} 30878 */ 30879 this.$toggle = $('<span/>', {'class': 'footable-toggle fooicon fooicon-plus'}); 30880 30881 var isObj = F.is.hash(dataOrElement), 30882 hasOptions = isObj && F.is.hash(dataOrElement.options) && F.is.hash(dataOrElement.value); 30883 30884 /** 30885 * The value of the row. 30886 * @instance 30887 * @protected 30888 * @type {Object} 30889 */ 30890 this.value = isObj ? (hasOptions ? dataOrElement.value : dataOrElement) : null; 30891 30892 /** 30893 * Contains any options for the row. 30894 * @type {object} 30895 */ 30896 this.o = $.extend(true, { 30897 expanded: false, 30898 classes: null, 30899 style: null 30900 }, hasOptions ? dataOrElement.options : {}); 30901 30902 /** 30903 * Whether or not this row is expanded and will display it's detail row when there are any hidden columns. 30904 * @instance 30905 * @protected 30906 * @type {boolean} 30907 */ 30908 this.expanded = F.is.jq(this.$el) ? (this.$el.data('expanded') || this.o.expanded) : this.o.expanded; 30909 /** 30910 * An array of CSS classes for the row. 30911 * @instance 30912 * @protected 30913 * @type {Array.<string>} 30914 */ 30915 this.classes = F.is.jq(this.$el) && this.$el.attr('class') ? this.$el.attr('class').match(/\S+/g) : (F.is.array(this.o.classes) ? this.o.classes : (F.is.string(this.o.classes) ? this.o.classes.match(/\S+/g) : [])); 30916 /** 30917 * The inline styles for the row. 30918 * @instance 30919 * @protected 30920 * @type {object} 30921 */ 30922 this.style = F.is.jq(this.$el) && this.$el.attr('style') ? F.css2json(this.$el.attr('style')) : (F.is.hash(this.o.style) ? this.o.style : (F.is.string(this.o.style) ? F.css2json(this.o.style) : {})); 30923 30924 /** 30925 * The cells array. This is populated before the call to the {@link FooTable.Row#$create} method. 30926 * @instance 30927 * @type {Array.<FooTable.Cell>} 30928 */ 30929 this.cells = this.createCells(); 30930 30931 // this ensures the value contains the parsed cell values and not the supplied values 30932 var self = this; 30933 self.value = {}; 30934 F.arr.each(self.cells, function(cell){ 30935 self.value[cell.column.name] = cell.val(); 30936 }); 30937 }, 30938 /** 30939 * After the row has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value. 30940 * @instance 30941 * @protected 30942 * @this FooTable.Row 30943 */ 30944 $create: function(){ 30945 if (this.created) return; 30946 (this.$el = F.is.jq(this.$el) ? this.$el : $('<tr/>')) 30947 .data('__FooTableRow__', this); 30948 30949 this._setClasses(this.$el); 30950 this._setStyle(this.$el); 30951 30952 if (this.ft.rows.toggleColumn == 'last') this.$toggle.addClass('last-column'); 30953 30954 this.$details = $('<tr/>', { 'class': 'footable-detail-row' }) 30955 .append($('<td/>', { colspan: this.ft.columns.visibleColspan }) 30956 .append($('<table/>', { 'class': 'footable-details ' + this.ft.classes.join(' ') }) 30957 .append('<tbody/>'))); 30958 30959 var self = this; 30960 F.arr.each(self.cells, function(cell){ 30961 if (!cell.created) cell.$create(); 30962 self.$el.append(cell.$el); 30963 }); 30964 self.$el.off('click.ft.row').on('click.ft.row', { self: self }, self._onToggle); 30965 this.created = true; 30966 }, 30967 /** 30968 * This is called during the construct method and uses the current column definitions to create an array of {@link FooTable.Cell} objects for the row. 30969 * @instance 30970 * @protected 30971 * @returns {Array.<FooTable.Cell>} 30972 * @this FooTable.Row 30973 */ 30974 createCells: function(){ 30975 var self = this; 30976 return F.arr.map(self.columns, function(col){ 30977 return col.createCell(self); 30978 }); 30979 }, 30980 /** 30981 * Allows easy access to getting or setting the row's data. If the data is set all associated properties are also updated along with the actual element.
30982 * Using this method also allows us to supply an object containing options and the data for the row at the same time. 30983 * @instance 30984 * @param {object} [data] - The data to set for the row. If not supplied the current value of the row is returned. 30985 * @returns {(*|undefined)} 30986 */ 30987 val: function(data){ 30988 var self = this; 30989 if (!F.is.hash(data)){ 30990 // get - check the value property and build it from the cells if required. 30991 if (!F.is.hash(this.value) || F.is.emptyObject(this.value)){ 30992 this.value = {}; 30993 F.arr.each(this.cells, function(cell){ 30994 self.value[cell.column.name] = cell.val(); 30995 }); 30996 } 30997 return this.value; 30998 } 30999 // set 31000 this.collapse(false); 31001 var isObj = F.is.hash(data), 31002 hasOptions = isObj && F.is.hash(data.options) && F.is.hash(data.value); 31003 31004 this.o = $.extend(true, { 31005 expanded: self.expanded, 31006 classes: self.classes, 31007 style: self.style 31008 }, hasOptions ? data.options : {}); 31009 31010 this.expanded = this.o.expanded; 31011 this.classes = F.is.array(this.o.classes) ? this.o.classes : (F.is.string(this.o.classes) ? this.o.classes.match(/\S+/g) : []); 31012 this.style = F.is.hash(this.o.style) ? this.o.style : (F.is.string(this.o.style) ? F.css2json(this.o.style) : {}); 31013 this.value = isObj ? (hasOptions ? data.value : data) : null; 31014 31015 F.arr.each(this.cells, function(cell){ 31016 if (F.is.defined(self.value[cell.column.name])) cell.val(self.value[cell.column.name], false); 31017 }); 31018 31019 if (this.created){ 31020 this._setClasses(this.$el); 31021 this._setStyle(this.$el); 31022 this.draw(); 31023 } 31024 }, 31025 _setClasses: function($el){ 31026 var hasClasses = !F.is.emptyArray(this.classes), 31027 classes = null; 31028 $el.removeAttr('class'); 31029 if (!hasClasses) return; 31030 else classes = this.classes.join(' '); 31031 if (!F.is.emptyString(classes)){
31032 $el.addClass(classes); 31033 } 31034 }, 31035 _setStyle: function($el){ 31036 var hasStyle = !F.is.emptyObject(this.style), 31037 style = null; 31038 $el.removeAttr('style'); 31039 if (!hasStyle) return; 31040 else style = this.style; 31041 if (F.is.hash(style)){ 31042 $el.css(style); 31043 } 31044 }, 31045 /** 31046 * Sets the current row to an expanded state displaying any hidden columns in a detail row just below it. 31047 * @instance 31048 * @fires FooTable.Row#"expand.ft.row" 31049 */ 31050 expand: function(){ 31051 if (!this.created) return; 31052 var self = this; 31053 /** 31054 * The expand.ft.row event is raised before the the row is expanded. 31055 * Calling preventDefault on this event will stop the row being expanded. 31056 * @event FooTable.Row#"expand.ft.row" 31057 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31058 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31059 * @param {FooTable.Row} row - The row about to be expanded. 31060 */ 31061 self.ft.raise('expand.ft.row').then(function(){ 31062 self.__hidden__ = F.arr.map(self.cells, function(cell){ 31063 return cell.column.hidden && cell.column.visible ? cell : null; 31064 }); 31065 31066 if (self.__hidden__.length > 0){ 31067 self.$details.insertAfter(self.$el) 31068 .children('td').first() 31069 .attr('colspan', self.ft.columns.visibleColspan); 31070 31071 F.arr.each(self.__hidden__, function(cell){ 31072 cell.collapse(); 31073 }); 31074 } 31075 self.$el.attr('data-expanded', true); 31076 self.$toggle.removeClass('fooicon-plus').addClass('fooicon-minus'); 31077 self.expanded = true; 31078 }); 31079 }, 31080 /** 31081 * Sets the current row to a collapsed state removing the detail row if it exists. 31082 * @instance 31083 * @this FooTable.Row 31084 */ 31085 collapse: function(setExpanded){ 31086 if (!this.created) return; 31087 var self = this; 31088 /** 31089 * The expand.ft.row event is raised before the the row is expanded. 31090 * Calling preventDefault on this event will stop the row being expanded. 31091 * @event FooTable.Row#"expand.ft.row" 31092 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31093 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31094 * @param {FooTable.Row} row - The row about to be expanded. 31095 */ 31096 self.ft.raise('collapse.ft.row').then(function(){ 31097 F.arr.each(self.__hidden__, function(cell){ 31098 cell.restore(); 31099 }); 31100 self.$details.detach(); 31101 self.$el.removeAttr('data-expanded'); 31102 self.$toggle.removeClass('fooicon-minus').addClass('fooicon-plus'); 31103 if (F.is.boolean(setExpanded) ? setExpanded : true) self.expanded = false; 31104 }); 31105 }, 31106 /** 31107 * Prior to drawing this moves the details contents back to there original cells and detaches the toggle element from the row. 31108 * @instance 31109 * @this FooTable.Row 31110 */ 31111 predraw: function(){ 31112 if (this.created){ 31113 if (this.expanded){ 31114 this.collapse(false); 31115 } 31116 this.$toggle.detach(); 31117 this.$el.detach(); 31118 } 31119 }, 31120 /** 31121 * Draws the current row and cells. 31122 * @instance 31123 * @this FooTable.Row 31124 */ 31125 draw: function($parent){ 31126 if (!this.created) this.$create(); 31127 if (F.is.jq($parent)) $parent.append(this.$el); 31128 var self = this; 31129 F.arr.each(self.cells, function(cell){ 31130 cell.$el.css('display', (cell.column.hidden || !cell.column.visible ? 'none' : 'table-cell')); 31131 if (self.ft.rows.showToggle && self.ft.columns.hasHidden){ 31132 if ((self.ft.rows.toggleColumn == 'first' && cell.column.index == self.ft.columns.firstVisibleIndex) 31133 || (self.ft.rows.toggleColumn == 'last' && cell.column.index == self.ft.columns.lastVisibleIndex)) { 31134 cell.$el.prepend(self.$toggle); 31135 } 31136 } 31137 }); 31138 if (this.expanded){ 31139 this.expand(); 31140 } 31141 }, 31142 /**
31143 * Toggles the row between it's expanded and collapsed state if there are hidden columns. 31144 * @instance 31145 * @this FooTable.Row 31146 */ 31147 toggle: function(){ 31148 if (this.created && this.ft.columns.hasHidden){ 31149 if (this.expanded) this.collapse(); 31150 else this.expand(); 31151 } 31152 }, 31153 /** 31154 * Handles the toggle click event for rows. 31155 * @instance 31156 * @param {jQuery.Event} e - The jQuery.Event object for the click event. 31157 * @private 31158 * @this jQuery 31159 */ 31160 _onToggle: function (e) { 31161 var self = e.data.self; 31162 // only execute the toggle if the event.target is one of the approved initiators 31163 if ($(e.target).is(self.ft.rows.toggleSelector)){ 31164 self.toggle(); 31165 } 31166 } 31167 }); 31168 31169})(jQuery, FooTable); 31170(function ($, F) { 31171 31172 /** 31173 * An array of all currently loaded instances of the plugin. 31174 * @protected 31175 * @readonly 31176 * @type {Array.<FooTable.Table>} 31177 */ 31178 F.instances = []; 31179 31180 F.Table = F.Class.extend(/** @lends FooTable.Table */{ 31181 /** 31182 * This class is the core of the plugin and drives the logic of all components. 31183 * @constructs 31184 * @this FooTable.Table 31185 * @extends FooTable.Class 31186 * @param {(HTMLTableElement|jQuery)} element - The element or jQuery table object to bind the plugin to. 31187 * @param {object} options - The options to initialize the plugin with. 31188 * @param {function} [ready] - A callback function to execute once the plugin is initialized. 31189 * @returns {FooTable.Table} 31190 */ 31191 construct: function (element, options, ready) { 31192 //BEGIN MEMBERS 31193 /** 31194 * The timeout ID for the resize event. 31195 * @instance 31196 * @private 31197 * @type {?number} 31198 */ 31199 this._resizeTimeout = null; 31200 /** 31201 * The ID of the FooTable instance. 31202 * @instance 31203 * @type {number} 31204 */ 31205 this.id = F.instances.push(this); 31206 /** 31207 * Whether or not the plugin and all components and add-ons are fully initialized. 31208 * @instance 31209 * @type {boolean} 31210 */ 31211 this.initialized = false; 31212 /** 31213 * The jQuery table object the plugin is bound to. 31214 * @instance 31215 * @type {jQuery} 31216 */ 31217 this.$el = (F.is.jq(element) ? element : $(element)).first(); // ensure one table, one instance 31218 /** 31219 * The options for the plugin. This is a merge of user defined options and the default options. 31220 * @instance 31221 * @type {object} 31222 */ 31223 this.o = $.extend(true, {}, F.defaults, options); 31224 /** 31225 * An array of all CSS classes on the table that do not start with "footable". 31226 * @instance 31227 * @protected 31228 * @type {Array.<string>} 31229 */ 31230 this.classes = []; 31231 /** 31232 * All components for this instance of the plugin. These are executed in the order they appear in the array for the initialize phase and in reverse order for the destroy phase of the plugin. 31233 * @instance 31234 * @protected 31235 * @type {object} 31236 * @prop {Array.<FooTable.Component>} internal - The internal components for the plugin. These are executed either before all other components in the initialize phase or after them in the destroy phase of the plugin. 31237 * @prop {Array.<FooTable.Component>} core - The core components for the plugin. These are executed either after the internal components in the initialize phase or before them in the destroy phase of the plugin. 31238 * @prop {Array.<FooTable.Component>} custom - The custom components for the plugin. These are executed either after the core components in the initialize phase or before them in the destroy phase of the plugin. 31239 */ 31240 this.components = { 31241 internal: F.components.internal.load(this),//[this.breakpoints, this.columns, this.editor, this.rows], 31242 core: F.components.core.load(this), 31243 custom: F.components.load(this) 31244 }; 31245 /** 31246 * The breakpoints component for this instance of the plugin. 31247 * @instance 31248 * @type {FooTable.Breakpoints} 31249 */ 31250 31251 31252 31253 this.breakpoints = this.use(FooTable.Breakpoints); 31254 /** 31255 * The columns component for this instance of the plugin. 31256 * @instance 31257 * @type {FooTable.Columns} 31258 */ 31259 this.columns = this.use(FooTable.Columns); 31260 /** 31261 * The rows component for this instance of the plugin. 31262 * @instance 31263 * @type {FooTable.Rows} 31264 */ 31265 this.rows = this.use(FooTable.Rows); 31266 31267 //END MEMBERS 31268 this._construct(ready); 31269 }, 31270 /** 31271 * Once all properties are set this performs the actual initialization of the plugin calling the {@link FooTable.Table#_preinit} and 31272 * {@link FooTable.Table#_init} methods as well as raising the {@link FooTable.Table#"ready.ft.table"} event. 31273 * @this FooTable.Table 31274 * @instance 31275 * @param {function} [ready] - A callback function to execute once the plugin is initialized. 31276 * @private 31277 * @returns {jQuery.Promise} 31278 * @fires FooTable.Table#"ready.ft.table" 31279 */ 31280 _construct: function(ready){ 31281 var self = this; 31282 this._preinit().then(function(){ 31283 return self._init(); 31284 }).always(function(arg){ 31285 if (F.is.error(arg)){ 31286 console.error('FooTable: unhandled error thrown during initialization.', arg); 31287 } else { 31288 /** 31289 * The postinit.ft.table event is raised after the plugin has been initialized and the table drawn. 31290 * Calling preventDefault on this event will stop the ready callback being executed. 31291 * @event FooTable.Table#"postinit.ft.table" 31292 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31293 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31294 */ 31295 return self.raise('ready.ft.table').then(function(){ 31296 if (F.is.fn(ready)) ready.call(self, self); 31297 }); 31298 } 31299 }); 31300 }, 31301 /** 31302 * The preinit method is called prior to the plugins actual initialization and provides itself and it's components an opportunity to parse any additional option values. 31303 * @instance 31304 * @private 31305 * @returns {jQuery.Promise} 31306 * @fires FooTable.Table#"preinit.ft.table" 31307 */ 31308 _preinit: function(){ 31309 var self = this; 31310 /** 31311 * The preinit.ft.table event is raised before any components. 31312 * Calling preventDefault on this event will disable the entire plugin. 31313 * @event FooTable.Table#"preinit.ft.table" 31314 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31315 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31316 */ 31317 return this.raise('preinit.ft.table').then(function(){ 31318 var classes = self.$el.attr('class').match(/\S+/g), 31319 data = self.$el.data() || {}; 31320 31321 self.o.ajax = F.checkFnValue(self, data.ajax, self.o.ajax); 31322 self.o.stopPropagation = F.is.boolean(data.stopPropagation) 31323 ? data.stopPropagation 31324 : self.o.stopPropagation; 31325 31326 for (var i = 0, len = classes.length; i < len; i++){
31327 if (!F.str.startsWith(classes[i], 'footable')) self.classes.push(classes[i]); 31328 } 31329 var $loader = $('<div/>', { 'class': 'footable-loader' }).append($('<span/>', {'class': 'fooicon fooicon-loader'})); 31330 self.$el.hide().after($loader); 31331 return self.execute(false, false, 'preinit', data).always(function(){ 31332 self.$el.show(); 31333 $loader.remove(); 31334 }); 31335 }); 31336 }, 31337 /** 31338 * Initializes this instance of the plugin and calls the callback function if one is supplied once complete. 31339 * @this FooTable.Table 31340 * @instance 31341 * @private 31342 * @return {jQuery.Promise} 31343 * @fires FooTable.Table#"init.ft.table" 31344 */ 31345 _init: function(){ 31346 var self = this; 31347 /** 31348 * The init.ft.table event is raised before any components are initialized. 31349 * Calling preventDefault on this event will disable the entire plugin. 31350 * @event FooTable.Table#"init.ft.table" 31351 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31352 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31353 */ 31354 return self.raise('init.ft.table').then(function(){ 31355 var $thead = self.$el.children('thead'), 31356 $tbody = self.$el.children('tbody'), 31357 $tfoot = self.$el.children('tfoot'); 31358 self.$el.addClass('footable footable-' + self.id); 31359 if (F.is.hash(self.o.on)) self.$el.on(self.o.on); 31360 if ($tfoot.length == 0) self.$el.append($tfoot = $('<tfoot/>')); 31361 if ($tbody.length == 0) self.$el.append('<tbody/>'); 31362 if ($thead.length == 0) self.$el.prepend($thead = $('<thead/>')); 31363 return self.execute(false, true, 'init').then(function(){ 31364 self.$el.data('__FooTable__', self); 31365 if ($tfoot.children('tr').length == 0) $tfoot.remove(); 31366 if ($thead.children('tr').length == 0) $thead.remove(); 31367 31368 /** 31369 * The postinit.ft.table event is raised after any components are initialized but before the table is 31370 * drawn for the first time. 31371 * Calling preventDefault on this event will disable the initial drawing of the table. 31372 * @event FooTable.Table#"postinit.ft.table" 31373 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31374 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31375 */ 31376 return self.raise('postinit.ft.table').then(function(){ 31377 return self.draw(); 31378 }).always(function(){ 31379 $(window).off('resize.ft'+self.id, self._onWindowResize) 31380 .on('resize.ft'+self.id, { self: self }, self._onWindowResize); 31381 self.initialized = true; 31382 }); 31383 }); 31384 }); 31385 }, 31386 /** 31387 * Destroys this plugin removing it from the table. 31388 * @this FooTable.Table 31389 * @instance 31390 * @fires FooTable.Table#"destroy.ft.table" 31391 */ 31392 destroy: function () { 31393 var self = this; 31394 /** 31395 * The destroy.ft.table event is called before all core components. 31396 * Calling preventDefault on this event will prevent the entire plugin from being destroyed. 31397 * @event FooTable.Table#"destroy.ft.table" 31398 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31399 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31400 */ 31401 return self.raise('destroy.ft.table').then(function(){ 31402 return self.execute(true, true, 'destroy').then(function () { 31403 self.$el.removeData('__FooTable__'); 31404 if (F.is.hash(self.o.on)) self.$el.off(self.o.on); 31405 self.initialized = false; 31406 }); 31407 }).fail(function(err){ 31408 if (F.is.error(err)){ 31409 console.error('FooTable: unhandled error thrown while destroying the plugin.', err); 31410 } 31411 }); 31412 }, 31413 /** 31414 * Raises an event on this instance supplying the args array as additional parameters to the handlers. 31415 * @this FooTable.Table 31416 * @instance 31417 * @param {string} eventName - The name of the event to raise, this can include namespaces. 31418 * @param {Array} [args] - An array containing additional parameters to be passed to any boun
31418d handlers. 31419 * @returns {jQuery.Event} 31420 */ 31421 raise: function(eventName, args){ 31422 var self = this, 31423 debug = F.__debug__ && (F.is.emptyArray(F.__debug_options__.events) || F.arr.any(F.__debug_options__.events, function(name){ return F.str.contains(eventName, name); })); 31424 args = args || []; 31425 args.unshift(this); 31426 return $.Deferred(function(d){ 31427 var evt = $.Event(eventName); 31428 if (self.o.stopPropagation == true){ 31429 self.$el.one(eventName, function (e) {e.stopPropagation();}); 31430 } 31431 if (debug) console.log('FooTable:'+eventName+': ', args); 31432 self.$el.trigger(evt, args); 31433 if (evt.isDefaultPrevented()){ 31434 if (debug) console.log('FooTable: default prevented for the "'+eventName+'" event.'); 31435 d.reject(evt); 31436 } else d.resolve(evt); 31437 }); 31438 }, 31439 /** 31440 * Attempts to retrieve the instance of the supplied component type for this instance. 31441 * @this FooTable.Table 31442 * @instance 31443 * @param {object} type - The content type to retrieve for this instance. 31444 * @returns {(*|null)} 31445 */ 31446 use: function(type){ 31447 var components = this.components.internal.concat(this.components.core, this.components.custom); 31448 for (var i = 0, len = components.length; i < len; i++){ 31449 if (components[i] instanceof type) return components[i]; 31450 } 31451 return null; 31452 }, 31453 /** 31454 * Performs the drawing of the table. 31455 * @this FooTable.Table 31456 * @instance 31457 * @protected 31458 * @returns {jQuery.Promise} 31459 * @fires FooTable.Table#"predraw.ft.table" 31460 * @fires FooTable.Table#"draw.ft.table" 31461 * @fires FooTable.Table#"postdraw.ft.table" 31462 */ 31463 draw: function () { 31464 var self = this; 31465 // when drawing the order that the components are executed is important so chain the methods but use promises to retain async safety. 31466 return self.execute(false, true, 'predraw').then(function(){ 31467 /** 31468 * The predraw.ft.table event is raised after all core components and add-ons have executed there predraw functions but before they execute there draw functions. 31469 * @event FooTable.Table#"predraw.ft.table" 31470 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31471 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31472 */ 31473 return self.raise('predraw.ft.table').then(function(){ 31474 return self.execute(false, true, 'draw').then(function(){ 31475 /** 31476 * The draw.ft.table event is raised after all core components and add-ons have executed there draw functions. 31477 * @event FooTable.Table#"draw.ft.table" 31478 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31479 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31480 */ 31481 return self.raise('draw.ft.table').then(function(){ 31482 return self.execute(false, true, 'postdraw').then(function(){ 31483 /** 31484 * The postdraw.ft.table event is raised after all core components and add-ons have executed there postdraw functions. 31485 * @event FooTable.Table#"postdraw.ft.table" 31486 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31487 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31488 */ 31489 return self.raise('postdraw.ft.table'); 31490 }); 31491 }); 31492 }); 31493 }); 31494 }).fail(function(err){ 31495 if (F.is.error(err)){ 31496 console.error('FooTable: unhandled error thrown during a draw operation.', err); 31497 } 31498 }); 31499 }, 31500 /** 31501 * Executes the specified method with the optional number of parameters on all components and waits for the promise from each to be resolved before executing the next. 31502 * @this FooTable.Table 31503 * @instance 31504 * @protected 31505 * @param {boolean} reverse - Whether or not to execute the component methods in the reverse order to what they were registered in. 31506 * @param {boolean} enabled - Whether or not to execute the method on enabled components only. 31507 * @param {string} methodName - The name of the method to execute. 31508 * @param {*} [param1] - The first parameter for the method. 31509 * @param {...*} [paramN] - Any number of additional parameters for the method. 31510 * @returns {jQuery.Promise} 31511 */ 31512 execute: function(reverse, enabled, methodName, param1, paramN){ 31513 var self = this, args = Array.prototype.slice.call(arguments); 31514 reverse = args.shift(); 31515 enabled = args.shift(); 31516 var internal = enabled ? F.arr.get(self.components.internal, function(c){ return c.enabled; }) : self.components.internal.slice(0),
31517 core = enabled ? F.arr.get(self.components.core, function(c){ return c.enabled; }) : self.components.core.slice(0), 31518 custom = enabled ? F.arr.get(self.components.custom, function(c){ return c.enabled; }) : self.components.custom.slice(0); 31519 31520 args.unshift(reverse ? custom.reverse() : internal); 31521 return self._execute.apply(self, args).then(function(){ 31522 args.shift(); 31523 args.unshift(reverse ? core.reverse() : core); 31524 return self._execute.apply(self, args).then(function(){ 31525 args.shift(); 31526 args.unshift(reverse ? internal.reverse() : custom); 31527 return self._execute.apply(self, args); 31528 }); 31529 }); 31530 }, 31531 /** 31532 * Executes the specified method with the optional number of parameters on all supplied components waiting for the result of each before executing the next. 31533 * @this FooTable.Table 31534 * @instance 31535 * @private 31536 * @param {Array.<FooTable.Component>} components - The components to call the method on. 31537 * @param {string} methodName - The name of the method to execute 31538 * @param {*} [param1] - The first parameter for the method. 31539 * @param {...*} [paramN] - Any additional parameters for the method. 31540 * @returns {jQuery.Promise} 31541 */ 31542 _execute: function(components, methodName, param1, paramN){ 31543 if (!components || !components.length) return $.when(); 31544 var self = this, args = Array.prototype.slice.call(arguments), 31545 component; 31546 components = args.shift(); 31547 methodName = args.shift(); 31548 component = components.shift(); 31549 31550 if (!F.is.fn(component[methodName])) 31551 return self._execute.apply(self, [components, methodName].concat(args)); 31552 31553 return $.Deferred(function(d){
31554 try { 31555 var result = component[methodName].apply(component, args); 31556 if (F.is.promise(result)){ 31557 return result.then(d.resolve, d.reject); 31558 } else { 31559 d.resolve(result); 31560 } 31561 } catch (err) { 31562 d.reject(err); 31563 } 31564 }).then(function(){ 31565 return self._execute.apply(self, [components, methodName].concat(args)); 31566 }); 31567 }, 31568 /** 31569 * Listens to the window resize event and performs a check to see if the breakpoint has changed. 31570 * @this window 31571 * @instance 31572 * @private 31573 * @fires FooTable.Table#"resize.ft.table" 31574 */ 31575 _onWindowResize: function (e) { 31576 var self = e.data.self; 31577 if (self._resizeTimeout != null) { clearTimeout(self._resizeTimeout); } 31578 self._resizeTimeout = setTimeout(function () { 31579 self._resizeTimeout = null; 31580 /** 31581 * The resize event is raised a short time after window resize operations cease. 31582 * @event FooTable.Table#"resize.ft.table" 31583 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31584 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31585 */ 31586 self.raise('resize.ft.table').then(function(){ 31587 self.breakpoints.check(); 31588 }); 31589 }, 300); 31590 } 31591 }); 31592 31593})(jQuery, FooTable); 31594(function($, F){ 31595 31596 if (F.is.undef(window.moment)){ 31597 // The DateColumn requires moment.js to parse and format date values. Goto http://momentjs.com/ to get it. 31598 return; 31599 } 31600 31601 F.DateColumn = F.Column.extend(/** @lends FooTable.DateColumn */{ 31602 /** 31603 * The date column class is used to handle date values. This column is dependent on [moment.js]{@link http://momentjs.com/} to provide date parsing and formatting functionality. 31604 * @constructs 31605 * @extends FooTable.Column 31606 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to. 31607 * @param {object} definition - An object containing all the properties to set for the column. 31608 * @returns {FooTable.DateColumn} 31609 */ 31610 construct: function(instance, definition){ 31611 this._super(instance, definition, 'date'); 31612 /** 31613 * The format string to use when parsing and formatting dates. 31614 * @instance 31615 * @type {string} 31616 */ 31617 this.formatString = F.is.string(definition.formatString) ? definition.formatString : 'MM-DD-YYYY'; 31618 }, 31619 /** 31620 * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.DateColumn#format} function 31621 * to generate the cell contents. 31622 * @instance 31623 * @protected 31624 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 31625 * @returns {(moment|null)} 31626 * @this FooTable.DateColumn 31627 */ 31628 parser: function(valueOrElement){ 31629 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){ 31630 valueOrElement = $(valueOrElement).data('value') || $(valueOrElement).text(); 31631 if (F.is.string(valueOrElement)) valueOrElement = isNaN(valueOrElement) ? valueOrElement : +valueOrElement; 31632 } 31633 if (F.is.date(valueOrElement)) return moment(valueOrElement); 31634 if (F.is.object(valueOrElement) && F.is.boolean(valueOrElement._isAMomentObject)) return valueOrElement; 31635 if (F.is.string(valueOrElement)){ 31636 // if it looks like a number convert it and do nothing else otherwise create a new moment using the string value and formatString 31637 if (isNaN(valueOrElement)){ 31638 return moment(valueOrElement, this.formatString); 31639 } else { 31640 valueOrElement = +valueOrElement; 31641 } 31642 } 31643 if (F.is.number(valueOrElement)){ 31644 return moment(valueOrElement); 31645 } 31646 return null; 31647 }, 31648 /** 31649 * This is supplied the value retrieved from the {@link FooTable.DateColumn#parser} function and must return a string, HTMLElement or jQuery object. 31650 * The return value from this function is what is displayed in the cell in the table. 31651 * @instance 31652 * @protected 31653 * @param {*} value - The value to format. 31654 * @returns {(string|HTMLElement|jQuery)} 31655 * @this FooTable.DateColumn 31656 */ 31657 formatter: function(value){ 31658 return F.is.object(value) && F.is.boolean(value._isAMomentObject) ? value.format(this.formatString) : ''; 31659 }, 31660 /** 31661 * This is supplied either the cell value or jQuery object to parse. A str
31661ing value must be returned from this method and will be used during filtering operations. 31662 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 31663 * @returns {string} 31664 * @this FooTable.DateColumn 31665 */ 31666 filterValue: function(valueOrElement){ 31667 // if we have an element or a jQuery object use jQuery to get the value 31668 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)) valueOrElement = $(valueOrElement).data('filterValue') || $(valueOrElement).text(); 31669 // if options are supplied with the value 31670 if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){ 31671 if (F.is.string(valueOrElement.options.filterValue)) valueOrElement = valueOrElement.options.filterValue; 31672 if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value; 31673 } 31674 // if the value is a moment object just return the formatted value 31675 if (F.is.object(valueOrElement) && F.is.boolean(valueOrElement._isAMomentObject)) return valueOrElement.format(this.formatString); 31676 // if its a string 31677 if (F.is.string(valueOrElement)){ 31678 // if its not a number return it 31679 if (isNaN(valueOrElement)){ 31680 return valueOrElement; 31681 } else { // otherwise convert it and carry on 31682 valueOrElement = +valueOrElement; 31683 } 31684 } 31685 // if the value is a number or date convert to a moment object and return the formatted result. 31686 if (F.is.number(valueOrElement) || F.is.date(valueOrElement)){ 31687 return moment(valueOrElement).format(this.formatString); 31688 } 31689 // try use the native toString of the value if its not undefined or null 31690 if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement+''; 31691 return ''; // otherwise we have no value so return an empty string 31692 } 31693 }); 31694 31695 F.columns.register('date', F.DateColumn); 31696 31697})(jQuery, FooTable); 31698(function($, F){ 31699 31700 F.HTMLColumn = F.Column.extend(/** @lends FooTable.HTMLColumn */{ 31701 /** 31702 * The HTML column class is used to handle any raw HTML columns. 31703 * @constructs 31704 * @extends FooTable.Column 31705 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to. 31706 * @param {object} definition - An object containing all the properties to set for the column. 31707 * @returns {FooTable.HTMLColumn} 31708 */ 31709 construct: function(instance, definition){ 31710 this._super(instance, definition, 'html'); 31711 }, 31712 /** 31713 * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.HTMLColumn#format} function 31714 * to generate the cell contents. 31715 * @instance 31716 * @protected 31717 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 31718 * @returns {(number|null)} 31719 * @this FooTable.HTMLColumn 31720 */ 31721 parser: function(valueOrElement){ 31722 if (F.is.string(valueOrElement)) valueOrElement = $($.trim(valueOrElement)); 31723 if (F.is.element(valueOrElement)) valueOrElement = $(valueOrElement); 31724 if (F.is.jq(valueOrElement)){ 31725 var tagName = valueOrElement.prop('tagName').toLowerCase(); 31726 if (tagName == 'td' || tagName == 'th') return valueOrElement.data('value') || valueOrElement.contents(); 31727 return valueOrElement; 31728 } 31729 return null; 31730 } 31731 }); 31732 31733 F.columns.register('html', F.HTMLColumn); 31734 31735})(jQuery, FooTable); 31736(function($, F){ 31737 31738 F.NumberColumn = F.Column.extend(/** @lends FooTable.NumberColumn */{ 31739 /** 31740 * The number column class is used to handle simple number columns. 31741 * @constructs 31742 * @extends FooTable.Column 31743 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to. 31744 * @param {object} definition - An object containing all the properties to set for the column. 31745 * @returns {FooTable.NumberColumn} 31746 */ 31747 construct: function(instance, definition){ 31748 this._super(instance, definition, 'number'); 31749 this.decimalSeparator = F.is.string(definition.decimalSeparator) ? definition.decimalSeparator : '.'; 31750 this.thousandSeparator = F.is.string(definition.thousandSeparator) ? definition.thousandSeparator : '.'; 31751 this.decimalSeparatorRegex = new RegExp(F.str.escapeRegExp(this.decimalSeparator), 'g'); 31752 this.thousandSeparatorRegex = new RegExp(F.str.escapeRegExp(this.thousandSeparator), 'g'); 31753 this.cleanRegex = new RegExp('[^0-9' + F.str.escapeRegExp(this.decimalSeparator) + ']', 'g'); 31754 }, 31755 /** 31756 * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.Column#formatter} function 31757 * to generate the cell contents. 31758 * @instance 31759 * @protected 31760 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 31761 * @returns {(number|null)} 31762 * @this FooTable.NumberColumn 31763 */ 31764 parser: function(valueOrElement){
31765 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){ 31766 valueOrElement = $(valueOrElement).data('value') || $(valueOrElement).text().replace(this.cleanRegex, ''); 31767 } 31768 if (F.is.string(valueOrElement)){ 31769 valueOrElement = valueOrElement.replace(this.thousandSeparatorRegex, '').replace(this.decimalSeparatorRegex, '.'); 31770 valueOrElement = parseFloat(valueOrElement); 31771 } 31772 if (F.is.number(valueOrElement)) return valueOrElement; 31773 return null; 31774 }, 31775 /** 31776 * This is supplied the value retrieved from the {@link FooTable.NumberColumn#parse} function and must return a string, HTMLElement or jQuery object. 31777 * The return value from this function is what is displayed in the cell in the table. 31778 * @instance 31779 * @protected 31780 * @param {number} value - The value to format. 31781 * @returns {(string|HTMLElement|jQuery)} 31782 * @this FooTable.NumberColumn 31783 */ 31784 formatter: function(value){ 31785 if (value == null) return ''; 31786 var s = (value + '').split('.'); 31787 if (s.length == 2 && s[0].length > 3) { 31788 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, this.thousandSeparator); 31789 } 31790 return s.join(this.decimalSeparator); 31791 } 31792 }); 31793 31794 F.columns.register('number', F.NumberColumn); 31795 31796})(jQuery, FooTable); 31797(function ($, F) { 31798 31799 F.Component = F.Class.extend(/** @lends FooTable.Component */{ 31800 /** 31801 * The base class for all FooTable components. 31802 * @constructs 31803 * @extends FooTable.Class 31804 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} object for the component. 31805 * @param {boolean} enabled - Whether or not the component is enabled. 31806 * @throws {TypeError} The instance parameter must be an instance of {@link FooTable.Table}. 31807 * @returns {FooTable.Component} 31808 */ 31809 construct: function (instance, enabled) { 31810 if (!(instance instanceof F.Table)) 31811 throw new TypeError('The instance parameter must be an instance of FooTable.Table.'); 31812 31813 /** 31814 * The parent {@link FooTable.Table} for the component. 31815 * @type {FooTable.Table} 31816 */ 31817 this.ft = instance; 31818 /** 31819 * Whether or not this component is enabled. Disabled components only have there preinit method called allowing for this value to be overridden. 31820 * @type {boolean} 31821 */ 31822 this.enabled = F.is.boolean(enabled) ? enabled : false; 31823 }, 31824 /** 31825 * The preinit method is called during the parent {@link FooTable.Table} constructor call. 31826 * @param {object} data - The jQuery.data() object of the root table. 31827 * @instance 31828 * @protected 31829 * @function 31830 */ 31831 preinit: null, 31832 /** 31833 * The init method is called during the parent {@link FooTable.Table} constructor call. 31834 * @instance 31835 * @protected 31836 * @function 31837 */ 31838 init: null, 31839 /** 31840 * This method is called from the {@link FooTable.Table#destroy} method. 31841 * @instance 31842 * @protected 31843 */ 31844 destroy: null, 31845 /** 31846 * This method is called from the {@link FooTable.Table#draw} method. 31847 * @instance 31848 * @protected 31849 * @function 31850 */ 31851 predraw: null, 31852 /** 31853 * This method is called from the {@link FooTable.Table#draw} method. 31854 * @instance 31855 * @protected 31856 * @function 31857 */ 31858 draw: null, 31859 /** 31860 * This method is called from the {@link FooTable.Table#draw} method. 31861 * @instance 31862 * @protected 31863 * @function 31864 */ 31865 postdraw: null 31866 }); 31867 31868 F.components = new F.ClassFactory(); 31869 F.components.core = new F.ClassFactory(); 31870 F.components.internal = new F.ClassFactory(); 31871 31872})(jQuery, FooTable); 31873(function($, F){ 31874 31875 F.Breakpoint = F.Class.extend(/** @lends FooTable.Breakpoint */{ 31876 /** 31877 * The breakpoint class containing the name and maximum width for the breakpoint. 31878 * @constructs 31879 * @extends FooTable.Class 31880 * @param {string} name - The name of the breakpoint. Must contain no spaces or special characters. 31881 * @param {number} width - The width of the breakpoint in pixels. 31882 * @returns {FooTable.Breakpoint} 31883 */ 31884 construct: function(name, width){ 31885 /** 31886 * The name of the breakpoint. 31887 * @type {string} 31888 */ 31889 this.name = name; 31890 /** 31891 * The maximum width of the breakpoint in pixels. 31892 * @type {number} 31893 */ 31894 this.width = width; 31895 } 31896 }); 31897 31898})(jQuery, FooTable); 31899(function($, F){ 31900 F.Breakpoints = F.Component.extend(/** @lends FooTable.Breakpoints */{ 31901 /** 31902 * Contains the logic to calculate and apply breakpoints for the plugin. 31903 * @constructs 31904 * @extends FooTable.Component 31905 * @param {FooTable.Table} table - The parent {@link FooTable.Table} this component belongs to. 31906 * @returns {FooTable.Breakpoints} 31907 */ 31908 construct: function(table){ 31909 // call the base class constructor 31910 this._super(table, true); 31911 31912 /* PROTECTED */ 31913 /** 31914 * This provides a shortcut to the {@link FooTable.Table#options} object. 31915 * @protected 31916 * @type {FooTable.Table#options} 31917 */ 31918 this.o = table.o; 31919 31920 /* PUBLIC */ 31921 /** 31922 * The current breakpoint. 31923 * @type {FooTable.Breakpoint} 31924 */ 31925 this.current = null; 31926 /** 31927 * An array of {@link FooTable.Breakpoint} objects created from parsing the options. 31928 * @type {Array.<FooTable.Breakpoint>} 31929 */ 31930 this.array = []; 31931 /** 31932 * Whether or not breakpoints cascade. When set to true all breakpoints larger than the current will be hidden along with it. 31933 * @type {boolean} 31934 */ 31935 this.cascade = this.o.cascade; 31936 /** 31937 * Whether or not to calculate breakpoints on the width of the parent element rather than the viewport. 31938 * @type {boolean} 31939 */ 31940 this.useParentWidth = this.o.useParentWidth; 31941 /** 31942 * This value is updated each time the current breakpoint changes and contains a space delimited string of the names of the current breakpoint and all those smaller than it. 31943 * @type {string} 31944 */ 31945 this.hidden = null; 31946 31947 /* PRIVATE */ 31948 /** 31949 * This value is set once when the {@link FooTable.Breakpoints#array} is generated and contains a space delimited string of all the breakpoint class names. 31950 * @type {string} 31951 * @private 31952 */ 31953 this._classNames = ''; 31954 31955 // check if a function was supplied to override the default getWidth 31956 this.getWidth = F.checkFnValue(this, this.o.getWidth, this.getWidth); 31957 }, 31958 31959 /* PROTECTED */ 31960 /** 31961 * Checks the supplied data and options for the breakpoints component. 31962 * @instance 31963 * @protected 31964 * @param {object} data - The jQuery data object from the parent table. 31965 * @fires FooTable.Breakpoints#"preinit.ft.breakpoints" 31966 */ 31967 preinit: function(data){ 31968 var self = this; 31969 /** 31970 * The preinit.ft.breakpoints event is raised before any UI is created and provides the tables jQuery data object for additional options parsing. 31971 * Calling preventDefault on this event will disable the entire plugin. 31972 * @event FooTable.Breakpoints#"preinit.ft.breakpoints" 31973 * @param {jQuery.Event} e - The jQuery.Event object for the event. 31974 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 31975 * @param {object} data - The jQuery data object of the table raising the event. 31976 */ 31977 return this.ft.raise('preinit.ft.breakpoints', [data]).then(function(){ 31978 self.cascade = F.is.boolean(data.cascade) ? data.cascade : self.cascade; 31979 self.o.breakpoints = F.is.hash(data.breakpoints) ? data.breakpoints : self.o.breakpoints; 31980 self.getWidth = F.checkFnValue(self, data.getWidth, self.getWidth); 31981 if (self.o.breakpoints == null) self.o.breakpoints = { "xs": 480, "sm": 768, "md": 992, "lg": 1200 }; 31982 // Create a nice friendly array to work with out of the breakpoints object. 31983 for (var name in self.o.breakpoints) { 31984 if (!self.o.breakpoints.hasOwnProperty(name)) continue; 31985 self.array.push(new F.Breakpoint(name, self.o.breakpoints[name])); 31986 self._classNames += 'breakpoint-' + name + ' '; 31987 } 31988 // Sort the breakpoints so the largest is checked first 31989 self.array.sort(function (a, b) { 31990 return b.width - a.width; 31991 }); 31992 }); 31993 }, 31994 /** 31995 * Initializes the class parsing the options into a sorted array of {@link FooTable.Breakpoint} objects. 31996 * @instance 31997 * @protected 31998 * @fires FooTable.Breakpoints#"init.ft.breakpoints" 31999 */ 32000 init: function(){ 32001 var self = this; 32002 /** 32003 * The init.ft.breakpoints event is raised before any UI is generated. 32004 * Calling preventDefault on this event will disable the entire plugin. 32005 * @event FooTable.Breakpoints#"init.ft.breakpoints" 32006 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32007 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32008 */ 32009 return this.ft.raise('init.ft.breakpoints').then(function(){ 32010 self.current = self.get(); 32011 }); 32012 }, 32013 /** 32014 * Whenever the table is drawn this ensures the correct breakpoint class is applied to the table. 32015 * @instance 32016 * @protected 32017 */ 32018 draw: function(){ 32019 this.ft.$el.removeClass(this._classNames).addClass('breakpoint-' + this.current.name); 32020 }, 32021 32022 /* PUBLIC */ 32023 /** 32024 * Calculates the current breakpoint from the {@link FooTable.Breakpoints#array} and sets the {@link FooTable.Breakpoints#current} property. 32025 * @instance 32026 * @returns {FooTable.Breakpoint} 32027 */ 32028 calculate: function(){ 32029 var self = this, current = null, hidden = [], breakpoint, prev = null, width = self.getWidth(); 32030 for (var i = 0, len = self.array.length; i < len; i++) { 32031 breakpoint = self.array[i]; 32032 // if the width is smaller than the smallest breakpoint set the smallest as the current. 32033 // if the width is larger than the largest breakpoint set the largest as the current. 32034 // otherwise if the width is somewhere in between check all breakpoints testing if the width 32035 // is greater than the current but smaller than the previous. 32036 if ((!current && i == len -1) 32037 || (width >= breakpoint.width && (prev instanceof F.Breakpoint ? width < prev.width : true))) { 32038 current = breakpoint; 32039 } 32040 if (!current) hidden.push(breakpoint.name); 32041 prev = breakpoint; 32042 } 32043 hidden.push(current.name); 32044 self.hidden = hidden.join(' '); 32045 return current; 32046 }, 32047 /** 32048 * Supplied a columns breakpoints this returns a boolean value indicating whether or not the column is visible. 32049 * @param {string} breakpoints - A space separated string of breakpoint names. 32050 * @returns {boolean} 32051 */ 32052 visible: function(breakpoints){ 32053 if (F.is.emptyString(breakpoints)) return true; 32054 if (breakpoints === 'all') return false;
32055 var parts = breakpoints.split(' '), i = 0, len = parts.length; 32056 for (; i < len; i++){ 32057 if (this.cascade ? F.str.containsWord(this.hidden, parts[i]) : parts[i] == this.current.name) return false; 32058 } 32059 return true; 32060 }, 32061 /** 32062 * Performs a check between the current breakpoint and the previous breakpoint and performs a redraw if they differ. 32063 * @instance 32064 * @fires FooTable.Breakpoints#"before.ft.breakpoints" 32065 * @fires FooTable.Breakpoints#"after.ft.breakpoints" 32066 */ 32067 check: function(){ 32068 var self = this, bp = self.get(); 32069 if (!(bp instanceof F.Breakpoint) 32070 || bp == self.current) 32071 return; 32072 32073 /** 32074 * The before.ft.breakpoints event is raised if the breakpoint has changed but before the UI is redrawn and is supplied both the current breakpoint 32075 * and the next "new" one that is about to be applied. 32076 * Calling preventDefault on this event will prevent the next breakpoint from being applied. 32077 * @event FooTable.Breakpoints#"before.ft.breakpoints" 32078 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32079 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32080 * @param {FooTable.Breakpoint} current - The current breakpoint. 32081 * @param {FooTable.Breakpoint} next - The breakpoint that is about to be applied. 32082 */ 32083 self.ft.raise('before.ft.breakpoints', [self.current, bp]).then(function(){ 32084 var previous = self.current; 32085 self.current = bp; 32086 return self.ft.draw().then(function(){ 32087 /** 32088 * The after.ft.breakpoints event is raised after the breakpoint has changed and the UI is redrawn and is supplied both the "new" current breakpoint 32089 * and the previous one that was replaced. 32090 * @event FooTable.Breakpoints#"after.ft.breakpoints" 32091 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32092 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32093 * @param {FooTable.Breakpoint} current - The current breakpoint. 32094 * @param {FooTable.Breakpoint} previous - The breakpoint that was just replaced. 32095 */ 32096 self.ft.raise('after.ft.breakpoints', [self.current, previous]); 32097 }); 32098 }); 32099 }, 32100 /** 32101 * Attempts to return a {@link FooTable.Breakpoint} instance when passed a {@link FooTable.Breakpoint}, 32102 * the {@link FooTable.Breakpoint#name} string or if nothing is supplied the current breakpoint. 32103 * @instance 32104 * @param {(FooTable.Breakpoint|string|number)} [breakpoint] - The breakpoint to retrieve. 32105 * @returns {FooTable.Breakpoint} 32106 */ 32107 get: function(breakpoint){ 32108 if (F.is.undef(breakpoint)) return this.calculate(); 32109 if (breakpoint instanceof F.Breakpoint) return breakpoint; 32110 if (F.is.string(breakpoint)) return F.arr.first(this.array, function (bp) { return bp.name == breakpoint; }); 32111 if (F.is.number(breakpoint)) return breakpoint >= 0 && breakpoint < this.array.length ? this.array[breakpoint] : null; 32112 return null; 32113 }, 32114 /** 32115 * Gets the width used to determine breakpoints whether it be from the viewport, parent or a custom function. 32116 * @instance 32117 * @returns {number} 32118 */ 32119 getWidth: function(){ 32120 if (F.is.fn(this.o.getWidth)) return this.o.getWidth(this.ft); 32121 if (this.useParentWidth == true) return this.getParentWidth(); 32122 return this.getViewportWidth(); 32123 }, 32124 /** 32125 * Gets the tables direct parents width. 32126 * @instance 32127 * @returns {number} 32128 */ 32129 getParentWidth: function(){ 32130 return this.ft.$el.parent().width(); 32131 }, 32132 /** 32133 * Gets the current viewport width. 32134 * @instance 32135 * @returns {number} 32136 */ 32137 getViewportWidth: function(){ 32138 var ratio = F.is.defined(window.devicePixelRatio) && F.is.mobile ? window.devicePixelRatio : 1; 32139 return Math.max(document.documentElement.clientWidth, window.innerWidth, 0) / ratio; 32140 } 32141 }); 32142 32143 F.components.internal.register('breakpoints', F.Breakpoints, 10); 32144 32145})(jQuery, FooTable); 32146(function(F){ 32147 /** 32148 * A space delimited string of breakpoint names that specify when the column will be hidden. You can also specify "all" to make a column permanently display in an expandable detail row. 32149 * @type {string} 32150 * @default null 32151 * @example <caption>The below shows how this value would be set</caption> 32152 * breakpoints: "md" 32153 */ 32154 F.Column.prototype.breakpoints = null; 32155 32156 F.Column.prototype.__breakpoints_define__ = function(definition){ 32157 this.breakpoints = F.is.emptyString(definition.breakpoints) ? null : definition.breakpoints; 32158 }; 32159 32160 F.Column.extend('define', function(definition){ 32161 this._super(definition); 32162 this.__breakpoints_define__(definition); 32163 }); 32164})(FooTable); 32165(function(F){ 32166 /**
32167 * An object containing the breakpoints for the plugin. 32168 * @type {object.<string, number>} 32169 * @default { "xs": 480, "sm": 768, "md": 992, "lg": 1200 } 32170 */ 32171 F.Defaults.prototype.breakpoints = null; 32172 32173 /** 32174 * Whether or not breakpoints cascade. When set to true all breakpoints larger than the current will also be hidden along with it. 32175 * @type {boolean} 32176 * @default false 32177 */ 32178 F.Defaults.prototype.cascade = false; 32179 32180 /** 32181 * Whether or not to calculate breakpoints on the width of the parent element rather than the viewport. 32182 * @type {boolean} 32183 * @default false 32184 */ 32185 F.Defaults.prototype.useParentWidth = false; 32186 32187 /** 32188 * A function used to override the default getWidth function with a custom one. 32189 * @type {function} 32190 * @default null 32191 * @example <caption>The below shows what the default getWidth function would look like.</caption> 32192 * getWidth: function(instance){ 32193 * if (instance.o.useParentWidth == true) return instance.$el.parent().width(); 32194 * return instance.breakpoints.getViewportWidth(); 32195 * } 32196 */ 32197 F.Defaults.prototype.getWidth = null; 32198})(FooTable); 32199(function($, F){ 32200 F.Columns = F.Component.extend(/** @lends FooTable.Columns */{ 32201 /** 32202 * The columns class contains all the logic for handling columns. 32203 * @constructs 32204 * @extends FooTable.Component 32205 * @param {FooTable.Table} table - The parent {@link FooTable.Table} this component belongs to. 32206 * @returns {FooTable.Columns} 32207 */ 32208 construct: function(table){ 32209 // call the base class constructor 32210 this._super(table, true); 32211 32212 /* PROTECTED */ 32213 /** 32214 * This provides a shortcut to the {@link FooTable.Table#options} object. 32215 * @protected 32216 * @type {FooTable.Table#options} 32217 */ 32218 this.o = table.o; 32219 32220 /* PUBLIC */ 32221 /** 32222 * An array of {@link FooTable.Column} objects created from parsing the options and/or DOM. 32223 * @type {Array.<FooTable.Column>} 32224 */ 32225 this.array = []; 32226 /** 32227 * The jQuery header row object. 32228 * @type {jQuery} 32229 */ 32230 this.$header = null; 32231 /** 32232 * Whether or not to display the header row. 32233 * @type {boolean} 32234 */ 32235 this.showHeader = table.o.showHeader; 32236 }, 32237 32238 /* PROTECTED */ 32239 /** 32240 * This parses the columns from either the tables rows or the supplied options. 32241 * @instance 32242 * @protected 32243 * @param {object} data - The tables jQuery data object. 32244 * @returns {jQuery.Promise} 32245 * @this FooTable.Columns 32246 */ 32247 parse: function(data){ 32248 var self = this; 32249 return $.Deferred(function(d){ 32250 function merge(cols1, cols2){ 32251 var merged = []; 32252 // check if either of the arrays is empty as it can save us having to merge them by index. 32253 if (cols1.length == 0 || cols2.length == 0){ 32254 merged = cols1.concat(cols2); 32255 } else { 32256 // at this point we have two arrays of column definitions, we now need to merge them based on there index properties 32257 // first figure out the highest column index provided so we can loop that many times to merge all columns and provide 32258 // defaults where nothing was specified (fill in the gaps in the array as it were). 32259 var highest = 0; 32260 F.arr.each(cols1.concat(cols2), function(c){ 32261 if (c.index > highest) highest = c.index; 32262 }); 32263 highest++; 32264 for (var i = 0, cols1_c, cols2_c; i < highest; i++){ 32265 cols1_c = {}; 32266 F.arr.each(cols1, function(c){ 32267 if (c.index == i){ 32268 cols1_c = c; 32269 return false; 32270 } 32271 }); 32272 cols2_c = {}; 32273 F.arr.each(cols2, function(c){ 32274 if (c.index == i){ 32275 cols2_c = c; 32276 return false; 32277 } 32278 }); 32279 merged.push($.extend(true, {}, cols1_c, cols2_c)); 32280 } 32281 } 32282 return merged; 32283 } 32284 32285 var json = [], html = []; 32286 // get the column options from the content 32287 var $header = self.ft.$el.find('tr.footable-header'), $cell, cdata; 32288 if ($header.length == 0) $header = self.ft.$el.find('thead > tr:last:has([data-breakpoints])'); 32289 if ($header.length == 0) $header = self.ft.$el.find('tbody > tr:first:has([data-breakpoints])'); 32290 if ($header.length > 0){ 32291 var virtual = $header.parent().is('tbody') && $header.children().length == $header.children('td').length; 32292 if (!virtual) self.$header = $header.addClass('footable-header'); 32293 $header.children('td,th').each(function(i, cell){ 32294 $cell = $(cell); 32295 cdata = $cell.data(); 32296 cdata.index = i; 32297 cdata.$el = $cell; 32298 cdata.virtual = virtual; 32299 html.push(cdata); 32300 }); 32301 if (virtual) self.showHeader = false;
32302 } 32303 // get the supplied column options 32304 if (F.is.array(self.o.columns)){ 32305 F.arr.each(self.o.columns, function(c, i){ 32306 c.index = i; 32307 json.push(c); 32308 }); 32309 self.parseFinalize(d, merge(json, html)); 32310 } else if (F.is.promise(self.o.columns)){ 32311 self.o.columns.then(function(cols){ 32312 F.arr.each(cols, function(c, i){ 32313 c.index = i; 32314 json.push(c); 32315 }); 32316 self.parseFinalize(d, merge(json, html)); 32317 }, function(xhr){ 32318 d.reject(Error('Columns ajax request error: ' + xhr.status + ' (' + xhr.statusText + ')')); 32319 }); 32320 } else { 32321 self.parseFinalize(d, merge(json, html)); 32322 } 32323 }); 32324 }, 32325 /** 32326 * Used to finalize the parsing of columns it is supplied the parse deferred object which must be resolved with an array of {@link FooTable.Column} objects 32327 * or rejected with an error. 32328 * @instance 32329 * @protected 32330 * @param {jQuery.Deferred} deferred - The deferred object used for parsing. 32331 * @param {Array.<object>} cols - An array of all merged column definitions. 32332 */ 32333 parseFinalize: function(deferred, cols){ 32334 // we now have a merged array of all column definitions supplied to the plugin, time to make the objects. 32335 var self = this, columns = [], column; 32336 F.arr.each(cols, function(def){ 32337 // if we have a column registered using the definition type then create an instance of that column otherwise just create a default text column. 32338 if (column = F.columns.contains(def.type) ? F.columns.make(def.type, self.ft, def) : new F.Column(self.ft, def)) 32339 columns.push(column); 32340 }); 32341 if (F.is.emptyArray(columns)){ 32342 deferred.reject(Error("No columns supplied.")); 32343 } else { 32344 // make sure to sort by the column index as the merge process may have mixed them up 32345 columns.sort(function(a, b){ return a.index - b.index; }); 32346 deferred.resolve(columns); 32347 } 32348 }, 32349 /** 32350 * The columns preinit method is used to parse and check the column options supplied from both static content and through the constructor. 32351 * @instance 32352 * @protected 32353 * @param {object} data - The jQuery data object from the root table element. 32354 * @this FooTable.Columns 32355 */ 32356 preinit: function(data){ 32357 var self = this; 32358 /** 32359 * The preinit.ft.columns event is raised before any UI is created and provides the tables jQuery data object for additional options parsing. 32360 * Calling preventDefault on this event will disable the entire plugin. 32361 * @event FooTable.Columns#"preinit.ft.columns" 32362 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32363 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32364 * @param {object} data - The jQuery data object of the table raising the event. 32365 */ 32366 return self.ft.raise('preinit.ft.columns', [data]).then(function(){ 32367 return self.parse(data).then(function(columns){ 32368 self.array = columns; 32369 self.showHeader = F.is.boolean(data.showHeader) ? data.showHeader : self.showHeader; 32370 }); 32371 }); 32372 }, 32373 /** 32374 * Initializes the columns creating the table header if required. 32375 * @instance 32376 * @protected 32377 * @fires FooTable.Columns#"init.ft.columns" 32378 * @this FooTable.Columns 32379 */ 32380 init: function(){ 32381 var self = this; 32382 /** 32383 * The init.ft.columns event is raised after the header row is created/parsed for column data. 32384 * @event FooTable.Columns#"init.ft.columns" 32385 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32386 * @param {FooTable.Table} instance - The instance of the plugin raising the event. 32387 * @param {Array.<FooTable.Column>} columns - The array of {@link FooTable.Column} objects parsed from the options and/or DOM. 32388 */ 32389 return this.ft.raise('init.ft.columns', [ self.array ]).then(function(){ 32390 self.$create(); 32391 }); 32392 }, 32393 /** 32394 * The predraw method called from within the {@link FooTable.Table#draw} method. 32395 * @instance 32396 * @protected 32397 * @this FooTable.Columns 32398 */ 32399 predraw: function(){ 32400 var self = this, first = true; 32401 self.visibleColspan = 0; 32402 self.firstVisibleIndex = 0; 32403 self.lastVisibleIndex = 0; 32404 self.hasHidden = false;
32405 F.arr.each(self.array, function(col){ 32406 col.hidden = !self.ft.breakpoints.visible(col.breakpoints); 32407 if (!col.hidden && col.visible){ 32408 if (first){ 32409 self.firstVisibleIndex = col.index; 32410 first = false; 32411 } 32412 self.lastVisibleIndex = col.index; 32413 self.visibleColspan++; 32414 } 32415 if (col.hidden) self.hasHidden = true; 32416 }); 32417 }, 32418 /** 32419 * Performs the actual drawing of the columns, hiding or displaying them depending on there breakpoints. 32420 * @instance 32421 * @protected 32422 * @this FooTable.Columns 32423 */ 32424 draw: function(){ 32425 F.arr.each(this.array, function(col){ 32426 col.$el.css('display', (col.hidden || !col.visible ? 'none' : 'table-cell')); 32427 }); 32428 if (!this.showHeader && F.is.jq(this.$header.parent())){ 32429 this.$header.detach(); 32430 } 32431 }, 32432 /** 32433 * Creates the header row for the table from the parsed column definitions. 32434 * @instance 32435 * @protected 32436 * @this FooTable.Columns 32437 */ 32438 $create: function(){ 32439 var self = this; 32440 self.$header = F.is.jq(self.$header) ? self.$header : $('<tr/>', {'class': 'footable-header'}); 32441 self.$header.children('th,td').detach(); 32442 F.arr.each(self.array, function(col){ 32443 self.$header.append(col.$el); 32444 }); 32445 if (self.showHeader && !F.is.jq(self.$header.parent())){ 32446 self.ft.$el.children('thead').append(self.$header); 32447 } 32448 }, 32449 /** 32450 * Attempts to return a {@link FooTable.Column} instance when passed the {@link FooTable.Column} instance, the {@link FooTable.Column#name} string or the {@link FooTable.Column#index} number. 32451 * If supplied a function this will return an array by iterating all columns passing the index and column itself to the supplied callback as arguments. 32452 * Returning true in the callback will include the column in the result. 32453 * @instance 32454 * @param {(FooTable.Column|string|number|function)} column - The column to retrieve. 32455 * @returns {(Array.<FooTable.Column>|FooTable.Column|null)} The column if one is found otherwise it returns NULL. 32456 * @example <caption>This example shows retrieving a column by name assuming a column called "id" exists. The <code>columns</code> object is an instance of {@link FooTable.Columns}.</caption> 32457 * var column = columns.get('id'); 32458 * if (column instanceof FooTable.Column){ 32459 * // found the "id" column 32460 * } else { 32461 * // no column with a name of "id" exists 32462 * } 32463 * // to get an array of all hidden columns 32464 * var columns = columns.get(function(col){ 32465 * return col.hidden; 32466 * }); 32467 */ 32468 get: function(column){ 32469 if (column instanceof F.Column) return column; 32470 if (F.is.string(column)) return F.arr.first(this.array, function (col) { return col.name == column; }); 32471 if (F.is.number(column)) return F.arr.first(this.array, function (col) { return col.index == column; }); 32472 if (F.is.fn(column)) return F.arr.get(this.array, column); 32473 return null; 32474 }, 32475 /** 32476 * Takes an array of column names, index's or actual {@link FooTable.Column} and ensures that an array of only {@link FooTable.Column} is returned. 32477 * @instance 32478 * @param {(Array.<string>|Array.<number>|Array.<FooTable.Column>)} columns - The array of column names, index's or {@link FooTable.Column} to check. 32479 * @returns {Array.<FooTable.Column>} 32480 */ 32481 ensure: function(columns){ 32482 var self = this, result = []; 32483 if (!F.is.array(columns)) return result; 32484 F.arr.each(columns, function(name){ 32485 result.push(self.get(name)); 32486 }); 32487 return result; 32488 } 32489 }); 32490 32491 F.components.internal.register('columns', F.Columns, 5); 32492 32493})(jQuery, FooTable); 32494(function(F){ 32495 /** 32496 * An array containing the column options or a jQuery promise that resolves returning the columns. The index of the definitions must match the index of each column as it should appear in the table. For more information on the options available see the {@link FooTable.Column} object. 32497 * @type {(Array.<object>|jQuery.Promise)} 32498 * @default [] 32499 * @example <caption>The below shows column definitions for a row defined as <code>{ id: Number, name: String, age: Number }</code>. The ID column has a fixed width, the table is initially sorted on the Name column and the Age column will be hidden on phones.</caption> 32500 * columns: [ 32501 * { name: 'id', title: 'ID', type: 'number' }, 32502 * { name: 'name', title: 'Name', sorted: true, direction: 'ASC' } 32503 * { name: 'age', title: 'Age', type: 'number', breakpoints: 'xs' } 32504 * ] 32505 */ 32506 F.Defaults.prototype.columns = []; 32507 32508 /** 32509 * Specifies whether or not the column headers should be displayed. 32510 * @type {boolean} 32511 * @default true 32512 */ 32513 F.Defaults.prototype.showHeader = true; 32514})(FooTable); 32515(function ($, F) { 32516 F.Rows = F.Component.extend(/** @lends FooTable.Rows */{ 32517 /** 32518 * The rows class contains all the logic for handling rows. 32519 * @constructs 32520 * @extends FooTable.Component 32521 * @param {FooTable.Table} table - The parent {@link FooTable.Table} this component belongs to. 32522 * @returns {FooTable.Rows} 32523 */ 32524 construct: function (table) { 32525 // call the base class constructor 32526 this._super(table, true); 32527 32528 /** 32529 * This provides a shortcut to the {@link FooTable.Table#options} object. 32530 * @instance 32531 * @protected 32532 * @type {FooTable.Table#options} 32533 */ 32534 this.o = table.o; 32535 /** 32536 * The current working array of {@link FooTable.Row} objects. 32537 * @instance 32538 * @protected 32539 * @type {Array.<FooTable.Row>} 32540 * @default [] 32541 */ 32542 this.array = []; 32543 /** 32544 * The base array of rows parsed from either the DOM or the constructor options. 32545 * The {@link FooTable.Rows#current} member is populated with a shallow clone of this array 32546 * during the predraw operation before any core or custom components are executed. 32547 * @instance 32548 * @protected 32549 * @type {Array.<FooTable.Row>} 32550 * @default [] 32551 */ 32552 this.all = []; 32553 /** 32554 * Whether or not to display a toggle in each row when it contains hidden columns. 32555 * @type {boolean} 32556 * @default true 32557 */ 32558 this.showToggle = table.o.showToggle; 32559 /** 32560 * The CSS selector used to filter row click events. If the event.target property matches the selector the row will be toggled. 32561 * @type {string} 32562 * @default "tr,td,.footable-toggle" 32563 */ 32564 this.toggleSelector = table.o.toggleSelector; 32565 /** 32566 * Specifies which column the row toggle is appended to. Supports only two values; "first" and "last" 32567 * @type {string} 32568 */ 32569 this.toggleColumn = table.o.toggleColumn; 32570 /** 32571 * The text to display when the table has no rows. 32572 * @type {string} 32573 */ 32574 this.emptyString = table.o.empty; 32575 /** 32576 * Whether or not the first rows details are expanded by default when displayed on a device that hides any columns. 32577 * @type {boolean} 32578 */ 32579 this.expandFirst = table.o.expandFirst; 32580 /** 32581 * The jQuery object that contains the empty row control. 32582 * @type {jQuery} 32583 */ 32584 this.$empty = null; 32585 }, 32586 /** 32587 * This parses the rows from either the tables rows or the supplied options. 32588 * @instance 32589 * @protected 32590 * @returns {jQuery.Promise} 32591 */ 32592 parse: function(){ 32593 var self = this; 32594 return $.Deferred(function(d){ 32595 var $rows = self.ft.$el.children('tbody').children('tr'); 32596 if (F.is.jq($rows)){ 32597 self.parseFinalize(d, $rows); 32598 $rows.detach(); 32599 } else if (F.is.array(self.o.rows) && self.o.rows.length > 0){ 32600 self.parseFinalize(d, self.o.rows); 32601 } else if (F.is.promise(self.o.rows)){ 32602 self.o.rows.then(function(rows){ 32603 self.parseFinalize(d, rows); 32604 }, function(xhr){ 32605 d.reject(Error('Rows ajax request error: ' + xhr.status + ' (' + xhr.statusText + ')')); 32606 }); 32607 } else { 32608 self.parseFinalize(d, []); 32609 } 32610 }); 32611 }, 32612 /** 32613 * Used to finalize the parsing of rows it is supplied the parse deferred object which must be resolved with an array of {@link FooTable.Row} objects 32614 * or rejected with an error. 32615 * @instance 32616 * @protected 32617 * @param {jQuery.Deferred} deferred - The deferred object used for parsing. 32618 * @param {(Array.<object>|jQuery)} rows - An array of row values and options or the jQuery object c
32618ontaining all rows. 32619 */ 32620 parseFinalize: function(deferred, rows){ 32621 var self = this, result = $.map(rows, function(r){ 32622 return new F.Row(self.ft, self.ft.columns.array, r); 32623 }); 32624 deferred.resolve(result); 32625 }, 32626 /** 32627 * The columns preinit method is used to parse and check the column options supplied from both static content and through the constructor. 32628 * @instance 32629 * @protected 32630 * @param {object} data - The jQuery data object from the root table element. 32631 * @fires FooTable.Rows#"preinit.ft.rows" 32632 */ 32633 preinit: function(data){ 32634 var self = this; 32635 /** 32636 * The preinit.ft.rows event is raised before any UI is created and provides the tables jQuery data object for additional options parsing. 32637 * Calling preventDefault on this event will disable the entire plugin. 32638 * @event FooTable.Rows#"preinit.ft.rows" 32639 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32640 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32641 * @param {object} data - The jQuery data object of the table raising the event. 32642 */ 32643 return self.ft.raise('preinit.ft.rows', [data]).then(function(){ 32644 return self.parse().then(function(rows){ 32645 self.all = rows; 32646 self.array = self.all.slice(0); 32647 self.showToggle = F.is.boolean(data.showToggle) ? data.showToggle : self.showToggle; 32648 self.toggleSelector = F.is.string(data.toggleSelector) ? data.toggleSelector : self.toggleSelector; 32649 self.toggleColumn = F.is.string(data.toggleColumn) ? data.toggleColumn : self.toggleColumn; 32650 if (self.toggleColumn != "first" && self.toggleColumn != "last") self.toggleColumn = "first"; 32651 self.emptyString = F.is.string(data.empty) ? data.empty : self.emptyString; 32652 self.expandFirst = F.is.boolean(data.expandFirst) ? data.expandFirst : self.expandFirst; 32653 }); 32654 }); 32655 }, 32656 /** 32657 * Initializes the rows class using the supplied table and options. 32658 * @instance 32659 * @protected 32660 * @fires FooTable.Rows#"init.ft.rows" 32661 */ 32662 init: function () { 32663 var self = this; 32664 /** 32665 * The init.ft.rows event is raised after the the rows are parsed from either the DOM or the options. 32666 * Calling preventDefault on this event will disable the entire plugin. 32667 * @event FooTable.Rows#"init.ft.rows" 32668 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32669 * @param {FooTable.Table} instance - The instance of the plugin raising the event. 32670 * @param {Array.<FooTable.Row>} rows - The array of {@link FooTable.Row} objects parsed from the DOM or the options. 32671 */ 32672 return self.ft.raise('init.ft.rows', [self.all]).then(function(){ 32673 self.$create(); 32674 }); 32675 }, 32676 /** 32677 * Performs the predraw operations that are required including creating the shallow clone of the {@link FooTable.Rows#array} to work with. 32678 * @instance 32679 * @protected 32680 */ 32681 predraw: function(){ 32682 F.arr.each(this.array, function(row){ 32683 row.predraw(); 32684 }); 32685 this.array = this.all.slice(0); 32686 }, 32687 $create: function(){ 32688 this.$empty = $('<tr/>', { 'class': 'footable-empty' }).append($('<td/>').text(this.emptyString)); 32689 }, 32690 /** 32691 * Performs the actual drawing of the table rows. 32692 * @instance 32693 * @protected 32694 */ 32695 draw: function(){ 32696 var self = this, $tbody = self.ft.$el.children('tbody'), first = true; 32697 // if we have rows 32698 if (self.array.length > 0){ 32699 self.$empty.detach(); 32700 // loop through them appending to the tbody and then drawing 32701 F.arr.each(self.array, function(row){ 32702 if (self.expandFirst && first){ 32703 row.expanded = true; 32704 first = false; 32705 } 32706 row.draw($tbody); 32707 }); 32708 } else { 32709 // otherwise display the $empty row 32710 self.$empty.children('td').attr('colspan', self.ft.columns.visibleColspan); 32711 $tbody.append(self.$empty); 32712 } 32713 } 32714 }); 32715 32716 F.components.internal.register('rows', F.Rows, 0); 32717 32718})(jQuery, FooTable); 32719(function(F){ 32720 /** 32721 * An array of JSON objects containing the row data or a jQuery promise that resolves returning the row data. 32722 * @type {(Array.<object>|jQuery.Promise)} 32723 * @default [] 32724 */ 32725 F.Defaults.prototype.rows = []; 32726 32727 /** 32728 * A string to display when there are no rows in the table. 32729 * @type {string} 32730 * @default "No results" 32731 */ 32732 F.Defaults.prototype.empty = 'No results'; 32733 32734 /** 32735 * Whether or not the toggle is appended to each row. 32736 * @type {boolean} 32737 * @default true 32738 */ 32739 F.Defaults.prototype.showToggle = true; 32740 32741 /** 32742 * The CSS selector used to filter row click events. If the event.target property matches the selector the row will be toggled. 32743 * @type {string} 32744 * @default "tr,td,.footable-toggle" 32745 */ 32746 F.Defaults.prototype.toggleSelector = 'tr,td,.footable-toggle'; 32747 32748 /** 32749 * Specifies which column to display the row toggle in. The only supported values are "first" or "last". 32750 * @type {string} 32751 * @default "first" 32752 */ 32753 F.Defaults.prototype.toggleColumn = 'first'; 32754 32755 /** 32756 * Whether or not the first rows details are expanded by default when displayed on a device that hides any columns. 32757 * @type {boolean} 32758 */ 32759 F.Defaults.prototype.expandFirst = false;
32760})(FooTable); 32761(function(F){ 32762 F.Filter = F.Class.extend(/** @lends FooTable.Filter */{ 32763 /** 32764 * The filter object contains the query to filter by and the columns to apply it to. 32765 * @constructs 32766 * @extends FooTable.Class 32767 * @param {string} name - The name for the filter. 32768 * @param {string} query - The query for the filter. 32769 * @param {Array.<FooTable.Column>} columns - The columns to apply the query to. 32770 * @param {string} [space="AND"] - How the query treats space chars. 32771 * @param {boolean} [connectors=true] - Whether or not to replace phrase connectors (+.-_) with spaces. 32772 * @returns {FooTable.Filter} 32773 */ 32774 construct: function(name, query, columns, space, connectors){ 32775 /** 32776 * The name of the filter. 32777 * @instance 32778 * @type {string} 32779 */ 32780 this.name = name; 32781 /** 32782 * A string specifying how the filter treats space characters. Can be either "OR" or "AND". 32783 * @instance 32784 * @type {string} 32785 */ 32786 this.space = F.is.string(space) && (space == 'OR' || space == 'AND') ? space : 'AND'; 32787 /** 32788 * Whether or not to replace phrase connectors (+.-_) with spaces before executing the query. 32789 * @instance 32790 * @type {boolean} 32791 */ 32792 this.connectors = F.is.boolean(connectors) ? connectors : true; 32793 /** 32794 * The query for the filter. 32795 * @instance 32796 * @type {(string|FooTable.Query)} 32797 */ 32798 this.query = new F.Query(query, this.space, this.connectors); 32799 /** 32800 * The columns to apply the query to. 32801 * @instance 32802 * @type {Array.<FooTable.Column>} 32803 */ 32804 this.columns = columns; 32805 }, 32806 /** 32807 * Checks if the current filter matches the supplied string. 32808 * If the current query property is a string it will be auto converted to a {@link FooTable.Query} object to perform the match. 32809 * @instance 32810 * @param {string} str - The string to check. 32811 * @returns {boolean} 32812 */ 32813 match: function(str){ 32814 if (!F.is.string(str)) return false; 32815 if (F.is.string(this.query)){ 32816 this.query = new F.Query(this.query, this.space, this.connectors); 32817 } 32818 return this.query instanceof F.Query ? this.query.match(str) : false; 32819 }, 32820 /** 32821 * Checks if the current filter matches the supplied {@link FooTable.Row}. 32822 * @instance 32823 * @param {FooTable.Row} row - The row to check. 32824 * @returns {boolean} 32825 */ 32826 matchRow: function(row){ 32827 var self = this, text = F.arr.map(row.cells, function(cell){ 32828 return F.arr.contains(self.columns, cell.column) ? cell.filterValue : null; 32829 }).join(' '); 32830 return self.match(text); 32831 } 32832 }); 32833 32834})(FooTable); 32835(function ($, F) { 32836 F.Filtering = F.Component.extend(/** @lends FooTable.Filtering */{ 32837 /** 32838 * The filtering component adds a search input and column selector dropdown to the table allowing users to filter the using space delimited queries. 32839 * @constructs 32840 * @extends FooTable.Component 32841 * @param {FooTable.Table} table - The parent {@link FooTable.Table} object for the component. 32842 * @returns {FooTable.Filtering} 32843 */ 32844 construct: function (table) { 32845 // call the constructor of the base class 32846 this._super(table, table.o.filtering.enabled); 32847 32848 /* PUBLIC */ 32849 /** 32850 * The filters to apply to the current {@link FooTable.Rows#array}. 32851 * @instance 32852 * @type {Array.<FooTable.Filter>} 32853 */ 32854 this.filters = table.o.filtering.filters; 32855 /** 32856 * The delay in milliseconds before the query is auto applied after a change. 32857 * @instance 32858 * @type {number} 32859 */ 32860 this.delay = table.o.filtering.delay; 32861 /** 32862 * The minimum number of characters allowed in the search input before it is auto applied. 32863 * @instance 32864 * @type {number} 32865 */ 32866 this.min = table.o.filtering.min; 32867 /** 32868 * Specifies how whitespace in a filter query is handled. 32869 * @instance 32870 * @type {string} 32871 */ 32872 this.space = table.o.filtering.space; 32873 /** 32874 * Whether or not to replace phrase connectors (+.-_) with spaces before executing the query. 32875 * @instance 32876 * @type {boolean} 32877 */ 32878 this.connectors = table.o.filtering.connectors; 32879 /** 32880 * The placeholder text to display within the search $input. 32881 * @instance 32882 * @type {string} 32883 */ 32884 this.placeholder = table.o.filtering.placeholder; 32885 /** 32886 * The position of the $search input within the filtering rows cell. 32887 * @type {string} 32888 */ 32889 this.position = table.o.filtering.position; 32890 /** 32891 * The jQuery row object that contains all the filtering specific elements. 32892 * @instance 32893 * @type {jQuery} 32894 */ 32895 this.$row = null; 32896 /** 32897 * The jQuery cell object that contains the search input and column selector. 32898 * @instance 32899 * @type {jQuery} 32900 */ 32901 this.$cell = null; 32902 /** 32903 * The jQuery object of the column selector dropdown. 32904 * @instance 32905 * @type {jQuery} 32906 */ 32907 this.$dropdown = null; 32908 /** 32909 * The jQuery object of the search input. 32910 * @instance 32911 * @type {jQuery} 32912 */ 32913 this.$input = null; 32914 /** 32915 * The jQuery object of the search button. 32916 * @instance 32917 * @type {jQuery} 32918 */ 32919 this.$button = null; 32920 32921 /* PRIVATE */ 32922 /** 32923 * The timeout ID for the filter changed event. 32924 * @instance 32925 * @private 32926 * @type {?number} 32927 */ 32928 this._filterTimeout = null; 32929 }, 32930 32931 /* PROTECTED */ 32932 /** 32933 * Checks the supplied data and options for the filtering component. 32934 * @instance 32935 * @protected 32936 * @param {object} data - The jQuery data object from the parent table. 32937 * @fires FooTable.Filtering#"preinit.ft.filtering" 32938 */ 32939 preinit: function(data){ 32940 var self = this; 32941 /** 32942 * The preinit.ft.filtering event is raised before the UI is created and provides the tables jQuery data object for additional options parsing. 32943 * Calling preventDefault on this event will disable the component. 32944 * @event FooTable.Filtering#"preinit.ft.filtering" 32945 * @param {jQuery.Event} e - The jQuery.Event object for the event. 32946 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 32947 * @param {object} data - The jQuery data object of the table raising the event. 32948 */ 32949 this.ft.raise('preinit.ft.filtering').then(function(){ 32950 // first check if filtering is enabled via the class being applied 32951 if (self.ft.$el.hasClass('footable-filtering')) 32952 self.enabled = true; 32953 // then check if the data-filtering-enabled attribute has been set 32954 self.enabled = F.is.boolean(data.filtering) 32955 ? data.filtering 32956 : self.enabled; 32957 32958 // if filtering is not enabled exit early as we don't need to do anything else 32959 if (!self.enabled) return; 32960 32961 self.space = F.is.string(data.filterSpace) 32962 ? data.filterSpace 32963 : self.space; 32964 32965 self.min = F.is.number(data.filterMin) 32966 ? data.filterMin 32967 : self.min; 32968 32969 self.connectors = F.is.boolean(data.filterConnectors) 32970 ? data.filterConnectors 32971 : self.connectors; 32972 32973 self.delay = F.is.number(data.filterDelay) 32974 ? data.filterDelay 32975 : self.delay; 32976 32977 self.placeholder = F.is.string(data.filterPlaceholder) 32978 ? data.filterPlaceholder 32979 : self.placeholder; 32980 32981 self.filters = F.is.array(data.filterFilters) 32982 ? self.ensure(data.filterFilters) 32983 : self.ensure(self.filters); 32984 32985 if (self.ft.$el.hasClass('footable-filtering-left')) 32986 self.position = 'left'; 32987 if (self.ft.$el.hasClass('footable-filtering-center')) 32988 self.position = 'center'; 32989 if (self.ft.$el.hasClass('footable-filtering-right')) 32990 self.position = 'right'; 32991 32992 self.position = F.is.string(data.filterPosition) 32993 ? data.filterPosition 32994 : self.position; 32995 },function(){ 32996 self.enabled = false;
32997 }); 32998 }, 32999 /** 33000 * Initializes the filtering component for the plugin. 33001 * @instance 33002 * @protected 33003 * @fires FooTable.Filtering#"init.ft.filtering" 33004 */ 33005 init: function () { 33006 var self = this; 33007 /** 33008 * The init.ft.filtering event is raised before its UI is generated. 33009 * Calling preventDefault on this event will disable the component. 33010 * @event FooTable.Filtering#"init.ft.filtering" 33011 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33012 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33013 */ 33014 this.ft.raise('init.ft.filtering').then(function(){ 33015 self.$create(); 33016 }, function(){ 33017 self.enabled = false; 33018 }); 33019 }, 33020 /** 33021 * Destroys the filtering component removing any UI from the table. 33022 * @instance 33023 * @protected 33024 * @fires FooTable.Filtering#"destroy.ft.filtering" 33025 */ 33026 destroy: function () { 33027 /** 33028 * The destroy.ft.filtering event is raised before its UI is removed. 33029 * Calling preventDefault on this event will prevent the component from being destroyed. 33030 * @event FooTable.Filtering#"destroy.ft.filtering" 33031 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33032 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33033 */ 33034 var self = this; 33035 this.ft.raise('destroy.ft.filtering').then(function(){ 33036 self.ft.$el.removeClass('footable-filtering') 33037 .find('thead > tr.footable-filtering').remove(); 33038 }); 33039 }, 33040 /** 33041 * Creates the filtering UI from the current options setting the various jQuery properties of this component. 33042 * @instance 33043 * @protected 33044 * @this FooTable.Filtering 33045 */ 33046 $create: function () { 33047 var self = this; 33048 // generate the cell that actually contains all the UI. 33049 var $form_grp = $('<div/>', {'class': 'form-group'}) 33050 .append($('<label/>', {'class': 'sr-only', text: 'Search'})), 33051 $input_grp = $('<div/>', {'class': 'input-group'}).appendTo($form_grp), 33052 $input_grp_btn = $('<div/>', {'class': 'input-group-btn'}), 33053 $dropdown_toggle = $('<button/>', {type: 'button', 'class': 'btn btn-default dropdown-toggle'}) 33054 .on('click', { self: self }, self._onDropdownToggleClicked) 33055 .append($('<span/>', {'class': 'caret'})), 33056 position; 33057 33058 switch (self.position){ 33059 case 'left': position = 'footable-filtering-left'; break; 33060 case 'center': position = 'footable-filtering-center'; break; 33061 default: position = 'footable-filtering-right'; break; 33062 } 33063 self.ft.$el.addClass('footable-filtering').addClass(position); 33064 33065 // add it to a row and then populate it with the search input and column selector dropdown. 33066 self.$row = $('<tr/>', {'class': 'footable-filtering'}).prependTo(self.ft.$el.children('thead')); 33067 self.$cell = $('<th/>').attr('colspan', self.ft.columns.visibleColspan).appendTo(self.$row); 33068 self.$form = $('<form/>', {'class': 'form-inline'}).append($form_grp).appendTo(self.$cell); 33069 33070 self.$input = $('<input/>', {type: 'text', 'class': 'form-control', placeholder: self.placeholder}); 33071 33072 self.$button = $('<button/>', {type: 'button', 'class': 'btn btn-primary'}) 33073 .on('click', { self: self }, self._onSearchButtonClicked) 33074 .append($('<span/>', {'class': 'fooicon fooicon-search'})); 33075 33076 self.$dropdown = $('<ul/>', {'class': 'dropdown-menu dropdown-menu-right'}).append( 33077 F.arr.map(self.ft.columns.array, function (col) { 33078 return col.filterable ? $('<li/>').append( 33079 $('<a/>', {'class': 'checkbox'}).append( 33080 $('<label/>', {text: col.title}).prepend( 33081 $('<input/>', {type: 'checkbox', checked: true}).data('__FooTableColumn__', col) 33082 ) 33083 ) 33084 ) : null; 33085 }) 33086 ); 33087 33088 if (self.delay > 0){ 33089 self.$input.on('keypress keyup', { self: self }, self._onSearchInputChanged); 33090 self.$dropdown.on('click', 'input[type="checkbox"]', {self: self}, self._onSearchColumnClicked); 33091 } 33092 33093 $input_grp_btn.append(self.$button, $dropdown_toggle, self.$dropdown); 33094 $input_grp.append(self.$input, $input_grp_btn); 33095 }, 33096 /** 33097 * Performs the filtering of rows before they are appended to the page. 33098 * @instance 33099 * @protected 33100 */ 33101 predraw: function(){ 33102 if (F.is.emptyArray(this.filters)) 33103 return; 33104 33105 var self = this; 33106 self.ft.rows.array = $.grep(self.ft.rows.array, function(r){ 33107 return r.filtered(self.filters); 33108 }); 33109 }, 33110 /** 33111 * As the rows are drawn by the {@link FooTable.Rows#draw}
33111 method this simply updates the colspan for the UI. 33112 * @instance 33113 * @protected 33114 */ 33115 draw: function(){ 33116 this.$cell.attr('colspan', this.ft.columns.visibleColspan); 33117 }, 33118 33119 /* PUBLIC */ 33120 /** 33121 * Adds or updates the filter using the supplied name, query and columns. 33122 * @param {string} name - The name for the filter. 33123 * @param {(string|FooTable.Query)} query - The query for the filter. 33124 * @param {(Array.<number>|Array.<string>|Array.<FooTable.Column>)} columns - The columns to apply the filter to. 33125 */ 33126 addFilter: function(name, query, columns){ 33127 var f = F.arr.first(this.filters, function(f){ return f.name == name; }); 33128 if (f instanceof F.Filter){ 33129 f.name = name; 33130 f.query = query; 33131 f.columns = columns; 33132 } else { 33133 this.filters.push({name: name, query: query, columns: columns}); 33134 } 33135 }, 33136 /** 33137 * Removes the filter using the supplied name if it exists. 33138 * @param {string} name - The name of the filter to remove. 33139 */ 33140 removeFilter: function(name){ 33141 F.arr.remove(this.filters, function(f){ return f.name == name; }); 33142 }, 33143 /** 33144 * Creates a new search filter from the supplied parameters and applies it to the rows. If no parameters are supplied the current search input value 33145 * and selected columns are used to create or update the search filter. If there is no search input value then the search filter is removed. 33146 * @instance 33147 * @param {string} [query] - The query to filter the rows by. 33148 * @param {(Array.<string>|Array.<number>|Array.<FooTable.Column>)} [columns] - The columns to apply the filter to in each row. 33149 * @returns {jQuery.Promise} 33150 * @fires FooTable.Filtering#"before.ft.filtering" 33151 * @fires FooTable.Filtering#"after.ft.filtering" 33152 */ 33153 filter: function(query, columns){ 33154 if (F.is.undef(query)){ 33155 query = $.trim(this.$input.val() || ''); 33156 } else { 33157 this.$input.val(query); 33158 } 33159 if (!F.is.emptyString(query)) { 33160 this.addFilter('search', query, columns); 33161 } else { 33162 this.removeFilter('search'); 33163 } 33164 this.$button.children('.fooicon').removeClass('fooicon-search').addClass('fooicon-remove'); 33165 return this._filter(); 33166 }, 33167 /** 33168 * Removes the current search filter. 33169 * @instance 33170 * @returns {jQuery.Promise} 33171 * @fires FooTable.Filtering#"before.ft.filtering" 33172 * @fires FooTable.Filtering#"after.ft.filtering" 33173 */ 33174 clear: function(){ 33175 this.$button.children('.fooicon').removeClass('fooicon-remove').addClass('fooicon-search'); 33176 this.$input.val(null); 33177 this.removeFilter('search'); 33178 return this._filter(); 33179 }, 33180 /** 33181 * Gets an array of {@link FooTable.Column} to apply the search filter to. This also doubles as the default columns for filters which do not specify any columns. 33182 * @instance 33183 * @returns {Array.<FooTable.Column>} 33184 */ 33185 columns: function(){ 33186 if (F.is.jq(this.$dropdown)){ 33187 // if we have a dropdown containing the column names get the selected columns from there 33188 return this.$dropdown.find('input:checked').map(function(){ 33189 return $(this).data('__FooTableColumn__'); 33190 }).get(); 33191 } else { 33192 // otherwise find all columns that are set to be filterable. 33193 return this.ft.columns.get(function(c){ return c.filterable; }); 33194 } 33195 }, 33196 /** 33197 * Takes an array of plain objects containing the filter values or actual {@link FooTable.Filter} objects and ensures that an array of only {@link FooTable.Filter} is returned. 33198 * If supplied a plain object that object must contain a name, query and columns properties which are used to create a new {@link FooTable.Filter}. 33199 * @instance 33200 * @param {({name: string, query: (string|FooTable.Query), columns: (Array.<string>|Array.<number>|Array.<FooTable.Column>)}|Array.<FooTable.Filter>)} filters - The array of filters to check. 33201 * @returns {Array.<FooTable.Filter>} 33202 */ 33203 ensure: function(filters){ 33204 var self = this, parsed = [], filterable = self.columns(); 33205 if (!F.is.emptyArray(filters)){ 33206 F.arr.each(filters, function(f){ 33207 if (F.is.object(f) && (!F.is.emptyString(f.query) || f.query instanceof F.Query)) { 33208 f.name = F.is.emptyString(f.name) ? 'anon' : f.name; 33209 f.columns = F.is.emptyArray(f.columns) ? filterable : self.ft.columns.ensure(f.columns); 33210 parsed.push(f instanceof F.Filter ? f : new F.Filter(f.name, f.query, f.columns, self.space, self.connectors)); 33211 } 33212 }); 33213 } 33214 return parsed; 33215 }, 33216 33217 /* PRIVATE */ 33218 /** 33219 * Performs the required steps to handle filtering including the raising of the {@link FooTable.Filtering#"before.ft.filtering"} and {@link FooTable.Filtering#"after.ft.filtering"} events. 33220 * @instance 33221 * @private 33222 * @returns {jQuery.Promise} 33223 * @fires FooTable.Filtering#"before.ft.filtering" 33224 * @fires FooTable.Filtering#"after.ft.filtering" 33225 */ 33226 _filter: function(){ 33227 var self = this; 33228 self.filters = self.ensure(self.filters); 33229 /** 33230 * The before.ft.filtering event is raised before a filter is applied and allows listeners to modify the filter or cancel it completely by calling preventDefault on the jQuery.Event object. 33231 * @event FooTable.Filtering#"before.ft.filtering" 33232 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33233 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33234 * @param {Array.<FooTable.Filter>} filters - The filters that are about to be applied. 33235 */ 33236 return self.ft.raise('before.ft.filtering', [self.filters]).then(function(){ 33237 self.filters = self.ensure(self.filters); 33238 return self.ft.draw().then(function(){ 33239 /** 33240 * The after.ft.filtering event is raised after a filter has been applied. 33241 * @event FooTable.Filtering#"after.ft.filtering" 33242 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33243 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33244 * @param {FooTable.Filter} filter - The filters that were applied. 33245 */ 33246 self.ft.raise('after.ft.filtering', [self.filters]); 33247 }); 33248 }); 33249 }, 33250 /** 33251 * Handles the change event for the {@link FooTable.Filtering#$input}. 33252 * @instance 33253 * @private 33254 * @param {jQuery.Event} e - The event object for the event. 33255 */ 33256 _onSearchInputChanged: function (e) { 33257 var self = e.data.self; 33258 var alpha = e.type == 'keypress' && !F.is.emptyString(String.fromCharCode(e.charCode)), 33259 ctrl = e.type == 'keyup' && (e.which == 8 || e.which == 46); // backspace & delete 33260 33261 // if alphanumeric characters or specific control characters 33262 if(alpha || ctrl) { 33263 if (e.which == 13) e.preventDefault(); 33264 if (self._filterTimeout != null) clearTimeout(self._filterTimeout); 33265 self._filterTimeout = setTimeout(function(){ 33266 self._filterTimeout = null; 33267 self.filter(); 33268 }, self.delay); 33269 } 33270 }, 33271 /** 33272 * Handles the click event for the {@link FooTable.Filtering#$button}. 33273 * @instance 33274 * @private 33275 * @param {jQuery.Event} e - The event object for the event. 33276 */ 33277 _onSearchButtonClicked: function (e) { 33278 e.preventDefault(); 33279 var self = e.data.self; 33280 if (self._filterTimeout != null) clearTimeout(self._filterTimeout); 33281 var $icon = self.$button.children('.fooicon'); 33282 if ($icon.hasClass('fooicon-remove')) self.clear(); 33283 else self.filter(); 33284 }, 33285 /** 33286 * Handles the click event for the column checkboxes in the {@link FooTable.Filtering#$dropdown}. 33287 * @instance 33288 * @private 33289 * @param {jQuery.Event} e - The event object for the event. 33290 */ 33291 _onSearchColumnClicked: function (e) { 33292 var self = e.data.self; 33293 if (self._filterTimeout != null) clearTimeout(self._filterTimeout); 33294 self._filterTimeout = setTimeout(function(){ 33295 self._filterTimeout = null; 33296 var $icon = self.$button.children('.fooicon'); 33297 if ($icon.hasClass('fooicon-remove')){ 33298 $icon.removeClass('fooicon-remove').addClass('fooicon-search'); 33299 self.filter(); 33300 } 33301 }, self.delay); 33302 }, 33303 /** 33304 * Handles the click event for the {@link FooTable.Filtering#$dropdown} toggle. 33305 * @instance 33306 * @private 33307 * @param {jQuery.Event} e - The event object for the event. 33308 */ 33309 _onDropdownToggleClicked: function (e) { 33310 e.preventDefault(); 33311 e.stopPropagation(); 33312 var self = e.data.self; 33313 self.$dropdown.parent().toggleClass('open'); 33314 if (self.$dropdown.parent().hasClass('open')) $(document).on('click.footable', { self: self }, self._onDocumentClicked); 33315 else $(document).off('click.footable', self._onDocumentClicked); 33316 }, 33317 /** 33318 * Checks all click events when the dropdown is visible and closes the menu if the target is not the dropdown. 33319 * @instance 33320 * @private 33321 * @param {jQuery.Event} e - The event object for the event. 33322 */ 33323 _onDocumentClicked: function(e){ 33324 if ($(e.target).closest('.dropdown-menu').length == 0){ 33325 e.preventDefault(); 33326 var self = e.data.self; 33327 self.$dropdown.parent().removeClass('open'); 33328 $(document).off('click.footable', self._onDocumentClicked); 33329 } 33330 } 33331 }); 33332
33333 F.components.core.register('filtering', F.Filtering, 10); 33334 33335})(jQuery, FooTable); 33336(function(F){ 33337 F.Query = F.Class.extend(/** @lends FooTable.Query */{ 33338 /** 33339 * The query object is used to parse and test the filtering component's queries 33340 * @constructs 33341 * @extends FooTable.Class 33342 * @param {string} query - The string value of the query. 33343 * @param {string} [space="AND"] - How the query treats whitespace. 33344 * @param {boolean} [connectors=true] - Whether or not to replace phrase connectors (+.-_) with spaces. 33345 * @returns {FooTable.Query} 33346 */ 33347 construct: function(query, space, connectors){ 33348 /* PRIVATE */ 33349 /** 33350 * Holds the previous value of the query and is used internally in the {@link FooTable.Query#val} method. 33351 * @type {string} 33352 * @private 33353 */ 33354 this._original = null; 33355 /** 33356 * Holds the value for the query. Access to this variable is provided through the {@link FooTable.Query#val} method. 33357 * @type {string} 33358 * @private 33359 */ 33360 this._value = null; 33361 /* PUBLIC */ 33362 /** 33363 * A string specifying how the query treats whitespace. Can be either "OR" or "AND". 33364 * @type {string} 33365 */ 33366 this.space = F.is.string(space) && (space == 'OR' || space == 'AND') ? space : 'AND'; 33367 /** 33368 * Whether or not to replace phrase connectors (+.-_) with spaces before executing the query. 33369 * @instance 33370 * @type {boolean} 33371 */ 33372 this.connectors = F.is.boolean(connectors) ? connectors : true; 33373 /** 33374 * The left side of the query if one exists. OR takes precedence over AND. 33375 * @type {FooTable.Query} 33376 * @example <caption>The below shows what is meant by the "left" side of a query</caption> 33377 * query = "Dave AND Mary" - "Dave" is the left side of the query. 33378 * query = "Dave AND Mary OR John" - "Dave and Mary" is the left side of the query. 33379 */ 33380 this.left = null; 33381 /** 33382 * The right side of the query if one exists. OR takes precedence over AND. 33383 * @type {FooTable.Query} 33384 * @example <caption>The below shows what is meant by the "right" side of a query</caption> 33385 * query = "Dave AND Mary" - "Mary" is the right side of the query. 33386 * query = "Dave AND Mary OR John" - "John" is the right side of the query. 33387 */ 33388 this.right = null; 33389 /** 33390 * The parsed parts of the query. This contains the information used to actually perform a match against a string. 33391 * @type {Array} 33392 */ 33393 this.parts = []; 33394 /** 33395 * The type of operand to apply to the results of the individual parts of the query. 33396 * @type {string} 33397 */ 33398 this.operator = null; 33399 this.val(query); 33400 }, 33401 /** 33402 * Gets or sets the value for the query. During set the value is parsed setting all properties as required. 33403 * @param {string} [value] - If supplied the value to set for this query. 33404 * @returns {(string|undefined)} 33405 */ 33406 val: function(value){ 33407 // get 33408 if (F.is.emptyString(value)) return this._value; 33409 33410 // set 33411 if (F.is.emptyString(this._original)) this._original = value; 33412 else if (this._original == value) return; 33413 33414 this._value = value; 33415 this._parse(); 33416 }, 33417 /** 33418 * Tests the supplied string against the query. 33419 * @param {string} str - The string to test. 33420 * @returns {boolean} 33421 */ 33422 match: function(str){ 33423 if (F.is.emptyString(this.operator) || this.operator === 'OR') 33424 return this._left(str, false) || this._match(str, false) || this._right(str, false); 33425 if (this.operator === 'AND') 33426 return this._left(str, true) && this._match(str, true) && this._right(str, true); 33427 }, 33428 /** 33429 * Matches this queries parts array against the supplied string. 33430 * @param {string} str - The string to test. 33431 * @param {boolean} def - The default value to return based on the operand. 33432 * @returns {boolean} 33433 * @private 33434 */ 33435 _match: function(str, def){ 33436 var self = this, result = false;
33437 if (F.is.emptyArray(self.parts) && self.left instanceof F.Query) return def; 33438 if (F.is.emptyArray(self.parts)) return result; 33439 if (self.space === 'OR'){ 33440 // with OR we give the str every part to test and if any match it is a success, we do exit early if a negated match occurs 33441 F.arr.each(self.parts, function(p){ 33442 var match = F.str.contains(str, p.query, true); 33443 if (match && !p.negate) result = true; 33444 if (match && p.negate) { 33445 result = false; 33446 return result; 33447 } 33448 }); 33449 } else { 33450 // otherwise with AND we check until the first failure and then exit 33451 result = true; 33452 F.arr.each(self.parts, function(p){ 33453 var match = F.str.contains(str, p.query, true); 33454 if ((!match && !p.negate) || (match && p.negate)) result = false; 33455 return result; 33456 }); 33457 } 33458 return result; 33459 }, 33460 /** 33461 * Matches the left side of the query if one exists with the supplied string. 33462 * @param {string} str - The string to test. 33463 * @param {boolean} def - The default value to return based on the operand. 33464 * @returns {boolean} 33465 * @private 33466 */ 33467 _left: function(str, def){ 33468 return (this.left instanceof F.Query) ? this.left.match(str) : def; 33469 }, 33470 /** 33471 * Matches the right side of the query if one exists with the supplied string. 33472 * @param {string} str - The string to test. 33473 * @param {boolean} def - The default value to return based on the operand. 33474 * @returns {boolean} 33475 * @private 33476 */ 33477 _right: function(str, def){ 33478 return (this.right instanceof F.Query) ? this.right.match(str) : def; 33479 }, 33480 /** 33481 * Parses the private {@link FooTable.Query#_value} property and populates the object. 33482 * @private 33483 */ 33484 _parse: function(){ 33485 if (F.is.emptyString(this._value)) return; 33486 // OR takes precedence so test for it first 33487 if (/\sOR\s/.test(this._value)){ 33488 // we have an OR so split the value on the first occurrence of OR to get the left and right sides of the statement 33489 this.operator = 'OR'; 33490 var or = this._value.split(/(?:\sOR\s)(.*)?/); 33491 this.left = new F.Query(or[0], this.space, this.connectors); 33492 this.right = new F.Query(or[1], this.space, this.connectors); 33493 } else if (/\sAND\s/.test(this._value)) { 33494 // there are no more OR's so start with AND 33495 this.operator = 'AND'; 33496 var and = this._value.split(/(?:\sAND\s)(.*)?/); 33497 this.left = new F.Query(and[0], this.space, this.connectors); 33498 this.right = new F.Query(and[1], this.space, this.connectors); 33499 } else { 33500 // we have no more statements to parse so set the parts array by parsing each part of the remaining query 33501 var self = this; 33502 this.parts = F.arr.map(this._value.match(/(?:[^\s"]+|"[^"]*")+/g), function(str){ 33503 return self._part(str); 33504 }); 33505 } 33506 }, 33507 /** 33508 * Parses a single part of a query into an object to use during matching. 33509 * @param {string} str - The string representation of the part. 33510 * @returns {{query: string, negate: boolean, phrase: boolean, exact: boolean}} 33511 * @private 33512 */ 33513 _part: function(str){ 33514 var p = { 33515 query: str, 33516 negate: false, 33517 phrase: false, 33518 exact: false 33519 }; 33520 // support for NEGATE operand - (minus sign). Remove this first so we can get onto phrase checking 33521 if (F.str.startsWith(p.query, '-')){ 33522 p.query = F.str.from(p.query, '-'); 33523 p.negate = true; 33524 } 33525 // support for PHRASES (exact matches) 33526 if (/^"(.*?)"$/.test(p.query)){ // if surrounded in quotes strip them and nothing else 33527 p.query = p.query.replace(/^"(.*?)"$/, '$1'); 33528 p.phrase = true; 33529 p.exact = true; 33530 } else if (this.connectors && /(?:\w)+?([-_\+\.])(?:\w)+?/.test(p.query)) { // otherwise replace supported phrase connectors (-_+.) with spaces 33531 p.query = p.query.replace(/(?:\w)+?([-_\+\.])(?:\w)+?/g, function(match, p1){ 33532 return match.replace(p1, ' '); 33533 }); 33534 p.phrase = true; 33535 } 33536 return p; 33537 } 33538 }); 33539 33540})(FooTable); 33541(function(F){ 33542 33543 /** 33544 * The value used by the filtering component during filter operations. Must be a string and can be set using the data-filter-value attribute on the cell itself. 33545 * If this is not supplied it is set to the result of the toString method called on the value for the cell. Added by the {@link FooTable.Filtering} component. 33546 * @type {string} 33547 * @default null 33548 */ 33549 F.Cell.prototype.filterValue = null; 33550 33551 // this is used to define the filtering specific properties on cell creation 33552 F.Cell.prototype.__filtering_define__ = function(valueOrElement){ 33553 this.filterValue = this.column.filterValue.call(this.column, valueOrElement); 33554 }; 33555 33556 // this is used to update the filterValue property whenever the cell value is changed 33557 F.Cell.prototype.__filtering_val__ = function(value){ 33558 if (F.is.defined(value)){ 33559 // set only 33560 this.filterValue = this.column.filterValue.call(this.column, value); 33561 } 33562 }; 33563 33564 // overrides the public define method and replaces it with our own 33565 F.Cell.extend('define', function(valueOrElement){ 33566 this._super(valueOrElement); 33567 this.__filtering_define__(valueOrElement); 33568 }); 33569 // overrides the public val method and replaces it with our own 33570 F.Cell.extend('val', function(value){ 33571 var val = this._super(value); 33572 this.__filtering_val__(value); 33573 return val; 33574 }); 33575})(FooTable); 33576(function($, F){ 33577 /** 33578 * Whether or not the column can be used during filtering. Added by the {@link FooTable.Filtering} component. 33579 * @type {boolean} 33580 * @default true 33581 */ 33582 F.Column.prototype.filterable = true; 33583 33584 /** 33585 * This is supplied either the cell value or jQuery object to parse. A str
33585ing value must be returned from this method and will be used during filtering operations. 33586 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 33587 * @returns {string} 33588 * @this FooTable.Column 33589 */ 33590 F.Column.prototype.filterValue = function(valueOrElement){ 33591 // if we have an element or a jQuery object use jQuery to get the value 33592 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)) return $(valueOrElement).data('filterValue') || $(valueOrElement).text(); 33593 // if options are supplied with the value 33594 if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){ 33595 if (F.is.string(valueOrElement.options.filterValue)) return valueOrElement.options.filterValue; 33596 if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value; 33597 } 33598 if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement+''; // use the native toString of the value 33599 return ''; // otherwise we have no value so return an empty string 33600 }; 33601 33602 // this is used to define the filtering specific properties on column creation 33603 F.Column.prototype.__filtering_define__ = function(definition){ 33604 this.filterable = F.is.boolean(definition.filterable) ? definition.filterable : this.filterable; 33605 }; 33606 33607 // overrides the public define method and replaces it with our own 33608 F.Column.extend('define', function(definition){ 33609 this._super(definition); // call the base so we don't have to redefine any previously set properties 33610 this.__filtering_define__(definition); // then call our own 33611 }); 33612})(jQuery, FooTable); 33613(function(F){ 33614 /** 33615 * An object containing the filtering options for the plugin. Added by the {@link FooTable.Filtering} component. 33616 * @type {object} 33617 * @prop {boolean} enabled=false - Whether or not to allow filtering on the table. 33618 * @prop {({name: string, query: (string|FooTable.Query), columns: (Array.<string>|Array.<number>|Array.<FooTable.Column>)}|Array.<FooTable.Filter>)} filters - The filters to apply to the current {@link FooTable.Rows#array}. 33619 * @prop {number} delay=1200 - The delay in milliseconds before the query is auto applied after a change (any value equal to or less than zero will disable this). 33620 * @prop {number} min=3 - The minimum number of characters allowed in the search input before it is auto applied. 33621 * @prop {string} space="AND" - Specifies how whitespace in a filter query is handled. 33622 * @prop {string} placeholder="Search" - The string used as the placeholder for the search input. 33623 * @prop {string} position="right" - The string used to specify the alignment of the search input. 33624 * @prop {string} connectors=true - Whether or not to replace phrase connectors (+.-_) with space before executing the query. 33625 */ 33626 F.Defaults.prototype.filtering = { 33627 enabled: false, 33628 filters: [], 33629 delay: 1200, 33630 min: 3, 33631 space: 'AND', 33632 placeholder: 'Search', 33633 position: 'right', 33634 connectors: true 33635 }; 33636})(FooTable); 33637(function(F){ 33638 /** 33639 * Checks if the row is filtered using the supplied filters. 33640 * @this FooTable.Row 33641 * @param {Array.<FooTable.Filter>} filters - The filters to apply. 33642 * @returns {boolean} 33643 */ 33644 F.Row.prototype.filtered = function(filters){ 33645 var result = true, self = this; 33646 F.arr.each(filters, function(f){ 33647 if ((result = f.matchRow(self)) == false) return false; 33648 }); 33649 return result; 33650 }; 33651})(FooTable); 33652(function(F){ 33653 /** 33654 * Filter the table using the supplied query and columns. Added by the {@link FooTable.Filtering} component. 33655 * @instance 33656 * @param {string} query - The query to filter the rows by. 33657 * @param {(Array.<string>|Array.<number>|Array.<FooTable.Column>)} [columns] - The columns to apply the filter to in each row. 33658 * @returns {jQuery.Promise} 33659 * @fires FooTable.Filtering#before.ft.filtering 33660 * @fires FooTable.Filtering#after.ft.filtering 33661 * @see FooTable.Filtering#filter 33662 */ 33663 F.Table.prototype.applyFilter = function(query, columns){ 33664 return this.use(F.Filtering).filter(query, columns); 33665 }; 33666 33667 /** 33668 * Clear the current filter from the table. Added by the {@link FooTable.Filtering} component. 33669 * @instance 33670 * @returns {jQuery.Promise} 33671 * @fires FooTable.Filtering#before.ft.filtering 33672 * @fires FooTable.Filtering#after.ft.filtering 33673 * @see FooTable.Filtering#clear 33674 */ 33675 F.Table.prototype.clearFilter = function(){ 33676 return this.use(F.Filtering).clear(); 33677 }; 33678})(FooTable); 33679(function($, F){ 33680 33681 F.Sorter = F.Class.extend(/** @lends FooTable.Sorter */{ 33682 /**
33683 * The sorter object contains the column and direction to sort by. 33684 * @constructs 33685 * @extends FooTable.Class 33686 * @param {FooTable.Column} column - The column to sort. 33687 * @param {string} direction - The direction to sort by. 33688 * @returns {FooTable.Sorter} 33689 */ 33690 construct: function(column, direction){ 33691 /** 33692 * The column to sort. 33693 * @type {FooTable.Column} 33694 */ 33695 this.column = column; 33696 /** 33697 * The direction to sort by. 33698 * @type {string} 33699 */ 33700 this.direction = direction; 33701 } 33702 }); 33703 33704})(jQuery, FooTable); 33705(function ($, F) { 33706 F.Sorting = F.Component.extend(/** @lends FooTable.Sorting */{ 33707 /** 33708 * The sorting component adds a small sort button to specified column headers allowing users to sort those columns in the table. 33709 * @constructs 33710 * @extends FooTable.Component 33711 * @param {FooTable.Table} table - The parent {@link FooTable.Table} object for the component. 33712 * @returns {FooTable.Sorting} 33713 */ 33714 construct: function (table) { 33715 // call the constructor of the base class 33716 this._super(table, table.o.sorting.enabled); 33717 33718 /* PROTECTED */ 33719 /** 33720 * This provides a shortcut to the {@link FooTable.Table#options}.[sorting]{@link FooTable.Defaults#sorting} object. 33721 * @instance 33722 * @protected 33723 * @type {object} 33724 */ 33725 this.o = table.o.sorting; 33726 /** 33727 * The current sorted column. 33728 * @instance 33729 * @type {FooTable.Column} 33730 */ 33731 this.column = null; 33732 /** 33733 * Whether or not to allow sorting to occur, should be set using the {@link FooTable.Sorting#toggleAllowed} method. 33734 * @instance 33735 * @type {boolean} 33736 */ 33737 this.allowed = true; 33738 /** 33739 * The initial sort state of the table, this value is used for determining if the sorting has occurred or to reset the state to default. 33740 * @instance 33741 * @type {{isset: boolean, rows: Array.<FooTable.Row>, column: string, direction: ?string}} 33742 */ 33743 this.initial = null; 33744 }, 33745 33746 /* PROTECTED */ 33747 /** 33748 * Checks the supplied data and options for the sorting component. 33749 * @instance 33750 * @protected 33751 * @param {object} data - The jQuery data object from the parent table. 33752 * @fires FooTable.Sorting#"preinit.ft.sorting" 33753 * @this FooTable.Sorting 33754 */ 33755 preinit: function(data){ 33756 var self = this; 33757 /** 33758 * The preinit.ft.sorting event is raised before the UI is created and provides the tables jQuery data object for additional options parsing. 33759 * Calling preventDefault on this event will disable the component. 33760 * @event FooTable.Sorting#"preinit.ft.sorting" 33761 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33762 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33763 * @param {object} data - The jQuery data object of the table raising the event. 33764 */ 33765 this.ft.raise('preinit.ft.sorting', [data]).then(function(){ 33766 if (self.ft.$el.hasClass('footable-sorting')) 33767 self.enabled = true; 33768 self.enabled = F.is.boolean(data.sorting) 33769 ? data.sorting 33770 : self.enabled; 33771 if (!self.enabled) return; 33772 self.column = F.arr.first(self.ft.columns.array, function(col){ return col.sorted; }); 33773 }, function(){ 33774 self.enabled = false; 33775 }); 33776 }, 33777 /** 33778 * Initializes the sorting component for the plugin using the supplied table and options. 33779 * @instance 33780 * @protected 33781 * @fires FooTable.Sorting#"init.ft.sorting" 33782 * @this FooTable.Sorting 33783 */ 33784 init: function () { 33785 /** 33786 * The init.ft.sorting event is raised before its UI is generated. 33787 * Calling preventDefault on this event will disable the component. 33788 * @event FooTable.Sorting#"init.ft.sorting" 33789 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33790 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33791 */ 33792 var self = this; 33793 this.ft.raise('init.ft.sorting').then(function(){ 33794 if (!self.initial){ 33795 var isset = !!self.column; 33796 self.initial = { 33797 isset: isset, 33798 // grab a shallow copy of the rows array prior to sorting - allows us to reset without an initial sort 33799 rows: self.ft.rows.all.slice(0), 33800 // if there is a sorted column store its name and direction 33801 column: isset ? self.column.name : null, 33802 direction: isset ? self.column.direction : null 33803 } 33804 } 33805 F.arr.each(self.ft.columns.array, function(col){ 33806 if (col.sortable){ 33807 col.$el.addClass('footable-sortable').append($('<span/>', {'class': 'fooicon fooicon-sort'})); 33808 } 33809 }); 33810 self.ft.$el.on('click.footable', '.footable-sortable', { self: self }, self._onSortClicked); 33811 }, function(){ 33812 self.enabled = false;
33813 }); 33814 }, 33815 /** 33816 * Destroys the sorting component removing any UI generated from the table. 33817 * @instance 33818 * @protected 33819 * @fires FooTable.Sorting#"destroy.ft.sorting" 33820 */ 33821 destroy: function () { 33822 /** 33823 * The destroy.ft.sorting event is raised before its UI is removed. 33824 * Calling preventDefault on this event will prevent the component from being destroyed. 33825 * @event FooTable.Sorting#"destroy.ft.sorting" 33826 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33827 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33828 */ 33829 var self = this; 33830 this.ft.raise('destroy.ft.paging').then(function(){ 33831 self.ft.$el.off('click.footable', '.footable-sortable', self._onSortClicked); 33832 self.ft.$el.children('thead').children('tr.footable-header') 33833 .children('.footable-sortable').removeClass('footable-sortable') 33834 .find('span.fooicon').remove(); 33835 }); 33836 }, 33837 /** 33838 * Performs the actual sorting against the {@link FooTable.Rows#current} array. 33839 * @instance 33840 * @protected 33841 */ 33842 predraw: function () { 33843 if (!this.column) return; 33844 var self = this, col = self.column; 33845 self.ft.rows.array.sort(function (a, b) { 33846 return col.direction == 'DESC' 33847 ? col.sorter(b.cells[col.index].sortValue, a.cells[col.index].sortValue) 33848 : col.sorter(a.cells[col.index].sortValue, b.cells[col.index].sortValue); 33849 }); 33850 }, 33851 /** 33852 * Updates the sorting UI setting the state of the sort buttons. 33853 * @instance 33854 * @protected 33855 */ 33856 draw: function () { 33857 if (!this.column) return; 33858 var self = this, 33859 $sortable = self.ft.$el.find('thead > tr > .footable-sortable'), 33860 $active = self.column.$el; 33861 33862 $sortable.removeClass('footable-asc footable-desc').children('.fooicon').removeClass('fooicon-sort fooicon-sort-asc fooicon-sort-desc'); 33863 $sortable.not($active).children('.fooicon').addClass('fooicon-sort'); 33864 $active.addClass(self.column.direction == 'ASC' ? 'footable-asc' : 'footable-desc') 33865 .children('.fooicon').addClass(self.column.direction == 'ASC' ? 'fooicon-sort-asc' : 'fooicon-sort-desc'); 33866 }, 33867 33868 /* PUBLIC */ 33869 /** 33870 * Sets the sorting options and calls the {@link FooTable.Table#draw} method to perform the actual sorting. 33871 * @instance 33872 * @param {(string|number|FooTable.Column)} column - The column name, index or the actual {@link FooTable.Column} object to sort by. 33873 * @param {string} [direction="ASC"] - The direction to sort by, either ASC or DESC. 33874 * @returns {jQuery.Promise} 33875 * @fires FooTable.Sorting#"before.ft.sorting" 33876 * @fires FooTable.Sorting#"after.ft.sorting" 33877 */ 33878 sort: function(column, direction){ 33879 return this._sort(column, direction); 33880 }, 33881 /** 33882 * Toggles whether or not sorting is currently allowed. 33883 * @param {boolean} [state] - You can optionally specify the state you want it to be, if not supplied the current value is flipped. 33884 */ 33885 toggleAllowed: function(state){ 33886 state = F.is.boolean(state) ? state : !this.allowed; 33887 this.allowed = state; 33888 this.ft.$el.toggleClass('footable-sorting-disabled', !this.allowed); 33889 }, 33890 /** 33891 * Checks whether any sorting has occurred for the table. 33892 * @returns {boolean} 33893 */ 33894 hasChanged: function(){ 33895 return !(!this.initial || !this.column || 33896 (this.column.name === this.initial.column && 33897 (this.column.direction === this.initial.direction || (this.initial.direction === null && this.column.direction === 'ASC'))) 33898 ); 33899 }, 33900 /** 33901 * Resets the table sorting to the initial state recorded in the components init method. 33902 */ 33903 reset: function(){ 33904 if (!!this.initial){ 33905 if (this.initial.isset){ 33906 // if the initial value specified a column, sort by it 33907 this.sort(this.initial.column, this.initial.direction); 33908 } else { 33909 // if there was no initial column then we need to reset the rows to there original order 33910 if (!!this.column){ 33911 // if there is a currently sorted column remove the asc/desc classes and set it to null. 33912 this.column.$el.removeClass('footable-asc footable-desc'); 33913 this.column = null; 33914 } 33915 // replace the current all rows array with the one stored in the initial value 33916 this.ft.rows.all = this.initial.rows; 33917 // force the table to redraw itself using the updated rows array 33918 this.ft.draw(); 33919 } 33920 } 33921 }, 33922 33923 /* PRIVATE */ 33924 /** 33925 * Performs the required steps to handle sorting including the raising of the {@link FooTable.Sorting#"before.ft.sorting"} and {@link FooTable.Sorting#"after.ft.sorting"} events. 33926 * @instance 33927 * @private 33928 * @param {(string|number|FooTable.Column)} column - The column name, index or the actual {@link FooTable.Column} object to sort by. 33929 * @param {string} [direction="ASC"] - The direction to sort by, either ASC or DESC. 33930 * @returns {jQuery.Promise} 33931 * @fires FooTable.Sorting#"before.ft.sorting" 33932 * @fires FooTable.Sorting#"after.ft.sorting" 33933 */ 33934 _sort: function(column, direction){ 33935 if (!this.allowed) return $.Deferred().reject('sorting disabled'); 33936 var self = this; 33937 var sorter = new F.Sorter(self.ft.columns.get(column), F.Sorting.dir(direction)); 33938 /** 33939 * The before.ft.sorting event is raised before a sort is applied and allows listeners to modify the sorter or cancel it completely by calling preventDefault on the jQuery.Event object. 33940 * @event FooTable.Sorting#"before.ft.sorting" 33941 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33942 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33943 * @param {FooTable.Sorter} sorter - The sorter that is about to be applied. 33944 */ 33945 return self.ft.raise('before.ft.sorting', [sorter]).then(function(){ 33946 F.arr.each(self.ft.columns.array, function(col){ 33947 if (col != self.column) col.direction = null; 33948 }); 33949 self.column = self.ft.columns.get(sorter.column); 33950 if (self.column) self.column.direction = F.Sorting.dir(sorter.direction); 33951 return self.ft.draw().then(function(){ 33952 /** 33953 * The after.ft.sorting event is raised after a sorter has been applied. 33954 * @event FooTable.Sorting#"after.ft.sorting" 33955 * @param {jQuery.Event} e - The jQuery.Event object for the event. 33956 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 33957 * @param {FooTable.Sorter} sorter - The sorter that has been applied. 33958 */ 33959 self.ft.raise('after.ft.sorting', [sorter]); 33960 }); 33961 }); 33962 }, 33963 /** 33964 * Handles the sort button clicked event. 33965 * @instance 33966 * @private 33967 * @param {jQuery.Event} e - The event object for the event. 33968 */ 33969 _onSortClicked: function (e) { 33970 e.preventDefault(); 33971 var self = e.data.self, $header = $(this).closest('th,td'), 33972 direction = $header.is('.footable-asc, .footable-desc') 33973 ? ($header.hasClass('footable-desc') ? 'ASC' : 'DESC') 33974 : 'ASC'; 33975 self._sort($header.index(), direction); 33976 } 33977 }); 33978 33979 /** 33980 * Checks the supplied string is a valid direction and if not returns ASC as default. 33981 * @static 33982 * @protected 33983 * @param {string} str - The string to check. 33984 */ 33985 F.Sorting.dir = function(str){ 33986 return F.is.string(str) && (str == 'ASC' || str == 'DESC') ? str : 'ASC'; 33987 }; 33988
33989 F.components.core.register('sorting', F.Sorting, 5); 33990 33991})(jQuery, FooTable); 33992(function(F){ 33993 33994 /** 33995 * The value used by the sorting component during sort operations. Can be set using the data-sort-value attribute on the cell itself. 33996 * If this is not supplied it is set to the result of the toString method called on the value for the cell. Added by the {@link FooTable.Sorting} component. 33997 * @type {string} 33998 * @default null 33999 */ 34000 F.Cell.prototype.sortValue = null; 34001 34002 // this is used to define the sorting specific properties on cell creation 34003 F.Cell.prototype.__sorting_define__ = function(valueOrElement){ 34004 this.sortValue = this.column.sortValue.call(this.column, valueOrElement); 34005 }; 34006 34007 // this is used to update the sortValue property whenever the cell value is changed 34008 F.Cell.prototype.__sorting_val__ = function(value){ 34009 if (F.is.defined(value)){ 34010 // set only 34011 this.sortValue = this.column.sortValue.call(this.column, value); 34012 } 34013 }; 34014 34015 // overrides the public define method and replaces it with our own 34016 F.Cell.extend('define', function(valueOrElement){ 34017 this._super(valueOrElement); 34018 this.__sorting_define__(valueOrElement); 34019 }); 34020 // overrides the public val method and replaces it with our own 34021 F.Cell.extend('val', function(value){ 34022 var val = this._super(value); 34023 this.__sorting_val__(value); 34024 return val; 34025 }); 34026})(FooTable); 34027(function($, F){ 34028 /** 34029 * The direction to sort if the {@link FooTable.Column#sorted} property is set to true. Can be "ASC", "DESC" or NULL. Added by the {@link FooTable.Sorting} component. 34030 * @type {string} 34031 * @default null 34032 */ 34033 F.Column.prototype.direction = null; 34034 /** 34035 * Whether or not the column can be sorted. Added by the {@link FooTable.Sorting} component. 34036 * @type {boolean} 34037 * @default true 34038 */ 34039 F.Column.prototype.sortable = true; 34040 /** 34041 * Whether or not the column is sorted. Added by the {@link FooTable.Sorting} component. 34042 * @type {boolean} 34043 * @default false 34044 */ 34045 F.Column.prototype.sorted = false; 34046 34047 /** 34048 * This is supplied two values from the column for a comparison to be made and the result returned. Added by the {@link FooTable.Sorting} component. 34049 * @param {*} a - The first value to be compared. 34050 * @param {*} b - The second value to compare to the first. 34051 * @returns {number} 34052 * @example <caption>This example shows using pseudo code what a sort function would look like.</caption> 34053 * "sorter": function(a, b){ 34054 * if (a is less than b by some ordering criterion) { 34055 * return -1; 34056 * } 34057 * if (a is greater than b by the ordering criterion) { 34058 * return 1; 34059 * } 34060 * // a must be equal to b 34061 * return 0; 34062 * } 34063 */ 34064 F.Column.prototype.sorter = function(a, b){ 34065 if (typeof a === 'string') a = a.toLowerCase(); 34066 if (typeof b === 'string') b = b.toLowerCase(); 34067 if (a === b) return 0; 34068 if (a < b) return -1; 34069 return 1; 34070 }; 34071 34072 /** 34073 * This is supplied either the cell value or jQuery object to parse. A value must be returned from this method and will be used during sorting operations. 34074 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 34075 * @returns {*} 34076 * @this FooTable.Column 34077 */ 34078 F.Column.prototype.sortValue = function(valueOrElement){ 34079 // if we have an element or a jQuery object use jQuery to get the value 34080 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)) return $(valueOrElement).data('sortValue') || this.parser(valueOrElement); 34081 // if options are supplied with the value 34082 if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){ 34083 if (F.is.string(valueOrElement.options.sortValue)) return valueOrElement.options.sortValue; 34084 if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value; 34085 } 34086 if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement; 34087 return null; 34088 }; 34089 34090 // this is used to define the sorting specific properties on column creation 34091 F.Column.prototype.__sorting_define__ = function(definition){ 34092 this.sorter = F.checkFnValue(this, definition.sorter, this.sorter); 34093 this.direction = F.is.type(definition.direction, 'string') ? F.Sorting.dir(definition.direction) : null;
34094 this.sortable = F.is.boolean(definition.sortable) ? definition.sortable : true; 34095 this.sorted = F.is.boolean(definition.sorted) ? definition.sorted : false; 34096 }; 34097 34098 // overrides the public define method and replaces it with our own 34099 F.Column.extend('define', function(definition){ 34100 this._super(definition); 34101 this.__sorting_define__(definition); 34102 }); 34103 34104})(jQuery, FooTable); 34105(function(F){ 34106 /** 34107 * An object containing the sorting options for the plugin. Added by the {@link FooTable.Sorting} component. 34108 * @type {object} 34109 * @prop {boolean} enabled=false - Whether or not to allow sorting on the table. 34110 */ 34111 F.Defaults.prototype.sorting = { 34112 enabled: false 34113 }; 34114})(FooTable); 34115(function($, F){ 34116 34117 F.HTMLColumn.extend('__sorting_define__', function(definition){ 34118 this._super(definition); 34119 this.sortUse = F.is.string(definition.sortUse) && $.inArray(definition.sortUse, ['html','text']) !== -1 ? definition.sortUse : 'html'; 34120 }); 34121 34122 /** 34123 * This is supplied either the cell value or jQuery object to parse. A value must be returned from this method and will be used during sorting operations. 34124 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 34125 * @returns {*} 34126 * @this FooTable.HTMLColumn 34127 */ 34128 F.HTMLColumn.prototype.sortValue = function(valueOrElement){ 34129 // if we have an element or a jQuery object use jQuery to get the data value or pass it off to the parser 34130 if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){ 34131 return $(valueOrElement).data('sortValue') || $.trim($(valueOrElement)[this.sortUse]()); 34132 } 34133 // if options are supplied with the value 34134 if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){ 34135 if (F.is.string(valueOrElement.options.sortValue)) return valueOrElement.options.sortValue; 34136 if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value; 34137 } 34138 if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement; 34139 return null; 34140 }; 34141 34142})(jQuery, FooTable); 34143(function(F){ 34144 /** 34145 * Sort the table using the specified column and direction. Added by the {@link FooTable.Sorting} component. 34146 * @instance 34147 * @param {(string|number|FooTable.Column)} column - The column name, index or the actual {@link FooTable.Column} object to sort by. 34148 * @param {string} [direction="ASC"] - The direction to sort by, either ASC or DESC. 34149 * @returns {jQuery.Promise} 34150 * @fires FooTable.Sorting#"change.ft.sorting" 34151 * @fires FooTable.Sorting#"changed.ft.sorting" 34152 * @see FooTable.Sorting#sort 34153 */ 34154 F.Table.prototype.sort = function(column, direction){ 34155 return this.use(F.Sorting).sort(column, direction); 34156 }; 34157})(FooTable); 34158(function($, F){ 34159 34160 F.Pager = F.Class.extend(/** @lends FooTable.Pager */{ 34161 /** 34162 * The pager object contains the page number and direction to page to. 34163 * @constructs 34164 * @extends FooTable.Class 34165 * @param {number} total - The total number of pages available. 34166 * @param {number} current - The current page number. 34167 * @param {number} size - The number of rows per page. 34168 * @param {number} page - The page number to goto. 34169 * @param {boolean} forward - A boolean indicating the direction of paging, TRUE = forward, FALSE = back. 34170 * @returns {FooTable.Pager} 34171 */ 34172 construct: function(total, current, size, page, forward){ 34173 /** 34174 * The total number of pages available. 34175 * @type {number} 34176 */ 34177 this.total = total; 34178 /** 34179 * The current page number. 34180 * @type {number} 34181 */ 34182 this.current = current; 34183 /** 34184 * The number of rows per page. 34185 * @type {number} 34186 */ 34187 this.size = size; 34188 /** 34189 * The page number to goto. 34190 * @type {number} 34191 */ 34192 this.page = page; 34193 /** 34194 * A boolean indicating the direction of paging, TRUE = forward, FALSE = back. 34195 * @type {boolean} 34196 */ 34197 this.forward = forward; 34198 } 34199 }); 34200 34201})(jQuery, FooTable); 34202(function($, F){ 34203 F.Paging = F.Component.extend(/** @lends FooTable.Paging */{ 34204 /** 34205 * The paging component adds a pagination control to the table allowing users to navigate table rows via pages. 34206 * @constructs 34207 * @extends FooTable.Component 34208 * @param {FooTable.Table} table - The parent {@link FooTable.Table} object for the component. 34209 * @returns {FooTable.Filtering} 34210 */ 34211 construct: function(table){ 34212 // call the base constructor 34213 this._super(table, table.o.paging.enabled); 34214 34215 /* PROTECTED */ 34216 /**
34217 * An object containing the strings used by the paging buttons. 34218 * @type {{ first: string, prev: string, next: string, last: string }} 34219 */ 34220 this.strings = table.o.paging.strings; 34221 34222 /* PUBLIC */ 34223 /** 34224 * The current page number to display. 34225 * @instance 34226 * @type {number} 34227 */ 34228 this.current = table.o.paging.current; 34229 /** 34230 * The number of rows to display per page. 34231 * @instance 34232 * @type {number} 34233 */ 34234 this.size = table.o.paging.size; 34235 /** 34236 * The maximum number of page links to display at once. 34237 * @type {number} 34238 */ 34239 this.limit = table.o.paging.limit; 34240 /** 34241 * The position of the pagination control within the paging rows cell. 34242 * @type {string} 34243 */ 34244 this.position = table.o.paging.position; 34245 /** 34246 * The format string used to generate the text displayed under the pagination control. 34247 * @type {string} 34248 */ 34249 this.countFormat = table.o.paging.countFormat; 34250 /** 34251 * The total number of pages. 34252 * @instance 34253 * @type {number} 34254 */ 34255 this.total = -1; 34256 /** 34257 * The jQuery row object that contains all the paging specific elements. 34258 * @instance 34259 * @type {jQuery} 34260 */ 34261 this.$row = null; 34262 /** 34263 * The jQuery cell object that contains the pagination control and total count. 34264 * @instance 34265 * @type {jQuery} 34266 */ 34267 this.$cell = null; 34268 /** 34269 * The jQuery object that contains the links for the pagination control. 34270 * @type {jQuery} 34271 */ 34272 this.$pagination = null; 34273 /** 34274 * The jQuery object that contains the row count. 34275 * @type {jQuery} 34276 */ 34277 this.$count = null; 34278 /** 34279 * Whether or not the pagination row is detached from the table. 34280 * @type {boolean} 34281 */ 34282 this.detached = false; 34283 34284 /* PRIVATE */ 34285 /** 34286 * A number indicating the previous page displayed. 34287 * @private 34288 * @type {number} 34289 */ 34290 this._previous = 1; 34291 /** 34292 * Used to hold the number of rows in the {@link FooTable.Rows#array} before paging is applied. 34293 * @type {number} 34294 * @private 34295 */ 34296 this._total = 0; 34297 }, 34298 34299 /* PROTECTED */ 34300 /** 34301 * Checks the supplied data and options for the paging component. 34302 * @instance 34303 * @protected 34304 * @param {object} data - The jQuery data object from the parent table. 34305 * @fires FooTable.Paging#"preinit.ft.paging" 34306 */ 34307 preinit: function(data){ 34308 var self = this; 34309 /** 34310 * The preinit.ft.paging event is raised before the UI is created and provides the tables jQuery data object for additional options parsing. 34311 * Calling preventDefault on this event will disable the component. 34312 * @event FooTable.Paging#"preinit.ft.paging" 34313 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34314 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34315 * @param {object} data - The jQuery data object of the table raising the event. 34316 */ 34317 this.ft.raise('preinit.ft.paging', [data]).then(function(){ 34318 if (self.ft.$el.hasClass('footable-paging')) 34319 self.enabled = true; 34320 self.enabled = F.is.boolean(data.paging) 34321 ? data.paging 34322 : self.enabled; 34323 34324 if (!self.enabled) return; 34325 34326 self.size = F.is.number(data.pagingSize) 34327 ? data.pagingSize 34328 : self.size; 34329 34330 self.current = F.is.number(data.pagingCurrent) 34331 ? data.pagingCurrent 34332 : self.current; 34333 34334 self.limit = F.is.number(data.pagingLimit) 34335 ? data.pagingLimit 34336 : self.limit; 34337 34338 if (self.ft.$el.hasClass('footable-paging-left')) 34339 self.position = 'left'; 34340 if (self.ft.$el.hasClass('footable-paging-center')) 34341 self.position = 'center'; 34342 if (self.ft.$el.hasClass('footable-paging-right')) 34343 self.position = 'right'; 34344 34345 self.position = F.is.string(data.pagingPosition) 34346 ? data.pagingPosition 34347 : self.position; 34348 34349 self.countFormat = F.is.string(data.pagingCountFormat) 34350 ? data.pagingCountFormat 34351 : self.countFormat; 34352 34353 self.total = Math.ceil(self.ft.rows.all.length / self.size); 34354 }, function(){ 34355 self.enabled = false; 34356 }); 34357 }, 34358 /** 34359 * Initializes the paging component for the plugin using the supplied table and options. 34360 * @instance 34361 * @protected 34362 * @fires FooTable.Paging#"init.ft.paging" 34363 */ 34364 init: function(){ 34365 /** 34366 * The init.ft.paging event is raised before its UI is generated. 34367 * Calling preventDefault on this event will disable the component. 34368 * @event FooTable.Paging#"init.ft.paging" 34369 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34370 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34371 */ 34372 var self = this; 34373 this.ft.raise('init.ft.paging').then(function(){ 34374 self.$create(); 34375 }, function(){ 34376 self.enabled = false;
34377 }); 34378 }, 34379 /** 34380 * Destroys the paging component removing any UI generated from the table. 34381 * @instance 34382 * @protected 34383 * @fires FooTable.Paging#"destroy.ft.paging" 34384 */ 34385 destroy: function () { 34386 /** 34387 * The destroy.ft.paging event is raised before its UI is removed. 34388 * Calling preventDefault on this event will prevent the component from being destroyed. 34389 * @event FooTable.Paging#"destroy.ft.paging" 34390 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34391 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34392 */ 34393 var self = this; 34394 this.ft.raise('destroy.ft.paging').then(function(){ 34395 self.ft.$el.removeClass('footable-paging') 34396 .find('tfoot > tr.footable-paging').remove(); 34397 self.detached = false; 34398 }); 34399 }, 34400 /** 34401 * Performs the actual paging against the {@link FooTable.Rows#current} array removing all rows that are not on the current visible page. 34402 * @instance 34403 * @protected 34404 */ 34405 predraw: function(){ 34406 this.total = Math.ceil(this.ft.rows.array.length / this.size); 34407 this.current = this.current > this.total ? this.total : (this.current < 1 ? 1 : this.current); 34408 if (this.ft.rows.array.length > this.size){ 34409 this.ft.rows.array = this.ft.rows.array.splice((this.current - 1) * this.size, this.size); 34410 } 34411 }, 34412 /** 34413 * Updates the paging UI setting the state of the pagination control. 34414 * @instance 34415 * @protected 34416 */ 34417 draw: function(){ 34418 if (this.total <= 1){ 34419 if (!this.detached){ 34420 this.$row.detach(); 34421 this.detached = true; 34422 } 34423 } else { 34424 if (this.detached){ 34425 var $tfoot = this.ft.$el.children('tfoot'); 34426 if ($tfoot.length == 0){ 34427 $tfoot = $('<tfoot/>'); 34428 this.ft.$el.append($tfoot); 34429 } 34430 this.$row.appendTo($tfoot); 34431 this.detached = false; 34432 } 34433 this.$cell.attr('colspan', this.ft.columns.visibleColspan); 34434 this._createLinks(); 34435 this._setVisible(this.current, this.current > this._previous); 34436 this._setNavigation(true); 34437 } 34438 }, 34439 /** 34440 * Creates the paging UI from the current options setting the various jQuery properties of this component. 34441 * @instance 34442 * @protected 34443 */ 34444 $create: function(){ 34445 var position = 'footable-paging-center'; 34446 switch (this.position){ 34447 case 'left': position = 'footable-paging-left'; break; 34448 case 'right': position = 'footable-paging-right'; break; 34449 } 34450 this.ft.$el.addClass('footable-paging').addClass(position); 34451 this.$cell = $('<td/>').attr('colspan', this.ft.columns.visibleColspan); 34452 var $tfoot = this.ft.$el.children('tfoot'); 34453 if ($tfoot.length == 0){ 34454 $tfoot = $('<tfoot/>'); 34455 this.ft.$el.append($tfoot); 34456 } 34457 this.$row = $('<tr/>', { 'class': 'footable-paging' }).append(this.$cell).appendTo($tfoot); 34458 this.$pagination = $('<ul/>', { 'class': 'pagination' }).on('click.footable', 'a.footable-page-link', { self: this }, this._onPageClicked); 34459 this.$count = $('<span/>', { 'class': 'label label-default' }); 34460 this.$cell.append(this.$pagination, $('<div/>', {'class': 'divider'}), this.$count); 34461 this.detached = false; 34462 this._createLinks(); 34463 }, 34464 34465 /* PUBLIC */ 34466 /** 34467 * Pages to the first page. 34468 * @instance 34469 * @returns {jQuery.Promise} 34470 * @fires FooTable.Paging#"before.ft.paging" 34471 * @fires FooTable.Paging#"after.ft.paging" 34472 */ 34473 first: function(){ 34474 return this._set(1); 34475 }, 34476 /** 34477 * Pages to the previous page. 34478 * @instance 34479 * @returns {jQuery.Promise} 34480 * @fires FooTable.Paging#"before.ft.paging" 34481 * @fires FooTable.Paging#"after.ft.paging" 34482 */ 34483 prev: function(){ 34484 return this._set(this.current - 1 > 0 ? this.current - 1 : 1); 34485 }, 34486 /** 34487 * Pages to the next page. 34488 * @instance 34489 * @returns {jQuery.Promise} 34490 * @fires FooTable.Paging#"before.ft.paging" 34491 * @fires FooTable.Paging#"after.ft.paging" 34492 */ 34493 next: function(){ 34494 return this._set(this.current + 1 < this.total ? this.current + 1 : this.total); 34495 }, 34496 /** 34497 * Pages to the last page. 34498 * @instance 34499 * @returns {jQuery.Promise} 34500 * @fires FooTable.Paging#"before.ft.paging" 34501 * @fires FooTable.Paging#"after.ft.paging" 34502 */ 34503 last: function(){ 34504 return this._set(this.total); 34505 }, 34506 /** 34507 * Pages to the specified page. 34508 * @instance 34509 * @param {number} page - The page number to go to. 34510 * @returns {jQuery.Promise} 34511 * @fires FooTable.Paging#"before.ft.paging" 34512 * @fires FooTable.Paging#"after.ft.paging" 34513 */ 34514 goto: function(page){ 34515 return this._set(page > this.total ? this.total : (page < 1 ? 1 : page)); 34516 }, 34517 /** 34518 * Shows the previous X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit option value. 34519 * @instance 34520 */ 34521 prevPages: function(){ 34522 var page = this.$pagination.children('li.footable-page.visible:first').data('page') - 1; 34523 this._setVisible(page, true); 34524 this._setNavigation(false); 34525 }, 34526 /** 34527 * Shows the next X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit option value. 34528 * @instance 34529 */ 34530 nextPages: function(){ 34531 var page = this.$pagination.children('li.footable-page.visible:last').data('page') + 1; 34532 this._setVisible(page, false); 34533 this._setNavigation(false); 34534 }, 34535 /** 34536 * Gets or sets the current page size 34537 * @instance 34538 * @param {number} [value] - The new page size to use. 34539 * @returns {(number|undefined)} 34540 */ 34541 pageSize: function(value){ 34542 if (!F.is.number(value)){ 34543 return this.size; 34544 } 34545 this.size = value;
34546 this.total = Math.ceil(this.ft.rows.all.length / this.size); 34547 if (F.is.jq(this.$row)) this.$row.remove(); 34548 this.$create(); 34549 this.ft.draw(); 34550 }, 34551 34552 /* PRIVATE */ 34553 /** 34554 * Performs the required steps to handle paging including the raising of the {@link FooTable.Paging#"before.ft.paging"} and {@link FooTable.Paging#"after.ft.paging"} events. 34555 * @instance 34556 * @private 34557 * @param {number} page - The page to set. 34558 * @returns {jQuery.Promise} 34559 * @fires FooTable.Paging#"before.ft.paging" 34560 * @fires FooTable.Paging#"after.ft.paging" 34561 */ 34562 _set: function(page){ 34563 var self = this, 34564 pager = new F.Pager(self.total, self.current, self.size, page, page > self.current); 34565 /** 34566 * The before.ft.paging event is raised before a sort is applied and allows listeners to modify the pager or cancel it completely by calling preventDefault on the jQuery.Event object. 34567 * @event FooTable.Paging#"before.ft.paging" 34568 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34569 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34570 * @param {FooTable.Pager} pager - The pager that is about to be applied. 34571 */ 34572 return self.ft.raise('before.ft.paging', [pager]).then(function(){ 34573 pager.page = pager.page > pager.total ? pager.total : pager.page; 34574 pager.page = pager.page < 1 ? 1 : pager.page; 34575 if (self.current == page) return $.when(); 34576 self._previous = self.current; 34577 self.current = pager.page; 34578 return self.ft.draw().then(function(){ 34579 /** 34580 * The after.ft.paging event is raised after a pager has been applied. 34581 * @event FooTable.Paging#"after.ft.paging" 34582 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34583 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34584 * @param {FooTable.Pager} pager - The pager that has been applied. 34585 */ 34586 self.ft.raise('after.ft.paging', [pager]); 34587 }); 34588 }); 34589 }, 34590 /** 34591 * Creates the pagination links using the current state of the plugin. If the total number of pages is the same as 34592 * the last time this function was executed it does nothing. 34593 * @instance 34594 * @private 34595 */ 34596 _createLinks: function(){ 34597 if (this._total === this.total) return; 34598 var self = this, 34599 multiple = self.total > 1, 34600 link = function(attr, html, klass){ 34601 return $('<li/>', { 34602 'class': klass 34603 }).attr('data-page', attr) 34604 .append($('<a/>', { 34605 'class': 'footable-page-link', 34606 href: '#' 34607 }).data('page', attr).html(html)); 34608 }; 34609 self.$pagination.empty(); 34610 if (multiple) { 34611 self.$pagination.append(link('first', self.strings.first, 'footable-page-nav')); 34612 self.$pagination.append(link('prev', self.strings.prev, 'footable-page-nav')); 34613 if (self.limit > 0 && self.limit < self.total){ 34614 self.$pagination.append(link('prev-limit', self.strings.prevPages, 'footable-page-nav')); 34615 } 34616 } 34617 for (var i = 0, $li; i < self.total; i++){ 34618 $li = link(i + 1, i + 1, 'footable-page'); 34619 self.$pagination.append($li); 34620 } 34621 if (multiple){ 34622 if (self.limit > 0 && self.limit < self.total){ 34623 self.$pagination.append(link('next-limit', self.strings.nextPages, 'footable-page-nav')); 34624 } 34625 self.$pagination.append(link('next', self.strings.next, 'footable-page-nav')); 34626 self.$pagination.append(link('last', self.strings.last, 'footable-page-nav')); 34627 } 34628 self._total = self.total; 34629 }, 34630 /** 34631 * Sets the state for the navigation links of the pagination control and optionally sets the active class state on the current page link. 34632 * @instance 34633 * @private 34634 * @param {boolean} active - Whether or not to set the active class state on the individual page links. 34635 */ 34636 _setNavigation: function(active){ 34637 if (this.current == 1) { 34638 this.$pagination.children('li[data-page="first"],li[data-page="prev"]').addClass('disabled'); 34639 } else { 34640 this.$pagination.children('li[data-page="first"],li[data-page="prev"]').removeClass('disabled'); 34641 } 34642 34643 if (this.current == this.total) { 34644 this.$pagination.children('li[data-page="next"],li[data-page="last"]').addClass('disabled'); 34645 } else { 34646 this.$pagination.children('li[data-page="next"],li[data-page="last"]').removeClass('disabled'); 34647 } 34648 34649 if ((this.$pagination.children('li.footable-page.visible:first').data('page') || 1) == 1) { 34650 this.$pagination.children('li[data-page="prev-limit"]').addClass('disabled'); 34651 } else { 34652 this.$pagination.children('li[data-page="prev-limit"]').removeClass('disabled'); 34653 } 34654 34655 if ((this.$pagination.children('li.footable-page.visible:last').data('page') || this.limit) == this.total) { 34656 this.$pagination.children('li[data-page="next-limit"]').addClass('disabled'); 34657 } else { 34658 this.$pagination.children('li[data-page="next-limit"]').removeClass('disabled'); 34659 } 34660 34661 if (this.limit > 0 && this.total < this.limit){ 34662 this.$pagination.children('li[data-page="prev-limit"],li[data-page="next-limit"]').hide(); 34663 } else { 34664 this.$pagination.children('li[data-page="prev-limit"],li[data-page="next-limit"]').show(); 34665 } 34666
34667 if (active){ 34668 this.$pagination.children('li.footable-page').removeClass('active').filter('li[data-page="' + this.current + '"]').addClass('active'); 34669 } 34670 }, 34671 /** 34672 * Sets the visible page using the supplied parameters. 34673 * @instance 34674 * @private 34675 * @param {number} page - The page to make visible. 34676 * @param {boolean} right - If set to true the supplied page will be the right most visible pagination link. 34677 */ 34678 _setVisible: function(page, right){ 34679 if (this.limit > 0 && this.total > this.limit){ 34680 if (!this.$pagination.children('li.footable-page[data-page="'+page+'"]').hasClass('visible')){ 34681 var start = 0, end = 0; 34682 if (right == true){ 34683 end = page > this.total ? this.total : page; 34684 start = end - this.limit; 34685 } else { 34686 start = page < 1 ? 0 : page - 1; 34687 end = start + this.limit; 34688 } 34689 if (start < 0){ 34690 start = 0; 34691 end = this.limit > this.total ? this.total : this.limit; 34692 } 34693 if (end > this.total){ 34694 end = this.total; 34695 start = this.total - this.limit < 0 ? 0 : this.total - this.limit; 34696 } 34697 this.$pagination.children('li.footable-page').removeClass('visible').slice(start, end).addClass('visible'); 34698 } 34699 } else { 34700 this.$pagination.children('li.footable-page').removeClass('visible').slice(0, this.total).addClass('visible'); 34701 } 34702 var first = (this.size * (page - 1)) + 1, 34703 last = this.size * page, 34704 totalRows = this.ft.rows.all.length; 34705 if (this.ft.rows.array.length == 0){ 34706 first = 0; 34707 last = 0; 34708 } else { 34709 last = last > totalRows ? totalRows : last; 34710 } 34711 this._setCount(page, this.total, first, last, totalRows); 34712 }, 34713 /** 34714 * Uses the countFormat option to generate the text using the supplied parameters. 34715 * @param {number} currentPage - The current page. 34716 * @param {number} totalPages - The total number of pages. 34717 * @param {number} pageFirst - The first row number of the current page. 34718 * @param {number} pageLast - The last row number of the current page. 34719 * @param {number} totalRows - The total number of rows. 34720 * @private 34721 */ 34722 _setCount: function(currentPage, totalPages, pageFirst, pageLast, totalRows){ 34723 this.$count.text(this.countFormat.replace(/\{CP}/g, currentPage) 34724 .replace(/\{TP}/g, totalPages) 34725 .replace(/\{PF}/g, pageFirst) 34726 .replace(/\{PL}/g, pageLast) 34727 .replace(/\{TR}/g, totalRows)); 34728 }, 34729 /** 34730 * Handles the click event for all links in the pagination control. 34731 * @instance 34732 * @private 34733 * @param {jQuery.Event} e - The event object for the event. 34734 */ 34735 _onPageClicked: function(e){ 34736 e.preventDefault(); 34737 if ($(e.target).closest('li').is('.active,.disabled')) return; 34738 34739 var self = e.data.self, page = $(this).data('page'); 34740 switch(page){ 34741 case 'first': self.first(); 34742 return; 34743 case 'prev': self.prev(); 34744 return; 34745 case 'next': self.next(); 34746 return; 34747 case 'last': self.last(); 34748 return; 34749 case 'prev-limit': self.prevPages(); 34750 return; 34751 case 'next-limit': self.nextPages(); 34752 return; 34753 default: self._set(page); 34754 return; 34755 } 34756 } 34757 }); 34758 34759 F.components.core.register('paging', F.Paging, 0); 34760 34761})(jQuery, FooTable); 34762(function(F){ 34763 /** 34764 * An object containing the paging options for the plugin. Added by the {@link FooTable.Paging} component. 34765 * @type {object} 34766 * @prop {boolean} enabled=false - Whether or not to allow paging on the table. 34767 * @prop {string} countFormat="{CP} of {TP}" - A string format used to generate the page count text. 34768 * @prop {number} current=1 - The page number to display. 34769 * @prop {number} limit=5 - The maximum number of page links to display at once. 34770 * @prop {string} position="center" - The string used to specify the alignment of the pagination control. 34771 * @prop {number} size=10 - The number of rows displayed per page. 34772 * @prop {object} strings - An object containing the strings used by the paging buttons. 34773 * @prop {string} strings.first="«" - The string used for the 'first' button. 34774 * @prop {string} strings.prev="‹" - The string used for the 'previous' button. 34775 * @prop {string} strings.next="›" - The string used for the 'next' button. 34776 * @prop {string} strings.last="»" - The string used for the 'last' button. 34777 * @prop {string} strings.prevPages="..." - The string used for the 'previous X pages' button. 34778 * @prop {string} strings.nextPages="..." - The string used for the 'next X pages' button. 34779 */ 34780 F.Defaults.prototype.paging = { 34781 enabled: false, 34782 countFormat: '{CP} of {TP}',
34783 current: 1, 34784 limit: 5, 34785 position: 'center', 34786 size: 10, 34787 strings: { 34788 first: '«', 34789 prev: '‹', 34790 next: '›', 34791 last: '»', 34792 prevPages: '...', 34793 nextPages: '...' 34794 } 34795 }; 34796})(FooTable); 34797(function(F){ 34798 /** 34799 * Navigates to the specified page number. Added by the {@link FooTable.Paging} component. 34800 * @instance 34801 * @param {number} num - The page number to go to. 34802 * @returns {jQuery.Promise} 34803 * @fires FooTable.Paging#paging_changing 34804 * @fires FooTable.Paging#paging_changed 34805 * @see FooTable.Paging#goto 34806 */ 34807 F.Table.prototype.gotoPage = function(num){ 34808 return this.use(F.Paging).goto(num); 34809 }; 34810 34811 /** 34812 * Navigates to the next page. Added by the {@link FooTable.Paging} component. 34813 * @instance 34814 * @returns {jQuery.Promise} 34815 * @fires FooTable.Paging#paging_changing 34816 * @fires FooTable.Paging#paging_changed 34817 * @see FooTable.Paging#next 34818 */ 34819 F.Table.prototype.nextPage = function(){ 34820 return this.use(F.Paging).next(); 34821 }; 34822 34823 /** 34824 * Navigates to the previous page. Added by the {@link FooTable.Paging} component. 34825 * @instance 34826 * @returns {jQuery.Promise} 34827 * @fires FooTable.Paging#paging_changing 34828 * @fires FooTable.Paging#paging_changed 34829 * @see FooTable.Paging#prev 34830 */ 34831 F.Table.prototype.prevPage = function(){ 34832 return this.use(F.Paging).prev(); 34833 }; 34834 34835 /** 34836 * Navigates to the first page. Added by the {@link FooTable.Paging} component. 34837 * @instance 34838 * @returns {jQuery.Promise} 34839 * @fires FooTable.Paging#paging_changing 34840 * @fires FooTable.Paging#paging_changed 34841 * @see FooTable.Paging#first 34842 */ 34843 F.Table.prototype.firstPage = function(){ 34844 return this.use(F.Paging).first(); 34845 }; 34846 34847 /** 34848 * Navigates to the last page. Added by the {@link FooTable.Paging} component. 34849 * @instance 34850 * @returns {jQuery.Promise} 34851 * @fires FooTable.Paging#paging_changing 34852 * @fires FooTable.Paging#paging_changed 34853 * @see FooTable.Paging#last 34854 */ 34855 F.Table.prototype.lastPage = function(){ 34856 return this.use(F.Paging).last(); 34857 }; 34858 34859 /** 34860 * Shows the next X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit.size option value. Added by the {@link FooTable.Paging} component. 34861 * @instance 34862 * @see FooTable.Paging#nextPages 34863 */ 34864 F.Table.prototype.nextPages = function(){ 34865 return this.use(F.Paging).nextPages(); 34866 }; 34867 34868 /** 34869 * Shows the previous X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit.size option value. Added by the {@link FooTable.Paging} component. 34870 * @instance 34871 * @see FooTable.Paging#prevPages 34872 */ 34873 F.Table.prototype.prevPages = function(){ 34874 return this.use(F.Paging).prevPages(); 34875 }; 34876 34877 /** 34878 * Gets or sets the current page size 34879 * @instance 34880 * @param {number} [value] - The new page size to use. 34881 * @returns {(number|undefined)} 34882 * @see FooTable.Paging#pageSize 34883 */ 34884 F.Table.prototype.pageSize = function(value){ 34885 return this.use(F.Paging).pageSize(value); 34886 }; 34887})(FooTable); 34888(function($, F){ 34889 34890 F.Editing = F.Component.extend(/** @lends FooTable.Editing */{ 34891 /** 34892 * The editing component adds a column with edit and delete buttons to each row as well as a single add row button in the footer. 34893 * @constructs 34894 * @extends FooTable.Component 34895 * @param {FooTable.Table} table - The parent {@link FooTable.Table} object for the component. 34896 * @returns {FooTable.Editing} 34897 */ 34898 construct: function(table){ 34899 // call the base constructor 34900 this._super(table, table.o.editing.enabled); 34901 34902 /** 34903 * Whether or not to automatically page to a new row when it is added to the table. 34904 * @type {boolean} 34905 */ 34906 this.pageToNew = table.o.editing.pageToNew; 34907 34908 /** 34909 * Whether or not the editing column and add row button are always visible. 34910 * @type {boolean} 34911 */ 34912 this.alwaysShow = table.o.editing.alwaysShow; 34913 34914 /** 34915 * The options for the editing column. @see {@link FooTable.EditingColumn} for more info. 34916 * @type {object} 34917 * @prop {string} classes="footable-editing" - A space separated string of class names to apply to all cells in the column. 34918 * @prop {string} name="editing" - The name of the column. 34919 * @prop {string} title="" - The title displayed in the header row of the table for the column. 34920 * @prop {boolean} filterable=false - Whether or not the column should be filterable when using the filtering component. 34921 * @prop {boolean} sortable=false - Whether or not the column should be sortable when using the sorting component. 34922 */ 34923 this.column = $.extend(true, {}, table.o.editing.column, {visible: this.alwaysShow}); 34924 34925 /** 34926 * The position of the editing column in the table as well as the alignment of the buttons. 34927 * @type {string} 34928 */ 34929 this.position = table.o.editing.position; 34930 34931 34932 /** 34933 * The text that appears in the show button. This can contain HTML. 34934 * @type {string} 34935 */ 34936 this.showText = table.o.editing.showText; 34937 34938 /** 34939 * The text that appears in the hide button. This can contain HTML. 34940 * @type {string} 34941 */ 34942 this.hideText = table.o.editing.hideText; 34943 34944 /** 34945 * The text that appears in the add button. This can contain HTML. 34946 * @type {string} 34947 */ 34948 this.addText = table.o.editing.addText; 34949 34950 /** 34951 * The text that appears in the edit button. This can contain HTML. 34952 * @type {string} 34953 */ 34954 this.editText = table.o.editing.editText; 34955 34956 /** 34957 * The text that appears in the delete button. This can contain HTML. 34958 * @type {string} 34959 */ 34960 this.deleteText = table.o.editing.deleteText; 34961 34962 /** 34963 * This object is used to contain the callbacks for the add, edit and delete row buttons. 34964 * @type {object} 34965 * @prop {function} addRow 34966 * @prop {function} editRow 34967 * @prop {function} deleteRow 34968 */ 34969 this.callbacks = { 34970 addRow: F.checkFnValue(this, table.o.editing.addRow), 34971 editRow: F.checkFnValue(this, table.o.editing.editRow), 34972 deleteRow: F.checkFnValue(this, table.o.editing.deleteRow) 34973 }; 34974 }, 34975 /* PROTECTED */ 34976 /** 34977 * Checks the supplied data and options for the editing component. 34978 * @instance 34979 * @protected 34980 * @param {object} data - The jQuery data object from the parent table. 34981 * @fires FooTable.Editing#"preinit.ft.editing" 34982 */ 34983 preinit: function(data){ 34984 var self = this; 34985 /** 34986 * The preinit.ft.editing event is raised before the UI is created and provides the tables jQuery data object for additional options parsing. 34987 * Calling preventDefault on this event will disable the component. 34988 * @event FooTable.Editing#"preinit.ft.editing" 34989 * @param {jQuery.Event} e - The jQuery.Event object for the event. 34990 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 34991 * @param {object} data - The jQuery data object of the table raising the event. 34992 */ 34993 this.ft.raise('preinit.ft.editing', [data]).then(function(){ 34994 if (self.ft.$el.hasClass('footable-editing')) 34995 self.enabled = true; 34996 34997 self.enabled = F.is.boolean(data.editing) 34998 ? data.editing 34999 : self.enabled; 35000 35001 if (!self.enabled) return; 35002 35003 self.pageToNew = F.is.boolean(data.editingPageToNew) ? data.editingPageToNew : self.pageToNew; 35004 35005 self.alwaysShow = F.is.boolean(data.editingAlwaysShow) ? data.editingAlwaysShow : self.alwaysShow; 35006 35007 self.position = F.is.string(data.editingPosition) ? data.editingPosition : self.position; 35008 35009 self.showText = F.is.string(data.editingShowText) ? data.editingShowText : self.showText; 35010 35011 self.hideText = F.is.string(data.editingHideText) ? data.editingHideText : self.hideText; 35012 35013 self.addText = F.is.string(data.editingAddText) ? data.editingAddText : self.addText; 35014 35015 self.editText = F.is.string(data.editingEditText) ? data.editingEditText : self.editText; 35016 35017 self.deleteText = F.is.string(data.editingDeleteText) ? data.editingDeleteText : self.deleteText; 35018 35019 self.column = new F.EditingColumn(self.ft, self, $.extend(true, {}, self.column, data.editingColumn, {visible: self.alwaysShow})); 35020 35021 if (self.ft.$el.hasClass('footable-editing-left')) 35022 self.position = 'left'; 35023 35024 if (self.ft.$el.hasClass('footable-editing-right')) 35025 self.position = 'right'; 35026 35027 if (self.position === 'right'){ 35028 self.column.index = self.ft.columns.array.length; 35029 } else { 35030 self.column.index = 0; 35031 for (var i = 0, len = self.ft.columns.array.length; i < len; i++){ 35032 self.ft.columns.array[i].index += 1; 35033 } 35034 } 35035 self.ft.columns.array.push(self.column); 35036 self.ft.columns.array.sort(function(a, b){ return a.index - b.index; }); 35037 35038 self.callbacks.addRow = F.checkFnValue(self, data.editingAddRow, self.callbacks.addRow); 35039 self.callbacks.editRow = F.checkFnValue(self, data.editingEditRow, self.callbacks.editRow); 35040 self.callbacks.deleteRow = F.checkFnValue(self, data.editingDeleteRow, self.callbacks.deleteRow); 35041 }, function(){ 35042 self.enabled = false;
35043 }); 35044 }, 35045 /** 35046 * Initializes the editing component for the plugin using the supplied table and options. 35047 * @instance 35048 * @protected 35049 * @fires FooTable.Editing#"init.ft.editing" 35050 */ 35051 init: function(){ 35052 /** 35053 * The init.ft.editing event is raised before its UI is generated. 35054 * Calling preventDefault on this event will disable the component. 35055 * @event FooTable.Editing#"init.ft.editing" 35056 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35057 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35058 */ 35059 var self = this; 35060 this.ft.raise('init.ft.editing').then(function(){ 35061 self.$create(); 35062 }, function(){ 35063 self.enabled = false; 35064 }); 35065 }, 35066 /** 35067 * Destroys the editing component removing any UI generated from the table. 35068 * @instance 35069 * @protected 35070 * @fires FooTable.Editing#"destroy.ft.editing" 35071 */ 35072 destroy: function () { 35073 /** 35074 * The destroy.ft.editing event is raised before its UI is removed. 35075 * Calling preventDefault on this event will prevent the component from being destroyed. 35076 * @event FooTable.Editing#"destroy.ft.editing" 35077 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35078 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35079 */ 35080 var self = this; 35081 this.ft.raise('destroy.ft.editing').then(function(){ 35082 self.ft.$el.removeClass('footable-editing').off('click.ft.editing') 35083 .find('tfoot > tr.footable-editing').remove(); 35084 }); 35085 }, 35086 /** 35087 * Creates the editing UI from the current options setting the various jQuery properties of this component. 35088 * @instance 35089 * @protected 35090 */ 35091 $create: function(){ 35092 var self = this, position = self.position === 'right' ? 'footable-editing-right' : 'footable-editing-left'; 35093 self.ft.$el.addClass('footable-editing').addClass(position) 35094 .on('click.ft.editing', '.footable-show', {self: self}, self._onShowClick) 35095 .on('click.ft.editing', '.footable-hide', {self: self}, self._onHideClick) 35096 .on('click.ft.editing', '.footable-edit', {self: self}, self._onEditClick) 35097 .on('click.ft.editing', '.footable-delete', {self: self}, self._onDeleteClick) 35098 .on('click.ft.editing', '.footable-add', {self: self}, self._onAddClick); 35099 35100 self.$cell = $('<td/>').attr('colspan', self.ft.columns.visibleColspan) 35101 .append(self.$buttonShow()) 35102 .append(self.$buttonAdd()) 35103 .append(self.$buttonHide()); 35104 35105 if (self.alwaysShow){ 35106 self.ft.$el.addClass('footable-editing-always-show'); 35107 } 35108 35109 var $tfoot = self.ft.$el.children('tfoot'); 35110 if ($tfoot.length == 0){ 35111 $tfoot = $('<tfoot/>'); 35112 self.ft.$el.append($tfoot); 35113 } 35114 self.$row = $('<tr/>', { 'class': 'footable-editing' }).append(self.$cell).appendTo($tfoot); 35115 }, 35116 /** 35117 * Creates the show button for the editing component. 35118 * @instance 35119 * @protected 35120 * @returns {(string|HTMLElement|jQuery)} 35121 */ 35122 $buttonShow: function(){ 35123 return '<button type="button" class="btn btn-primary footable-show">' + this.showText + '</button>'; 35124 }, 35125 /** 35126 * Creates the hide button for the editing component. 35127 * @instance 35128 * @protected 35129 * @returns {(string|HTMLElement|jQuery)} 35130 */ 35131 $buttonHide: function(){ 35132 return '<button type="button" class="btn btn-default footable-hide">' + this.hideText + '</button>'; 35133 }, 35134 /** 35135 * Creates the add button for the editing component. 35136 * @instance 35137 * @protected 35138 * @returns {(string|HTMLElement|jQuery)} 35139 */ 35140 $buttonAdd: function(){ 35141 return '<button type="button" class="btn btn-primary footable-add">' + this.addText + '</button> '; 35142 }, 35143 /** 35144 * Creates the edit button for the editing component. 35145 * @instance 35146 * @protected 35147 * @returns {(string|HTMLElement|jQuery)} 35148 */ 35149 $buttonEdit: function(){ 35150 return '<button type="button" class="btn btn-default footable-edit">' + this.editText + '</button> '; 35151 }, 35152 /** 35153 * Creates the delete button for the editing component. 35154 * @instance 35155 * @protected 35156 * @returns {(string|HTMLElement|jQuery)} 35157 */ 35158 $buttonDelete: function(){ 35159 return '<button type="button" class="btn btn-default footable-delete">' + this.deleteText + '</button>'; 35160 }, 35161 /** 35162 * Creates the button group for the row buttons. 35163 * @instance 35164 * @protected 35165 * @returns {(string|HTMLElement|jQuery)} 35166 */ 35167 $rowButtons: function(){ 35168 return $('<div class="btn-group btn-group-xs" role="group"></div>') 35169 .append(this.$buttonEdit()) 35170 .append(this.$buttonDelete()); 35171 }, 35172 /** 35173 * Performs the drawing of the component. 35174 */ 35175 draw: function(){ 35176 this.$cell.attr('colspan', this.ft.columns.visibleColspan); 35177 }, 35178 /** 35179 * Handles the edit button click event. 35180 * @instance 35181 * @private 35182 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35183 * @fires FooTable.Editing#"edit.ft.editing" 35184 */ 35185 _onEditClick: function(e){ 35186 e.preventDefault(); 35187 var self = e.data.self, row = $(this).closest('tr').data('__FooTableRow__'); 35188 if (row instanceof F.Row){ 35189 /** 35190 * The edit.ft.editing event is raised before its callback is executed. 35191 * Calling preventDefault on this event will prevent the callback from being executed. 35192 * @event FooTable.Editing#"edit.ft.editing" 35193 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35194 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35195 * @param {FooTable.Row} row - The row to be edited. 35196 */ 35197 self.ft.raise('edit.ft.editing', [row]).then(function(){ 35198 self.callbacks.editRow.call(self.ft, row); 35199 }); 35200 } 35201 }, 35202 /** 35203 * Handles the delete button click event. 35204 * @instance 35205 * @private 35206 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35207 * @fires FooTable.Editing#"delete.ft.editing" 35208 */ 35209 _onDeleteClick: function(e){ 35210 e.preventDefault(); 35211 var self = e.data.self, row = $(this).closest('tr').data('__FooTableRow__'); 35212 if (row instanceof F.Row){ 35213 /** 35214 * The delete.ft.editing event is raised before its callback is executed. 35215 * Calling preventDefault on this event will prevent the callback from being executed. 35216 * @event FooTable.Editing#"delete.ft.editing" 35217 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35218 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35219 * @param {FooTable.Row} row - The row to be deleted. 35220 */ 35221 self.ft.raise('delete.ft.editing', [row]).then(function(){ 35222 self.callbacks.deleteRow.call(self.ft, row); 35223 }); 35224 } 35225 }, 35226 /** 35227 * Handles the add button click event. 35228 * @instance 35229 * @private 35230 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35231 * @fires FooTable.Editing#"add.ft.editing" 35232 */ 35233 _onAddClick: function(e){ 35234 e.preventDefault(); 35235 var self = e.data.self; 35236 /** 35237 * The add.ft.editing event is raised before its callback is executed. 35238 * Calling preventDefault on this event will prevent the callback from being executed. 35239 * @event FooTable.Editing#"add.ft.editing" 35240 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35241 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35242 */ 35243 self.ft.raise('add.ft.editing').then(function(){ 35244 self.callbacks.addRow.call(self.ft); 35245 }); 35246 }, 35247 /** 35248 * Handles the show button click event. 35249 * @instance 35250 * @private 35251 * @param {jQuery.Event} e - The jQuery.Event object for the event.
35252 * @fires FooTable.Editing#"show.ft.editing" 35253 */ 35254 _onShowClick: function(e){ 35255 e.preventDefault(); 35256 var self = e.data.self; 35257 /** 35258 * The show.ft.editing event is raised before its callback is executed. 35259 * Calling preventDefault on this event will prevent the callback from being executed. 35260 * @event FooTable.Editing#"show.ft.editing" 35261 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35262 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35263 */ 35264 self.ft.raise('show.ft.editing').then(function(){ 35265 self.ft.$el.addClass('footable-editing-show'); 35266 self.column.visible = true; 35267 self.ft.draw(); 35268 }); 35269 }, 35270 /** 35271 * Handles the hide button click event. 35272 * @instance 35273 * @private 35274 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35275 * @fires FooTable.Editing#"show.ft.editing" 35276 */ 35277 _onHideClick: function(e){ 35278 e.preventDefault(); 35279 var self = e.data.self; 35280 /** 35281 * The hide.ft.editing event is raised before its callback is executed. 35282 * Calling preventDefault on this event will prevent the callback from being executed. 35283 * @event FooTable.Editing#"hide.ft.editing" 35284 * @param {jQuery.Event} e - The jQuery.Event object for the event. 35285 * @param {FooTable.Table} ft - The instance of the plugin raising the event. 35286 */ 35287 self.ft.raise('hide.ft.editing').then(function(){ 35288 self.ft.$el.removeClass('footable-editing-show'); 35289 self.column.visible = false; 35290 self.ft.draw(); 35291 }); 35292 } 35293 }); 35294 35295 F.components.internal.register('editing', F.Editing, 4); 35296 35297})(jQuery, FooTable); 35298(function($, F){ 35299 35300 F.EditingColumn = F.Column.extend(/** @lends FooTable.EditingColumn */{ 35301 /** 35302 * The Editing column class is used to create the column containing the editing buttons. 35303 * @constructs 35304 * @extends FooTable.Column 35305 * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to. 35306 * @param {FooTable.Editing} editing - The parent {@link FooTable.Editing} component this column is used with. 35307 * @param {object} definition - An object containing all the properties to set for the column. 35308 * @returns {FooTable.EditingColumn} 35309 */ 35310 construct: function(instance, editing, definition){ 35311 this._super(instance, definition, 'editing'); 35312 this.editing = editing; 35313 }, 35314 /** 35315 * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and 35316 * will be provided to the {@link FooTable.EditingColumn#format} function 35317 * to generate the cell contents. 35318 * @instance 35319 * @protected 35320 * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object. 35321 * @returns {(jQuery)} 35322 */ 35323 parser: function(valueOrElement){ 35324 if (F.is.string(valueOrElement)) valueOrElement = $($.trim(valueOrElement)); 35325 if (F.is.element(valueOrElement)) valueOrElement = $(valueOrElement); 35326 if (F.is.jq(valueOrElement)){ 35327 var tagName = valueOrElement.prop('tagName').toLowerCase(); 35328 if (tagName == 'td' || tagName == 'th') return valueOrElement.data('value') || valueOrElement.contents(); 35329 return valueOrElement; 35330 } 35331 return null; 35332 }, 35333 /** 35334 * Creates a cell to be used in the supplied row for this column. 35335 * @param {FooTable.Row} row - The row to create the cell for. 35336 * @returns {FooTable.Cell} 35337 */ 35338 createCell: function(row){ 35339 var $buttons = this.editing.$rowButtons(), $cell = $('<td/>').append($buttons); 35340 if (F.is.jq(row.$el)){ 35341 if (this.index === 0){ 35342 $cell.prependTo(row.$el); 35343 } else { 35344 $cell.insertAfter(row.$el.children().eq(this.index-1)); 35345 } 35346 } 35347 return new F.Cell(this.ft, row, this, $cell || $cell.html()); 35348 } 35349 }); 35350 35351 F.columns.register('editing', F.EditingColumn); 35352 35353})(jQuery, FooTable); 35354(function($, F) { 35355 35356 /** 35357 * An object containing the editing options for the plugin. Added by the {@link FooTable.Editing} component. 35358 * @type {object} 35359 * @prop {boolean} enabled=false - Whether or not to allow editing on the table. 35360 * @prop {boolean} pageToNew=true - Whether or not to automatically page to a new row when it is added to the table. 35361 * @prop {string} position="right" - The position of the editing column in the table as well as the alignment of the buttons. 35362 * @prop {boolean} alwaysShow=false - Whether or not the editing column and add row button are always visible. 35363 * @prop {function} addRow - The callback function to execute when the add row button is clicked. 35364 * @prop {function} editRow - The callback function to execute when the edit row button is clicked. 35365 * @prop {function} deleteRow - The callback function to execute when the delete row button is clicked. 35366 * @prop {string} showText - The text that appears in the show button. This can contain HTML. 35367 * @prop {string} hideText - The text that appears in the hide button. This can contain HTML. 35368 * @prop {string} addText - The text that appears in the add button. This can contain HTML. 35369 * @prop {string} editText - The text that appears in the edit button. This can contain HTML. 35370 * @prop {string} deleteText - The text that appears in the delete button. This can contain HTML. 35371 * @prop {object} column - The options for the editing column. @see {@link FooTable.EditingColumn} for more info. 35372 * @prop {string} column.classes="footable-editing" - A space separated string of class names to apply to all cells in the column. 35373 * @prop {string} column.name="editing" - The name of the column. 35374 * @prop {string} column.title="" - The title displayed in the header row of the table for the column. 35375 * @prop {boolean} column.filterable=false - Whether or not the column should be filterable when using the filtering component. 35376 * @prop {boolean} column.sortable=false - Whether or not the column should be sortable when using the sorting component. 35377 */ 35378 F.Defaults.prototype.editing = { 35379 enabled: false, 35380 pageToNew: true, 35381 position: 'right', 35382 alwaysShow: false, 35383 addRow: function(){}, 35384 editRow: function(row){}, 35385 deleteRow: function(row){}, 35386 showText: '<span class="fooicon fooicon-pencil" aria-hidden="true"></span> Edit rows', 35387 hideText: 'Cancel', 35388 addText: 'New row', 35389 editText: '<span class="fooicon fooicon-pencil" aria-hidden="true"></span>', 35390 deleteText: '<span class="fooicon fooicon-trash" aria-hidden="true"></span>', 35391 column: { 35392 classes: 'footable-editing', 35393 name: 'editing', 35394 title: '', 35395 filterable: false, 35396 sortable: false 35397 } 35398 }; 35399 35400})(jQuery, FooTable); 35401(function($, F){ 35402 35403 if (F.is.defined(F.Paging)){ 35404 /**
35405 * Holds a shallow clone of the un-paged {@link FooTable.Rows#array} value before paging occurs and superfluous rows are removed. Added by the {@link FooTable.Editing} component. 35406 * @instance 35407 * @public 35408 * @type {Array<FooTable.Row>} 35409 */ 35410 F.Paging.prototype.unpaged = []; 35411 35412 // override the default predraw method with one that sets the unpaged property. 35413 F.Paging.extend('predraw', function(){ 35414 this.unpaged = this.ft.rows.array.slice(0); // create a shallow clone for later use 35415 this._super(); // call the original method 35416 }); 35417 } 35418 35419})(jQuery, FooTable); 35420(function($, F){ 35421 35422 /** 35423 * Adds the row to the table. 35424 * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this 35425 * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method. 35426 * @returns {jQuery.Deferred} 35427 */ 35428 F.Row.prototype.add = function(redraw){ 35429 redraw = F.is.boolean(redraw) ? redraw : true; 35430 var self = this; 35431 return $.Deferred(function(d){ 35432 var index = self.ft.rows.all.push(self) - 1; 35433 if (redraw){ 35434 return self.ft.draw().then(function(){ 35435 d.resolve(index); 35436 }); 35437 } else { 35438 d.resolve(index); 35439 } 35440 }); 35441 }; 35442 35443 /** 35444 * Removes the row from the table. 35445 * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this 35446 * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method. 35447 * @returns {jQuery.Deferred} 35448 */ 35449 F.Row.prototype.delete = function(redraw){ 35450 redraw = F.is.boolean(redraw) ? redraw : true; 35451 var self = this; 35452 return $.Deferred(function(d){ 35453 var index = self.ft.rows.all.indexOf(self); 35454 if (F.is.number(index) && index >= 0 && index < self.ft.rows.all.length){ 35455 self.ft.rows.all.splice(index, 1); 35456 if (redraw){ 35457 return self.ft.draw().then(function(){ 35458 d.resolve(self); 35459 }); 35460 } 35461 } 35462 d.resolve(self); 35463 }); 35464 }; 35465 35466 if (F.is.defined(F.Paging)){ 35467 // override the default add method with one that supports paging 35468 F.Row.extend('add', function(redraw){ 35469 redraw = F.is.boolean(redraw) ? redraw : true; 35470 var self = this, 35471 added = this._super(redraw), 35472 editing = self.ft.use(F.Editing), 35473 paging; 35474 if (editing && editing.pageToNew && (paging = self.ft.use(F.Paging)) && redraw){ 35475 return added.then(function(){ 35476 var index = paging.unpaged.indexOf(self); // find this row in the unpaged array (this array will be sorted and filtered) 35477 var page = Math.ceil((index + 1) / paging.size); // calculate the page the new row is on 35478 if (paging.current !== page){ // goto the page if we need to 35479 return paging.goto(page); 35480 } 35481 }); 35482 } 35483 return added; 35484 }); 35485 } 35486 35487 if (F.is.defined(F.Sorting)){ 35488 // override the default val method with one that supports sorting and paging 35489 F.Row.extend('val', function(data, redraw){ 35490 redraw = F.is.boolean(redraw) ? redraw : true; 35491 var result = this._super(data); 35492 if (!F.is.hash(data)){ 35493 return result; 35494 } 35495 var self = this; 35496 if (redraw){ 35497 self.ft.draw().then(function(){ 35498 var editing = self.ft.use(F.Editing), paging; 35499 if (F.is.defined(F.Paging) && editing && editing.pageToNew && (paging = self.ft.use(F.Paging))){ 35500 var index = paging.unpaged.indexOf(self); // find this row in the unpaged array (this array will be sorted and filtered) 35501 var page = Math.ceil((index + 1) / paging.size); // calculate the page the new row is on 35502 if (paging.current !== page){ // goto the page if we need to 35503 return paging.goto(page); 35504 } 35505 } 35506 }); 35507 } 35508 return result; 35509 }); 35510 } 35511 35512})(jQuery, FooTable); 35513(function(F){ 35514 35515 /** 35516 * Adds a row to the underlying {@link FooTable.Rows#all} array. 35517 * @param {(object|FooTable.Row)} dataOrRow - A hash containing the row values or an actual {@link FooTable.Row} object. 35518 */ 35519 F.Rows.prototype.add = function(dataOrRow){ 35520 var row = dataOrRow; 35521 if (F.is.hash(dataOrRow)){ 35522 row = new FooTable.Row(this.ft, this.ft.columns.array, dataOrRow); 35523 } 35524 if (row instanceof FooTable.Row){ 35525 row.add(); 35526 } 35527 }; 35528 35529 /** 35530 * Updates a row in the underlying {@link FooTable.Rows#all} array.
35531 * @param {(number|FooTable.Row)} indexOrRow - The index to update or the actual {@link FooTable.Row} object. 35532 * @param {object} data - A hash containing the new row values. 35533 */ 35534 F.Rows.prototype.update = function(indexOrRow, data){ 35535 var len = this.ft.rows.all.length, 35536 row = indexOrRow; 35537 if (F.is.number(indexOrRow) && indexOrRow >= 0 && indexOrRow < len){ 35538 row = this.ft.rows.all[indexOrRow]; 35539 } 35540 if (row instanceof FooTable.Row && F.is.hash(data)){ 35541 row.val(data); 35542 } 35543 }; 35544 35545 /** 35546 * Deletes a row from the underlying {@link FooTable.Rows#all} array. 35547 * @param {(number|FooTable.Row)} indexOrRow - The index to delete or the actual {@link FooTable.Row} object. 35548 */ 35549 F.Rows.prototype.delete = function(indexOrRow){ 35550 var len = this.ft.rows.all.length, 35551 row = indexOrRow; 35552 if (F.is.number(indexOrRow) && indexOrRow >= 0 && indexOrRow < len){ 35553 row = this.ft.rows.all[indexOrRow]; 35554 } 35555 if (row instanceof FooTable.Row){ 35556 row.delete(); 35557 } 35558 }; 35559 35560})(FooTable); 35561 35562;// /var/www/www.vfb.de/httpdocs/current/static/js/footableToggle.js 35563(function (w) { 35564 35565 var toggleInstances = []; 35566 35567 function getToggleWidth($currentTable, index) { 35568 var toggleInstance = this, 35569 width; 35570 35571 if (typeof toggleInstance.tablesBefore !== "undefined" && 35572 typeof toggleInstance.tablesBefore[index] !== "undefined" && 35573 typeof toggleInstance.before !== "undefined") { 35574 width = getRootWidth.call(toggleInstance); 35575 } else { 35576 width = $currentTable.width(); 35577 } 35578 35579 return !width ? toggleInstance.rootWidth : width; 35580 } 35581 35582 function checkToggleBreakpoints() { 35583 var toggleInstance = this; 35584 35585 function toggleText(tElement, toggleAttr) { 35586 toggleAttr = toggleAttr || 'short'; 35587 35588 function toggleElement(element) { 35589 var $element = $(element), 35590 toggleText = $element.data(toggleAttr), 35591 toggleTextFull = $element.data('full'), 35592 $html = $("<root>" + $element.html() + "</root>"); 35593 35594 35595 35596 $html.find('.footable-toggle').remove(); 35597 $element.html(toggleText); 35598 35599 if (!toggleTextFull) { 35600 $element.data('full', $html.html()); 35601 } 35602 } 35603 35604 if (tElement.length) { 35605 tElement.forEach(function (element) { 35606 toggleElement(element); 35607 }); 35608 } else { 35609 toggleElement(tElement); 35610 } 35611 } 35612 35613 function toggleTh(th, toggleAttr) { 35614 if (th.data(toggleAttr)) { 35615 toggleText(th[0], toggleAttr); 35616 } 35617 } 35618 35619 toggleInstance.tables.forEach(function ($table, ind) { 35620 var width = getToggleWidth.call(toggleInstance, $table, ind); 35621 toggleInstance.tablesBefore[ind] = $table; //update before content 35622 toggleInstance.cellData[ind].forEach(function (data) { 35623 var $th = $table.find('th:eq(' + data.index + ')'), 35624 toggled = $th.hasClass('toggled'), 35625 mini = $th.hasClass('mini'), 35626 nano = $th.hasClass('nano'); 35627 35628 if (!width) { 35629 return; 35630 } 35631 //short 35632 if (toggled && width > data.breakpoint) { 35633 toggleText(data.tds, 'full'); 35634 toggleTh(data.th, 'full'); 35635 $th.removeClass('toggled'); 35636 } else { 35637 if (!toggled && width <= data.breakpoint && !mini) { 35638 toggleText(data.tds, 'short'); 35639 toggleTh(data.th, 'short'); 35640 $th.addClass('toggled'); 35641 } 35642 } 35643 //mini 35644 if (mini && width > data.mini && width <= data.breakpoint) { 35645 toggleText(data.tds, 'short'); 35646 toggleTh(data.th, 'short'); 35647 $th.removeClass('mini'); 35648 } else { 35649 if (!mini && width <= data.mini) { 35650 toggleText(data.tds, 'mini'); 35651 toggleTh(data.th, 'mini'); 35652 $th.addClass('mini'); 35653 } 35654 } 35655 //nano 35656 if (nano && width > data.nano && width <= data.mini) { 35657 toggleText(data.tds, 'mini'); 35658 toggleTh(data.th, 'mini'); 35659 $th.removeClass('nano'); 35660 } else { 35661 if (!nano && width <= data.nano) { 35662 35663 toggleText(data.tds, 'nano'); 35664 toggleTh(data.th, 'nano'); 35665 $th.addClass('nano'); 35666 } 35667 } 35668 }); 35669 }); 35670 } 35671 35672 35673 function getTablesBeforeReplacement($before, tableIndex) { 35674 var toggleInstance = this, 35675 $toggleCells = $before.find('th[data-togglebreakpoint]'); 35676 35677 $toggleCells.each(function () { 35678 var $that = $(this), 35679 $parent = $that.parent(); 35680 35681 toggleInstance.tablesBefore[tableIndex] = $parent.parents('table:first'); 35682 }); 35683 35684 } 35685 35686 function getRootWidth() { 35687 var toggleInstance = this, 35688 width = toggleInstance.rootElement.width(), 35689 widthBefore = typeof toggleInstance.before !== "undefined" ? toggleInstance.before.width() : 0; 35690 return widthBefore ? widthBefore : width; 35691 } 35692 35693 w.vfb.initFootableToggle = function ($rootElement, $before, instanceIndex) { 35694 $rootElement = $rootElement || $(document); 35695 var toggleInstance = this; 35696 if (!(toggleInstance instanceof w.vfb.initFootableToggle)) { 35697 console.log("initFootableToggle couldn't be initialized, it have be a instance"); 35698 return; 35699 } 35700 35701 toggleInstance.rootElement = $rootElement; 35702 toggleInstance.before = $before; 35703 toggleInstance.cellData = []; 35704 toggleInstance.tables = []; 35705 toggleInstance.tablesBefore = []; 35706 toggleInstance.$tables = $rootElement.find('table.table'); 35707 toggleInstance.$toggleCells = $rootElement.find('th[data-togglebreakpoint]'); 35708 35709 if (toggleInstance.$tables.length) { 35710 if (typeof instanceIndex !== "undefined") { 35711 toggleInstance.key = instanceIndex; 35712 toggleInstances[instanceIndex] = toggleInstance; 35713 } else { 35714 toggleInstance.key = toggleInstances.length; 35715 toggleInstances.push(toggleInstance); 35716 } 35717 } 35718 35719 toggleInstance.$toggleCells.each(function () { 35720 var $that = $(this), 35721 toggleBreakpoint = $that.data('togglebreakpoint'), 35722 toggleMini = $that.data('togglemini'), 35723 toggleNano = $that.data('togglenano'), 35724 $parent = $that.parent(), 35725 $parentTable = $parent.parents('table:first'), 35726 tableIndex = toggleInstance.$tables.index($parentTable), 35727 index = $parent.find('th').index($that), 35728 $tds = $parentTable.find('tr').find('td:eq(' + index + ')'); 35729 35730 if (toggleInstance.cellData[tableIndex]) { 35731 toggleInstance.cellData[tableIndex].push({ 35732 breakpoint: toggleBreakpoint, 35733 mini: toggleMini, 35734 nano: toggleNano, 35735 tds: $tds.toArray(), 35736 index: index, 35737 th: $that 35738 }); 35739 } else { 35740 toggleInstance.cellData[tableIndex] = [{ 35741 breakpoint: toggleBreakpoint, 35742 mini: toggleMini, 35743 nano: toggleNano, 35744 tds: $tds.toArray(), 35745 index: index, 35746 th: $that 35747 }]; 35748 } 35749 if ($before) { 35750 getTablesBeforeReplacement.call(toggleInstance, $before, tableIndex); 35751 } 35752 toggleInstance.tables[tableIndex] = $parentTable; 35753 }); 35754 toggleInstance.checkToggleBreakpoints = checkToggleBreakpoints.bind(toggleInstance); 35755 toggleInstance.checkToggleBreakpoints(); 35756 }; 35757 35758 document.addEventListener("DOMContentLoaded", function () { 35759 new w.vfb.initFootableToggle(); 35760 }); 35761 35762 $(window).resize(function () { 35763 var i, 35764 length = toggleInstances.length; 35765 35766 for (i = 0; i < length; i++) { 35767 toggleInstances[i].checkToggleBreakpoints(); 35768 } 35769 }); 35770}(window)); 35771;// /var/www/www.vfb.de/httpdocs/current/static/js/es6-promise.js 35772(function (root) { 35773 35774 // Store setTimeout reference so promise-polyfill will be unaffected by 35775 // other code modifying setTimeout (like sinon.useFakeTimers())
vendor: 7,380 bytes, lines 35776-36069
35776 var setTimeoutFunc = setTimeout; 35777 35778 function noop() {} 35779 35780 // Polyfill for Function.prototype.bind 35781 function bind(fn, thisArg) { 35782 return function () { 35783 fn.apply(thisArg, arguments); 35784 }; 35785 } 35786 35787 function Promise(fn) { 35788 if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new'); 35789 if (typeof fn !== 'function') throw new TypeError('not a function'); 35790 this._state = 0; 35791 this._handled = false; 35792 this._value = undefined; 35793 this._deferreds = []; 35794 35795 doResolve(fn, this); 35796 } 35797 35798 function handle(self, deferred) { 35799 while (self._state === 3) { 35800 self = self._value; 35801 } 35802 if (self._state === 0) { 35803 self._deferreds.push(deferred); 35804 return; 35805 } 35806 self._handled = true; 35807 Promise._immediateFn(function () { 35808 var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; 35809 if (cb === null) { 35810 (self._state === 1 ? resolve : reject)(deferred.promise, self._value); 35811 return; 35812 } 35813 var ret; 35814 try { 35815 ret = cb(self._value); 35816 } catch (e) { 35817 reject(deferred.promise, e); 35818 return; 35819 } 35820 resolve(deferred.promise, ret); 35821 }); 35822 } 35823 35824 function resolve(self, newValue) { 35825 try { 35826 // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure 35827 if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); 35828 if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { 35829 var then = newValue.then; 35830 if (newValue instanceof Promise) { 35831 self._state = 3; 35832 self._value = newValue; 35833 finale(self); 35834 return; 35835 } else if (typeof then === 'function') { 35836 doResolve(bind(then, newValue), self); 35837 return; 35838 } 35839 } 35840 self._state = 1; 35841 self._value = newValue; 35842 finale(self); 35843 } catch (e) { 35844 reject(self, e); 35845 } 35846 } 35847 35848 function reject(self, newValue) { 35849 self._state = 2; 35850 self._value = newValue; 35851 finale(self); 35852 } 35853 35854 function finale(self) { 35855 if (self._state === 2 && self._deferreds.length === 0) { 35856 Promise._immediateFn(function() { 35857 if (!self._handled) { 35858 Promise._unhandledRejectionFn(self._value); 35859 } 35860 }); 35861 } 35862 35863 for (var i = 0, len = self._deferreds.length; i < len; i++) { 35864 handle(self, self._deferreds[i]); 35865 } 35866 self._deferreds = null; 35867 } 35868 35869 function Handler(onFulfilled, onRejected, promise) { 35870 this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; 35871 this.onRejected = typeof onRejected === 'function' ? onRejected : null; 35872 this.promise = promise; 35873 } 35874 35875 /** 35876 * Take a potentially misbehaving resolver function and make sure 35877 * onFulfilled and onRejected are only called once. 35878 * 35879 * Makes no guarantees about asynchrony. 35880 */ 35881 function doResolve(fn, self) { 35882 var done = false; 35883 try { 35884 fn(function (value) { 35885 if (done) return; 35886 done = true; 35887 resolve(self, value); 35888 }, function (reason) { 35889 if (done) return; 35890 done = true; 35891 reject(self, reason); 35892 }); 35893 } catch (ex) { 35894 if (done) return; 35895 done = true; 35896 reject(self, ex); 35897 } 35898 } 35899 35900 Promise.prototype['catch'] = function (onRejected) { 35901 return this.then(null, onRejected); 35902 }; 35903 35904 Promise.prototype.then = function (onFulfilled, onRejected) { 35905 var prom = new (this.constructor)(noop); 35906 35907 handle(this, new Handler(onFulfilled, onRejected, prom)); 35908 return prom; 35909 }; 35910 35911 Promise.all = function (arr) { 35912 var args = Array.prototype.slice.call(arr); 35913 35914 return new Promise(function (resolve, reject) { 35915 if (args.length === 0) return resolve([]); 35916 var remaining = args.length; 35917 35918 function res(i, val) { 35919 try { 35920 if (val && (typeof val === 'object' || typeof val === 'function')) { 35921 var then = val.then; 35922 if (typeof then === 'function') { 35923 then.call(val, function (val) { 35924 res(i, val); 35925 }, reject); 35926 return; 35927 } 35928 } 35929 args[i] = val; 35930 if (--remaining === 0) { 35931 resolve(args); 35932 } 35933 } catch (ex) { 35934 reject(ex); 35935 } 35936 } 35937 35938 for (var i = 0; i < args.length; i++) { 35939 res(i, args[i]); 35940 } 35941 }); 35942 }; 35943 35944 Promise.resolve = function (value) { 35945 if (value && typeof value === 'object' && value.constructor === Promise) { 35946 return value; 35947 } 35948 35949 return new Promise(function (resolve) { 35950 resolve(value); 35951 }); 35952 }; 35953 35954 Promise.reject = function (value) { 35955 return new Promise(function (resolve, reject) { 35956 reject(value); 35957 }); 35958 }; 35959 35960 Promise.race = function (values) { 35961 return new Promise(function (resolve, reject) { 35962 for (var i = 0, len = values.length; i < len; i++) { 35963 values[i].then(resolve, reject); 35964 } 35965 }); 35966 }; 35967 35968 // Use polyfill for setImmediate for performance gains 35969 Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) || 35970 function (fn) { 35971 setTimeoutFunc(fn, 0); 35972 }; 35973 35974 Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { 35975 if (typeof console !== 'undefined' && console) { 35976 console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console 35977 } 35978 }; 35979 35980 /** 35981 * Set the immediate function to execute callbacks 35982 * @param fn {function} Function to execute 35983 * @deprecated 35984 */ 35985 Promise._setImmediateFn = function _setImmediateFn(fn) { 35986 Promise._immediateFn = fn; 35987 }; 35988 35989 /** 35990 * Change the function to execute on unhandled rejection 35991 * @param {function} fn Function to execute on unhandled rejection 35992 * @deprecated 35993 */ 35994 Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { 35995 Promise._unhandledRejectionFn = fn; 35996 }; 35997 35998 if (typeof module !== 'undefined' && module.exports) { 35999 module.exports = Promise; 36000 } else if (!root.Promise) { 36001 root.Promise = Promise; 36002 } 36003 36004})(this); 36005;// /var/www/www.vfb.de/httpdocs/current/static/js/sweetalert.js 36006/*! 36007 * sweetalert2 v5.2.0 36008 * Released under the MIT License. 36009 */ 36010(function (global, factory) { 36011 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 36012 typeof define === 'function' && define.amd ? define(factory) : 36013 (global.Sweetalert2 = factory()); 36014}(this, function () { 'use strict'; 36015 36016 var swalPrefix = 'swal2-'; 36017 36018 var prefix = function(items) { 36019 var result = {}; 36020 for (var i in items) { 36021 result[items[i]] = swalPrefix + items[i]; 36022 } 36023 return result; 36024 }; 36025 36026 var swalClasses = prefix([ 36027 'container', 36028 'in', 36029 'modal', 36030 'overlay', 36031 'close', 36032 'content', 36033 'spacer', 36034 'confirm', 36035 'cancel', 36036 'icon', 36037 'image', 36038 'input', 36039 'file', 36040 'range', 36041 'select', 36042 'radio', 36043 'checkbox', 36044 'textarea', 36045 'validationerror', 36046 'progresssteps', 36047 'activeprogressstep', 36048 'progresscircle', 36049 'progressline' 36050 ]); 36051 36052 var iconTypes = prefix([ 36053 'success', 36054 'warning', 36055 'info', 36056 'question', 36057 'error' 36058 ]); 36059 36060 var defaultParams = { 36061 title: '', 36062 text: '', 36063 html: '', 36064 type: null, 36065 customClass: '', 36066 animation: true, 36067 allowOutsideClick: true, 36068 allowEscapeKey: true, 36069 showConfirmButton: true,
36070 showCancelButton: false, 36071 preConfirm: null, 36072 confirmButtonText: 'OK', 36073 confirmButtonColor: '#3085d6', 36074 confirmButtonClass: null, 36075 cancelButtonText: 'Cancel', 36076 cancelButtonColor: '#aaa', 36077 cancelButtonClass: null, 36078 buttonsStyling: true, 36079 reverseButtons: false, 36080 focusCancel: false, 36081 showCloseButton: false, 36082 showLoaderOnConfirm: false, 36083 imageUrl: null, 36084 imageWidth: null, 36085 imageHeight: null, 36086 imageClass: null, 36087 timer: null, 36088 width: 500, 36089 padding: 20, 36090 background: '#fff', 36091 input: null, 36092 inputPlaceholder: '', 36093 inputValue: '', 36094 inputOptions: {}, 36095 inputAutoTrim: true, 36096 inputClass: null, 36097 inputAttributes: {}, 36098 inputValidator: null, 36099 progressSteps: [], 36100 currentProgressStep: null, 36101 progressStepsDistance: '40px', 36102 onOpen: null, 36103 onClose: null 36104 }; 36105 36106 var sweetHTML = '<div class="' + swalClasses.modal + '" style="display: none" tabIndex="-1">' + 36107 '<ul class="' + swalClasses.progresssteps + '"></ul>' + 36108 '<div class="' + swalClasses.icon + ' ' + iconTypes.error + '">' + 36109 '<span class="x-mark"><span class="line left"></span><span class="line right"></span></span>' + 36110 '</div>' + 36111 '<div class="' + swalClasses.icon + ' ' + iconTypes.question + '">?</div>' + 36112 '<div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">!</div>' + 36113 '<div class="' + swalClasses.icon + ' ' + iconTypes.info + '">i</div>' + 36114 '<div class="' + swalClasses.icon + ' ' + iconTypes.success + '">' + 36115 '<span class="line tip"></span> <span class="line long"></span>' + 36116 '<div class="placeholder"></div> <div class="fix"></div>' + 36117 '</div>' + 36118 '<img class="' + swalClasses.image + '">' + 36119 '<h2></h2>' + 36120 '<div class="' + swalClasses.content + '"></div>' + 36121 '<input class="' + swalClasses.input + '">' + 36122 '<input type="file" class="' + swalClasses.file + '">' + 36123 '<div class="' + swalClasses.range + '">' + 36124 '<output></output>' + 36125 '<input type="range">' + 36126 '</div>' + 36127 '<select class="' + swalClasses.select + '"></select>' + 36128 '<div class="' + swalClasses.radio + '"></div>' + 36129 '<label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">' + 36130 '<input type="checkbox">' + 36131 '</label>' + 36132 '<textarea class="' + swalClasses.textarea + '"></textarea>' + 36133 '<div class="' + swalClasses.validationerror + '"></div>' + 36134 '<hr class="' + swalClasses.spacer + '">' + 36135 '<button type="button" class="' + swalClasses.confirm + '">OK</button>' + 36136 '<button type="button" class="' + swalClasses.cancel + '">Cancel</button>' + 36137 '<span class="' + swalClasses.close + '">×</span>' + 36138 '</div>'; 36139 36140 var sweetContainer; 36141 36142 var existingSweetContainers = document.getElementsByClassName(swalClasses.container); 36143 36144 if (existingSweetContainers.length) { 36145 sweetContainer = existingSweetContainers[0]; 36146 } else { 36147 sweetContainer = document.createElement('div'); 36148 sweetContainer.className = swalClasses.container; 36149 sweetContainer.innerHTML = sweetHTML; 36150 } 36151 36152 var extend = function(a, b) { 36153 for (var key in b) { 36154 if (b.hasOwnProperty(key)) { 36155 a[key] = b[key]; 36156 } 36157 } 36158 36159 return a; 36160 }; 36161 36162 36163 /* 36164 * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color) 36165 */ 36166 var colorLuminance = function(hex, lum) { 36167 // Validate hex string 36168 hex = String(hex).replace(/[^0-9a-f]/gi, ''); 36169 if (hex.length < 6) { 36170 hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; 36171 } 36172 lum = lum || 0; 36173 36174 // Convert to decimal and change luminosity 36175 var rgb = '#'; 36176 for (var i = 0; i < 3; i++) { 36177 var c = parseInt(hex.substr(i * 2, 2), 16); 36178 c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16); 36179 rgb += ('00' + c).substr(c.length); 36180 } 36181 36182 return rgb; 36183 }; 36184 36185 // Remember state in cases where opening and handling a modal will fiddle with it. 36186 var states = { 36187 previousWindowKeyDown: null, 36188 previousActiveElement: null, 36189 previousBodyPadding: null 36190 }; 36191 36192 /* 36193 * Add modal + overlay to DOM 36194 */ 36195 var init = function() { 36196 if (typeof document === 'undefined') { 36197 console.error('SweetAlert2 requires document to initialize'); 36198 return; 36199 } else if (document.getElementsByClassName(swalClasses.container).length) { 36200 return; 36201 } 36202 36203 document.body.appendChild(sweetContainer); 36204 36205 var modal = getModal(); 36206 var input = getChildByClass(modal, swalClasses.input); 36207 var file = getChildByClass(modal, swalClasses.file); 36208 var range = modal.querySelector('.' + swalClasses.range + ' input'); 36209 var select = getChildByClass(modal, swalClasses.select); 36210 var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input'); 36211 var textarea = getChildByClass(modal, swalClasses.textarea); 36212 36213 input.oninput = function() { 36214 sweetAlert.resetValidationError(); 36215 }; 36216 36217 input.onkeyup = function(event) { 36218 event.stopPropagation(); 36219 if (event.keyCode === 13) { 36220 sweetAlert.clickConfirm(); 36221 } 36222 }; 36223 36224 file.onchange = function() { 36225 sweetAlert.resetValidationError(); 36226 }; 36227 36228 range.oninput = function() { 36229 sweetAlert.resetValidationError(); 36230 range.previousSibling.value = range.value; 36231 }; 36232 36233 range.onchange = function() { 36234 sweetAlert.resetValidationError(); 36235 range.previousSibling.value = range.value; 36236 }; 36237 36238 select.onchange = function() { 36239 sweetAlert.resetValidationError(); 36240 }; 36241 36242 checkbox.onchange = function() { 36243 sweetAlert.resetValidationError(); 36244 }; 36245 36246 textarea.oninput = function() { 36247 sweetAlert.resetValidationError(); 36248 }; 36249 36250 return modal; 36251 }; 36252 36253 /* 36254 * Manipulate DOM 36255 */ 36256 var elementByClass = function(className) { 36257 return sweetContainer.querySelector('.' + className); 36258 }; 36259 36260 var getModal = function() { 36261 return document.body.querySelector('.' + swalClasses.modal) || init(); 36262 }; 36263 36264 var getIcons = function() { 36265 var modal = getModal(); 36266 return modal.querySelectorAll('.' + swalClasses.icon); 36267 }; 36268 36269 var getSpacer = function() { 36270 return elementByClass(swalClasses.spacer); 36271 }; 36272 36273 var getProgressSteps = function() { 36274 return elementByClass(swalClasses.progresssteps); 36275 }; 36276 36277 var getValidationError = function() { 36278 return elementByClass(swalClasses.validationerror); 36279 }; 36280 36281 var getConfirmButton = function() { 36282 return elementByClass(swalClasses.confirm); 36283 }; 36284 36285 var getCancelButton = function() { 36286 return elementByClass(swalClasses.cancel); 36287 }; 36288 36289 var getCloseButton = function() { 36290 return elementByClass(swalClasses.close); 36291 }; 36292 36293 var getFocusableElements = function(focusCancel) { 36294 var buttons = [getConfirmButton(), getCancelButton()]; 36295 if (focusCancel) { 36296 buttons.reverse(); 36297 } 36298 return buttons.concat(Array.prototype.slice.call( 36299 getModal().querySelectorAll('button:not([class^=' + swalPrefix + ']), input:not([type=hidden]), textarea, select') 36300 )); 36301 }; 36302 36303 var hasClass = function(elem, className) { 36304 return elem.classList.contains(className); 36305 }; 36306 36307 var focusInput = function(input) { 36308 input.focus(); 36309 36310 // place cursor at end of text in text input 36311 if (input.type !== 'file') { 36312 // http://stackoverflow.com/a/2345915/1331425 36313 var val = input.value; 36314 input.value = ''; 36315 input.value = val; 36316 } 36317 }; 36318 36319 var addClass = function(elem, className) { 36320 if (!elem || !className) { 36321 return; 36322 } 36323 var classes = className.split(/\s+/);
36324 classes.forEach(function(className) { 36325 elem.classList.add(className); 36326 }); 36327 }; 36328 36329 var removeClass = function(elem, className) { 36330 if (!elem || !className) { 36331 return; 36332 } 36333 var classes = className.split(/\s+/); 36334 classes.forEach(function(className) { 36335 elem.classList.remove(className); 36336 }); 36337 }; 36338 36339 var getChildByClass = function(elem, className) { 36340 for (var i = 0; i < elem.childNodes.length; i++) { 36341 if (hasClass(elem.childNodes[i], className)) { 36342 return elem.childNodes[i]; 36343 } 36344 } 36345 }; 36346 36347 var show = function(elem, display) { 36348 if (!display) { 36349 display = 'block'; 36350 } 36351 elem.style.opacity = ''; 36352 elem.style.display = display; 36353 }; 36354 36355 var hide = function(elem) { 36356 elem.style.opacity = ''; 36357 elem.style.display = 'none'; 36358 }; 36359 36360 var empty = function(elem) { 36361 while (elem.firstChild) { 36362 elem.removeChild(elem.firstChild); 36363 } 36364 }; 36365 36366 // borrowed from jqeury $(elem).is(':visible') implementation 36367 var isVisible = function(elem) { 36368 return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length; 36369 }; 36370 36371 var removeStyleProperty = function(elem, property) { 36372 if (elem.style.removeProperty) { 36373 elem.style.removeProperty(property); 36374 } else { 36375 elem.style.removeAttribute(property); 36376 } 36377 }; 36378 36379 var fireClick = function(node) { 36380 // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/ 36381 // Then fixed for today's Chrome browser. 36382 if (typeof MouseEvent === 'function') { 36383 // Up-to-date approach 36384 var mevt = new MouseEvent('click', { 36385 view: window, 36386 bubbles: false, 36387 cancelable: true 36388 }); 36389 node.dispatchEvent(mevt); 36390 } else if (document.createEvent) { 36391 // Fallback 36392 var evt = document.createEvent('MouseEvents'); 36393 evt.initEvent('click', false, false); 36394 node.dispatchEvent(evt); 36395 } else if (document.createEventObject) { 36396 node.fireEvent('onclick'); 36397 } else if (typeof node.onclick === 'function') { 36398 node.onclick(); 36399 } 36400 }; 36401 36402 var stopEventPropagation = function(e) { 36403 // In particular, make sure the space bar doesn't scroll the main window. 36404 if (typeof e.stopPropagation === 'function') { 36405 e.stopPropagation(); 36406 e.preventDefault(); 36407 } else if (window.event && window.event.hasOwnProperty('cancelBubble')) { 36408 window.event.cancelBubble = true; 36409 } 36410 }; 36411 36412 var animationEndEvent = (function() { 36413 var testEl = document.createElement('div'), 36414 transEndEventNames = { 36415 'WebkitAnimation': 'webkitAnimationEnd', 36416 'OAnimation': 'oAnimationEnd oanimationend', 36417 'msAnimation': 'MSAnimationEnd', 36418 'animation': 'animationend' 36419 }; 36420 for (var i in transEndEventNames) { 36421 if (transEndEventNames.hasOwnProperty(i) && 36422 testEl.style[i] !== undefined) { 36423 return transEndEventNames[i]; 36424 } 36425 } 36426 36427 return false; 36428 })(); 36429 36430 36431 // Reset the page to its previous state 36432 var resetPrevState = function() { 36433 var modal = getModal(); 36434 window.onkeydown = states.previousWindowKeyDown; 36435 if (states.previousActiveElement && states.previousActiveElement.focus) { 36436 states.previousActiveElement.focus(); 36437 } 36438 clearTimeout(modal.timeout); 36439 }; 36440 36441 // Measure width of scrollbar 36442 // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286 36443 var measureScrollbar = function() { 36444 var scrollDiv = document.createElement('div'); 36445 scrollDiv.style.width = '50px'; 36446 scrollDiv.style.height = '50px'; 36447 scrollDiv.style.overflow = 'scroll'; 36448 document.body.appendChild(scrollDiv); 36449 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 36450 document.body.removeChild(scrollDiv); 36451 return scrollbarWidth; 36452 }; 36453 36454 // JavaScript Debounce Function 36455 // https://davidwalsh.name/javascript-debounce-function 36456 var debounce = function(func, wait, immediate) { 36457 var timeout; 36458 return function() { 36459 var context = this, args = arguments; 36460 var later = function() { 36461 timeout = null;
36462 if (!immediate) func.apply(context, args); 36463 }; 36464 var callNow = immediate && !timeout; 36465 clearTimeout(timeout); 36466 timeout = setTimeout(later, wait); 36467 if (callNow) func.apply(context, args); 36468 }; 36469 }; 36470 36471 var modalParams = extend({}, defaultParams); 36472 var queue = []; 36473 var swal2Observer; 36474 36475 /* 36476 * Set type, text and actions on modal 36477 */ 36478 var setParameters = function(params) { 36479 var modal = getModal(); 36480 36481 for (var param in params) { 36482 if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') { 36483 console.warn('SweetAlert2: Unknown parameter "' + param + '"'); 36484 } 36485 } 36486 36487 // set modal width and margin-left 36488 modal.style.width = (typeof params.width === 'number') ? params.width + 'px' : params.width; 36489 36490 modal.style.padding = params.padding + 'px'; 36491 modal.style.background = params.background; 36492 36493 var $title = modal.querySelector('h2'); 36494 var $content = modal.querySelector('.' + swalClasses.content); 36495 var $confirmBtn = getConfirmButton(); 36496 var $cancelBtn = getCancelButton(); 36497 var $closeButton = modal.querySelector('.' + swalClasses.close); 36498 36499 // Title 36500 $title.innerHTML = params.title.split('\n').join('<br>'); 36501 36502 // Content 36503 var i; 36504 if (params.text || params.html) { 36505 if (typeof params.html === 'object') { 36506 $content.innerHTML = ''; 36507 if (0 in params.html) { 36508 for (i = 0; i in params.html; i++) { 36509 $content.appendChild(params.html[i].cloneNode(true)); 36510 } 36511 } else { 36512 $content.appendChild(params.html.cloneNode(true)); 36513 } 36514 } else { 36515 $content.innerHTML = params.html || (params.text.split('\n').join('<br>')); 36516 } 36517 show($content); 36518 } else { 36519 hide($content); 36520 } 36521 36522 // Close button 36523 if (params.showCloseButton) { 36524 show($closeButton); 36525 } else { 36526 hide($closeButton); 36527 } 36528 36529 // Custom Class 36530 modal.className = swalClasses.modal; 36531 if (params.customClass) { 36532 addClass(modal, params.customClass); 36533 } 36534 36535 // Progress steps 36536 var progressStepsContainer = getProgressSteps(); 36537 var currentProgressStep = parseInt(params.currentProgressStep === null? sweetAlert.getQueueStep() : params.currentProgressStep, 10); 36538 if (params.progressSteps.length) { 36539 show(progressStepsContainer); 36540 empty(progressStepsContainer); 36541 if (currentProgressStep >= params.progressSteps.length) { 36542 console.warn( 36543 'SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + 36544 '(currentProgressStep like JS arrays starts from 0)' 36545 ); 36546 } 36547 params.progressSteps.forEach(function(step, index) { 36548 var circle = document.createElement('li'); 36549 addClass(circle, swalClasses.progresscircle); 36550 circle.innerHTML = step; 36551 if (index === currentProgressStep) { 36552 addClass(circle, swalClasses.activeprogressstep); 36553 } 36554 progressStepsContainer.appendChild(circle); 36555 if (index !== params.progressSteps.length - 1) { 36556 var line = document.createElement('li'); 36557 addClass(line, swalClasses.progressline); 36558 line.style.width = params.progressStepsDistance; 36559 progressStepsContainer.appendChild(line); 36560 } 36561 }); 36562 } else { 36563 hide(progressStepsContainer); 36564 } 36565 36566 // Icon 36567 var icons = getIcons(); 36568 for (i = 0; i < icons.length; i++) { 36569 hide(icons[i]); 36570 } 36571 if (params.type) { 36572 var validType = false;
36573 for (var iconType in iconTypes) { 36574 if (params.type === iconType) { 36575 validType = true; 36576 break; 36577 } 36578 } 36579 if (!validType) { 36580 console.error('SweetAlert2: Unknown alert type: ' + params.type); 36581 return false; 36582 } 36583 var $icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]); 36584 show($icon); 36585 36586 // Animate icon 36587 switch (params.type) { 36588 case 'success': 36589 addClass($icon, 'animate'); 36590 addClass($icon.querySelector('.tip'), 'animate-success-tip'); 36591 addClass($icon.querySelector('.long'), 'animate-success-long'); 36592 break; 36593 case 'error': 36594 addClass($icon, 'animate-error-icon'); 36595 addClass($icon.querySelector('.x-mark'), 'animate-x-mark'); 36596 break; 36597 case 'warning': 36598 addClass($icon, 'pulse-warning'); 36599 break; 36600 default: 36601 break; 36602 } 36603 36604 } 36605 36606 // Custom image 36607 var $customImage = modal.querySelector('.' + swalClasses.image); 36608 if (params.imageUrl) { 36609 $customImage.setAttribute('src', params.imageUrl); 36610 show($customImage); 36611 36612 if (params.imageWidth) { 36613 $customImage.setAttribute('width', params.imageWidth); 36614 } else { 36615 $customImage.removeAttribute('width'); 36616 } 36617 36618 if (params.imageHeight) { 36619 $customImage.setAttribute('height', params.imageHeight); 36620 } else { 36621 $customImage.removeAttribute('height'); 36622 } 36623 36624 $customImage.className = swalClasses.image; 36625 if (params.imageClass) { 36626 addClass($customImage, params.imageClass); 36627 } 36628 } else { 36629 hide($customImage); 36630 } 36631 36632 // Cancel button 36633 if (params.showCancelButton) { 36634 $cancelBtn.style.display = 'inline-block'; 36635 } else { 36636 hide($cancelBtn); 36637 } 36638 36639 // Confirm button 36640 if (params.showConfirmButton) { 36641 removeStyleProperty($confirmBtn, 'display'); 36642 } else { 36643 hide($confirmBtn); 36644 } 36645 36646 // Buttons spacer 36647 var spacer = getSpacer(); 36648 if (!params.showConfirmButton && !params.showCancelButton) { 36649 hide(spacer); 36650 } else { 36651 show(spacer); 36652 } 36653 36654 // Edit text on cancel and confirm buttons 36655 $confirmBtn.innerHTML = params.confirmButtonText; 36656 $cancelBtn.innerHTML = params.cancelButtonText; 36657 36658 // Set buttons to selected background colors 36659 if (params.buttonsStyling) { 36660 $confirmBtn.style.backgroundColor = params.confirmButtonColor; 36661 $cancelBtn.style.backgroundColor = params.cancelButtonColor; 36662 } 36663 36664 // Add buttons custom classes 36665 $confirmBtn.className = swalClasses.confirm; 36666 addClass($confirmBtn, params.confirmButtonClass); 36667 $cancelBtn.className = swalClasses.cancel; 36668 addClass($cancelBtn, params.cancelButtonClass); 36669 36670 // Buttons styling 36671 if (params.buttonsStyling) { 36672 addClass($confirmBtn, 'styled'); 36673 addClass($cancelBtn, 'styled'); 36674 } else { 36675 removeClass($confirmBtn, 'styled'); 36676 removeClass($cancelBtn, 'styled'); 36677 36678 $confirmBtn.style.backgroundColor = $confirmBtn.style.borderLeftColor = $confirmBtn.style.borderRightColor = ''; 36679 $cancelBtn.style.backgroundColor = $cancelBtn.style.borderLeftColor = $cancelBtn.style.borderRightColor = ''; 36680 } 36681 36682 // CSS animation 36683 if (params.animation === true) { 36684 removeClass(modal, 'no-animation'); 36685 } else { 36686 addClass(modal, 'no-animation'); 36687 } 36688 }; 36689 36690 /* 36691 * Animations 36692 */ 36693 var openModal = function(animation, onComplete) { 36694 var modal = getModal(); 36695 if (animation) { 36696 addClass(modal, 'show-swal2'); 36697 addClass(sweetContainer, 'fade'); 36698 removeClass(modal, 'hide-swal2'); 36699 } else { 36700 removeClass(modal, 'fade'); 36701 } 36702 show(modal); 36703 36704 // scrolling is 'hidden' until animation is done, after that 'auto' 36705 sweetContainer.style.overflowY = 'hidden'; 36706 if (animationEndEvent && !hasClass(modal, 'no-animation')) { 36707 modal.addEventListener(animationEndEvent, function swalCloseEventFinished() { 36708 modal.removeEventListener(animationEndEvent, swalCloseEventFinished); 36709 sweetContainer.style.overflowY = 'auto'; 36710 }); 36711 } else { 36712 sweetContainer.style.overflowY = 'auto'; 36713 } 36714 36715 addClass(sweetContainer, 'in'); 36716 addClass(document.body, swalClasses.in); 36717 fixScrollbar(); 36718 states.previousActiveElement = document.activeElement; 36719 if (onComplete !== null && typeof onComplete === 'function') { 36720 onComplete.call(this, modal); 36721 } 36722 }; 36723 36724 function fixScrollbar() { 36725 // for queues, do not do this more than once 36726 if (states.previousBodyPadding !== null) { 36727 return; 36728 } 36729 // if the body has overflow 36730 if (document.body.scrollHeight > window.innerHeight) { 36731 // add padding so the content doesn't shift after removal of scrollbar 36732 states.previousBodyPadding = document.body.style.paddingRight; 36733 document.body.style.paddingRight = measureScrollbar() + 'px'; 36734 } 36735 } 36736 36737 function undoScrollbar() { 36738 if (states.previousBodyPadding !== null) { 36739 document.body.style.paddingRight = states.previousBodyPadding; 36740 states.previousBodyPadding = null; 36741 } 36742 } 36743 36744 function modalDependant() { 36745 if (arguments[0] === undefined) { 36746 console.error('SweetAlert2 expects at least 1 attribute!'); 36747 return false;
36748 } 36749 36750 var params = extend({}, modalParams); 36751 36752 switch (typeof arguments[0]) { 36753 36754 case 'string': 36755 params.title = arguments[0]; 36756 params.text = arguments[1] || ''; 36757 params.type = arguments[2] || ''; 36758 36759 break; 36760 36761 case 'object': 36762 extend(params, arguments[0]); 36763 params.extraParams = arguments[0].extraParams; 36764 36765 if (params.input === 'email' && params.inputValidator === null) { 36766 params.inputValidator = function(email) { 36767 return new Promise(function(resolve, reject) { 36768 var emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; 36769 if (emailRegex.test(email)) { 36770 resolve(); 36771 } else { 36772 reject('Invalid email address'); 36773 } 36774 }); 36775 }; 36776 } 36777 36778 break; 36779 36780 default: 36781 console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + typeof arguments[0]); 36782 return false; 36783 } 36784 36785 setParameters(params); 36786 36787 // Modal interactions 36788 var modal = getModal(); 36789 36790 return new Promise(function(resolve, reject) { 36791 // Close on timer 36792 if (params.timer) { 36793 modal.timeout = setTimeout(function() { 36794 sweetAlert.closeModal(params.onClose); 36795 reject('timer'); 36796 }, params.timer); 36797 } 36798 36799 // Get input element by specified type or, if type isn't specified, by params.input 36800 var getInput = function(inputType) { 36801 inputType = inputType || params.input; 36802 switch (inputType) { 36803 case 'select': 36804 case 'textarea': 36805 case 'file': 36806 return getChildByClass(modal, swalClasses[inputType]); 36807 case 'checkbox': 36808 return modal.querySelector('.' + swalClasses.checkbox + ' input'); 36809 case 'radio': 36810 return modal.querySelector('.' + swalClasses.radio + ' input:checked') || 36811 modal.querySelector('.' + swalClasses.radio + ' input:first-child'); 36812 case 'range': 36813 return modal.querySelector('.' + swalClasses.range + ' input'); 36814 default: 36815 return getChildByClass(modal, swalClasses.input); 36816 } 36817 }; 36818 36819 // Get the value of the modal input 36820 var getInputValue = function() { 36821 var input = getInput(); 36822 if (!input) { 36823 return null; 36824 } 36825 switch (params.input) { 36826 case 'checkbox': 36827 return input.checked ? 1 : 0; 36828 case 'radio': 36829 return input.checked ? input.value : null; 36830 case 'file': 36831 return input.files.length ? input.files[0] : null; 36832 default: 36833 return params.inputAutoTrim? input.value.trim() : input.value; 36834 } 36835 }; 36836 36837 // input autofocus 36838 if (params.input) { 36839 setTimeout(function() { 36840 var input = getInput(); 36841 if (input) { 36842 focusInput(input); 36843 } 36844 }, 0); 36845 } 36846 36847 var confirm = function(value) { 36848 if (params.showLoaderOnConfirm) { 36849 sweetAlert.showLoading(); 36850 } 36851 36852 if (params.preConfirm) { 36853 params.preConfirm(value, params.extraParams).then( 36854 function(preConfirmValue) { 36855 sweetAlert.closeModal(params.onClose); 36856 resolve(preConfirmValue || value); 36857 }, 36858 function(error) { 36859 sweetAlert.hideLoading(); 36860 if (error) { 36861 sweetAlert.showValidationError(error); 36862 } 36863 } 36864 ); 36865 } else { 36866 sweetAlert.closeModal(params.onClose); 36867 resolve(value); 36868 } 36869 }; 36870 36871 // Mouse interactions 36872 var onButtonEvent = function(event) { 36873 var e = event || window.event; 36874 var target = e.target || e.srcElement; 36875 var confirmBtn = getConfirmButton(); 36876 var cancelBtn = getCancelButton(); 36877 var targetedConfirm = confirmBtn === target || confirmBtn.contains(target); 36878 var targetedCancel = cancelBtn === target || cancelBtn.contains(target); 36879 36880 switch (e.type) { 36881 case 'mouseover': 36882 case 'mouseup': 36883 if (params.buttonsStyling) { 36884 if (targetedConfirm) { 36885 confirmBtn.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1); 36886 } else if (targetedCancel) { 36887 cancelBtn.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1); 36888 } 36889 } 36890 break; 36891 case 'mouseout': 36892 if (params.buttonsStyling) { 36893 if (targetedConfirm) { 36894 confirmBtn.style.backgroundColor = params.confirmButtonColor; 36895 } else if (targetedCancel) { 36896 cancelBtn.style.backgroundColor = params.cancelButtonColor; 36897 } 36898 } 36899 break; 36900 case 'mousedown': 36901 if (params.buttonsStyling) { 36902 if (targetedConfirm) { 36903 confirmBtn.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2); 36904 } else if (targetedCancel) { 36905 cancelBtn.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2); 36906 } 36907 } 36908 break; 36909 case 'click': 36910 // Clicked 'confirm' 36911 if (targetedConfirm && sweetAlert.isVisible()) { 36912 if (params.input) { 36913 var inputValue = getInputValue(); 36914 36915 if (params.inputValidator) { 36916 sweetAlert.disableInput(); 36917 params.inputValidator(inputValue, params.extraParams).then( 36918 function() { 36919 sweetAlert.enableInput(); 36920 confirm(inputValue); 36921 }, 36922 function(error) { 36923 sweetAlert.enableInput(); 36924 if (error) { 36925 sweetAlert.showValidationError(error); 36926 } 36927 } 36928 ); 36929 } else { 36930 confirm(inputValue); 36931 } 36932 36933 } else { 36934 confirm(true); 36935 } 36936 36937 // Clicked 'cancel' 36938 } else if (targetedCancel && sweetAlert.isVisible()) { 36939 sweetAlert.closeModal(params.onClose); 36940 reject('cancel'); 36941 } 36942 36943 break; 36944 default: 36945 } 36946 }; 36947 36948 var $buttons = modal.querySelectorAll('button'); 36949 var i; 36950 for (i = 0; i < $buttons.length; i++) { 36951 $buttons[i].onclick = onButtonEvent; 36952 $buttons[i].onmouseover = onButtonEvent; 36953 $buttons[i].onmouseout = onButtonEvent; 36954 $buttons[i].onmousedown = onButtonEvent; 36955 } 36956 36957 // Closing modal by close button 36958 getCloseButton().onclick = function() { 36959 sweetAlert.closeModal(params.onClose); 36960 reject('close'); 36961 }; 36962 36963 // Closing modal by overlay click 36964 sweetContainer.onclick = function(e) { 36965 if (e.target !== sweetContainer) { 36966 return; 36967 } 36968 if (params.allowOutsideClick) { 36969 sweetAlert.closeModal(params.onClose); 36970 reject('overlay'); 36971 } 36972 }; 36973 36974 var $confirmButton = getConfirmButton(); 36975 var $cancelButton = getCancelButton(); 36976 36977 // Reverse buttons if neede d 36978 if (params.reverseButtons) { 36979 $confirmButton.parentNode.insertBefore($cancelButton, $confirmButton); 36980 } else { 36981 $confirmButton.parentNode.insertBefore($confirmButton, $cancelButton); 36982 } 36983 36984 // Focus handling 36985 function setFocus(index, increment) { 36986 var focusableElements = getFocusableElements(params.focusCancel); 36987 // search for visible elements and select the next possible match 36988 for (var i = 0; i < focusableElements.length; i++) { 36989 index = index + increment; 36990 36991 // rollover to first item 36992 if (index === focusableElements.length) { 36993 index = 0; 36994 36995 // go to last item 36996 } else if (index === -1) { 36997 index = focusableElements.length - 1; 36998 } 36999 37000 // determine if element is visible 37001 var el = focusableElements[index]; 37002 if (isVisible(el)) { 37003 return el.focus(); 37004 } 37005 } 37006 } 37007 37008 function handleKeyDown(event) { 37009 var e = event || window.event; 37010 var keyCode = e.keyCode || e.which; 37011 37012 if ([9, 13, 32, 27].indexOf(keyCode) === -1) { 37013 // Don't do work on keys we don't care about. 37014 return; 37015 } 37016 37017 var $targetElement = e.target || e.srcElement; 37018 37019 var focusableElements = getFocusableElements(params.focusCancel); 37020 var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
37021 for (var i = 0; i < focusableElements.length; i++) { 37022 if ($targetElement === focusableElements[i]) { 37023 btnIndex = i; 37024 break; 37025 } 37026 } 37027 37028 // TAB 37029 if (keyCode === 9) { 37030 if (!e.shiftKey) { 37031 // Cycle to the next button 37032 setFocus(btnIndex, 1); 37033 } else { 37034 // Cycle to the prev button 37035 setFocus(btnIndex, -1); 37036 } 37037 37038 stopEventPropagation(e); 37039 37040 } else { 37041 if (keyCode === 13 || keyCode === 32) { 37042 if (btnIndex === -1) { 37043 // ENTER/SPACE clicked outside of a button. 37044 if (params.focusCancel) { 37045 fireClick($cancelButton, e); 37046 } else { 37047 fireClick($confirmButton, e); 37048 } 37049 } 37050 } else if (keyCode === 27 && params.allowEscapeKey === true) { 37051 sweetAlert.closeModal(params.onClose); 37052 reject('esc'); 37053 } 37054 } 37055 } 37056 37057 states.previousWindowKeyDown = window.onkeydown; 37058 window.onkeydown = handleKeyDown; 37059 37060 // Loading state 37061 if (params.buttonsStyling) { 37062 $confirmButton.style.borderLeftColor = params.confirmButtonColor; 37063 $confirmButton.style.borderRightColor = params.confirmButtonColor; 37064 } 37065 37066 /** 37067 * Show spinner instead of Confirm button and disable Cancel button 37068 */ 37069 sweetAlert.showLoading = sweetAlert.enableLoading = function() { 37070 show(getSpacer()); 37071 show($confirmButton, 'inline-block'); 37072 addClass($confirmButton, 'loading'); 37073 addClass(modal, 'loading'); 37074 $confirmButton.disabled = true; 37075 $cancelButton.disabled = true; 37076 }; 37077 37078 /** 37079 * Show spinner instead of Confirm button and disable Cancel button 37080 */ 37081 sweetAlert.hideLoading = sweetAlert.disableLoading = function() { 37082 if (!params.showConfirmButton) { 37083 hide($confirmButton); 37084 if (!params.showCancelButton) { 37085 hide(getSpacer()); 37086 } 37087 } 37088 removeClass($confirmButton, 'loading'); 37089 removeClass(modal, 'loading'); 37090 $confirmButton.disabled = false; 37091 $cancelButton.disabled = false; 37092 }; 37093 37094 sweetAlert.enableButtons = function() { 37095 $confirmButton.disabled = false; 37096 $cancelButton.disabled = false; 37097 }; 37098 37099 sweetAlert.disableButtons = function() { 37100 $confirmButton.disabled = true; 37101 $cancelButton.disabled = true; 37102 }; 37103 37104 sweetAlert.enableConfirmButton = function() { 37105 $confirmButton.disabled = false; 37106 }; 37107 37108 sweetAlert.disableConfirmButton = function() { 37109 $confirmButton.disabled = true; 37110 }; 37111 37112 sweetAlert.enableInput = function() { 37113 var input = getInput(); 37114 if (!input) { 37115 return false; 37116 } 37117 if (input.type === 'radio') { 37118 var radiosContainer = input.parentNode.parentNode; 37119 var radios = radiosContainer.querySelectorAll('input'); 37120 for (var i = 0; i < radios.length; i++) { 37121 radios[i].disabled = false; 37122 } 37123 } else { 37124 input.disabled = false; 37125 } 37126 }; 37127 37128 sweetAlert.disableInput = function() { 37129 var input = getInput(); 37130 if (!input) { 37131 return false; 37132 } 37133 if (input && input.type === 'radio') { 37134 var radiosContainer = input.parentNode.parentNode; 37135 var radios = radiosContainer.querySelectorAll('input'); 37136 for (var i = 0; i < radios.length; i++) { 37137 radios[i].disabled = true; 37138 } 37139 } else { 37140 input.disabled = true; 37141 } 37142 }; 37143 37144 // Set modal min-height to disable scrolling inside the modal 37145 sweetAlert.recalculateHeight = debounce(function() { 37146 var modal = getModal(); 37147 var prevState = modal.style.display; 37148 modal.style.minHeight = ''; 37149 show(modal); 37150 modal.style.minHeight = (modal.scrollHeight + 1) + 'px'; 37151 modal.style.display = prevState; 37152 }, 50); 37153 37154 // Show block with validation error 37155 sweetAlert.showValidationError = function(error) {
37156 var validationError = getValidationError(); 37157 validationError.innerHTML = error; 37158 show(validationError); 37159 37160 var input = getInput(); 37161 focusInput(input); 37162 addClass(input, 'error'); 37163 }; 37164 37165 // Hide block with validation error 37166 sweetAlert.resetValidationError = function() { 37167 var validationError = getValidationError(); 37168 hide(validationError); 37169 sweetAlert.recalculateHeight(); 37170 37171 var input = getInput(); 37172 if (input) { 37173 removeClass(input, 'error'); 37174 } 37175 }; 37176 37177 sweetAlert.getProgressSteps = function() { 37178 return params.progressSteps; 37179 }; 37180 37181 sweetAlert.setProgressSteps = function(progressSteps) { 37182 params.progressSteps = progressSteps; 37183 setParameters(params); 37184 }; 37185 37186 sweetAlert.showProgressSteps = function() { 37187 show(getProgressSteps()); 37188 }; 37189 37190 sweetAlert.hideProgressSteps = function() { 37191 hide(getProgressSteps()); 37192 }; 37193 37194 sweetAlert.enableButtons(); 37195 sweetAlert.hideLoading(); 37196 sweetAlert.resetValidationError(); 37197 37198 // inputs 37199 var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; 37200 var input; 37201 for (i = 0; i < inputTypes.length; i++) { 37202 var inputClass = swalClasses[inputTypes[i]]; 37203 var inputContainer = getChildByClass(modal, inputClass); 37204 input = getInput(inputTypes[i]); 37205 37206 // set attributes 37207 if (input) { 37208 for (var j in input.attributes) { 37209 if (input.attributes.hasOwnProperty(j)) { 37210 var attrName = input.attributes[j].name; 37211 if (attrName !== 'type' && attrName !== 'value') { 37212 input.removeAttribute(attrName); 37213 } 37214 } 37215 } 37216 for (var attr in params.inputAttributes) { 37217 input.setAttribute(attr, params.inputAttributes[attr]); 37218 } 37219 } 37220 37221 // set class 37222 inputContainer.className = inputClass; 37223 if (params.inputClass) { 37224 addClass(inputContainer, params.inputClass); 37225 } 37226 37227 hide(inputContainer); 37228 } 37229 37230 var populateInputOptions; 37231 switch (params.input) { 37232 case 'text': 37233 case 'email': 37234 case 'password': 37235 case 'number': 37236 case 'tel': 37237 input = getChildByClass(modal, swalClasses.input); 37238 input.value = params.inputValue; 37239 input.placeholder = params.inputPlaceholder; 37240 input.type = params.input; 37241 show(input); 37242 break; 37243 case 'file': 37244 input = getChildByClass(modal, swalClasses.file); 37245 input.placeholder = params.inputPlaceholder; 37246 input.type = params.input; 37247 show(input); 37248 break; 37249 case 'range': 37250 var range = getChildByClass(modal, swalClasses.range); 37251 var rangeInput = range.querySelector('input'); 37252 var rangeOutput = range.querySelector('output'); 37253 rangeInput.value = params.inputValue; 37254 rangeInput.type = params.input; 37255 rangeOutput.value = params.inputValue; 37256 show(range); 37257 break; 37258 case 'select': 37259 var select = getChildByClass(modal, swalClasses.select); 37260 select.innerHTML = ''; 37261 if (params.inputPlaceholder) { 37262 var placeholder = document.createElement('option'); 37263 placeholder.innerHTML = params.inputPlaceholder; 37264 placeholder.value = ''; 37265 placeholder.disabled = true; 37266 placeholder.selected = true; 37267 select.appendChild(placeholder); 37268 } 37269 populateInputOptions = function(inputOptions) { 37270 for (var optionValue in inputOptions) { 37271 var option = document.createElement('option'); 37272 option.value = optionValue; 37273 option.innerHTML = inputOptions[optionValue]; 37274 if (params.inputValue === optionValue) { 37275 option.selected = true; 37276 } 37277 select.appendChild(option); 37278 } 37279 show(select); 37280 select.focus(); 37281 }; 37282 break; 37283 case 'radio': 37284 var radio = getChildByClass(modal, swalClasses.radio); 37285 radio.innerHTML = ''; 37286 populateInputOptions = function(inputOptions) { 37287 for (var radioValue in inputOptions) { 37288 var id = 1; 37289 var radioInput = document.createElement('input'); 37290 var radioLabel = document.createElement('label'); 37291 var radioLabelSpan = document.createElement('span'); 37292 radioInput.type = 'radio'; 37293 radioInput.name = swalClasses.radio; 37294 radioInput.value = radioValue; 37295 radioInput.id = swalClasses.radio + '-' + (id++); 37296 if (params.inputValue === radioValue) { 37297 radioInput.checked = true; 37298 } 37299 radioLabelSpan.innerHTML = inputOptions[radioValue]; 37300 radioLabel.appendChild(radioInput); 37301 radioLabel.appendChild(radioLabelSpan); 37302 radioLabel.for = radioInput.id; 37303 radio.appendChild(radioLabel); 37304 } 37305 show(radio); 37306 var radios = radio.querySelectorAll('input'); 37307 if (radios.length) { 37308 radios[0].focus(); 37309 } 37310 }; 37311 break; 37312 case 'checkbox': 37313 var checkbox = getChildByClass(modal, swalClasses.checkbox); 37314 var checkboxInput = getInput('checkbox'); 37315 checkboxInput.type = 'checkbox'; 37316 checkboxInput.value = 1; 37317 checkboxInput.id = swalClasses.checkbox; 37318 checkboxInput.checked = Boolean(params.inputValue); 37319 var label = checkbox.getElementsByTagName('span'); 37320 if (label.length) { 37321 checkbox.removeChild(label[0]); 37322 } 37323 label = document.createElement('span'); 37324 label.innerHTML = params.inputPlaceholder; 37325 checkbox.appendChild(label); 37326 show(checkbox); 37327 break; 37328 case 'textarea': 37329 var textarea = getChildByClass(modal, swalClasses.textarea); 37330 textarea.value = params.inputValue; 37331 textarea.placeholder = params.inputPlaceholder; 37332 show(textarea); 37333 break; 37334 case null: 37335 break; 37336 default: 37337 console.error('SweetAlert2: Unexpected type of input! Expected "text" or "email" or "password", "select", "checkbox", "textarea" or "file", got "' + params.input + '"'); 37338 break; 37339 } 37340 37341 if (params.input === 'select' || params.input === 'radio') { 37342 if (params.inputOptions instanceof Promise) { 37343 sweetAlert.showLoading(); 37344 params.inputOptions.then(function(inputOptions) { 37345 sweetAlert.hideLoading(); 37346 populateInputOptions(inputOptions); 37347 }); 37348 } else if (typeof params.inputOptions === 'object') { 37349 populateInputOptions(params.inputOptions); 37350 } else { 37351 console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + typeof params.inputOptions); 37352 } 37353 } 37354 37355 openModal(params.animation, params.onOpen); 37356 37357 // Focus the first element (input or button) 37358 setFocus(-1, 1); 37359 37360 // fix scroll 37361 sweetContainer.scrollTop = 0; 37362 37363 // Observe changes inside the modal and adjust height 37364 if (typeof MutationObserver !== 'undefined' && !swal2Observer) { 37365 swal2Observer = new MutationObserver(sweetAlert.recalculateHeight); 37366 swal2Observer.observe(modal, {childList: true, characterData: true, subtree: true}); 37367 } 37368 }); 37369 } 37370 37371 // SweetAlert function 37372 function sweetAlert() { 37373 // Copy arguments to the local args variable 37374 var args = arguments; 37375 37376 if (sweetAlert.isVisible()) { 37377 sweetAlert.close(); 37378 } 37379 37380 return modalDependant.apply(this, args); 37381 } 37382 37383 /* 37384 * Global function to determine if swal2 modal is visible 37385 */ 37386 sweetAlert.isVisible = function() { 37387 var modal = getModal(); 37388 return isVisible(modal); 37389 }; 37390 37391 /* 37392 * Global function for chaining sweetAlert modals 37393 */ 37394 sweetAlert.queue = function(steps) { 37395 queue = steps; 37396 var modal = getModal(); 37397 var resetQueue = function() { 37398 queue = []; 37399 modal.removeAttribute('data-queue-step'); 37400 }; 37401 return new Promise(function(resolve, reject) { 37402 (function step(i, callback) { 37403 if (i < queue.length) { 37404 modal.setAttribute('data-queue-step', i); 37405 37406 sweetAlert(queue[i]).then(function() { 37407 step(i+1, callback); 37408 }, function(dismiss) { 37409 resetQueue(); 37410 reject(dismiss); 37411 }); 37412 } else { 37413 resetQueue(); 37414 resolve(); 37415 } 37416 })(0); 37417 }); 37418 }; 37419 37420 /* 37421 * Global function for getting the index of current modal in queue 37422 */ 37423 sweetAlert.getQueueStep = function() { 37424 return getModal().getAttribute('data-queue-step'); 37425 }; 37426 37427 /* 37428 * Global function for inserting a modal to the queue 37429 */ 37430 sweetAlert.insertQueueStep = function(step, index) { 37431 if (index && index < queue.length) { 37432 return queue.splice(index, 0, step); 37433 } 37434 return queue.push(step); 37435 }; 37436 37437 /* 37438 * Global function for deleting a modal from the queue 37439 */ 37440 sweetAlert.deleteQueueStep = function(index) { 37441 if (typeof queue[index] !== 'undefined') { 37442 queue.splice(index, 1); 37443 } 37444 }; 37445 37446 /* 37447 * Global function to close sweetAlert 37448 */ 37449 sweetAlert.close = sweetAlert.closeModal = function(onComplete) { 37450 var modal = getModal(); 37451 removeClass(modal, 'show-swal2'); 37452 addClass(modal, 'hide-swal2'); 37453 37454 // Reset icon animations 37455 var $successIcon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes.success); 37456 removeClass($successIcon, 'animate'); 37457 removeClass($successIcon.querySelector('.tip'), 'animate-success-tip'); 37458 removeClass($successIcon.querySelector('.long'), 'animate-success-long'); 37459 37460 var $errorIcon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes.error); 37461 removeClass($errorIcon, 'animate-error-icon'); 37462 removeClass($errorIcon.querySelector('.x-mark'), 'animate-x-mark'); 37463 37464 var $warningIcon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes.warning); 37465 removeClass($warningIcon, 'pulse-warning'); 37466 37467 resetPrevState(); 37468 37469 // If animation is supported, animate 37470 if (animationEndEvent && !hasClass(modal, 'no-animation')) { 37471 modal.addEventListener(animationEndEvent, function swalCloseEventFinished() { 37472 modal.removeEventListener(animationEndEvent, swalCloseEventFinished); 37473 if (hasClass(modal, 'hide-swal2')) { 37474 hide(modal); 37475 removeClass(sweetContainer, 'in'); 37476 removeClass(document.body, swalClasses.in); 37477 undoScrollbar(); 37478 } 37479 }); 37480 } else { 37481 // Otherwise, hide immediately 37482 hide(modal); 37483 removeClass(sweetContainer, 'in'); 37484 removeClass(document.body, swalClasses.in); 37485 undoScrollbar(); 37486 } 37487 if (onComplete !== null && typeof onComplete === 'function') { 37488 onComplete.call(this, modal); 37489 } 37490 }; 37491 37492 /* 37493 * Global function to click 'Confirm' button 37494 */ 37495 sweetAlert.clickConfirm = function() { 37496 getConfirmButton().click(); 37497 }; 37498 37499 /* 37500 * Global function to click 'Cancel' button 37501 */ 37502 sweetAlert.clickCancel = function() { 37503 getCancelButton().click(); 37504 }; 37505 37506 /** 37507 * Set default params for each popup 37508 * @param {Object} userParams 37509 */ 37510 sweetAlert.setDefaults = function(userParams) { 37511 if (!userParams) { 37512 throw new Error('userParams is required'); 37513 } 37514 if (typeof userParams !== 'object') { 37515 throw new Error('userParams has to be a object'); 37516 } 37517 37518 extend(modalParams, userParams); 37519 }; 37520 37521 /** 37522 * Reset default params for each popup 37523 */ 37524 sweetAlert.resetDefaults = function() { 37525 modalParams = extend({}, defaultParams); 37526 }; 37527 37528 sweetAlert.version = '5.2.0'; 37529 37530 if (typeof Promise === 'function') { 37531 Promise.prototype.done = Promise.prototype.done || function() { 37532 return this.catch(function() { 37533 // Catch promise rejections silently. 37534 // https://github.com/limonte/sweetalert2/issues/177 37535 }); 37536 }; 37537 } else { 37538 console.warn('SweetAlert2: Please inlude Promise polyfill BEFORE including sweetalert2.js if IE10+ support needed.'); 37539 } 37540 37541 return sweetAlert; 37542 37543})); 37544if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2; 37545;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/static/javascript/urlParam.js 37546$.urlParam = function(name){ 37547 var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); 37548 if (results==null){ 37549 return null; 37550 } 37551 else{ 37552 return results[1] || 0; 37553 } 37554}; 37555 37556;// /var/www/www.vfb.de/httpdocs/current/static/js/functions.js 37557(function (w) { 37558 37559 $(function () { 37560 37561 if (mobileConverter.pageNeedsToBeConverted()) { 37562 mobileConverter.convertPage(); 37563 } 37564 37565 hideLinksWithUrlNotFound(); 37566 37567 // Klapp-Element 37568 $('.foldelement').on('click', function () { 37569 $(this).toggleClass('show'); 37570 }); 37571 37572 if ($('.data-snippet.carousel').length > 0) {
37573 loadDatacenterNavigation(); 37574 } 37575 37576 vfb.initSwipers = function ($ele, options, innerClass) { 37577 innerClass = innerClass || 'swiper-container-inner'; 37578 function createSwiper(ele, customOptions) { 37579 var swiper = ele.data('dangerousSwiper'); 37580 if (swiper) { 37581 ele.data('dangerousSwiper').destroy(true, true); 37582 } 37583 37584 var options = { 37585 pagination: ele.find('.swiper-pagination'), 37586 paginationClickable: true, 37587 speed: 400, 37588 visibilityFullFit: true, 37589 loop: true, 37590 slidesPerView: 4, 37591 useElementBreakpoints: true, 37592 height: 300, 37593 // Disable preloading of all images 37594 preloadImages: false, 37595 // Enable lazy loading 37596 lazyLoading: true, 37597 nextButton: ele.find('.swiper-button-next'), 37598 prevButton: ele.find('.swiper-button-prev'), 37599 onInit: function (sw) { 37600 sw.onResize(); 37601 } 37602 37603 }; 37604 37605 $.extend(options, customOptions); 37606 ele.data('dangerousSwiper', new Swiper(ele.find('.' + innerClass), options)); 37607 } 37608 37609 if ($ele.length) { 37610 $ele.each(function () { 37611 var that = $(this); 37612 if (that.find('.' + innerClass).length) { 37613 createSwiper(that, options); 37614 } 37615 }); 37616 } 37617 }; 37618 37619 w.vfb.initFootable = function ($rootElement) { 37620 $rootElement = $rootElement || $(document); 37621 var $tables = $rootElement.find('table.table:not(.footable):not(.spieltage):not(.spielplan)'); 37622 37623 $tables.footable({ 37624 useParentWidth: true, 37625 breakpoints: { 37626 "b200": 0, 37627 "b225": 200, 37628 "b250": 225, 37629 "b275": 250, 37630 "b300": 275, 37631 "b325": 300, 37632 "b350": 325, 37633 "b375": 350, 37634 "b400": 375, 37635 "b425": 400, 37636 "b450": 425, 37637 "b475": 450, 37638 "b500": 475, 37639 "b525": 500, 37640 "b550": 525, 37641 "b575": 550, 37642 "b600": 575, 37643 "b625": 600, 37644 "b650": 625, 37645 "b675": 650, 37646 "b700": 675, 37647 "b725": 700, 37648 "b750": 725, 37649 "b775": 750, 37650 "b800": 775, 37651 "b825": 800, 37652 "b850": 825, 37653 "b875": 850, 37654 "b900": 875, 37655 "b925": 900, 37656 "b950": 925, 37657 "b975": 950, 37658 "b1000": 975, 37659 "b1025": 1000, 37660 "b1050": 1025, 37661 "b1075": 1050, 37662 "b1100": 1075, 37663 "b1125": 1100, 37664 "b1150": 1125, 37665 "b1175": 1150, 37666 "b1200": 1175, 37667 "b1225": 1200, 37668 "b1250": 1225, 37669 "b1275": 1250, 37670 "b1300": 1275, 37671 "b1325": 1300, 37672 "b1350": 1325, 37673 "b1375": 1350, 37674 "b1400": 1375, 37675 "b1425": 1400, 37676 "b1450": 1425, 37677 "b1475": 1450, 37678 "b1500": 1475, 37679 "b1525": 1500, 37680 "b1550": 1525, 37681 "b1575": 1550, 37682 "b1600": 1575, 37683 "last": 1600, 37684 "merlin": true 37685 }, 37686 "on": { 37687 "resize.ft.table": function (e, ft) { 37688 ft.draw(); 37689 } 37690 }, 37691 "empty": "Derzeit keine Daten verfügbar" 37692 }); 37693 }; 37694 37695 w.vfb.initFootable(); 37696 37697 w.vfb.lazyLoad = function () { 37698 this.selector = '.lazy'; 37699 37700 this.lazyOptions = { 37701 scrollDirection: 'both', 37702 effect: 'fadeIn', 37703 visibleOnly: true, 37704 defaultImage: '/?proxy=img/platzhalter.jpg', 37705 placeholder: '/?proxy=img/platzhalter.jpg', 37706 onError: function (element) { 37707 console.log('error loading ' + element.data('src')); 37708 } 37709 }; 37710 37711 $(this.selector).Lazy(this.lazyOptions); 37712 }; 37713 37714 w.vfb.lazyLoad(); 37715 37716 // resize textmitbild bild 37717 $(".meldung-bild .image").each(function () { 37718 var thatImageClass = $(this); 37719 var image = $(this).find('img'); 37720 $(image).load(function () { 37721 var imgWidth = image.css('width'); 37722 thatImageClass.css("max-width", imgWidth); 37723 }); 37724 }); 37725 37726 if (window.location.search.indexOf("?mobile") === -1) { 37727 new SmartBanner({ 37728 daysHidden: 15, // days to hide banner after close button is clicked (defaults to 15) 37729 daysReminder: 90, // days to hide banner after "VIEW" button is clicked (defaults to 90) 37730 appStoreLanguage: 'de', // language code for the App Store (defaults to user's browser language) 37731 title: 'VfB Stuttgart', 37732 author: 'VfB Stuttgart 1893 AG', 37733 button: 'ÃFFNEN', 37734 store: { 37735 ios: 'Im App Store', 37736 android: 'In Google Play', 37737 windows: 'Im Windows store' 37738 }, 37739 price: { 37740 ios: 'Gratis', 37741 android: 'Gratis', 37742 windows: 'Gratis' 37743 } 37744 , icon: '/?proxy=img/logo_app.png' 37745 }); 37746 } 37747 37748 // DSV-4222 BannerBar 37749 if ($(".bannerbar").length) { 37750 $(".bannerbar").each(function () { 37751 let jsonFile = $(this).data('jsonfile'); 37752 let path = jsonFile.substr(0, jsonFile.lastIndexOf('/')); 37753 let that = $(this); 37754 let items = []; 37755 37756 $.getJSON(jsonFile, function( data ) { 37757 $.each( data.data, function( i, item ) { 37758 items.push(item); 37759 }); 37760 }).done(function() { 37761 37762 let startNumbers = []; 37763 for (i=0; i < 4; i++) { 37764 do { 37765 randomStartNumber = Math.floor(Math.random() * items.length); 37766 } while (startNumbers.includes(randomStartNumber)); 37767 startNumbers.push(randomStartNumber); 37768 } 37769 37770 bannerBar(that, startNumbers, items, path); 37771 37772 setInterval(function() { 37773 for (i=0; i < 4; i++) { 37774 startNumbers[i] = startNumbers[i]+1 < items.length ? startNumbers[i]+1 : 0; 37775 } 37776 bannerBar(that, startNumbers, items, path); 37777 }, 5000); 37778 }); 37779 37780 }); 37781 } 37782 37783 // Schleife 37784 let $vfbSchleifeElements = $('.vfb_schleife_brustkrebsvorsorge'); 37785 let startDate = new Date(2025, 9, 25, 18, 0, 0, 0); 37786 let endDate = new Date(2025, 9, 27, 12, 0, 0, 0); 37787 let now = new Date(); 37788 37789 if(now >= startDate && now <= endDate) { 37790 $vfbSchleifeElements.each(function( ) { 37791 $( this ).show(); 37792 }); 37793 } 37794 37795 }); 37796 37797}(window)); 37798 37799$(window).on('load', function () { 37800 $(window).resize(); 37801}); 37802 37803vfb.toggleInstances = { 37804 switchContent: undefined 37805}; 37806 37807$(document).on('click', 'a.datacenter-switch', function () { 37808 var $this = $(this), 37809 targetClass = $this.data('target'), 37810 path = $this.data('path'), 37811 leagueId = $this.data('leagueid'); 37812 37813 switchContent(targetClass, path, undefined, function (response) { 37814 if (response) { 37815 $('a.datacenter-switch.active').removeClass('active'); 37816 $('a.datacenter-switch[data-leagueid=' + leagueId + ']').addClass('active'); 37817 } 37818 }); 37819}); 37820 37821function bannerBar(that, ids, items, path) { 37822 that.find('.swiper-slide').fadeOut("slow", function() { 37823 for (i=0; i < 4; i++) { 37824 let item = items[ids[i]]; 37825 that.find('.swiper-slide').eq(i).find('a').attr('href', item.url ? item.url : 'javascript:'); 37826 that.find('.swiper-slide').eq(i).find('a').attr('target', item.url ? '_blank' : ''); 37827 that.find('.swiper-slide').eq(i).find('a').attr('title', item.title); 37828 that.find('.swiper-slide').eq(i).find('a img').attr('alt', item.title); 37829 that.find('.swiper-slide').eq(i).find('a img').attr('src', path + '/' + item.image + '.jpg'); 37830 } 37831 that.find('.swiper-slide').fadeIn("slow"); 37832 }); 37833} 37834 37835function switchContent(elem, fileToLoad, dataMenu, callback) { 37836 var fileUrl = ajaxUrlData + '&filename=' + fileToLoad.replace('/static/', ''), 37837 $carouselContent = $(elem).find('.ticker-carousel'); 37838 37839 if ($carouselContent.length) { 37840 $carouselContent.html('').addClass('vfb-loader'); 37841 } 37842 37843 $.ajax({ 37844 url: fileUrl, 37845 dataType: 'json', 37846 success: function (newContent) { 37847 if (typeof newContent.html === "undefined") { 37848 return; 37849 } 37850 var $currentEle = $(elem); 37851 var $newContent = $('<root>' + newContent.html + '</root>'); 37852 var toggleInstance = new vfb.initFootableToggle($newContent, $currentEle, vfb.toggleInstances.switchContent); 37853 vfb.toggleInstances.switchContent = toggleInstance.key; 37854 37855 if (elem == '.wrapper.team') { 37856 $currentEle.html($newContent); 37857 vfb.initFootable($currentEle); 37858 var spv = 5; 37859 var slideCnt = $('.meldung-team').find('.swiper-container-inner .swiper-slide').length; 37860 37861 if (slideCnt < 5) { 37862 spv = slideCnt; 37863 } 37864 37865 vfb.initSwipers($('.meldung-team'), { 37866 slidesPerView: spv, 37867 breakpoints: { 37868 1000: { 37869 slidesPerView: 4, 37870 spaceBetweenSlides: 0 37871 }, 37872 800: { 37873 slidesPerView: 3, 37874 spaceBetweenSlides: 0 37875 }, 37876 585: { 37877 slidesPerView: 2, 37878 spaceBetweenSlides: 0 37879 }, 37880 400: { 37881 slidesPerView: 1, 37882 spaceBetweenSlides: 0 37883 } 37884 } 37885 }); 37886 } else if (elem == '.data-snippet.carousel') {
37887 loadDatacenterNavigation(dataMenu, $newContent, function (success) { 37888 if (success) { 37889 $currentEle.html($newContent); 37890 initialSlide = $currentEle.find(".swiper-container").attr("data-initial-slide"); 37891 vfb.initFootable($currentEle); 37892 vfb.initSwipers($('.ticker-carousel'), { 37893 slidesPerView: 1, 37894 initialSlide: parseInt(initialSlide) 37895 }); 37896 if (typeof callback === "function") { 37897 callback(true); 37898 } 37899 } 37900 }); 37901 } else { 37902 $currentEle.html($newContent); 37903 vfb.initFootable($currentEle); 37904 } 37905 }, error: function () { 37906 if ($carouselContent.length) { 37907 $carouselContent.removeClass('vfb-loader'); 37908 } 37909 } 37910 }); 37911} 37912 37913function loadDatacenterNavigation(activeMenu, $rootElement, callback) { 37914 $rootElement = $rootElement || $(document); 37915 var menuNode = $rootElement.find('.data-snippet.carousel .meldung-navi'); 37916 37917 var fileUrl = ajaxUrlData + '&filename=ticker-files/vfb_karussell_menu.html'; 37918 $.ajax({ 37919 url: fileUrl, 37920 dataType: 'json', 37921 success: function (menu) { 37922 menuNode.html(menu.html); 37923 37924 if (activeMenu !== undefined) { 37925 menuNode.find('a').removeClass('active'); 37926 menuNode.find('a[data-menu="' + activeMenu + '"]').addClass('active'); 37927 } 37928 if (callback) { 37929 callback(true); 37930 } 37931 }, 37932 error: function () { 37933 if (callback) { 37934 callback(false); 37935 } 37936 } 37937 }); 37938} 37939 37940function hideLinksWithUrlNotFound() { 37941 $('body').find('a[href=#urlNotFound]').hide(); 37942} 37943 37944function switchVisibility(elem, dataToShow) { 37945 var navi = $(elem).prev('.meldung-navi'); 37946 navi.find('a').removeClass('active'); 37947 navi.find('a[data-show = "' + dataToShow + '"]').addClass('active'); 37948 37949 $(elem).addClass('hidden'); 37950 $(elem + '[data-show = "' + dataToShow + '"]').removeClass('hidden'); 37951 37952 $(window).resize(); 37953} 37954 37955function resizeFrame() { 37956 var windowWidth = $(window).width(); 37957 var contentWidth = $(".content").width(); 37958 if (windowWidth <= 1024) { 37959 $("iframe").css("width", contentWidth); 37960 } else { 37961 $("iframe").css("width", "100%"); 37962 } 37963} 37964$(document).ready(resizeFrame); 37965$(window).resize(resizeFrame); 37966 37967 37968/* Code for Download-Tracking */ 37969/*$(document).on('click', 'a[href]', function () { 37970 var requestUrlOriginial = $(this).attr('href').toLowerCase(); 37971 var testUrl = requestUrlOriginial.toLowerCase(); 37972 var regex = new RegExp("(/downloads/).*.(doc|docx|eps|ics|pdf|xls|xlsx|zip)$"); 37973 37974 if (regex.test(testUrl)) { 37975 console.log('Trigger Econda-Downloadpixel') 37976 econdaDownload(requestUrlOriginial); 37977 } 37978})*/ 37979 37980function econdaDownload(docname) { 37981 /*if (typeof(window.emospro) == 'undefined') { 37982 window.emospro = {}; 37983 } 37984 console.log('Triggered DOWNLOAD'); 37985 if (docname.indexOf('http') != -1) { 37986 var namesplit = docname.split('/'); 37987 docname = namesplit[namesplit.length - 1]; 37988 } 37989 window.emospro.download = docname; 37990 window.emosPropertiesEvent(window.emospro);*/ 37991} 37992 37993/** 37994 * scroll binding 37995 * e.g. https://www.vfb.de/de/1893/erlebnis/reha-welt/seite/rehabilitation/ 37996 * */ 37997$(document).on('click', '.meldung-navi a', function (event) { 37998 37999 if ($(this).attr('href').indexOf('#') === 0) { 38000 event.preventDefault(); 38001 var link = $(document).find('a[name=' + $(this).attr('href').replace('#', '') + ']'); 38002 38003 $('html, body').animate({ 38004 scrollTop: (link.offset().top - 60) 38005 }, 1500); 38006 } 38007}) 38008 38009;// /var/www/www.vfb.de/httpdocs/current/static/js/aufmacher.js 38010$(document).ready(function () { 38011 var $wrapperAufmacher = $('.wrapper.aufmacher'); 38012 38013 if (!$wrapperAufmacher.length) { 38014 $('.aufmacher-brustring').css({ paddingBottom: '28px' }); 38015 } 38016 38017 if ($wrapperAufmacher.length && !$wrapperAufmacher.find('.aufmacher-meldung').length) { 38018 if ($(window).width() >= 520) { 38019 vfb.initSwipers($wrapperAufmacher, { 38020 slidesPerView: 1, 38021 breakpoints: { 38022 830: { 38023 spaceBetween: 40 38024 } 38025 }, 38026 keyboardControl: true, 38027 autoplay: $wrapperAufmacher.find('.swiper-wrapper').data('autoplay'), 38028 speed: 1000, 38029 spaceBetween: 25, 38030 centeredSlides: true, 38031 setWrapperSize: true, 38032 watchSlidesVisibility: true 38033 }, 'inner'); 38034 } 38035 } 38036 38037 if ($wrapperAufmacher.length && $wrapperAufmacher.find('.aufmacher-meldung .swiper-wrapper').length) { 38038 vfb.initSwipers($wrapperAufmacher, { 38039 slidesPerView: 1, 38040 keyboardControl: true, 38041 useElementBreakpoints: false, 38042 speed: 1000, 38043 spaceBetween: 0, 38044 centeredSlides: true, 38045 setWrapperSize: true 38046 }, 'foto'); 38047 } 38048}); 38049;// /var/www/www.vfb.de/httpdocs/current/static/js/navi.js 38050(function() { 38051 38052 var lastScrollTop = 0; 38053 38054 function stickyNaviFacelift() { 38055 var $wrapperHeader = $('.wrapper.header'), 38056 scrollTop = $(window).scrollTop(), 38057 hasSticky = $wrapperHeader.hasClass('sticky-facelift'); 38058 38059 38060 var isScrollingDown = scrollTop > lastScrollTop; 38061 38062 if (scrollTop >= 120 && !hasSticky && !isScrollingDown) { 38063 $wrapperHeader.addClass('sticky-facelift'); 38064 } else if (scrollTop < 120 && hasSticky) { 38065 $wrapperHeader.removeClass('sticky-facelift').removeClass('sticky-facelift-hidden').removeClass('from-sticky-facelift-to-sticky-facelift-hidden'); 38066 } 38067 38068 if (isScrollingDown && scrollTop >= 120) { 38069 if ($wrapperHeader.hasClass('sticky-facelift')) { 38070 $wrapperHeader.addClass('from-sticky-facelift-to-sticky-facelift-hidden'); // Track transition 38071 } 38072 $wrapperHeader.addClass('sticky-facelift-hidden'); 38073 $wrapperHeader.removeClass('sticky-facelift') 38074 } else { 38075 $wrapperHeader.removeClass('sticky-facelift-hidden from-sticky-facelift-to-sticky-facelift-hidden'); 38076 } 38077 38078 // Update last scroll position 38079 lastScrollTop = Math.max(scrollTop, 0); 38080 } 38081 38082 $(window).scroll(function () { 38083 stickyNaviFacelift() 38084 }); 38085 38086 function updateEyeAbleStyles() { 38087 const eyeAbleContainer = document.querySelector(".eyeAble_container_b"); 38088 if (!eyeAbleContainer || !eyeAbleContainer.shadowRoot) return; 38089 38090 const shadowRoot = eyeAbleContainer.shadowRoot; 38091 const animeEyeAble = shadowRoot.querySelector(".animeEyeAble"); 38092 const animeEyeAbleExtended = shadowRoot.querySelector(".animeEyeAbleExtended"); 38093 38094 const isWideScreen = window.innerWidth > 736; 38095 38096 const updateElementPosition = (el, top, left, right) => { 38097 if (!el) return; 38098 el.style.setProperty("top", top, "important"); 38099 if (left !== null) { 38100 el.style.setProperty("left", left, "important"); 38101 el.style.removeProperty("right"); 38102 } else { 38103 el.style.setProperty("left", "unset", "important"); 38104 el.style.setProperty("right", right, "important"); 38105 } 38106 }; 38107 38108 updateElementPosition(animeEyeAbleExtended, isWideScreen ? "22%" : "8%", isWideScreen ? "10px" : null, "20px"); 38109 updateElementPosition(animeEyeAble, isWideScreen ? "28%" : "8%", isWideScreen ? "10px" : null, "20px"); 38110 38111 // Add style tag once 38112 if (!shadowRoot.querySelector("#custom-eyeable-style")) { 38113 const styleTag = document.createElement("style"); 38114 styleTag.id = "custom-eyeable-style"; 38115 styleTag.textContent = ` 38116 :host { 38117 --main-toolbar-background: white !important; 38118 --fixed-header-background: white !important; 38119 --main-text-color: black !important;
38120 --fixedHeader-text-color: black !important; 38121 --inactive-hover-background: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(186 186 186) 100%) !important; 38122 --boxes-background: white !important; 38123 } 38124 38125 .eyeAble_smallIconHeader { 38126 filter: brightness(0) saturate(100%) !important; 38127 } 38128 38129 .eyeAble_smallIconHeader:hover, .eyeAble_smallIconHeader:focus { 38130 outline: none !important; 38131 } 38132 38133 .eyeAble_settings { 38134 right: unset !important; 38135 left: 300px; 38136 } 38137 `; 38138 shadowRoot.appendChild(styleTag); 38139 } 38140 } 38141 38142 function replaceEyeAbleImages() { 38143 const eyeAbleContainer = document.querySelector(".eyeAble_container_b"); 38144 if (!eyeAbleContainer || !eyeAbleContainer.shadowRoot) return; 38145 38146 const shadowRoot = eyeAbleContainer.shadowRoot; 38147 const eyeableImages = shadowRoot.querySelectorAll(".eyeAble_mainIconClass"); 38148 38149 eyeableImages.forEach(img => { 38150 if (img.parentNode && !img.getAttribute("data-replaced")) { 38151 const replacementDiv = document.createElement("div"); 38152 replacementDiv.className = "eyeAble_mainIconClass"; 38153 replacementDiv.style.width = "40px"; 38154 replacementDiv.style.height = "45px"; 38155 replacementDiv.style.backgroundImage = "url('/?proxy=img/logos/vfb-logo-facelift.png')"; 38156 replacementDiv.style.backgroundSize = "cover"; 38157 replacementDiv.style.backgroundPosition = "center"; 38158 38159 const hiddenImg = document.createElement("img"); 38160 hiddenImg.id = "mainIconID"; 38161 hiddenImg.src = img.src; 38162 hiddenImg.style.display = "none"; 38163 hiddenImg.setAttribute("data-hidden", "true"); 38164 38165 img.setAttribute("data-replaced", "true"); 38166 img.parentNode.replaceChild(replacementDiv, img); 38167 38168 shadowRoot.appendChild(hiddenImg); 38169 } 38170 }); 38171 } 38172 38173 function waitForEyeAble(retries = 20, interval = 500) { 38174 const check = () => { 38175 const eyeAbleContainer = document.querySelector(".eyeAble_container_b"); 38176 if (eyeAbleContainer && eyeAbleContainer.shadowRoot) { 38177 updateEyeAbleStyles(); 38178 replaceEyeAbleImages(); 38179 return true; 38180 } 38181 return false; 38182 }; 38183 38184 if (check()) return; 38185 38186 let attempts = 0; 38187 const poll = setInterval(() => { 38188 if (check() || ++attempts >= retries) { 38189 clearInterval(poll); 38190 } 38191 }, interval); 38192 } 38193 38194 document.addEventListener("DOMContentLoaded", waitForEyeAble); 38195 window.addEventListener("resize", updateEyeAbleStyles); 38196 38197 38198 window.addEventListener("DOMContentLoaded", () => { 38199 document.querySelector('.meldung-table .loadmore')?.addEventListener('click', function () { 38200 setTimeout(() => { 38201 const gameDetails = document.querySelector(".game-details"); 38202 if (gameDetails) { 38203 gameDetails.querySelectorAll("td").forEach((td) => { 38204 const text = td.textContent.trim(); 38205 const match = text.match(/^(\d{1,2})([A-ZÃÃÃ])/); 38206 if (match && !text.includes(" ")) { 38207 td.textContent = text.replace(/^(\d{1,2})([A-ZÃÃÃ])/, "$1 $2"); 38208 } 38209 }); 38210 } 38211 }, 300);
38212 const loadMoreElement = document.querySelector('.meldung-table .loadmore'); 38213 const ticker = document.querySelector('.meldung-table .ticker-aufmacher.carousel'); 38214 38215 // Check if the .rotate180 class is present inside the .loadmore element 38216 if (loadMoreElement && loadMoreElement.querySelector('.rotate180') && ticker) { 38217 ticker.scrollIntoView({ block: 'center' }); // Instant scroll to the center 38218 } 38219 }); 38220 }); 38221 38222 38223 38224 38225 var active, entered, delay=200, setTimeoutConst; 38226 38227 $(function () { 38228 var $navMain = $('nav.main'), 38229 $loginBtn = $('.login'); 38230 38231 $navMain.on('click', 'li', function () { 38232 var that = $(this); 38233 if (entered && !that.parents('.header.opened').length) { 38234 entered = false; 38235 return; 38236 } 38237 var $parent = that.parent(), 38238 index = $parent.find('li').index(that), 38239 $subNavi = that.find('.sub-navi-content'); 38240 38241 if ($subNavi.length) { 38242 $parent.find('li:lt(' + index + ')').removeClass('opened').find('.arrow-up, .sub-navi-content').hide(); 38243 $parent.find('li:gt(' + index + ')').removeClass('opened').find('.arrow-up, .sub-navi-content').hide(); 38244 $subNavi.toggle(); 38245 that.find('.arrow-up:first').toggle(); 38246 that.toggleClass('opened'); 38247 } 38248 }); 38249 38250 const menuIcon = document.querySelector('.js-menu-icon'); 38251 const search = document.querySelector('.js-search'); 38252 const menuText = document.querySelector('.js-menu-text'); 38253 const navigationWrapper = document.querySelector('.js-navigation-wrapper'); 38254 const navigationContainer = document.querySelector('.js-navigation-container'); 38255 const menuSearchIcon = document.querySelector('.js-menu-search-icon'); 38256 const eyeable = document.querySelector('.c-eyeable'); 38257 38258 if (navigationWrapper && navigationContainer && menuIcon && menuSearchIcon && search && menuText && eyeable) { 38259 38260 navigationWrapper.addEventListener('scroll', function() { 38261 if (navigationWrapper.scrollTop > 20) { 38262 navigationContainer.classList.add('scrolled'); 38263 } else { 38264 navigationContainer.classList.remove('scrolled'); 38265 } 38266 }); 38267 38268 window.addEventListener('scroll', function() { 38269 if (window.scrollY > 57) { 38270 navigationContainer.classList.add('scrolled'); 38271 } else { 38272 navigationContainer.classList.remove('scrolled'); 38273 } 38274 }); 38275 38276 menuIcon.addEventListener('click', function() { 38277 handleMenu(); 38278 }); 38279 38280 /* menuText.addEventListener('click', function() { 38281 handleMenu(); 38282 });*/ 38283 38284 function handleMenu() { 38285 if (search.classList.contains('active')) { 38286 menuText.classList.toggle('in-active'); 38287 } 38288 38289 menuIcon.classList.toggle('active'); 38290 if (menuIcon.classList.contains('active')) { 38291 menuSearchIcon.classList.remove('in-active'); 38292 38293 if (eyeable.classList.contains('hide')) { 38294 eyeable.classList.remove('hide'); 38295 } 38296 } 38297 if (menuIcon.classList.contains('search-active')) { 38298 menuIcon.classList.toggle('search-active'); 38299 } 38300 38301 navigationWrapper.classList.toggle('active'); 38302 search.classList.remove('active'); 38303 navigationContainer.classList.remove('scrolled'); 38304 menuSearchIcon.classList.toggle('is-hidden'); 38305 38306 if(menuSearchIcon.classList.contains('is-hidden')) { 38307 eyeable.classList.add('hide'); 38308 } 38309 38310 document.documentElement.scrollTop = 0; 38311 document.body.scrollTop = 0; 38312 } 38313 38314 38315 menuSearchIcon.addEventListener('click', function() { 38316 search.classList.toggle('active'); 38317 eyeable.classList.toggle('hide'); 38318 menuSearchIcon.classList.toggle('in-active'); 38319 menuText.classList.toggle('in-active'); 38320 menuIcon.classList.toggle('search-active'); 38321 }); 38322 38323 } 38324 38325 $navMain.on('mouseenter', 'li', function () {
38326 NaviAction.mouseEnter($(this)); 38327 }); 38328 38329 $navMain.on('mousedown', 'li', function () { 38330 NaviAction.mouseDown($(this)); 38331 }); 38332 38333 $navMain.on('mouseleave', 'li', function () { 38334 NaviAction.mouseLeave($(this)); 38335 }); 38336 38337 $navMain.on('focus', 'ul:first > li', function() { 38338 var newActive = $(this).find('.access-key-anchor:first').attr('id'); 38339 38340 if(newActive !== active) { 38341 NaviAction.mouseLeave($('#'+active).parent()); 38342 } 38343 38344 active = newActive; 38345 NaviAction.mouseDown($(this)); 38346 }); 38347 38348 $('.mobile-menu-btn').on('click', function () { 38349 $('body').scrollTop(0); 38350 $(this).parents('.wrapper.header').toggleClass('opened'); 38351 }); 38352 38353 $loginBtn.on('click', '.showform', function () { 38354 var $loginForm = $('.login-form'); 38355 swal({ 38356 title: "", 38357 html: $loginForm.html(), 38358 showConfirmButton: false 38359 }); 38360 $loginForm.find('input').show(); 38361 }); 38362 38363 $(document).on('click', '.sweet-overlay, .swal2-container .cancel', function () { 38364 swal.close(); 38365 }); 38366 38367 $('.meldung-bild .more').on('click', function () { 38368 $(this).toggleClass('opened'); 38369 }); 38370 }); 38371 38372 var NaviAction = { 38373 mouseEnter: function(listElement) { 38374 setTimeoutConst = setTimeout(function(){ 38375 NaviAction.mouseDown(listElement); 38376 }, delay); 38377 }, 38378 mouseDown: function(listElement) { 38379 entered = true; 38380 NaviAction.show(listElement); 38381 }, 38382 mouseLeave: function(listElement) { 38383 clearTimeout(setTimeoutConst ); 38384 entered = false; 38385 active = null; 38386 if (!listElement.parents('.header.opened').length || !$('.sticky-words').is(':visible')) { 38387 listElement.find('.arrow-up:first').hide(); 38388 listElement.find('.sub-navi-content').hide(); 38389 } 38390 }, 38391 show: function(listElement) { 38392 if (!listElement.parents('.header.opened').length || !$('.sticky-words').is(':visible')) { 38393 listElement.find('.arrow-up:first').show(); 38394 listElement.find('.sub-navi-content').show(); 38395 } 38396 } 38397 } 38398}()); 38399 38400;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/static/javascript/barrierFree.js 38401$(document).ready(function(){ 38402 BarrierFree.Jumplinks.init(); 38403 BarrierFree.AccessKeys.init(); 38404}); 38405 38406var BarrierFree = []; 38407 38408BarrierFree.Jumplinks = { 38409 init: function() { 38410 this.writeJumpLinks(); 38411 }, 38412 writeJumpLinks: function() { 38413 var jumpLinksDom = $('#jumplinks'); 38414 if(jumpLinksDom.length) { 38415 var counter = 1; 38416 var html = '<ul>'; 38417 $('.barrierfree-jumplink-anchor').each(function() { 38418 var jumpLinkId = $(this).attr('id'); 38419 var jumpLinkId = jumpLinkId ? jumpLinkId : 'jumplink-' + counter; 38420 $(this).attr('id', jumpLinkId); 38421 38422 var jumpLinkTitle = $(this).data('barrierfree-jumplink'); 38423 38424 if(jumpLinkTitle) { 38425 html += '<li>'; 38426 html += '<a href="#' + jumpLinkId + '" class="barrierfree-jumplink">'; 38427 html += jumpLinkTitle; 38428 html += '</a>'; 38429 html += '</a>'; 38430 html += '</li>'; 38431 counter++; 38432 } 38433 }); 38434 html += '</ul>'; 38435 38436 jumpLinksDom.append(html); 38437 } 38438 } 38439} 38440 38441BarrierFree.AccessKeys = { 38442 init: function() { 38443 this.writeAccessKeys(); 38444 }, 38445 writeAccessKeys: function() { 38446 var accessKeysDom = $('#accesskeys'); 38447 if(accessKeysDom.length) { 38448 var counter = 1; 38449 var html = '<ul>'; 38450 $('.access-key-anchor').each(function(){ 38451 var accessId = $(this).attr('id'); 38452 var accessId = accessId ? accessId : 'accesslink-' + counter; 38453 $(this).attr('id', accessId); 38454 38455 var accessKey = $(this).data('access-key'); 38456 var accessTitle = $(this).data('access-title'); 38457 38458 if($.isNumeric(accessKey) && accessTitle) { 38459 html += '<li>'; 38460 html += '<a href="#' + accessId + '" accesskey="' + accessKey + '" title="[ALT+' + accessKey + ']">'; 38461 html += accessTitle; 38462 html += '</a>'; 38463 html += '</li>'; 38464 38465 counter++; 38466 } 38467 }); 38468 html += '</ul>'; 38469 } 38470 accessKeysDom.append(html); 38471 } 38472} 38473;// /var/www/www.vfb.de/httpdocs/current/static/js/socialMedia.js
38474$(function () { 38475 var $socialMediaBlock = $('.meldung-social'); 38476 38477 var social = function (that) { 38478 var $gridHtml = $('<root></root>'), 38479 $loadMore = that.find('.loadmore'), 38480 loadMoreHtml = $loadMore.html(), 38481 $headerRight = that.find('.heading-right'), 38482 $socialMediaWrapper = that.find('.social-wrapper'), 38483 ajaxUrl = $socialMediaWrapper.attr("data-url"), 38484 initialItems = $socialMediaWrapper.attr("data-initial"), 38485 elementSiteNumber = initialItems, 38486 $originElements; 38487 38488 $('.social-wrapper').Lazy({ 38489 loadSocialMedia: function() { 38490 $.ajax(ajaxUrl, 38491 { 38492 dataType: "json", 38493 success: function (response) { 38494 if (response.html) { 38495 $gridHtml.html(response.html); 38496 $originElements = $gridHtml.clone(); 38497 $socialMediaWrapper.attr('data-index', elementSiteNumber); 38498 $socialMediaWrapper.append($gridHtml.find('.social-item:lt(' + elementSiteNumber + ')')); 38499 38500 initMasonry($socialMediaWrapper, '.social-item'); 38501 } 38502 } 38503 } 38504 ); 38505 } 38506 }); 38507 38508 $headerRight.on('click', 'img', function () { 38509 var that = $(this); 38510 38511 if ($headerRight.find('img.active').length === 1 && that.hasClass('active')) { 38512 return; 38513 } 38514 38515 that.toggleClass('active'); 38516 $socialMediaWrapper.masonry("remove", $socialMediaWrapper.find('.social-item')).masonry('layout'); 38517 38518 }); 38519 38520 $loadMore.on('click', function () { 38521 var $items = $gridHtml.find('.social-item'), 38522 itemLength = $items.length, 38523 $slicedItems; 38524 38525 if (itemLength > 0) { 38526 $slicedItems = $items.slice(0, elementSiteNumber); 38527 $socialMediaWrapper.append($slicedItems).masonry('appended', $slicedItems).masonry(); 38528 } 38529 38530 if (itemLength === 0 || itemLength <= elementSiteNumber) { 38531 $loadMore.html(""); 38532 } 38533 }); 38534 38535 $socialMediaWrapper.on('removeComplete', function () { 38536 var $accounts = $headerRight.find('img'), 38537 $items, 38538 $newItems; 38539 38540 $loadMore.html(loadMoreHtml); 38541 38542 $gridHtml = $originElements.clone(); 38543 38544 $accounts.each(function () { 38545 var that = $(this), elementClass = that.attr('data-account'); 38546 if (!that.is('.active')) { 38547 $items = $gridHtml.find('.social-item[data-type!=' + elementClass + ']'); 38548 $gridHtml.html($items); 38549 } 38550 }); 38551 38552 if ($gridHtml.find('.social-item').length <= elementSiteNumber) { 38553 $loadMore.html("") 38554 } 38555 $newItems = $gridHtml.find('.social-item:lt(' + elementSiteNumber + ')'); 38556 38557 $socialMediaWrapper.append($newItems).masonry('appended', $newItems).masonry('layout'); 38558 38559 }); 38560 }; 38561 38562 $socialMediaBlock.each(function () { 38563 new social($(this)); 38564 }); 38565 38566 function initMasonry($ele, itemClass, spacerClass) { 38567 spacerClass = spacerClass || '.social-gutter-sizer'; 38568 $ele.masonry({ 38569 itemSelector: itemClass, 38570 columnWidth: itemClass, 38571 gutter: spacerClass, 38572 initLayout: false, 38573 percentPosition: true 38574 38575 }); 38576 38577 $ele.imagesLoaded(function () { 38578 $ele.show(); 38579 $ele.masonry('layout'); 38580 }); 38581 } 38582 38583 function resetMasonry($ele) { 38584 $ele.masonry('destroy'); 38585 } 38586}); 38587;// /var/www/www.vfb.de/httpdocs/current/static/js/socialMediaBar.js 38588$(function() { 38589 var $socialStaticBar = $('.social_static_bar'), 38590 $socialMediaStatic = $socialStaticBar.find('.socialmedia'), 38591 $socialStaticArrowUp = $socialStaticBar.find('.arrow-ssb-show'), 38592 $socialStaticArrowDown = $socialStaticBar.find('.arrow-ssb-hide'), 38593 $navMain = $('nav.main'); 38594 38595 var instafeedLoaded = false;
38596 38597 $socialMediaStatic.on('mouseenter', function() { 38598 var dataSrcElem = $(this).find('[data-src]'); 38599 if (dataSrcElem.attr('data-src')) { 38600 dataSrcElem.attr('src', dataSrcElem.data('src')).removeAttr('data-src'); 38601 } 38602 $(this).find('.box, .arrow-up').velocity("stop").velocity("fadeIn", { duration: 200 }); 38603 if ($(this).find('#instafeed.box').length && !instafeedLoaded) { 38604 feed.run(); 38605 instafeedLoaded = true; 38606 } 38607 }); 38608 38609 $socialMediaStatic.on('mouseleave', function() { 38610 $(this).find('.box, .arrow-up').velocity("stop").velocity("fadeOut", { duration: 200 }) 38611 }); 38612 38613 $socialStaticArrowUp.on('click', function() { 38614 $socialStaticBar.removeClass('hide'); 38615 $(this).hide(); 38616 $socialStaticArrowDown.show(); 38617 }); 38618 38619 $socialStaticArrowDown.on('click', function() { 38620 $socialStaticBar.addClass('hide'); 38621 $(this).hide(); 38622 $socialStaticArrowUp.show(); 38623 }); 38624 38625 $navMain.on('mouseenter focus', 'li', function() { 38626 var that = $(this); 38627 that.find('.arrow-up, .subnavi').show(); 38628 }); 38629 38630 $navMain.on('mouseleave focusout', 'li', function() { 38631 var that = $(this); 38632 that.find('.arrow-up, .subnavi').hide(); 38633 }); 38634}); 38635;// /var/www/www.vfb.de/httpdocs/current/static/js/gallery.js 38636$(function () { 38637 var $galleryBlock = $('.wrapper.galerie'), 38638 $navi = $galleryBlock.find('.contentnavi .third'), 38639 $naviItems = $navi.find('li'), 38640 $wrapper = $galleryBlock.find('.swiper-wrapper'), 38641 swiper, 38642 gallery; 38643 38644 initDiashow(); 38645 38646 countGalleryItems(); 38647 38648 function countGalleryItems() { 38649 const swiperWrapperGallery = document.querySelector('.swiper-wrapper.gallery'); 38650 if (swiperWrapperGallery) { 38651 const numberOfChildren = swiperWrapperGallery.children.length; 38652 38653 if (swiperWrapperGallery && swiperWrapperGallery.children.length >= 5) { 38654 let fifthChild = swiperWrapperGallery.children[4]; 38655 let uniqueClass = 'fifth-child'; 38656 fifthChild.classList.add(uniqueClass); 38657 let style = document.createElement('style'); 38658 38659 style.innerHTML = ` 38660 .${uniqueClass}::after { 38661 content: '+${numberOfChildren - 5}'; 38662 } 38663 `; 38664 38665 document.head.appendChild(style); 38666 } 38667 } 38668 } 38669 38670 38671 38672 function distributionDiashowInit(element) { 38673 var that = element, 38674 $lightGallery = that.find('.lightGallery'); 38675 if ($lightGallery) { 38676 $lightGallery.lightGallery({ 38677 addHtml: true, 38678 selector: '.image', 38679 thumbnail: true, 38680 thumbWidth: 100, 38681 thumbContHeight: 78, 38682 exThumbImage: 'data-exthumbimage' 38683 }); 38684 38685 that.on('click', 'a div.image', function () { 38686 $lightGallery.find('.image:first').click(); 38687 }); 38688 } 38689 } 38690 38691 function loadDistributionDiashowPage(page) { 38692 var $articles = $('.articles'), 38693 activePage = $articles.find('.pages li.active').text(), 38694 url = $articles.data('url'), 38695 folderId = $articles.data('folderid'), 38696 pageId = $articles.data('pageid'), 38697 totalRows = $articles.data('total'), 38698 limit = $articles.data('limit'); 38699 if ($('.articles .pages li').length > 1 && parseInt(activePage) !== parseInt(page)) { 38700 vfb.distributionLoader(true); 38701 } else { 38702 return; 38703 } 38704 38705 $.ajax({ 38706 url: url, 38707 type: 'POST', 38708 data: { 38709 command : 'loadDiashows', 38710 folderId: parseInt(folderId), 38711 rubricId: -1, 38712 year: -1, 38713 full: true, 38714 optSmartyParams: { 38715 totalRows: parseInt(totalRows), 38716 pageId: parseInt(pageId),
38717 diashowLimit: parseInt(limit), 38718 actPage: parseInt(page) //page to load 38719 } 38720 }, 38721 dataType: 'json', 38722 success: function(data, status) { 38723 if (status === 'success') { 38724 if (typeof (data.html) != "undefined" && data.html !== null) { 38725 $('.articles').html(data.html); 38726 distributionLoader(); 38727 } 38728 } 38729 }, 38730 error: function () { 38731 distributionLoader(); 38732 } 38733 }); 38734 } 38735 38736 function loadDiashow(url, diashow) { 38737 $.ajax(url, 38738 { 38739 dataType: "json", 38740 data: {"diashow": diashow}, 38741 success: function (response) { 38742 if (response.html) { 38743 $wrapper.html(response.html); 38744 loader(); 38745 initDiashow(); 38746 countGalleryItems(); 38747 } 38748 } 38749 } 38750 ); 38751 } 38752 38753 function initDiashow() { 38754 var $galerieImages = $('.galerie .images'); 38755 38756 if (gallery) { 38757 gallery.data('lightGallery').destroy(true); 38758 gallery.off('click', '.image.swiper-slide-duplicate', bindDuplicateSlides); 38759 } 38760 if ($galerieImages.length) { 38761 $galerieImages.imagesLoaded().done(function () { 38762 var $brustring = $('.brustring'); 38763 38764 gallery = $wrapper; 38765 gallery.lightGallery({ 38766 addHtml: true, 38767 selector: '.swiper-slide.image:not(".swiper-slide-duplicate")', 38768 thumbnail: false, 38769 thumbWidth: 100, 38770 thumbContHeight: 78, 38771 exThumbImage: 'data-exthumbimage' 38772 }); 38773 gallery.on('onBeforeOpen.lg', function () { 38774 $brustring.addClass('max-z'); 38775 }); 38776 gallery.on('onBeforeClose.lg', function () { 38777 $brustring.removeClass('max-z'); 38778 }); 38779 gallery.on('click', '.image.swiper-slide-duplicate', bindDuplicateSlides); 38780 }); 38781 } 38782 } 38783 38784 function loader(active) { 38785 if (active) { 38786 $wrapper.find('.swiper-slide').addClass('loading'); 38787 } else { 38788 $wrapper.find('.swiper-slide').removeClass('loading'); 38789 } 38790 } 38791 38792 function distributionLoader(active) { 38793 if (active) { 38794 $('.articles').addClass('loading'); 38795 } else { 38796 $('.articles').removeClass('loading'); 38797 } 38798 } 38799 38800 function bindDuplicateSlides(event) { 38801 var that = $(event.target).parents('.swiper-slide'), 38802 parent = that.parent(), 38803 index = that.data('swiper-slide-index'); 38804 38805 parent.find('.image:not(".swiper-slide-duplicate")[data-swiper-slide-index="' + index + '"]').click(); 38806 } 38807 38808 $navi.on('click', 'li', function () { 38809 var that = $(this), 38810 url = that.attr('data-url'),
38811 diashow = that.attr('data-diashow'); 38812 loader(true); 38813 $naviItems.removeClass('active'); 38814 that.addClass('active'); 38815 38816 loadDiashow(url, diashow); 38817 }); 38818 38819 vfb.distributionLoader = distributionLoader; 38820 vfb.diashowInit = distributionDiashowInit; 38821 vfb.loadDistributionDiashowPage = loadDistributionDiashowPage; 38822}); 38823 38824;// /var/www/www.vfb.de/httpdocs/current/static/js/meldung.js 38825(function() { 38826 function addLightGallery($element, customOptions) { 38827 var options = { 38828 addHtml: true, 38829 thumbnail: true, 38830 thumbWidth: 100, 38831 thumbContHeight: 78, 38832 exThumbImage: 'data-exthumbimage' 38833 }; 38834 $.extend(options, customOptions); 38835 if (!$element.parents('.verteilseite').length) { 38836 $element.lightGallery(options); 38837 } 38838 } 38839 38840 $(function() { 38841 var $meldung = $('.wrapper.meldung'), 38842 $newsarchive = $('.wrapper.meldung .newsarchive'), 38843 $brustring = $('.brustring'), 38844 $audioPlayer = $('.audio-player'); 38845 38846 function bindDuplicateSlides(event) { 38847 var that = $(event.target).parents('.swiper-slide'), 38848 parent = that.parent(), 38849 index = that.data('swiper-slide-index'); 38850 38851 parent.find('.image:not(".swiper-slide-duplicate")[data-swiper-slide-index="' + index + '"]').click(); 38852 } 38853 38854 if (window.location.pathname.indexOf('/en/') == 0){ 38855 $('.newsarchive .more-details').replaceWith('<div class="loadmore close"><div class="text"><span>MORE</span> <img src="/?proxy=img/icon_pfeil.png"></div></div>'); 38856 } else { 38857 $('.newsarchive .more-details').replaceWith('<div class="loadmore close"><div class="text"><span>WEITERE DATEN EINBLENDEN</span> <img src="/?proxy=img/icon_pfeil.png"></div></div>'); 38858 } 38859 $('.newsarchive .loadmore').on('click', function () { 38860 $(this).toggleClass('open'); 38861 if ($(this).hasClass('open')) { 38862 if (window.location.pathname.indexOf('/en/') == 0){ 38863 $('.newsarchive .loadmore .text').html('<span>HIDE</span> <img src="/?proxy=img/icon_pfeil.png" class="rotate180">'); 38864 } else { 38865 $('.newsarchive .loadmore .text').html('<span>WEITERE DATEN AUSBLENDEN</span> <img src="/?proxy=img/icon_pfeil.png" class="rotate180">'); 38866 } 38867 $("#content_spieledetails").slideDown(); 38868 } else { 38869 if (window.location.pathname.indexOf('/en/') == 0){ 38870 $('.newsarchive .loadmore .text').html('<span>MORE</span> <img src="/?proxy=img/icon_pfeil.png">'); 38871 } else { 38872 $('.newsarchive .loadmore .text').html('<span>WEITERE DATEN EINBLENDEN</span> <img src="/?proxy=img/icon_pfeil.png">'); 38873 } 38874 $(".newsarchive #content_spieledetails").slideUp(); 38875 } 38876 $(window).resize(); 38877 }); 38878 38879 if ($meldung.length) { 38880 addLightGallery($meldung, {selector : '.meldung-bild >.image:not(".swiper-slide-duplicate, .disallowOverlay")'}); 38881 addLightGallery($meldung.find('.meldung-bild .diashow'), {selector : '.image:not(".swiper-slide-duplicate, .disallowOverlay")'}); 38882 addLightGallery($meldung.find('.meldung-gallery'), {selector : '.image:not(".swiper-slide-duplicate")'}); 38883 addLightGallery($newsarchive, {selector : '.image:not(".swiper-slide-duplicate")', thumbnail: false}); 38884 38885 $meldung.on('onBeforeOpen.lg',function(){ 38886 $brustring.addClass('max-z'); 38887 }); 38888 $meldung.on('onBeforeClose.lg',function(){ 38889 $brustring.removeClass('max-z'); 38890 }); 38891 $meldung.on('click', '.image.swiper-slide-duplicate', bindDuplicateSlides); 38892 } 38893 38894 /* audioplayer */ 38895 if ($audioPlayer.length) { 38896 $('#audio-player').mediaelementplayer({ 38897 alwaysShowControls: true, 38898 features: ['playpause', 'progress', 'volume', 'current', 'duration'], 38899 audioVolume: 'horizontal', 38900 iPadUseNativeControls: true, 38901 iPhoneUseNativeControls: true, 38902 AndroidUseNativeControls: true 38903 }); 38904 } 38905 38906 //diashows in meldung-bild 38907 vfb.initSwipers($('.meldung-bild'), { 38908 slidesPerView: 1, 38909 speed: 1000, 38910 loopedSlides: 0, 38911 spaceBetween: 0, 38912 centeredSlides: true, 38913 setWrapperSize: true, 38914 keyboardControl: true 38915 }, 'diashow'); 38916 38917 //gallery in right-box 38918 vfb.initSwipers($('.meldung-gallery.small'), { 38919 slidesPerView: 2, 38920 speed: 1000, 38921 loopedSlides: 0, 38922 spaceBetween: 48, 38923 centeredSlides: true, 38924 setWrapperSize: true, 38925 keyboardControl: true, 38926 breakpoints: { 38927 600: { 38928 centeredSlides: true, 38929 slidesPerView: 2 38930 } 38931 } 38932 }, 'diashow'); 38933 38934 //gallery in content (not right box) 38935 vfb.initSwipers($('.meldung-gallery.full-screen'), { 38936 slidesPerView: 3, 38937 speed: 1000, 38938 loopedSlides: 0, 38939 spaceBetween: 48, 38940 centeredSlides: true, 38941 setWrapperSize: true, 38942 keyboardControl: true, 38943 breakpoints: { 38944 861: { 38945 slidesPerView: 2, 38946 spaceBetween: 32 38947 }, 38948 600: { 38949 slidesPerView: 1, 38950 spaceBetween: 0 38951 } 38952 } 38953 }, 'diashow'); 38954 38955 //show swiper 38956 vfb.initSwipers($('.meldung-shop, .wrapper.galerie'), { 38957 breakpoints: { 38958 1000: { 38959 slidesPerView: 3, 38960 spaceBetweenSlides: 0 38961 }, 38962 750: { 38963 slidesPerView: 2, 38964 spaceBetweenSlides: 0 38965 }, 38966 500: { 38967 slidesPerView: 1, 38968 spaceBetweenSlides: 0 38969 } 38970 } 38971 }); 38972 38973 //team swiper 38974 var randomInitSlide = Math.floor(Math.random() * 20); 38975 vfb.initSwipers($('.meldung-team'), { 38976 initialSlide: randomInitSlide, 38977 slidesPerView: 5, 38978 breakpoints: { 38979 1000: { 38980 slidesPerView: 4, 38981 spaceBetweenSlides: 0 38982 }, 38983 800: { 38984 slidesPerView: 3, 38985 spaceBetweenSlides: 0 38986 }, 38987 585: { 38988 slidesPerView: 2, 38989 spaceBetweenSlides: 0 38990 }, 38991 400: { 38992 slidesPerView: 1, 38993 spaceBetweenSlides: 0 38994 } 38995 } 38996 }); 38997 38998 //videobox swiper 38999 vfb.initSwipers($('.wrapper.video'), { 39000 slidesPerView: 3, 39001 height: 300, 39002 spaceBetween: 10, 39003 allowSwipeToNext: true, 39004 allowSwipeToPrev: true, 39005 breakpoints: { 39006 1150: { 39007 slidesPerView: 3, 39008 spaceBetweenSlides: 0, 39009 allowSwipeToNext: true, 39010 allowSwipeToPrev: true 39011 }, 39012 960: { 39013 slidesPerView: 2, 39014 spaceBetweenSlides: 0, 39015 allowSwipeToNext: true, 39016 allowSwipeToPrev: true 39017 }, 39018 640: { 39019 slidesPerView: 1, 39020 spaceBetweenSlides: 0, 39021 allowSwipeToNext: true, 39022 allowSwipeToPrev: true 39023 } 39024 } 39025 }); 39026 39027 //datencenter swiper 39028 vfb.initSwipers($('.wrapper.datencenter'), {
39029 initialSlide: $('.ticker-carousel:not(.meldung-carousel) .swiper-container').data('initial-slide'), 39030 slidesPerView: 1, 39031 height: 300, 39032 visibilityFullFit: true 39033 }); 39034 39035 //gameday swiper with right-box 39036 vfb.initSwipers($('.verteilseite-spieltage:not(.full-screen)'), { 39037 slidesPerView: 5, 39038 speed: 1000, 39039 loopedSlides: 0, 39040 loop: false, 39041 breakpoints: { 39042 640: { 39043 slidesPerView: 4 39044 }, 39045 500: { 39046 slidesPerView: 3 39047 }, 39048 320: { 39049 slidesPerView: 2 39050 } 39051 }, 39052 spaceBetween: 5, 39053 setWrapperSize: true, 39054 keyboardControl: true 39055 }, 'spieltage'); 39056 39057 //gameday swiper without right-box 39058 vfb.initSwipers($('.verteilseite-spieltage.full-screen'), { 39059 slidesPerView: 8, 39060 speed: 1000, 39061 loopedSlides: 0, 39062 loop: false, 39063 breakpoints: { 39064 1064: { 39065 slidesPerView: 7 39066 }, 39067 830: { 39068 slidesPerView: 6 39069 }, 39070 640: { 39071 slidesPerView: 4 39072 }, 39073 500: { 39074 slidesPerView: 3 39075 }, 39076 320: { 39077 slidesPerView: 2 39078 } 39079 }, 39080 spaceBetween: 5, 39081 paginationClickable: true, 39082 setWrapperSize: true, 39083 keyboardControl: true 39084 }, 'spieltage'); 39085 39086 $(document).on('mouseenter click touch', '.formError', function() { 39087 $(this).addClass('hovered'); 39088 }); 39089 39090 $(document).on('click', '.meldung-navi > .menu', function () { 39091 $(this).parents('.meldung-navi').toggleClass('opened'); 39092 }); 39093 39094 $(document).on('click', '.meldung-navi >div', function (e) { 39095 var that = $(this), 39096 parent = that.parents('.meldung-navi'); 39097 39098 if (!$(e.target).hasClass('menu')) { 39099 parent.find('>div:not(".menu")').removeClass('active'); 39100 $(this).toggleClass('active'); 39101 } 39102 }); 39103 39104 39105 if($(window).width() <= 640) { 39106 $('.meldung-navi > .navi-right-spacer').prepend('<div class="menu"></div>'); 39107 $(document).on('click', '.meldung-navi > .navi-right-spacer > .menu', function () { 39108 $(this).parents('.navi-right-spacer').toggleClass('opened'); 39109 }); 39110 39111 $(document).on('click', '.meldung-navi > .navi-right-spacer > a', function (e) { 39112 var that = $(this), 39113 parent = that.parents('.navi-right-spacer'); 39114 39115 if (!$(e.target).hasClass('menu')) { 39116 parent.find('>div:not(".menu")').removeClass('active'); 39117 $(this).toggleClass('active'); 39118 } 39119 }); 39120 } 39121 39122 39123 39124 39125 39126 $(document).on('click', '.dropdown-navi li li', function () { 39127 var that = $(this), 39128 parent = that.parents('.dropdown-navi'), 39129 isOpened = parent.hasClass('opened'); 39130 39131 if ($('.verteilseite').length) { 39132 var lastValue = $('#' + that.parent().data('id')).val(); 39133 } 39134 39135 if (isOpened) { 39136 parent.find('li .active').removeClass('active'); 39137 that.addClass('active'); 39138 39139 var selectId = that.parent().data('id'); 39140 if ($('#' + selectId).length) { 39141 $('#' + selectId).val(that.data('value')); 39142 } 39143 } 39144 39145 if ($('.verteilseite').length && lastValue != that.data('value')) { 39146 //writeHash(); 39147 //newsArchiveLoadData(); 39148 } 39149 39150 parent.toggleClass('opened'); 39151 }); 39152 39153 $(document).on('click', '.meldung-bild .diashow .lupe', function () { 39154 $(this).parent().find('.swiper-slide-active').click(); 39155 }); 39156 39157 function updateTextBasedOnWidth(td) { 39158 if (window.innerWidth > 1168) { 39159 td.textContent = td.textContent.replace('Mo.', 'Montag'); 39160 td.textContent = td.textContent.replace('Di.', 'Die
39160nstag'); 39161 td.textContent = td.textContent.replace('Mi.', 'Mittwoch'); 39162 td.textContent = td.textContent.replace('Do.', 'Donnerstag'); 39163 td.textContent = td.textContent.replace('Fr.', 'Freitag'); 39164 td.textContent = td.textContent.replace('Sa.', 'Samstag'); 39165 td.textContent = td.textContent.replace('So.', 'Sonntag'); 39166 td.textContent = td.textContent.replace('Montag.', 'Montag'); 39167 td.textContent = td.textContent.replace('Dienstag.', 'Dienstag'); 39168 td.textContent = td.textContent.replace('Mittwoch.', 'Mittwoch'); 39169 td.textContent = td.textContent.replace('Donnerstag.', 'Donnerstag'); 39170 td.textContent = td.textContent.replace('Freitag.', 'Freitag'); 39171 td.textContent = td.textContent.replace('Samstag.', 'Samstag'); 39172 td.textContent = td.textContent.replace('Sonntag.', 'Sonntag'); 39173 } else { 39174 td.textContent = td.textContent.replace('Montag.', 'Mo.'); 39175 td.textContent = td.textContent.replace('Dienstag.', 'Di.'); 39176 td.textContent = td.textContent.replace('Mittwoch.', 'Mi.'); 39177 td.textContent = td.textContent.replace('Donnerstag.', 'Do.'); 39178 td.textContent = td.textContent.replace('Freitag.', 'Fr.'); 39179 td.textContent = td.textContent.replace('Samstag.', 'Sa.'); 39180 td.textContent = td.textContent.replace('Sonntag.', 'So.'); 39181 td.textContent = td.textContent.replace('Montag', 'Mo.'); 39182 td.textContent = td.textContent.replace('Dienstag', 'Di.'); 39183 td.textContent = td.textContent.replace('Mittwoch', 'Mi.'); 39184 td.textContent = td.textContent.replace('Donnerstag', 'Do.'); 39185 td.textContent = td.textContent.replace('Freitag', 'Fr.'); 39186 td.textContent = td.textContent.replace('Samstag', 'Sa.'); 39187 td.textContent = td.textContent.replace('Sonntag', 'So.'); 39188 } 39189 } 39190 39191 function formateDate() { 39192 var nestedTable = document.querySelector("td > table.table.footable"); 39193 if (nestedTable) { 39194 nestedTable.querySelectorAll("td.aleft:not(.teamname)").forEach(td => { 39195 setTimeout(() => { 39196 updateTextBasedOnWidth(td); 39197 }, 300); 39198 39199 var resizeTimeout; 39200 window.addEventListener('resize', () => { 39201 clearTimeout(resizeTimeout); 39202 resizeTimeout = setTimeout(() => { 39203 updateTextBasedOnWidth(td); 39204 }, 300); 39205 }); 39206 39207 39208 39209 }); 39210 } 39211 } 39212 39213 function toggleData() { 39214 var dc = $('.datencenter'); 39215 if (window.location.pathname.indexOf('/en/') == 0){ 39216 if (dc.hasClass('open')) { 39217 $('.datencenter .loadmore .text').html('<span>HIDE</span>') 39218 } else { 39219 $('.datencenter .loadmore .text').html('<span>MORE</span>') 39220 window.scrollTo(0, document.querySelector(".wrapper.datencenter.data-snippet").offsetTop); 39221 } 39222 } else { 39223 if (dc.hasClass('open')) { 39224 $('.datencenter .loadmore .text').html('<span>WEITERE DATEN AUSBLENDEN</span>') 39225 } else { 39226 $('.datencenter .loadmore .text').html('<span>WEITERE DATEN EINBLENDEN</span>') 39227 window.scrollTo(0, document.querySelector(".wrapper.datencenter.data-snippet").offsetTop); 39228 } 39229 } 39230 } 39231 39232 function syncClassOpenToInnerDiv() { 39233 var outerDiv = document.querySelector('.wrapper.datencenter.data-snippet.carousel'); 39234 if (outerDiv && outerDiv.classList.contains('open')) { 39235 var rootElement = outerDiv.querySelector('root'); 39236 39237 if (rootElement) { 39238 var innerDiv = rootElement.querySelector('.wrapper.datencenter.data-snippet.carousel'); 39239 39240 if (innerDiv) { 39241 innerDiv.classList.add('open'); 39242 } 39243 } 39244 } 39245 toggleData(); 39246 } 39247 39248 $(document).on('click', '.datacenter-switch', function () { 39249 setTimeout(() => { 39250 syncClassOpenToInnerDiv(); 39251 formateDate(); 39252 }, 1000); 39253 }); 39254 39255 $(document).on('click', '.datencenter .loadmore', function () { 39256 var dc = $('.datencenter'); 39257 dc.toggleClass('open'); 39258 toggleData(); 39259 formateDate(); 39260 $(window).resize(); 39261 }); 39262 39263 $(document).on('click', '.meldung-table .loadmore', function () { 39264 var mt = $('.meldung-table'); 39265 mt.toggleClass('open'); 39266 if (window.location.pathname.indexOf('/en/') == 0){ 39267 if (mt.hasClass('open')) { 39268 $('.meldung-table .loadmore .text').html('<span>HIDE</span> <img src="/?proxy=img/icon_pfeil.png" class="rotate180">') 39269 } else { 39270 $('.meldung-table .loadmore .text').html('<span>MORE</span> <img src="/?proxy=img/icon_pfeil.png">') 39271 } 39272 } else { 39273 if (mt.hasClass('open')) { 39274 $('.meldung-table .loadmore .text').html('<span>WEITERE DATEN AUSBLENDEN</span> <img src="/?proxy=img/icon_pfeil.png" class="rotate180">') 39275 } else { 39276 $('.meldung-table .loadmore .text').html('<span>WEITERE DATEN EINBLENDEN</span> <img src="/?proxy=img/icon_pfeil.png">') 39277 } 39278 } 39279 $(window).resize(); 39280 }); 39281 39282 $('.meldung-bar').each(function () { 39283 var share = true; 39284 $(this).sharrre({ 39285 share: { 39286 twitter: true, 39287 facebook: true 39288 }, 39289 buttons: { 39290 facebook: {layout: 'box_count'}, 39291 twitter: {count: 'vertical'} 39292 }, 39293 template: '<div class="bar-left">' + 39294 '<a href="javascript:" class="print"><img src="/?proxy=img/icons/130x130/icon-drucken.png"/></a>' + 39295 '<a href="javascript:" class="mail"><img src="/?proxy=img/icons/130x130/icon-mail.png"/></a>' + 39296 '</div>' + 39297 '<div class="bar-right">' + 39298 '<a class="schalter" href="javascript:"></a>' + 39299 '<a href="javascript:" class="fb"><img src="/?proxy=img/icons/130x130/icon-facebook.png"/></a>' + 39300 '<a href="javascript:" class="tw"><img src="/?proxy=img/icons/130x130/icon-twitter.png"/></a>' + 39301 '<a href="javascript:" class="wa" target="_blank"><img src="/?proxy=img/icons/130x130/icon-whatsapp.png"/></a>' + 39302 '</div>', 39303 enableHover: false, 39304 enableTracking: true, 39305 render: function (api) { 39306 if (share) { 39307 function checkActive($ele) { 39308 return $ele.parent().hasClass('active'); 39309 } 39310 39311 $(api.element).on('click', '.fb', function () { 39312 if (checkActive($(this))) { 39313 api.openPopup('facebook'); 39314 } 39315 }); 39316 $(api.element).on('click', '.tw', function () { 39317 if (checkActive($(this))) { 39318 api.openPopup('twitter'); 39319 } 39320 }); 39321 $(api.element).on('click', '.wa', function () { 39322 if (checkActive($(this))) { 39323 var waSubdomain = 'web'; 39324 var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 39325 39326 if(isMobile) { 39327 waSubdomain = 'api'; 39328 } 39329 39330 window.open('https://' + waSubdomain + '.whatsapp.com/se
39330nd?text=Hallo,%0D%0A %0D%0Aich habe diesen Artikel auf vfb.de gelesen und empfehle Dir das auch zu tun!%0D%0A %0D%0A' + window.location, '_blank'); 39331 } 39332 }); 39333 $(api.element).on('click', '.print', function () { 39334 window.print(); 39335 }); 39336 39337 $(api.element).on('click', '.mail', function () { 39338 window.location.href = 'mailto:?subject=Artikelempfehlung auf vfb.de&body=Hallo,%0D%0A %0D%0Aich habe diesen Artikel auf vfb.de gelesen und empfehle Dir das auch zu tun!%0D%0A %0D%0A' + window.location; 39339 }); 39340 $(api.element).on('click', '.schalter', function () { 39341 $(this).parent().toggleClass('active'); 39342 }); 39343 share = false; 39344 } 39345 } 39346 }); 39347 }); 39348 }); 39349}()); 39350 39351;// /var/www/www.vfb.de/httpdocs/current/static/js/instafeed.js 39352// Generated by CoffeeScript 1.9.3 39353(function() { 39354 var Instafeed; 39355 39356 Instafeed = (function() { 39357 function Instafeed(params, context) { 39358 var option, value; 39359 this.options = { 39360 target: 'instafeed', 39361 get: 'popular', 39362 resolution: 'thumbnail', 39363 sortBy: 'none', 39364 links: true, 39365 mock: false, 39366 useHttp: false 39367 }; 39368 if (typeof params === 'object') { 39369 for (option in params) { 39370 value = params[option]; 39371 this.options[option] = value; 39372 } 39373 } 39374 this.context = context != null ? context : this; 39375 this.unique = this._genKey(); 39376 } 39377 39378 Instafeed.prototype.hasNext = function() { 39379 return typeof this.context.nextUrl === 'string' && this.context.nextUrl.length > 0; 39380 }; 39381 39382 Instafeed.prototype.next = function() { 39383 if (!this.hasNext()) { 39384 return false; 39385 } 39386 return this.run(this.context.nextUrl); 39387 }; 39388 39389 Instafeed.prototype.run = function(url) { 39390 var header, instanceName, script; 39391 if (typeof this.options.clientId !== 'string') { 39392 if (typeof this.options.accessToken !== 'string') { 39393 throw new Error("Missing clientId or accessToken."); 39394 } 39395 } 39396 if (typeof this.options.accessToken !== 'string') { 39397 if (typeof this.options.clientId !== 'string') { 39398 throw new Error("Missing clientId or accessToken."); 39399 } 39400 } 39401 if ((this.options.before != null) && typeof this.options.before === 'function') { 39402 this.options.before.call(this); 39403 } 39404 if (typeof document !== "undefined" && document !== null) { 39405 script = document.createElement('script'); 39406 script.id = 'instafeed-fetcher'; 39407 script.src = url || this._buildUrl(); 39408 header = document.getElementsByTagName('head'); 39409 header[0].appendChild(script); 39410 instanceName = "instafeedCache" + this.unique; 39411 window[instanceName] = new Instafeed(this.options, this); 39412 window[instanceName].unique = this.unique; 39413 } 39414 return true; 39415 }; 39416 39417 Instafeed.prototype.parse = function(response) { 39418 var anchor, childNodeCount, childNodeIndex, childNodesArr, e, eMsg, fragment, header, htmlString, httpProtocol, i, image, imageObj, imageString, imageUrl, images, img, imgHeight, imgOrient, imgUrl, imgWidth, instanceName, j, k, len, len1, len2, node, parsedLimit, reverse, sortSettings, targetEl, tmpEl; 39419 if (typeof response !== 'object') { 39420 if ((this.options.error != null) && typeof this.options.error === 'function') { 39421 this.options.error.call(this, 'Invalid JSON data'); 39422 return false; 39423 } else { 39424 throw new Error('Invalid JSON response'); 39425 } 39426 } 39427 if (response.meta.code !== 200) { 39428 if ((this.options.error != null) && typeof this.options.error === 'function') { 39429 this.options.error.call(this, response.meta.error_message); 39430 return false; 39431 } else { 39432 throw new Error("Error from Instagram: " + response.meta.error_message); 39433 } 39434 } 39435 if (response.data.length === 0) { 39436 if ((this.options.error != null) && typeof this.options.error === 'function') { 39437 this.options.error.call(this, 'No images were returned from Instagram'); 39438 return false;
39439 } else { 39440 throw new Error('No images were returned from Instagram'); 39441 } 39442 } 39443 if ((this.options.success != null) && typeof this.options.success === 'function') { 39444 this.options.success.call(this, response); 39445 } 39446 this.context.nextUrl = ''; 39447 if (response.pagination != null) { 39448 this.context.nextUrl = response.pagination.next_url; 39449 } 39450 if (this.options.sortBy !== 'none') { 39451 if (this.options.sortBy === 'random') { 39452 sortSettings = ['', 'random']; 39453 } else { 39454 sortSettings = this.options.sortBy.split('-'); 39455 } 39456 reverse = sortSettings[0] === 'least' ? true : false; 39457 switch (sortSettings[1]) { 39458 case 'random': 39459 response.data.sort(function() { 39460 return 0.5 - Math.random(); 39461 }); 39462 break; 39463 case 'recent': 39464 response.data = this._sortBy(response.data, 'created_time', reverse); 39465 break; 39466 case 'liked': 39467 response.data = this._sortBy(response.data, 'likes.count', reverse); 39468 break; 39469 case 'commented': 39470 response.data = this._sortBy(response.data, 'comments.count', reverse); 39471 break; 39472 default: 39473 throw new Error("Invalid option for sortBy: '" + this.options.sortBy + "'."); 39474 } 39475 } 39476 if ((typeof document !== "undefined" && document !== null) && this.options.mock === false) { 39477 images = response.data; 39478 parsedLimit = parseInt(this.options.limit, 10); 39479 if ((this.options.limit != null) && images.length > parsedLimit) { 39480 images = images.slice(0, parsedLimit); 39481 } 39482 fragment = document.createDocumentFragment(); 39483 if ((this.options.filter != null) && typeof this.options.filter === 'function') { 39484 images = this._filter(images, this.options.filter); 39485 } 39486 if ((this.options.template != null) && typeof this.options.template === 'string') { 39487 htmlString = ''; 39488 imageString = ''; 39489 imgUrl = ''; 39490 tmpEl = document.createElement('div'); 39491 for (i = 0, len = images.length; i < len; i++) { 39492 image = images[i]; 39493 imageObj = image.images[this.options.resolution]; 39494 if (typeof imageObj !== 'object') { 39495 eMsg = "No image found for resolution: " + this.options.resolution + "."; 39496 throw new Error(eMsg); 39497 } 39498 imgWidth = imageObj.width; 39499 imgHeight = imageObj.height; 39500 imgOrient = "square"; 39501 if (imgWidth > imgHeight) { 39502 imgOrient = "landscape"; 39503 } 39504 if (imgWidth < imgHeight) { 39505 imgOrient = "portrait"; 39506 } 39507 imageUrl = imageObj.url; 39508 httpProtocol = window.location.protocol.indexOf("http") >= 0; 39509 if (httpProtocol && !this.options.useHttp) { 39510 imageUrl = imageUrl.replace(/https?:\/\//, '//'); 39511 } 39512 imageString = this._makeTemplate(this.options.template, { 39513 model: image, 39514 id: image.id, 39515 link: image.link, 39516 type: image.type, 39517 image: imageUrl, 39518 width: imgWidth, 39519 height: imgHeight, 39520 orientation: imgOrient, 39521 caption: this._getObjectProperty(image, 'caption.text'), 39522 likes: image.likes.count, 39523 comments: image.comments.count, 39524 location: this._getObjectProperty(image, 'location.name') 39525 }); 39526 htmlString += imageString; 39527 } 39528 tmpEl.innerHTML = htmlString; 39529 childNodesArr = []; 39530 childNodeIndex = 0; 39531 childNodeCount = tmpEl.childNodes.length; 39532 while (childNodeIndex < childNodeCount) { 39533 childNodesArr.push(tmpEl.childNodes[childNodeIndex]); 39534 childNodeIndex += 1; 39535 } 39536 for (j = 0, len1 = childNodesArr.length; j < len1; j++) { 39537 node = childNodesArr[j]; 39538 fragment.appendChild(node); 39539 } 39540 } else { 39541 for (k = 0, len2 = images.length; k < len2; k++) { 39542 image = images[k]; 39543 img = document.createElement('img'); 39544 imageObj = image.images[this.options.resolution]; 39545 if (typeof imageObj !== 'object') { 39546 eMsg = "No image found for resolution: " + this.options.resolution + "."; 39547 throw new Error(eMsg); 39548 } 39549 imageUrl = imageObj.url; 39550 httpProtocol = window.location.protocol.indexOf("http") >= 0; 39551 if (httpProtocol && !this.options.useHttp) { 39552 imageUrl = imageUrl.replace(/https?:\/\//, '//'); 39553 } 39554 img.src = imageUrl; 39555 if (this.options.links === true) { 39556 anchor = document.createElement('a'); 39557 anchor.href = image.link; 39558 anchor.appendChild(img); 39559 fragment.appendChild(anchor); 39560 } else { 39561 fragment.appendChild(img); 39562 } 39563 } 39564 } 39565 targetEl = this.options.target; 39566 if (typeof targetEl === 'string') { 39567 targetEl = document.getElementById(targetEl); 39568 } 39569 if (targetEl == null) { 39570 eMsg = "No element with id=\"" + this.options.target + "\" on page."; 39571 throw new Error(eMsg); 39572 } 39573 targetEl.appendChild(fragment); 39574 header = document.getElementsByTagName('head')[0]; 39575 header.removeChild(document.getElementById('instafeed-fetcher')); 39576 instanceName = "instafeedCache" + this.unique; 39577 window[instanceName] = void 0; 39578 try { 39579 delete window[instanceName]; 39580 } catch (_error) { 39581 e = _error; 39582 } 39583 } 39584 if ((this.options.after != null) && typeof this.options.after === 'function') { 39585 this.options.after.call(this); 39586 } 39587 return true; 39588 }; 39589 39590 Instafeed.prototype._buildUrl = function() { 39591 var base, endpoint, final; 39592 base = "https://api.instagram.com/v1"; 39593 switch (this.options.get) { 39594 case "popular": 39595 endpoint = "media/popular"; 39596 break; 39597 case "tagged": 39598 if (!this.options.tagName) { 39599 throw new Error("No tag name specified. Use the 'tagName' option."); 39600 } 39601 endpoint = "tags/" + this.options.tagName + "/media/recent"; 39602 break; 39603 case "location": 39604 if (!this.options.locationId) { 39605 throw new Error("No location specified. Use the 'locationId' option."); 39606 } 39607 endpoint = "locations/" + this.options.locationId + "/media/recent"; 39608 break; 39609 case "user": 39610 if (!this.options.userId) { 39611 throw new Error("No user specified. Use the 'userId' option."); 39612 } 39613 endpoint = "users/" + this.options.userId + "/media/recent"; 39614 break; 39615 default: 39616 throw new Error("Invalid option for get: '" + this.options.get + "'."); 39617 }
39618 final = base + "/" + endpoint; 39619 if (this.options.accessToken != null) { 39620 final += "?access_token=" + this.options.accessToken; 39621 } else { 39622 final += "?client_id=" + this.options.clientId; 39623 } 39624 if (this.options.limit != null) { 39625 final += "&count=" + this.options.limit; 39626 } 39627 final += "&callback=instafeedCache" + this.unique + ".parse"; 39628 return final; 39629 }; 39630 39631 Instafeed.prototype._genKey = function() { 39632 var S4; 39633 S4 = function() { 39634 return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); 39635 }; 39636 return "" + (S4()) + (S4()) + (S4()) + (S4()); 39637 }; 39638 39639 Instafeed.prototype._makeTemplate = function(template, data) { 39640 var output, pattern, ref, varName, varValue; 39641 pattern = /(?:\{{2})([\w\[\]\.]+)(?:\}{2})/; 39642 output = template; 39643 while (pattern.test(output)) { 39644 varName = output.match(pattern)[1]; 39645 varValue = (ref = this._getObjectProperty(data, varName)) != null ? ref : ''; 39646 output = output.replace(pattern, function() { 39647 return "" + varValue; 39648 }); 39649 } 39650 return output; 39651 }; 39652 39653 Instafeed.prototype._getObjectProperty = function(object, property) { 39654 var piece, pieces; 39655 property = property.replace(/\[(\w+)\]/g, '.$1'); 39656 pieces = property.split('.'); 39657 while (pieces.length) { 39658 piece = pieces.shift(); 39659 if ((object != null) && piece in object) { 39660 object = object[piece]; 39661 } else { 39662 return null; 39663 } 39664 } 39665 return object; 39666 }; 39667 39668 Instafeed.prototype._sortBy = function(data, property, reverse) { 39669 var sorter; 39670 sorter = function(a, b) { 39671 var valueA, valueB; 39672 valueA = this._getObjectProperty(a, property); 39673 valueB = this._getObjectProperty(b, property); 39674 if (reverse) { 39675 if (valueA > valueB) { 39676 return 1; 39677 } else { 39678 return -1; 39679 } 39680 } 39681 if (valueA < valueB) { 39682 return 1; 39683 } else { 39684 return -1; 39685 } 39686 }; 39687 data.sort(sorter.bind(this)); 39688 return data; 39689 }; 39690 39691 Instafeed.prototype._filter = function(images, filter) { 39692 var filteredImages, fn, i, image, len; 39693 filteredImages = []; 39694 fn = function(image) { 39695 if (filter(image)) { 39696 return filteredImages.push(image); 39697 } 39698 }; 39699 for (i = 0, len = images.length; i < len; i++) { 39700 image = images[i]; 39701 fn(image); 39702 } 39703 return filteredImages; 39704 }; 39705 39706 return Instafeed; 39707 39708 })(); 39709 39710 (function(root, factory) { 39711 if (typeof define === 'function' && define.amd) { 39712 return define([], factory); 39713 } else if (typeof module === 'object' && module.exports) { 39714 return module.exports = factory(); 39715 } else { 39716 return root.Instafeed = factory(); 39717 } 39718 })(this, function() { 39719 return Instafeed; 39720 }); 39721 39722}).call(this); 39723;// /var/www/www.vfb.de/httpdocs/current/?proxy=/eisbehr-/jquery.lazy/jquery.lazy.js 39724/*! 39725 * jQuery & Zepto Lazy - v1.7.9 39726 * http://jquery.eisbehr.de/lazy/ 39727 * 39728 * Copyright 2012 - 2018, Daniel 'Eisbehr' Kern 39729 * 39730 * Dual licensed under the MIT and GPL-2.0 licenses: 39731 * http://www.opensource.org/licenses/mit-license.php 39732 * http://www.gnu.org/licenses/gpl-2.0.html 39733 * 39734 * $("img.lazy").lazy(); 39735 */ 39736 39737;(function(window, undefined) { 39738 ; 39739 39740 // noinspection JSUnresolvedVariable 39741 /** 39742 * library instance - here and not in construct to be shorter in minimization 39743 * @return void 39744 */ 39745 var $ = window.jQuery || window.Zepto, 39746 39747 /** 39748 * unique plugin instance id counter 39749 * @type {number} 39750 */ 39751 lazyInstanceId = 0, 39752 39753 /** 39754 * helper to register window load for jQuery 3 39755 * @type {boolean} 39756 */ 39757 windowLoaded = false; 39758 39759 /** 39760 * make lazy available to jquery - and make it a bit more case-insensitive :) 39761 * @access public 39762 * @type {function} 39763 * @param {object} settings 39764 * @return {LazyPlugin} 39765 */ 39766 $.fn.Lazy = $.fn.lazy = function(settings) { 39767 return new LazyPlugin(this, settings); 39768 }; 39769 39770 /** 39771 * helper to add plugins to lazy prototype configuration 39772 * @access public 39773 * @type {function} 39774 * @param {string|Array}
vendor: 26,153 bytes, lines 39774-40493
39774 names 39775 * @param {string|Array|function} [elements] 39776 * @param {function} loader 39777 * @return void 39778 */ 39779 $.Lazy = $.lazy = function(names, elements, loader) { 39780 // make second parameter optional 39781 if ($.isFunction(elements)) { 39782 loader = elements; 39783 elements = []; 39784 } 39785 39786 // exit here if parameter is not a callable function 39787 if (!$.isFunction(loader)) { 39788 return; 39789 } 39790 39791 // make parameters an array of names to be sure 39792 names = $.isArray(names) ? names : [names]; 39793 elements = $.isArray(elements) ? elements : [elements]; 39794 39795 var config = LazyPlugin.prototype.config, 39796 forced = config._f || (config._f = {}); 39797 39798 // add the loader plugin for every name 39799 for (var i = 0, l = names.length; i < l; i++) { 39800 if (config[names[i]] === undefined || $.isFunction(config[names[i]])) { 39801 config[names[i]] = loader; 39802 } 39803 } 39804 39805 // add forced elements loader 39806 for (var c = 0, a = elements.length; c < a; c++) { 39807 forced[elements[c]] = names[0]; 39808 } 39809 }; 39810 39811 /** 39812 * contains all logic and the whole element handling 39813 * is packed in a private function outside class to reduce memory usage, because it will not be created on every plugin instance 39814 * @access private 39815 * @type {function} 39816 * @param {LazyPlugin} instance 39817 * @param {object} config 39818 * @param {object|Array} items 39819 * @param {object} events 39820 * @param {string} namespace 39821 * @return void 39822 */ 39823 function _executeLazy(instance, config, items, events, namespace) { 39824 /** 39825 * a helper to trigger the 'onFinishedAll' callback after all other events 39826 * @access private 39827 * @type {number} 39828 */ 39829 var _awaitingAfterLoad = 0, 39830 39831 /** 39832 * visible content width 39833 * @access private 39834 * @type {number} 39835 */ 39836 _actualWidth = -1, 39837 39838 /** 39839 * visible content height 39840 * @access private 39841 * @type {number} 39842 */ 39843 _actualHeight = -1, 39844 39845 /** 39846 * determine possibly detected high pixel density 39847 * @access private 39848 * @type {boolean} 39849 */ 39850 _isRetinaDisplay = false, 39851 39852 /** 39853 * dictionary entry for better minimization 39854 * @access private 39855 * @type {string} 39856 */ 39857 _afterLoad = 'afterLoad', 39858 39859 /** 39860 * dictionary entry for better minimization 39861 * @access private 39862 * @type {string} 39863 */ 39864 _load = 'load', 39865 39866 /** 39867 * dictionary entry for better minimization 39868 * @access private 39869 * @type {string} 39870 */ 39871 _error = 'error', 39872 39873 /** 39874 * dictionary entry for better minimization 39875 * @access private 39876 * @type {string} 39877 */ 39878 _img = 'img', 39879 39880 /** 39881 * dictionary entry for better minimization 39882 * @access private 39883 * @type {string} 39884 */ 39885 _src = 'src', 39886 39887 /** 39888 * dictionary entry for better minimization 39889 * @access private 39890 * @type {string} 39891 */ 39892 _srcset = 'srcset', 39893 39894 /** 39895 * dictionary entry for better minimization 39896 * @access private 39897 * @type {string} 39898 */ 39899 _sizes = 'sizes', 39900 39901 /** 39902 * dictionary entry for better minimization 39903 * @access private 39904 * @type {string} 39905 */ 39906 _backgroundImage = 'background-image'; 39907 39908 /** 39909 * initialize plugin 39910 * bind loading to events or set delay time to load all items at once 39911 * @access private 39912 * @return void 39913 */ 39914 function _initialize() { 39915 // detect actual device pixel ratio 39916 // noinspection JSUnresolvedVariable 39917 _isRetinaDisplay = window.devicePixelRatio > 1; 39918 39919 // prepare all initial items 39920 items = _prepareItems(items); 39921 39922 // if delay time is set load all items at once after delay time 39923 if (config.delay >= 0) { 39924 setTimeout(function() { 39925 _lazyLoadItems(true); 39926 }, config.delay); 39927 } 39928 39929 // if no delay is set or combine usage is active bind events 39930 if (config.delay < 0 || config.combined) { 39931 // create unique event function 39932 events.e = _throttle(config.throttle, function(event) { 39933 // reset detected window size on resize event 39934 if (event.type === 'resize') { 39935 _actualWidth = _actualHeight = -1; 39936 } 39937 39938 // execute 'lazy magic' 39939 _lazyLoadItems(event.all); 39940 }); 39941 39942 // create function to add new items to instance 39943 events.a = function(additionalItems) { 39944 additionalItems = _prepareItems(additionalItems); 39945 items.push.apply(items, additionalItems); 39946 }; 39947 39948 // create function to get all instance items left 39949 events.g = function() { 39950 // filter loaded items before return in case internal filter was not running until now 39951 return (items = $(items).filter(function() { 39952 return !$(this).data(config.loadedName); 39953 })); 39954 }; 39955 39956 // create function to force loading elements 39957 events.f = function(forcedItems) { 39958 for (var i = 0; i < forcedItems.length; i++) { 39959 // only handle item if available in current instance 39960 // use a compare function, because Zepto can't handle object parameter for filter 39961 // var item = items.filter(forcedItems[i]); 39962 /* jshint loopfunc: true */ 39963 var item = items.filter(function() { 39964 return this === forcedItems[i]; 39965 }); 39966 39967 if (item.length) { 39968 _lazyLoadItems(false, item); 39969 } 39970 } 39971 }; 39972 39973 // load initial items 39974 _lazyLoadItems(); 39975 39976 // bind lazy load functions to scroll and resize event 39977 // noinspection JSUnresolvedVariable 39978 $(config.appendScroll).on('scroll.' + namespace + ' resize.' + namespace, events.e); 39979 } 39980 } 39981 39982 /** 39983 * prepare items before handle them 39984 * @access private 39985 * @param {Array|object|jQuery} items 39986 * @return {Array|object|jQuery} 39987 */ 39988 function _prepareItems(items) { 39989 // fetch used configurations before loops 39990 var defaultImage = config.defaultImage, 39991 placeholder = config.placeholder, 39992 imageBase = config.imageBase, 39993 srcsetAttribute = config.srcsetAttribute, 39994 loaderAttribute = config.loaderAttribute, 39995 forcedTags = config._f || {}; 39996 39997 // filter items and only add those who not handled yet and got needed attributes available 39998 items = $(items).filter(function() { 39999 var element = $(this), 40000 tag = _getElementTagName(this); 40001 40002 return !element.data(config.handledName) && 40003 (element.attr(config.attribute) || element.attr(srcsetAttribute) || element.attr(loaderAttribute) || forcedTags[tag] !== undefined); 40004 }) 40005 40006 // append plugin instance to all elements 40007 .data('plugin_' + config.name, instance); 40008 40009 for (var i = 0, l = items.length; i < l; i++) { 40010 var element = $(items[i]), 40011 tag = _getElementTagName(items[i]), 40012 elementImageBase = element.attr(config.imageBaseAttribute) || imageBase; 40013 40014 // generate and update source set if an image base is set 40015 if (tag === _img && elementImageBase && element.attr(srcsetAttribute)) { 40016 element.attr(srcsetAttribute, _getCorrectedSrcSet(element.attr(srcsetAttribute), elementImageBase)); 40017 } 40018 40019 // add loader to forced element types 40020 if (forcedTags[tag] !== undefined && !element.attr(loaderAttribute)) { 40021 element.attr(loaderAttribute, forcedTags[tag]); 40022 } 40023 40024 // set default image on every element without source 40025 if (tag === _img && defaultImage && !element.attr(_src)) { 40026 element.attr(_src, defaultImage); 40027 } 40028 40029 // set placeholder on every element without background image 40030 else if (tag !== _img && placeholder && (!element.css(_backgroundImage) || element.css(_backgroundImage) === 'none')) { 40031 element.css(_backgroundImage, "url('" + placeholder + "')"); 40032 } 40033 } 40034 40035 return items; 40036 } 40037 40038 /** 40039 * the 'lazy magic' - check all items 40040 * @access private 40041 * @param {boolean} [allItems] 40042 * @param {object} [forced] 40043 * @return void 40044 */ 40045 function _lazyLoadItems(allItems, forced) { 40046 // skip if no items where left 40047 if (!items.length) { 40048 // destroy instance if option is enabled 40049 if (config.autoDestroy) { 40050 // noinspection JSUnresolvedFunction 40051 instance.destroy(); 40052 } 40053 40054 return; 40055 } 40056 40057 var elements = forced || items, 40058 loadTriggered = false, 40059 imageBase = config.imageBase || '', 40060 srcsetAttribute = config.srcsetAttribute, 40061 handledName = config.handledName; 40062 40063 // loop all available items 40064 for (var i = 0; i < elements.length; i++) { 40065 // item is at least in loadable area 40066 if (allItems || forced || _isInLoadableArea(elements[i])) { 40067 var element = $(elements[i]), 40068 tag = _getElementTagName(elements[i]), 40069 attribute = element.attr(config.attribute), 40070 elementImageBase = element.attr(config.imageBaseAttribute) || imageBase, 40071 customLoader = element.attr(config.loaderAttribute); 40072 40073 // is not already handled 40074 if (!element.data(handledName) && 40075 // and is visible or visibility doesn't matter 40076 (!config.visibleOnly || element.is(':visible')) && ( 40077 // and image source or source set attribute is available 40078 (attribute || element.attr(srcsetAttribute)) && ( 40079 // and is image tag where attribute is not equal source or source set 40080 (tag === _img && (elementImageBase + attribute !== element.attr(_src) || element.attr(srcsetAttribute) !== element.attr(_srcset))) || 40081 // or is non image tag where attribute is not equal background 40082 (tag !== _img && elementImageBase + attribute !== element.css(_backgroundImage)) 40083 ) || 40084 // or custom loader is available 40085 customLoader)) 40086 { 40087 // mark element always as handled as this point to prevent double handling 40088 loadTriggered = true; 40089 element.data(handledName, true); 40090 40091 // load item 40092 _handleItem(element, tag, elementImageBase, customLoader); 40093 } 40094 } 40095 } 40096 40097 // when something was loaded remove them from remaining items 40098 if (loadTriggered) { 40099 items = $(items).filter(function() { 40100 return !$(this).data(handledName); 40101 }); 40102 } 40103 } 40104 40105 /** 40106 * load the given element the lazy way 40107 * @access private 40108 * @param {object} element 40109 * @param {string} tag 40110 * @param {string} imageBase 40111 * @param {function} [customLoader] 40112 * @return void 40113 */ 40114 function _handleItem(element, tag, imageBase, customLoader) { 40115 // increment count of items waiting for after load 40116 ++_awaitingAfterLoad; 40117 40118 // extended error callback for correct 'onFinishedAll' handling 40119 var errorCallback = function() { 40120 _triggerCallback('onError', element); 40121 _reduceAwaiting(); 40122 40123 // prevent further callback calls 40124 errorCallback = $.noop; 40125 }; 40126 40127 // trigger function before loading image 40128 _triggerCallback('beforeLoad', element); 40129 40130 // fetch all double used data here for better code minimization 40131 var srcAttribute = config.attribute, 40132 srcsetAttribute = config.srcsetAttribute, 40133 sizesAttribute = config.sizesAttribute, 40134 retinaAttribute = config.retinaAttribute, 40135 removeAttribute = config.removeAttribute, 40136 loadedName = config.loadedName, 40137 elementRetina = element.attr(retinaAttribute); 40138 40139 // handle custom loader 40140 if (customLoader) { 40141 // on load callback 40142 var loadCallback = function() { 40143 // remove attribute from element 40144 if (removeAttribute) { 40145 element.removeAttr(config.loaderAttribute); 40146 } 40147 40148 // mark element as loaded 40149 element.data(loadedName, true); 40150 40151 // call after load event 40152 _triggerCallback(_afterLoad, element); 40153 40154 // remove item from waiting queue and possibly trigger finished event 40155 // it's needed to be asynchronous to run after filter was in _lazyLoadItems 40156 setTimeout(_reduceAwaiting, 1); 40157 40158 // prevent further callback calls 40159 loadCallback = $.noop; 40160 }; 40161 40162 // bind error event to trigger callback and reduce waiting amount 40163 element.off(_error).one(_error, errorCallback) 40164 40165 // bind after load callback to element 40166 .one(_load, loadCallback); 40167 40168 // trigger custom loader and handle response 40169 if (!_triggerCallback(customLoader, element, function(response) { 40170 if(response) { 40171 element.off(_load); 40172 loadCallback(); 40173 } 40174 else { 40175 element.off(_error); 40176 errorCallback(); 40177 } 40178 })) { 40179 element.trigger(_error); 40180 } 40181 } 40182 40183 // handle images 40184 else { 40185 // create image object 40186 var imageObj = $(new Image()); 40187 40188 // bind error event to trigger callback and reduce waiting amount 40189 imageObj.one(_error, errorCallback) 40190 40191 // bind after load callback to image 40192 .one(_load, function() { 40193 // remove element from view 40194 element.hide(); 40195 40196 // set image back to element 40197 // do it as single 'attr' calls, to be sure 'src' is set after 'srcset' 40198 if (tag === _img) { 40199 element.attr(_sizes, imageObj.attr(_sizes)) 40200 .attr(_srcset, imageObj.attr(_srcset)) 40201 .attr(_src, imageObj.attr(_src)); 40202 } 40203 else { 40204 element.css(_backgroundImage, "url('" + imageObj.attr(_src) + "')"); 40205 } 40206 40207 // bring it back with some effect! 40208 element[config.effect](config.effectTime); 40209 40210 // remove attribute from element 40211 if (removeAttribute) { 40212 element.removeAttr(srcAttribute + ' ' + srcsetAttribute + ' ' + retinaAttribute + ' ' + config.imageBaseAttribute); 40213 40214 // only remove 'sizes' attribute, if it was a custom one 40215 if (sizesAttribute !== _sizes) { 40216 element.removeAttr(sizesAttribute); 40217 } 40218 } 40219 40220 // mark element as loaded 40221 element.data(loadedName, true); 40222 40223 // call after load event 40224 _triggerCallback(_afterLoad, element); 40225 40226 // cleanup image object 40227 imageObj.remove(); 40228 40229 // remove item from waiting queue and possibly trigger finished event 40230 _reduceAwaiting(); 40231 }); 40232 40233 // set sources 40234 // do it as single 'attr' calls, to be sure 'src' is set after 'srcset' 40235 var imageSrc = (_isRetinaDisplay && elementRetina ? elementRetina : element.attr(srcAttribute)) || ''; 40236 imageObj.attr(_sizes, element.attr(sizesAttribute)) 40237 .attr(_srcset, element.attr(srcsetAttribute)) 40238 .attr(_src, imageSrc ? imageBase + imageSrc : null); 40239 40240 // call after load even on cached image 40241 imageObj.complete && imageObj.trigger(_load); // jshint ignore : line 40242 } 40243 } 40244 40245 /** 40246 * check if the given element is inside the current viewport or threshold 40247 * @access private 40248 * @param {object} element 40249 * @return {boolean} 40250 */ 40251 function _isInLoadableArea(element) { 40252 var elementBound = element.getBoundingClientRect(), 40253 direction = config.scrollDirection, 40254 threshold = config.threshold, 40255 vertical = // check if element is in loadable area from top 40256 ((_getActualHeight() + threshold) > elementBound.top) && 40257 // check if element is even in loadable are from bottom 40258 (-threshold < elementBound.bottom), 40259 horizontal = // check if element is in loadable area from left 40260 ((_getActualWidth() + threshold) > elementBound.left) && 40261 // check if element is even in loadable area from right 40262 (-threshold < elementBound.right); 40263 40264 if (direction === 'vertical') { 40265 return vertical; 40266 } 40267 else if (direction === 'horizontal') { 40268 return horizontal; 40269 } 40270 40271 return vertical && horizontal; 40272 } 40273 40274 /** 40275 * receive the current viewed width of the browser 40276 * @access private 40277 * @return {number} 40278 */ 40279 function _getActualWidth() { 40280 return _actualWidth >= 0 ? _actualWidth : (_actualWidth = $(window).width()); 40281 } 40282 40283 /** 40284 * receive the current viewed height of the browser 40285 * @access private 40286 * @return {number} 40287 */ 40288 function _getActualHeight() { 40289 return _actualHeight >= 0 ? _actualHeight : (_actualHeight = $(window).height()); 40290 } 40291 40292 /** 40293 * get lowercase tag name of an element 40294 * @access private 40295 * @param {object} element 40296 * @returns {string} 40297 */ 40298 function _getElementTagName(element) { 40299 return element.tagName.toLowerCase(); 40300 } 40301 40302 /** 40303 * prepend image base to all srcset entries 40304 * @access private 40305 * @param {string} srcset 40306 * @param {string} imageBase 40307 * @returns {string} 40308 */ 40309 function _getCorrectedSrcSet(srcset, imageBase) { 40310 if (imageBase) { 40311 // trim, remove unnecessary spaces and split entries 40312 var entries = srcset.split(','); 40313 srcset = ''; 40314 40315 for (var i = 0, l = entries.length; i < l; i++) { 40316 srcset += imageBase + entries[i].trim() + (i !== l - 1 ? ',' : ''); 40317 } 40318 } 40319 40320 return srcset; 40321 } 40322 40323 /** 40324 * helper function to throttle down event triggering 40325 * @access private 40326 * @param {number} delay 40327 * @param {function} callback 40328 * @return {function} 40329 */ 40330 function _throttle(delay, callback) { 40331 var timeout, 40332 lastExecute = 0; 40333 40334 return function(event, ignoreThrottle) { 40335 var elapsed = +new Date() - lastExecute; 40336 40337 function run() { 40338 lastExecute = +new Date(); 40339 // noinspection JSUnresolvedFunction 40340 callback.call(instance, event); 40341 } 40342 40343 timeout && clearTimeout(timeout); // jshint ignore : line 40344 40345 if (elapsed > delay || !config.enableThrottle || ignoreThrottle) { 40346 run(); 40347 } 40348 else { 40349 timeout = setTimeout(run, delay - elapsed); 40350 } 40351 }; 40352 } 40353 40354 /** 40355 * reduce count of awaiting elements to 'afterLoad' event and fire 'onFinishedAll' if reached zero 40356 * @access private 40357 * @return void 40358 */ 40359 function _reduceAwaiting() { 40360 --_awaitingAfterLoad; 40361 40362 // if no items were left trigger finished event 40363 if (!items.length && !_awaitingAfterLoad) { 40364 _triggerCallback('onFinishedAll'); 40365 } 40366 } 40367 40368 /** 40369 * single implementation to handle callbacks, pass element and set 'this' to current instance 40370 * @access private 40371 * @param {string|function} callback 40372 * @param {object} [element] 40373 * @param {*} [args] 40374 * @return {boolean} 40375 */ 40376 function _triggerCallback(callback, element, args) { 40377 if ((callback = config[callback])) { 40378 // jQuery's internal '$(arguments).slice(1)' are causing problems at least on old iPads 40379 // below is shorthand of 'Array.prototype.slice.call(arguments, 1)' 40380 callback.apply(instance, [].slice.call(arguments, 1)); 40381 return true; 40382 } 40383 40384 return false; 40385 } 40386 40387 // if event driven or window is already loaded don't wait for page loading 40388 if (config.bind === 'event' || windowLoaded) { 40389 _initialize(); 40390 } 40391 40392 // otherwise load initial items and start lazy after page load 40393 else { 40394 // noinspection JSUnresolvedVariable 40395 $(window).on(_load + '.' + namespace, _initialize); 40396 } 40397 } 40398 40399 /** 40400 * lazy plugin class constructor 40401 * @constructor 40402 * @access private 40403 * @param {object} elements 40404 * @param {object} settings 40405 * @return {object|LazyPlugin} 40406 */ 40407 function LazyPlugin(elements, settings) { 40408 /** 40409 * this lazy plugin instance 40410 * @access private 40411 * @type {object|LazyPlugin|LazyPlugin.prototype} 40412 */ 40413 var _instance = this, 40414 40415 /** 40416 * this lazy plugin instance configuration 40417 * @access private 40418 * @type {object} 40419 */ 40420 _config = $.extend({}, _instance.config, settings), 40421 40422 /** 40423 * instance generated event executed on container scroll or resize 40424 * packed in an object to be referenceable and short named because properties will not be minified 40425 * @access private 40426 * @type {object} 40427 */ 40428 _events = {}, 40429 40430 /** 40431 * unique namespace for instance related events 40432 * @access private 40433 * @type {string} 40434 */ 40435 _namespace = _config.name + '-' + (++lazyInstanceId); 40436 40437 // noinspection JSUndefinedPropertyAssignment 40438 /** 40439 * wrapper to get or set an entry from plugin instance configuration 40440 * much smaller on minify as direct access 40441 * @access public 40442 * @type {function} 40443 * @param {string} entryName 40444 * @param {*} [value] 40445 * @return {LazyPlugin|*} 40446 */ 40447 _instance.config = function(entryName, value) { 40448 if (value === undefined) { 40449 return _config[entryName]; 40450 } 40451 40452 _config[entryName] = value; 40453 return _instance; 40454 }; 40455 40456 // noinspection JSUndefinedPropertyAssignment 40457 /** 40458 * add additional items to current instance 40459 * @access public 40460 * @param {Array|object|string} items 40461 * @return {LazyPlugin} 40462 */ 40463 _instance.addItems = function(items) { 40464 _events.a && _events.a($.type(items) === 'string' ? $(items) : items); // jshint ignore : line 40465 return _instance; 40466 }; 40467 40468 // noinspection JSUndefinedPropertyAssignment 40469 /** 40470 * get all left items of this instance 40471 * @access public 40472 * @returns {object} 40473 */ 40474 _instance.getItems = function() { 40475 return _events.g ? _events.g() : {}; 40476 }; 40477 40478 // noinspection JSUndefinedPropertyAssignment 40479 /** 40480 * force lazy to load all items in loadable area right now 40481 * by default without throttle 40482 * @access public 40483 * @type {function} 40484 * @param {boolean} [useThrottle] 40485 * @return {LazyPlugin} 40486 */ 40487 _instance.update = function(useThrottle) { 40488 _events.e && _events.e({}, !useThrottle); // jshint ignore : line 40489 return _instance; 40490 }; 40491 40492 // noinspection JSUndefinedPropertyAssignment 40493 /**
40494 * force element(s) to load directly, ignoring the viewport 40495 * @access public 40496 * @param {Array|object|string} items 40497 * @return {LazyPlugin} 40498 */ 40499 _instance.force = function(items) { 40500 _events.f && _events.f($.type(items) === 'string' ? $(items) : items); // jshint ignore : line 40501 return _instance; 40502 }; 40503 40504 // noinspection JSUndefinedPropertyAssignment 40505 /** 40506 * force lazy to load all available items right now 40507 * this call ignores throttling 40508 * @access public 40509 * @type {function} 40510 * @return {LazyPlugin} 40511 */ 40512 _instance.loadAll = function() { 40513 _events.e && _events.e({all: true}, true); // jshint ignore : line 40514 return _instance; 40515 }; 40516 40517 // noinspection JSUndefinedPropertyAssignment 40518 /** 40519 * destroy this plugin instance 40520 * @access public 40521 * @type {function} 40522 * @return undefined 40523 */ 40524 _instance.destroy = function() { 40525 // unbind instance generated events 40526 // noinspection JSUnresolvedFunction, JSUnresolvedVariable 40527 $(_config.appendScroll).off('.' + _namespace, _events.e); 40528 // noinspection JSUnresolvedVariable 40529 $(window).off('.' + _namespace); 40530 40531 // clear events 40532 _events = {}; 40533 40534 return undefined; 40535 }; 40536 40537 // start using lazy and return all elements to be chainable or instance for further use 40538 // noinspection JSUnresolvedVariable 40539 _executeLazy(_instance, _config, elements, _events, _namespace); 40540 return _config.chainable ? elements : _instance; 40541 } 40542 40543 /** 40544 * settings and configuration data 40545 * @access public 40546 * @type {object|*} 40547 */ 40548 LazyPlugin.prototype.config = { 40549 // general 40550 name : 'lazy', 40551 chainable : true, 40552 autoDestroy : true, 40553 bind : 'load', 40554 threshold : 500, 40555 visibleOnly : false, 40556 appendScroll : window, 40557 scrollDirection : 'both', 40558 imageBase : null, 40559 defaultImage : 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', 40560 placeholder : null, 40561 delay : -1, 40562 combined : false, 40563 40564 // attributes 40565 attribute : 'data-src', 40566 srcsetAttribute : 'data-srcset', 40567 sizesAttribute : 'data-sizes', 40568 retinaAttribute : 'data-retina', 40569 loaderAttribute : 'data-loader', 40570 imageBaseAttribute : 'data-imagebase', 40571 removeAttribute : true, 40572 handledName : 'handled', 40573 loadedName : 'loaded', 40574 40575 // effect 40576 effect : 'show', 40577 effectTime : 0, 40578 40579 // throttle 40580 enableThrottle : true, 40581 throttle : 250, 40582 40583 // callbacks 40584 beforeLoad : undefined, 40585 afterLoad : undefined, 40586 onError : undefined, 40587 onFinishedAll : undefined 40588 }; 40589 40590 // register window load event globally to prevent not loading elements 40591 // since jQuery 3.X ready state is fully async and may be executed after 'load' 40592 $(window).on('load', function() { 40593 windowLoaded = true; 40594 }); 40595})(window); 40596;// /var/www/www.vfb.de/httpdocs/current/src/LAOLA1/CmsCore/Plugin/VfBPage/Fe/js/liveMatchBanner.js 40597'use strict'; 40598 40599(() => { 40600 console.debug('live match banner file'); 40601 /** 40602 * @param {Function} fn 40603 */ 40604 40605 function ready(fn) { 40606 console.debug('ready triggered'); 40607 40608 if (document.readyState !== 'loading') { 40609 console.debug('fn called'); 40610 fn(); 40611 } else { 40612 console.debug('fn added to queue'); 40613 document.addEventListener('DOMContentLoaded', fn); 40614 } 40615 } 40616 40617 ready(() => { 40618 console.debug('handling ajax container'); 40619 const ajaxCssContainerClass = '.js-ajax-container'; 40620 document.querySelectorAll(ajaxCssContainerClass).forEach(element => { 40621 if (element.dataset.url === undefined) { 40622 console.debug('container element has no ajax url'); 40623 return; 40624 } 40625 40626 url = element.dataset.url; 40627 fetch(url, { 40628 method: 'GET' 40629 }).then(r => r.json()).then(data => { 40630 if (!data.success || typeof data.html !== 'string') { 40631 throw new Error('Unable to display live ticker. Request was not successful.'); 40632 return; 40633 } 40634 40635 element.innerHTML = data.html; 40636 }).catch(error => { 40637 console.error(error); 40638 element.remove(); 40639 }); 40640 }); 40641 }); 40642})(); 40643;// /var/www/www.vfb.de/httpdocs/current/src/LAOLA1/CmsCore/Plugin/VfBLogin/Fe/js/login.js 40644var VfBLogin = { 40645 domFakeObject: null, 40646 url: null, 40647 failValue: 'Fehlgeschlagen!', 40648 refreshContent: function () { 40649 VfBTvAbo.getInstance().reload(); 40650 VideoPlayerLoader.init(); 40651 }, 40652 init: function () { 40653 if ($('#vfb-login').length && $('#vfb-login').data('url').length) { 40654 VfBLogin.domFakeObject = $('#vfb-login'); 40655 VfBLogin.url = VfBLogin.domFakeObject.data('url'); 40656 VfBLogin.isLoggedIn(); 40657 } 40658 }, 40659 isLoggedIn: function () { 40660 $.ajax({ 40661 url: VfBLogin.url, 40662 type: 'POST', 40663 dataType: 'json', 40664 data: {cmd: 'isLoggedIn'}, 40665 success: function (data) { 40666 VfBLogin.domFakeObject.html(data); 40667 }, 40668 complete: function () { 40669 VfBLogin.refreshContent(); 40670 } 40671 }); 40672 }, 40673 login: function () { 40674 var username = $('.swal2-content .login_form input[name="username"]'); 40675 var usernameValue = username.length ? $.trim(username.val()) : null; 40676 40677 var password = $('.swal2-content .login_form input[name="password"]'); 40678 var passwordValue = password.length ? (password.val()) : null; 40679 40680 if (usernameValue.length && passwordValue.length) { 40681 $.ajax({ 40682 url: VfBLogin.url, 40683 type: 'POST', 40684 dataType: 'json', 40685 data: {cmd: 'login', username: usernameValue, password: passwordValue}, 40686 success: function (data) { 40687 if (data.success === true) { 40688 VfBLogin.domFakeObject.html(data.html); 40689 VfBLogin.refreshContent(); 40690 swal.close(); 40691 } else { 40692 VfBLogin.loginFailed(); 40693 } 40694 } 40695 }); 40696 } else { 40697 VfBLogin.loginFailed(); 40698 } 40699 }, 40700 loginFailed: function () { 40701 var username = $('.swal2-content .login_form input[name="username"]'); 40702 var password = $('.swal2-content .login_form input[name="password"]'); 40703 40704 if (username.val() !== VfBLogin.failValue) { 40705 VfBLogin.loginFailedUsername = username.val(); 40706 username.val(VfBLogin.failValue); 40707 password.val(''); 40708 } 40709 40710 $('.swal2-content .login_form').on('click', 'input[name="username"]', function () { 40711 username.val(VfBLogin.loginFailedUsername); 40712 }); 40713 40714 }, 40715 logout: function () { 40716 $.ajax({ 40717 url: VfBLogin.url, 40718 type: 'POST', 40719 dataType: 'json', 40720 data: {cmd: 'logout'}, 40721 success: function (data) { 40722 if (data.success === true) { 40723 VfBLogin.domFakeObject.html(data.html); 40724 VfBLogin.refreshContent(); 40725 } else { 40726 alert(VfBLogin.failValue); 40727 } 40728 } 40729 }); 40730 } 40731}; 40732 40733$(document).ready(function () { 40734 VfBLogin.init(); 40735}); 40736 40737$(document).on('click', '.swal2-container .login_form .submit', function () { 40738 VfBLogin.login(); 40739}); 40740 40741$(document).on('keypress', '.swal2-container .login_form input', function (event) { 40742 var keyPressed = event.keyCode || event.which;
40743 //if ENTER is pressed 40744 if (keyPressed == 13) { 40745 VfBLogin.login(); 40746 } 40747}); 40748 40749 40750$(document).on('click', '#vfb-login .logout', function () { 40751 VfBLogin.logout(); 40752}); 40753 40754;// /var/www/www.vfb.de/httpdocs/current/static/js/mobileConverter.js 40755/** 40756 * MobileConverter 40757 * 40758 * @author Gerald Vrana 40759 * 40760 * Parses the Page for the Mobile view if there is an #mobile / ?mobile on the end. 40761 * 40762 */ 40763 40764var mobileConverter = {}; 40765 40766// you need to use Jquery Statements, to hide elements. 40767mobileConverter.elementsToHide = [ 40768 /*'footer', 40769 'header', 40770 '.wrapper.header', 40771 '.wrapper.sponsoren', 40772 '.wrapper-header .inner .box-right', 40773 '.wrapper.aufmacher .wrapper-header .inner .aufmacher-meldung .rightBox', 40774 '.brustring', 40775 '.watermark', 40776 '.top-watermark-bg'*/ 40777]; 40778 40779// css Statements that should be updated. 40780mobileConverter.cssUpdates = { 40781 '.wrapper.aufmacher .wrapper-header .inner .aufmacher-meldung': {'margin-top': '15px'}, 40782 'body':{'background-color': 'transparent'} 40783}; 40784 40785mobileConverter.convertPage = function () { 40786 mobileConverter.hideElements(mobileConverter.elementsToHide); 40787 mobileConverter.updateCss(mobileConverter.cssUpdates); 40788 if (mobileConverter.needToAddBackButton() === true) { 40789 mobileConverter.addBackButton(); 40790 } 40791 mobileConverter.addMobileToInternLinks(); 40792}; 40793 40794 40795/** 40796 * Hides Elements via Jquery Statements. 40797 * @param objectsToHide 40798 */ 40799mobileConverter.hideElements = function (objectsToHide) { 40800 $.each(objectsToHide, function (key, value) { 40801 if ($(document).find(value).length) { 40802 $(document).find(value).hide(); 40803 } 40804 }); 40805}; 40806 40807/** 40808 * Update CSS on the Page, via Jquery Statements. 40809 * @param cssUpdates 40810 */ 40811mobileConverter.updateCss = function (cssUpdates) { 40812 $.each(cssUpdates, function (key, value) { 40813 $.each(value, function (attribute, cssValue) { 40814 if ($(document).find(key).length) { 40815 var object = $(document).find(key); 40816 object.css(attribute, cssValue); 40817 } 40818 }) 40819 }); 40820}; 40821 40822mobileConverter.addBackButton = function () { 40823 var html = '<a href="javascript:void(0);" class="backbtn boxarrow left"><i>«</i>Zurück</a>' + 40824 '<a href="javascript:void(0);" class="boxarrow homebtn">Zurück zur Ãbersicht <i>»</i></a>'; 40825 40826 // fix if backbtn is not existing. 40827 if (!$('.backbtn').length) { 40828 if ($('.startbox .inner4').length) { 40829 $(html).prependTo('.startbox .inner4'); 40830 40831 } else if ($('main[role=main]').length) { 40832 $(html).prependTo('main[role=main]'); 40833 } 40834 } 40835}; 40836 40837/** 40838 * checks if there is a MobileParameter 40839 * return true / false; 40840 */ 40841mobileConverter.pageNeedsToBeConverted = function () { 40842 var url = window.location.href; 40843 40844 if (url.indexOf('?mobile') !== -1 || url.indexOf('#mobile') !== -1) { 40845 return true; 40846 } else { 40847 return false; 40848 } 40849}; 40850 40851/** 40852 * checks if there is a backButton 40853 * return true / false; 40854 */ 40855mobileConverter.needToAddBackButton = function () { 40856 var url = window.location.href; 40857 if (url.indexOf('&data') !== -1 || url.indexOf('%26data') !== -1) { 40858 return true; 40859 } else { 40860 return false; 40861 } 40862}; 40863 40864/** 40865 * Parses the Page, and adds ?mobile / &data to hrefs 40866 */ 40867mobileConverter.addMobileToInternLinks = function () { 40868 40869 $('a').each(function () { 40870 var href = $(this).attr('href'); 40871 40872 // added because of a without "Href" 40873 if (typeof href === 'string') { 40874 40875 if (href.indexOf('#mobile') === -1 && href.indexOf('?mobile') === -1 && href.indexOf('javascript') === -1 && href.indexOf('mailto') === -1 && href.indexOf('?proxy')) { 40876 href += '?mobile'; 40877 $(this).attr('href', href); 40878 } 40879 40880 if (mobileConverter.needToAddBackButton) { 40881 if ((href.indexOf('&data') === -1 || href.indexOf('%26data') === -1 ) && href.indexOf('javascript') === -1 && href.indexOf('mailto') === -1) { 40882 href += '&data'; 40883 $(this).attr('href', href); 40884 } 40885 } 40886 } 40887 }); 40888}; 40889 40890mobileConverter.cleanUrl = function (url) { 40891 if (url.indexOf('?mobile')) { 40892 url = url.replace('?mobile', ''); 40893 } 40894 if (url.indexOf('&data')) { 40895 url = url.replace('&data', ''); 40896 } 40897 return url; 40898}; 40899 40900 40901$(document).ready(function () { 40902 $('.backbtn').on("click", function () { 40903 history.go(-1); 40904 }); 40905 40906 40907 //home 40908 $('.homebtn').on('click', function () {
40909 window.location = '/file' + 'admin/daten/mobil/statistikverteil.html'; 40910 }) 40911}); 40912;// /var/www/www.vfb.de/httpdocs/current/src/LAOLA1/CmsCore/Plugin/VfBNewsletter/Fe/js/newsletter.js 40913(function () { 40914 40915 $(function () { 40916 var $form = $('.wrapper.newsletter .newsletter'); 40917 40918 function sendSubscriptionAjax(wantsNewsletter, wantsOffers) { 40919 var request = {}, 40920 url = $form.find("form").data('url'); 40921 40922 request.newsletterRegistration = 1; 40923 request.email = $form.find("input[name='email']").val(); 40924 request.newsletter = wantsNewsletter; 40925 request.infomail = wantsOffers; 40926 40927 $.ajax(url, { 40928 dataType: "json", data: request, method: 'post', 40929 success: function (data) { 40930 if (!data.error) { 40931 $form.html("<h3 style='text-align: center'>" + data.message + "</h3>"); 40932 } else { 40933 alert(data.message); 40934 } 40935 } 40936 }); 40937 } 40938 40939 function sendCancelSubscriptionAjax() { 40940 var request = {}, 40941 url = $form.find("form").data('url'); 40942 40943 request.email = $form.find("input[name='email']").val(); 40944 $.ajax(url, { 40945 data: request, method: 'post', 40946 success: function (data) { 40947 $form.html("<h4 style='text-align:center'>" + JSON.parse(data) + "</h4>"); 40948 } 40949 }); 40950 } 40951 40952 $form.on('click', 'button[type=button].register', function () { 40953 var wantsNewsletter = $form.find("input[name='newsletter']").is(':checked'), 40954 wantsOffers = $form.find("input[name='offers']").is(':checked'); 40955 40956 if (wantsNewsletter || wantsOffers) { 40957 sendSubscriptionAjax(wantsNewsletter, wantsOffers); 40958 40959 } else { 40960 alert("Bitte wählen Sie etwas aus!"); 40961 } 40962 }); 40963 40964 $form.on('click', 'button[type=button].cancel', function () { 40965 sendCancelSubscriptionAjax(); 40966 }); 40967 }); 40968}()); 40969 40970;// /var/www/www.vfb.de/httpdocs/current/static/js/onscreen.js 40971!function (global, factory) { 40972 "object" == typeof exports && "undefined" != typeof module ? module.exports = factory() : "function" == typeof define && define.amd ? define(factory) : global.OnScreen = factory() 40973}(this, function () { 40974 ; 40975 function attach() { 40976 var container = this.options.container; 40977 if (container instanceof HTMLElement) { 40978 var style = window.getComputedStyle(container); 40979 "static" === style.position && (container.style.position = "relative") 40980 } 40981 container.addEventListener("scroll", this._scroll), window.addEventListener("resize", this._scroll), this._scroll(), this.attached = !0 40982 } 40983 40984 function inViewport(el) { 40985 var options = arguments.length <= 1 || void 0 === arguments[1] ? {tolerance: 0} : arguments[1]; 40986 if (!el)throw new Error("You should specify the element you want to test"); 40987 "string" == typeof el && (el = document.querySelector(el)); 40988 var elRect = el.getBoundingClientRect(); 40989 return elRect.bottom - options.tolerance > 0 && elRect.right - options.tolerance > 0 && elRect.left + options.tolerance < (window.innerWidth || document.documentElement.clientWidth) && elRect.top + options.tolerance < (window.innerHeight || document.documentElement.clientHeight) 40990 } 40991 40992 function inContainer(el) { 40993 var options = arguments.length <= 1 || void 0 === arguments[1] ? {tolerance: 0, container: ""} : arguments[1]; 40994 if (!el)throw new Error("You should specify the element you want to test"); 40995 if ("string" == typeof el && (el = document.querySelector(el)), "string" == typeof options && (options = { 40996 tolerance: 0, 40997 container: document.querySelector(options) 40998 }), "string" == typeof options.container && (options.container = document.querySelector(options.container)), options instanceof HTMLElement && (options = { 40999 tolerance: 0, 41000 container: options 41001 }), !options.container)throw new Error("You should specify a container element"); 41002 var containerRect = options.container.getBoundingClientRect(); 41003 return el.offsetTop + el.clientHeight - options.tolerance > options.container.scrollTop && el.offsetLeft + el.clientWidth - options.tolerance > options.container.scrollLeft && el.offsetLeft + options.tolerance < containerRect.width + options.container.scrollLeft && el.offsetTop + options.tolerance < containerRect.height + options.container.scrollTop 41004 } 41005 41006 function eventHandler() { 41007 var trackedElements = arguments.length <= 0 || void 0 === arguments[0] ? {}
41007 : arguments[0], options = arguments.length <= 1 || void 0 === arguments[1] ? {tolerance: 0} : arguments[1], selectors = Object.keys(trackedElements), testVisibility = void 0; 41008 selectors.length && (testVisibility = options.container === window ? inViewport : inContainer, selectors.forEach(function (selector) { 41009 trackedElements[selector].nodes.forEach(function (item) { 41010 testVisibility(item.node, options) ? (item.wasVisible = item.isVisible, item.isVisible = !0) : (item.wasVisible = item.isVisible, item.isVisible = !1), item.isVisible === !0 && item.wasVisible === !1 && "function" == typeof trackedElements[selector].enter && trackedElements[selector].enter(item.node), item.isVisible === !1 && item.wasVisible === !0 && "function" == typeof trackedElements[selector].leave && trackedElements[selector].leave(item.node) 41011 }) 41012 })) 41013 } 41014 41015 function debouncedScroll() { 41016 var _this = this, timeout = void 0; 41017 return function () { 41018 clearTimeout(timeout), timeout = setTimeout(function () { 41019 eventHandler(_this.trackedElements, _this.options) 41020 }, _this.options.throttle) 41021 } 41022 } 41023 41024 function destroy() { 41025 this.options.container.removeEventListener("scroll", this._scroll), window.removeEventListener("resize", this._scroll), this.attached = !1 41026 } 41027 41028 function off(event, selector) { 41029 ({}).hasOwnProperty.call(this.trackedElements, selector) && this.trackedElements[selector][event] && delete this.trackedElements[selector][event], this.trackedElements[selector].enter || this.trackedElements[selector].leave || delete this.trackedElements[selector] 41030 } 41031 41032 function on(event, selector, callback) { 41033 var allowed = ["enter", "leave"]; 41034 if (!event)throw new Error("No event given. Choose either enter or leave"); 41035 if (!selector)throw new Error("No selector to track"); 41036 if (allowed.indexOf(event) < 0)throw new Error(event + " event is not supported"); 41037 ({}).hasOwnProperty.call(this.trackedElements, selector) || (this.trackedElements[selector] = {}), this.trackedElements[selector].nodes = []; 41038 for (var i = 0; i < document.querySelectorAll(selector).length; i++) { 41039 var item = {isVisible: !1, wasVisible: !1, node: document.querySelectorAll(selector)[i]}; 41040 this.trackedElements[selector].nodes.push(item) 41041 } 41042 "function" == typeof callback && (this.trackedElements[selector][event] = callback) 41043 } 41044 41045 function observeDOM(obj, callback) { 41046 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver, eventListenerSupported = window.addEventListener; 41047 if (MutationObserver) { 41048 var obs = new MutationObserver(function (mutations) { 41049 (mutations[0].addedNodes.length || mutations[0].removedNodes.length) && callback() 41050 }); 41051 obs.observe(obj, {childList: !0, subtree: !0}) 41052 } else eventListenerSupported && (obj.addEventListener("DOMNodeInserted", callback, !1), obj.addEventListener("DOMNodeRemoved", callback, !1)) 41053 } 41054 41055 function OnScreen() { 41056 var _this = this, options = arguments.length <= 0 || void 0 === arguments[0] ? { 41057 tolerance: 0, 41058 debounce: 100, 41059 container: window 41060 } : arguments[0]; 41061 this.options = {}, this.trackedElements = {}, Object.defineProperties(this.options, { 41062 container: { 41063 configurable: !1, 41064 enumerable: !1, 41065 get: function () { 41066 var container = void 0; 41067 return "string" == typeof options.container ? container = document.querySelector(options.container) : options.container instanceof HTMLElement && (container = options.container), container || window 41068 }, 41069 set: function (value) { 41070 options.container = value 41071 } 41072 }, debounce: { 41073 get: function () { 41074 return parseInt(options.debounce, 10) || 100 41075 }, set: function (value) { 41076 options.debounce = value 41077 } 41078 }, tolerance: { 41079 get: function () { 41080 return parseInt(options.tolerance, 10) || 0 41081 }, set: function (value) { 41082 options.tolerance = value 41083 } 41084 } 41085 }), Object.defineProperty(this, "_scroll", { 41086 enumerable: !1, 41087 configurable: !1, 41088 writable: !1, 41089 value: this._debouncedScroll.call(this) 41090 }), observeDOM(document.querySelector("body"), function () {
41091 Object.keys(_this.trackedElements).forEach(function (element) { 41092 _this.on("enter", element), _this.on("leave", element) 41093 }) 41094 }), this.attach() 41095 } 41096 41097 return Object.defineProperties(OnScreen.prototype, { 41098 _debouncedScroll: { 41099 configurable: !1, 41100 writable: !1, 41101 enumerable: !1, 41102 value: debouncedScroll 41103 }, 41104 attach: {configurable: !1, writable: !1, enumerable: !1, value: attach}, 41105 destroy: {configurable: !1, writable: !1, enumerable: !1, value: destroy}, 41106 off: {configurable: !1, writable: !1, enumerable: !1, value: off}, 41107 on: {configurable: !1, writable: !1, enumerable: !1, value: on} 41108 }), OnScreen.check = inViewport, OnScreen 41109}); 41110//# sourceMappingURL=dist/on-screen.umd.min.map 41111;// /var/www/www.vfb.de/httpdocs/current/?proxy=/gbirke/jquery_pagination/src/jquery.pagination.js 41112/** 41113 * This jQuery plugin displays pagination links inside the selected elements. 41114 * 41115 * This plugin needs at least jQuery 1.4.2 41116 * 41117 * @author Gabriel Birke (birke *at* d-scribe *dot* de) 41118 * @version 2.2 41119 * @param {int} maxentries Number of entries to paginate 41120 * @param {Object} opts Several options (see README for documentation) 41121 * @return {Object} jQuery Object 41122 */ 41123 (function($){ 41124 /** 41125 * @class Class for calculating pagination values 41126 */ 41127 $.PaginationCalculator = function(maxentries, opts) { 41128 this.maxentries = maxentries; 41129 this.opts = opts; 41130 } 41131 41132 $.extend($.PaginationCalculator.prototype, { 41133 /** 41134 * Calculate the maximum number of pages 41135 * @method 41136 * @returns {Number} 41137 */ 41138 numPages:function() { 41139 return Math.ceil(this.maxentries/this.opts.items_per_page); 41140 }, 41141 /** 41142 * Calculate start and end point of pagination links depending on 41143 * current_page and num_display_entries. 41144 * @returns {Array} 41145 */ 41146 getInterval:function(current_page) { 41147 var ne_half = Math.floor(this.opts.num_display_entries/2); 41148 var np = this.numPages(); 41149 var upper_limit = np - this.opts.num_display_entries; 41150 var start = current_page > ne_half ? Math.max( Math.min(current_page - ne_half, upper_limit), 0 ) : 0; 41151 var end = current_page > ne_half?Math.min(current_page+ne_half + (this.opts.num_display_entries % 2), np):Math.min(this.opts.num_display_entries, np); 41152 return {start:start, end:end}; 41153 } 41154 }); 41155 41156 // Initialize jQuery object container for pagination renderers 41157 $.PaginationRenderers = {} 41158 41159 /** 41160 * @class Default renderer for rendering pagination links 41161 */ 41162 $.PaginationRenderers.defaultRenderer = function(maxentries, opts) { 41163 this.maxentries = maxentries; 41164 this.opts = opts; 41165 this.pc = new $.PaginationCalculator(maxentries, opts); 41166 } 41167 $.extend($.PaginationRenderers.defaultRenderer.prototype, { 41168 /** 41169 * Helper function for generating a single link (or a span tag if it's the current page) 41170 * @param {Number} page_id The page id for the new item 41171 * @param {Number} current_page 41172 * @param {Object} appendopts Options for the new item: text and classes 41173 * @returns {jQuery} jQuery object containing the link 41174 */ 41175 createLink:function(page_id, current_page, appendopts){ 41176 var lnk, np = this.pc.numPages(); 41177 page_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value 41178 appendopts = $.extend({text:page_id+1, classes:""}, appendopts||{}); 41179 if(page_id == current_page){ 41180 lnk = $("<span class='current'>" + appendopts.text + "</span>"); 41181 } 41182 else 41183 { 41184 lnk = $("<a>" + appendopts.text + "</a>") 41185 .attr('href', this.opts.link_to.replace(/__id__/,page_id)); 41186 } 41187 if(appendopts.classes){ lnk.addClass(appendopts.classes); } 41188 lnk.data('page_id', page_id); 41189 return lnk; 41190 }, 41191 // Generate a range of numeric links 41192 appendRange:function(container, current_page, start, end, opts) { 41193 var i; 41194 for(i=start; i<end; i++) { 41195 this.createLink(i, current_page, opts).appendTo(container); 41196 } 41197 }, 41198 getLinks:function(current_page, eventHandler) { 41199 var begin, end, 41200 interval = this.pc.getInterval(current_page), 41201 np = this.pc.numPages(), 41202 fragment = $("<div class='pagination'></div>"); 41203 41204 // Generate "Previous"-Link 41205 if(this.opts.prev_text && (current_page > 0 || this.opts.prev_show_always)){ 41206 fragment.append(this.createLink(current_page-1, current_page, {text:this.opts.prev_text, classes:"prev"})); 41207 } 41208 // Generate starting points 41209 if (interval.start >
41209 0 && this.opts.num_edge_entries > 0) 41210 { 41211 end = Math.min(this.opts.num_edge_entries, interval.start); 41212 this.appendRange(fragment, current_page, 0, end, {classes:'sp'}); 41213 if(this.opts.num_edge_entries < interval.start && this.opts.ellipse_text) 41214 { 41215 jQuery("<span>"+this.opts.ellipse_text+"</span>").appendTo(fragment); 41216 } 41217 } 41218 // Generate interval links 41219 this.appendRange(fragment, current_page, interval.start, interval.end); 41220 // Generate ending points 41221 if (interval.end < np && this.opts.num_edge_entries > 0) 41222 { 41223 if(np-this.opts.num_edge_entries > interval.end && this.opts.ellipse_text) 41224 { 41225 jQuery("<span>"+this.opts.ellipse_text+"</span>").appendTo(fragment); 41226 } 41227 begin = Math.max(np-this.opts.num_edge_entries, interval.end); 41228 this.appendRange(fragment, current_page, begin, np, {classes:'ep'}); 41229 41230 } 41231 // Generate "Next"-Link 41232 if(this.opts.next_text && (current_page < np-1 || this.opts.next_show_always)){ 41233 fragment.append(this.createLink(current_page+1, current_page, {text:this.opts.next_text, classes:"next"})); 41234 } 41235 $('a', fragment).click(eventHandler); 41236 return fragment; 41237 } 41238 }); 41239 41240 // Extend jQuery 41241 $.fn.pagination = function(maxentries, opts){ 41242 41243 // Initialize options with default values 41244 opts = jQuery.extend({ 41245 items_per_page:10, 41246 num_display_entries:11, 41247 current_page:0, 41248 num_edge_entries:0, 41249 link_to:"#", 41250 prev_text:"Prev", 41251 next_text:"Next", 41252 ellipse_text:"...", 41253 prev_show_always:true, 41254 next_show_always:true, 41255 renderer:"defaultRenderer", 41256 load_first_page:false, 41257 callback:function(){return false;} 41258 },opts||{}); 41259 41260 var containers = this, 41261 renderer, links, current_page; 41262 41263 /** 41264 * This is the event handling function for the pagination links. 41265 * @param {int} page_id The new page number 41266 */ 41267 function paginationClickHandler(evt){ 41268 var links, 41269 new_current_page = $(evt.target).data('page_id'), 41270 continuePropagation = selectPage(new_current_page); 41271 if (!continuePropagation) { 41272 evt.stopPropagation(); 41273 } 41274 return continuePropagation; 41275 } 41276 41277 /** 41278 * This is a utility function for the internal event handlers. 41279 * It sets the new current page on the pagination container objects, 41280 * generates a new HTMl fragment for the pagination links and calls 41281 * the callback function. 41282 */ 41283 function selectPage(new_current_page) { 41284 // update the link display of a all containers 41285 containers.data('current_page', new_current_page); 41286 links = renderer.getLinks(new_current_page, paginationClickHandler); 41287 containers.empty(); 41288 links.appendTo(containers); 41289 // call the callback and propagate the event if it does not return false 41290 var continuePropagation = opts.callback(new_current_page, containers); 41291 return continuePropagation; 41292 } 41293 41294 // ----------------------------------- 41295 // Initialize containers 41296 // ----------------------------------- 41297 current_page = opts.current_page; 41298 containers.data('current_page', current_page); 41299 // Create a sane value for maxentries and items_per_page 41300 maxentries = (!maxentries || maxentries < 0)?1:maxentries; 41301 opts.items_per_page = (!opts.items_per_page || opts.items_per_page < 0)?1:opts.items_per_page; 41302 41303 if(!$.PaginationRenderers[opts.renderer]) 41304 { 41305 throw new ReferenceError("Pagination renderer '" + opts.renderer + "' was not found in jQuery.PaginationRenderers object."); 41306 } 41307 renderer = new $.PaginationRenderers[opts.renderer](maxentries, opts); 41308 41309 // Attach control events to the DOM elements 41310 var pc = new $.PaginationCalculator(maxentries, opts); 41311 var np = pc.numPages(); 41312 containers.bind('setPage', {numPages:np}, function(evt, page_id) { 41313 if(page_id >= 0 && page_id < evt.data.numPages) { 41314 selectPage(page_id); return false; 41315 } 41316 }); 41317 containers.bind('prevPage', function(evt){ 41318 var current_page = $(this).data('current_page'); 41319 if (current_page > 0) { 41320 selectPage(current_page - 1); 41321 } 41322 return false; 41323 }); 41324 containers.bind('nextPage', {numPages:np}, function(evt){ 41325 var current_page = $(this).data('current_page'); 41326 if(current_page < evt.data.numPages - 1) { 41327 selectPage(current_page + 1); 41328 } 41329 return false;
41330 }); 41331 41332 // When all initialisation is done, draw the links 41333 links = renderer.getLinks(current_page, paginationClickHandler); 41334 containers.empty(); 41335 links.appendTo(containers); 41336 // call callback function 41337 if(opts.load_first_page) { 41338 opts.callback(current_page, containers); 41339 } 41340 } // End of $.fn.pagination block 41341 41342})(jQuery); 41343 41344;// /var/www/www.vfb.de/httpdocs/current/static/js/pagination_renderer.js 41345/** 41346 * Custom render parameter 41347 */ 41348var customRendererOptions = { 41349 callback : pageselectCallback, 41350 items_per_page : 1, 41351 num_display_entries:7, 41352 num_edge_entries:1, 41353 ellipse_text:"…", 41354 current_page:0, 41355 prev_text:'<img src="/?proxy=img/icon_pfeil_rot.png" class="rotate180">vorherige <span>Seite</span>', 41356 next_text:'<img src="/?proxy=img/icon_pfeil_rot.png">nächste <span>Seite</span>', 41357 prev_show_always:true, 41358 next_show_always:true, 41359 renderer:"customRenderer" 41360}; 41361/** 41362 * @class Custom renderer for rendering pagination links 41363 */ 41364$.PaginationRenderers.customRenderer = function(maxentries, opts) { 41365 this.maxentries = maxentries; 41366 this.opts = opts; 41367 this.pc = new $.PaginationCalculator(maxentries, opts); 41368}; 41369 41370$.extend($.PaginationRenderers.customRenderer.prototype, { 41371 /** 41372 * Helper function for generating a single link (or a span tag if it's the current page) 41373 * @param {Number} page_id The page id for the new item 41374 * @param {Number} current_page 41375 * @param {Object} appendopts Options for the new item: text and classes 41376 * @returns {jQuery} jQuery object containing the link 41377 */ 41378 createLink:function(page_id, current_page, appendopts){ 41379 var lnk, np = this.pc.numPages(); 41380 page_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value 41381 appendopts = $.extend({text:page_id+1, classes:""}, appendopts||{}); 41382 41383 lnk = $("<a>" + appendopts.text + "</a>"); 41384 if (typeof appendopts.rel != 'undefined') { 41385 lnk.addClass('boxarrow'); 41386 if (appendopts.rel.indexOf('prev')>=0) { 41387 lnk.addClass('left'); 41388 } else if (appendopts.rel.indexOf('next')>=0) { 41389 lnk.addClass('right'); 41390 } 41391 } else { 41392 lnk.wrap('<li></li>'); 41393 lnk = lnk.parent(); 41394 } 41395 41396 if(page_id == current_page) { 41397 lnk.addClass('active'); 41398 } else { 41399 lnk.find('a').andSelf().attr('href', this.opts.link_to.replace(/__id__/,page_id)); 41400 } 41401 41402 if(appendopts.classes){ lnk.addClass(appendopts.classes); } 41403 if(appendopts.rel){ lnk.attr('rel', appendopts.rel); } 41404 lnk.find('a,img,span').andSelf().data('page_id', page_id); 41405 41406 if ((lnk.hasClass('left') && current_page == 0) || (lnk.hasClass('right') && current_page == np-1)) { 41407 lnk.css('opacity', 0); 41408 } 41409 41410 return lnk; 41411 }, 41412 // Generate a range of numeric links 41413 appendRange:function(container, current_page, start, end, opts) { 41414 var i; 41415 for(i=start; i<end; i++) { 41416 this.createLink(i, current_page, opts).appendTo(container); 41417 } 41418 }, 41419 getLinks:function(current_page, eventHandler) { 41420 var begin, end, 41421 interval = this.pc.getInterval(current_page), 41422 np = this.pc.numPages(), 41423 fragment = $("<div></div>"); 41424 fragment2 = $("<ul class='pages'></ul>"); 41425 41426 // Generate "Previous"-Link 41427 if(this.opts.prev_text && (current_page > 0 || this.opts.prev_show_always)){ 41428 fragment.append(this.createLink(current_page-1, current_page, {text:this.opts.prev_text, classes:"prev",rel:"prev"})); 41429 } 41430 // Generate starting points 41431 if (interval.start > 0 && this.opts.num_edge_entries > 0) 41432 { 41433 end = Math.min(this.opts.num_edge_entries, interval.start); 41434 this.appendRange(fragment2, current_page, 0, end, {classes:'sp'}); 41435 if(this.opts.num_edge_entries < interval.start && this.opts.ellipse_text) 41436 { 41437 $("<li>"+this.opts.ellipse_text+"</li>").appendTo(fragment2); 41438 } 41439 } 41440 // Generate interval links 41441 this.appendRange(fragment2, current_page, interval.start, interval.end); 41442 // Generate ending points
41443 if (interval.end < np && this.opts.num_edge_entries > 0) 41444 { 41445 if(np-this.opts.num_edge_entries > interval.end && this.opts.ellipse_text) 41446 { 41447 $("<li>"+this.opts.ellipse_text+"</li>").appendTo(fragment2); 41448 } 41449 begin = Math.max(np-this.opts.num_edge_entries, interval.end); 41450 this.appendRange(fragment2, current_page, begin, np, {classes:'ep'}); 41451 41452 } 41453 // Generate "Next"-Link 41454 if(this.opts.next_text && (current_page < np-1 || this.opts.next_show_always)){ 41455 fragment.append(fragment2); 41456 fragment.append(this.createLink(current_page+1, current_page, {text:this.opts.next_text, classes:"next",rel:"next"})); 41457 } 41458 $('a', fragment).click(eventHandler); 41459 return fragment; 41460 } 41461}); 41462;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Event/Fe/js/eventArchive.js 41463/** 41464 * Initialisation of EventArchive = Select; 41465 */ 41466if (typeof(ajaxUrlEventArchive) === 'undefined') { 41467 var ajaxUrlEventArchive = ''; 41468} 41469
41470function initEventArchive(selector, ajaxUrl) { 41471 41472 if (!$(selector).length) { 41473 return; 41474 } 41475 41476 ajaxUrlEventArchive = ajaxUrl; 41477 $.post(ajaxUrl, { 41478 command: 'generateSelect' 41479 }, function (data, status) { 41480 data = JSON.parse(data); 41481 41482 var output = '<select class="year" class="yearSelectEventArchiv">'; 41483 41484 var date = new Date(); 41485 41486 $.each(data.result, function (index, value) { 41487 if (parseInt(index) == parseInt(date.getFullYear())) { 41488 output += '<option selected="selected" value="' + index + '">' + index + '</option>'; 41489 } else { 41490 output += '<option value="' + index + '">' + index + '</option>'; 41491 } 41492 }); 41493 output += '</select>'; 41494 41495 $.each(data.result, function (index, value) { 41496 if (parseInt(index) == parseInt(date.getFullYear())) { 41497 output += '<select class="month" data-year="' + index + '">'; 41498 } else { 41499 output += '<select class="month" data-year="' + index + '" style="display:none">'; 41500 } 41501 41502 $.each(value, function (index, v) { 41503 index = index + ''; 41504 if (index.length == 1) { 41505 index = 0 + index; 41506 } 41507 if (parseInt(index) == parseInt(date.getMonth()) + 1) { 41508 output += '<option selected="selected" value="' + index + '">' + v + '</option>'; 41509 } else { 41510 output += '<option value="' + index + '">' + v + '</option>'; 41511 } 41512 }); 41513 output += '</select>'; 41514 }); 41515 $(selector).append(output); 41516 }); 41517} 41518 41519$(document).on('change', '.year', function () { 41520 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41521 var year = $(this).val(); 41522 $(document).find('select[data-year]').each(function () { 41523 if (parseInt(year) !== parseInt($(this).data('year'))) { 41524 $(this).hide(); 41525 } else { 41526 $(this).show(); 41527 } 41528 }) 41529 var year = $('.year').val(); 41530 $('.month').each(function () { 41531 if (parseInt($(this).data('year')) === parseInt(year)) { 41532 var month = $(this).val(); 41533 EventArchiveStartSearch(year, month); 41534 41535 var firstMonth = $(this).find('option').first().val(); 41536 var lastMonth = $(this).find('option').last().val(); 41537 41538 if (lastMonth == month) { 41539 $('li.next').hide(); 41540 } else { 41541 $('li.next').show(); 41542 } 41543 if (firstMonth == month) { 41544 $('li.previous').hide(); 41545 } else { 41546 $('li.previous').show(); 41547 } 41548 } 41549 }) 41550 } 41551}) 41552 41553$(document).ready(function () { 41554 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41555 var date = new Date(); 41556 EventArchiveStartSearch(date.getFullYear(), date.getMonth() + 1) 41557 } 41558}) 41559 41560 41561$(document).on('change', '.month', function () { 41562 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41563 var year = $('.year').val(); 41564 $('.month').each(function () { 41565 if (parseInt($(this).data('year')) === parseInt(year)) { 41566 var month = $(this).val(); 41567 EventArchiveStartSearch(year, month); 41568 41569 var firstMonth = $(this).find('option').first().val(); 41570 var lastMonth = $(this).find('option').last().val(); 41571 41572 if (lastMonth == month) { 41573 $('li.next').hide(); 41574 } else { 41575 $('li.next').show(); 41576 } 41577 if (firstMonth == month) { 41578 $('li.previous').hide(); 41579 } else { 41580 $('li.previous').show(); 41581 } 41582 41583 } 41584 }) 41585 } 41586}) 41587 41588$(document).on('change', '.category', function () { 41589 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41590 var year = $('.year').val(); 41591 $('.month').each(function () { 41592 if (parseInt($(this).data('year')) === parseInt(year)) {
41593 var month = $(this).val(); 41594 EventArchiveStartSearch(year, month); 41595 } 41596 }) 41597 } 41598}) 41599 41600 41601function EventArchiveStartSearch(year, month) { 41602 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41603 var category = 'ALL'; 41604 if ($('select.category').length) { 41605 category = $('select.category').val(); 41606 } 41607 41608 $.post(ajaxUrlEventArchive, { 41609 command: 'searchInArchive', 41610 year: year, 41611 month: month, 41612 category: category 41613 }, function (data, status) { 41614 result = JSON.parse(data); 41615 if (typeof (result.html) != "undefined" && result.html !== null) { 41616 $('.eventArchiveResult').html(result.html); 41617 if (typeof initLazyloader === 'function') { 41618 initLazyloader(); 41619 } 41620 } 41621 }) 41622 } 41623} 41624 41625function eventArchiveNextMonth() { 41626 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41627 var year = $('.year').val(); 41628 $('.month').each(function () { 41629 if (parseInt($(this).data('year')) === parseInt(year)) { 41630 var month = (parseInt($(this).val()) + 1) + ''; 41631 41632 if (month.length == 1) { 41633 month = '0' + month; 41634 } 41635 41636 /** Special use if There is a gap between months**/ 41637 for (var counter = month * 1; counter <= 12; counter++) { 41638 month = counter + ''; 41639 if (month.length == 1) { 41640 month = '0' + month; 41641 } 41642 if ($(this).find('[value=' + month + ']').length) { 41643 break; 41644 } 41645 } 41646 41647 $(this).find('[value=' + month + ']').attr('selected', 'selected'); 41648 EventArchiveStartSearch(year, month); 41649 41650 41651 var lastMonth = $(this).find('option').last().val(); 41652 if (lastMonth == month) { 41653 $('li.next').hide(); 41654 } 41655 $('li.previous').show(); 41656 41657 } 41658 }) 41659 } 41660} 41661 41662function eventArchivePrevMonth() { 41663 if (typeof(ajaxUrlEventArchive) !== 'undefined' && ajaxUrlEventArchive !== '') { 41664 var year = $('.year').val(); 41665 $('.month').each(function () { 41666 if (parseInt($(this).data('year')) === parseInt(year)) { 41667 var month = (parseInt($(this).val()) - 1) + ''; 41668 41669 if (month.length == 1) { 41670 month = '0' + month; 41671 } 41672 41673 /** Special use if There is a gap between months**/ 41674 for (var counter = month * 1; counter >= 1; counter--) { 41675 month = counter + ''; 41676 if (month.length == 1) { 41677 month = '0' + month; 41678 } 41679 if ($(this).find('[value=' + month + ']').length) { 41680 break; 41681 } 41682 } 41683 41684 $(this).find('[value=' + month + ']').attr('selected', 'selected'); 41685 EventArchiveStartSearch(year, month); 41686 41687 var firstMonth = $(this).find('option').first().val(); 41688 if (firstMonth == month) { 41689 $('li.previous').hide(); 41690 } 41691 $('li.next').show(); 41692 41693 } 41694 }) 41695 } 41696} 41697 41698;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Event/Fe/js/countdown.js 41699var ContelCountdown = { 41700 init: function($countdown) { 41701 var dateTimeString = $countdown.data('datetime'); 41702 41703 if(dateTimeString.length) { 41704 $countdown.countdown(dateTimeString) 41705 .on('update.countdown', function (event) { 41706 $countdown.find('.days').html(event.strftime('%D')); 41707 $countdown.find('.hours').html(event.strftime('%H')); 41708 $countdown.find('.minutes').html(event.strftime('%M')); 41709 $countdown.find('.seconds').html(event.strftime('%S')); 41710 }) 41711 .on('finish.countdown', function() { 41712 $countdown.remove(); 41713 });; 41714 } 41715 } 41716}; 41717 41718$(document).ready(function() { 41719 $.each($('.contel-countdown'), function() { 41720 ContelCountdown.init($(this)); 41721 }); 41722}); 41723;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Event/Fe/js/jquery.countdown.js 41724/*! 41725 * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/) 41726 * Copyright (c) 2016 Edson Hilios 41727 * 41728 * Permission is hereby granted, free of charge, to any person obtaining a copy of 41729 * this software and associated documentation files (the "Software"), to deal in 41730 * the Software without restriction, including without limitation the rights to 41731 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 41732 * the Software, and to permit persons to whom the Software is furnished to do so, 41733 * subject to the following conditions: 41734 * 41735 * The above copyright notice and this permission notice shall be included in all 41736 * copies or substantial portions of the Software. 41737 * 41738 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41739 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 41740 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 41741 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 41742 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 41743 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41744 */ 41745(function(factory) { 41746 ; 41747 if (typeof define === "function" && define.amd) { 41748 define([ "jquery" ], factory); 41749 } else { 41750 factory(jQuery); 41751 } 41752})(function($) { 41753
vendor: 8,594 bytes, lines 41753-41969
41753; 41754 var instances = [], matchers = [], defaultOptions = { 41755 precision: 100, 41756 elapse: false, 41757 defer: false 41758 }; 41759 matchers.push(/^[0-9]*$/.source); 41760 matchers.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source); 41761 matchers.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source); 41762 matchers = new RegExp(matchers.join("|")); 41763 function parseDateString(dateString) { 41764 if (dateString instanceof Date) { 41765 return dateString; 41766 } 41767 if (String(dateString).match(matchers)) { 41768 if (String(dateString).match(/^[0-9]*$/)) { 41769 dateString = Number(dateString); 41770 } 41771 if (String(dateString).match(/\-/)) { 41772 dateString = String(dateString).replace(/\-/g, "/"); 41773 } 41774 return new Date(dateString); 41775 } else { 41776 throw new Error("Couldn't cast `" + dateString + "` to a date object."); 41777 } 41778 } 41779 var DIRECTIVE_KEY_MAP = { 41780 Y: "years", 41781 m: "months", 41782 n: "daysToMonth", 41783 d: "daysToWeek", 41784 w: "weeks", 41785 W: "weeksToMonth", 41786 H: "hours", 41787 M: "minutes", 41788 S: "seconds", 41789 D: "totalDays", 41790 I: "totalHours", 41791 N: "totalMinutes", 41792 T: "totalSeconds" 41793 }; 41794 function escapedRegExp(str) { 41795 var sanitize = str.toString().replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); 41796 return new RegExp(sanitize); 41797 } 41798 function strftime(offsetObject) { 41799 return function(format) { 41800 var directives = format.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi); 41801 if (directives) { 41802 for (var i = 0, len = directives.length; i < len; ++i) { 41803 var directive = directives[i].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/), regexp = escapedRegExp(directive[0]), modifier = directive[1] || "", plural = directive[3] || "", value = null; 41804 directive = directive[2]; 41805 if (DIRECTIVE_KEY_MAP.hasOwnProperty(directive)) { 41806 value = DIRECTIVE_KEY_MAP[directive]; 41807 value = Number(offsetObject[value]); 41808 } 41809 if (value !== null) { 41810 if (modifier === "!") { 41811 value = pluralize(plural, value); 41812 } 41813 if (modifier === "") { 41814 if (value < 10) { 41815 value = "0" + value.toString(); 41816 } 41817 } 41818 format = format.replace(regexp, value.toString()); 41819 } 41820 } 41821 } 41822 format = format.replace(/%%/, "%"); 41823 return format; 41824 }; 41825 } 41826 function pluralize(format, count) { 41827 var plural = "s", singular = ""; 41828 if (format) { 41829 format = format.replace(/(:|;|\s)/gi, "").split(/\,/); 41830 if (format.length === 1) { 41831 plural = format[0]; 41832 } else { 41833 singular = format[0]; 41834 plural = format[1]; 41835 } 41836 } 41837 if (Math.abs(count) > 1) { 41838 return plural; 41839 } else { 41840 return singular; 41841 } 41842 } 41843 var Countdown = function(el, finalDate, options) { 41844 this.el = el; 41845 this.$el = $(el); 41846 this.interval = null; 41847 this.offset = {}; 41848 this.options = $.extend({}, defaultOptions); 41849 this.instanceNumber = instances.length; 41850 instances.push(this); 41851 this.$el.data("countdown-instance", this.instanceNumber); 41852 if (options) { 41853 if (typeof options === "function") { 41854 this.$el.on("update.countdown", options); 41855 this.$el.on("stoped.countdown", options); 41856 this.$el.on("finish.countdown", options); 41857 } else { 41858 this.options = $.extend({}, defaultOptions, options); 41859 } 41860 } 41861 this.setFinalDate(finalDate); 41862 if (this.options.defer === false) { 41863 this.start(); 41864 } 41865 }; 41866 $.extend(Countdown.prototype, { 41867 start: function() { 41868 if (this.interval !== null) { 41869 clearInterval(this.interval); 41870 } 41871 var self = this; 41872 this.update(); 41873 this.interval = setInterval(function() { 41874 self.update.call(self); 41875 }, this.options.precision); 41876 }, 41877 stop: function() { 41878 clearInterval(this.interval); 41879 this.interval = null; 41880 this.dispatchEvent("stoped"); 41881 }, 41882 toggle: function() { 41883 if (this.interval) { 41884 this.stop(); 41885 } else { 41886 this.start(); 41887 } 41888 }, 41889 pause: function() { 41890 this.stop(); 41891 }, 41892 resume: function() { 41893 this.start(); 41894 }, 41895 remove: function() { 41896 this.stop.call(this); 41897 instances[this.instanceNumber] = null; 41898 delete this.$el.data().countdownInstance; 41899 }, 41900 setFinalDate: function(value) { 41901 this.finalDate = parseDateString(value); 41902 }, 41903 update: function() { 41904 if (this.$el.closest("html").length === 0) { 41905 this.remove(); 41906 return; 41907 } 41908 var hasEventsAttached = $._data(this.el, "events") !== undefined, now = new Date(), newTotalSecsLeft; 41909 newTotalSecsLeft = this.finalDate.getTime() - now.getTime(); 41910 newTotalSecsLeft = Math.ceil(newTotalSecsLeft / 1e3); 41911 newTotalSecsLeft = !this.options.elapse && newTotalSecsLeft < 0 ? 0 : Math.abs(newTotalSecsLeft); 41912 if (this.totalSecsLeft === newTotalSecsLeft || !hasEventsAttached) { 41913 return; 41914 } else { 41915 this.totalSecsLeft = newTotalSecsLeft; 41916 } 41917 this.elapsed = now >= this.finalDate; 41918 this.offset = { 41919 seconds: this.totalSecsLeft % 60, 41920 minutes: Math.floor(this.totalSecsLeft / 60) % 60, 41921 hours: Math.floor(this.totalSecsLeft / 60 / 60) % 24, 41922 days: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7, 41923 daysToWeek: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7, 41924 daysToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 % 30.4368), 41925 weeks: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7), 41926 weeksToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7) % 4, 41927 months: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30.4368), 41928 years: Math.abs(this.finalDate.getFullYear() - now.getFullYear()), 41929 totalDays: Math.floor(this.totalSecsLeft / 60 / 60 / 24), 41930 totalHours: Math.floor(this.totalSecsLeft / 60 / 60), 41931 totalMinutes: Math.floor(this.totalSecsLeft / 60), 41932 totalSeconds: this.totalSecsLeft 41933 }; 41934 if (!this.options.elapse && this.totalSecsLeft === 0) { 41935 this.stop(); 41936 this.dispatchEvent("finish"); 41937 } else { 41938 this.dispatchEvent("update"); 41939 } 41940 }, 41941 dispatchEvent: function(eventName) { 41942 var event = $.Event(eventName + ".countdown"); 41943 event.finalDate = this.finalDate; 41944 event.elapsed = this.elapsed; 41945 event.offset = $.extend({}, this.offset); 41946 event.strftime = strftime(this.offset); 41947 this.$el.trigger(event); 41948 } 41949 }); 41950 $.fn.countdown = function() { 41951 var argumentsArray = Array.prototype.slice.call(arguments, 0); 41952 return this.each(function() { 41953 var instanceNumber = $(this).data("countdown-instance"); 41954 if (instanceNumber !== undefined) { 41955 var instance = instances[instanceNumber], method = argumentsArray[0]; 41956 if (Countdown.prototype.hasOwnProperty(method)) { 41957 instance[method].apply(instance, argumentsArray.slice(1)); 41958 } else if (String(method).match(/^[$A-Z_][0-9A-Z_$]*$/i) === null) { 41959 instance.setFinalDate.call(instance, method); 41960 instance.start(); 41961 } else { 41962 $.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi, method)); 41963 } 41964 } else { 41965 new Countdown(this, argumentsArray[0], argumentsArray[1]); 41966 } 41967 }); 41968 }; 41969});
41969 41970;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/News/Fe/js/newsArchive.js 41971var newsArchiveRubric; 41972var newsArchiveCurrentPage = 0; 41973 41974if (typeof(contelPageId) == 'undefined') { 41975 contelPageId = 1; 41976} 41977 41978function newsArchiveLoadSelect(ajaxUrl, command, templatePostFix) { 41979 templatePostFix = templatePostFix || ""; 41980 $.post(ajaxUrl, { 41981 command: command, 41982 rubricId: typeof newsArchiveRubricId != 'undefined' ? newsArchiveRubricId : -1, 41983 templatePostFix: templatePostFix 41984 }, function (data, status) { 41985 if (status === 'success') { 41986 result = JSON.parse(data); 41987 if (typeof (result.html) != "undefined" && result.html !== null) { 41988 $('.select').append(result.html); 41989 } 41990 if (typeof (result.year) != "undefined" && result.year !== null) { 41991 var year = hash.get('n' + contelPageId + 'y', 0); 41992 if (year != 0) { 41993 result.year = year; 41994 } 41995 $('#newsArchiveYearSelect option[value=' + result.year + ']').prop('selected', true); 41996 41997 $('ul[data-id=newsArchiveYearSelect] li[data-value=' + result.year + ']').addClass('active'); 41998 $('input[id=newsArchiveYearSelect]').val(result.year); 41999 } 42000 if (typeof (result.month) != "undefined" && result.month !== null) { 42001 var month = hash.get('n' + contelPageId + 'm', 0); 42002 if (month != 0) { 42003 result.month = month; 42004 } 42005 $('#newsArchiveMonthSelect option[value=' + result.month + ']').prop('selected', true); 42006 42007 $('ul[data-id=newsArchiveMonthSelect] li[data-value=' + result.month + ']').addClass('active'); 42008 $('input[id=newsArchiveMonthSelect]').val(result.month); 42009 } 42010 42011 if ($('#newsArchiveSaisonSelect').length) { 42012 var saison = hash.get('n' + contelPageId + 's', -1); 42013 if (saison != -1) { 42014 result.saison = saison; 42015 } 42016 $('#newsArchiveSaisonSelect option[value="' + result.saison + '"]').prop('selected', true); 42017 } 42018 42019 if ($('span.bubble').length) { 42020 postings.fillBubbles(); 42021 } 42022 42023 if ($('#newsArchiveRubricSelect').length) { 42024 var rubricId = hash.get('n' + contelPageId + 'r', -1); 42025 if (rubricId != -1) { 42026 newsArchiveRubricId = rubricId; 42027 } 42028 $('#newsArchiveRubricSelect option[value="' + newsArchiveRubricId + '"]').prop('selected', true); 42029 42030 $('ul[data-id=newsArchiveRubricSelect] li[data-value=' + newsArchiveRubricId + ']').addClass('active'); 42031 $('input[id=newsArchiveRubricSelect]').val(newsArchiveRubricId); 42032 } 42033 42034 if ($('#newsArchiveFilterSelect').length) { 42035 var newsArchiveFilters = hash.get('n' + contelPageId + 'f', ''); 42036 42037 $('#newsArchiveFilterSelect option[value="' + newsArchiveFilters + '"]').prop('selected', true); 42038 42039 $('ul[data-id=newsArchiveFilterSelect] li[data-value="' + newsArchiveFilters + '"]').addClass('active'); 42040 $('input[id=newsArchiveFilterSelect]').val(newsArchiveFilters); 42041 } 42042 42043 newsArchiveLoadData(templatePostFix); 42044 if (typeof newsArchiveRubricId!='undefined' && newsArchiveRubricId>0) { 42045 writeHash(); 42046 } 42047 // request comes from url -> save page for paging 42048 newsArchiveCurrentPage = hash.get('n' + contelPageId + 'p', 0); 42049 } 42050 }); 42051} 42052 42053function newsArchiveLoadData(templatePostFix) { 42054 //alert("caller is " + arguments.callee.caller.toString()); 42055 if ($('#dvLoading').length) { 42056 if (typeof Spinner == 'function') { 42057 var spinner = new Spinner({ 42058 top: '20px', 42059 position: 'relative' 42060 }).spin(); 42061 $('.spinner').remove(); 42062 $('#dvLoading').append(spinner.el); 42063 }
42064 $('#dvLoading').show(); 42065 } 42066 $.post(ajaxUrl, { 42067 command: 'loadPage', 42068 year: typeof $('#newsArchiveYearSelect').val() != 'undefined' ? $('#newsArchiveYearSelect').val() : 0, 42069 month: typeof $('#newsArchiveMonthSelect').val() != 'undefined' ? $('#newsArchiveMonthSelect').val() : 0, 42070 saison: typeof $('#newsArchiveSaisonSelect').val() != 'undefined' ? $('#newsArchiveSaisonSelect').val() : -1, 42071 rubricId: typeof $('#newsArchiveRubricSelect').val() != 'undefined' ? $('#newsArchiveRubricSelect').val() : -1, 42072 filters: typeof $('#newsArchiveFilterSelect').val() != 'undefined' ? $('#newsArchiveFilterSelect').val() : '', 42073 templatePostFix: templatePostFix 42074 }, function (data, status) { 42075 if (status === 'success') { 42076 $('#hiddenresult').empty(); 42077 result = JSON.parse(data); 42078 if (typeof (result.html) != "undefined" && result.html !== null) { 42079 $('#hiddenresult').append(result.html); 42080 initPagination(); 42081 } 42082 if (typeof initLazyloader === 'function') { 42083 initLazyloader(true); 42084 } 42085 if (typeof emptyNewsarchiveHandler === 'function') { 42086 emptyNewsarchiveHandler(); 42087 } 42088 } 42089 }).always(function () { 42090 if ($('#dvLoading').length) { 42091 $('#dvLoading').fadeOut(500); 42092 $('.spinner').remove(); 42093 } 42094 }); 42095} 42096 42097function pageselectCallback(page_index, jq) { 42098 var new_content = jQuery('#hiddenresult div.newpage:eq(' + page_index + ')').clone(); 42099 var page = 0; 42100 $('#newsresult').empty().append(new_content); 42101 if (typeof initLazyloader === 'function') { 42102 initLazyloader(); 42103 } 42104 if (page_index > 0) { 42105 jsonVariable = {}; 42106 jsonVariable['n' + contelPageId + 'p'] = parseInt(page_index); 42107 hash.add(jsonVariable); 42108 } else { 42109 hash.remove('n' + contelPageId + 'p'); 42110 } 42111 // request comes from url -> goto selected page 42112 if (typeof $.PaginationRenderers.zaehlpixel == 'function' && jq != 0) { 42113 $.PaginationRenderers.zaehlpixel(page_index, 42114 $('#newsArchiveFilterSelect').val().replace(',', '.'), 42115 $('#newsArchiveYearSelect').val(), 42116 $('#newsArchiveMonthSelect').val() 42117 ); 42118 } 42119 if (newsArchiveCurrentPage > 0 && newsArchiveCurrentPage != page_index) { 42120 gotoPage(newsArchiveCurrentPage); 42121 newsArchiveCurrentPage = 0; 42122 } 42123 $("html, body").animate({scrollTop: 0}, "slow"); 42124 return false; 42125} 42126 42127/** 42128 * Initialisation function for pagination 42129 */ 42130function initPagination() { 42131 // count entries inside the hidden content 42132 var num_entries = $('#hiddenresult div.newpage').length; 42133 // Create content inside pagination element 42134 $("div.paging").pagination(num_entries, customRendererOptions); 42135} 42136 42137function newsArchiveSetRubricId(rubricId, rubric) { 42138 if (newsArchiveRubricId !== rubricId) { // only if not already selected 42139 newsArchiveRubricId = rubricId; 42140 newsArchiveRubric = rubric; 42141 newsArchiveLoadData(); 42142 if (rubricId > 0) { 42143 $(".rubricfilter").empty(); 42144 $(".rubricfilter").append('<a href="javascript:void(0)" onclick="newsArchiveSetRubricId(-1,\'\');">' + rubric + '</a> '); 42145 } else { 42146 $(".rubricfilter").empty(); 42147 } 42148 } 42149} 42150 42151 42152function writeHash() { 42153 var year = $('#newsArchiveYearSelect').val(); 42154 var month = $('#newsArchiveMonthSelect').val(); 42155 var saison = $('#newsArchiveSaisonSelect').val(); 42156 var rubricId = $('#newsArchiveRubricSelect').val(); 42157 var filter = $('#newsArchiveFilterSelect').val(); 42158 if (year > 0) { 42159 jsonVariable = {}; 42160 jsonVariable['n' + contelPageId + 'y'] = year; 42161 hash.add(jsonVariable); 42162 } else { 42163 hash.remove('n' + contelPageId + 'y'); 42164 } 42165 if (month > 0 || month == -1) { // -1 for all news 42166 jsonVariable = {}; 42167 jsonVariable['n' + contelPageId + 'm'] = month; 42168 hash.add(jsonVariable); 42169 } else { 42170 hash.remove('n' + contelPageId + 'm'); 42171 } 42172 if (typeof(saison) !== 'undefined' && saison.indexOf('/')) { 42173 jsonVariable = {}; 42174 jsonVariable['n' + contelPageId + 's'] = saison; 42175 hash.add(jsonVariable); 42176 } else { 42177 hash.remove('n' + contelPageId + 's'); 42178 } 42179 if (rubricId > 0 && rubricId !== undefined) { 42180 jsonVariable = {}; 42181 jsonVariable['n' + contelPageId + 'r'] = rubricId; 42182 hash.add(jsonVariable); 42183 } else { 42184 hash.remove('n' + contelPageId + 'r'); 42185 } 42186 if (filter !== '' && filter !== undefined) { 42187 jsonVariable = {}; 42188 jsonVariable['n' + contelPageId + 'f'] = filter; 42189 hash.add(jsonVariable); 42190 } else { 42191 hash.remove('n' + contelPageId + 'f'); 42192 } 42193 hash.remove('n' + contelPageId + 'p'); 42194} 42195 42196function onHashchangeNews() { 42197 var year = hash.get('n' + contelPageId + 'y', $("#newsArchiveYearSelect").val());
42198 var month = hash.get('n' + contelPageId + 'm', $("#newsArchiveMonthSelect").val()); 42199 var saison = hash.get('n' + contelPageId + 's', -1); 42200 var rubricId = hash.get('n' + contelPageId + 'r', -1); 42201 var filters = hash.get('n' + contelPageId + 'f', ''); 42202 var page = hash.get('n' + contelPageId + 'p', 0); 42203 if ($("#newsArchiveYearSelect").length && year != $("#newsArchiveYearSelect").val()) { 42204 $("#newsArchiveYearSelect").val(year).change(); 42205 } 42206 if ($("#newsArchiveMonthSelect").length > 0 && month != $("#newsArchiveMonthSelect").val()) { 42207 $("#newsArchiveMonthSelect").val(month).change(); 42208 } 42209 if ($("#newsArchiveSaisonSelect").length && saison != $("#newsArchiveSaisonSelect").val()) { 42210 $("#newsArchiveSaisonSelect").val(saison).change(); 42211 } 42212 if ($("#newsArchiveRubricSelect").length && rubricId != $("#newsArchiveRubricSelect").val()) { 42213 $("#newsArchiveRubricSelect").val(rubricId).change(); 42214 } 42215 if ($("#newsArchiveFilterSelect").length && filters != $("#newsArchiveFilterSelect").val()) { 42216 if (filters !== null) { 42217 $("#newsArchiveFilterSelect").val(filters).change(); 42218 } 42219 } 42220 if (page > 0) { 42221 gotoPage(page); 42222 } 42223} 42224 42225function gotoPage(page) { 42226 if (parseInt(page)+1 != parseInt($('#pagination > ul > li > a.active').text())) { 42227 $('#pagination').trigger('setPage', [page]); // pass page number 42228 } 42229} 42230 42231$(document).on('change', 'select', function () { 42232 var templatePostFix = "", 42233 $newsBox = $('.newsbox'); 42234 42235 if ($newsBox.length) { 42236 templatePostFix = $newsBox.data('templatepostfix'); 42237 } 42238 42239 if ($('#newsArchiveYearSelect').length || 42240 $('#newsArchiveMonthSelect').length || 42241 $('#newsArchiveRubricSelect').length) { // Only the news archive 42242 $('#newsresult').empty(); 42243 writeHash(); 42244 newsArchiveLoadData(templatePostFix); 42245 } 42246}); 42247 42248$(window).on('hashchange', function () { 42249 if ($('#newsArchiveYearSelect').length || 42250 $('#newsArchiveMonthSelect').length || 42251 $('#newsArchiveRubricSelect').length) { // Only the news archive 42252 // check if hashchange comes from hash.add() 42253 if (hash.hashchangeFromHash()) { 42254 onHashchangeNews(); 42255 } 42256 } 42257}); 42258 42259 42260;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Page/Fe/js/pageTextAccordion.js 42261$(document).ready(function(){ 42262 $('.l1at-ptaccordion-toggle').on('click', function(){ 42263 $(this).next(".l1at-ptaccordion-box").fadeToggle(); 42264 $(this).toggleClass("open"); 42265 }); 42266}); 42267;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Page/Fe/js/pageData.js 42268function pageDataLoad(ajaxUrl, filename, successCallback, errorCallback, additionalPostData) { 42269 postData = {}; 42270 42271 if (typeof(additionalPostData) !== 'undefined'){ 42272 postData = additionalPostData; 42273 } 42274 postData.filename = filename; 42275 42276 return $.post(ajaxUrl, postData).done(function(data) { 42277 result = JSON.parse(data); 42278 if ( typeof successCallback === "function") { 42279 successCallback(result.html); 42280 } 42281 }).fail(function(jqxhr,status,data) { 42282 if ( typeof errorCallback === "function") { 42283 errorCallback(jqxhr,status,data); 42284 } 42285 }); 42286} 42287 42288$( document ).ready(function() { 42289 if ($('.dyndata-navi').length) { 42290 onHashchange(); 42291 /*$(".dyndata-navi").on('click', function() { 42292 alert($(this).parent().attr('class')); 42293 if (!$(this).parent().hasClass('active')) { 42294 jsonVariable = {}; 42295 jsonVariable['c' + $(this).attr('id')] = '1'; 42296 hash.add(jsonVariable); 42297 } 42298 });*/ 42299 } 42300}); 42301 42302function setDynDataHash(obj) { 42303 if (!obj.closest('li').hasClass('active')) { 42304 jsonVariable = {}; 42305 jsonVariable[obj.attr('id')] = obj.attr('data-linkid'); 42306 if (obj.closest('li').hasClass('default')) { 42307 hash.remove(obj.attr('id')); 42308 } else { 42309 hash.add(jsonVariable); 42310 } 42311 } 42312} 42313 42314function onHashchange(className) { 42315 className = typeof className !== 'undefined' ? className : 'dyndata-navi'; // bypass HBL 42316 if ($('.'+className).length) { 42317 $('.'+className).each(function( key, value ) { 42318 def = $(this).closest('li.default').find('.'+className).attr('data-linkid'); 42319 if (def=='undefined') { 42320 def = $(this).closest('a.default').attr('data-linkid'); 42321 } 42322 if (hash.get($(this).attr('id'), def) == $(this).attr('data-linkid')) { 42323 42324 if (!$(this).closest('li').hasClass('active')) { 42325 console.log('klick: ' + $(this).attr('id')); 42326 $(this).click(); 42327 } 42328 } 42329 }); 42330 } 42331} 42332 42333$(window).on('hashchange', function () { 42334 if ($('.dyndata-navi').length) { 42335 // check if hashchange comes from hash.add() 42336 if (hash.hashchangeFromHash()) { 42337 onHashchange(); 42338 } 42339 } 42340}); 42341;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/FeUser/Fe/js/searchData.js 42342function searchDataLoad(ajaxUrl, diashowId, successCallback, errorCallback) { 42343 return $.post(ajaxUrl, {
42344 diashowId : diashowId 42345 }).done(function(data) { 42346 result = JSON.parse(data); 42347 if ( typeof successCallback === "function") { 42348 successCallback(result.xml); 42349 } 42350 }).fail(function(jqxhr,status,data) { 42351 if ( typeof errorCallback === "function") { 42352 errorCallback(jqxhr,status,data); 42353 } 42354 }); 42355} 42356;// /var/www/www.vfb.de/httpdocs/current/static/js/rwdImageMap.js 42357/* 42358* rwdImageMaps jQuery plugin v1.4 42359* 42360* Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize 42361* 42362* Copyright (c) 2012 Matt Stow 42363* https://github.com/stowball/jQuery-rwdImageMaps 42364* http://mattstow.com 42365* Licensed under the MIT license 42366*/ 42367;(function($) { 42368 $.fn.rwdImageMaps = function() { 42369 var $img = this, 42370 version = parseFloat($.fn.jquery); 42371 42372 var rwdImageMap = function() { 42373 $img.each(function() { 42374 if (typeof($(this).attr('usemap')) == 'undefined') 42375 return; 42376 42377 var that = this, 42378 $that = $(that); 42379 42380 // Since WebKit doesn't know the height until after the image has loaded, perform everything in an onload copy 42381 $('<img />').load(function() { 42382 var w, 42383 h, 42384 attrW = 'width', 42385 attrH = 'height'; 42386 42387 // jQuery < 1.6 incorrectly uses the actual image width/height instead of the attribute's width/height 42388 if (version < 1.6) 42389 w = that.getAttribute(attrW), 42390 h = that.getAttribute(attrH); 42391 else 42392 w = $that.attr(attrW), 42393 h = $that.attr(attrH); 42394 42395 if (!w || !h) { 42396 var temp = new Image(); 42397 temp.src = $that.attr('src'); 42398 if (!w) 42399 w = temp.width; 42400 if (!h) 42401 h = temp.height; 42402 } 42403 42404 var wPercent = $that.width()/100, 42405 hPercent = $that.height()/100, 42406 map = $that.attr('usemap').replace('#', ''), 42407 c = 'coords'; 42408 42409 $('map[name="' + map + '"]').find('area').each(function() { 42410 var $this = $(this); 42411 if (!$this.data(c)) 42412 $this.data(c, $this.attr(c)); 42413 42414 var coords = $this.data(c).split(','), 42415 coordsPercent = new Array(coords.length); 42416 42417 for (var i = 0; i < coordsPercent.length; ++i) { 42418 if (i % 2 === 0) 42419 coordsPercent[i] = parseInt(((coords[i]/w)*100)*wPercent); 42420 else 42421 coordsPercent[i] = parseInt(((coords[i]/h)*100)*hPercent); 42422 } 42423 $this.attr(c, coordsPercent.toString()); 42424 }); 42425 }).attr('src', $that.attr('src')); 42426 }); 42427 }; 42428 $(window).resize(rwdImageMap).trigger('resize'); 42429 42430 return this; 42431 }; 42432})(jQuery); 42433;// /var/www/www.vfb.de/httpdocs/current/?proxy=/marioizquierdo/jquery-serializejson/jquery.serializejson.js 42434/*! 42435 SerializeJSON jQuery plugin. 42436 https://github.com/marioizquierdo/jquery.serializeJSON 42437 version 2.7.2 (Dec, 2015) 42438 42439 Copyright (c) 2012, 2015 Mario Izquierdo 42440 Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 42441 and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 42442*/ 42443(function (factory) { 42444 if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. 42445 define(['jquery'], factory); 42446 } else if (typeof exports === 'object') { // Node/CommonJS 42447 var jQuery = require('jquery'); 42448 module.exports = factory(jQuery); 42449 } else { // Browser globals (zepto supported) 42450 factory(window.jQuery || window.Zepto || window.$); // Zepto supported on browsers as well 42451 } 42452 42453}(function ($) { 42454 ; 42455 42456 // jQuery('form').serializeJSON() 42457 $.fn.serializeJSON = function (options) { 42458 var f, $form, opts, formAsArray, serializedObject, name, value, _obj, nameWithNoType, type, keys; 42459 f = $.serializeJSON; 42460 $form = this; // NOTE: the set of matched elements is most likely a form, but it could also be a group of inputs 42461 opts = f.setupOpts(options); // calculate values for options {parseNumbers, parseBoolens, parseNulls, ...} with defaults 42462 42463 // Use native `serializeArray` function to get an array of {name, value} objects. 42464 formAsArray = $form.serializeArray(); 42465 f.readCheckboxUncheckedValues(formAsArray, opts, $form); // add objects to the array from unchecked checkboxes if needed 42466 42467 // Convert the formAsArray into a serializedObject with nested keys 42468 serializedObject = {}; 42469 $.each(formAsArray, function (i, obj) { 42470 name = obj.name; // original input name 42471 value = obj.value; // input value 42472 _obj = f.extractTypeAndNameWithNoType(name); 42473 nameWithNoType = _obj.nameWithNoType; // input name with no type (i.e. "foo:string" => "foo") 42474 type = _obj.type; // type defined from the input name in :type colon notation 42475 if (!type) type = f.tryToFindTypeFromDataAttr(name, $form); // type defined in the data-value-type attr 42476 f.validateType(name, type, opts); // make sure that the type is one of the valid types if defined 42477 42478 if (type !== 'skip') { // ignore elements with type 'skip' 42479 keys = f.splitInputNameIntoKeysArray(nameWithNoType); 42480 value = f.parseValue(value, name, type, opts); // convert to string, number, boolean, null or customType 42481 f.deepSet(serializedObject, keys, value, opts); 42482 } 42483 }); 42484 return serializedObject; 42485 }; 42486 42487 // Use $.serializeJSON as namespace for the auxiliar functions 42488 // and to define defaults 42489 $.serializeJSON = { 42490 42491 defaultOptions: { 42492 checkboxUncheckedValue: undefined, // to include that value for unchecked checkboxes (instead of ignoring them) 42493 42494 parseNumbers: false, // convert values like "1", "-2.33" to 1, -2.33
42495 parseBooleans: false, // convert "true", "false" to true, false 42496 parseNulls: false, // convert "null" to null 42497 parseAll: false, // all of the above 42498 parseWithFunction: null, // to use custom parser, a function like: function(val){ return parsed_val; } 42499 42500 customTypes: {}, // override defaultTypes 42501 defaultTypes: { 42502 "string": function(str) { return String(str); }, 42503 "number": function(str) { return Number(str); }, 42504 "boolean": function(str) { var falses = ["false", "null", "undefined", "", "0"]; return falses.indexOf(str) === -1; }, 42505 "null": function(str) { var falses = ["false", "null", "undefined", "", "0"]; return falses.indexOf(str) === -1 ? str : null; }, 42506 "array": function(str) { return JSON.parse(str); }, 42507 "object": function(str) { return JSON.parse(str); }, 42508 "auto": function(str) { return $.serializeJSON.parseValue(str, null, null, {parseNumbers: true, parseBooleans: true, parseNulls: true}); }, // try again with something like "parseAll" 42509 "skip": null // skip is a special type that makes it easy to ignore elements 42510 }, 42511 42512 useIntKeysAsArrayIndex: false // name="foo[2]" value="v" => {foo: [null, null, "v"]}, instead of {foo: ["2": "v"]} 42513 }, 42514 42515 // Merge option defaults into the options 42516 setupOpts: function(options) { 42517 var opt, validOpts, defaultOptions, optWithDefault, parseAll, f; 42518 f = $.serializeJSON; 42519 42520 if (options == null) { options = {}; } // options ||= {} 42521 defaultOptions = f.defaultOptions || {}; // defaultOptions 42522 42523 // Make sure that the user didn't misspell an option 42524 validOpts = ['checkboxUncheckedValue', 'parseNumbers', 'parseBooleans', 'parseNulls', 'parseAll', 'parseWithFunction', 'customTypes', 'defaultTypes', 'useIntKeysAsArrayIndex']; // re-define because the user may override the defaultOptions 42525 for (opt in options) { 42526 if (validOpts.indexOf(opt) === -1) { 42527 throw new Error("serializeJSON ERROR: invalid option '" + opt + "'. Please use one of " + validOpts.join(', ')); 42528 } 42529 } 42530 42531 // Helper to get the default value for this option if none is specified by the user 42532 optWithDefault = function(key) { return (options[key] !== false) && (options[key] !== '') && (options[key] || defaultOptions[key]); }; 42533 42534 // Return computed options (opts to be used in the rest of the script) 42535 parseAll = optWithDefault('parseAll'); 42536 return { 42537 checkboxUncheckedValue: optWithDefault('checkboxUncheckedValue'), 42538 42539 parseNumbers: parseAll || optWithDefault('parseNumbers'), 42540 parseBooleans: parseAll || optWithDefault('parseBooleans'), 42541 parseNulls: parseAll || optWithDefault('parseNulls'), 42542 parseWithFunction: optWithDefault('parseWithFunction'), 42543 42544 typeFunctions: $.extend({}, optWithDefault('defaultTypes'), optWithDefault('customTypes')), 42545 42546 useIntKeysAsArrayIndex: optWithDefault('useIntKeysAsArrayIndex') 42547 }; 42548 }, 42549 42550 // Given a string, apply the type or the relevant "parse" options, to return the parsed value 42551 parseValue: function(valStr, inputName, type, opts) { 42552 var f, parsedVal; 42553 f = $.serializeJSON; 42554 parsedVal = valStr; // if no parsing is needed, the returned value will be the same 42555 42556 if (opts.typeFunctions && type && opts.typeFunctions[type]) { // use a type if available 42557 parsedVal = opts.typeFunctions[type](valStr); 42558 } else if (opts.parseNumbers && f.isNumeric(valStr)) { // auto: number 42559 parsedVal = Number(valStr); 42560 } else if (opts.parseBooleans && (valStr === "true" || valStr === "false")) { // auto: boolean 42561 parsedVal = (valStr === "true"); 42562 } else if (opts.parseNulls && valStr == "null") { // auto: null 42563 parsedVal = null; 42564 } 42565 if (opts.parseWithFunction && !type) { // custom parse function (apply after previous parsing options, but not if there's a specific type) 42566 parsedVal = opts.parseWithFunction(parsedVal, inputName); 42567 } 42568 42569 return parsedVal; 42570 }, 42571 42572 isObject: function(obj) { return obj === Object(obj); }, // is it an Object? 42573 isUndefined: function(obj) { return obj === void 0; }, // safe check for undefined values 42574 isValidArrayIndex: function(val) { return /^[0-9]+$/.test(String(val)); }, // 1,2,3,4 ... are valid array indexes 42575 isNumeric: function(obj) { return obj - parseFloat(obj) >= 0; }, // taken from jQuery.isNumeric implementation. Not using jQuery.isNumeric to support old jQuery and Zepto versions 42576 42577 optionKeys: function(obj) { if (Object.keys) { return Object.keys(obj); }
42577 else { var key, keys = []; for(key in obj){ keys.push(key); } return keys;} }, // polyfill Object.keys to get option keys in IE<9 42578 42579 42580 // Fill the formAsArray object with values for the unchecked checkbox inputs, 42581 // using the same format as the jquery.serializeArray function. 42582 // The value of the unchecked values is determined from the opts.checkboxUncheckedValue 42583 // and/or the data-unchecked-value attribute of the inputs. 42584 readCheckboxUncheckedValues: function (formAsArray, opts, $form) { 42585 var selector, $uncheckedCheckboxes, $el, dataUncheckedValue, f; 42586 if (opts == null) { opts = {}; } 42587 f = $.serializeJSON; 42588 42589 selector = 'input[type=checkbox][name]:not(:checked):not([disabled])'; 42590 $uncheckedCheckboxes = $form.find(selector).add($form.filter(selector)); 42591 $uncheckedCheckboxes.each(function (i, el) { 42592 $el = $(el); 42593 dataUncheckedValue = $el.attr('data-unchecked-value'); 42594 if(dataUncheckedValue) { // data-unchecked-value has precedence over option opts.checkboxUncheckedValue 42595 formAsArray.push({name: el.name, value: dataUncheckedValue}); 42596 } else { 42597 if (!f.isUndefined(opts.checkboxUncheckedValue)) { 42598 formAsArray.push({name: el.name, value: opts.checkboxUncheckedValue}); 42599 } 42600 } 42601 }); 42602 }, 42603 42604 // Returns and object with properties {name_without_type, type} from a given name. 42605 // The type is null if none specified. Example: 42606 // "foo" => {nameWithNoType: "foo", type: null} 42607 // "foo:boolean" => {nameWithNoType: "foo", type: "boolean"} 42608 // "foo[bar]:null" => {nameWithNoType: "foo[bar]", type: "null"} 42609 extractTypeAndNameWithNoType: function(name) { 42610 var match; 42611 if (match = name.match(/(.*):([^:]+)$/)) { 42612 return {nameWithNoType: match[1], type: match[2]}; 42613 } else { 42614 return {nameWithNoType: name, type: null}; 42615 } 42616 }, 42617 42618 // Find an input in the $form with the same name, 42619 // and get the data-value-type attribute. 42620 // Returns nil if none found. Returns the first data-value-type found if many inputs have the same name. 42621 tryToFindTypeFromDataAttr: function(name, $form) { 42622 var escapedName, selector, $input, typeFromDataAttr; 42623 escapedName = name.replace(/(:|\.|\[|\]|\s)/g,'\\$1'); // every non-standard character need to be escaped by \\ 42624 selector = '[name="' + escapedName + '"]'; 42625 $input = $form.find(selector).add($form.filter(selector)); 42626 typeFromDataAttr = $input.attr('data-value-type'); // NOTE: this returns only the first $input element if multiple are matched with the same name (i.e. an "array[]"). So, arrays with different element types specified through the data-value-type attr is not supported. 42627 return typeFromDataAttr || null; 42628 }, 42629 42630 // Raise an error if the type is not recognized. 42631 validateType: function(name, type, opts) { 42632 var validTypes, f; 42633 f = $.serializeJSON; 42634 validTypes = f.optionKeys(opts ? opts.typeFunctions : f.defaultOptions.defaultTypes); 42635 if (!type || validTypes.indexOf(type) !== -1) { 42636 return true; 42637 } else { 42638 throw new Error("serializeJSON ERROR: Invalid type " + type + " found in input name '" + name + "', please use one of " + validTypes.join(', ')); 42639 } 42640 }, 42641 42642 42643 // Split the input name in programatically readable keys. 42644 // Examples: 42645 // "foo" => ['foo'] 42646 // "[foo]" => ['foo'] 42647 // "foo[inn][bar]" => ['foo', 'inn', 'bar'] 42648 // "foo[inn[bar]]" => ['foo', 'inn', 'bar'] 42649 // "foo[inn][arr][0]" => ['foo', 'inn', 'arr', '0'] 42650 // "arr[][val]" => ['arr', '', 'val'] 42651 splitInputNameIntoKeysArray: function(nameWithNoType) { 42652 var keys, f; 42653 f = $.serializeJSON; 42654 keys = nameWithNoType.split('['); // split string into array 42655 keys = $.map(keys, function (key) { return key.replace(/\]/g, ''); }); // remove closing brackets 42656 if (keys[0] === '') { keys.shift(); } // ensure no opening bracket ("[foo][inn]" should be same as "foo[inn]") 42657 return keys; 42658 }, 42659 42660 // Set a value in an object or array, using multiple keys to set in a nested object or array: 42661 // 42662 // deepSet(obj, ['foo'], v) // obj['foo'] = v 42663 // deepSet(obj, ['foo', 'inn'], v) // obj['foo']['inn'] = v // Create the inner obj['foo'] object, if needed 42664 // deepSet(obj, ['foo', 'inn', '123'], v) // obj['foo']['arr']['123'] = v // 42665 // 42666 // deepSet(obj, ['0'], v) // obj['0'] = v 42667 // deepSet(arr, ['0'], v, {useIntKeysAsArrayIndex: true}) // arr[0] = v 42668 // deepSet(arr, [''], v) // arr.push(v) 42669 // deepSet(obj, ['arr', ''], v) // obj['arr'].push(v) 42670 // 42671 // arr = []; 42672 // deepSet(arr, ['', v] // arr => [v] 42673 // deepSet(arr, ['', 'foo'], v) // arr => [v, {foo: v}] 42674 // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}] 42675 // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}, {bar: v}] 42676 // 42677 deepSet: function (o, keys, value, opts) {
42678 var key, nextKey, tail, lastIdx, lastVal, f; 42679 if (opts == null) { opts = {}; } 42680 f = $.serializeJSON; 42681 if (f.isUndefined(o)) { throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined"); } 42682 if (!keys || keys.length === 0) { throw new Error("ArgumentError: param 'keys' expected to be an array with least one element"); } 42683 42684 key = keys[0]; 42685 42686 // Only one key, then it's not a deepSet, just assign the value. 42687 if (keys.length === 1) { 42688 if (key === '') { 42689 o.push(value); // '' is used to push values into the array (assume o is an array) 42690 } else { 42691 o[key] = value; // other keys can be used as object keys or array indexes 42692 } 42693 42694 // With more keys is a deepSet. Apply recursively. 42695 } else { 42696 nextKey = keys[1]; 42697 42698 // '' is used to push values into the array, 42699 // with nextKey, set the value into the same object, in object[nextKey]. 42700 // Covers the case of ['', 'foo'] and ['', 'var'] to push the object {foo, var}, and the case of nested arrays. 42701 if (key === '') { 42702 lastIdx = o.length - 1; // asume o is array 42703 lastVal = o[lastIdx]; 42704 if (f.isObject(lastVal) && (f.isUndefined(lastVal[nextKey]) || keys.length > 2)) { // if nextKey is not present in the last object element, or there are more keys to deep set 42705 key = lastIdx; // then set the new value in the same object element 42706 } else { 42707 key = lastIdx + 1; // otherwise, point to set the next index in the array 42708 } 42709 } 42710 42711 // '' is used to push values into the array "array[]" 42712 if (nextKey === '') { 42713 if (f.isUndefined(o[key]) || !$.isArray(o[key])) { 42714 o[key] = []; // define (or override) as array to push values 42715 } 42716 } else { 42717 if (opts.useIntKeysAsArrayIndex && f.isValidArrayIndex(nextKey)) { // if 1, 2, 3 ... then use an array, where nextKey is the index 42718 if (f.isUndefined(o[key]) || !$.isArray(o[key])) { 42719 o[key] = []; // define (or override) as array, to insert values using int keys as array indexes 42720 } 42721 } else { // for anything else, use an object, where nextKey is going to be the attribute name 42722 if (f.isUndefined(o[key]) || !f.isObject(o[key])) { 42723 o[key] = {}; // define (or override) as object, to set nested properties 42724 } 42725 } 42726 } 42727 42728 // Recursively set the inner object 42729 tail = keys.slice(1); 42730 f.deepSet(o[key], tail, value, opts); 42731 } 42732 } 42733 42734 }; 42735 42736})); 42737 42738;// /var/www/www.vfb.de/httpdocs/current/static/js/smart-app-banner.js 42739(function(u){"object"===typeof exports&&"undefined"!==typeof module?module.exports=u():"function"===typeof define&&define.amd?define([],u):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).SmartBanner=u()})(function(){return function c(f,h,e){function b(d,v){if(!h[d]){if(!f[d]){var g="function"==typeof require&&require;if(!v&&g)return g(d,!0);if(a)return a(d,!0);g=Error("Cannot find module '"+d+"'");throw g.code="MODULE_NOT_FOUND",g;}g=h[d]= 42740{exports:{}};f[d][0].call(g.exports,function(a){var e=f[d][1][a];return b(e?e:a)},g,g.exports,c,f,h,e)}return h[d].exports}for(var a="function"==typeof require&&require,d=0;d<e.length;d++)b(e[d]);return b}({1:[function(c,f,h){var e=c("xtend/mutable"),b=c("component-query"),a=c("get-doc"),d=c("cookie-cutter"),g=c("ua-parser-js"),v=(navigator.language||navigator.userLanguage||navigator.browserLanguage).slice(-2)||"us",p=a&&a.documentElement,l={ios:{appMeta:"apple-itunes-app",iconRels:["apple-touch-icon-precomposed", 42741"apple-touch-icon"],getStoreLink:function(){return"https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id"+this.appId+"?mt=8"}},android:{appMeta:"google-play-app",iconRels:["android-touch-icon","apple-touch-icon-precomposed","apple-touch-icon"],getStoreLink:function(){return"http://play.google.com/store/apps/details?id="+this.appId}},windows:{appMeta:"msApplication-ID",iconRels:["windows-touch-icon","apple-touch-icon-precomposed","apple-touch-icon"],getStoreLink:function(){return"http://www.windowsphone.com/s?appid="+ 42742this.appId}}};c=function(a){var b=g(navigator.userAgent);this.options=e({},{daysHidden:15,daysReminder:90,appStoreLanguage:v,button:"OPEN",store:{ios:"O
42742n the App Store",android:"In Google Play",windows:"In the Windows Store"},price:{ios:"FREE",android:"FREE",windows:"FREE"},theme:"",icon:"",force:""},a||{});this.options.force?this.type=this.options.force:"Windows Phone"===b.os.name||"Windows Mobile"===b.os.name?this.type="windows":"iOS"===b.os.name?this.type="ios":"Android"===b.os.name&&(this.type= 42743"android");a=!this.type||!this.options.store[this.type];var m="ios"===this.type&&"Mobile Safari"===b.browser.name&&6<=parseInt(b.os.version,10),r=navigator.standalone,w=d.get("smartbanner-closed"),q=d.get("smartbanner-installed");a||m||r||w||q||(e(this,l[this.type]),!this.parseAppId()&&"IOS"===b.os.name&&"Safari"===b.browser.name)||(this.create(),this.show())};c.prototype={constructor:c,create:function(){var d=this.getStoreLink(),e=this.options.price[this.type]+" - "+this.options.store[this.type], 42744m;if(this.options.icon)m=this.options.icon;else for(var r=0;r<this.iconRels.length;r++){var g=b('link[rel="'+this.iconRels[r]+'"]');if(g){m=g.getAttribute("href");break}}var q=a.createElement("div");q.className="smartbanner smartbanner-"+(this.options.theme||this.type);q.innerHTML='<div class="smartbanner-container"><a href="javascript:void(0);" class="smartbanner-close">×</a><span class="smartbanner-icon" style="background-image: url('+m+')"></span><div class="smartbanner-info"><div class="smartbanner-title">'+ 42745this.options.title+"</div><div>"+this.options.author+"</div><span>"+e+'</span></div><a href="'+d+'" class="smartbanner-button"><span class="smartbanner-button-text">'+this.options.button+"</span></a></div>";a.body?a.body.appendChild(q):a&&a.addEventListener("DOMContentLoaded",function(){a.body.appendChild(q)});b(".smartbanner-button",q).addEventListener("click",this.install.bind(this),!1);b(".smartbanner-close",q).addEventListener("click",this.close.bind(this),!1)},hide:function(){p.classList.remove("smartbanner-show"); 42746if("function"===typeof this.options.close)return this.options.close()},show:function(){p.classList.add("smartbanner-show");if("function"===typeof this.options.show)return this.options.show()},close:function(){this.hide();d.set("smartbanner-closed","true",{path:"/",expires:new Date(Number(new Date)+864E5*this.options.daysHidden)});if("function"===typeof this.options.close)return this.options.close()},install:function(){this.hide();d.set("smartbanner-installed","true",{path:"/",expires:new Date(Number(new Date)+ 42747864E5*this.options.daysReminder)});if("function"===typeof this.options.close)return this.options.close()},parseAppId:function(){var a=b('meta[name="'+this.appMeta+'"]');if(a)return this.appId="windows"===this.type?a.getAttribute("content"):/app-id=([^\s,]+)/.exec(a.getAttribute("content"))[1]}};f.exports=c},{"component-query":2,"cookie-cutter":3,"get-doc":4,"ua-parser-js":6,"xtend/mutable":7}],2:[function(c,f,h){function e(b,a){return a.querySelector(b)}h=f.exports=function(b,a){a=a||document;return e(b, 42748a)};h.all=function(b,a){a=a||document;return a.querySelectorAll(b)};h.engine=function(b){if(!b.one)throw Error(".one callback required");if(!b.all)throw Error(".all callback required");e=b.one;h.all=b.all;return h}},{}],3:[function(c,f,h){h=f.exports=function(e){e||(e={});"string"===typeof e&&(e={cookie:e});void 0===e.cookie&&(e.cookie="");return{get:function(b){for(var a=e.cookie.split(/;\s*/),d=0;d<a.length;d++){var g=a[d].split("=");if(unescape(g[0])===b)return unescape(g[1])}},set:function(b, 42749a,d){d||(d={});b=escape(b)+"="+escape(a);d.expires&&(b+="; expires="+d.expires);d.path&&(b+="; path="+escape(d.path));return e.cookie=b}}};"undefined"!==typeof document&&(c=h(document),h.get=c.get,h.set=c.set)},{}],4:[function(c,f,h){c=c("has-dom");f.exports=c()?document:null},{"has-dom":5}],5:[function(c,f,h){f.exports=function(){return"undefined"!==typeof window&&"undefined"!==typeof document&&"function"===typeof document.createElement}},{}],6:[function(c,f,h){(function(e,b){var a={extend:function(a, 42750b){var d={},m;for(m in a)d[m]=b[m]&&0===b[m].length%2?b[m].concat(a[m]):a[m];return d},has:function(a,b){return"string"===typeof a?-1!==b.toLowerCase().indexOf(a.toLowerCase()):!1},lowerize:function(a){return a.toLowerCase()},major:function(a){return"string"===typeof a?a.split(".")[0]:b},trim:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},d=function(){for(var a,d=0,e,g,c,k,h,f,l=arguments;d<l.length&&!h;){var p=l[d],n=l[d+1];if("undefined"===typeof a)for(c in a={},n)n.hasOwnProperty(c)&& 42751(k=n[c],"object"===typeof k?a[k[0]]=b:a[k]=b);for(e=g=0;e<p.length&&!h;)if(h=p[e++].exec(this.getUA()))for(c=0;c<n.length;c++)f=h[++g],k=n[c],"object"===typeof k&&0<k.length?2==k.length?a[k[0]]="function"==typeof k[1]?k[1].call(this,f):k[1]:3==k.length?a[k[0]]="function"!==typeof k[1]||k[1].exec&&k[1].test?f?f.replace(k[1],k[2]):b:f?k[1].call(this,f,k[2]):b:4==k.length&&(a[k[0]]=f?k[3].call(this,f.replace(k[1],k[2])):b):a[k]=f?f:b;d+=2}return a},g=function(d,e){for(var c in e)if("object"===typeof e[c]&& 427520<e[c].length)for(var g=0;g<e[c].length;g++){if(a.has(e[c][g],d))return"?"===c?b:c}else if(a.has(e[c],d))return"?"===c?b:c;return d},c={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2E3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},p={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],["name","version"],[/(OPiOS)[\/\s]+([\w\.]+)/i],[["name", 42753"Opera Mini"],"version"],[/\s(opr)\/([\w\.]+)/i],[["name","Opera"],"version"],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],["name","version"],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[["name","IE"],"version"],[/(edge)\/((\d+)?[\w\.]+)/i], 42754["name","version"],[/(yabrowser)\/([\w\.]+)/i],[["name","Yandex"],"version"],[/(comodo_dragon)\/([\w\.]+)/i],[["name",/_/g," "],"version"],[/(chrome|omniweb|arora|[t
42754izenoka]{5}\s?browser)\/v?([\w\.]+)/i],["name","version"],[/(MicroMessenger)\/([\w\.]+)/i],[["name","WeChat"],"version"],[/(qqbrowser)[\/\s]?([\w\.]+)/i],["name","version"],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/JUC.+(ucweb)[\/\s]?([\w\.]+)/i],[["name","UCBrowser"],"version"],[/(dolfin)\/([\w\.]+)/i], 42755[["name","Dolphin"],"version"],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[["name","Chrome"],"version"],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],["version",["name","MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],["version",["name","Android Browser"]],[/FBAV\/([\w\.]+);/i],["version",["name","Facebook"]],[/fxios\/([\w\.-]+)/i],["version",["name","Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],["version",["name","Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i], 42756["version","name"],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],["name",["version",g,{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],["name","version"],[/(navigator|netscape)\/([\w\.-]+)/i],[["name","Netscape"],"version"],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,
vendor: 5,654 bytes, lines 42757-42767
42757/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],["name","version"]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",a.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], 42758[["architecture",/ower/,"",a.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",a.lowerize]]],device:[[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[["vendor",a.trim],["model",a.trim],["type","smarttv"]],[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],["model","vendor",["type","tablet"]],[/applecoremedia\/[\w\.]+ \((ipad)/],["model",["vendor","Apple"],["type", 42759"tablet"]],[/(apple\s{0,1}tv)/i],[["model","Apple TV"],["vendor","Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],["vendor","model",["type","tablet"]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],["model",["vendor","Amazon"],["type","tablet"]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[["model",g,{"Fire Phone":["SD","KF"]}],["vendor","Amazon"],["type","mobile"]],[/\((ip[honed|\s\w*]+);.+(apple)/i], 42760["model","vendor",["type","mobile"]],[/\((ip[honed|\s\w*]+);/i],["model",["vendor","Apple"],["type","mobile"]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],["vendor","model",["type","mobile"]],[/\(bb10;\s(\w+)/i],["model",["vendor","BlackBerry"],["type","mobile"]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],["model",["vendor","Asus"],["type","tablet"]], 42761[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[["vendor","Sony"],["model","Xperia Tablet"],["type","tablet"]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[["vendor","Sony"],["model","Xperia Phone"],["type","mobile"]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],["vendor","model",["type","console"]],[/android.+;\s(shield)\sbuild/i],["model",["vendor","Nvidia"],["type","console"]],[/(playstation\s[34portablevi]+)/i],["model",["vendor","Sony"],["type","console"]],[/(sprint\s(\w+))/i], 42762[["vendor",g,{HTC:"APA",Sprint:"Sprint"}],["model",g,{"Evo Shift 4G":"7373KT"}],["type","mobile"]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],["vendor","model",["type","tablet"]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],["vendor",["model",/_/g," "],["type","mobile"]],[/(nexus\s9)/i],["model",["vendor","HTC"],["type","tablet"]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],["model",["vendor","Microsoft"],["type", 42763"console"]],[/(kin\.[onetw]{3})/i],[["model",/\./g," "],["vendor","Microsoft"],["type","mobile"]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s[6])/i],["model",["vendor","Motorola"],["type","mobile"]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],["model",["vendor","Motorola"],["type","tablet"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[["vendor","Samsung"], 42764"model",["type","tablet"]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[["vendor","Samsung"],"model",["type","mobile"]],[/hbbtv.+maple;(\d+)/i],[["model",/^/,"SmartTV"],["vendor","Samsung"],["type","smarttv"]],[/\(dtv[\);].+(aquos)/i],["model",["vendor","Sharp"],["type","smarttv"]],[/sie-(\w+)*/i],["model",["vendor","Siemens"],["type","mobile"]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[["vendor","Nokia"],"model", 42765["type","mobile"]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],["model",["vendor","Acer"],["type","tablet"]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[["vendor","LG"],"model",["type","tablet"]],[/(lg) netcast\.tv/i],["vendor","model",["type","smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],["model",["vendor","LG"],["type","mobile"]],[/android.+(ideatab[a-z0-9\-\s]+)/i],["model",["vendor","Lenovo"],["type","tablet"]],[/linux;.+((jolla));/i],["vendor","model",["type","mobile"]],[/((pebble))app\/[\d\.]+\s/i], 42766["vendor","model",["type","wearable"]],[/android.+;\s(glass)\s\d/i],["model",["vendor","Google"],["type","wearable"]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[["model",/_/g," "],["vendor","Xiaomi"],["type","mobile"]],[/\s(tablet)[;\/]/i,/\s(mobile)[;\/]/i],[["type",a.lowerize],"vendor","model"]],engine:[[/windows.+\sedge\/([\w\.]+)/i],["version",["name","EdgeHTML"]],[/(presto)\/([\w\.]+)/i, 42767/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],["name","version"],[/rv\:([\w\.]+).*(gecko)/i],["version","name"]],os:[[/microsoft\s(windows)\s(vista|xp)/i],["name","version"],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],["name",["version",g,c]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[["name","Windows"],["version",g,c]],[/\((bb)(10);/i],[["name",
42768"BlackBerry"],"version"],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],["name","version"],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[["name","Symbian"],"version"],[/\((series40);/i],["name"],[/mozilla.+\(mobile;.+gecko.+firefox/i],[["name","Firefox OS"],"version"],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i, 42769/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],["name","version"],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[["name","Chromium OS"],"version"],[/(sunos)\s?([\w\.]+\d)*/i],[["name","Solaris"],"version"],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],["name","version"],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[["name","iOS"],["version",/_/g, 42770"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[["name","Mac OS"],["version",/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],["name","version"]]},l=function(b,c){if(!(this instanceof l))return(new l(b,c)).getResult();var g=b||(e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),f=c?a.extend(p,c):p;this.getBrowser=function(){var b= 42771d.apply(this,f.browser);b.major=a.major(b.version);return b};this.getCPU=function(){return d.apply(this,f.cpu)};this.getDevice=function(){return d.apply(this,f.device)};this.getEngine=function(){return d.apply(this,f.engine)};this.getOS=function(){return d.apply(this,f.os)};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return g};this.setUA=function(a){g=a;return this}; 42772return this};l.VERSION="0.7.11";l.BROWSER={NAME:"name",MAJOR:"major",VERSION:"version"};l.CPU={ARCHITECTURE:"architecture"};l.DEVICE={MODEL:"model",VENDOR:"vendor",TYPE:"type",CONSOLE:"console",MOBILE:"mobile",SMARTTV:"smarttv",TABLET:"tablet",WEARABLE:"wearable",EMBEDDED:"embedded"};l.ENGINE={NAME:"name",VERSION:"version"};l.OS={NAME:"name",VERSION:"version"};"undefined"!==typeof h?("undefined"!==typeof f&&f.exports&&(h=f.exports=l),h.UAParser=l):e.UAParser=l;var n=e.jQuery||e.Zepto;if("undefined"!== 42773typeof n){var t=new l;n.ua=t.getResult();n.ua.get=function(){return t.getUA()};n.ua.set=function(a){t.setUA(a);a=t.getResult();for(var b in a)n.ua[b]=a[b]}}})("object"===typeof window?window:this)},{}],7:[function(c,f,h){f.exports=function(b){for(var a=1;a<arguments.length;a++){var d=arguments[a],c;for(c in d)e.call(d,c)&&(b[c]=d[c])}return b};var e=Object.prototype.hasOwnProperty},{}]},{},[1])(1)}); 42774 42775;// /var/www/www.vfb.de/httpdocs/current/?proxy=/fgnass/spin.js/spin.js 42776/** 42777 * Copyright (c) 2011-2014 Felix Gnass 42778 * Licensed under the MIT license 42779 * http://spin.js.org/ 42780 * 42781 * Example: 42782 var opts = { 42783 lines: 12 // The number of lines to draw 42784 , length: 7 // The length of each line 42785 , width: 5 // The line thickness 42786 , radius: 10 // The radius of the inner circle 42787 , scale: 1.0 // Scales overall size of the spinner 42788 , corners: 1 // Roundness (0..1) 42789 , color: '#000' // #rgb or #rrggbb 42790 , opacity: 1/4 // Opacity of the lines 42791 , rotate: 0 // Rotation offset 42792 , direction: 1 // 1: clockwise, -1: counterclockwise 42793 , speed: 1 // Rounds per second 42794 , trail: 100 // Afterglow percentage 42795 , fps: 20 // Frames per second when using setTimeout() 42796 , zIndex: 2e9 // Use a high z-index by default 42797 , className: 'spinner' // CSS class to assign to the element 42798 , top: '50%' // center vertically 42799 , left: '50%' // center horizontally 42800 , shadow: false // Whether to render a shadow 42801 , hwaccel: false // Whether to use hardware acceleration (might be buggy) 42802 , position: 'absolute' // Element positioning 42803 } 42804 var target = document.getElementById('foo') 42805 var spinner = new Spinner(opts).spin(target) 42806 */ 42807;(function (root, factory) { 42808 42809 /* CommonJS */ 42810 if (typeof module == 'object' && module.exports) module.exports = factory() 42811 42812 /* AMD module */ 42813 else if (typeof define == 'function' && define.amd) define(factory) 42814 42815 /* Browser global */ 42816 else root.Spinner = factory() 42817}(this, function () { 42818 42819 42820 var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */ 42821 , animations = {} /* Animation rules keyed by their name */ 42822 , useCssAnimations /* Whether to use CSS animations or setTimeout */ 42823 , sheet /* A stylesheet to hold the @keyframe or VML rules. */ 42824 42825 /** 42826 * Utility function to create elements. If no tag name is given, 42827 * a DIV is created. Optionally properties can be passed. 42828 */ 42829 function createEl (tag, prop) { 42830 var el = document.createElement(tag || 'div') 42831 , n 42832 42833 for (n in prop) el[n] = prop[n] 42834 return el 42835 } 42836 42837 /** 42838 * Appends children and returns the parent. 42839 */ 42840 function ins (parent /* child1, child2, ...*/) { 42841 for (var i = 1, n = arguments.length; i < n; i++) { 42842 parent.appendChild(arguments[i]) 42843 } 42844 42845 return parent 42846 } 42847 42848 /** 42849 * Creates an opacity keyframe animation rule and returns its name. 42850 * Since most mobile Webkits have timing issues with animation-delay, 42851 * we create separate rules for each line/segment. 42852 */ 42853 function addAnimation (alpha, trail, i, lines) { 42854 var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-') 42855 , start = 0.01 + i/lines * 100 42856 , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha) 42857 , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase() 42858 , pre = prefix && '-' + prefix + '-' || '' 42859 42860 if (!animations[name]) { 42861 sheet.insertRule( 42862 '@' + pre + 'keyframes ' + name + '{' + 42863 '0%{opacity:' + z + '}' + 42864 start + '%{opacity:' + alpha + '}' + 42865 (start+0.01) + '%{opacity:1}' + 42866 (start+trail) % 100 + '%{opacity:' + alpha + '}' + 42867 '100%{opacity:' + z + '}' + 42868 '}', sheet.cssRules.length) 42869 42870 animations[name] = 1 42871 } 42872 42873 return name 42874 } 42875 42876 /**
vendor: 4,896 bytes, lines 42877-43045
42877 * Tries various vendor prefixes and returns the first supported property. 42878 */ 42879 function vendor (el, prop) { 42880 var s = el.style 42881 , pp 42882 , i 42883 42884 prop = prop.charAt(0).toUpperCase() + prop.slice(1) 42885 if (s[prop] !== undefined) return prop 42886 for (i = 0; i < prefixes.length; i++) { 42887 pp = prefixes[i]+prop 42888 if (s[pp] !== undefined) return pp 42889 } 42890 } 42891 42892 /** 42893 * Sets multiple style properties at once. 42894 */ 42895 function css (el, prop) { 42896 for (var n in prop) { 42897 el.style[vendor(el, n) || n] = prop[n] 42898 } 42899 42900 return el 42901 } 42902 42903 /** 42904 * Fills in default values. 42905 */ 42906 function merge (obj) { 42907 for (var i = 1; i < arguments.length; i++) { 42908 var def = arguments[i] 42909 for (var n in def) { 42910 if (obj[n] === undefined) obj[n] = def[n] 42911 } 42912 } 42913 return obj 42914 } 42915 42916 /** 42917 * Returns the line color from the given string or array. 42918 */ 42919 function getColor (color, idx) { 42920 return typeof color == 'string' ? color : color[idx % color.length] 42921 } 42922 42923 // Built-in defaults 42924 42925 var defaults = { 42926 lines: 12 // The number of lines to draw 42927 , length: 7 // The length of each line 42928 , width: 5 // The line thickness 42929 , radius: 10 // The radius of the inner circle 42930 , scale: 1.0 // Scales overall size of the spinner 42931 , corners: 1 // Roundness (0..1) 42932 , color: '#000' // #rgb or #rrggbb 42933 , opacity: 1/4 // Opacity of the lines 42934 , rotate: 0 // Rotation offset 42935 , direction: 1 // 1: clockwise, -1: counterclockwise 42936 , speed: 1 // Rounds per second 42937 , trail: 100 // Afterglow percentage 42938 , fps: 20 // Frames per second when using setTimeout() 42939 , zIndex: 2e9 // Use a high z-index by default 42940 , className: 'spinner' // CSS class to assign to the element 42941 , top: '50%' // center vertically 42942 , left: '50%' // center horizontally 42943 , shadow: false // Whether to render a shadow 42944 , hwaccel: false // Whether to use hardware acceleration (might be buggy) 42945 , position: 'absolute' // Element positioning 42946 } 42947 42948 /** The constructor */ 42949 function Spinner (o) { 42950 this.opts = merge(o || {}, Spinner.defaults, defaults) 42951 } 42952 42953 // Global defaults that override the built-ins: 42954 Spinner.defaults = {} 42955 42956 merge(Spinner.prototype, { 42957 /** 42958 * Adds the spinner to the given target element. If this instance is already 42959 * spinning, it is automatically removed from its previous target b calling 42960 * stop() internally. 42961 */ 42962 spin: function (target) { 42963 this.stop() 42964 42965 var self = this 42966 , o = self.opts 42967 , el = self.el = createEl(null, {className: o.className}) 42968 42969 css(el, { 42970 position: o.position 42971 , width: 0 42972 , zIndex: o.zIndex 42973 , left: o.left 42974 , top: o.top 42975 }) 42976 42977 if (target) { 42978 target.insertBefore(el, target.firstChild || null) 42979 } 42980 42981 el.setAttribute('role', 'progressbar') 42982 self.lines(el, self.opts) 42983 42984 if (!useCssAnimations) { 42985 // No CSS animation support, use setTimeout() instead 42986 var i = 0 42987 , start = (o.lines - 1) * (1 - o.direction) / 2 42988 , alpha 42989 , fps = o.fps 42990 , f = fps / o.speed 42991 , ostep = (1 - o.opacity) / (f * o.trail / 100) 42992 , astep = f / o.lines 42993 42994 ;(function anim () { 42995 i++ 42996 for (var j = 0; j < o.lines; j++) { 42997 alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) 42998 42999 self.opacity(el, j * o.direction + start, alpha, o) 43000 } 43001 self.timeout = self.el && setTimeout(anim, ~~(1000 / fps)) 43002 })() 43003 } 43004 return self 43005 } 43006 43007 /** 43008 * Stops and removes the Spinner. 43009 */ 43010 , stop: function () { 43011 var el = this.el 43012 if (el) { 43013 clearTimeout(this.timeout) 43014 if (el.parentNode) el.parentNode.removeChild(el) 43015 this.el = undefined 43016 } 43017 return this 43018 } 43019 43020 /** 43021 * Internal method that draws the individual lines. Will be overwritten 43022 * in VML fallback mode below. 43023 */ 43024 , lines: function (el, o) { 43025 var i = 0 43026 , start = (o.lines - 1) * (1 - o.direction) / 2 43027 , seg 43028 43029 function fill (color, shadow) { 43030 return css(createEl(), { 43031 position: 'absolute' 43032 , width: o.scale * (o.length + o.width) + 'px' 43033 , height: o.scale * o.width + 'px' 43034 , background: color 43035 , boxShadow: shadow 43036 , transformOrigin: 'left' 43037 , transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)' 43038 , borderRadius: (o.corners * o.scale * o.width >> 1) + 'px' 43039 }) 43040 } 43041 43042 for (; i < o.lines; i++) { 43043 seg = css(createEl(), { 43044 position: 'absolute' 43045 , top: 1 + ~(o.scale * o.width / 2) + 'px'
43046 , transform: o.hwaccel ? 'translate3d(0,0,0)' : '' 43047 , opacity: o.opacity 43048 , animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite' 43049 }) 43050 43051 if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'})) 43052 ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)'))) 43053 } 43054 return el 43055 } 43056 43057 /** 43058 * Internal method that adjusts the opacity of a single line. 43059 * Will be overwritten in VML fallback mode below. 43060 */ 43061 , opacity: function (el, i, val) { 43062 if (i < el.childNodes.length) el.childNodes[i].style.opacity = val 43063 } 43064 43065 }) 43066 43067 43068 function initVML () { 43069 43070 /* Utility function to create a VML tag */ 43071 function vml (tag, attr) { 43072 return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) 43073 } 43074 43075 // No CSS transforms but VML support, add a CSS rule for VML elements: 43076 sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') 43077 43078 Spinner.prototype.lines = function (el, o) { 43079 var r = o.scale * (o.length + o.width) 43080 , s = o.scale * 2 * r 43081 43082 function grp () { 43083 return css( 43084 vml('group', { 43085 coordsize: s + ' ' + s 43086 , coordorigin: -r + ' ' + -r 43087 }) 43088 , { width: s, height: s } 43089 ) 43090 } 43091 43092 var margin = -(o.width + o.length) * o.scale * 2 + 'px' 43093 , g = css(grp(), {position: 'absolute', top: margin, left: margin}) 43094 , i 43095 43096 function seg (i, dx, filter) { 43097 ins( 43098 g 43099 , ins( 43100 css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}) 43101 , ins( 43102 css( 43103 vml('roundrect', {arcsize: o.corners}) 43104 , { width: r 43105 , height: o.scale * o.width 43106 , left: o.scale * o.radius 43107 , top: -o.scale * o.width >> 1 43108 , filter: filter 43109 } 43110 ) 43111 , vml('fill', {color: getColor(o.color, i), opacity: o.opacity}) 43112 , vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change 43113 ) 43114 ) 43115 ) 43116 } 43117 43118 if (o.shadow) 43119 for (i = 1; i <= o.lines; i++) { 43120 seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') 43121 } 43122 43123 for (i = 1; i <= o.lines; i++) seg(i) 43124 return ins(el, g) 43125 } 43126 43127 Spinner.prototype.opacity = function (el, i, val, o) { 43128 var c = el.firstChild 43129 o = o.shadow && o.lines || 0 43130 if (c && i + o < c.childNodes.length) { 43131 c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild 43132 if (c) c.opacity = val 43133 } 43134 } 43135 } 43136 43137 if (typeof document !== 'undefined') { 43138 sheet = (function () { 43139 var el = createEl('style', {type : 'text/css'}) 43140 ins(document.getElementsByTagName('head')[0], el) 43141 return el.sheet || el.styleSheet 43142 }()) 43143 43144 var probe = css(createEl('group'), {behavior: 'url(#default#VML)'}) 43145 43146 if (!vendor(probe, 'transform') && probe.adj) initVML() 43147 else useCssAnimations = vendor(probe, 'animation') 43148 } 43149 43150 return Spinner 43151 43152})); 43153 43154;// /var/www/www.vfb.de/httpdocs/current/static/js/suche.js 43155var searchApi = { 43156 initGallery: function () { 43157 $('.suchergebnis article').each(function () { 43158 vfb.diashowInit($(this)); 43159 }); 43160 } 43161}; 43162;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/OnSiteSearchExtended/Fe/js/searchApi.js 43163if (!searchApi) { 43164 var searchApi = {}; 43165} 43166searchApi = $.extend(searchApi, { 43167 firstSearch: true, 43168 actPage: 1, 43169 actCategoryId: null, 43170 pageSize: 20, 43171 resultHtmls: [], 43172 pagingHtmls: [], 43173 formSubmit: function (formElement) { 43174 var url = $(formElement).data('url'); 43175 var urlSplit = url.split('/'); 43176 var parameterSign = urlSplit[urlSplit.length - 1] == '' ? '?' : '&'; 43177 43178 window.location.href = url + parameterSign + "search=" + $(formElement).find('input[name="search"]').val(); 43179 }, 43180 search: function () { 43181 var api = this; 43182 var $changeSearchCategoryActive = $('.changeSearchCategory.active'); 43183 43184 // explicitly scroll to top on paging 43185 $(window).scrollTop(0); 43186 43187 $(api.element).find('.' + api.resultClass).html(''); 43188 $(api.element).find('.paging-container').html(''); 43189 43190 if (!$changeSearchCategoryActive.hasClass('inactive')) { 43191 $(api.element).find('.searchLoader').show(); 43192 if (typeof api.resultHtmls[api.actPage] !== 'undefined') { 43193 api.showResults(); 43194 } else { 43195 $.ajax({ 43196 type: "GET", 43197 data: {q: api.searchValue, p: api.actPage, i: api.identifer}, 43198 timeout: 5000, 43199 dataType: "jsonp", 43200 url: api.domain, 43201 success: api.searchSuccess, 43202 error: api.searchError 43203 }); 43204 } 43205 } else { 43206 var categoryName = $changeSearchCategoryActive.data('category'); 43207 var categoryEmptyHtml = $(api.element).find('.searchError.categoryEmpty').html(); 43208 categoryEmptyHtml = categoryEmptyHtml.replace('[[category]]', categoryName); 43209 $(api.element).find('.' + api.resultClass).html(categoryEmptyHtml); 43210 } 43211 }, 43212 searchSuccess: function (data) { 43213 $.ajax({ 43214 url: searchApi.feAjaxUrl, 43215 type: 'POST', 43216 data: { 43217 cmd: 'getHtmlForSearchResults', 43218 resultXml: data.result, 43219 pageId: searchApi.pageId, 43220 postfix: searchApi.postFix ? searchApi.postFix : "",
43221 categories: $('.searchCategories').length ? true : false, 43222 categoryId: searchApi.actCategoryId, 43223 firstSearch: searchApi.firstSearch, 43224 actPage: searchApi.actPage, 43225 pageSize: searchApi.pageSize, 43226 resultClass: searchApi.resultClass 43227 }, 43228 dataType: 'json', 43229 success: function (data, status) { 43230 if (status === 'success') { 43231 data = $.parseJSON(data); 43232 if (searchApi.firstSearch == true) { 43233 $(searchApi.element).find('.searchCategories').html(data.categoriesHtml); 43234 $(searchApi.element).find('.sumResults').html(data.allCategoryTotalResults); 43235 } 43236 searchApi.resultHtmls[searchApi.actPage] = data.resultsHtml; 43237 searchApi.pagingHtmls[searchApi.actPage] = data.pagingHtml; 43238 searchApi.showResults(); 43239 if (typeof searchApi.initGallery === "function") { 43240 searchApi.initGallery(); 43241 } 43242 43243 searchApi.lookForDiashowCallback(); 43244 } 43245 } 43246 }); 43247 }, 43248 searchError: function () { 43249 if (typeof error !== "undefined" && error == "timeout") { 43250 $(searchApi.element).find('.searchError.timeout').show(); 43251 } else if (typeof request !== "undefined" && request.status == 404 || typeof request !== "undefined" && request.status == 500) { 43252 $(searchApi.element).find('.searchError.notavailable').show(); 43253 } 43254 }, 43255 showResults: function () { 43256 searchApi.actCategoryId = $('.changeSearchCategory.active').data('categoryid'); 43257 $(searchApi.element).find('.' + searchApi.resultClass).html(searchApi.resultHtmls[searchApi.actPage][searchApi.actCategoryId]); 43258 $(searchApi.element).find('.paging-container').html(searchApi.pagingHtmls[searchApi.actPage][searchApi.actCategoryId]); 43259 $(searchApi.element).find('.searchLoader').hide(); 43260 searchApi.firstSearch = false; 43261 $(searchApi.element).find('.searchText').show(); 43262 43263 searchApi.lookForDiashowCallback(); 43264 }, 43265 lookForDiashowCallback: function () { 43266 var category = $('.changeSearchCategory.active').data('category'); 43267 if (category === "Diashows" && typeof searchApi.callback !== 'undefined' && typeof searchApi.callback === 'function') { 43268 searchApi.callback(); 43269 } 43270 } 43271}); 43272 43273// Search - Go! 43274$(function () { 43275 var $searchApi = $('.searchApi'); 43276 if ($searchApi.length) { 43277 $searchApi.each(function () { 43278 var isTag = false; 43279 if ($(this).data('tag')) { 43280 if ($.isNumeric($(this).data('tag'))) { 43281 searchApi.searchValue = $(this).data('tag'); 43282 isTag = true; 43283 } 43284 } else { 43285 searchApi.searchValue = $(this).find('input[name="search"]').attr('value'); 43286 } 43287 43288 if (isTag === true || (typeof searchApi.searchValue !== 'undefined' && searchApi.searchValue.length > 2)) { 43289 searchApi.domain = $(this).data('domain'); 43290 searchApi.identifer = $(this).data('identifier'); 43291 searchApi.feAjaxUrl = $(this).data('ajaxurl'); 43292 searchApi.pageId = $(this).data('pageid'); 43293 searchApi.postFix = $(this).data('postfix'); 43294 searchApi.actCategoryId = $(this).data('categoryid'); 43295 searchApi.resultClass = $(this).data('result-class'); 43296 searchApi.element = this; 43297 searchApi.search(); 43298 } else { 43299 $(this).find('.searchError.input').show(); 43300 } 43301 }); 43302 } 43303}); 43304 43305$(document).on('click', '.changeSearchCategory', function () { 43306 if (!$(this).hasClass('active') && $.isNumeric($(this).data('categoryid'))) { 43307 var parentTag = $(this).parent(); 43308 $(parentTag).find('.changeSearchCategory').removeClass('active'); 43309 $(this).addClass('active'); 43310 43311 searchApi.actPage = 1; 43312 searchApi.actCategoryId = $(this).data('categoryid'); 43313 searchApi.search(); 43314 43315 searchApi.lookForDiashowCallback(); 43316 } 43317}); 43318 43319$(document).on('click', '.searchPreviousPage', function () { 43320 searchApi.actPage--; 43321 searchApi.search(); 43322}); 43323 43324$(document).on('click', '.searchNextPage', function () {
43325 searchApi.actPage++; 43326 searchApi.search(); 43327}); 43328 43329$(document).on('click', '.searchApi .pages li', function () { 43330 searchApi.actPage = parseInt($(this).text()); 43331 searchApi.search(); 43332}); 43333 43334;// /var/www/www.vfb.de/httpdocs/current/src/LAOLA1/CmsCore/Plugin/TvAbos/Fe/js/aboPayment.js 43335; 43336 43337var _VfBTvAbo; 43338function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); } 43339function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } 43340function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } 43341function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; } 43342function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } 43343function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } 43344function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } 43345function _classStaticPrivateMethodGet(receiver, classConstructor, method) { _classCheckPrivateStaticAccess(receiver, classConstructor); return method; } 43346function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { _classCheckPrivateStaticAccess(receiver, classConstructor); _classCheckPrivateStaticFieldDescriptor(descriptor, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } 43347function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } 43348function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { _classCheckPrivateStaticAccess(receiver, classConstructor); _classCheckPrivateStaticFieldDescriptor(descriptor, "get"); return _classApplyDescriptorGet(receiver, descriptor); } 43349function _classCheckPrivateStaticFieldDescriptor(descriptor, action) { if (descriptor === undefined) { throw new TypeError("attempted to " + action + " private static field before its declaration"); } } 43350function _classCheckPrivateStaticAccess(receiver, classConstructor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } } 43351function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } 43352var _ajaxUrl = /*#__PURE__*/new WeakMap(); 43353var _busy = /*#__PURE__*/new WeakMap(); 43354var _currentStep = /*#__PURE__*/new WeakMap(); 43355var _billwerkConfig = /*#__PURE__*/new WeakMap(); 43356var _initialized = /*#__PURE__*/new WeakMap(); 43357var _paymentForm = /*#__PURE__*/new WeakMap(); 43358var _paymentService = /*#__PURE__*/new WeakMap(); 43359var _signupService = /*#__PURE__*/new WeakMap(); 43360var _selectedPlan = /*#__PURE__*/new WeakMap(); 43361var _customer = /*#__PURE__*/new WeakMap(); 43362var _initializing = /*#__PURE__*/new WeakMap(); 43363var _container = /*#__PURE__*/new WeakMap(); 43364var _finalized = /*#__PURE__*/new WeakMap(); 43365var _paymentError = /*#__PURE__*/new WeakMap(); 43366var _disableForm = /*#__PURE__*/new WeakSet(); 43367var _enableForm = /*#__PURE__*/new WeakSet(); 43368var _changeStep = /*#__PURE__*/new WeakSet(); 43369var _getCustomer = /*#__PURE__*/new WeakSet(); 43370var _fetchAction = /*#__PURE__*/new WeakSet(); 43371var _loadPaymentMethods = /*#__PURE__*/new WeakSet(); 43372var _loadPlanSelection = /*#__PURE__*/new WeakSet(); 43373var _loadThankYou = /*#__PURE__*/new WeakSet(); 43374var _showAction = /*#__PURE__*/new WeakSet(); 43375var _placeOrder = /*#__PURE__*/new WeakSet(); 43376var _getCart = /*#__PURE__*/new WeakSet(); 43377var _replaceContainerHTML = /*#__PURE__*/new WeakSet(); 43378var _submitPlanForm = /*#__PURE__*/new WeakSet(); 43379var _checkForm = /*#__PURE__*/new WeakSet(); 43380var _respondFormErrors = /*#__PURE__*/new WeakSet(); 43381var _finalizeIfNecessary = /*#__PURE__*/new WeakSet(); 43382var _finalize = /*#__PURE__*/new WeakSet(); 43383var _showFinalizeError = /*#__PURE__*/new WeakSet(); 43384class VfBTvAbo { 43385 constructor() { 43386 _classPrivateMethodInitSpec(this, _showFinalizeError); 43387 _classPrivateMethodInitSpec(this, _finalize); 43388 _classPrivateMethodInitSpec(this, _finalizeIfNecessary); 43389 /** 43390 * @param {{ErrorCode:string}} e 43391 * @returns {Promise<void>} 43392 */ 43393 _classPrivateMethodInitSpec(this, _respondFormErrors); 43394 /** 43395 * @returns {Promise<void>} 43396 */ 43397 _classPrivateMethodInitSpec(this, _checkForm); 43398 /** 43399 * @returns {Promise<Response>} 43400 */ 43401 _classPrivateMethodInitSpec(this, _submitPlanForm); 43402 /** 43403 * @param {string} html 43404 */ 43405 _classPrivateMethodInitSpec(this, _replaceContainerHTML); 43406 _classPrivateMethodInitSpec(this, _getCart); 43407 /** 43408 * @returns {Promise<any>} 43409 */ 43410 _classPrivateMethodInitSpec(this, _placeOrder); 43411 /** 43412 * @param {string} action 43413 * @returns {Promise<void>} 43414 */ 43415 _classPrivateMethodInitSpec(this, _showAction); 43416 _classPrivateMethodInitSpec(this, _loadThankYou); 43417 _classPrivateMethodInitSpec(this, _loadPlanSelection); 43418 _classPrivateMethodInitSpec(this, _loadPaymentMethods); 43419 /** 43420 * @param {string} action 43421 * @returns {Promise<any>} 43422 */ 43423 _classPrivateMethodInitSpec(this, _fetchAction); 43424 /** 43425 * @return {void} 43426 */ 43427 _classPrivateMethodInitSpec(this, _getCustomer); 43428 /** 43429 * @param {string} step 43430 * @returns {Promise<void>} 43431 */ 43432 _classPrivateMethodInitSpec(this, _changeStep); 43433 _classPrivateMethodInitSpec(this, _enableForm); 43434 /** 43435 * @returns {Promise<void>} 43436 */ 43437 _classPrivateMethodInitSpec(this, _disableForm); 43438 _classPrivateFieldInitSpec(this, _ajaxUrl, { 43439 writable: true, 43440 value: null 43441 }); 43442 _classPrivateFieldInitSpec(this, _busy, { 43443 writable: true, 43444 value: false 43445 }); 43446 _classPrivateFieldInitSpec(this, _currentStep, { 43447 writable: true, 43448 value: 'uninitialized' 43449 }); 43450 _classPrivateFieldInitSpec(this, _billwerkConfig, { 43451 writable: true, 43452 value: { 43453 publicApiKey: null, 43454 url: null, 43455 providerReturnUrl: null, 43456 locale: null 43457 } 43458 }); 43459 _classPrivateFieldInitSpec(this, _initialized, { 43460 writable: true, 43461 value: false 43462 }); 43463 _classPrivateFieldInitSpec(this, _paymentForm, { 43464 writable: true, 43465 value: null 43466 }); 43467 _classPrivateFieldInitSpec(this, _paymentService, { 43468 writable: true, 43469 value: null 43470 }); 43471 _classPrivateFieldInitSpec(this, _signupService, { 43472 writable: true, 43473 value: null 43474 }); 43475 _classPrivateFieldInitSpec(this, _selectedPlan, {
43476 writable: true, 43477 value: null 43478 }); 43479 _classPrivateFieldInitSpec(this, _customer, { 43480 writable: true, 43481 value: null 43482 }); 43483 _classPrivateFieldInitSpec(this, _initializing, { 43484 writable: true, 43485 value: false 43486 }); 43487 _classPrivateFieldInitSpec(this, _container, { 43488 writable: true, 43489 value: null 43490 }); 43491 _classPrivateFieldInitSpec(this, _finalized, { 43492 writable: true, 43493 value: null 43494 }); 43495 _classPrivateFieldInitSpec(this, _paymentError, { 43496 writable: true, 43497 value: null 43498 }); 43499 } 43500 /** 43501 * @returns {VfBTvAbo} 43502 */ 43503 static getInstance() { 43504 if (_classStaticPrivateFieldSpecGet(this, VfBTvAbo, _instance) === null) { 43505 _classStaticPrivateFieldSpecSet(this, VfBTvAbo, _instance, new VfBTvAbo()); 43506 } 43507 return _classStaticPrivateFieldSpecGet(this, VfBTvAbo, _instance); 43508 } 43509 43510 /** 43511 * @returns {{"Content-Type": string}} 43512 */ 43513 43514 /** 43515 * @param {{providerReturnUrl: string, publicApiKey: string, locale: string, url: string}} config 43516 */ 43517 setConfig(config) { 43518 _classPrivateFieldSet(this, _billwerkConfig, config); 43519 } 43520 init() { 43521 if (_classPrivateFieldGet(this, _initialized) || _classPrivateFieldGet(this, _initializing)) { 43522 console.log('VfBTvAbo already initialized'); 43523 return; 43524 } 43525 43526 // Prüfen, ob SubscriptionJS verfügbar ist 43527 if (!window.SubscriptionJS) { 43528 const error = new Error('VfBTvAbo.init() wurde aufgerufen, aber window.SubscriptionJS ist nicht verfügbar. ' + 'Stelle sicher, dass das Billwerk-Script vom ConsentManager freigegeben wurde.'); 43529 _classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError).call(VfBTvAbo, error); 43530 throw error; 43531 } 43532 _classPrivateFieldSet(this, _initializing, true); 43533 _classPrivateFieldSet(this, _busy, true); 43534 _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'initializing').then(new Promise((resolve, reject) => { 43535 const container = document.querySelector('.tvAboForm'); 43536 if (container.hasAttribute('data-url')) { 43537 _classPrivateFieldSet(this, _ajaxUrl, container.getAttribute('data-url')); 43538 } else { 43539 _classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError).call(VfBTvAbo, 'No data-url found'); 43540 _classPrivateFieldSet(this, _initializing, false); 43541 reject(); 43542 } 43543 _classPrivateFieldSet(this, _container, container); 43544 resolve(); 43545 })).then(() => { 43546 // SubscriptionJS ist bereits da, wir müssen es nicht neu laden. 43547 // Optional: kleine Verzögerung, falls Billwerk selbst noch initialisiert. 43548 return new Promise(resolve => setTimeout(resolve, 0)); 43549 }).then(() => { 43550 _classPrivateFieldSet(this, _paymentService, new SubscriptionJS.Payment(_classPrivateFieldGet(this, _billwerkConfig), () => console.debug('payment initialized'), _classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError))); 43551 _classPrivateFieldSet(this, _signupService, new SubscriptionJS.Signup()); 43552 }).then(async () => await _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'initialized')).catch(_classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError)).finally(() => _classPrivateFieldSet(this, _busy, false)); 43553 } 43554 order() { 43555 _classPrivateFieldSet(this, _busy, true); 43556 _classPrivateMethodGet(this, _checkForm, _checkForm2).call(this).then(() => _classPrivateMethodGet(this, _disableForm, _disableForm2).call(this)).then(() => _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'processingOrder')).then(() => _classPrivateMethodGet(this, _getCustomer, _getCustomer2).call(this)).then(() => _classPrivateMethodGet(this, _placeOrder, _placeOrder2).call(this)).then(() => _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'orderCreated')).then(() => _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'showThankYou')).catch(async e => { 43557 _classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError).call(VfBTvAbo, e); 43558 await _classPrivateMethodGet(this, _respondFormErrors, _respondFormErrors2).call(this, e); 43559 await _classPrivateMethodGet(this, _enableForm, _enableForm2).call(this); 43560 }).finally(() => _classPrivateFieldSet(this, _busy, false)); 43561 } 43562 async reload() { 43563 if (_classPrivateFieldGet(this, _initialized) === false) { 43564 console.log('Not reloading because VfBTvAbo has not been initialized.'); 43565 return; 43566 } else if (_classPrivateFieldGet(this, _busy)) { 43567 console.debug('Cannot reload. VfBTvAbo is busy!'); 43568 return; 43569 } else if (_classPrivateFieldGet(this, _currentStep) === 'showFinalizeError') { 43570 console.debug('Not reloading because finalization error occurred'); 43571 return; 43572 } else if (['showThankYou', 'finalize'].includes(_classPrivateFieldGet(this, _currentStep))) { 43573 console.debug('Not reloading because step "' + _classPrivateFieldGet(this, _currentStep) + '" is non-reloadable'); 43574 return; 43575 } 43576 console.debug('reloading content'); 43577 return _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'initialized'); 43578 } 43579 submitPlanSelection() { 43580 _classPrivateFieldSet(this, _busy, true); 43581 _classPrivateMethodGet(this, _checkForm, _checkForm2).call(this).then(() => _classPrivateMethodGet(this, _disableForm, _disableForm2).call(this)).then(() => _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'planSelected')).then(() => _classPrivateMethodGet(this, _submitPlanForm, _submitPlanForm2).call(this)).then(response => response.json()).then(async data => { 43582 _classPrivateMethodGet(this, _replaceContainerHTML, _replaceContainerHTML2).call(this, data.html); 43583 _classPrivateFieldSet(this, _selectedPlan, data.planId); 43584 await _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, data.step); 43585 }).catch(async e => { 43586 _classStaticPrivateMethodGet(VfBTvAbo, VfBTvAbo, _logError).call(VfBTvAbo, e); 43587 await _classPrivateMethodGet(this, _enableForm, _enableForm2).call(this); 43588 }).finally(() => _classPrivateFieldSet(this, _busy, false)); 43589 } 43590} 43591_VfBTvAbo = VfBTvAbo; 43592function _getPostHeaders() { 43593 return { 43594 'Content-Type': 'application/x-www-form-urlencoded' 43595 }; 43596} 43597/** 43598 * @returns {string} 43599 */ 43600function _getSpinner() { 43601 return '<div class="spinner loading"></div>'; 43602} 43603/** 43604 * @param {any} error 43605 */ 43606function _logError(error) { 43607 console.error('[VfB TV]:', error); 43608} 43609/** 43610 * 43611 * @param {Element|null} container 43612 */ 43613function _showSpinner(container) { 43614 if (!container) { 43615 container = document.querySelector('.tvAboForm'); 43616 } 43617 container.innerHTML = _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _getSpinner).call(_VfBTvAbo); 43618} 43619function _disableForm2() { 43620 return new Promise(resolve => { 43621 const submitButton = _classPrivateFieldGet(this, _container).querySelector('form button[type=submit]'); 43622 submitButton.disabled = true; 43623 43624 // add blur effect
43625 Array.prototype.forEach.call(_classPrivateFieldGet(this, _container).children, element => element.style.filter = 'blur(2px)'); 43626 let spinner = document.createElement('div'); 43627 spinner.innerHTML = _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _getSpinner).call(_VfBTvAbo); 43628 spinner = spinner.firstChild; 43629 spinner.style.position = 'absolute'; 43630 spinner.style.top = '0'; 43631 spinner.style.width = '100%'; 43632 spinner.style.height = '100%'; 43633 43634 /* 43635 * This spinner cannot replace the entire containers content and needs to be appended. Otherwise, the 43636 * iframe/form with all the information would not be processable. 43637 */ 43638 _classPrivateFieldGet(this, _container).appendChild(spinner); 43639 resolve(); 43640 }); 43641} 43642function _enableForm2() { 43643 return new Promise(resolve => { 43644 var _classPrivateFieldGet2; 43645 // enable submit button 43646 _classPrivateFieldGet(this, _container).querySelector('form button[type=submit]').disabled = false; 43647 //remove spinner 43648 (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _container).querySelector('.spinner')) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.remove(); 43649 // remove blur effect 43650 Array.prototype.forEach.call(_classPrivateFieldGet(this, _container).children, element => element.style.filter = 'blur(0)'); 43651 resolve(); 43652 }); 43653} 43654function _changeStep2(step) { 43655 return new Promise(async resolve => { 43656 if (step !== _classPrivateFieldGet(this, _currentStep)) { 43657 console.debug(`step changed from ${_classPrivateFieldGet(this, _currentStep)} to ${step}`); 43658 _classPrivateFieldSet(this, _currentStep, step); 43659 } 43660 switch (step) { 43661 case 'finalize': 43662 await _classPrivateMethodGet(this, _finalize, _finalize2).call(this); 43663 break; 43664 case 'initialized': 43665 _classPrivateFieldSet(this, _initialized, true); 43666 _classPrivateFieldSet(this, _initializing, false); 43667 _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _showSpinner).call(_VfBTvAbo, null); 43668 if (!_classPrivateFieldGet(this, _finalized) && _classPrivateMethodGet(this, _finalizeIfNecessary, _finalizeIfNecessary2).call(this)) { 43669 await _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'finalize'); 43670 break; 43671 } 43672 await _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'showPlanSelection'); 43673 break; 43674 case 'showPlanSelection': 43675 await _classPrivateMethodGet(this, _loadPlanSelection, _loadPlanSelection2).call(this); 43676 break; 43677 case 'selectPaymentMethod': 43678 _classPrivateMethodGet(this, _loadPaymentMethods, _loadPaymentMethods2).call(this); 43679 break; 43680 case 'orderCreated': 43681 _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _showSpinner).call(_VfBTvAbo); 43682 break; 43683 case 'showFinalizeError': 43684 await _classPrivateMethodGet(this, _showFinalizeError, _showFinalizeError2).call(this); 43685 break; 43686 case 'showThankYou': 43687 await _classPrivateMethodGet(this, _loadThankYou, _loadThankYou2).call(this); 43688 } 43689 resolve(); 43690 }); 43691} 43692function _getCustomer2() { 43693 return _classPrivateMethodGet(this, _fetchAction, _fetchAction2).call(this, 'getCustomer').then(customer => _classPrivateFieldSet(this, _customer, customer)); 43694} 43695function _fetchAction2(action) { 43696 return fetch(_classPrivateFieldGet(this, _ajaxUrl), { 43697 method: 'POST', 43698 headers: _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _getPostHeaders).call(_VfBTvAbo), 43699 body: `action=${action}` 43700 }).then(response => response.json()); 43701} 43702function _loadPaymentMethods2() { 43703 const paymentMethodFormContianer = document.createElement('div'); 43704 paymentMethodFormContianer.classList.add('payment-method-form-container'); 43705 const config = _classPrivateFieldGet(this, _billwerkConfig); 43706 config.paymentMethods = _classPrivateFieldGet(this, _paymentService).getAvailablePaymentMethodEnum(); 43707 config.providerReturnUrl += '?finalize=1'; 43708 const spinner = _classPrivateFieldGet(this, _container).querySelector('.payment-method > form >.form-group > .abo-card > .abo-card-body > .spinner'); 43709 spinner.parentNode.appendChild(paymentMethodFormContianer); 43710 spinner.remove(); 43711 _classPrivateFieldSet(this, _paymentForm, SubscriptionJS.createElement('paymentForm', paymentMethodFormContianer, config, _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _getPaymentFormStyles).call(_VfBTvAbo), _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _logError))); 43712} 43713function _getPaymentFormStyles() { 43714 return { 43715 /* Some example values of available properties 43716 { 43717 backgroundColor: '#ffffff', 43718 border: '1px solid #ccc', 43719 borderBottomColor: '#ccc', 43720 borderBottomWidth: '5px', 43721 borderColor: '#ccc', 43722 borderLeftColor: 'black', 43723 borderLeftWidth: '5px', 43724 borderRadius: '4px', 43725 borderRightColor: '#ccc', 43726 borderRightWidth: '5px', 43727 borderTopColor: '#ccc', 43728 borderTopWidth: '5px', 43729 borderWidth: '2px', 43730 boxShadow: 'inset 0 1px 1px rgba(0,0,0,.075)', 43731 color: '#444444', 43732 display: 'block' 43733 fontSize: '16px', 43734 fontFamily: '"Times New Roman", Times, serif', 43735 fontStyle: 'normal', 43736 fontWeight: '', 43737 height: '34px', 43738 lineHeight: 'normal', 43739 margin: '0', 43740 padding: '1px 2px' 43741 } 43742 */ 43743 body: { 43744 color: '#000', 43745 padding: 0 43746 }, 43747 container: {}, 43748 input: {}, 43749 inputInvalid: {}, 43750 inputRequired: {}, 43751 label: {}, 43752 labelRequired: {}, 43753 sectionContent: { 43754 padding: 0 43755 }, 43756 select: {}, 43757 selectInvalid: {}, 43758 selectRequired: {} 43759 }; 43760} 43761function _loadPlanSelection2() { 43762 return _classPrivateMethodGet(this, _showAction, _showAction2).call(this, 'showAvailablePlans'); 43763} 43764function _loadThankYou2() { 43765 return _classPrivateMethodGet(this, _showAction, _showAction2).call(this, 'showThankYou'); 43766} 43767async function _showAction2(action) { 43768 return _classPrivateMethodGet(this, _fetchAction, _fetchAction2).call(this, action).then(data => _classPrivateMethodGet(this, _replaceContainerHTML, _replaceContainerHTML2).call(this, data.html)); 43769} 43770function _placeOrder2() { 43771 return new Promise(async (resolve, reject) => { 43772 const cart = _classPrivateMethodGet(this, _getCart, _getCart2).call(this); 43773 43774 /** 43775 * redirect to 3ds challenge if required 43776 * 43777 * @param data 43778 * @return {string|*|null} 43779 */ 43780 const redirectToChallangeIfNecessary = data => data.Url !== undefined ? window.location.href = data.Url : null; 43781 /** 43782 * Use SubscriptionJS to create a new order for a new customer. 43783 * @return {Promise<void>} 43784 */ 43785 const placeOrderForNewCustomer = () => new Promise((resolve, reject) => _classPrivateFieldGet(this, _signupService).preview(cart, _classPrivateFieldGet(this, _customer), preview => _classPrivateFieldGet(this, _paymentForm).processPaymentData(preview.Order.TotalGross, preview.Order.Currency, processedPaymentData => _classPrivateFieldGet(this, _signupService).createOrder(cart, _classPrivateFieldGet(this, _customer), order => _classPrivateFieldGet(this, _signupService).paySignupInteractive(null, processedPaymentData, order, data => redirectToChallangeIfNecessary(data) || resolve, reject), reject), reject), reject)); 43786 const paymentMethod = _classPrivateFieldGet(this, _container).querySelector('[name=paymentMethod]:checked').value; 43787 const body = 'action=createOrder' + '&cart=' + encodeURIComponent(JSON.stringify(cart)) + '&paymentMethod=' + paymentMethod; 43788 const createOrderForExistingCustomer = () => new Promise((resolve, reject) => fetch(_classPrivateFieldGet(this, _ajaxUrl), { 43789 method: 'POST', 43790 headers: _classStaticPrivateMethodGet(_VfBTvAbo, _VfBTvAbo, _getPostHeaders).call(_VfBTvAbo), 43791 body: body 43792 }).then(response => response.json()).then(data => { 43793 if (typeof data['ErrorCode'] != 'undefined') { 43794 reject(data); 43795 } 43796 return data; 43797 }).then(order => new Promise(r => _classPrivateFieldGet(this, _signupService).paySignupInteractive(null, _classPrivateFieldGet(this, _paymentForm), order, r, reject))).then(data =>
43797 redirectToChallangeIfNecessary(data)).then(resolve).catch(reject)); 43798 43799 /* 43800 * If we 43801 * get an ID: This means the user already exists in billwerk, and we HAVE to use php, since the 43802 * SubscriptionJS doesn't care about the ID at all and will always create a new "customer". 43803 * don't get an ID: This means billwerk has no customer associated with the VfB SSO ID. Therefore, we can use 43804 * SubscriptionJS to simply create a new user/customer. 43805 */ 43806 const strategy = _classPrivateFieldGet(this, _customer).Id ? createOrderForExistingCustomer : placeOrderForNewCustomer; 43807 strategy().then(resolve).catch(reject); 43808 }); 43809} 43810function _getCart2() { 43811 const cart = { 43812 PlanVariantId: _classPrivateFieldGet(this, _selectedPlan) 43813 }; 43814 const voucher = _classPrivateFieldGet(this, _container).querySelector('input[name=voucher]').value.trim(); 43815 if (voucher) { 43816 cart.CouponCode = voucher; 43817 } 43818 return cart; 43819} 43820function _replaceContainerHTML2(html) { 43821 console.debug(`replacing content at step "${_classPrivateFieldGet(this, _currentStep)}"`); 43822 _classPrivateFieldGet(this, _container).innerHTML = html; 43823} 43824function _submitPlanForm2() { 43825 const form = _classPrivateFieldGet(this, _container).querySelector('form'); 43826 return fetch(form.action, { 43827 method: form.method, 43828 body: new FormData(form) 43829 }); 43830} 43831function _checkForm2() { 43832 return new Promise((resolve, reject) => { 43833 const form = _classPrivateFieldGet(this, _container).querySelector('form'); 43834 if (!form.reportValidity()) { 43835 reject('Form is invalid'); 43836 } else { 43837 resolve(); 43838 } 43839 }); 43840} 43841function _respondFormErrors2(e) { 43842 return new Promise(resolve => { 43843 if (e['ErrorCode'] === "InvalidCouponCode") { 43844 const validationFeedback = document.createElement('div'); 43845 validationFeedback.classList.add('validation-feedback'); 43846 validationFeedback.innerText = e['ErrorMessage']; 43847 const voucherFormGroupElement = _classPrivateFieldGet(this, _container).querySelector('#voucher').closest('.form-group'); 43848 voucherFormGroupElement.classList.add('has-error'); 43849 voucherFormGroupElement.appendChild(validationFeedback); 43850 } 43851 resolve(); 43852 }); 43853} 43854function _finalizeIfNecessary2() { 43855 const searchParams = new URL(window.location.href).searchParams; 43856 return !!(searchParams.has('pactasTransactionId') && searchParams.has('trigger') && searchParams.has('finalize')); 43857} 43858async function _finalize2() { 43859 /** 43860 * Removes a parameter from the current query string without a reload. 43861 * 43862 * @param {String} paramName 43863 * @return {void} 43864 */ 43865 const removeParamFromQueryString = paramName => { 43866 const searchParams = new URLSearchParams(window.location.search); 43867 searchParams.delete(paramName); 43868 if (history.replaceState) { 43869 const searchString = searchParams.toString().length > 0 ? '?' + searchParams.toString() : ''; 43870 const newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + searchString + window.location.hash; 43871 history.replaceState(null, '', newUrl); 43872 } 43873 }; 43874 return new Promise((resolve, reject) => SubscriptionJS.finalize(resolve, reject)).then(() => _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'showThankYou')).then(() => _classPrivateFieldSet(this, _finalized, true)).catch(e => { 43875 _classPrivateFieldSet(this, _paymentError, e.errorMessage); 43876 _classPrivateMethodGet(this, _changeStep, _changeStep2).call(this, 'showFinalizeError'); 43877 }).finally( 43878 // cleanup current url 43879 () => ['finalize', 'pactasTransactionId', 'secret', 'trigger', 'language'].forEach(param => removeParamFromQueryString(param))); 43880} 43881async function _showFinalizeError2() { 43882 let action; 43883 switch (_classPrivateFieldGet(this, _paymentError)) { 43884 case 'Payment failed!': 43885 action = 'showPaymentError'; 43886 break; 43887 case 'Payment cancelled by customer!': 43888 action = 'showPaymentCanceled'; 43889 break; 43890 default: 43891 action = 'showGenericError'; 43892 } 43893 return await _classPrivateMethodGet(this, _showAction, _showAction2).call(this, action); 43894} 43895var _instance = { 43896 writable: true, 43897 value: null 43898}; 43899;// /var/www/www.vfb.de/httpdocs/current/static/js/searchApiExtended.js 43900if (!searchApi) { 43901 var searchApi = {}; 43902} 43903searchApi = $.extend(searchApi, { 43904 searchSuccess: function (data) { 43905 $.ajax({ 43906 url: searchApi.feAjaxUrl, 43907 type: 'POST', 43908 data: { 43909 cmd: 'getHtmlForSearchResults', 43910 resultXml: data.result, 43911 pageId: searchApi.pageId, 43912 postfix: searchApi.postFix ? searchApi.postFix : "",
43913 categories: $('.searchCategories').length ? true : false, 43914 categoryId: searchApi.actCategoryId, 43915 firstSearch: searchApi.firstSearch, 43916 actPage: searchApi.actPage, 43917 pageSize: searchApi.pageSize, 43918 resultClass: searchApi.resultClass 43919 }, 43920 dataType: 'json', 43921 success: function (data, status) { 43922 if (status === 'success') { 43923 data = $.parseJSON(data); 43924 if (searchApi.firstSearch == true) { 43925 $(searchApi.element).find('.searchCategories').html(data.categoriesHtml); 43926 43927 let resultWithoutMBA = data.allCategoryTotalResults - data.totalByCategory[2]; 43928 $(searchApi.element).find('.sumResults').html(resultWithoutMBA); 43929 } 43930 searchApi.resultHtmls[searchApi.actPage] = data.resultsHtml; 43931 searchApi.pagingHtmls[searchApi.actPage] = data.pagingHtml; 43932 searchApi.showResults(); 43933 if (typeof searchApi.initGallery === "function") { 43934 searchApi.initGallery(); 43935 } 43936 43937 } 43938 } 43939 }); 43940 }, 43941}); 43942;// /var/www/www.vfb.de/httpdocs/current/src/LAOLA1/CmsCore/Plugin/VfBBets/Fe/js/Bettings.js 43943; 43944 43945var _VfBBets, _bets, _linkPrefix, _affiliateId, _skeleton, _template, _ensureRequiredAttributesExist, _fetchBets, _displayBets, _betButton; 43946function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); } 43947function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } 43948function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } 43949function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 43950function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } 43951function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } 43952function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; } 43953function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } 43954function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } 43955function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } 43956customElements.define('vfb-bets', (_bets = /*#__PURE__*/new WeakMap(), _linkPrefix = /*#__PURE__*/new WeakMap(), _affiliateId = /*#__PURE__*/new WeakMap(), _skeleton = /*#__PURE__*/new WeakMap(), _template = /*#__PURE__*/new WeakSet(), _ensureRequiredAttributesExist = /*#__PURE__*/new WeakSet(), _fetchBets = /*#__PURE__*/new WeakSet(), _displayBets = /*#__PURE__*/new WeakSet(), _betButton = /*#__PURE__*/new WeakSet(), _VfBBets = class VfBBets extends HTMLElement { 43957 constructor() { 43958 super(); 43959 _classPrivateMethodInitSpec(this, _betButton); 43960 _classPrivateMethodInitSpec(this, _displayBets); 43961 _classPrivateMethodInitSpec(this, _fetchBets); 43962 _classPrivateMethodInitSpec(this, _ensureRequiredAttributesExist); 43963 // @formatter:on 43964 /** 43965 * @param {string} home 43966 * @param {string} draw 43967 * @param {string} away 43968 * @returns {string} 43969 */ 43970 _classPrivateMethodInitSpec(this, _template); 43971 _classPrivateFieldInitSpec(this, _bets, { 43972 writable: true, 43973 value: void 0 43974 }); 43975 /** 43976 * @type {string} 43977 */ 43978 _classPrivateFieldInitSpec(this, _linkPrefix, { 43979 writable: true, 43980 value: 'https://www.bet365.de/dl/sportsbookredirect' 43981 }); 43982 /** 43983 * @type {string} 43984 */ 43985 _classPrivateFieldInitSpec(this, _affiliateId, { 43986 writable: true, 43987 value: '365_012490' 43988 }); 43989 /** 43990 * @type {string} 43991 */ 43992 _classPrivateFieldInitSpec(this, _skeleton, { 43993 writable: true, 43994 value: 43995 // @formatter:off 43996 '<div class="vfb-bets-skeleton">' + '<span class="vfb-bets-skeleton--logo"></span>' + '<div>' + '<span class="vfb-bets-skeleton--button"></span>' + '<span class="vfb-bets-skeleton--button"></span>' + '<span class="vfb-bets-skeleton--button"></span>' + '</div>' + '<span class="vfb-bets-skeleton--text"></span>' + '</div>' 43997 }); 43998 } 43999 async connectedCallback() { 44000 this.innerHTML = _classPrivateFieldGet(this, _skeleton); 44001 try { 44002 _classPrivateMethodGet(this, _ensureRequiredAttributesExist, _ensureRequiredAttributesExist2).call(this); 44003 await _classPrivateMethodGet(this, _fetchBets, _fetchBets2).call(this); 44004 _classPrivateMethodGet(this, _displayBets, _displayBets2).call(this); 44005 } catch (error) { 44006 console.error(error); 44007 this.remove(); 44008 } 44009 } 44010}, _defineProperty(_VfBBets, "requiredAttributes", ['away-team-name', 'home-team-name', 'start-date']), _VfBBets)); 44011function _template2(home, draw, away) { 44012 return '' + '<div><a target="_blank" href="https://www.bet365.de/"><img src="/?proxy=img/logos/bet365.svg" class="sponsor"/></a></div>' + '<div>' + `${home}` + `${draw}` + `${away}` + '</div>' + '<div><p class="disclaimer">18+ | Erlaubt (White-List) | Suchtrisiken | Hilfe unter <a href="https://buwei.de">Buwei.de</a></p></div>'; 44013} 44014function _ensureRequiredAttributesExist2() {
44015 _VfBBets.requiredAttributes.forEach(attributeName => { 44016 if (!this.hasAttribute(attributeName)) { 44017 this.remove(); 44018 throw new Error(`Unable to mount component due to missing required attribute "${attributeName}"`); 44019 } 44020 }); 44021} 44022async function _fetchBets2() { 44023 const url = new URL(ajaxUrlData, window.location.origin); 44024 const searchParams = url.searchParams; 44025 searchParams.set('action', 'fetchBets'); 44026 searchParams.set('startdate', this.getAttribute('start-date')); 44027 return await fetch(url).then(response => response.json()).then(json => _classPrivateFieldSet(this, _bets, json)); 44028} 44029function _displayBets2() { 44030 if (!_classPrivateFieldGet(this, _bets) || typeof _classPrivateFieldGet(this, _bets) === 'string' || !_classPrivateFieldGet(this, _bets).match || !_classPrivateFieldGet(this, _bets).match.outcome || !_classPrivateFieldGet(this, _bets).match.outcome.home || !_classPrivateFieldGet(this, _bets).match.outcome.draw || !_classPrivateFieldGet(this, _bets).match.outcome.away) { 44031 this.remove(); 44032 return; 44033 } 44034 this.innerHTML = _classPrivateMethodGet(this, _template, _template2).call(this, _classPrivateMethodGet(this, _betButton, _betButton2).call(this, _classPrivateFieldGet(this, _bets).match.outcome.home, this.getAttribute('home-team-name') || null, this.getAttribute('home-team-short') || null), _classPrivateMethodGet(this, _betButton, _betButton2).call(this, _classPrivateFieldGet(this, _bets).match.outcome.draw, 'Unentschieden', 'Unentschieden'), _classPrivateMethodGet(this, _betButton, _betButton2).call(this, _classPrivateFieldGet(this, _bets).match.outcome.away, this.getAttribute('away-team-name') || null, this.getAttribute('away-team-short') || null)); 44035} 44036function _betButton2(bet, text, shortname) { 44037 shortname = shortname || ''; 44038 text = text ? `<span><small>` + `<span class="hide-mobile">${text}</span>` + `<span class="hide-desktop hide-tablet">${shortname}</span>` + `</small></span>` : ''; 44039 return '' + `<a class="vfb-bets--button" target="_blank" href="${_classPrivateFieldGet(this, _linkPrefix)}?affiliate=${_classPrivateFieldGet(this, _affiliateId)}&bs=${_classPrivateFieldGet(this, _bets).match.outcome.id}-${bet.id}~${bet.oddsFraction}&bet=1">` + `${text}` + `<span><strong>${parseFloat(bet.odds).toFixed(2)}</strong></span>` + '</a>'; 44040} 44041;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/video-player/dist/v8/laola1player.js 44042 if (typeof jQuery == 'undefined') { 44043 /*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */ 44044 !function(a,b){;"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){
vendor: 31,724 bytes, line 44044
44044;var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,
44044 44045
vendor: 32,006 bytes, line 44045
44045r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),aa=["Top","Right","Bottom","Left"],ba=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ca=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function da(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&_.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ea={};function fa(a){var b,c=a.ownerDocument,d=a.nodeName,e=ea[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ea[d]=e,e)}function ga(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c<h;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==va()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===va()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ta:ua,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:ua,isPropagationStopped:ua,isImmediatePropagationStopped:ua,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ta,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ta,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ta,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&qa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ra.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return wa(this,a,b,c,d)},one:function(a,b,c,d){return wa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ua),this.each(function(){r.event.remove(this,a,c,b)})}});var xa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/<script|<style|<link/i,za=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/^true\/(.*)/,Ba=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;l<i;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;d<e;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Ma(a,b,f),(d<0||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)})},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);f<g;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Ya=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){Za||(Za=a.requestAnimationFrame?a.requestAnimationFrame(ab):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame(Za):a.clearInterval(Za),Za=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var hb,ib=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);
44045 44046
vendor: 22,262 bytes, line 44046
44046if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i<h;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=oa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=r.trim(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||pa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Na(o.pixelPosition,function(a,c){if(c)return c=Ma(a,b),Ka.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
44046 44047 } 44048/*! 44049 * clipboard.js v1.5.12 44050 * https://zenorocha.github.io/clipboard.js 44051 * 44052 * Licensed MIT © Zeno Rocha 44053 */ 44054!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var o=t("matches-selector");e.exports=function(t,e,n){for(var i=n?t:t.parentNode;i&&i!==document;){if(o(i,e))return i;i=i.parentNode}}},{"matches-selector":5}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e,!0),n.delegateTarget&&o.call(t,n)}}
44054var r=t("closest");e.exports=o},{closest:1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return s(document.body,t,e,n)}var c=t("./is"),s=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t,e){if(r)return r.call(t,e);for(var n=t.parentNode.querySelectorAll(e),o=0;o<n.length;++o)if(n[o]==t)return!0;return!1}var i=Element.prototype,r=i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;e.exports=o},{}],6:[function(t,e,n){function o(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.focus(),t.setSelectionRange(0,t.value.length),e=t.value;
44054else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}e.exports=o},{}],7:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;i>o;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;a>r;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if("undefined"!=typeof o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){;function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=e.action,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""},t.prototype.initSelection=function t(){this.text?this.selectFake():this.target&&this.selectTarget()},t.prototype.selectFake=function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()},t.prototype.removeFake=function t(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function t(){this.selectedText=(0,i.default)(this.target),this.copyText()},t.prototype.copyText=function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(n){e=!1}this.handleResult(e)},t.prototype.handleResult=function t(e){e?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function t(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function t(){this.removeFake()},a(t,[{key:"action",set:function t(){var e=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==("undefined"==typeof e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:6}],9:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){;function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),u=i(n),f=i(o),d=function(t){function e(n,o){r(this,e);var i=a(this,t.call(this));return i.resolveOptions(o),i.listenClick(n),i}return c(e,t),e.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText},e.prototype.listenClick=function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})},e.prototype.onClick=function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})},e.prototype.defaultAction=function t(e){return s("action",e)},e.prototype.defaultTarget=function t(e){var n=s("target",e);return n?document.querySelector(n):void 0},e.prototype.defaultText=function t(e){return s("text",e)},e.prototype.destroy=function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(u.default);t.exports=d})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)});
vendor: 9,487 bytes, line 44055
44055!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(b.dashjs||(b.dashjs={})).MediaPlayer=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){;!function(a){var b={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},c=function(a){var c=a;return b.hasOwnProperty(a)&&(c=b[a]),String.fromCharCode(c)},d=15,e=32,f={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},g={17:2,18:4,21:6,22:8,23:10,19:13,20:15},h={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},i={25:2,26:4,29:6,30:8,31:10,27:13,28:15},j=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],k={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(a){this.time=a},log:function(a,b){var c=this.verboseFilter[a];this.verboseLevel>=c&&console.log(this.time+" ["+a+"] "+b)}},l=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].toString(16));return b},m=function(a,b,c,d,e){this.foreground=a||"white",this.underline=b||!1,this.italics=c||!1,this.background=d||"black",this.flash=e||!1};m.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(a){for(var b=["foreground","underline","italics","background","flash"],c=0;c<b.length;c++){var d=b[c];a.hasOwnProperty(d)&&(this[d]=a[d])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},copy:function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var n=function(a,b,c,d,e,f){this.uchar=a||" ",this.penState=new m(b,c,d,e,f)};n.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(a,b){this.uchar=a,this.penState.copy(b)},setPenState:function(a){this.penState.copy(a)},equals:function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},copy:function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var o=function(){this.chars=[];for(var a=0;a<e;a++)this.chars.push(new n);this.pos=0,this.currPenState=new m};o.prototype={equals:function(a){for(var b=!0,c=0;c<e;c++)if(!this.chars[c].equals(a.chars[c])){b=!1;break}return b},copy:function(a){for(var b=0;b<e;b++)this.chars[b].copy(a.chars[b])},isEmpty:function(){for(var a=!0,b=0;b<e;b++)if(!this.chars[b].isEmpty()){a=!1;break}return a},setCursor:function(a){this.pos!==a&&(this.pos=a),this.pos<0?(k.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>e&&(k.log("ERROR","Too large cursor position "+this.pos),this.pos=e)},moveCursor:function(a){var b=this.pos+a;if(a>1)for(var c=this.pos+1;c<b+1;c++)this.chars[c].setPenState(this.currPenState);this.setCursor(b)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(a){a>=144&&this.backSpace();var b=c(a);return this.pos>=e?void k.log("ERROR","Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(b,this.currPenState),void this.moveCursor(1))},clearFromPos:function(a){var b;for(b=a;b<e;b++)this.chars[b].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var a=[],b=!0,c=0;c<e;c++){var d=this.chars[c].uchar;" "!==d&&(b=!1),a.push(d)}return b?"":a.join("")},setPenStyles:function(a){this.currPenState.setStyles(a);var b=this.chars[this.pos];b.setPenState(this.currPenState)}};var p=function(){this.rows=[];for(var a=0;a<d;a++)this.rows.push(new o);this.currRow=d-1,this.nrRollUpRows=null,this.reset()};p.prototype={reset:function(){for(var a=0;a<d;a++)this.rows[a].clear();this.currRow=d-1},equals:function(a){for(var b=!0,c=0;c<d;c++)if(!this.rows[c].equals(a.rows[c])){b=!1;break}return b},copy:function(a){for(var b=0;b<d;b++)this.rows[b].copy(a.rows[b])},isEmpty:function(){for(var a=!0,b=0;b<d;b++)if(!this.rows[b].isEmpty()){a=!1;break}return a},backSpace:function(){var a=this.rows[this.currRow];a.backSpace()},clearToEndOfRow:function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},insertChar:function(a){var b=this.rows[this.currRow];b.insertChar(a)},setPen:function(a){var b=this.rows[this.currRow];b.setPenStyles(a)},moveCursor:function(a){var b=this.rows[this.currRow];b.moveCursor(a)},setCursor:function(a){k.log("INFO","setCursor: "+a);var b=this.rows[this.currRow];b.setCursor(a)},setPAC:function(a){k.log("INFO","pacData = "+JSON.stringify(a));var b=a.row-1;this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.currRow=b;var c=this.rows[this.currRow];if(null!==a.indent){var d=a.indent,e=Math.max(d-1,0);c.setCursor(a.indent),a.color=c.chars[e].penState.foreground}var f={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(f)},setBkgData:function(a){k.log("INFO","bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},setRollUpRows:function(a){this.nrRollUpRows=a},rollUp:function(){if(null===this.nrRollUpRows)return void k.log("DEBUG","roll_up but nrRollUpRows not set yet");k.log("TEXT",this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(a,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),k.log("INFO","Rolling up")},getDisplayText:function(a){a=a||!1;for(var b=[],c="",e=-1,f=0;f<d;f++){var g=this.rows[f].getTextString();g&&(e=f+1,a?b.push("Row "+e+': "'+g+'"'):b.push(g.trim()))}return b.length>0&&(c=a?"["+b.join(" | ")+"]":b.join("\n")),c},getTextAndFormat:function(){return this.rows}};var q=function(a,b){this.chNr=a,this.outputFilter=b,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[d-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};q.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[d-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(a){this.outputFilter=a},setPAC:function(a){this.writeScreen.setPAC(a)},setBkgData:function(a){this.writeScreen.setBkgData(a)},setMode:function(a){a!==this.mode&&(this.mode=a,k.log("INFO","MODE="+a),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=a)},insertChars:function(a){for(var b=0;b<a.length;b++)this.writeScreen.insertChar(a[b]);var c=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";k.log("INFO",c+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(k.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){k.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){k.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){k.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(a){k.log("INFO","RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},cc_FON:function(){k.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})}
44055,cc_RDC:function(){k.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){k.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){k.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){k.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){k.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){k.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(k.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,k.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(a){k.log("INFO","TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},cc_MIDROW:function(a){var b={flash:!1};if(b.underline=a%2===1,b.italics=a>=46,b.italics)b.foreground="white";else{var c=Math.floor(a/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=d[c]}k.log("INFO","MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},outputDataUpdate:function(){var a=k.time;null!==a&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(a,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:a):this.cueStartTime=a,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))}};var r=function(a,b,c){this.field=a||1,this.outputs=[b,c],this.channels=[new q(1,b),new q(2,c)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};r.prototype={getHandler:function(a){return this.channels[a].getHandler()},setHandler:function(a,b){this.channels[a].setHandler(b)},addData:function(a,b){var c,d,e,f=!1;this.lastTime=a,k.setTime(a);for(var g=0;g<b.length;g+=2)if(d=127&b[g],e=127&b[g+1],0!==d||0!==e){if(k.log("DATA","["+l([b[g],b[g+1]])+"] -> ("+l([d,e])+")"),c=this.parseCmd(d,e),c||(c=this.parseMidrow(d,e)),c||(c=this.parsePAC(d,e)),c||(c=this.parseBackgroundAttributes(d,e)),!c&&(f=this.parseChars(d,e)))if(this.currChNr&&this.currChNr>=0){var h=this.channels[this.currChNr-1];h.insertChars(f)}else k.log("WARNING","No channel found yet. TEXT-MODE?");c?this.dataCounters.cmd+=2:f?this.dataCounters.char+=2:(this.dataCounters.other+=2,k.log("WARNING","Couldn't parse cleaned data "+l([d,e])+" orig: "+l([b[g],b[g+1]])))}else this.dataCounters.padding+=2},parseCmd:function(a,b){var c=null,d=(20===a||28===a)&&32<=b&&b<=47,e=(23===a||31===a)&&33<=b&&b<=35;if(!d&&!e)return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,k.log("DEBUG","Repeated command ("+l([a,b])+") is dropped"),!0;c=20===a||23===a?1:2;var f=this.channels[c-1];return 20===a||28===a?32===b?f.cc_RCL():33===b?f.cc_BS():34===b?f.cc_AOF():35===b?f.cc_AON():36===b?f.cc_DER():37===b?f.cc_RU(2):38===b?f.cc_RU(3):39===b?f.cc_RU(4):40===b?f.cc_FON():41===b?f.cc_RDC():42===b?f.cc_TR():43===b?f.cc_RTD():44===b?f.cc_EDM():45===b?f.cc_CR():46===b?f.cc_ENM():47===b&&f.cc_EOC():f.cc_TO(b-32),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},parseMidrow:function(a,b){var c=null;if((17===a||25===a)&&32<=b&&b<=47){if(c=17===a?1:2,c!==this.currChNr)return k.log("ERROR","Mismatch channel in midrow parsing"),!1;var d=this.channels[c-1];return d.cc_MIDROW(b),k.log("DEBUG","MIDROW ("+l([a,b])+")"),!0}return!1},parsePAC:function(a,b){var c=null,d=null,e=(17<=a&&a<=23||25<=a&&a<=31)&&64<=b&&b<=127,j=(16===a||24===a)&&64<=b&&b<=95;if(!e&&!j)return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;c=a<=23?1:2,d=64<=b&&b<=95?1===c?f[a]:h[a]:1===c?g[a]:i[a];var k=this.interpretPAC(d,b),l=this.channels[c-1];return l.setPAC(k),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},interpretPAC:function(a,b){var c=b,d={color:null,italics:!1,indent:null,underline:!1,row:a};return c=b>95?b-96:b-64,d.underline=1===(1&c),c<=13?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(c/2)]:c<=15?(d.italics=!0,d.color="white"):d.indent=4*Math.floor((c-16)/2),d},parseChars:function(a,b){var d=null,e=null,f=null;if(a>=25?(d=2,f=a-8):(d=1,f=a),17<=f&&f<=19){var g=b;g=17===f?b+80:18===f?b+112:b+144,k.log("INFO","Special char '"+c(g)+"' in channel "+d),e=[g]}else 32<=a&&a<=127&&(e=0===b?[a]:[a,b]);if(e){var h=l(e);k.log("DEBUG","Char codes = "+h.join(",")),this.lastCmdA=null,this.lastCmdB=null}return e}
44055,parseBackgroundAttributes:function(a,b){var c,d,e,f,g=(16===a||24===a)&&32<=b&&b<=47,h=(23===a||31===a)&&45<=b&&b<=47;return!(!g&&!h)&&(c={},16===a||24===a?(d=Math.floor((b-32)/2),c.background=j[d],b%2===1&&(c.background=c.background+"_semi")):45===b?c.background="transparent":(c.foreground="black",47===b&&(c.underline=!0)),e=a<24?1:2,f=this.channels[e-1],f.setBkgData(c),this.lastCmdA=null,this.lastCmdB=null,!0)},reset:function(){for(var a=0;a<this.channels.length;a++)this.channels[a]&&this.channels[a].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(a){for(var b=0;b<this.channels.length;b++)this.channels[b]&&this.channels[b].cueSplitAtTime(a)}};var s=function(a,b,c){for(var d=0,e=b,f=0,g=[],h=function(a,b,c,d){if(4!==a||b<8)return null;var e=c.getUint8(d),f=c.getUint16(d+1),g=c.getUint32(d+3),h=c.getUint8(d+7);return 181==e&&49==f&&1195456820==g&&3==h};e<b+c;){if(d=a.getUint32(e),f=31&a.getUint8(e+4),6===f)for(var i=e+5,j=-1;i<e+4+d-1;){j=0;for(var k=255;255===k;)k=a.getUint8(i),j+=k,i++;var l=0;for(k=255;255===k;)k=a.getUint8(i),l+=k,i++;h(j,l,a,i)&&g.push([i,l]),i+=l}e+=d+4}return g},t=function(a,b){var c=b[0],d=[[],[]];c+=8;var e=31&a.getUint8(c);c+=2;for(var f=0;f<e;f++){var g=a.getUint8(c),h=4&g,i=3&g;c++;var j=a.getUint8(c);c++;var k=a.getUint8(c);c++,h&&(127&j)+(127&k)!==0&&(0===i?(d[0].push(j),d[0].push(k)):1===i&&(d[1].push(j),d[1].push(k)))}return d};a.logger=k,a.PenState=m,a.CaptionScreen=p,a.Cea608Parser=r,a.findCea608Nalus=s,a.extractCea608DataFromRange=t}("undefined"==typeof c?(void 0).cea608parser={}:c)},{}],2:[function(a,b,c){;function d(a){var b,c,d;for(b=[],d=0,c=a.length;d<c;d+=1)a[d].isRoot?b.push("root"):b.push(a[d].name);var e=function(a,b){var c;if(null!==a&&null!==b)for(c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]))},f=function(a,b,c){var d,f,g,h,i;if(null!==a&&0!==a.length)for(d=0,f=a.length;d<f;d+=1)g=a[d],b.hasOwnProperty(g.name)&&(c.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=c[g.name],"object"==typeof h&&"object"==typeof i?e(h,i):null!=g.mergeFunction?c[g.name]=g.mergeFunction(h,i):c[g.name]=h+i):c[g.name]=b[g.name])},g=function a(b,c){var d,e,g,h,i,j,k,l=b;if(null!==l.children&&0!==l.children.length)for(d=0,e=l.children.length;d<e;d+=1)if(j=l.children[d],c.hasOwnProperty(j.name))if(j.isArray)for(i=c[j.name+"_asArray"],g=0,h=i.length;g<h;g+=1)k=i[g],f(l.properties,c,k),a(j,k);else k=c[j.name],f(l.properties,c,k),a(j,k)},h=function c(d){var e,f,h,i,j,k,l;if(null===d)return d;if("object"!=typeof d)return d;for(e=0,f=b.length;e<f;e+=1)"root"===b[e]&&(j=a[e],k=d,g(j,k));for(i in d)if(d.hasOwnProperty(i)&&"__children"!=i){if(h=b.indexOf(i),h!==-1)if(j=a[h],j.isArray)for(l=d[i+"_asArray"],e=0,f=l.length;e<f;e+=1)k=l[e],g(j,k);else k=d[i],g(j,k);c(d[i])}return d};return{run:h}}Object.defineProperty(c,"__esModule",{value:!0}),c.default=d,b.exports=c.default},{}],3:[function(a,b,c){;function d(a,b,c){function d(a){var b=a.localName;return null==b&&(b=a.baseName),null!=b&&""!=b||(b=a.nodeName),b}function e(a){return a.prefix}function f(a){return"string"==typeof a?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"):a}function g(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/")}function h(f){if(f.nodeType==u.DOCUMENT_NODE){var i,j,k,l=f.firstChild;for(j=0,k=f.childNodes.length;j<k;j+=1)if(f.childNodes[j].nodeType!==u.COMMENT_NODE){l=f.childNodes[j];break}if(c)i=h(l);else{i={};var m=d(l);i[m]=h(l)}return i}if(f.nodeType==u.ELEMENT_NODE){var i=new Object;i.__cnt=0;for(var n=[],o=f.childNodes,p=0;p<o.length;p++){var l=o.item(p),m=d(l);if(i.__cnt++,null==i[m]){var q=h(l);if("#text"!=m||/[^\s]/.test(q)){var r={};r[m]=q,n.push(r)}i[m]=q,i[m+"_asArray"]=new Array(1),i[m+"_asArray"][0]=i[m]}else{if(null!=i[m]&&!(i[m]instanceof Array)){var s=i[m];i[m]=new Array,i[m][0]=s,i[m+"_asArray"]=i[m]}for(var v=0;null!=i[m][v];)v++;var q=h(l);if("#text"!=m||/[^\s]/.test(q)){var r={};r[m]=q,n.push(r)}i[m][v]=q}}i.__children=n;for(var w=0;w<f.attributes.length;w++){var x=f.attributes.item(w);i.__cnt++;for(var y=x.value,z=0,A=a.length;z<A;z++){var B=a[z];
44055B.test(x)&&(y=B.converter(x.value))}i[b+x.name]=y}var C=e(f);return null!=C&&""!=C&&(i.__cnt++,i.__prefix=C),1==i.__cnt&&null!=i["#text"]&&(i=i["#text"]),null!=i["#text"]&&(i.__text=i["#text"],t&&(i.__text=g(i.__text)),delete i["#text"],delete i["#text_asArray"]),null!=i["#cdata-section"]&&(i.__cdata=i["#cdata-section"],delete i["#cdata-section"],delete i["#cdata-section_asArray"]),null==i.__text&&null==i.__cdata||(i.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),i}return f.nodeType==u.TEXT_NODE||f.nodeType==u.CDATA_SECTION_NODE?f.nodeValue:f.nodeType==u.COMMENT_NODE?null:void 0}function i(a,b,c,d){var e="<"+(null!=a&&null!=a.__prefix?a.__prefix+":":"")+b;if(null!=c)for(var f=0;f<c.length;f++){var g=c[f],h=a[g];e+=" "+g.substr(1)+"='"+h+"'"}return e+=d?"/>":">"}function j(a,b){return"</"+(null!=a.__prefix?a.__prefix+":":"")+b+">"}function k(a,b){return a.indexOf(b,a.length-b.length)!==-1}function l(a,b){return!!(k(b.toString(),"_asArray")||0==b.toString().indexOf("_")||a[b]instanceof Function)}function m(a){var b=0;if(a instanceof Object)for(var c in a)l(a,c)||b++;return b}function n(a){var b=[];if(a instanceof Object)for(var c in a)c.toString().indexOf("__")==-1&&0==c.toString().indexOf("_")&&b.push(c);return b}function o(a){var b="";return null!=a.__cdata&&(b+="<![CDATA["+a.__cdata+"]]>"),null!=a.__text&&(b+=t?f(a.__text):a.__text),b}function p(a){var b="";return a instanceof Object?b+=o(a):null!=a&&(b+=t?f(a):a),b}function q(a,b,c){var d="";if(0==a.length)d+=i(a,b,c,!0);else for(var e=0;e<a.length;e++)d+=i(a[e],b,n(a[e]),!1),d+=r(a[e]),d+=j(a[e],b);return d}function r(a){var b="",c=m(a);if(c>0)for(var d in a)if(!l(a,d)){var e=a[d],f=n(e);if(null==e||void 0==e)b+=i(e,d,f,!0);else if(e instanceof Object)if(e instanceof Array)b+=q(e,d,f);else{var g=m(e);g>0||null!=e.__text||null!=e.__cdata?(b+=i(e,d,f,!1),b+=r(e),b+=j(e,d)):b+=i(e,d,f,!0)}else b+=i(e,d,f,!1),b+=p(e),b+=j(e,d)}return b+=p(a)}null!==b&&void 0!==b||(b="_"),null!==c&&void 0!==c||(c=!1);var s="1.0.11",t=!1,u={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(a){var b,c,d;if(window.DOMParser){c=new window.DOMParser;try{d=c.parseFromString("<","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){}try{b=c.parseFromString(a,"text/xml"),d&&b.getElementsByTagNameNS(d,"parsererror").length&&(b=void 0)}catch(e){}}else 0==a.indexOf("<?")&&(a=a.substr(a.indexOf("?>")+2)),b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a);return b},this.xml2json=function(a){return h(a)},this.xml_str2json=function(a){var b=this.parseXmlString(a);return b?this.xml2json(b):void 0},this.json2xml_str=function(a){return r(a)},this.json2xml=function(a){var b=this.json2xml_str(a);return this.parseXmlString(b)},this.getVersion=function(){return s},this.escapeMode=function(a){t=a}}Object.defineProperty(c,"__esModule",{value:!0}),c.default=d,b.exports=c.default},{}],4:[function(a,b,c){/*! codem-isoboxer v0.2.2 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ 44056var d={};d.parseBuffer=function(a){return new e(a).parse()},d.Utils={},d.Utils.dataViewToString=function(a,b){var c=b||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(c).decode(a);var d=[],e=0;if("utf-8"===c)for(;e<a.byteLength;){var f=a.getUint8(e++);f<128||(f<224?(f=(31&f)<<6,f|=63&a.getUint8(e++)):f<240?(f=(15&f)<<12,f|=(63&a.getUint8(e++))<<6,f|=63&a.getUint8(e++)):(f=(7&f)<<18,f|=(63&a.getUint8(e++))<<12,f|=(63&a.getUint8(e++))<<6,f|=63&a.getUint8(e++))),d.push(String.fromCharCode(f))}else for(;e<a.byteLength;)d.push(String.fromCharCode(a.getUint8(e++)));return d.join("")},"undefined"!=typeof c&&(c.parseBuffer=d.parseBuffer,c.Utils=d.Utils),d.Cursor=function(a){this.offset="undefined"==typeof a?0:a};var e=function(a){this._raw=new DataView(a),this._cursor=new d.Cursor,this.boxes=[]};e.prototype.fetch=function(a){var b=this.fetchAll(a,!0);return b.length?b[0]:null},e.prototype.fetchAll=function(a,b){var c=[];return e._sweep.call(this,a,c,b),c},e.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var a=f.parse(this);if("undefined"==typeof a.type)break;this.boxes.push(a)}return this},e._sweep=function(a,b,c){this.type&&this.type==a&&b.push(this);for(var d in this.boxes){if(b.length&&c)return;e._sweep.call(this.boxes[d],a,b,c)}};var f=function(){this._cursor=new d.Cursor};f.parse=function(a){var b=new f;return b._offset=a._cursor.offset,b._root=a._root?a._root:a,b._raw=a._raw,b._parent=a,b._parseBox(),a._cursor.offset=b._raw.byteOffset+b._raw.byteLength,b},f.prototype._readInt=function(a){var b=null;switch(a){case 8:b=this._raw.getInt8(this._cursor.offset-this._raw.byteOffset);break;case 16:b=this._raw.getInt16(this._cursor.offset-this._raw.byteOffset);break;case 32:b=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset);break;case 64:var c=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset),d=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset+4);b=c*Math.pow(2,32)+d}return this._cursor.offset+=a>>3,b},f.prototype._readUint=function(a){var b=null;switch(a){case 8:b=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:b=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:var c=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset),d=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);b=(c<<8)+d;break;case 32:b=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:var c=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),d=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);b=c*Math.pow(2,32)+d}return this._cursor.offset+=a>>3,b},f.prototype._readString=function(a){for(var b="",c=0;c<a;c++){var d=this._readUint(8);b+=String.fromCharCode(d)}return b},f.prototype._readTerminatedString=function(){for(var a="";;){var b=this._readUint(8);if(0==b)break;a+=String.fromCharCode(b)}return a},f.prototype._readTemplate=function(a){var b=this._readUint(a/2),c=this._readUint(a/2);return b+c/Math.pow(2,a/2)},f.prototype._parseBox=function(){if(this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)return void(this._root._incomplete=!0);switch(this.size=this._readUint(32),this.type=this._readString(4),1==this.size&&(this.largesize=this._readUint(64)),"uuid"==this.type&&(this.usertype=this._readString(16)),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}!this._incomplete&&this._boxParsers[this.type]&&this._boxParsers[this.type].call(this)},f.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},f.prototype._boxParsers={},["moov","trak","tref","mdia","minf","stbl","edts","dinf","mvex","moof","traf","mfra","udta","meco","strk","vttc"].forEach(function(a){f.prototype._boxParsers[a]=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(f.parse(this))}}),f.prototype._boxParsers.elst=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(var a=1;a<=this.entry_count;a++){var b={};1==this.version?(b.segment_duration=this._readUint(64),b.media_time=this._readInt(64)):(b.segment_duration=this._readUint(32),b.media_time=this._readInt(32)),b.media_rate_integer=this._readInt(16),b.media_rate_fraction=this._readInt(16),this.entries.push(b)}},f.prototype._boxParsers.emsg=function(){this._parseFullBox(),this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString(),this.timescale=this._readUint(32),this.presentation_time_delta=this._readUint(32),this.event_duration=this._readUint(32),this.id=this._readUint(32),this.message_data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},f.prototype._boxParsers.free=f.prototype._boxParsers.skip=function(){this.data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},f.prototype._boxParsers.ftyp=f.prototype._boxParsers.styp=function(){for(this.major_brand=this._readString(4),this.minor_versions=this._readUint(32),this.compatible_brands=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.compatible_brands.push(this._readString(4))},f.prototype._boxParsers.hdlr=function(){this._parseFullBox(),this.pre_defined=this._readUint(32),this.handler_type=this._readString(4),this.reserved=[this._readUint(32),this._readUint(32),this._readUint(32)],this.name=this._readTerminatedString()},f.prototype._boxParsers.mdat=function(){this.data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},f.prototype._boxParsers.mdhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32));var a=this._readUint(16);this.pad=a>>15,this.language=String.fromCharCode((a>>10&31)+96,(a>>5&31)+96,(31&a)+96),this.pre_defined=this._readUint(16)},f.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},f.prototype._boxParsers.mvhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32)),this.rate=this._readTemplate(32),this.volume=this._readTemplate(16),this.reserved1=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.matrix=[];for(var a=0;a<9;a++)this.matrix.push(this._readTemplate(32));this.pre_defined=[];for(var a=0;a<6;a++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},f.prototype._boxParsers.payl=function(){var a=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.cue_text=d.Utils.dataViewToString(a)},f.prototype._boxParsers.sidx=function(){this._parseFullBox(),this.reference_ID=this._readUint(32),this.timescale=this._readUint(32),0==this.version?(this.earliest_presentation_time=this._readUint(32),this.first_offset=this._readUint(32)):(this.earliest_presentation_time=this._readUint(64),this.first_offset=this._readUint(64)),this.reserved=this._readUint(16),this.reference_count=this._readUint(16),this.references=[];for(var a=0;a<this.reference_count;a++){var b={},c=this._readUint(32);b.reference_type=c>>31&1,b.referenced_size=2147483647&c,b.subsegment_duration=this._readUint(32);var d=this._readUint(32);b.starts_with_SAP=d>>31&1,b.SAP_type=d>>28&7,b.SAP_delta_time=268435455&d,this.references.push(b)}},f.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(var a=0;a<this.subsegment_count;a++){var b={};b.ranges_count=this._readUint(32),b.ranges=[];for(var c=0;c<b.ranges_count;c++){var d={};d.level=this._readUint(8),d.range_size=this._readUint(24),b.ranges.push(d)}this.subsegments.push(b)}},f.prototype._boxParsers.tfdt=function(){this._parseFullBox(),1==this.version?this.baseMediaDecodeTime=this._readUint(64):this.baseMediaDecodeTime=this._readUint(32)},f.prototype._boxParsers.tfhd=function(){this._parseFullBox(),this.track_ID=this._readUint(32),1&this.flags&&(this.base_data_offset=this._readUint(64)),2&this.flags&&(this.sample_description_offset=this._readUint(32)),8&this.flags&&(this.default_sample_duration=this._readUint(32)),16&this.flags&&(this.default_sample_size=this._readUint(32)),32&this.flags&&(this.default_sample_flags=this._readUint(32))},f.prototype._boxParsers.tkhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(32)),this.reserved2=[this._readUint(32),this._readUint(32)],this.layer=this._readUint(16),this.alternate_group=this._readUint(16),this.volume=this._readTemplate(16),this.reserved3=this._readUint(16),this.matrix=[];for(var a=0;a<9;a++)this.matrix.push(this._readTemplate(32));this.width=this._readUint(32),this.height=this._readUint(32)},f.prototype._boxParsers.trun=function(){this._parseFullBox(),this.sample_count=this._readUint(32),1&this.flags&&(this.data_offset=this._readInt(32)),4&this.flags&&(this.first_sample_flags=this._readUint(32)),this.samples=[];for(var a=0;a<this.sample_count;a++){var b={};256&this.flags&&(b.sample_duration=this._readUint(32)),512&this.flags&&(b.sample_size=this._readUint(32)),1024&this.flags&&(b.sample_flags=this._readUint(32)),2048&this.flags&&(0==this.version?b.sample_composition_time_offset=this._readUint(32):b.sample_composition_time_offset=this._readInt(32)),this.samples.push(b)}},f.prototype._boxParsers.vlab=function(){var a=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.source_label=d.Utils.dataViewToString(a)},f.prototype._boxParsers.vttC=function(){var a=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.config=d.Utils.dataViewToString(a)},f.prototype._boxParsers.vtte=function(){}},{}],5:[function(a,b,c){var d=c.decimalAdjust=function(a,b,c){return"undefined"==typeof c||0===+c?Math[a](b):(b=+b,c=+c,isNaN(b)||"number"!=typeof c||c%1!==0?NaN:(b=b.toString().split("e"),b=Math[a](+(b[0]+"e"+(b[1]?+b[1]-c:-c))),b=b.toString().split("e"),+(b[0]+"e"+(b[1]?+b[1]+c:c))))};b.exports={round10:function(a,b){return d("round",a,b)},floor10:function(a,b){return d("floor",a,b)},ceil10:function(a,b){return d("ceil",a,b)}}
44056,b.exports.polyfill=function(){Math.round10||(Math.round10=b.exports.round10),Math.floor10||(Math.floor10=b.exports.floor10),Math.ceil10||(Math.ceil10=b.exports.ceil10)}},{}],6:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){k=!0,l=!0,m=(new Date).getTime()}function b(a){l=a}function c(a){k=a}function d(){return k}function e(){var a="",b=null;l&&(b=(new Date).getTime(),a+="["+(b-m)+"]"),a.length>0&&(a+=" "),Array.apply(null,arguments).forEach(function(b){a+=b+" "}),k&&console.log(a),h.trigger(i.default.LOG,{message:a})}var f=this.context,h=(0,g.default)(f).getInstance(),j=void 0,k=void 0,l=void 0,m=void 0;return j={log:e,setLogTimestampVisible:b,setLogToBrowserConsole:c,getLogToBrowserConsole:d},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j);e.__dashjs_factory_name="Debug",c.default=k.default.getSingletonFactory(e),b.exports=c.default},{11:11,7:7,8:8}],7:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b,c){var e=arguments.length<=3||void 0===arguments[3]?h:arguments[3];if(!a)throw new Error("event type cannot be null or undefined");if(!b||"function"!=typeof b)throw new Error("listener must be a function: "+b);if(!(d(a,b,c)>=0)){f[a]=f[a]||[];var g={callback:b,scope:c,priority:e},i=f[a].some(function(b,c){if(e>b.priority)return f[a].splice(c,0,g),!0});i||f[a].push(g)}}function b(a,b,c){if(a&&b&&f[a]){var e=d(a,b,c);e<0||f[a].splice(e,1)}}function c(a,b){if(a&&f[a]){if(b=b||{},b.hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");b.type=a,f[a].forEach(function(a){return a.callback.call(a.scope,b)})}}function d(a,b,c){var d=-1;return f[a]?(f[a].some(function(a,e){if(a.callback===b&&(!c||c===a.scope))return d=e,!0}),d):d}function e(){f={}}var f={},g={on:a,off:b,trigger:c,reset:e};return g}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=0,i=5e3;e.__dashjs_factory_name="EventBus";var j=g.default.getSingletonFactory(e);j.EVENT_PRIORITY_LOW=h,j.EVENT_PRIORITY_HIGH=i,c.default=j,b.exports=c.default},{8:8}],8:[function(a,b,c){;Object.defineProperty(c,"__esModule",{value:!0});var d=function(){function a(a,b,c,d){var e=g(d);!e[a]&&b&&(e[a]={instance:b,override:c})}function b(a,b){for(var c in j){var d=j[c];if(d.context===a&&d.name===b)return d.instance}return null}function c(a,b,c){for(var d in j){var e=j[d];if(e.context===a&&e.name===b)return void(j[d].instance=c)}j.push({name:b,context:a,instance:c})}function d(a){return function(b){return void 0===b&&(b={}),{create:function(){return f(a.__dashjs_factory_name,a.apply({context:b},arguments),b,arguments)}}}}function e(a){return function(c){var d=void 0;return void 0===c&&(c={}),{getInstance:function(){return d||(d=b(c,a.__dashjs_factory_name)),d||(d=f(a.__dashjs_factory_name,a.apply({context:c},arguments),c,arguments),j.push({name:a.__dashjs_factory_name,context:c,instance:d})),d}}}}function f(a,b,c,d){var e=g(c),f=e[a];if(f){var i=f.instance;if(!f.override)return i.apply({context:c,factory:h},d);i=i.apply({context:c,factory:h,parent:b},d);for(var j in i)b.hasOwnProperty(j)&&(b[j]=i[j])}return b}function g(a){var b=void 0;return i.forEach(function(c){c===a&&(b=c)}),b||(b=i.push(a)),b}var h=void 0,i=[],j=[];return h={extend:a,getSingletonInstance:b,setSingletonInstance:c,getSingletonFactory:e,getClassFactory:d}}();c.default=d,b.exports=c.default},{}],9:[function(a,b,c){;function d(){return e}Object.defineProperty(c,"__esModule",{value:!0}),c.getVersionString=d;var e="2.3.0"},{}],10:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(12),i=d(h),j=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.AST_IN_FUTURE="astinfuture",this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.BYTES_APPENDED="bytesAppended",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CHUNK_APPENDED="chunkAppended",this.CURRENT_TRACK_CHANGED="currenttrackchanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.DATA_UPDATE_STARTED="dataUpdateStarted",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.INITIALIZATION_LOADED="initializationLoaded",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_REQUESTED="initRequested",this.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",this.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_PROGRESS="loadingProgress",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.QUOTA_EXCEEDED="quotaExceeded",this.REPRESENTATION_UPDATED="representationUpdated",this.SEGMENTS_LOADED="segmentsLoaded",this.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",this.SOURCEBUFFER_APPEND_COMPLETED="sourceBufferAppendCompleted",this.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_COMPLETED="streamCompleted",this.STREAM_INITIALIZED="streaminitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TIMED_TEXT_REQUESTED="timedTextRequested",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.URL_RESOLUTION_FAILED="urlResolutionFailed",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ALL_ELEMENTS_LOADED="xlinkAllElementsLoaded",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady"}return f(b,a),b}(i.default);c.default=j,b.exports=c.default},{12:12}],11:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(10),i=d(h),j=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).apply(this,arguments)}return f(b,a),b}(i.default),k=new j;c.default=k,b.exports=c.default},{10:10}],12:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(){d(this,a)}return e(a,[{key:"extend",value:function(a,b){if(a){var c=!!b&&b.override,d=!!b&&b.publicOnly;for(var e in a)!a.hasOwnProperty(e)||this[e]&&!c||d&&a[e].indexOf("public_")===-1||(this[e]=a[e])}}}]),a}();c.default=f,b.exports=c.default},{}],13:[function(a,b,c){;function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b.default=a,b}function e(a){return a&&a.__esModule?a:{default:a}}function f(){function a(a){a&&a.dashManifestModel&&(I=a.dashManifestModel)}function b(){J=[],K={}}function c(a,b){return b.getRepresentationForQuality(a.quality)}function d(a){return K[a.streamInfo.id][a.index]}function e(a){for(var b=J.length,c=0;c<b;c++){var d=J[c];if(a.id===d.id)return d}return null}function f(a,b){var c=new h.default,d=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index],e=I.getRepresentationFor(b.index,d);return c.id=b.id,c.quality=b.index,c.bandwidth=I.getBandwidth(e),c.DVRWindow=b.segmentAvailabilityRange,c.fragmentDuration=b.segmentDuration||(b.segments&&b.segments.length>0?b.segments[0].duration:NaN),c.MSETimeOffset=b.MSETimeOffset,c.useCalculatedLiveEdgeTime=b.useCalculatedLiveEdgeTime,c.mediaInfo=g(a,b.adaptation),c}function g(a,b){var c,d=new j.default,e=b.period.mpd.manifest.Period_asArray[b.period.index].AdaptationSet_asArray[b.index];return d.id=b.id,d.index=b.index,d.type=b.type,d.streamInfo=k(a,b.period),d.representationCount=I.getRepresentationCount(e),d.lang=I.getLanguageForAdaptation(e),c=I.getViewpointForAdaptation(e),d.viewpoint=c?c.value:void 0,d.accessibility=I.getAccessibilityForAdaptation(e).map(function(a){var b=a.value,c=b;return a.schemeIdUri&&a.schemeIdUri.search("cea-608")>
44056=0&&"undefined"!=typeof t.default&&(c=b?"cea-608:"+b:"cea-608",d.embeddedCaptions=!0),c}),d.audioChannelConfiguration=I.getAudioChannelConfigurationForAdaptation(e).map(function(a){return a.value}),d.roles=I.getRolesForAdaptation(e).map(function(a){return a.value}),d.codec=I.getCodec(e),d.mimeType=I.getMimeType(e),d.contentProtection=I.getContentProtectionData(e),d.bitrateList=I.getBitrateListForAdaptation(e),d.contentProtection&&d.contentProtection.forEach(function(a){a.KID=I.getKID(a)}),d.isText=I.getIsTextTrack(d.mimeType),d}function i(a,b,c){a.id=b,a.index=100+parseInt(b.substring(2,3)),a.type="embeddedText",a.codec="cea-608-in-SEI",a.isText=!0,a.isEmbedded=!0,a.lang=b+" "+c,a.roles=["caption"]}function k(a,b){var c=new l.default,d=1;return c.id=b.id,c.index=b.index,c.start=b.start,c.duration=b.duration,c.manifestInfo=m(a,b.mpd),c.isLast=1===a.Period_asArray.length||Math.abs(c.start+c.duration-c.manifestInfo.duration)<d,c.isFirst=1===a.Period_asArray.length||I.getRegularPeriods(a,I.getMpd(a))[0].id===b.id,c}function m(a,b){var c=new n.default;return c.DVRWindowSize=b.timeShiftBufferDepth,c.loadedTime=b.manifest.loadedTime,c.availableFrom=b.availabilityStartTime,c.minBufferTime=b.manifest.minBufferTime,c.maxFragmentDuration=b.maxSegmentDuration,c.duration=I.getDuration(a),c.isDynamic=I.getIsDynamic(a),c}function o(a,b,c){var d=I.getAdaptationForType(a,b.index,c,b);if(!d)return null;var f=e(b),h=f.id,i=I.getIndexForAdaptation(d,a,b.index);return K[h]=K[h]||I.getAdaptationsForPeriod(a,f),g(a,K[h][i])}function q(a,b,c){var d,f,h,j,k,l,m=e(b),n=m.id,o=I.getAdaptationsForType(a,b.index,"embeddedText"!==c?c:"video"),p=[];if(!o)return p;for(K[n]=K[n]||I.getAdaptationsForPeriod(a,m),j=0,l=o.length;j<l;j++){if(d=o[j],h=I.getIndexForAdaptation(d,a,b.index),f=g(a,K[n][h]),"embeddedText"===c){var q=f.accessibility.length;for(k=0;k<q;k++)if(f){var r=f.accessibility[k];if(0===r.indexOf("cea-608:")){var s=r.substring(8),t=s.split(";");if("CC"===t[0].substring(0,2))for(k=0;k<t.length;k++)f||(f=g.call(this,a,K[n][h])),i(f,t[k].substring(0,3),t[k].substring(4)),p.push(f),f=null;else for(k=0;k<t.length;k++)f||(f=g.call(this,a,K[n][h])),i(f,"CC"+(k+1),t[k]),p.push(f),f=null}else 0===r.indexOf("cea-608")&&(i(f,"CC1","eng"),p.push(f),f=null)}}f&&"embeddedText"!==c&&p.push(f)}return p}function r(a){var b,c,d,e=[];if(!a)return null;for(b=I.getMpd(a),J=I.getRegularPeriods(a,b),b.checkTime=I.getCheckTime(a,J[0]),K={},c=J.length,d=0;d<c;d++)e.push(k(a,J[d]));return e}function s(a){var b=I.getMpd(a);return m(a,b)}function u(a,b){var c=a.getRepresentationController().getRepresentationForQuality(b);return a.getIndexHandler().getInitRequest(c)}function w(a,b){var d=c(b,a.getRepresentationController());return a.getIndexHandler().getNextSegmentRequest(d)}function x(a,b,d,e){var f=c(b,a.getRepresentationController());return a.getIndexHandler().getSegmentRequestForTime(f,d,e)}function y(a,b,d){var e=c(b,a.getRepresentationController());return a.getIndexHandler().generateSegmentRequestForTime(e,d)}function z(a){return a.getIndexHandler().getCurrentTime()}function A(a,b){return a.getIndexHandler().setCurrentTime(b)}function B(a,b){var c,f,g=e(b.getStreamInfo()),h=b.getMediaInfo(),i=d(h),j=b.getType();c=h.id,f=c?I.getAdaptationForId(c,a,g.index):I.getAdaptationForIndex(h.index,a,g.index),b.getRepresentationController().updateData(f,i,j)}function C(a,b,c){var d=b.getRepresentationForQuality(c);return d?f(a,d):null}function D(a,b){var c=b.getCurrentRepresentation();return c?f(a,c):null}function E(a,b,c){var d=new p.default,e=a.scheme_id_uri,f=a.value,g=a.timescale,h=a.presentation_time_delta,i=a.event_duration,j=a.id,k=a.message_data,l=c*g+h;return b[e]?(d.eventStream=b[e],d.eventStream.value=f,d.eventStream.timescale=g,d.duration=i,d.id=j,d.presentationTime=l,d.messageData=k,d.presentationTimeDelta=h,d):null}function F(a,b,f){var g=[];return b instanceof l.default?g=I.getEventsForPeriod(a,e(b)):b instanceof j.default?g=I.getEventStreamForAdaptationSet(a,d(b)):b instanceof h.default&&(g=I.getEventStreamForRepresentation(a,c(b,f.getRepresentationController()))),g}function G(){J=[],K={}}var H=void 0,I=void 0,J=void 0,K=void 0;return H={initialize:b,convertDataToTrack:f,convertDataToMedia:g,convertDataToStream:k,getDataForTrack:c,getDataForMedia:d,getDataForStream:e,getStreamsInfo:r,getManifestInfo:s,getMediaInfoForType:
44056o,getAllMediaInfoForType:q,getCurrentRepresentationInfo:D,getRepresentationInfoForQuality:C,updateData:B,getInitRequest:u,getNextFragmentRequest:w,getFragmentRequestForTime:x,generateFragmentRequestForTime:y,getIndexHandlerTime:z,setIndexHandlerTime:A,getEventsFor:F,getEvent:E,setConfig:a,reset:G,metricsList:v}}Object.defineProperty(c,"__esModule",{value:!0});var g=a(123),h=e(g),i=a(118),j=e(i),k=a(120),l=e(k),m=a(117),n=e(m),o=a(39),p=e(o),q=a(8),r=e(q),s=a(1),t=e(s),u=a(18),v=d(u);f.__dashjs_factory_name="DashAdapter",c.default=r.default.getSingletonFactory(f),b.exports=c.default},{1:1,117:117,118:118,120:120,123:123,18:18,39:39,8:8}],14:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){U=-1,Y=0,Z=NaN,M.on(l.default.INITIALIZATION_LOADED,I,T),M.on(l.default.SEGMENTS_LOADED,J,T)}function c(b){$=b,X=$.getType(),W=$.isDynamic(),_=(0,w.default)(K).create(a,W)}function d(){return $}function e(a){Y=a}function f(){return Y}function h(){return U}function k(){return Z}function m(){_=null,Y=0,Z=NaN,V=NaN,U=-1,W=null,X=null,$=null,M.off(l.default.INITIALIZATION_LOADED,I,T),M.off(l.default.SEGMENTS_LOADED,J,T)}function o(a){return a.split("$$").join("$")}function p(a,b){if(null===b||a.indexOf("$RepresentationID$")===-1)return a;var c=b.toString();return a.split("$RepresentationID$").join(c)}function q(a,b,c){var d,e,f=S.resolve(c.path);return f&&b!==f.url&&N.isRelative(b)?(d=f.url,e=f.serviceLocation,b&&(d+=b)):d=b,!N.isRelative(d)&&(a.url=d,a.serviceLocation=e,!0)}function s(a,b){var c,d,e=new g.default;if(c=a.adaptation.period,e.mediaType=b,e.type=j.HTTPRequest.INIT_SEGMENT_TYPE,e.range=a.range,d=c.start,e.availabilityStartTime=P.calcAvailabilityStartTimeFromPresentationTime(d,a.adaptation.period.mpd,W),e.availabilityEndTime=P.calcAvailabilityEndTimeFromPresentationTime(d+c.duration,c.mpd,W),e.quality=a.index,e.mediaInfo=$.getMediaInfo(),q(e,a.initialization,a))return e}function v(a){var b;return a?b=s(a,X):null}function y(a){var b,c,d,e=a.adaptation.period,f=a.segmentInfoType,g=!1;return U<0?g=!1:W||U<a.availableSegmentsNumber?(c=(0,u.getSegmentByIndex)(U,a),c&&(d=c.presentationStartTime-e.start,b=a.adaptation.period.duration,L(a.segmentInfoType+": "+d+" / "+b),g=("SegmentTimeline"!==f||!W)&&d>=b)):g=!0,g}function z(a){return _.getSegments(a,V,U,A)}function A(a,b){if(a.segments=b,b&&b.length>0&&(Z=isNaN(Z)?b[0].presentationStartTime:Math.min(b[0].presentationStartTime,Z)),W&&isNaN(P.getExpectedLiveEdge())){var c=b.length-1,d=b[c],e=d.presentationStartTime,f=R.getMetricsFor("stream");P.setExpectedLiveEdge(e),R.updateManifestUpdateInfo(Q.getCurrentManifestUpdate(f),{presentationStartTime:e})}}function B(a){if(!a)throw new i.default("no representation");return a.segments=null,z(a),a}function C(a,b){var c,d=a.initialization,e="BaseURL"!==a.segmentInfoType&&"SegmentBase"!==a.segmentInfoType&&!a.indexRange;return a.segmentDuration||a.segments||B(a),a.segmentAvailabilityRange=null,a.segmentAvailabilityRange=P.calcSegmentAvailabilityRange(a,W),a.segmentAvailabilityRange.end<a.segmentAvailabilityRange.start&&!a.useCalculatedLiveEdgeTime?(c=new i.default(x,"no segments are available yet",{availabilityDelay:a.segmentAvailabilityRange.start-a.segmentAvailabilityRange.end}),void M.trigger(l.default.REPRESENTATION_UPDATED,{sender:this,representation:a,error:c})):(b||(U=-1),a.segmentDuration&&B(a),d||O.loadInitialization(a),e||O.loadSegments(a,X,a.indexRange),void(d&&e&&M.trigger(l.default.REPRESENTATION_UPDATED,{sender:this,representation:a})))}function D(a,b,c){var d,e,f,g,h,i=b.segments,j=i?i.length:null,k=-1;if(i&&j>0)for(h=0;h<j;h++)if(e=i[h],f=e.presentationStartTime,g=e.duration,d=void 0===c||null===c?g/2:c,a+d>=f&&a-d<f+g){k=e.availabilityIdx;break}return k}function E(a){if(null===a||void 0===a)return null;var b=new g.default,c=a.representation,d=c.adaptation.period.mpd.manifest.Period_asArray[c.adaptation.period.index].AdaptationSet_asArray[c.adaptation.index].Representation_asArray[c.index].bandwidth,e=a.media;return e=(0,u.replaceTokenForTemplate)(e,"Number",a.replacementNumber),e=(0,u.replaceTokenForTemplate)(e,"Time",a.replacementTime),e=(0,u.replaceTokenForTemplate)(e,"Bandwidth",d),e=p(e,c.id),e=o(e),b.mediaType=X,b.type=j.HTTPRequest.MEDIA_SEGMENT_TYPE,b.range=a.mediaRange,b.startTime=a.presentationStartTime,b.duration=a.duration,b.timescale=c.timescale,b.availabilityStartTime=a.availabilityStartTime,b.availabilityEndTime=a.availabilityEndTime,b.wallStartTime=a.wallStartTime,b.quality=c.index,b.index=a.availabilityIdx,b.mediaInfo=$.getMediaInfo(),b.adaptationIndex=c.adaptation.index,q(b,e,c)?b:void 0}function F(a,b,c){var d,e,f,h=U,i=!!c&&c.keepIdx,j=c?c.timeThreshold:null,k=!(!c||!c.ignoreIsFinished);return a?(V!==b&&(V=b,L("Getting the request for "+X+" time : "+b)),U=D(b,a,j),z(a),U<0&&(U=D(b,a,j)),U>0&&L("Index for "+X+" time "+b+" is "+U),f=!k&&y(a),f?(d=new g.default,d.action=g.default.ACTION_COMPLETE,d.index=U,d.mediaType=X,d.mediaInfo=$.getMediaInfo(),L("Signal complete.",d)):(e=(0,u.getSegmentByIndex)(U,a),d=E(e)),i&&h>=0&&(U="SegmentTimeline"===a.segmentInfoType&&W?U:h),d):null}function G(a,b){var c=(a.segmentAvailabilityRange.end-a.segmentAvailabilityRange.start)/2;return a.segments=null,a.segmentAvailabilityRange={start:b-c,end:b+c},F(a,b,{keepIdx:!1,ignoreIsFinished:!0})}function H(a){var b,c,d;return a&&U!==-1?(V=null,U++,L("Getting the next request at index: "+U),d=y(a),d?(b=new g.default,b.action=g.default.ACTION_COMPLETE,b.index=U,b.mediaType=X,b.mediaInfo=$.getMediaInfo(),L("Signal complete.")):(z(a),c=(0,u.getSegmentByIndex)(U,a),b=E(c),!c&&W&&U--),b):null}function I(a){var b=a.representation;b.segments&&M.trigger(l.default.REPRESENTATION_UPDATED,{sender:this,representation:b})}function J(a){if(!a.error&&X===a.mediaType){var b,c,d,e,f=a.segments,g=a.representation,h=[],i=0;for(b=0,c=f.length;b<c;b++)d=f[b],e=(0,u.getTimeBasedSegment)(P,W,g,d.startTime,d.duration,d.timescale,d.media,d.mediaRange,i),h.push(e),e=null,i++;g.segmentAvailabilityRange={start:h[0].presentationStartTime,end:h[c-1].presentationStartTime},g.availableSegmentsNumber=c,A(g,h),g.initialization&&M.trigger(l.default.REPRESENTATION_UPDATED,{sender:this,representation:g 44057})}}var K=this.context,L=(0,r.default)(K).getInstance().log,M=(0,n.default)(K).getInstance(),N=(0,t.default)(K).getInstance(),O=a.segmentBaseLoader,P=a.timelineConverter,Q=a.dashMetrics,R=a.metricsModel,S=a.baseURLController,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0;return T={initialize:c,getStreamProcessor:d,getInitRequest:v,getSegmentRequestForTime:F,getNextSegmentRequest:H,generateSegmentRequestForTime:G,updateRepresentation:C,setCurrentTime:e,getCurrentTime:f,getCurrentIndex:h,getEarliestTime:k,reset:m},b(),T}Object.defineProperty(c,"__esModule",{value:!0});var f=a(114),g=d(f),h=a(113),i=d(h),j=a(130),k=a(11),l=d(k),m=a(7),n=d(m),o=a(8),p=d(o),q=a(6),r=d(q),s=a(109),t=d(s),u=a(33),v=a(32),w=d(v),x=1;e.__dashjs_factory_name="DashHandler";var y=p.default.getClassFactory(e);y.SEGMENTS_UNAVAILABLE_ERROR_CODE=x,c.default=y,b.exports=c.default},{109:109,11:11,113:113,114:114,130:130,32:32,33:33,6:6,7:7,8:8}],15:[function(a,b,c){;function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b.default=a,b}function e(a){return a&&a.__esModule?a:{default:a}}
44057function f(){function a(a,b){var c,d=C.getValue(),e=d.Period_asArray[b];return c=x(e,a),null===c?null:c.bandwidth}function b(a,b){var c,d=C.getValue(),e=d.Period_asArray[b];return c=w(e,a)}function c(a,b){var c,d=C.getValue(),e=d.Period_asArray[b];return c=z(e,a)}function d(a){return m(a,o.TRACK_SWITCH)}function e(a){return m(a,o.BUFFER_LEVEL)}function f(a){var b=e(a);return b?(0,p.round10)(b.level/1e3,-3):0}function h(a){return a.RequestsQueue}function j(a){if(null===a)return null;var b,c,d=a.HttpList,e=null;if(null===d||d.length<=0)return null;for(b=d.length,c=b-1;c>=0;){if(d[c].responsecode){e=d[c];break}c--}return e}function l(a){return null===a?[]:a.HttpList?a.HttpList:[]}function m(a,b){if(null===a)return null;var c=a[b];if(null===c)return null;var d=c.length;return d<=0?null:c[d-1]}function n(a){return m(a,o.DROPPED_FRAMES)}function q(a){return m(a,o.SCHEDULING_INFO)}function r(a){return m(a,o.MANIFEST_UPDATE)}function s(a){return m(a,o.DVR_INFO)}function t(a,b){var c,d,e,f={};if(null===a)return null;for(c=l(a),e=c.length-1;e>=0;e--)if(d=c[e],d.type===g.HTTPRequest.MPD_TYPE){f=v(d._responseHeaders);break}return void 0===f[b]?null:f[b]}function u(a,b){if(null===a)return null;var c,d=j(a);return null===d||null===d._responseHeaders?null:(c=v(d._responseHeaders),void 0===c[b]?null:c[b])}function v(a){var b={};if(!a)return b;for(var c=a.split("\r\n"),d=0,e=c.length;d<e;d++){var f=c[d],g=f.indexOf(": ");g>0&&(b[f.substring(0,g)]=f.substring(g+2))}return b}function w(a,b){var c=x(a,b,!0);return null!==c?c:-1}function x(a,b,c){var d,e,f,g,h,i;for(e=a.AdaptationSet_asArray,h=0;h<e.length;h+=1)for(d=e[h],g=d.Representation_asArray,i=0;i<g.length;i+=1)if(f=g[i],b===f.id)return c?i:f;return null}function y(a,b){return(0,k.default)(B).getInstance().getIsTypeOf(a,b)}function z(a,b){var c,d,e,f;if(!a||!b)return-1;for(d=a.AdaptationSet_asArray,f=0;f<d.length;f+=1)if(c=d[f],e=c.Representation_asArray,y(c,b))return e.length;return-1}var A=void 0,B=this.context,C=(0,i.default)(B).getInstance();return A={getBandwidthForRepresentation:a,getIndexForRepresentation:b,getMaxIndexForBufferType:c,getCurrentRepresentationSwitch:d,getLatestBufferLevelVO:e,getCurrentBufferLevel:f,getCurrentHttpRequest:j,getHttpRequests:l,getCurrentDroppedFrames:n,getCurrentSchedulingInfo:q,getCurrentDVRInfo:s,getCurrentManifestUpdate:r,getLatestFragmentRequestHeaderValueByID:u,getLatestMPDRequestHeaderValueByID:t,getRequestsQueue:h}}Object.defineProperty(c,"__esModule",{value:!0});var g=a(130),h=a(74),i=e(h),j=a(20),k=e(j),l=a(8),m=e(l),n=a(18),o=d(n),p=a(5);f.__dashjs_factory_name="DashMetrics",c.default=m.default.getSingletonFactory(f),b.exports=c.default},{130:130,18:18,20:20,5:5,74:74,8:8}],16:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){u=(0,m.default)(n).getInstance(),v=(0,s.default)(n).getInstance(),x=(0,g.default)(n).getInstance()}function b(a){a.baseURLController&&(y=a.baseURLController)}function c(a,b){var d=!0,e=null,f=null,g=new XMLHttpRequest,i=y.resolve(a.path),k=b||{url:i?i.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:g};p("Start searching for initialization."),g.onload=function(){g.status<200||g.status>299||(d=!1,k.bytesLoaded=k.range.end,f=v.parse(g.response),e=h(f),e?(a.range=e,a.initialization=k.url,r.trigger(o.default.INITIALIZATION_LOADED,{representation:a})):(k.range.end=k.bytesLoaded+k.bytesToLoad,c(a,k)))},g.onloadend=g.onerror=function(){d&&(d=!1,u.downloadError("initialization",k.url,g),r.trigger(o.default.INITIALIZATION_LOADED,{representation:a}))},j(g,k),p("Perform init search: "+k.url)}function d(a,b,c,e,g){if(c&&(void 0===c.start||void 0===c.end)){var h=c?c.toString().split("-"):null;c=h?{start:parseFloat(h[0]),end:parseFloat(h[1])}:null}g=g?g:l;var i=!0,k=null,m=null,n=!!c,o=new XMLHttpRequest,q=y.resolve(a.path),r={url:q?q.url:void 0,range:n?c:{start:0,end:1500},searching:!n,bytesLoaded:e?e.bytesLoaded:0,bytesToLoad:1500,request:o};o.onload=function(){if(!(o.status<200||o.status>299)){var c=r.bytesToLoad,e=o.response.byteLength;if(i=!1,r.bytesLoaded=r.range.end-r.range.start,k=v.parse(o.response),m=k.getBox("sidx"),m&&m.isComplete){var h,j,l=m.references;if(null!==l&&void 0!==l&&l.length>0&&(h=1===l[0].reference_type),h){p("Initiate multiple SIDX load."),r.range.end=r.range.start+m.size;var n,q,s,t,u,w=[],x=0,y=(m.offset||r.range.start)+m.size,z=function(c){c?(w=w.concat(c),x++,x>=q&&g(w,a,b)):g(null,a,b)};for(n=0,q=l.length;n<q;n++)s=y,t=y+l[n].referenced_size-1,y+=l[n].referenced_size,u={start:s,end:t},d(a,null,u,r,z)}else p("Parsing segments from SIDX."),j=f(m,r),g(j,a,b)}else{if(m)r.range.start=m.offset||r.range.start,r.range.end=r.range.start+(m.size||c);else{if(e<r.bytesLoaded)return void g(null,a,b);var A=k.getLastBox();A&&A.size?(r.range.start=A.offset+A.size,r.range.end=r.range.start+c):r.range.end+=c}
44057d(a,b,r.range,r,g)}}},o.onloadend=o.onerror=function(){i&&(i=!1,u.downloadError("SIDX",r.url,o),g(null,a,b))},j(o,r),p("Perform SIDX load: "+r.url)}function e(){u=null,v=null,x=null,p=null}function f(a,b){for(var c,d,e,f,g=a.references,h=g.length,j=a.timescale,k=a.earliest_presentation_time,l=b.range.start+a.offset+a.first_offset+a.size,m=[],n=0;n<h;n++)e=g[n].subsegment_duration,f=g[n].referenced_size,c=new i.default,c.duration=e,c.media=b.url,c.startTime=k,c.timescale=j,d=l+f-1,c.mediaRange=l+"-"+d,m.push(c),k+=e,l+=f;return m}function h(a){var b,c,d=a.getBox("ftyp"),e=a.getBox("moov"),f=null;return p("Searching for initialization."),e&&e.isComplete&&(b=d?d.offset:e.offset,c=e.offset+e.size-1,f=b+"-"+c,p("Found the initialization. Range: "+f)),f}function j(a,b){b.url&&(a.open("GET",x.modifyRequestURL(b.url)),a.responseType="arraybuffer",a.setRequestHeader("Range","bytes="+b.range.start+"-"+b.range.end),a=x.modifyRequestHeader(a),a.send(null))}function l(a,b,c){a?r.trigger(o.default.SEGMENTS_LOADED,{segments:a,representation:b,mediaType:c}):r.trigger(o.default.SEGMENTS_LOADED,{segments:null,representation:b,mediaType:c,error:new k.default(null,"error loading segments",null)})}var n=this.context,p=(0,w.default)(n).getInstance().log,r=(0,q.default)(n).getInstance(),t=void 0,u=void 0,v=void 0,x=void 0,y=void 0;return t={setConfig:b,initialize:a,loadInitialization:c,loadSegments:d,reset:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(107),g=d(f),h=a(44),i=d(h),j=a(113),k=d(j),l=a(102),m=d(l),n=a(11),o=d(n),p=a(7),q=d(p),r=a(97),s=d(r),t=a(8),u=d(t),v=a(6),w=d(v);e.__dashjs_factory_name="SegmentBaseLoader",c.default=u.default.getSingletonFactory(e),b.exports=c.default},{102:102,107:107,11:11,113:113,44:44,6:6,7:7,8:8,97:97}],17:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){y={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"},CueBlockNumber:{tag:21368}}}}},Void:{tag:236,required:!0}}}function b(){A=(0,q.default)(p).getInstance(),B=(0,s.default)(p).getInstance(),D=(0,z.default)(p).create({errHandler:A,metricsModel:C,requestModifier:B})}function c(a){if(!a.baseURLController||!a.metricsModel)throw new Error("Missing config parameter(s)");E=a.baseURLController,C=a.metricsModel}function d(a){var b=[],c=void 0,d=void 0,e=void 0,f=(0,k.default)(p).create({data:a}),g=void 0;for(f.consumeTag(y.Segment.Cues),d=f.getMatroskaCodedNum();f.moreData()&&f.consumeTagAndSize(y.Segment.Cues.CuePoint,!0);){for(c={},c.CueTime=f.parseTag(y.Segment.Cues.CuePoint.CueTime),c.CueTracks=[];f.moreData()&&f.consumeTagAndSize(y.Segment.Cues.CuePoint.CueTrackPositions,!0);){if(e={},e.Track=f.parseTag(y.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===e.Track)throw new Error("Cue track cannot be 0");e.ClusterPosition=f.parseTag(y.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),f.getPos()+4>d||!f.consumeTag(y.Segment.Cues.CuePoint.CueTrackPositions.CueBlockNumber,!0)?c.CueTracks.push(e):(g=f.getMatroskaCodedNum(),e.BlockNumber=f.getMatroskaUint(g),c.CueTracks.push(e))}if(0===c.CueTracks.length)throw new Error("Mandatory cuetrack not found");b.push(c)}if(0===b.length)throw new Error("mandatory cuepoint not found");return b}function e(a,b,c,e,f){var g=void 0,h=void 0,i=void 0,j=void 0,k=void 0,l=void 0,m=void 0,n=void 0;for(h=d(a),i=[],k=0,l=h.length;k<l;k+=1)j=new u.default,g=0,g=k<h.length-1?h[k+1].CueTime-h[k].CueTime:f-h[k].CueTime,j.duration=g,j.media=b,j.startTime=h[k].CueTime,j.timescale=1e3,m=h[k].CueTracks[0].ClusterPosition+c,n=k<h.length-1?h[k+1].CueTracks[0].ClusterPosition+c-1:e-1,j.mediaRange=m+"-"+n,i.push(j);return r("Parsed cues: "+i.length+" cues."),i}function f(a,b,c,d){var f=(0,k.default)(p).create({data:a}),g=void 0,h=void 0,i=c.split("-"),j=null,l={url:b,range:{start:parseFloat(i[0]),end:parseFloat(i[1])},request:j},n=void 0,o=void 0;for(r("Parse EBML header: "+l.url),f.skipOverElement(y.EBML),f.consumeTag(y.Segment),n=f.getMatroskaCodedNum(),n+=f.getPos(),o=f.getPos();
44057f.moreData()&&!f.consumeTagAndSize(y.Segment.Info,!0);)if(!(f.skipOverElement(y.Segment.SeekHead,!0)||f.skipOverElement(y.Segment.Tracks,!0)||f.skipOverElement(y.Segment.Cues,!0)||f.skipOverElement(y.Void,!0)))throw new Error("no valid top level element found");for(;void 0===g;){var q=f.getMatroskaCodedNum(!0),s=f.getMatroskaCodedNum();switch(q){case y.Segment.Info.Duration.tag:g=f[y.Segment.Info.Duration.parse](s);break;default:f.setPos(f.getPos()+s)}}j=m(l);var t=function(a){h=e(a,l.url,o,n,g),d(h)},u=function(){r("Download Error: Cues "+l.url),d(null)};D.load({request:j,success:t,error:u}),r("Perform cues load: "+l.url+" bytes="+l.range.start+"-"+l.range.end)}function h(a,b){var c=null,d=E.resolve(a.path),e=d?d.url:void 0,f=a.range.split("-"),h=b||{range:{start:parseFloat(f[0]),end:parseFloat(f[1])},request:c,url:e,init:!0};r("Start loading initialization."),c=m(h);var i=function(){a.initialization=h.url,t.trigger(g.default.INITIALIZATION_LOADED,{representation:a})},j=function(){t.trigger(g.default.INITIALIZATION_LOADED,{representation:a})};D.load({request:c,success:i,error:j}),r("Perform init load: "+h.url)}function j(a,b,c,d){var e=null,g=E.resolve(a.path),h=g?g.url:void 0,i=8192,j={bytesLoaded:0,bytesToLoad:i,range:{start:0,end:i},request:e,url:h,init:!1};d=d?d:l,e=m(j),r("Parsing ebml header");var k=function(e){f(e,h,c,function(c){d(c,a,b)})},n=function(){d(null,a,b)};D.load({request:e,success:k,error:n})}function l(a,b,c){a?t.trigger(g.default.SEGMENTS_LOADED,{segments:a,representation:b,mediaType:c}):t.trigger(g.default.SEGMENTS_LOADED,{segments:null,representation:b,mediaType:c,error:new Error(null,"error loading segments",null)})}function m(a){var b=new x.default;return b.type=a.init?v.HTTPRequest.INIT_SEGMENT_TYPE:v.HTTPRequest.MEDIA_SEGMENT_TYPE,b.url=a.url,b.range=a.range.start+"-"+a.range.end,b}function n(){A=null,B=null,r=null}var p=this.context,r=(0,o.default)(p).getInstance().log,t=(0,i.default)(p).getInstance(),w=void 0,y=void 0,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0;return w={setConfig:c,initialize:b,loadInitialization:h,loadSegments:j,reset:n},a(),w}Object.defineProperty(c,"__esModule",{value:!0});var f=a(11),g=d(f),h=a(7),i=d(h),j=a(101),k=d(j),l=a(8),m=d(l),n=a(6),o=d(n),p=a(102),q=d(p),r=a(107),s=d(r),t=a(44),u=d(t),v=a(130),w=a(114),x=d(w),y=a(55),z=d(y);e.__dashjs_factory_name="WebmSegmentBaseLoader",c.default=m.default.getSingletonFactory(e),b.exports=c.default},{101:101,102:102,107:107,11:11,114:114,130:130,44:44,55:55,6:6,7:7,8:8}],18:[function(a,b,c){;Object.defineProperty(c,"__esModule",{value:!0});var d="TcpList";c.TCP_CONNECTION=d;var e="HttpList";c.HTTP_REQUEST=e;var f="RepSwitchList";c.TRACK_SWITCH=f;var g="BufferLevel";c.BUFFER_LEVEL=g;var h="BufferState";c.BUFFER_STATE=h;var i="DVRInfo";c.DVR_INFO=i;var j="DroppedFrames";c.DROPPED_FRAMES=j;var k="SchedulingInfo";c.SCHEDULING_INFO=k;var l="RequestsQueue";c.REQUESTS_QUEUE=l;var m="ManifestUpdate";c.MANIFEST_UPDATE=m;var n="ManifestUpdatePeriodInfo";c.MANIFEST_UPDATE_STREAM_INFO=n;var o="ManifestUpdateRepresentationInfo";c.MANIFEST_UPDATE_TRACK_INFO=o;var p="PlayList";c.PLAY_LIST=p;var q="DVBErrors";c.DVB_ERRORS=q},{}],19:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){P=null,Q=-1,R=!0,S=[],V=(0,m.default)(M).getInstance(),X=(0,q.default)(M).getInstance(),Y=(0,o.default)(M).getInstance(),Z=(0,s.default)(M).getInstance(),$=(0,u.default)(M).getInstance(),_=(0,y.default)(M).getInstance(),aa=(0,k.default)(M).getInstance(),ba=(0,g.default)(M).getInstance(),ca=(0,i.default)(M).getInstance(),da=(0,w.default)(M).getInstance(),N.on(E.default.QUALITY_CHANGE_REQUESTED,K,O),N.on(E.default.REPRESENTATION_UPDATED,G,O),N.on(E.default.WALLCLOCK_TIME_UPDATED,H,O),N.on(E.default.BUFFER_LEVEL_UPDATED,J,O),N.on(E.default.LIVE_EDGE_SEARCH_COMPLETED,I,O)}function b(a){a.abrController&&(V=a.abrController)}function c(a){U=a,W=U.getIndexHandler()}function d(){return U}function e(){return P}function f(){return Q}function h(){return R}function j(){return T}function l(){N.off(E.default.QUALITY_CHANGE_REQUESTED,K,O),N.off(E.default.REPRESENTATION_UPDATED,G,O),N.off(E.default.WALLCLOCK_TIME_UPDATED,H,O),N.off(E.default.BUFFER_LEVEL_UPDATED,J,O),N.off(E.default.LIVE_EDGE_SEARCH_COMPLETED,I,O),P=null,Q=-1,R=!0,S=[],V=null,X=null,Y=null,Z=null,$=null,_=null,aa=null,ba=null,ca=null,da=null}function n(a,b,c){var d,e,f=null,g=U.getStreamInfo(),h=V.getTopQualityIndexFor(c,g.id);if(R=!0,N.trigger(E.default.DATA_UPDATE_STARTED,{sender:this}),S=z(b),null===P&&"fragmentedText"!==c?(e=V.getAverageThroughput(c),f=e||V.getInitialBitrateFor(c,g),d=V.getQualityForBitrate(U.getMediaInfo(),f)):d=V.getQualityFor(c,g),d>h&&(d=h),T=t(d),P=a,"video"!==c&&"audio"!==c&&"fragmentedText"!==c)return R=!1,void N.trigger(E.default.DATA_UPDATE_COMPLETED,{sender:this,data:P,currentRepresentation:T});for(var i=0;i<S.length;i++)W.updateRepresentation(S[i],!0)}function p(){var a=new Date,b=j(),c=1e3*Y.getTime();$.addRepresentationSwitch(b.adaptation.type,a,c,b.id)}function r(){var a=aa.calcSegmentAvailabilityRange(T,U.isDynamic());$.addDVRInfo(U.getType(),Y.getTime(),U.getStreamInfo().manifestInfo,a)}function t(a){return S[a]}function v(a){return S.indexOf(a)}function x(){for(var a=0,b=S.length;a<b;a++){var c=S[a].segmentInfoType;if(null===S[a].segmentAvailabilityRange||null===S[a].initialization||("SegmentBase"===c||"BaseURL"===c)&&!S[a].segments)return!1}return!0}function z(a){var b,c=Z.getValue();
44057return Q=ba.getIndexForAdaptation(P,c,a.period.index),b=ba.getRepresentationsForAdaptation(c,a)}function B(a){for(var b,c=0,d=S.length;c<d;c++)b=S[c],b.segmentAvailabilityRange=aa.calcSegmentAvailabilityRange(b,a)}function D(){S.forEach(function(a){a.segmentAvailabilityRange=null})}function F(a){var b=a,c=function(){if(!h()){R=!0,N.trigger(E.default.DATA_UPDATE_STARTED,{sender:O}),D();for(var a=0;a<S.length;a++)W.updateRepresentation(S[a],!0)}};R=!1,N.trigger(E.default.AST_IN_FUTURE,{delay:b}),setTimeout(c,b)}function G(a){if(a.sender.getStreamProcessor()===U&&h()){var b,c,d,e=a.representation,f=$.getMetricsFor("stream"),g=$.getMetricsFor(j().adaptation.type),i=ca.getCurrentManifestUpdate(f),k=!1,l=0;if("dynamic"===e.adaptation.period.mpd.manifest.type){var m=e.segmentAvailabilityRange.end-e.segmentAvailabilityRange.start,n=Y.computeLiveDelay(T.segmentDuration,U.getStreamInfo().manifestInfo.DVRWindowSize);l=1e3*(n-m)}if(l>0)return r(),F(l),c=new A.default(L,"Segments update failed",null),void N.trigger(E.default.DATA_UPDATE_COMPLETED,{sender:this,data:P,currentRepresentation:T,error:c});if(i){for(var o=0;o<i.trackInfo.length;o++)if(b=i.trackInfo[o],b.index===e.index&&b.mediaType===U.getType()){k=!0;break}k||$.addManifestUpdateRepresentationInfo(i,e.id,e.index,e.adaptation.period.index,U.getType(),e.presentationTimeOffset,e.startNumber,e.segmentInfoType)}x()&&(R=!1,V.setPlaybackQuality(U.getType(),U.getStreamInfo(),v(T)),$.updateManifestUpdateInfo(i,{latency:T.segmentAvailabilityRange.end-Y.getTime()}),d=ca.getCurrentRepresentationSwitch(g),d||p(),N.trigger(E.default.DATA_UPDATE_COMPLETED,{sender:this,data:P,currentRepresentation:T}))}}function H(a){a.isDynamic&&B(a.isDynamic)}function I(a){if(!a.error){B(!0),W.updateRepresentation(T,!1);var b=Z.getValue(),c=T.adaptation.period,d=X.getActiveStreamInfo();d.isLast&&(c.mpd.checkTime=ba.getCheckTime(b,c),c.duration=ba.getEndTimeForLastPeriod(Z.getValue(),c)-c.start,d.duration=c.duration)}}function J(a){a.sender.getStreamProcessor()===U&&r()}function K(a){a.mediaType===U.getType()&&U.getStreamInfo().id===a.streamInfo.id&&a.oldQuality!==a.newQuality&&(T=t(a.newQuality),_.setSavedBitrateSettings(a.mediaType,T.bandwidth),p())}var L=1,M=this.context,N=(0,C.default)(M).getInstance(),O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0;return O={initialize:c,setConfig:b,getData:e,getDataIndex:f,isUpdating:h,updateData:n,getStreamProcessor:d,getCurrentRepresentation:j,getRepresentationForQuality:t,reset:l},a(),O}Object.defineProperty(c,"__esModule",{value:!0});var f=a(20),g=d(f),h=a(15),i=d(h),j=a(35),k=d(j),l=a(57),m=d(l),n=a(65),o=d(n),p=a(68),q=d(p),r=a(74),s=d(r),t=a(76),u=d(t),v=a(75),w=d(v),x=a(100),y=d(x),z=a(113),A=d(z),B=a(7),C=d(B),D=a(11),E=d(D),F=a(8),G=d(F);e.__dashjs_factory_name="RepresentationController",c.default=G.default.getClassFactory(e),b.exports=c.default},{100:100,11:11,113:113,15:15,20:20,35:35,57:57,65:65,68:68,7:7,74:74,75:75,76:76,8:8}],20:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){var c,d,e,f=!1,g=!1,h=a.ContentComponent_asArray,i="text"!==b?new RegExp(b):new RegExp("(vtt|ttml)");if(a.Representation_asArray.length>0&&a.Representation_asArray[0].hasOwnProperty("codecs")){var j=a.Representation_asArray[0].codecs;if("stpp"===j||"wvtt"===j)return"fragmentedText"===b}if(h){if(h.length>1)return"muxed"===b;h[0]&&h[0].contentType===b&&(f=!0,g=!0)}if(a.hasOwnProperty("mimeType")&&(f=i.test(a.mimeType),g=!0),!g)for(c=0,d=a.Representation_asArray.length;!g&&c<d;)e=a.Representation_asArray[c],e.hasOwnProperty("mimeType")&&(f=i.test(e.mimeType),g=!0),c++;return f}function b(b){return a(b,"audio")}function c(b){return a(b,"video")}function d(b){return a(b,"fragmentedText")}function e(b){return a(b,"text")}function f(b){return a(b,"muxed")}function h(a){return"text/vtt"===a||"application/ttml+xml"===a}function j(a){var b="";return a.hasOwnProperty("lang")&&(b=a.lang.replace(/[^A-Za-z0-9-]/g,"")),b}function l(a){return a.hasOwnProperty("Viewpoint")?a.Viewpoint:null}function n(a){return a.hasOwnProperty("Role_asArray")?a.Role_asArray:[]}function p(a){return a.hasOwnProperty("Accessibility_asArray")?a.Accessibility_asArray:[]}function r(a){return a.hasOwnProperty("AudioChannelConfiguration_asArray")?a.AudioChannelConfiguration_asArray:[]}function t(a){return n(a).filter(function(a){return"main"===a.value})[0]}function v(){return function(a,b){return a.bandwidth-b.bandwidth}}function x(a){return void 0!==a.Representation_asArray&&null!==a.Representation_asArray&&a.Representation_asArray.sort(v()),a}function z(a,b,c){var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;d<e;d++)if(f[d].hasOwnProperty("id")&&f[d].id===a)return f[d];return null}function B(a,b,c){var d=b.Period_asArray[c].AdaptationSet_asArray;return d[a]}function D(a,b,c){var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;d<e;d++)if(f[d]===a)return d;return-1}function E(b,c,d){var e,f,g=b.Period_asArray[c].AdaptationSet_asArray,h=[];for(e=0,f=g.length;e<f;e++)a(g[e],d)&&h.push(x(g[e]));return h}function F(a,b,c,d){var e=E(a,b,c);if(!e||0===e.length)return null;if(e.length>1&&d)for(var f=la.getCurrentTrackFor(c,d),g=ma.getAllMediaInfoForType(a,d,c),h=0,i=e.length;h<i;h++){if(f&&la.isTracksEqual(f,g[h]))return e[h];if(t(e[h]))return e[h]}return e[0]}function G(a){var b=a.Representation_asArray[0];return b.mimeType+';codecs="'+b.codecs+'"'}function H(a){return a.Representation_asArray[0].mimeType}function I(a){return a&&a.hasOwnProperty("cenc:default_KID")?a["cenc:default_KID"]:null}function J(a){return a&&a.hasOwnProperty("ContentProtection_asArray")&&0!==a.ContentProtection_asArray.length?a.ContentProtection_asArray:null}function K(a){var b=!1;return a.hasOwnProperty("type")&&(b="dynamic"===a.type),b}function L(a){var b,c,d=K(a);return b=!isNaN(a.timeShiftBufferDepth),c=d&&b}function M(a,b){var c=!1;return a.profiles&&a.profiles.length>0&&(c=a.profiles.indexOf(b)!==-1),c}function N(a){return M(a,"urn:mpeg:dash:profile:isoff-on-demand:2011")}function O(a){return M(a,"urn:dvb:dash:profile:dvb-dash:2014")}function P(a){var b;return b=a.hasOwnProperty("mediaPresentationDuration")?a.mediaPresentationDuration:Number.MAX_VALUE}function Q(a){return a.bandwidth}function R(a){var b=NaN,c=2;return a.hasOwnProperty("minimumUpdatePeriod")&&(b=Math.max(parseFloat(a.minimumUpdatePeriod),c)),b}function S(a){return a.Representation_asArray.length}function T(a){if(!a||!a.Representation_asArray||!a.Representation_asArray.length)return null;for(var b=x(a),c=b.Representation_asArray,d=c.length,e=[],f=0;f<d;f++)e.push({bandwidth:c[f].bandwidth,width:c[f].width||0,height:c[f].height||0});return e}function U(a,b){return b.Representation_asArray[a]}function V(a,b){for(var c,d,e,f,i,j=x(a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index]),k=[],l=0;l<j.Representation_asArray.length;l++)f=j.Representation_asArray[l],c=new g.default,c.index=l,c.adaptation=b,f.hasOwnProperty("id")&&(c.id=f.id),f.hasOwnProperty("bandwidth")&&(c.bandwidth=f.bandwidth),f.hasOwnProperty("maxPlayoutRate")&&(c.maxPlayoutRate=f.maxPlayoutRate),f.hasOwnProperty("SegmentBase")?(e=f.SegmentBase,c.segmentInfoType="SegmentBase"):f.hasOwnProperty("SegmentList")?(e=f.SegmentList,e.hasOwnProperty("SegmentTimeline")?(c.segmentInfoType="SegmentTimeline",i=e.SegmentTimeline.S_asArray[e.SegmentTimeline.S_asArray.length-1],(!i.hasOwnProperty("r")||i.r>=0)&&(c.useCalculatedLiveEdgeTime=!0)):(c.segmentInfoType="SegmentList",c.useCalculatedLiveEdgeTime=!0)):f.hasOwnProperty("SegmentTemplate")?(e=f.SegmentTemplate,e.hasOwnProperty("SegmentTimeline")?(c.segmentInfoType="SegmentTimeline",i=e.SegmentTimeline.S_asArray[e.SegmentTimeline.S_asArray.length-1],(!i.hasOwnProperty("r")||i.r>=0)&&(c.useCalculatedLiveEdgeTime=!0)):c.segmentInfoType="SegmentTemplate",e.hasOwnProperty("initialization")&&(c.initialization=e.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):(e=f.BaseURL,c.segmentInfoType="BaseURL"),e.hasOwnProperty("Initialization")?(d=e.Initialization,d.hasOwnProperty("sourceURL")?c.initialization=d.sourceURL:d.hasOwnProperty("range")&&(c.range=d.range)):f.hasOwnProperty("mimeType")&&h(f.mimeType)&&(c.range=0),e.hasOwnProperty("timescale")&&(c.timescale=e.timescale),e.hasOwnProperty("duration")&&(c.segmentDuration=e.duration/c.timescale),e.hasOwnProperty("startNumber")&&(c.startNumber=e.startNumber),e.hasOwnProperty("indexRange")&&(c.indexRange=e.indexRange),e.hasOwnProperty("presentationTimeOffset")&&(c.presentationTimeOffset=e.presentationTimeOffset/c.timescale),c.MSETimeOffset=ka.calcMSETimeOffset(c),c.path=[b.period.index,b.index,l],k.push(c);return k}function W(a,e){for(var g,h,j=a.Period_asArray[e.index],k=[],l=0;l<j.AdaptationSet_asArray.length;l++)h=j.AdaptationSet_asArray[l],g=new i.default,h.hasOwnProperty("id")&&(g.id=h.id),g.index=l,g.period=e,f(h)?g.type="muxed":b(h)?g.type="audio":c(h)?g.type="video":d(h)?g.type="fragmentedText":g.type="text",k.push(g);return k}function X(a,b){var c,d,e=K(a),f=[],g=null,h=null,i=null,j=null;for(d=0,c=a.Period_asArray.length;d<c;d++)h=a.Period_asArray[d],h.hasOwnProperty("start")?(j=new k.default,j.start=h.start):null!==g&&h.hasOwnProperty("duration")&&null!==i?(j=new k.default,j.start=i.start+i.duration,j.duration=h.duration):0!==d||e||(j=new k.default,j.start=0),null!==i&&isNaN(i.duration)&&(i.duration=j.start-i.start),null!==j&&(j.id=Y(h)),null!==j&&h.hasOwnProperty("duration")&&(j.duration=h.duration),null!==j&&(j.index=d,j.mpd=b,f.push(j),g=h,i=j),h=null,j=null;return 0===f.length?f:(null!==i&&isNaN(i.duration)&&(i.duration=aa(a,i)-i.start),f)}function Y(a){if(!a)throw new Error("Period cannot be null or undefined");var b=k.default.DEFAULT_ID;return a.hasOwnProperty("id")&&"__proto__"!==a.id&&(b=a.id),b}function Z(a){var b=new m.default;return b.manifest=a,a.hasOwnProperty("availabilityStartTime")?b.availabilityStartTime=new Date(a.availabilityStartTime.getTime()):b.availabilityStartTime=new Date(a.loadedT
44057ime.getTime()),a.hasOwnProperty("availabilityEndTime")&&(b.availabilityEndTime=new Date(a.availabilityEndTime.getTime())),a.hasOwnProperty("suggestedPresentationDelay")&&(b.suggestedPresentationDelay=a.suggestedPresentationDelay),a.hasOwnProperty("timeShiftBufferDepth")&&(b.timeShiftBufferDepth=a.timeShiftBufferDepth),a.hasOwnProperty("maxSegmentDuration")&&(b.maxSegmentDuration=a.maxSegmentDuration),b}function $(a,b){return ka.calcPresentationTimeFromWallTime(a.loadedTime,b)}function _(a,b){var c,d=NaN;return a.hasOwnProperty("minimumUpdatePeriod")&&(c=$(a,b),d=c+a.minimumUpdatePeriod),d}function aa(a,b){var c,d=_(a,b);if(a.mediaPresentationDuration)c=a.mediaPresentationDuration;else{if(isNaN(d))throw new Error("Must have @mediaPresentationDuration or @minimumUpdatePeriod on MPD or an explicit @duration on the last period.");c=d}return c}function ba(a,b){var c=a.Period_asArray,d=c[b.index].EventStream_asArray,e=[];if(d)for(var f=0;f<d.length;f++){var g=new A.default;if(g.period=b,g.timescale=1,!d[f].hasOwnProperty("schemeIdUri"))throw new Error("Invalid EventStream. SchemeIdUri has to be set");g.schemeIdUri=d[f].schemeIdUri,d[f].hasOwnProperty("timescale")&&(g.timescale=d[f].timescale),d[f].hasOwnProperty("value")&&(g.value=d[f].value);for(var h=0;h<d[f].Event_asArray.length;h++){var i=new w.default;i.presentationTime=0,i.eventStream=g,d[f].Event_asArray[h].hasOwnProperty("presentationTime")&&(i.presentationTime=d[f].Event_asArray[h].presentationTime),d[f].Event_asArray[h].hasOwnProperty("duration")&&(i.duration=d[f].Event_asArray[h].duration),d[f].Event_asArray[h].hasOwnProperty("id")&&(i.id=d[f].Event_asArray[h].id),e.push(i)}}return e}function ca(a,b){var c=[];if(!a)return c;for(var d=0;d<a.length;d++){var e=new A.default;if(e.timescale=1,e.representation=b,!a[d].hasOwnProperty("schemeIdUri"))throw new Error("Invalid EventStream. SchemeIdUri has to be set");e.schemeIdUri=a[d].schemeIdUri,a[d].hasOwnProperty("timescale")&&(e.timescale=a[d].timescale),a[d].hasOwnProperty("value")&&(e.value=a[d].value),c.push(e)}return c}function da(a,b){var c=a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index].InbandEventStream_asArray;return ca(c,null)}function ea(a,b){var c=a.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].InbandEventStream_asArray;return ca(c,b)}function fa(a){var b=K(a),c=a.hasOwnProperty("availabilityStartTime"),d=a.UTCTiming_asArray,e=[];return(b||c)&&d&&d.forEach(function(a){var b=new o.default;a.hasOwnProperty("schemeIdUri")&&(b.schemeIdUri=a.schemeIdUri,a.hasOwnProperty("value")&&(b.value=a.value.toString(),e.push(b)))}),e}function ga(a){var b=[],c=a.BaseURL_asArray||[a.baseUri],d=!1;return c.some(function(c){if(c){var e=new y.default,f=c.__text||c;return na.isRelative(f)&&(d=!0,a.baseUri&&(f=a.baseUri+f)),e.url=f,c.hasOwnProperty("serviceLocation")&&c.serviceLocation.length?e.serviceLocation=c.serviceLocation:e.serviceLocation=f,c.hasOwnProperty("dvb:priority")&&(e.dvb_priority=c["dvb:priority"]),c.hasOwnProperty("dvb:weight")&&(e.dvb_weight=c["dvb:weight"]),b.push(e),d}}),b}function ha(a){return a.hasOwnProperty("Location")&&(a.Location=a.Location_asArray[0]),a.Location}var ia=void 0,ja=this.context,ka=(0,q.default)(ja).getInstance(),la=(0,s.default)(ja).getInstance(),ma=(0,u.default)(ja).getInstance(),na=(0,C.default)(ja).getInstance();return ia={getIsTypeOf:a,getIsAudio:b,getIsVideo:c,getIsText:e,getIsMuxed:f,getIsTextTrack:h,getIsFragmentedText:d,getIsMain:t,getLanguageForAdaptation:j,getViewpointForAdaptation:l,getRolesForAdaptation:n,getAccessibilityForAdaptation:p,getAudioChannelConfigurationForAdaptation:r,processAdaptation:x,getAdaptationForIndex:B,getIndexForAdaptation:D,getAdaptationForId:z,getAdaptationsForType:E,getAdaptationForType:F,getCodec:G,getMimeType:H,getKID:I,getContentProtectionData:J,getIsDynamic:K,getIsDVR:L,getIsOnDemand:N,getIsDVB:O,getDuration:P,getBandwidth:Q,getRefreshDelay:R,getRepresentationCount:S,getBitrateListForAdaptation:T,getRepresentationFor:U,getRepresentationsForAdaptation:V,getAdaptationsForPeriod:W,getRegularPeriods:X,getPeriodId:Y,getMpd:Z,getFetchTime:$,getCheckTime:_,getEndTimeForLastPerio
44057d:aa,getEventsForPeriod:ba,getEventStreams:ca,getEventStreamForAdaptationSet:da,getEventStreamForRepresentation:ea,getUTCTimingSources:fa,getBaseURLsFromElement:ga,getRepresentationSortFunction:v,getLocation:ha}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(43),g=d(f),h=a(37),i=d(h),j=a(42),k=d(j),l=a(41),m=d(l),n=a(45),o=d(n),p=a(35),q=d(p),r=a(63),s=d(r),t=a(13),u=d(t),v=a(39),w=d(v),x=a(38),y=d(x),z=a(40),A=d(z),B=a(109),C=d(B),D=a(8),E=d(D);e.__dashjs_factory_name="DashManifestModel",c.default=E.default.getSingletonFactory(e),b.exports=c.default},{109:109,13:13,35:35,37:37,38:38,39:39,40:40,41:41,42:42,43:43,45:45,63:63,8:8}],21:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){h=[new q.default,new s.default,new u.default],i=new o.default(h,"",(!0)),j=new m.default([new w.default,new y.default])}function b(a,b){var c;try{var f=window.performance.now();if(c=i.xml_str2json(a),!c)throw new Error("parser error");var g=window.performance.now();j.run(c);var k=window.performance.now();b.setMatchers(h),b.setIron(j),d("Parsing complete: ( xml2json: "+(g-f).toPrecision(3)+"ms, objectiron: "+(k-g).toPrecision(3)+"ms, total: "+((k-f)/1e3).toPrecision(3)+"s)")}catch(l){return e.manifestError("parsing the manifest failed","parse",a,l),null}return c}var c=this.context,d=(0,k.default)(c).getInstance().log,e=(0,g.default)(c).getInstance(),f=void 0,h=void 0,i=void 0,j=void 0;return f={parse:b},a(),f}Object.defineProperty(c,"__esModule",{ 44058value:!0});var f=a(102),g=d(f),h=a(8),i=d(h),j=a(6),k=d(j),l=a(2),m=d(l),n=a(3),o=d(n),p=a(28),q=d(p),r=a(27),s=d(r),t=a(29),u=d(t),v=a(24),w=d(v),x=a(25),y=d(x);e.__dashjs_factory_name="DashParser",c.default=i.default.getClassFactory(e),b.exports=c.default},{102:102,2:2,24:24,25:25,27:27,28:28,29:29,3:3,6:6,8:8}],22:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(b,c){d(this,a);var e=function(a){return a&&a.length&&a.charAt(0)===a.charAt(0).toUpperCase()};this._name=b,this._merge=void 0!==c?c:e(b)}return e(a,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),a}();c.default=f,b.exports=c.default},{}],23:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=a(22),h=d(g),i=function(){function a(b,c,d,f,g){var i=this;e(this,a),this._name=b||"",this._properties=[],this._children=d||[],this._isRoot=f||!1,this._isArray=g||!0,Array.isArray(c)&&c.forEach(function(a){i._properties.push(new h.default(a))})}return f(a,[{key:"name",get:function(){return this._name}},{key:"isRoot",get:function(){return this._isRoot}},{key:"isArray",get:function(){return this._isArray}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),a}();c.default=i,b.exports=c.default},{22:22}],24:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(23),i=d(h),j=function(a){function b(){e(this,b);var a=["profiles","width","height","sar","frameRate","audioSamplingRate","mimeType","segmentProfiles","codecs","maximumSAPPeriod","startWithSAP","maxPlayoutRate","codingDependency","scanType","FramePacking","AudioChannelConfiguration","ContentProtection","EssentialProperty","SupplementalProperty","InbandEventStream"];return g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,"AdaptationSet",a,[new i.default("Representation",a,[new i.default("SubRepresentation",a)])])}return f(b,a),b}(i.default);c.default=j,b.exports=c.default},{23:23}],25:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(23),i=d(h),j=function(a){function b(){e(this,b);var a=["SegmentBase","SegmentTemplate","SegmentList"];return g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,"Period",a,[new i.default("AdaptationSet",a,[new i.default("Representation",a)])])}return f(b,a),b}(i.default);c.default=j,b.exports=c.default},{23:23}],26:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(b,c){d(this,a),this._test=b,this._converter=c}return e(a,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),a}();c.default=f,b.exports=c.default},{}],27:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(26),i=d(h),j=60,k=60,l=1e3,m=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,n=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,function(a){return m.test(a.value)},function(a){var b=m.exec(a),c=void 0;if(c=Date.UTC(parseInt(b[1],10),parseInt(b[2],10)-1,parseInt(b[3],10),parseInt(b[4],10),parseInt(b[5],10),b[6]&&parseInt(b[6],10)||0,b[7]&&parseFloat(b[7])*l||0),b[9]&&b[10]){var d=parseInt(b[9],10)*k+p
44058arseInt(b[10],10);c+=("+"===b[8]?-1:1)*d*j*l}return new Date(c)})}return f(b,a),b}(i.default);c.default=n,b.exports=c.default},{26:26}],28:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(26),i=d(h),j=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,k=31536e3,l=2592e3,m=86400,n=3600,o=60,p=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,function(a){for(var b=["minBufferTime","mediaPresentationDuration","minimumUpdatePeriod","timeShiftBufferDepth","maxSegmentDuration","maxSubsegmentDuration","suggestedPresentationDelay","start","starttime","duration"],c=b.length,d=0;d<c;d++)if(a.nodeName===b[d])return j.test(a.value);return!1},function(a){var b=j.exec(a),c=parseFloat(b[2]||0)*k+parseFloat(b[4]||0)*l+parseFloat(b[6]||0)*m+parseFloat(b[8]||0)*n+parseFloat(b[10]||0)*o+parseFloat(b[12]||0);return void 0!==b[1]&&(c=-c),c})}return f(b,a),b}(i.default);c.default=p,b.exports=c.default},{26:26}],29:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(26),i=d(h),j=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,k=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,function(a){return j.test(a.value)},function(a){return parseFloat(a)})}return f(b,a),b}(i.default);c.default=k,b.exports=c.default},{26:26}],30:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){a&&a.boxParser&&(e=a.boxParser)}function b(a){var b,c,d,f,g,h,i,j,k,l,m,n=e.parse(a),o=n.getBox("tfhd"),p=n.getBox("tfdt"),q=n.getBox("trun"),r=n.getBox("moof"),s=n.getBox("mfhd");for(l=s.sequence_number,d=q.sample_count,g=p.baseMediaDecodeTime,k=(o.base_data_offset||0)+(q.data_offset||0),h=[],j=0;j<d;j++)i=q.samples[j],b=void 0!==i.sample_duration?i.sample_duration:o.default_sample_duration,f=void 0!==i.sample_size?i.sample_size:o.default_sample_size,c=void 0!==i.sample_composition_time_offset?i.sample_composition_time_offset:0,h.push({dts:g,cts:g+c,duration:b,offset:r.offset+k,size:f}),k+=f,g+=b;return m=g-p.baseMediaDecodeTime,{sampleList:h,sequenceNumber:l,totalDuration:m}}function c(a){var b=e.parse(a),c=b.getBox("mdhd");return c?c.timescale:NaN}var d=void 0,e=void 0;return d={getSamplesInfo:b,getMediaTimescaleFromMoov:c,setConfig:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="FragmentedTextBoxParser",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],31:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m,n,o=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentList,p=o.SegmentURL_asArray.length,q=[];for(n=a.startNumber,k=(0,h.decideSegmentListRangeForTemplate)(d,b,a,c,e,f),l=Math.max(k.start,0),m=Math.min(k.end,o.SegmentURL_asArray.length-1),g=l;g<=m;g++)j=o.SegmentURL_asArray[g],i=(0,h.getIndexBasedSegment)(d,b,a,g),i.replacementTime=(n+g-1)*a.segmentDuration,i.media=j.media?j.media:"",i.mediaRange=j.mediaRange,i.index=j.index,i.indexRange=j.indexRange,q.push(i),i=null;return a.availableSegmentsNumber=p,q}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(33);e.__dashjs_factory_name="ListSegmentsGetter";var i=g.default.getClassFactory(e);c.default=i,b.exports=c.default},{33:33,8:8}],32:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){function c(){h=(0,i.default)(f).create(a,b),j=(0,k.default)(f).create(a,b),l=(0,m.default)(f).create(a,b)}function d(a,b,c,d,f){var g,i=a.segmentInfoType;return"SegmentBase"!==i&&"BaseURL"!==i&&e(a,c)?("SegmentTimeline"===i?g=h.getSegments(a,b,c,f):"SegmentTemplate"===i?g=j.getSegments(a,b,c,f):"SegmentList"===i&&(g=l.getSegments(a,b,c,f)),d&&d(a,g)):g=a.segments,g}function e(a,b){var c,d,e=a.segments,f=!1;return e&&0!==e.length?(d=e[0].availabilityIdx,c=e[e.length-1].availabilityIdx,f=b<
44058d||b>c):f=!0,f}var f=this.context,g=void 0,h=void 0,j=void 0,l=void 0;return g={getSegments:d},c(),g}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(36),i=d(h),j=a(34),k=d(j),l=a(31),m=d(l);e.__dashjs_factory_name="SegmentsGetter";var n=g.default.getClassFactory(e);c.default=n,b.exports=c.default},{31:31,34:34,36:36,8:8}],33:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){for(;a.length<b;)a="0"+a;return a}function f(a,b){return a.representation.startNumber+b}function g(a,b,c){for(var d,f,g,h,i,j,k="%0",l=b.length,m=k.length;;){if(d=a.indexOf("$"+b),d<0)return a;if(f=a.indexOf("$",d+l),f<0)return a;if(g=a.indexOf(k,d+l),g>d&&g<f)switch(h=a.charAt(f-1),i=parseInt(a.substring(g+m,f-1),10),h){case"d":case"i":case"u":j=e(c.toString(),i);break;case"x":j=e(c.toString(16),i);break;case"X":j=e(c.toString(16),i).toUpperCase();break;case"o":j=e(c.toString(8),i);break;default:return a}else j=c;a=a.substring(0,d)+j+a.substring(f+1)}}function h(a,b,c,d){var e,g,h,i;return g=c.segmentDuration,isNaN(g)&&(g=c.adaptation.period.duration),h=c.adaptation.period.start+d*g,i=h+g,e=new n.default,e.representation=c,e.duration=g,e.presentationStartTime=h,e.mediaStartTime=a.calcMediaTimeFromPresentationTime(e.presentationStartTime,c),e.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(e.presentationStartTime,c.adaptation.period.mpd,b),e.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(i,c.adaptation.period.mpd,b),e.wallStartTime=a.calcWallTimeForSegment(e,b),e.replacementNumber=f(e,d),e.availabilityIdx=d,e}function i(a,b,c,d,e,h,i,j,k){var l,m,o,p=d/h,q=Math.min(e/h,c.adaptation.period.mpd.maxSegmentDuration);return l=a.calcPresentationTimeFromMediaTime(p,c),m=l+q,o=new n.default,o.representation=c,o.duration=q,o.mediaStartTime=p,o.presentationStartTime=l,o.availabilityStartTime=c.adaptation.period.mpd.manifest.loadedTime,o.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(m,c.adaptation.period.mpd,b),o.wallStartTime=a.calcWallTimeForSegment(o,b),o.replacementTime=d,o.replacementNumber=f(o,k),i=g(i,"Number",o.replacementNumber),i=g(i,"Time",o.replacementTime),o.media=i,o.mediaRange=j,o.availabilityIdx=k,o}function j(a,b){if(!b||!b.segments)return null;var c,d,e=b.segments.length;if(a<e&&(c=b.segments[a],c&&c.availabilityIdx===a))return c;for(d=0;d<e;d++)if(c=b.segments[d],c&&c.availabilityIdx===a)return c;return null}function k(a,b,c,d,e){var f,g,h,i=2,j=e||10,k=0,l=Number.POSITIVE_INFINITY;return b&&!a.isTimeSyncCompleted()?h={start:k,end:l}:!b&&c||d<0?null:(f=Math.max(d-i,k),g=Math.min(d+j,l),h={start:f,end:g})}function l(a,b,c,d,e,f){var g,h,i,k=c.segmentDuration,l=c.adaptation.period.mpd.manifest.minBufferTime,m=c.segmentAvailabilityRange,n={start:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,m.start),end:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,m.end)},o=c.segments,p=2*k,q=f||Math.max(2*l,10*k),r=NaN,s=null;return n.start=Math.max(n.start,0),b&&!a.isTimeSyncCompleted()?(g=Math.floor(n.start/k),h=Math.floor(n.end/k),i={start:g,end:h}):(o&&o.length>0?(s=j(e,c),r=s?a.calcPeriodRelativeTimeFromMpdRelativeTime(c,s.presentationStartTime):e>0?e*k:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,d)):r=e>0?e*k:b?n.end:n.start,g=Math.floor(Math.max(r-p,n.start)/k),h=Math.floor(Math.min(g+q/k,n.end/k)),i={start:g,end:h})}Object.defineProperty(c,"__esModule",{value:!0}),c.replaceTokenForTemplate=g,c.getIndexBasedSegment=h,c.getTimeBasedSegment=i,c.getSegmentByIndex=j,c.decideSegmentListRangeForTimeline=k,c.decideSegmentListRangeForTemplate=l;var m=a(44),n=d(m)},{44:44}],34:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate,n=a.segmentDuration,o=a.segmentAvailabilityRange,p=[],q=null,r=null;for(l=a.startNumber,g=isNaN(n)&&!b?{start:l,end:l}:(0,h.decideSegmentListRangeForTemplate)(d,b,a,c,e,f),j=g.start,k=g.end,i=j;i<=k;i++)r=(0,h.getIndexBasedSegment)(d,b,a,i),r.replacementTime=(l+i-1)*a.segmentDuration,q=m.media,q=(0,h.replaceTokenForTemplate)(q,"Number",r.replacementNumber),q=(0,h.replaceTokenForTemplate)(q,"Time",r.replacementTime),r.media=q,p.push(r),r=null;return isNaN(n)?a.availableSegmentsNumber=1:a.availableSegmentsNumber=Math.ceil((o.end-o.start)/n),p}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(33);e.__dashjs_factory_name="TemplateSegmentsGetter";var i=g.default.getClassFactory(e);c.default=i,b.exports=c.default},{33:33,8:8}],35:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){z=0,A=!1,B=NaN,x.on(i.default.LIVE_EDGE_SEARCH_COMPLETED,s,this),x.on(i.default.TIME_SYNCHRONIZATION_COMPLETED,t,this)}function b(){return A}function c(a){A=a}function d(){return z}function e(){return B}function f(a){B=a}function h(a,b,c,d){var e=NaN;return e=d?c&&b.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(b.availabilityStartTime.getTime()+1e3*(a+b.timeShiftBufferDepth)):b.availabilityEndTime:c?new Date(b.availabilityStartTime.getTime()+1e3*(a-z)):b.availabilityStartTime}function j(a,b,c){return h.call(this,a,b,c)}function k(a,b,c){return h.call(this,a,b,c,!0)}function l(a,b){return(a.getTime()-b.mpd.availabilityStartTime.getTime()+1e3*z)/1e3}function m(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a+(c-d)}function n(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a-c+d}function o(a,b){var c,d,e;return b&&(c=a.representation.adaptation.period.mpd.suggestedPresentationDelay,d=a.presentationStartTime+c,e=new Date(a.availabilityStartTime.getTime()+1e3*d)),e}function p(a,b){var c,d,e=a.adaptation.period.start,f=e+a.adaptation.period.duration,g={start:e,end:f},h=a.segmentDuration||(a.segments&&a.segments.length?a.segments[a.segments.length-1].duration:0);if(!b)return g;if(!A&&a.segmentAvailabilityRange)return a.segmentAvailabilityRange;c=a.adaptation.period.mpd.checkTime,d=l(new Date,a.adaptation.period),e=Math.max(d-a.adaptation.period.mpd.timeShiftBufferDepth,a.adaptation.period.start);var i=isNaN(c)?d:Math.min(c,d),j=a.adaptation.period.start+a.adaptation.period.duration;return f=(i>=j&&i-h<j?j:i)-h,g={start:e,end:f}}function q(a,b){var c=a.adaptation.period.start;return b-c}function r(a,b){var c=a.adaptation.period.start;return b+c}function s(a){A||a.error||(z+=a.liveEdge-(B+a.searchTime),A=!0)}function t(a){A||a.error||(z=a.offset/1e3,A=!0)}function u(a){var b=a.presentationTimeOffset,c=a.adaptation.period.start;return c-b}function v(){x.off(i.default.LIVE_EDGE_SEARCH_COMPLETED,s,this),x.off(i.default.TIME_SYNCHRONIZATION_COMPLETED,t,this),z=0,A=!1,B=NaN}var w=this.context,x=(0,g.default)(w).getInstance(),y=void 0,z=void 0,A=void 0,B=void 0;return y={initialize:a,isTimeSyncCompleted:b,setTimeSyncCompleted:c,getClientTimeOff
44058set:d,getExpectedLiveEdge:e,setExpectedLiveEdge:f,calcAvailabilityStartTimeFromPresentationTime:j,calcAvailabilityEndTimeFromPresentationTime:k,calcPresentationTimeFromWallTime:l,calcPresentationTimeFromMediaTime:m,calcPeriodRelativeTimeFromMpdRelativeTime:q,calcMpdRelativeTimeFromPeriodRelativeTime:r,calcMediaTimeFromPresentationTime:n,calcSegmentAvailabilityRange:p,calcWallTimeForSegment:o,calcMSETimeOffset:u,reset:v}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j);e.__dashjs_factory_name="TimelineConverter",c.default=k.default.getSingletonFactory(e),b.exports=c.default},{11:11,7:7,8:8}],36:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m,n,o,p,q,r,s,t,u,v=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate||a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentList,w=v.SegmentTimeline,x=v.SegmentURL_asArray,y=a.availableSegmentsNumber>0,z=10,A=0,B=0,C=-1,D=[],E=!1,F=function(c,e){var f=v.media,g=c.mediaRange;return x&&(f=x[e].media||"",g=x[e].mediaRange),(0,h.getTimeBasedSegment)(d,b,a,A,c.d,u,f,g,C)};for(u=a.timescale,g=w.S_asArray,p=(0,h.decideSegmentListRangeForTimeline)(d,b,c,e,f),p?(s=p.start,t=p.end):r=d.calcMediaTimeFromPresentationTime(c||0,a),j=0,k=g.length;j<k;j++){if(i=g[j],m=0,i.hasOwnProperty("r")&&(m=i.r),i.hasOwnProperty("t")&&(A=i.t,B=A/u),m<0){if(o=g[j+1],o&&o.hasOwnProperty("t"))n=o.t/u;else{var G=a.segmentAvailabilityRange?a.segmentAvailabilityRange.end:d.calcSegmentAvailabilityRange(a,b).end;n=d.calcMediaTimeFromPresentationTime(G,a),a.segmentDuration=i.d/u}m=Math.ceil((n-B)/(i.d/u))-1}if(q){if(y)break;C+=m+1}else for(l=0;l<=m;l++){if(C++,p){if(C>t){if(q=!0,y)break;continue}C>=s&&D.push(F(i,C))}else{if(D.length>z){if(q=!0,y)break;continue}E?D.push(F(i,C)):B>=r-i.d/u*1.5&&(E=!0,D.push(F(i,C)))}A+=i.d,B=A/u}}return y||(a.availableSegmentsNumber=C+1),D}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(33);e.__dashjs_factory_name="TimelineSegmentsGetter";var i=g.default.getClassFactory(e);c.default=i,b.exports=c.default},{33:33,8:8}],37:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.period=null,this.index=-1,this.type=null};c.default=e,b.exports=c.default},{}],38:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=1,f=1,g=function a(b,c,g,h){d(this,a),this.url=b||"",this.serviceLocation=c||b||"",this.dvb_priority=g||e,this.dvb_weight=h||f};g.DEFAULT_DVB_PRIORITY=e,g.DEFAULT_DVB_WEIGHT=f,c.default=g,b.exports=c.default},{}],39:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN};c.default=e,b.exports=c.default},{}],40:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri=""};c.default=e,b.exports=c.default},{}],41:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.checkTime=NaN,this.clientServerTimeShift=0,this.isClientServerTimeSyncCompleted=!1};c.default=e,b.exports=c.default},{}],42:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};e.DEFAULT_ID="defaultId",c.default=e,b.exports=c.default},{}],43:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.maxPlayoutRate=NaN};c.default=e,b.exports=c.default},{}],44:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null};c.default=e,b.exports=c.default},{}],45:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.schemeIdUri="",this.value=""};c.default=e,b.exports=c.default},{}],46:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){n=(0,g.default)(h).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){var b=function(b){j.trigger(o.default.CHECK_FOR_EXISTENCE_COMPLETED,{request:a,exists:b})};if(a){var c=new i.default(a.url);n.load({request:c,success:function(){b(!0)},error:function(){b(!1)}})}else b(!1)}function d(a){var b=function(b,c){j.trigger(o.default.LOADING_COMPLETED,{request:a,response:b||null,error:c||null,sender:l})};a?n.load({request:a,progress:function(){j.trigger(o.default.LOADING_PROGRESS,{request:a})},success:function(a){b(a)},error:function(a,c,d){b(void 0,new k.default(r,d,c))}}):b(void 0,new k.default(s,t))}function e(){n&&n.abort()}function f(){n&&(n.abort(),n=null)}var h=this.context,j=(0,m.default)(h).getInstance(),l=void 0,n=void 0;return l={checkForExistence:c,load:d,abort:e,reset:f},b(),l}Object.defineProperty(c,"__esModule",{value:!0});var f=a(55),g=d(f),h=a(115),i=d(h),j=a(113),k=d(j),l=a(7),m=d(l),n=a(11),o=d(n),p=a(8),q=d(p),r=1,s=2,t="request is null";e.__dashjs_factory_name="FragmentLoader";var u=q.default.getClassFactory(e);u.FRAGMENT_LOADER_ERROR_LOADING_FAILURE=r,u.FRAGMENT_LOADER_ERROR_NULL_REQUEST=s,c.default=u,b.exports=c.default}
44058,{11:11,113:113,115:115,55:55,7:7,8:8}],47:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){h.on(t.default.XLINK_READY,c,n),q=(0,i.default)(f).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier}),s=(0,g.default)(f).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){h.trigger(t.default.INTERNAL_MANIFEST_LOADED,{manifest:a.manifest})}function d(a){var b=new m.default(a,p.HTTPRequest.MPD_TYPE);q.load({request:b,success:function(b,c,d){var e,f;d.responseURL&&d.responseURL!==a?(f=j.parseBaseUrl(d.responseURL),e=d.responseURL):(j.isRelative(a)&&(a=j.parseBaseUrl(window.location.href)+a),f=j.parseBaseUrl(a));var g=l.parse(b,s);g?(g.url=e||a,g.originalUrl||(g.originalUrl=g.url),g.baseUri=f,g.loadedTime=new Date,s.resolveManifestOnLoad(g)):h.trigger(t.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new o.default(w,y)})},error:function(b,c,d){h.trigger(t.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new o.default(x,"Failed loading manifest: "+a+", "+d)})}})}function e(){h.off(t.default.XLINK_READY,c,n),s&&(s.reset(),s=null),q&&(q.abort(),q=null)}var f=this.context,h=(0,r.default)(f).getInstance(),j=(0,k.default)(f).getInstance(),l=a.parser,n=void 0,q=void 0,s=void 0;return n={load:d,reset:e},b(),n}Object.defineProperty(c,"__esModule",{value:!0});var f=a(71),g=d(f),h=a(55),i=d(h),j=a(109),k=d(j),l=a(121),m=d(l),n=a(113),o=d(n),p=a(130),q=a(7),r=d(q),s=a(11),t=d(s),u=a(8),v=d(u),w=1,x=2,y="parsing failed";e.__dashjs_factory_name="ManifestLoader";var z=v.default.getClassFactory(e);z.MANIFEST_LOADER_ERROR_PARSING_FAILURE=w,z.MANIFEST_LOADER_ERROR_LOADING_FAILURE=x,c.default=z,b.exports=c.default},{109:109,11:11,113:113,121:121,130:130,55:55,7:7,71:71,8:8}],48:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){a&&(a.manifestModel&&(z=a.manifestModel),a.dashManifestModel&&(A=a.dashManifestModel))}function b(a){y=a,u=NaN,v=null,x=!1,w=!0,s.on(i.default.STREAMS_COMPOSED,p,this),s.on(i.default.PLAYBACK_STARTED,n,this),s.on(i.default.PLAYBACK_PAUSED,o,this),s.on(i.default.INTERNAL_MANIFEST_LOADED,l,this)}function c(a){j(a)}function d(){return y}function e(){s.off(i.default.PLAYBACK_STARTED,n,this),s.off(i.default.PLAYBACK_PAUSED,o,this),s.off(i.default.STREAMS_COMPOSED,p,this),s.off(i.default.INTERNAL_MANIFEST_LOADED,l,this),w=!0,x=!1,f(),u=NaN}function f(){null!==v&&(clearInterval(v),v=null)}function h(){f(),isNaN(u)||(r("Refresh manifest in "+u+" seconds."),v=setTimeout(k,Math.min(1e3*u,Math.pow(2,31)-1),this))}function j(a){var b,c,d=new Date;z.setValue(a),r("Manifest has been refreshed at "+d+"["+d.getTime()/1e3+"] "),b=A.getRefreshDelay(a),c=((new Date).getTime()-a.loadedTime.getTime())/1e3,u=Math.max(b-c,0),s.trigger(i.default.MANIFEST_UPDATED,{manifest:a}),w||h()}function k(){var a,b;if(!w&&!x){x=!0,a=z.getValue(),b=a.url;var c=A.getLocation(a);c&&(b=c),y.load(b)}}function l(a){a.error||j(a.manifest)}function n(){w=!1,h()}function o(){w=!0,f()}function p(){x=!1}var q=this.context,r=(0,m.default)(q).getInstance().log,s=(0,g.default)(q).getInstance(),t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0;return t={initialize:b,setManifest:c,getManifestLoader:d,setConfig:a,reset:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j),l=a(6),m=d(l);e.__dashjs_factory_name="ManifestUpdater",c.default=k.default.getSingletonFactory(e),b.exports=c.default},{11:11,6:6,7:7,8:8}],49:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){_b=!1,ac=!1,bc=!0,ec=null,$b=null,gc=null,ea.default.extend(ga.default),ic=(0,I.default)(Ub).getInstance()}function b(a,b,c){return kc=(0,u.default)(Ub).getInstance(),jc=(0,s.default)(Ub).getInstance(),kc.supportsMediaSource()?void(_b||(_b=!0,cc=(0,M.default)(Ub).getInstance(),nc=(0,i.default)(Ub).getInstance(),dc=(0,m.default)(Ub).getInstance(),dc.initialize(),pc=(0,pa.default)(Ub).getInstance(),oc=(0,ra.default)(Ub).getInstance(),hc=(0,K.default)(Ub).getInstance(),hc.setConfig({adapter:Jb()}),db(),oa(void 0===c||c),a&&zb(a),b&&Db(b),Xb("[dash.js "+R()+"] MediaPlayer has been initialized"))):void jc.capabilityError("mediasource")}function c(){return!!qc&&!!Zb}function d(){if(!ac)throw Qb;(!bc||f()&&ac)&&nc.play()}function e(){if(!ac)throw Qb;nc.pause()}function f(){if(!ac)throw Qb;return nc.isPaused()}function h(){if(!ac)throw Qb;return nc.isSeeking()}function j(a){if(!qc)throw Rb;yb().muted=a}function l(){if(!qc)throw Rb;
44058return yb().muted}function n(a){if(!qc)throw Rb;yb().volume=a}function p(){if(!qc)throw Rb;return yb().volume}function r(a){var b=["video","audio","fragmentedText"];if(a){if(b.indexOf(a)!==-1){var c=va().getCurrentBufferLevel(wa(a));return c?c:NaN}return Xb("Warning - getBufferLength requested for invalid type"), 44059NaN}return b.map(function(a){return Ka(a).length>0?va().getCurrentBufferLevel(wa(a)):Number.MAX_VALUE}).reduce(function(a,b){return Math.min(a,b)})}function t(){var a=Mb();return a?a.manifestInfo.DVRWindowSize:0}function v(a){var b=Mb();if(!b)return 0;var c=b.range.start+a;return c>b.range.end&&(c=b.range.end),c}function x(a){if(!ac)throw Qb;var b=nc.getIsDynamic()?v(a):a;nc.seek(b)}function z(a){if(!ac)throw Qb;var b=yb().currentTime;if(void 0!==a)b=lc.getTimeRelativeToStreamId(b,a);else if(nc.getIsDynamic()){var c=Mb();b=null===c?0:B()-(c.range.end-c.time)}return b}function B(){if(!ac)throw Qb;var a=yb().duration;if(nc.getIsDynamic()){var b,c=Mb();if(!c)return 0;b=c.range.end-c.range.start,a=b<c.manifestInfo.DVRWindowSize?b:c.manifestInfo.DVRWindowSize}return a}function D(){if(!ac)throw Qb;return z()<0?NaN:Nb(z())}function F(){if(!ac)throw Qb;return Nb(B())}function H(a,b,c){var d=new Date(1e3*a),e=d.toLocaleDateString(b),f=d.toLocaleTimeString(b,{hour12:c});return f+" "+e}function J(a){a=Math.max(a,0);var b=Math.floor(a/3600),c=Math.floor(a%3600/60),d=Math.floor(a%3600%60);return(0===b?"":b<10?"0"+b.toString()+":":b.toString()+":")+(c<10?"0"+c.toString():c.toString())+":"+(d<10?"0"+d.toString():d.toString())}function L(a,b,c){ia.default.extend(a,b,c,Ub)}function N(a,b,c){Vb.on(a,b,c)}function P(a,b,c){Vb.off(a,b,c)}function R(){return(0,ja.getVersionString)()}function T(){return Wb}function V(){if(!qc)throw Rb;return qc}function X(a){ic.setLiveDelayFragmentCount(a)}function Z(a){ic.setLiveDelay(a)}function _(a){ic.setUseSuggestedPresentationDelay(a)}function ba(a,b){ic.setLastBitrateCachingInfo(a,b)}function da(a,b){ic.setLastMediaSettingsCachingInfo(a,b)}function fa(a,b){cc.setMaxAllowedBitrateFor(a,b)}function ha(a){return cc.getMaxAllowedBitrateFor(a)}function ka(a,b){cc.setMaxAllowedRepresentationRatioFor(a,b)}function ma(a){return cc.getMaxAllowedRepresentationRatioFor(a)}function oa(a){bc=a}function qa(){return bc}function sa(a){ic.setScheduleWhilePaused(a)}function ua(){return ic.getScheduleWhilePaused()}function va(){return oc}function wa(a){return hc.getReadOnlyMetricsFor(a)}function xa(a){if(!ac)throw Qb;return cc.getQualityFor(a,lc.getActiveStreamInfo())}function ya(a,b){if(!ac)throw Qb;cc.setPlaybackQuality(a,lc.getActiveStreamInfo(),b)}function za(){return cc.getLimitBitrateByPortal()}function Aa(a){cc.setLimitBitrateByPortal(a)}function Ba(){return cc.getUsePixelRatioInLimitBitrateByPortal()}function Ca(a){cc.setUsePixelRatioInLimitBitrateByPortal(a)}function Da(a){if(!ac)throw Qb;void 0===rc&&(rc=(0,C.default)(Ub).getInstance());for(var b=yb().textTracks,c=b.length,d=0;d<c;d++){var e=b[d],f=a===d?"showing":"hidden";e.mode!==f&&(e.mode=f)}rc.setTextTrack()}function Ea(a){if(!ac)throw Qb;var b=Ob();return b?b.getBitrateListFor(a):[]}function Fa(a,b){cc.setInitialBitrateFor(a,b)}function Ga(a){if(!ac)throw Qb;return cc.getInitialBitrateFor(a)}function Ha(a,b){cc.setInitialRepresentationRatioFor(a,b)}function Ia(a){return cc.getInitialRepresentationRatioFor(a)}function Ja(a){if(!ac)throw Qb;return gc.getStreamsInfo(a)}function Ka(a){if(!ac)throw Qb;var b=lc.getActiveStreamInfo();return b?dc.getTracksFor(a,b):[]}function La(a,b,c){if(!ac)throw Qb;return c=c||gc.getStreamsInfo(b)[0],c?gc.getAllMediaInfoForType(b,c,a):[]}function Ma(a){if(!ac)throw Qb;var b=lc.getActiveStreamInfo();return b?dc.getCurrentTrackFor(a,b):null}function Na(a,b){dc.setInitialSettings(a,b)}function Oa(a){return dc.getInitialSettings(a)}function Pa(a){if(!ac)throw Qb;dc.setTrack(a)}function Qa(a){return dc.getSwitchMode(a)}function Ra(a,b){dc.setSwitchMode(a,b)}function Sa(a){dc.setSelectionModeForInitialTrack(a)}function Ta(){return dc.getSelectionModeForInitialTrack()}function Ua(){return cc.getAutoSwitchBitrateFor("video")||cc.getAutoSwitchBitrateFor("audio")}function Va(a){cc.setAutoSwitchBitrateFor("video",a),cc.setAutoSwitchBitrateFor("audio",a)}function Wa(a){return cc.getAutoSwitchBitrateFor(a)}function Xa(a,b){cc.setAutoSwitchBitrateFor(a,b)}function Ya(a){ic.setFastSwitchEnabled(a)}function Za(){return ic.getFastSwitchEnabled()}function $a(a){ic.setBufferOccupancyABREnabled(a)}function _a(a,b){var c=Hb(),d=this,e=function a(e){e.error?b(null,e.error):b(e.manifest),Vb.off(ea.default.INTERNAL_MANIFEST_LOADED,a,d),c.reset()};Vb.on(ea.default.INTERNAL_MANIFEST_LOADED,e,d);var f=(0,E.default)(Ub).getInstance();f.initialize(),c.load(f.parseURI(a))}function ab(a,b){bb(a,b);var c=new g.default;c.schemeIdUri=a,c.value=b,ic.getUTCTimingSources().push(c)}function bb(a,b){var c=ic.getUTCTimingSources();
44059c.forEach(function(d,e){d.schemeIdUri===a&&d.value===b&&c.splice(e,1)})}function cb(){ic.setUTCTimingSources([])}function db(){ab(I.default.DEFAULT_UTC_TIMING_SOURCE.scheme,I.default.DEFAULT_UTC_TIMING_SOURCE.value)}function eb(a){ic.setUseManifestDateHeaderTimeSource(a)}function fb(a){ic.setBufferToKeep(a)}function gb(a){ic.setBufferPruningInterval(a)}function hb(a){ic.setStableBufferTime(a)}function ib(a){ic.setBufferTimeAtTopQuality(a)}function jb(a){ic.setBufferTimeAtTopQualityLongForm(a)}function kb(a){ic.setLongFormContentDurationThreshold(a)}function lb(a){ic.setRichBufferThreshold(a)}function mb(a){ic.setBandwidthSafetyFactor(a)}function nb(){return ic.getBandwidthSafetyFactor()}function ob(a){ic.setAbandonLoadTimeout(a)}function pb(a){ic.setFragmentRetryAttempts(a)}function qb(a){ic.setFragmentRetryInterval(a)}function rb(a){ic.setXHRWithCredentials(a)}function sb(){return Kb()}function tb(a){ec=a}function ub(a){$b=a}function vb(a){var b=(0,w.default)(Ub).getInstance();b.setConfig({videoModel:qc}),b.initialize(),b.displayCConTop(a)}function wb(){return qc?qc.getVideoContainer():null}function xb(a){if(!qc)throw Rb;qc.setVideoContainer(a)}function yb(){if(!qc)throw Rb;return qc.getElement()}function zb(a){if(!_b)throw Tb;qc=null,a&&(qc=(0,S.default)(Ub).getInstance(),qc.initialize(),qc.setElement(a),Kb(),Lb()),Fb()}function Ab(){return qc?qc.getTTMLRenderingDiv():null}function Bb(a){if(!qc)throw Rb;qc.setTTMLRenderingDiv(a)}function Cb(){if(!Zb)throw Sb;return Zb}function Db(a){if(!_b)throw Tb;if("string"==typeof a){var b=(0,E.default)(Ub).getInstance();b.initialize(),Zb=b.parseURI(a)}else Zb=a;Fb()}function Eb(){Db(null),zb(null),$b=null,ec=null}function Fb(){ac?(ac=!1,gc.reset(),lc.reset(),nc.reset(),cc.reset(),mc.reset(),dc.reset(),lc=null,fc=null,c()&&Pb()):c()&&Pb()}function Gb(){var a=(0,W.default)(Ub).getInstance();a.initialize();var b=(0,Q.default)(Ub).getInstance();b.initialize();var c=(0,y.default)(Ub).getInstance();c.setConfig({dashManifestModel:pc}),dc.initialize(),dc.setConfig({errHandler:jc}),mc=(0,U.default)(Ub).getInstance(),mc.initialize(),mc.setConfig({abrRulesCollection:b,synchronizationRulesCollection:a}),lc=(0,k.default)(Ub).getInstance(),lc.setConfig({capabilities:kc,manifestLoader:Hb(),manifestModel:(0,G.default)(Ub).getInstance(),dashManifestModel:pc,protectionController:ec,adapter:gc,metricsModel:hc,dashMetrics:oc,liveEdgeFinder:(0,q.default)(Ub).getInstance(),mediaSourceController:(0,Y.default)(Ub).getInstance(),timeSyncController:(0,O.default)(Ub).getInstance(),baseURLController:(0,$.default)(Ub).getInstance(),errHandler:jc,timelineConverter:(0,ta.default)(Ub).getInstance()}),lc.initialize(bc,$b),cc.setConfig({abrRulesCollection:b,rulesController:mc,streamController:lc})}function Hb(){return(0,o.default)(Ub).create({errHandler:jc,parser:Ib(),metricsModel:hc,requestModifier:(0,A.default)(Ub).getInstance()})}function Ib(){return(0,na.default)(Ub).create()}function Jb(){return gc=(0,la.default)(Ub).getInstance(),gc.initialize(),gc.setConfig({dashManifestModel:pc}),gc}function Kb(){if(ec)return ec;var a=dashjs.Protection;if("function"==typeof a){var b=a(Ub).create();return ea.default.extend(a.events),ga.default.extend(a.events,{publicOnly:!0}),ec=b.createProtectionSystem({log:Xb,videoModel:qc,capabilities:kc,eventBus:Vb,adapter:gc})}return null}function Lb(){if(fc)return fc;var a=dashjs.MetricsReporting;if("function"==typeof a){var b=a(Ub).create();return fc=b.createMetricsReporting({log:Xb,eventBus:Vb,mediaElement:yb(),dashManifestModel:pc,metricsModel:hc})}return null}function Mb(){var a=hc.getReadOnlyMetricsFor("video")||hc.getReadOnlyMetricsFor("audio");return oc.getCurrentDVRInfo(a)}function Nb(a){var b,c,d=Mb();return d?(b=d.manifestInfo.availableFrom.getTime()/1e3,c=a+(b+d.range.start)):0}function Ob(){if(!ac)throw Qb;var a=lc.getActiveStreamInfo();return a?lc.getStreamById(a.id):null}function Pb(){ac||(ac=!0,Xb("Playback Initialized"),Gb(),"string"==typeof Zb?lc.load(Zb):lc.loadWithManifest(Zb))}var Qb="You must first call play() to init playback before calling this method",Rb="You must first call attachView() to set the video element before calling this method",Sb="You must first call attachSource() with a valid source before calling this method",Tb="MediaPlayer not initialized!",Ub=this.context,Vb=(0,ca.default)(Ub).getInstance(),Wb=(0,aa.default)(Ub).getInstance(),Xb=Wb.log,Yb=void 0,Zb=void 0,$b=void 0,_b=void 0,ac=void 0,bc=void 0,cc=void 0,dc=void 0,ec=void 0,fc=void 0,gc=void 0,hc=void 0,ic=void 0,jc=void 0,kc=void 0,lc=void 0,mc=void 0,nc=void 0,oc=void 0,pc=void 0,qc=void 0,rc=void 0;return Yb={initialize:b,on:N,off:P,extend:L,attachView:zb,attachSource:Db,isReady:c,play:d,isPaused:f,pause:e,isSeeking:h,seek:x,setMute:j,isMuted:l,setVolume:n,getVolume:p,time:z,duration:B,timeAsUTC:D,durationAsUTC:F,getActiveStream:Ob,getDVRWindowSize:t,getDVRSeekOffset:v,convertToTimeCode:J,formatUTC:H,getVersion:R,getDebug:T,getBufferLength:r,getVideoModel:V,getVideoContainer:wb,getTTMLRenderingDiv:Ab,getVideoElement:yb,getSource:Cb,setLiveDelayFragmentCount:X,setLiveDelay:Z,useSuggestedPresentationDelay:_,enableLastBitrateCaching:ba,enableLastMediaSettingsCaching:da,setMaxAllowedBitrateFor:fa,getMaxAllowedBitrateFor:ha,setMaxAllowedRepresentationRatioFor:ka,getMaxAllowedRepresentationRatioFor:ma,setAutoPlay:oa,getAutoPlay:qa,setScheduleWhilePaused:sa,getScheduleWhilePaused:ua,getDashMetrics:va,getMetricsFor:wa,getQualityFor:xa,setQualityFor:ya,getLimitBitrateByPortal:za,setLimitBitrateByPortal:Aa,getUsePixelRatioInLimitBitrateByPortal:Ba,setUsePixelRatioInLimitBitrateByPortal:Ca,setTextTrack:Da,getBitrateInfoListFor:Ea,setInitialBitrateFor:Fa,getInitialBitrateFor:Ga,setInitialRepresentationRatioFor:Ha,getInitialRepresentationRatioFor:Ia,getStreamsFromManifest:Ja,getTracksFor:Ka,getTracksForTypeFromManifest:La,getCurrentTrackFor:Ma,setInitialMediaSettingsFor:Na,getInitialMediaSettingsFor:Oa,setCurrentTrack:Pa,getTrackSwitchModeFor:Qa,setTrackSwitchModeFor:Ra,setSelectionModeForInitialTrack:Sa,getSelectionModeForInitialTrack:Ta,getAutoSwitchQuality:Ua,setAutoSwitchQuality:Va,setFastSwitchEnabled:Ya,getFastSwitchEnabled:Za,getAutoSwitchQualityFor:Wa,setAutoSwitchQualityFor:Xa,enableBufferOccupancyABR:$a,setBandwidthSafetyFactor:mb,getBandwidthSafetyFactor:nb,setAbandonLoadTimeout:ob,retrieveManifest:_a,addUTCTimingSource:ab,removeUTCTimingSource:bb,clearDefaultUTCTimingSources:cb,restoreDefaultUTCTimingSources:db,setBufferToKeep:fb,setBufferPruningInterval:gb,setStableBufferTime:hb,setBufferTimeAtTopQuality:ib,setFragmentLoaderRetryAttempts:pb,setFragmentLoaderRetryInterval:qb,setXHRWithCredentials:rb,setBufferTimeAtTopQualityLongForm:jb,setLongFormContentDurationThreshold:kb,setRichBufferThreshold:lb,getProtectionController:sb,attachProtectionController:tb,setProtectionData:ub,enableManifestDateHeaderTimeSource:eb,dis
44059playCaptionsOnTop:vb,attachVideoContainer:xb,attachTTMLRenderingDiv:Bb,reset:Eb},a(),Yb}Object.defineProperty(c,"__esModule",{value:!0});var f=a(45),g=d(f),h=a(65),i=d(h),j=a(68),k=d(j),l=a(63),m=d(l),n=a(47),o=d(n),p=a(105),q=d(p),r=a(102),s=d(r),t=a(98),u=d(t),v=a(54),w=d(v),x=a(67),y=d(x),z=a(107),A=d(z),B=a(53),C=d(B),D=a(77),E=d(D),F=a(74),G=d(F),H=a(75),I=d(H),J=a(76),K=d(J),L=a(57),M=d(L),N=a(70),O=d(N),P=a(82),Q=d(P),R=a(78),S=d(R),T=a(80),U=d(T),V=a(95),W=d(V),X=a(64),Y=d(X),Z=a(58),$=d(Z),_=a(6),aa=d(_),ba=a(7),ca=d(ba),da=a(11),ea=d(da),fa=a(50),ga=d(fa),ha=a(8),ia=d(ha),ja=a(9),ka=a(13),la=d(ka),ma=a(21),na=d(ma),oa=a(20),pa=d(oa),qa=a(15),ra=d(qa),sa=a(35),ta=d(sa);e.__dashjs_factory_name="MediaPlayer";var ua=ia.default.getClassFactory(e);ua.events=ga.default,c.default=ua,b.exports=c.default},{102:102,105:105,107:107,11:11,13:13,15:15,20:20,21:21,35:35,45:45,47:47,50:50,53:53,54:54,57:57,58:58,6:6,63:63,64:64,65:65,67:67,68:68,7:7,70:70,74:74,75:75,76:76,77:77,78:78,8:8,80:80,82:82,9:9,95:95,98:98}],50:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(12),i=d(h),j=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.BUFFER_EMPTY="bufferstalled",this.BUFFER_LOADED="bufferloaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.ERROR="error",this.LOG="log",this.MANIFEST_LOADED="manifestloaded",this.METRICS_CHANGED="metricschanged",this.METRIC_CHANGED="metricchanged",this.METRIC_ADDED="metricadded",this.METRIC_UPDATED="metricupdated",this.PERIOD_SWITCH_COMPLETED="streamswitchcompleted",this.PERIOD_SWITCH_STARTED="streamswitchstarted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.STREAM_INITIALIZED="streaminitialized",this.TEXT_TRACKS_ADDED="alltexttracksadded",this.TEXT_TRACK_ADDED="texttrackadded",this.CAN_PLAY="canPlay",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated"}return f(b,a),b}(i.default),k=new j;c.default=k,b.exports=c.default},{12:12}],51:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){ja=[],ka=!1,la=!1,ma=null,na={},oa=!1,pa=!1,ra=(0,g.default)($).getInstance(),sa=(0,w.default)($).getInstance(),wa=(0,q.default)($).getInstance(),ta=(0,k.default)($).getInstance(),ua=(0,o.default)($).create(),xa=(0,O.default)($).getInstance(),aa.on(I.default.BUFFERING_COMPLETED,U,ia),aa.on(I.default.DATA_UPDATE_COMPLETED,V,ia)}function c(a,b){ma=a,qa=b,qa&&(aa.on(I.default.KEY_ERROR,D,ia),aa.on(I.default.SERVER_CERTIFICATE_UPDATED,D,ia),aa.on(I.default.LICENSE_REQUEST_COMPLETE,D,ia),aa.on(I.default.KEY_SYSTEM_SELECTED,D,ia),aa.on(I.default.KEY_SESSION_CREATED,D,ia))}function d(a){ka?T():(aa.on(I.default.CURRENT_TRACK_CHANGED,J,ia),Q(a))}function e(){for(var a=ja.length,b=0;b<a;b++)ja[b].reset();ja=[],ka=!1,la=!1,x(),aa.off(I.default.CURRENT_TRACK_CHANGED,J,ia)}function f(){sa&&(sa.pause(),sa=null),ua&&(ua.reset(),ua=null),ra.abort
44059Search(),e(),ta=null,wa=null,ca=null,ba=null,da=null,ea=null,_=null,fa=null,oa=!1,pa=!1,na={},aa.off(I.default.DATA_UPDATE_COMPLETED,V,ia),aa.off(I.default.BUFFERING_COMPLETED,U,ia),aa.off(I.default.KEY_ERROR,D,ia),aa.off(I.default.SERVER_CERTIFICATE_UPDATED,D,ia),aa.off(I.default.LICENSE_REQUEST_COMPLETE,D,ia),aa.off(I.default.KEY_SYSTEM_SELECTED,D,ia),aa.off(I.default.KEY_SESSION_CREATED,D,ia)}function h(){return ma.duration}function j(){return ma.start}function l(){return ma.index}function n(){return ma.id}function p(){return ma}function r(a){return null!==S(a)}function t(a){var b=S(a);return wa.getBitrateList(b)}function v(){va&&va.start()}function x(){va&&va.clear()}function z(){return ka}function B(){return pa}function D(a){a.error&&(fa.mediaKeySessionError(a.error),_(a.error),f())}function F(a){return"text"===a.type?a.mimeType:a.type}function H(a,b,c){var d,e,f=a.type;if("muxed"===f&&a)return e="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",_(e),fa.manifestError(e,"multiplexedrep",ba.getValue()),!1;if("text"===f||"fragmentedText"===f||"embeddedText"===f)return!0;if(d=a.codec,_(f+" codec: "+d),a.contentProtection&&!ea.supportsEncryptedMedia())fa.capabilityError("encryptedmedia");else if(!ea.supportsCodec((0,s.default)($).getInstance().getElement(),d))return e=f+"Codec ("+d+") is not supported.",fa.manifestError(e,"codec",c),_(e),!1;return!0}function J(a){if(a.newMediaInfo.streamInfo.id===ma.id){var b=W(a.oldMediaInfo);if(b){var c=sa.getTime(),d=b.getBuffer(),e=a.newMediaInfo,f=ba.getValue(),g=ja.indexOf(b),h=b.getMediaSource();"fragmentedText"!==e.type?(b.reset(!0),N(e,f,h,{buffer:d,replaceIdx:g,currentTime:c}),sa.seek(sa.getTime())):b.updateMediaInfo(f,e)}}}function L(a){var b=a.split("/")[1];return"webm"===b.toLowerCase()}function M(a){var b=L(a.mimeType)?(0,C.default)($).getInstance():(0,A.default)($).getInstance();b.setConfig({baseURLController:ha,metricsModel:(0,u.default)($).getInstance()}),b.initialize();var c=(0,y.default)($).create({segmentBaseLoader:b,timelineConverter:ga,dashMetrics:(0,E.default)($).getInstance(),metricsModel:(0,u.default)($).getInstance(),baseURLController:ha});return c}function N(a,b,c,d){var e=(0,i.default)($).create({indexHandler:M(a),timelineConverter:ga,adapter:da,manifestModel:ba}),f=da.getAllMediaInfoForType(b,ma,a.type);if(e.initialize(F(a),ua,c,ia,va),wa.updateTopQualityIndex(a),d?(e.setBuffer(d.buffer),e.getIndexHandler().setCurrentTime(d.currentTime),ja[d.replaceIdx]=e):ja.push(e),"text"===a.type||"fragmentedText"===a.type){for(var g,h=0;h<f.length;h++)f[h].index===a.index&&(g=h),e.updateMediaInfo(b,f[h]);"fragmentedText"===a.type&&e.updateMediaInfo(b,f[g])}else e.updateMediaInfo(b,a);return e}function P(a,b){var c,d=ba.getValue(),e=da.getAllMediaInfoForType(d,ma,a),f=null;if(!e||0===e.length)return void _("No "+a+" data.");for(var g=0,h=e.length;g<h;g++)if(f=e[g],"embeddedText"===a)xa.addEmbeddedTrack(f);else{if(!H(f,b,d))continue;ta.isMultiTrackSupportedByType(f.type)&&ta.addTrack(f,ma)}"embeddedText"!==a&&0!==ta.getTracksFor(a,ma).length&&(ta.checkInitialMediaSettingsForType(a,ma),c=ta.getCurrentTrackFor(a,ma),N(c,d,b))}function Q(a){var b,c=ba.getValue();if(va=(0,m.default)($).getInstance(),va.initialize(),va.setConfig({manifestModel:ba,manifestUpdater:ca}),b=da.getEventsFor(c,ma),va.addInlineEvents(b),oa=!0,P("video",a),P("audio",a),P("text",a),P("fragmentedText",a),P("embeddedText",a),P("muxed",a),T(),la=!0,oa=!1,0===ja.length){var d="No streams to play.";fa.manifestError(d,"nostreams",c),_(d)}else ra.initialize(ga,ja[0]),R()}function R(){var a=ja.length,b=!!na.audio||!!na.video,c=b?new Error(Z,"Data update failed",null):null,d=0;for(d;d<a;d++)if(ja[d].isUpdating()||oa)return;pa=!0,ka=!0,la&&(qa&&qa.initialize(ba.getValue(),S("audio"),S("video")),aa.trigger(I.default.STREAM_INITIALIZED,{streamInfo:ma,error:c}))}function S(a){for(var b=ja.length,c=null,d=0;d<b;d++)if(c=ja[d],c.getType()===a)return c.getMediaInfo();return null}function T(){for(var a=0,b=ja.length;a<b;a++)ja[a].createBuffer()}function U(a){if(a.streamInfo===ma){var b=X(),c=b.length,d=0;for(d;d<c;d++)if(!b[d].isBufferingCompleted())return;aa.trigger(I.default.STREAM_BUFFERING_COMPLETED,{streamInfo:ma})}}function V(a){var b=a.sender.getStreamProcessor();b.getStreamInfo()===ma&&(na[b.getType()]=a.error,R())}function W(a){if(!a)return!1;var b=X();
44059return b.filter(function(b){return b.getType()===a.type})[0]}function X(){var a,b,c=ja.length,d=[],e=0;for(e;e<c;e++)b=ja[e],a=b.getType(),"audio"!==a&&"video"!==a&&"fragmentedText"!==a||d.push(b);return d}function Y(a){_("Manifest updated... updating data system wide.");var b=ba.getValue();if(ka=!1,oa=!0,pa=!1,ma=a,va){var c=da.getEventsFor(b,ma);va.addInlineEvents(c)}for(var d=0,e=ja.length;d<e;d++){var f=ja[d],g=da.getMediaInfoForType(b,ma,f.getType());wa.updateTopQualityIndex(g),f.updateMediaInfo(b,g)}oa=!1,R()}var Z=1,$=this.context,_=(0,K.default)($).getInstance().log,aa=(0,G.default)($).getInstance(),ba=a.manifestModel,ca=a.manifestUpdater,da=a.adapter,ea=a.capabilities,fa=a.errHandler,ga=a.timelineConverter,ha=a.baseURLController,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0;return ia={initialize:c,activate:d,deactivate:e,getDuration:h,getStartTime:j,getStreamIndex:l,getId:n,getStreamInfo:p,hasMedia:r,getBitrateListFor:t,startEventController:v,isActivated:z,isInitialized:B,updateData:Y,reset:f,getProcessors:X},b(),ia}Object.defineProperty(c,"__esModule",{value:!0});var f=a(105),g=d(f),h=a(52),i=d(h),j=a(63),k=d(j),l=a(61),m=d(l),n=a(62),o=d(n),p=a(57),q=d(p),r=a(78),s=d(r),t=a(76),u=d(t),v=a(65),w=d(v),x=a(14),y=d(x),z=a(16),A=d(z),B=a(17),C=d(B),D=a(15),E=d(D),F=a(7),G=d(F),H=a(11),I=d(H),J=a(6),K=d(J),L=a(8),M=d(L),N=a(53),O=d(N);e.__dashjs_factory_name="Stream",c.default=M.default.getClassFactory(e),b.exports=c.default},{105:105,11:11,14:14,15:15,16:16,17:17,52:52,53:53,57:57,6:6,61:61,62:62,63:63,65:65,7:7,76:76,78:78,8:8}],52:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){ca=[]}function c(a,b,c,d,e){ba=a,da=d,ea=e,ja=b,_=da.getStreamInfo().manifestInfo.isDynamic,W.initialize(this),fa=(0,g.default)(V).getInstance(),fa.initialize(ba,this),ga=U(a),ha=(0,q.default)(V).create({metricsModel:(0,w.default)(V).getInstance(),manifestModel:Z,adapter:Y,dashMetrics:(0,I.default)(V).getInstance(),dashManifestModel:(0,G.default)(V).getInstance(),timelineConverter:X,rulesController:(0,s.default)(V).getInstance(),mediaPlayerModel:(0,u.default)(V).getInstance()}),ga.initialize(ba,c,this),ha.initialize(ba,this),ka=(0,y.default)(V).create({metricsModel:(0,w.default)(V).getInstance(),errHandler:(0,M.default)(V).getInstance(),requestModifier:(0,A.default)(V).getInstance()}),la=ha.getFragmentModel(),la.setLoader(ka),ia=(0,K.default)(V).create(),ia.initialize(this)}function d(a){W.reset(),ga&&(ga.reset(a),ga=null),ha&&(ha.reset(),ha=null),ia&&(ia.reset(),ia=null),ja=null,ka=null,ea=null,da=null,_=null,aa=null,ca=[],ba=null}function e(){return ia.isUpdating()}function f(){return ba}function h(){return fa}function j(){return ia}function l(){return ka}function n(){return W}function p(){return ja}function r(){return ga.getBuffer()}function t(a){ga.setBuffer(a)}function v(){return ga}function x(){return la}function z(){return da.getStreamInfo()}function B(a,b){b===aa||b&&aa&&b.type!==aa.type||(aa=b),ca.indexOf(b)===-1&&ca.push(b),Y.updateData(a,this)}function D(){return ca}function F(){return aa}function H(){return ga.getMediaSource()}function J(){return ha}function L(){return ea}function N(){ha.start()}function O(){ha.stop()}function P(){return Y.getCurrentRepresentationInfo(Z.getValue(),ia)}function Q(a){return Y.getRepresentationInfoForQuality(Z.getValue(),ia,a)}function R(){return ga.getIsBufferingCompleted()}function S(){return ga.getBuffer()||ga.createBuffer(aa)}function T(){return _}function U(a){var b=null;return b="video"===a||"audio"===a||"fragmentedText"===a?(0,i.default)(V).create({metricsModel:(0,w.default)(V).getInstance(),manifestModel:Z,sourceBufferController:(0,C.default)(V).getInstance(),errHandler:(0,M.default)(V).getInstance(),streamController:(0,k.default)(V).getInstance(),mediaController:(0,m.default)(V).getInstance(),adapter:Y,textSourceBuffer:(0,E.default)(V).getInstance()}):(0,o.default)(V).create({errHandler:(0,M.default)(V).getInstance(),sourceBufferController:(0,C.default)(V).getInstance()})}var V=this.context,W=a.indexHandler,X=a.timelineConverter,Y=a.adapter,Z=a.manifestModel,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0;return $={initialize:c,isUpdating:e,getType:f,getBufferController:v,getABRController:h,getFragmentLoader:l,getFragmentModel:x,getScheduleController:J,getEventC
44059ontroller:L,getFragmentController:p,getRepresentationController:j,getIndexHandler:n,getCurrentRepresentationInfo:P,getRepresentationInfoForQuality:Q,isBufferingCompleted:R,createBuffer:S,getStreamInfo:z,updateMediaInfo:B,getMediaInfoArr:D,getMediaInfo:F,getMediaSource:H,getBuffer:r,setBuffer:t,start:N,stop:O,isDynamic:T,reset:d},b(),$}Object.defineProperty(c,"__esModule",{value:!0});var f=a(57),g=d(f),h=a(60),i=d(h),j=a(68),k=d(j),l=a(63),m=d(l),n=a(69),o=d(n),p=a(66),q=d(p),r=a(80),s=d(r),t=a(75),u=d(t),v=a(76),w=d(v),x=a(46),y=d(x),z=a(107),A=d(z),B=a(67),C=d(B),D=a(53),E=d(D),F=a(20),G=d(F),H=a(15),I=d(H),J=a(19),K=d(J),L=a(102),M=d(L),N=a(8),O=d(N);e.__dashjs_factory_name="StreamProcessor",c.default=O.default.getClassFactory(e),b.exports=c.default},{102:102,107:107,15:15,19:19,20:20,46:46,53:53,57:57,60:60,63:63,66:66,67:67,68:68,69:69,75:75,76:76,8:8,80:80}],53:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,c){M=!1,N=null,U=null,V=!1,W=NaN,X=[],$=null,E||b();var d=c.getStreamProcessor();if(R=d.getMediaInfoArr(),S.setConfig({videoModel:Y}),S.initialize(),T=!K.getIsTextTrack(a),H=(0,k.default)(C).getInstance(),Q=(0,i.default)(C).getInstance(),Q.setConfig({boxParser:H}),T){U=d.getFragmentModel(),this.buffered=(0,m.default)(C).create(),X=L.getTracksFor("fragmentedText",Z.getActiveStreamInfo());for(var e=L.getCurrentTrackFor("fragmentedText",Z.getActiveStreamInfo()),f=0;f<X.length;f++)if(X[f]===e){_=f;break}}}function b(){aa=[],R=[],Y=(0,s.default)(C).getInstance(),S=(0,u.default)(C).getInstance(),S.setConfig({videoModel:Y}),S.initialize(),H=(0,k.default)(C).getInstance(),Q=(0,i.default)(C).getInstance(),Q.setConfig({boxParser:H}),T=!1,_=null,ba=!1,ca=0,fa=[],ea=[],da=null,E=!0}function c(a,b){function c(a,b){var c=new g.default,d={subtitle:"subtitles",caption:"captions"},e=function(){var a=b.roles.length>0?d[b.roles[0]]:d.caption;return a=a===d.caption||a===d.subtitle?a:d.caption},f=function(){var a=!1;return b.codec&&b.codec.search("stpp")>=0&&(a=!0),b.mimeType&&b.mimeType.search("ttml")>=0&&(a=!0),a};c.captionData=a,c.lang=b.lang,c.label=b.id,c.index=b.index,c.isTTML=f(),c.video=Y.getElement(),c.defaultTrack=A(b),c.isFragmented=T,c.isEmbedded=!!b.isEmbedded,c.kind=e();var h=(R?R.length:0)+aa.length;S.addTextTrack(c,h)}var e,f,h,i,j,k=b.mediaInfo,l=k.type,m=k.mimeType,n=k.codec||m;if(!n)return void D("No text type defined");if("fragmentedText"===l)if(V)if(i=Q.getSamplesInfo(a),f=i.sampleList,!$&&f.length>0&&($=f[0].cts-b.start*W),n.search("stpp")>=0)for(N=null!==N?N:B(n),h=0;h<f.length;h++){var p=f[h],q=p.cts,r=q-$;this.buffered.add(r/W,(r+p.duration)/W);var s=new DataView(a,p.offset,p.size);j=w.default.Utils.dataViewToString(s,"utf-8");try{e=N.parse(j,q/W,(q+p.duration)/W),S.addCaptions(_,$/W,e)}catch(t){D("TTML parser error: "+t.message)}}else{var u=[];for(h=0;h<f.length;h++){var v=f[h];v.cts-=$,this.buffered.add(v.cts/W,(v.cts+v.duration)/W);for(var x=a.slice(v.offset,v.offset+v.size),z=w.default.parseBuffer(x),C=0;C<z.boxes.length;C++){var E=z.boxes[C];if(D("VTT box1: "+E.type),"vtte"!==E.type&&"vttc"===E.type){D("VTT vttc boxes.length = "+E.boxes.length);for(var F=0;F<E.boxes.length;F++){var G=E.boxes[F];if(D("VTT box2: "+G.type),"payl"===G.type){var H=G.cue_text;D("VTT cue_text = "+H);var J=v.cts/W,K=(v.cts+v.duration)/W;u.push({start:J,end:K,data:H,styles:{}}),D("VTT "+J+"-"+K+" : "+H)}}}}}u.length>0&&S.addCaptions(_,0,u)}else{for(V=!0,h=0;h<R.length;h++)c(null,R[h]);W=Q.getMediaTimescaleFromMoov(a)}else if("text"===l){var s=new DataView(a,0,a.byteLength);j=w.default.Utils.dataViewToString(s,"utf-8");try{e=B(n).parse(j),c(e,k)}catch(t){I.timedTextError(t,"parse",j)}}else if("video"===l)if("InitializationSegment"===b.segmentType){if(0===ca)for(ca=Q.getMediaTimescaleFromMoov(a),h=0;h<aa.length;h++)c(null,aa[h])}else{if(0===ca)return void D("CEA-608: No timescale for embeddedTextTrack yet");var L=function(a,b){function c(a,c,d){var e=null;if(Y.getTTMLRenderingDiv())e=o(Y.getElement(),a,c,d);else{var f=d.getDisplayText();e=[{start:a,end:c,data:f,styles:{}}]}e&&S.addCaptions(b,0,e)}return c};i=Q.getSamplesInfo(a);var M=i.sequenceNumber;if(!fa[0]&&!fa[1]){var O=void 0,P=void 0,U=void 0;for(h=0;h<aa.length;h++){if("CC1"===aa[h].id?(O=0,U=S.getTrackIdxForId("CC1")):"CC3"===aa[h].id&&(O=1,U=S.getTrackIdxForId("CC3")),U===-1)return void D("CEA-608: data before track is ready.");P=L(this,U),fa[h]=new y.default.Cea608Parser(h,{newCue:P},null)}}if(ca&&ea.indexOf(M)==-1){if(null!==da&&M!==da+1)for(h=0;h<fa.length;h++)fa[h]&&fa[h].reset();for(var X=d(a),Z=0;Z<fa.length;Z++){var ba=X.fields[Z],ga=fa[Z];if(ga){for(h=0;h<ba.length;
44059h++)ga.addData(ba[h][0]/ca,ba[h][1]);X.endTime&&ga.cueSplitAtTime(X.endTime/ca)}}da=M,ea.push(M)}}}function d(a){var b=function(a,b,c){var d=a.length;if(d>0){if(b>=a[d-1][0])a.push([b,c]);else for(var e=d-1;e>=0;e--)if(b<a[e][0]){a.splice(e,0,[b,c]);break}}else a.push([b,c])},c=H.parse(a),d=c.getBox("moof"),e=c.getBox("tfdt"),f=c.getBoxes("trun"),g=null;if(0===f.length)return null;g=f[0],f.length>1&&D("Warning: Too many truns");for(var h=d.offset+g.data_offset,i=g.sample_count,j=h,k=e.baseMediaDecodeTime,l=new DataView(a),m={startTime:null,endTime:null,fields:[[],[]]},n=0,o=0;o<i;o++){for(var p=g.samples[o],q=k+n+p.sample_composition_time_offset,r=y.default.findCea608Nalus(l,j,p.sample_size),s=0;s<r.length;s++)for(var t=y.default.extractCea608DataFromRange(l,r[s]),u=0;u<2;u++)t[u].length>0&&b(m.fields[u],q,t[u]);n+=p.sample_duration,j+=p.sample_size}var v=k+n;return m.startTime=k,m.endTime=v,m}function e(a){for(var b="",c=0;c<a.length;++c){var d=a[c];b+=d.uchar}var e=b.length,f=b.replace(/^\s+/,"").length;return e-f}function f(a){return"left: "+3.125*a.x+"%; top: "+6.66*a.y1+"%; width: "+(100-3.125*a.x)+"%; height: "+6.66*Math.max(a.y2-1-a.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function h(a){return"red"==a?"rgb(255, 0, 0)":"green"==a?"rgb(0, 255, 0)":"blue"==a?"rgb(0, 0, 255)":"cyan"==a?"rgb(0, 255, 255)":"magenta"==a?"rgb(255, 0, 255)":"yellow"==a?"rgb(255, 255, 0)":"white"==a?"rgb(255, 255, 255)":"black"==a?"rgb(0, 0, 0)":a}function j(a,b){var c=a.videoHeight/15;return b?"font-size: "+c+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(b.foreground?h(b.foreground):"rgb(255, 255, 255)")+"; font-style: "+(b.italics?"italic":"normal")+"; text-decoration: "+(b.underline?"underline":"none")+"; white-space: pre; background-color: "+(b.background?h(b.background):"transparent")+";":"font-size: "+c+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function l(a){var b=a.replace(/^\s+/g,"");return b}function n(a){var b=a.replace(/\s+$/g,"");return b}function o(a,b,c,d){var g=null,h=null,i=!1,k=-1,m={start:b,end:c,spans:[]},o="style_cea608_white_black",p={},q={},r=[],s=void 0,t=void 0;for(s=0;s<15;++s){var u=d.rows[s],v="",w=null;if(!1===u.isEmpty()){var x=e(u.chars);null===g&&(g={x:x,y1:s,y2:s+1,p:[]}),x!==k&&i&&(g.p.push(m),m={start:b,end:c,spans:[]},g.y2=s,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)), 44060g={x:x,y1:s,y2:s+1,p:[]});for(var y=0;y<u.chars.length;++y){var z=u.chars[y],A=z.penState;if(null===w||!A.equals(w)){v.trim().length>0&&(m.spans.push({name:o,line:v,row:s}),v="");var B="style_cea608_"+A.foreground+"_"+A.background;A.underline&&(B+="_underline"),A.italics&&(B+="_italics"),q.hasOwnProperty(B)||(q[B]=JSON.parse(JSON.stringify(A))),w=A,o=B}v+=z.uchar}v.trim().length>0&&m.spans.push({name:o,line:v,row:s}),i=!0,k=x}else i=!1,k=-1,g&&(g.p.push(m),m={start:b,end:c,spans:[]},g.y2=s,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)),g=null)}g&&(g.p.push(m),g.y2=s+1,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)),g=null);var C=[];for(s=0;s<r.length;++s){var D=r[s],E="sub_cea608_"+F++,G=document.createElement("div");G.id=E;var H=f(D);G.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+H;var I=document.createElement("div");I.className="paragraph bodyStyle",I.style.cssText=j(a);var J=document.createElement("div");J.className="cueUniWrapper",J.style.cssText="unicode-bidi: normal; direction: ltr;";for(var K=0;K<D.p.length;++K){var L=D.p[K],M=0;for(t=0;t<L.spans.length;++t){var N=L.spans[t];if(N.line.length>0){if(0!==t&&M!=N.row){var O=document.createElement("br");O.className="lineBreak",J.appendChild(O)}var P=!1;M===N.row&&(P=!0),M=N.row;var Q=q[N.name],R=document.createElement("span");R.className="spanPadding "+N.name+" customSpanColor",R.style.cssText=j(a,Q),0!==t&&P?t===L.spans.length-1?R.textContent=n(N.line):R.textContent=N.line:0===t&&L.spans.length>1&&N.row===L.spans[1].row?R.textContent=l(N.line):R.textContent=N.line.trim(),J.appendChild(R)}}}I.appendChild(J),G.appendChild(I);var S={bodyStyle:90};for(t in q)q.hasOwnProperty(t)&&(S[t]=90);C.push({type:"html",start:b,end:c,cueHTMLElement:G,cueID:E,cellResolution:[32,15],isFromCEA608:!0,regions:r,regi
44060onID:D.name,videoHeight:a.videoHeight,videoWidth:a.videoWidth,fontSize:S||{defaultFontSize:"100"},lineHeight:{},linePadding:{}})}return C}function p(){S.deleteAllTextTracks(),M=!1,N=null,Q=null,R=null,S=null,T=!1,U=null,V=!1,W=NaN,X=[],Y=null,Z=null,E=!1,aa=null}function r(a){E||b(),"CC1"===a.id||"CC3"===a.id?aa.push(a):D("Warning: Embedded track "+a.id+" not supported!")}function t(){E=!1,aa=[],fa=[null,null],ea=[],da=null}function v(){return M}function x(a){a&&(a.errHandler&&(I=a.errHandler),a.adapter&&(J=a.adapter),a.dashManifestModel&&(K=a.dashManifestModel),a.mediaController&&(L=a.mediaController),a.videoModel&&(Y=a.videoModel),a.streamController&&(Z=a.streamController),a.textTracks&&(S=a.textTracks),a.VTTParser&&(O=a.VTTParser),a.TTMLParser&&(P=a.TTMLParser))}function z(){for(var a=Y.getElement(),b=a.textTracks,c=b.length,d=c-aa.length,e=S.getCurrentTrackIdx(),f=0;f<c;f++){var g=b[f];if(M="showing"!==g.mode,"showing"===g.mode){if(e!==f&&(S.setCurrentTrackIdx(f),S.addCaptions(f,0,null),T&&f<d)){var h=L.getCurrentTrackFor("fragmentedText",Z.getActiveStreamInfo()),i=X[f];i!==h&&(U.abortRequests(),S.deleteTrackCues(h),L.setTrack(i),_=f)}break}}M&&S.setCurrentTrackIdx(-1)}function A(a){var b=!1;return aa.length>1?b=a.id&&"CC1"===a.id:1===aa.length?a.id&&"CC"===a.id.substring(0,2)&&(b=!0):b=a.index===R[0].index,b}function B(a){var b;return a.search("vtt")>=0?b=O:(a.search("ttml")>=0||a.search("stpp")>=0)&&(b=P,b.setConfig({videoModel:Y})),b}var C=this.context,D=(0,q.default)(C).getInstance().log,E=!1,F=0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0;return G={initialize:a,append:c,abort:p,getAllTracksAreDisabled:v,setTextTrack:z,setConfig:x,addEmbeddedTrack:r,resetEmbedded:t}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(122),g=d(f),h=a(30),i=d(h),j=a(97),k=d(j),l=a(99),m=d(l),n=a(8),o=d(n),p=a(6),q=d(p),r=a(78),s=d(r),t=a(54),u=d(t),v=a(4),w=d(v),x=a(1),y=d(x);e.__dashjs_factory_name="TextSourceBuffer",c.default=o.default.getSingletonFactory(e),b.exports=c.default},{1:1,122:122,30:30,4:4,54:54,6:6,78:78,8:8,97:97,99:99}],54:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){D=window.VTTCue||window.TextTrackCue,G=[],H=[],I=-1,J=0,K=0,L=0,M=0,N=null,O=null,R=!1,S=2147483647,P=!!navigator.userAgent.match(/Chrome/)&&!navigator.userAgent.match(/Edge/),void 0!==document.fullscreenElement?Q="fullscreenElement":void 0!==document.webkitIsFullScreen?Q="webkitIsFullScreen":document.msFullscreenElement?Q="msFullscreenElement":document.mozFullScreen&&(Q="mozFullScreen")}function b(a){var b=G[a].kind,c=void 0!==G[a].label?G[a].label:G[a].lang,d=G[a].lang,e=P?document.createElement("track"):F.addTextTrack(b,c,d);return P&&(e.kind=b,e.label=c,e.srclang=d),e}function c(a){R=a,N&&!document[Q]&&(N.style.zIndex=a?S:null)}function d(a,c){if(G.length===c)return void B("Trying to add too many tracks.");if(G.push(a),void 0===F&&(F=a.video),G.length===c){G.sort(function(a,b){return a.index-b.index}),N=E.getTTMLRenderingDiv();for(var d=-1,e=0;e<G.length;e++){var f=b.call(this,e);H.push(f),G[e].defaultTrack&&(f.default=!0,d=e),P&&F.appendChild(f);var g=F.textTracks[e];g.nonAddedCues=[],N&&(G[e].isTTML||G[e].isEmbedded)?g.renderingType="html":g.renderingType="default",this.addCaptions(e,0,G[e].captionData),A.trigger(i.default.TEXT_TRACK_ADDED)}q.call(this,d),d>=0&&(F.textTracks[d].mode="showing",this.addCaptions(d,0,null)),A.trigger(i.default.TEXT_TRACKS_ADDED,{index:I,tracks:G})}}function e(a,b,c,d,e,f){var g=a/b,h=c/d,i=0,j=0;g>h?(j=b,i=j/d*c):(i=a,j=i/c*d);var k=0,l=0,m=0,n=0,o=i/j;return o>e?(n=j,m=j/(1/e),k=(a-m)/2,l=0):(m=i,n=i/e,k=0,l=(b-n)/2),f?{x:k+.1*m,y:l+.1*n,w:.8*m,h:.8*n}:{x:k,y:l,w:m,h:n}}function f(){var a=this.getCurrentTextTrack();if(a&&"html"===a.renderingType){var b=F.clientWidth/F.clientHeight,c=!1;a.isFromCEA608&&(b=3.5/3,c=!0);var d=e.call(this,F.clientWidth,F.clientHeight,F.videoWidth,F.videoHeight,b,c),f=d.w,g=d.h;if(f!=L||g!=M){J=d.x,K=d.y,L=f,M=g,N.style.left=J+"px",N.style.top=K+"px",N.style.width=L+"px",N.style.height=M+"px";for(var h=0;a.activeCues&&h<a.activeCues.length;++h){var i=a.activeCues[h];i.scaleCue(i)}Q&&document[Q]||R?N.style.zIndex=S:N.style.zIndex=null}}}function h(a,b){var c=Math.round(.01*a*b).toString()+"px";return c}function j(a){var b=L,c=M;if(b*c!==0&&a.layout){var d=a.layout,e=h(d.left,b),f=h(d.top,c),g=h(d.width,b),i=h(d.height,c);N.style.left=e,N.style.top=f,N.style.width=g,N.style.height=i;var j=N.firstChild;j&&j.style&&(j.style.left="0px",j.style.top="0px",j.style.width=g,j.style.height=i)}}function k(a){var b,c,d,e=L,f=M,g=[e/a.cellResolution[0],f/a.cellResolution[1]];if(a.linePadding)for(b in a.linePadding)if(a.linePadding.hasOwnProperty(b)){var h=a.linePadding[b];c=(h*g[0]).toString();for(var i=document.getElementsByClassName("spanPadding"),j=0;j<i.length;j++)i[j].style.cssText=i[j].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+c),i[j].style.cssText=i[j].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+c)}
44060if(a.fontSize)for(b in a.fontSize)if(a.fontSize.hasOwnProperty(b)){var k=a.fontSize[b]/100;c=(k*g[1]).toString(),d="defaultFontSize"!==b?document.getElementsByClassName(b):document.getElementsByClassName("paragraph");for(var l=0;l<d.length;l++)d[l].style.cssText=d[l].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+c)}if(a.lineHeight)for(b in a.lineHeight)if(a.lineHeight.hasOwnProperty(b)){var m=a.lineHeight[b]/100;c=(m*g[1]).toString(),d=document.getElementsByClassName(b);for(var n=0;n<d.length;n++)d[n].style.cssText=d[n].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+c)}}function l(a,b,c){var d=a>=0?F.textTracks[a]:null,e=this;if(d){if("showing"!==d.mode)return void(c&&c.length>0&&(d.nonAddedCues=d.nonAddedCues.concat(c)));if(c||(c=d.nonAddedCues,d.nonAddedCues=[]),c&&0!==c.length)for(var g in c){var h,i=c[g];d.cellResolution=i.cellResolution,d.isFromCEA608=i.isFromCEA608,O||"html"!==i.type&&"image"!==i.type||(O=setInterval(f.bind(this),500)),"image"===i.type?(h=new D(i.start-b,i.end-b,""),h.image=i.data,h.id=i.id,h.size=0,h.type="image",h.layout=i.layout,h.scaleCue=j.bind(e),h.onenter=function(){if(N&&"showing"===d.mode){var a=new Image;a.id="ttmlImage_"+this.id,a.src=this.image,a.style.cssText="z-index: 2147483648; pointer-events: none; display: block; visibility: visible !important; position: relative !important;",N.appendChild(a),j.call(e,this)}},h.onexit=function(){if(N)for(var a=N.childNodes,b=0;b<a.length;b++)a[b].id==="ttmlImage_"+this.id&&N.removeChild(a[b])}):"html"===i.type?(h=new D(i.start-b,i.end-b,""),h.cueHTMLElement=i.cueHTMLElement,h.regions=i.regions,h.regionID=i.regionID,h.cueID=i.cueID,h.videoWidth=i.videoWidth,h.videoHeight=i.videoHeight,h.cellResolution=i.cellResolution,h.fontSize=i.fontSize,h.lineHeight=i.lineHeight,h.linePadding=i.linePadding,h.scaleCue=k.bind(e),N.style.left=J+"px",N.style.top=K+"px",N.style.width=L+"px",N.style.height=M+"px",h.onenter=function(){"showing"===d.mode&&(B("Cue "+this.startTime+"-"+this.endTime+" : "+this.cueHTMLElement.id+" : "+this.cueHTMLElement.innerText),N.appendChild(this.cueHTMLElement),k.call(e,this))},h.onexit=function(){for(var a=N.childNodes,b=0;b<a.length;++b)a[b].id===this.cueID&&N.removeChild(a[b])}):(h=new D(i.start-b,i.end-b,i.data),i.styles&&(void 0!==i.styles.align&&h.hasOwnProperty("align")&&(h.align=i.styles.align),void 0!==i.styles.line&&h.hasOwnProperty("line")&&(h.line=i.styles.line),void 0!==i.styles.position&&h.hasOwnProperty("position")&&(h.position=i.styles.position),void 0!==i.styles.size&&h.hasOwnProperty("size")&&(h.size=i.styles.size))),d.addCue(h)}}}function n(){return I>=0?F.textTracks[I]:null}function o(){return I}function p(a){for(var b=-1,c=0;c<F.textTracks.length;c++)if(F.textTracks[c].label===a){b=c;break}return b}function q(a){if(I=a,x.call(this),a>=0){var b=F.textTracks[a];"html"===b.renderingType?v.call(this):w.call(this)}else w.call(this)}function r(a){return F.textTracks[a]}function s(a){if(a.cues){for(var b=a.cues,c=b.length-1,d=c;d>=0;d--)a.removeCue(b[d]);a.mode="disabled"}}function t(){for(var a=H.length,b=0;b<a;b++)if(P)F.removeChild(H[b]);else{var c=r.call(this,b);c.nonAddedCues=[],s.call(this,c)}H=[],G=[],O&&(clearInterval(O),O=null),x.call(this)}function u(a){F.removeChild(H[a]),H.splice(a,1)}function v(){if(P){var a=document.getElementById("native-cue-style");if(!a){a=document.createElement("style"),a.id="native-cue-style",document.head.appendChild(a);var b=a.sheet;F.id?b.insertRule("#"+F.id+"::cue {background: transparent}",0):0!==F.classList.length?b.insertRule("."+F.className+"::cue {background: transparent}",0):b.insertRule("video::cue {background: transparent}",0)}}}function w(){if(P){var a=document.getElementById("native-cue-style");a&&document.head.removeChild(a)}}function x(){if(N)for(;N.firstChild;)N.removeChild(N.firstChild)}function y(a){a&&a.videoModel&&(E=a.videoModel)}var z=this.context,A=(0,g.default)(z).getInstance(),B=(0,m.default)(z).getInstance().log,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0;return C={initialize:a,displayCConTop:c,addTextTrack:d,addCaptions:l,getTextTrack:r,getCurrentTextTrack:n,getCurrentTrackIdx:o,setCurrentTrackIdx:q,getTrackIdxForId:p,deleteTrackCues:s,deleteAllTextTracks:t,deleteTextTrack:u,setConfig:y}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j),l=a(6),m=d(l);e.__dashjs_factory_name="TextTracks",c.default=k.default.getSingletonFactory(e),b.exports=c.default},{11:11,6:6,7:7,8:8}],55:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a){function b(){var a;p=[],q=[],r=[],a={},e(a,g.HTTPRequest.MPD_TYPE,m.default.DOWNLOAD_ERROR_ID_MANIFEST),e(a,g.HTTPRequest.XLINK_EXPANSION_TYPE,m.default.DOWNLOAD_ERROR_ID_XLINK),e(a,g.HTTPRequest.INIT_SEGMENT_TYPE,m.default.DOWNLOAD_ERROR_ID_INITIALIZATION),e(a,g.HTTPRequest.MEDIA_SEGMENT_TYPE,m.default.DOWNLOAD_ERROR_ID_CONTENT),e(a,g.HTTPRequest.INDEX_SEGMENT_TYPE,m.default.DOWNLOAD_ERROR_ID_CONTENT),e(a,g.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,m.default.DOWNLOAD_ERROR_ID_CONTENT),e(a,g.HTTPRequest.OTHER_TYPE,m.default.DOWNLOAD_ERROR_ID_CONTENT),s=a}
vendor: 5,274 bytes, line 44060
44060function c(a,b){var d=a.request,e=new XMLHttpRequest,f=[],g=!0,h=!0,k=new Date,m=k,o=0,t=function(a){h=!1,d.requestStartDate=k,d.requestEndDate=new Date,d.firstByteDate=d.firstByteDate||k,d.checkExistenceOnly||l.addHttpRequest(d.mediaType,null,d.type,d.url,e.responseURL||null,d.serviceLocation||null,d.range||null,d.requestStartDate,d.firstByteDate,d.requestEndDate,e.status,d.duration,e.getAllResponseHeaders(),a?f:null)},u=function(){p.indexOf(e)!==-1&&(p.splice(p.indexOf(e),1),h&&(t(!1),b>0?(b--,r.push(setTimeout(function(){c(a,b)},i.getRetryIntervalForType(d.type)))):(j.downloadError(s[d.type],d.url,d),a.error&&a.error(d,"error",e.statusText),a.complete&&a.complete(d,e.statusText))))},v=function(b){var c=new Date;g&&(g=!1,(!b.lengthComputable||b.lengthComputable&&b.total!==b.loaded)&&(d.firstByteDate=c)),b.lengthComputable&&(d.bytesLoaded=b.loaded,d.bytesTotal=b.total),f.push({s:m,d:c.getTime()-m.getTime(),b:[b.loaded?b.loaded-o:0]}),m=c,o=b.loaded,a.progress&&a.progress()},w=function(){e.status>=200&&e.status<=299&&(t(!0),a.success&&a.success(e.response,e.statusText,e),a.complete&&a.complete(d,e.statusText))};try{var x=n.modifyRequestURL(d.url),y=d.checkExistenceOnly?"HEAD":"GET";e.open(y,x,!0),d.responseType&&(e.responseType=d.responseType),d.range&&e.setRequestHeader("Range","bytes="+d.range),d.requestStartDate||(d.requestStartDate=k),e=n.modifyRequestHeader(e),e.withCredentials=i.getXHRWithCredentials(),e.onload=w,e.onloadend=u,e.onerror=u,e.onprogress=v;var z=(new Date).getTime();isNaN(d.delayLoadingTime)||z>=d.delayLoadingTime?(p.push(e),e.send()):!function(){var a={xhr:e};q.push(a),a.delayTimeout=setTimeout(function(){if(q.indexOf(a)!==-1){q.splice(q.indexOf(a),1);try{p.push(a.xhr),a.xhr.send()}catch(b){a.xhr.onerror()}}},d.delayLoadingTime-z)}()}catch(A){e.onerror()}}function d(a){a.request&&c(a,i.getRetryAttemptsForType(a.request.type))}function f(){r.forEach(function(a){return clearTimeout(a)}),r=[],q.forEach(function(a){return clearTimeout(a.delayTimeout)}),q=[],p.forEach(function(a){a.onloadend=a.onerror=a.onprogress=void 0,a.abort()}),p=[]}var h=this.context,i=(0,k.default)(h).getInstance(),j=a.errHandler,l=a.metricsModel,n=a.requestModifier,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0;return o={load:d,abort:f},b(),o}Object.defineProperty(c,"__esModule",{value:!0});var g=a(130),h=a(8),i=d(h),j=a(75),k=d(j),l=a(102),m=d(l);f.__dashjs_factory_name="XHRLoader";var n=i.default.getClassFactory(f);c.default=n,b.exports=c.default},{102:102,130:130,75:75,8:8}],56:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a,b,c){var e=function(d,e){b.resolved=!0,b.resolvedContent=d?d:null,f.trigger(p.default.XLINK_ELEMENT_LOADED,{element:b,resolveObject:c,error:d||e?null:new g.default(s,"Failed loading Xlink element: "+a)})};if(a===d)e(null,!0);else{var i=new l.default(a,j.HTTPRequest.XLINK_TYPE);h.load({request:i,success:function(a){e(a)},error:function(){e(null)}})}}function c(){h&&(h.abort(),h=null)}var d="urn:mpeg:dash:resolve-to-zero:2013",e=this.context,f=(0,n.default)(e).getInstance(),h=(0,i.default)(e).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier}),k=void 0;return k={load:b,reset:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(113),g=d(f),h=a(55),i=d(h),j=a(130),k=a(121),l=d(k),m=a(7),n=d(m),o=a(11),p=d(o),q=a(8),r=d(q),s=1;e.__dashjs_factory_name="XlinkLoader";var t=r.default.getClassFactory(e);t.XLINK_LOADER_ERROR_LOADING_FAILURE=s,c.default=t,b.exports=c.default},{11:11,113:113,121:121,130:130,55:55,7:7,8:8}],57:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){ha={video:!0,audio:!0},ia={},ja={},ka={},la={},ma={},na={},pa={},oa={},ra=!1,sa=!1,xa=(0,k.default)(ba).getInstance(),wa=(0,o.default)(ba).getInstance(),ta=(0,y.default)(ba).getInstance(),ua=(0,A.default)(ba).getInstance(),va=(0,C.default)(ba).getInstance()}function b(a,b){oa[a]=b,pa[a]=pa[a]||{},pa[a].state=E,ca.on(u.default.LOADING_PROGRESS,aa,this)}function c(a){a&&(a.abrRulesCollection&&(ea=a.abrRulesCollection),a.rulesController&&(fa=a.rulesController),a.streamController&&(ga=a.streamController))}function d(a,b){var c;return ia[b]=ia[b]||{},ia[b].hasOwnProperty(a)||(ia[b][a]=0),c=Z(ia[b][a],a),c=$(c,a,ia[b][a]),c=_(c,a)}function e(a){var b=xa.getSavedBitrateSettings(a);if(!la.hasOwnProperty(a))if(ma.hasOwnProperty(a)){var c=ta.getValue(),d=ua.getAdaptationForType(c,0,a).Representation;if(Array.isArray(d)){var e=Math.max(Math.round(d.length*ma[a])-1,0);la[a]=d[e].bandwidth}else la[a]=0}else isNaN(b)?la[a]="video"===a?F:G:la[a]=b;return la[a]}function f(a,b){la[a]=b}function h(a){return ma.hasOwnProperty(a)?ma[a]:null}function j(a,b){ma[a]=b}function l(a){return la.hasOwnProperty("max")&&la.max.hasOwnProperty(a)?la.max[a]:NaN}function n(a,b){la.max=la.max||{},la.max[a]=b}function p(a){return ma.hasOwnProperty("max")&&ma.max.hasOwnProperty(a)?ma.max[a]:1}function r(a,b){ma.max=ma.max||{},ma.max[a]=b}function t(a){return ha[a]}function v(a,b){ha[a]=b}function w(){return ra}function x(a){ra=a}function z(){return sa}function B(a){sa=a}function I(a,b){var c=a.getType(),e=a.getStreamInfo(),f=e.id,h=function(a){var g=d(c,f),h=a.value;h<0&&(h=0),h>g&&(h=g);var i=U(c,e);
44060h!==i&&(pa[c].state===E||h>i)&&(X(c,f,a.confidence),K(c,e,i,h,a.reason)),b&&b()};if(t(c)){var i=ea.getRules(m.default.QUALITY_SWITCH_RULES);fa.applyRules(i,a,h,U(c,e),function(a,b){return a=a===g.default.NO_CHANGE?0:a,Math.max(a,b)})}else b&&b()}function J(a,b,c,e){var f=b.id,g=U(a,b),h=null!==c&&!isNaN(c)&&c%1===0;if(!h)throw new Error("argument is not an integer");c!==g&&c>=0&&c<=d(a,f)&&K(a,b,g,c,e)}function K(a,b,c,d,e){V(a,b.id,d),ca.trigger(u.default.QUALITY_CHANGE_REQUESTED,{mediaType:a,streamInfo:b,oldQuality:c,newQuality:d,reason:e})}function L(a,b){pa[a].state=b}function M(a){return pa[a].state}function N(a,b){var c=O(a);if(!c||0===c.length)return H;for(var d=c.length-1;d>=0;d--){var e=c[d];if(1e3*b>=e.bitrate)return d}return 0}function O(a){if(!a||!a.bitrateList)return null;for(var b,c=a.bitrateList,d=a.type,e=[],f=0,g=c.length;f<g;f++)b=new i.default,b.mediaType=d,b.qualityIndex=f,b.bitrate=c[f].bandwidth,b.width=c[f].width,b.height=c[f].height,e.push(b);return e}function P(a,b){na[a]=b}function Q(a){return na[a]}function R(a){var b=a.type,c=a.streamInfo.id,d=a.representationCount-1;return Y(b,c,d),d}function S(a){var b,c=a.id,e=U("audio",a),f=U("video",a);return b=e===d("audio",c)&&f===d("video",c)}function T(){ca.off(u.default.LOADING_PROGRESS,aa,this),clearTimeout(qa),qa=null,a()}function U(a,b){var c,d=b.id;return ja[d]=ja[d]||{},ja[d].hasOwnProperty(a)||(ja[d][a]=H),c=ja[d][a]}function V(a,b,c){ja[b]=ja[b]||{},ja[b][a]=c}function W(a,b){var c;return ka[b]=ka[b]||{},ka[b].hasOwnProperty(a)||(ka[b][a]=0),c=ka[b][a]}function X(a,b,c){ka[b]=ka[b]||{},ka[b][a]=c}function Y(a,b,c){ia[b]=ia[b]||{},ia[b][a]=c}function Z(a,b){var c=l(b);if(isNaN(c)||!oa[b])return a;var d=N(oa[b].getMediaInfo(),c);return Math.min(a,d)}function $(a,b,c){var d=p(b);return isNaN(d)||d>=1||d<0?a:Math.min(a,Math.round(c*d))}function _(a,b){if("video"!==b||!ra||!oa[b])return a;var c=sa&&window.hasOwnProperty("devicePixelRatio"),d=c?window.devicePixelRatio:1,e=va.getElement(),f=e.clientWidth*d,g=e.clientHeight*d,h=ta.getValue(),i=ua.getAdaptationForType(h,0,b).Representation,j=a;if(f>0&&g>0){for(;j>0&&i[j]&&f<i[j].width&&f-i[j-1].width<i[j].width-f;)j-=1;i.length-2>=j&&i[j].width===i[j+1].width&&(j=Math.min(a,j+1))}return j}function aa(a){var b=a.request.mediaType;if(t(b)){var c=function(){var c=ea.getRules(m.default.ABANDON_FRAGMENT_RULES),d=oa[b].getScheduleController();if(!d)return{v:void 0};var e=function(c){if(c.confidence===g.default.STRONG&&c.value<U(b,ga.getActiveStreamInfo())){var e=d.getFragmentModel(),f=e.getRequests({state:q.default.FRAGMENT_MODEL_LOADING,index:a.request.index})[0];f&&(e.abortRequests(),L(b,D),J(b,ga.getActiveStreamInfo(),c.value,c.reason),ca.trigger(u.default.FRAGMENT_LOADING_ABANDONED,{streamProcessor:oa[b],request:f,mediaType:b}),clearTimeout(qa),qa=setTimeout(function(){L(b,E),qa=null},wa.getAbandonLoadTimeout()))}};fa.applyRules(c,oa[b],e,a,function(a,b){return b})}();if("object"==typeof c)return c.v}}var ba=this.context,ca=(0,s.default)(ba).getInstance(),da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0;return da={isPlayingAtTopQuality:S,updateTopQualityIndex:R,getAverageThroughput:Q,getBitrateList:O,getQualityForBitrate:N,getMaxAllowedBitrateFor:l,setMaxAllowedBitrateFor:n,getMaxAllowedRepresentationRatioFor:p,setMaxAllowedRepresentationRatioFor:r,getInitialBitrateFor:e,setInitialBitrateFor:f,getInitialRepresentationRatioFor:h,setInitialRepresentationRatioFor:j,setAutoSwitchBitrateFor:v,getAutoSwitchBitrateFor:t,setLimitBitrateByPortal:x,getLimitBitrateByPortal:w,getUsePixelRatioInLimitBitrateByPortal:z,setUsePixelRatioInLimitBitrateByPortal:B,getConfidenceFor:W,getQualityFor:U,getAbandonmentStateFor:M,setAbandonmentStateFor:L,setPlaybackQuality:J,getPlaybackQuality:I,setAverageThroughput:P,getTopQualityIndexFor:d,initialize:b,setConfig:c,reset:T},a(),da}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(111),i=d(h),j=a(100),k=d(j),l=a(82),m=d(l),n=a(75),o=d(n),p=a(73),q=d(p),r=a(7),s=d(r),t=a(11),u=d(t),v=a(8),w=d(v),x=a(74),y=d(x),z=a(20),A=d(z),B=a(78),C=d(B),D="abandonload",E="allowload",F=1e3,G=100,H=0;e.__dashjs_factory_name="AbrController";var I=w.default.getSingletonFactory(e);I.ABANDON_LOAD=D,I.QUALITY_DEFAULT=H,c.default=I,b.exports=c.default},{100:100,11:11,111:111,20:20,7:7,73:73,74:74,75:75,78:78,8:8,81:81,82:82}],58:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){o.invalidateSelectedIndexes(a.entry)}function b(){o=(0,g.default)(j).create(),p=(0,i.default)(j).create(),l.on(s.default.SERVICE_LOCATION_BLACKLIST_CHANGED,a,h)}function c(a){o.update(a),p.chooseSelectorFromManifest(a)}function d(a){var b=o.getForPath(a),c=b.reduce(function(a,b){var c=p.select(b);return c&&(n.isRelative(c.url)?a.url+=c.url:n.isPathAbsolute(c.url)?a.url=n.parseOrigin(a.url)+c.url:(a.url=c.url,a.serviceLocation=c.serviceLocation)),a},new m.default);if(!n.isRelative(c.url))return c}function e(){o.reset(),p.reset()}function f(a){c(a)}var h=void 0,j=this.context,l=(0,q.default)(j).getInstance(),n=(0,k.default)(j).getInstance(),o=void 0,p=void 0;return h={reset:e,initialize:f,resolve:d},b(),h}Object.defineProperty(c,"__esModule",{value:!0});var f=a(72),g=d(f),h=a(96),i=d(h),j=a(109),k=d(j),l=a(38),m=d(l),n=a(8),o=d(n),p=a(7),q=d(p),r=a(11),s=d(r);e.__dashjs_factory_name="BaseURLController",c.default=o.default.getSingletonFactory(e),b.exports=c.default},{109:109,11:11,38:38,7:7,72:72,8:8,96:96}],59:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a){return!!(g.length&&a&&a.length)&&g.indexOf(a)!==-1}function c(a){g.indexOf(a)===-1&&(g.push(a),h.trigger(j,{entry:a}))}function d(a){a.error&&c(a.request.serviceLocation)}function e(){k&&h.on(k,d,this)}function f(){g=[]}var g=[],h=(0,i.default)(this.context).getInstance(),j=a.updateEventName,k=a.loadFailedEventName;return e(),{add:c,contains:b,reset:f}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(7),i=d(h);e.__dashjs_factory_name="BlackListController",c.default=g.default.getClassFactory(e),b.exports=c.default},{7:7,8:8}],60:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){oa=m.default.QUALITY_DEFAULT,pa=!1,qa=0,ra=Number.POSITIVE_INFINITY,ta=0,ua=0,wa=null,xa=E,za=0,Aa=!1,Ba=!1,Ca=!1,Da=!1}function c(a,b,c){va=a,$(b),Fa=c,Ia=(0,i.default)(ca).getInstance(),Ea=(0,o.default)(ca).getInstance(),Ga=(0,m.default)(ca).getInstance(),Ja=(0,C.default)(ca).getInstance(),Ha=Fa.getScheduleController(),oa=Ga.getQualityFor(va,Fa.getStreamInfo()),ea.on(u.default.DATA_UPDATE_COMPLETED,O,this),ea.on(u.default.INIT_FRAGMENT_LOADED,f,this),ea.on(u.default.MEDIA_FRAGMENT_LOADED,j,this),ea.on(u.default.QUALITY_CHANGE_REQUESTED,p,this),ea.on(u.default.STREAM_COMPLETED,P,this),ea.on(u.default.PLAYBACK_PROGRESS,t,this),ea.on(u.default.PLAYBACK_TIME_UPDATED,t,this),ea.on(u.default.PLAYBACK_RATE_CHANGED,S,this),ea.on(u.default.PLAYBACK_SEEKING,r,this),ea.on(u.default.WALLCLOCK_TIME_UPDATED,R,this),ea.on(u.default.CURRENT_TRACK_CHANGED,Q,this,s.default.EVENT_PRIORITY_HIGH),ea.on(u.default.SOURCEBUFFER_APPEND_COMPLETED,n,this),ea.on(u.default.SOURCEBUFFER_REMOVE_COMPLETED,M,this)}function d(a){if(!a||!sa||!Fa)return null;var b=null;try{b=ha.createSourceBuffer(sa,a),b&&b.hasOwnProperty("initialize")&&b.initialize(va,this)}catch(c){ia.mediaSourceError("Error creating "+va+" source buffer.")}return X(b),N(Fa.getRepresentationInfoForQuality(oa).MSETimeOffset),b}function e(){return Fa.getStreamInfo().id===ja.getActiveStreamInfo().id}function f(a){a.fragmentModel===Fa.getFragmentModel()&&(da("Init fragment finished loading saving to",va+"'s init cache"),Ja.save(a.chunk),l(a.chunk))}function h(a,b){var c=Ja.extract(a,va,b);c?l(c):ea.trigger(u.default.INIT_REQUESTED,{sender:na})}function j(a){if(a.fragmentModel===Fa.getFragmentModel()){var b=a.chunk,c=b.bytes,d=b.quality,e=Fa.getRepresentationInfoForQuality(d),f=ga.getValue(),h=la.getEventsFor(f,e.mediaInfo,Fa),i=la.getEventsFor(f,e,Fa);if(h.length>0||i.length>0){var j=Fa.getFragmentModel().getRequests({state:g.default.FRAGMENT_MODEL_EXECUTED,quality:d,index:b.index})[0],k=G(c,j,h,i);
44060Fa.getEventController().addInbandEvents(k)}b.bytes=H(c),l(b)}}function l(a){Ba=!0,ya=a,ha.append(wa,a),"video"===a.mediaInfo.type&&a.mediaInfo.embeddedCaptions&&ma.append(a.bytes,a)}function n(a){if(wa===a.buffer){if(a.error||!I())return a.error.code===k.default.QUOTA_EXCEEDED_ERROR_CODE&&(ra=.8*ha.getTotalBufferedTime(wa)),void(a.error.code!==k.default.QUOTA_EXCEEDED_ERROR_CODE&&I()||(ea.trigger(u.default.QUOTA_EXCEEDED,{sender:na,criticalBufferLevel:ra}),L(K())));isNaN(ya.index)||(ta=Math.max(ya.index,ta),y());var b=ha.getAllRanges(wa);if(b&&b.length>0)for(var c=0,d=b.length;c<d;c++)da("Buffered Range for type:",va,":",b.start(c)," - ",b.end(c));t(),Ba=!1,ea.trigger(u.default.BYTES_APPENDED,{sender:na,quality:ya.quality,startTime:ya.start,index:ya.index,bufferedRanges:b})}}function p(a){oa!==a.newQuality&&va===a.mediaType&&Fa.getStreamInfo().id===a.streamInfo.id&&(N(Fa.getRepresentationInfoForQuality(a.newQuality).MSETimeOffset),oa=a.newQuality)}function r(){ua=0,pa=!1,t()}function t(){v(),x()}function v(){qa=ha.getBufferLength(wa,Ea.getTime()),ea.trigger(u.default.BUFFER_LEVEL_UPDATED,{sender:na,bufferLevel:qa}),z()}function x(){e()&&(fa.addBufferState(va,xa,Ha.getBufferTarget()),fa.addBufferLevel(va,new Date,1e3*qa))}function y(){var a=ta===ua-1;a&&!pa&&(pa=!0,ea.trigger(u.default.BUFFERING_COMPLETED,{sender:na,streamInfo:Fa.getStreamInfo()}))}function z(){B(qa<F&&!pa?E:D)}function B(a){xa===a||"fragmentedText"===va&&ma.getAllTracksAreDisabled()||(xa=a,x(),ea.trigger(u.default.BUFFER_LEVEL_STATE_CHANGED,{sender:na,state:a,mediaType:va,streamInfo:Fa.getStreamInfo()}),ea.trigger(a===D?u.default.BUFFER_LOADED:u.default.BUFFER_EMPTY,{mediaType:va}),da(a===D?"Got enough buffer to start.":"Waiting for more buffer before starting playback."))}function G(a,b,c,d){var e=Math.max(isNaN(b.startTime)?0:b.startTime,0),f=[],g=[];Da=!1;for(var h=c.concat(d),i=0,j=h.length;i<j;i++)f[h[i].schemeIdUri]=h[i];for(var k=(0,w.default)(ca).getInstance().parse(a),l=k.getBoxes("emsg"),i=0,j=l.length;i<j;i++){var m=la.getEvent(l[i],f,e);m&&g.push(m)}return g}function H(a){if(!Da)return a;for(var b=a.length,c=Math.pow(256,2),d=Math.pow(256,3),e=new Uint8Array(a.length),f=0,g=0;f<b;){var h=String.fromCharCode(a[f+4],a[f+5],a[f+6],a[f+7]),i=a[f]*d+a[f+1]*c+256*a[f+2]+1*a[f+3];if("emsg"!=h)for(var j=f;j<f+i;j++)e[g]=a[j],g++;f+=i}return e.subarray(0,g)}function I(){var a=ha.getTotalBufferedTime(wa);return a<ra}function J(){if("fragmentedText"!==va){var a=wa.buffered.length?wa.buffered.start(0):0,b=Ea.getTime()-a-Ia.getBufferToKeep();b>0&&(da("pruning buffer: "+b+" seconds."),Ca=!0,ha.remove(wa,0,Math.round(a+b),sa))}}function K(){if(!wa)return null;var a=Ea.getTime(),b=Fa.getFragmentModel().getRequests({state:g.default.FRAGMENT_MODEL_EXECUTED,time:a})[0],c=ha.getBufferRange(wa,a),d=b&&!isNaN(b.startTime)?b.startTime:Math.floor(a);return null===c&&wa.buffered.length>0&&(d=wa.buffered.end(wa.buffered.length-1)),{start:wa.buffered.start(0),end:d}}function L(a){a&&wa&&ha.remove(wa,a.start,a.end,sa)}function M(a){wa===a.buffer&&(Ca&&(Ca=!1),v(),ea.trigger(u.default.BUFFER_CLEARED,{sender:na,from:a.from,to:a.to,hasEnoughSpaceToAppend:I()}))}function N(a){wa&&wa.timestampOffset!==a&&!isNaN(a)&&(wa.timestampOffset=a)}function O(a){a.sender.getStreamProcessor()!==Fa||a.error||N(a.currentRepresentation.MSETimeOffset)}function P(a){a.fragmentModel===Fa.getFragmentModel()&&(ua=a.request.index,y())}function Q(a){wa&&a.newMediaInfo.type===va&&a.newMediaInfo.streamInfo.id===Fa.getStreamInfo().id&&ka.getSwitchMode(va)===q.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&L(K())}function R(){za++;var a=za*(Ia.getWallclockTimeUpdateInterval()/1e3);a>=Ia.getBufferPruningInterval()&&!Ba&&(za=0,J())}function S(){z()}function T(){return va}function U(){return Fa}function V(a){Fa=a}function W(){return wa}function X(a){wa=a}function Y(){return qa}function Z(){return ra}function $(a){sa=a}function _(){return sa}function aa(){return pa}function ba(a){ea.off(u.default.DATA_UPDATE_COMPLETED,O,this),ea.off(u.default.QUALITY_CHANGE_REQUESTED,p,this),ea.off(u.default.INIT_FRAGMENT_LOADED,f,this),ea.off(u.default.MEDIA_FRAGMENT_LOADED,j,this),ea.off(u.default.STREAM_COMPLETED,P,this),ea.off(u.default.CURRENT_TRACK_CHANGED,Q,this),ea.off(u.default.PLAYBACK_PROGRESS,t,this),ea.off(u.default.PLAYBACK_TIME_UPDATED,t,this),ea.off(u.default.PLAYBACK_RATE_CHANGED,S,this),ea.off(u.default.PLAYBACK_SEEKING,r,this),ea.off(u.default.WALLCLOCK_TIME_UPDATED,R,this),ea.off(u.default.SOURCEBUFFER_APPEND_COMPLETED,n,this),ea.off(u.default.SOURCEBUFFER_REMOVE_COMPLETED,M,this),ra=Number.POSITIVE_INFINITY,xa=E,oa=m.default.QUALITY_DEFAULT,ua=0,ta=0,ya=null,Aa=!1,pa=!1,Ba=!1,Ca=!1,Ea=null,Fa=null,Ga=null,Ha=null,a||(ha.abort(sa,wa),ha.removeSourceBuffer(sa,wa)),wa=null}var ca=this.context,da=(0,A.default)(ca).getInstance().log,ea=(0,s.default)(ca).getInstance(),fa=a.metricsModel,ga=a.manifestModel,ha=a.sourceBufferController,ia=a.errHandler,ja=a.streamController,ka=a.mediaController,la=a.adapter,ma=a.textSourceBuffer,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0;return na={initialize:c,createBuffer:d,getType:T,getStreamProcessor:U,setStreamProcessor:V,getBuffer:W,setBuffer:X,getBufferLevel:Y,getCriticalBufferLevel:Z,setMediaSource:$,getMediaSource:_,getIsBufferingCompleted:aa,switchInitData:h,reset:ba},b(),na}Object.defineProperty(c,"__esModule",{value:!0});var f=a(73),g=d(f),h=a(75),i=d(h),j=a(67),k=d(j),l=a(57),m=d(l),n=a(65),o=d(n),p=a(63),q=d(p),r=a(7),s=d(r),t=a(11),u=d(t),v=a(97),w=d(v),x=a(8),y=d(x),z=a(6),A=d(z),B=a(103),C=d(B),D="bufferLoaded",E="bufferStalled",F=.5; 44061e.__dashjs_factory_name="BufferController";var G=y.default.getClassFactory(e);G.BUFFER_LOADED=D,G.BUFFER_EMPTY=E,c.default=G,b.exports=c.default},{103:103,11:11,57:57,6:6,63:63,65:65,67:67,7:7,73:73,75:75,8:8,97:97}],61:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){D=!1,u={},v={},w={},x=null,y=100,z=y/1e3,C=(0,g.default)(q).getInstance()}function b(){null!==x&&D&&(clearInterval(x),x=null,D=!1)}function c(){r("Start Event Controller"),D||isNaN(y)||(D=!0,x=setInterval(h,y))}function d(a){if(u={},a)for(var b=0;b<a.length;b++){var c=a[b];u[c.id]=c,r("Add inline event with id "+c.id)}r("Added "+a.length+" inline events")}function e(a){for(var b=0;b<a.length;b++){var c=a[b];c.id in v?r("Repeated event with id "+c.id):(v[c.id]=c,r("Add inband event with id "+c.id))}}function f(){if(w)for(var a=C.getTime(),b=Object.keys(w),c=0;c<b.length;c++){var d=b[c],e=w[d];null!==e&&(e.duration+e.presentationTime)/e.eventStream.timescale<a&&(r("Remove Event "+d+" at time "+a),e=null,delete w[d])}}function h(){j(v),j(u),f()}function i(){var a=A.getValue(),b=a.url;a.hasOwnProperty("Location")&&(b=a.Location),r("Refresh manifest @ "+b),B.getManifestLoader().load(b)}function j(a){var b,c=C.getTime();if(a)for(var d=Object.keys(a),e=0;e<d.length;e++){var f=d[e],g=a[f];void 0!==g&&(b=g.presentationTime/g.eventStream.timescale,(0===b||b<=c&&b+z>c)&&(r("Start Event "+f+" at "+c),g.duration>0&&(w[f]=g),g.eventStream.schemeIdUri==o&&g.eventStream.value==p?i():s.trigger(g.eventStream.schemeIdUri,{event:g}),delete a[f]))}}function l(a){a&&(a.manifestModel&&(A=a.manifestModel),a.manifestUpdater&&(B=a.manifestUpdater))}function n(){b(),u=null,v=null,w=null,C=null}var o="urn:mpeg:dash:event:2012",p=1,q=this.context,r=(0,k.default)(q).getInstance().log,s=(0,m.default)(q).getInstance(),t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0;return t={initialize:a,addInlineEvents:d,addInbandEvents:e,clear:b,start:c,setConfig:l,reset:n}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(65),g=d(f),h=a(8),i=d(h),j=a(6),k=d(j),l=a(7),m=d(l);e.__dashjs_factory_name="EventController",c.default=i.default.getSingletonFactory(e),b.exports=c.default},{6:6,65:65,7:7,8:8}],62:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){r={},o.on(p.default.FRAGMENT_LOADING_COMPLETED,i,q)}function b(a){var b=null;return null!==a&&void 0!==a&&a.byteLength>0&&(b=new Uint8Array(a)),b}function c(a){var b=r[a];return b||(b=(0,j.default)(k).create({metricsModel:(0,l.default)(k).getInstance()}),r[a]=b),b}function d(a){return a&&a.type&&a.type===f.HTTPRequest.INIT_SEGMENT_TYPE}function e(){o.off(p.default.FRAGMENT_LOADING_COMPLETED,i,this);for(var a in r)r[a].reset();r={}}function g(a,b,c){var d=new h.default;return d.streamId=c,d.mediaInfo=b.mediaInfo,d.segmentType=b.type,d.start=b.startTime,d.duration=b.duration,d.end=d.start+d.duration,d.bytes=a,d.index=b.index,d.quality=b.quality,d}function i(a){if(r[a.request.mediaType]===a.sender){var b=a.sender.getScheduleController(),c=a.request,e=a.response,f=d(c),h=b.getStreamProcessor().getStreamInfo().id;if(!e)return void m("No "+c.mediaType+" bytes to push.");var i=g(e,c,h);o.trigger(f?p.default.INIT_FRAGMENT_LOADED:p.default.MEDIA_FRAGMENT_LOADED,{chunk:i,fragmentModel:a.sender})}}var k=this.context,m=(0,t.default)(k).getInstance().log,o=(0,n.default)(k).getInstance(),q=void 0,r=void 0;return q={process:b,getModel:c,isInitializationRequest:d,reset:e},a(),q}Object.defineProperty(c,"__esModule",{value:!0});var f=a(130),g=a(112),h=d(g),i=a(73),j=d(i),k=a(76),l=d(k),m=a(7),n=d(m),o=a(11),p=d(o),q=a(8),r=d(q),s=a(6),t=d(s);e.__dashjs_factory_name="FragmentController",c.default=r.default.getClassFactory(e),b.exports=c.default},{11:11,112:112,130:130,6:6,7:7,73:73,76:76,8:8}],63:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){N={},E(),D()}function b(a,b){var c=k(a),e=d(a,b),f=[];return"fragmentedText"===a?void h(e[0]):(c||(c=L.getSavedMediaSettings(a),j(a,c)),void(e&&0!==e.length&&(c&&e.forEach(function(a){C(c,a)&&f.push(a)}),h(0===f.length?F(e):f.length>1?F(f):f[0]))))}function c(a){var b=a?a.type:null,c=a?a.streamInfo.id:null,d=k(b);return!(!a||!x(b))&&(N[c]=N[c]||G(),!(N[c][b].list.indexOf(a)>=0)&&(N[c][b].list.push(a),d&&C(d,a)&&!e(b,a.streamInfo)&&h(a),!0))}function d(a,b){if(!a||!b)return[];var c=b.id;return N[c]&&N[c][a]?N[c][a].list:[]}function e(a,b){return!a||!b||b&&!N[b.id]?null:N[b.id][a].current}function f(a){var b=a.type,c=a.streamInfo.id;return N[c]&&N[c][b]&&y(N[c][b].current,a)}
44061function h(a){if(a){var b=a.type,c=a.streamInfo,d=c.id,f=e(b,c);if(N[d]&&N[d][b]&&(!f||!y(a,f))){N[d][b].current=a,f&&J.trigger(g.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:a,switchMode:Q[b]});var h=B(a);h&&N[d][b].storeLastSettings&&(h.roles&&(h.role=h.roles[0],delete h.roles),h.accessibility&&(h.accessibility=h.accessibility[0]),h.audioChannelConfiguration&&(h.audioChannelConfiguration=h.audioChannelConfiguration[0]),L.setSavedMediaSettings(b,h))}}}function j(a,b){a&&b&&(O[a]=b)}function k(a){return a?O[a]:null}function l(a,b){var c=S.indexOf(b)!==-1;return c?void(Q[a]=b):void I("track switch mode is not supported: "+b)}function n(a){return Q[a]}function p(a){var b=T.indexOf(a)!==-1;return b?void(P=a):void I("track selection mode is not supported: "+a)}function w(){return P||v}function x(a){return"audio"===a||"video"===a||"text"===a||"fragmentedText"===a}function y(a,b){var c=a.id===b.id,d=a.viewpoint===b.viewpoint,e=a.lang===b.lang,f=a.roles.toString()===b.roles.toString(),g=a.accessibility.toString()===b.accessibility.toString(),h=a.audioChannelConfiguration.toString()===b.audioChannelConfiguration.toString();return c&&d&&e&&f&&g&&h}function z(a){a&&a.errHandler&&(R=a.errHandler)}function A(){a(),K.resetEmbedded()}function B(a){var b={lang:a.lang,viewpoint:a.viewpoint,roles:a.roles,accessibility:a.accessibility,audioChannelConfiguration:a.audioChannelConfiguration},c=b.lang||b.viewpoint||b.role&&b.role.length>0||b.accessibility&&b.accessibility.length>0||b.audioChannelConfiguration&&b.audioChannelConfiguration.length>0;return c?b:null}function C(a,b){var c=!a.lang||a.lang===b.lang,d=!a.viewpoint||a.viewpoint===b.viewpoint,e=!a.role||!!b.roles.filter(function(b){return b===a.role})[0],f=!a.accessibility||!!b.accessibility.filter(function(b){return b===a.accessibility})[0],g=!a.audioChannelConfiguration||!!b.audioChannelConfiguration.filter(function(b){return b===a.audioChannelConfiguration})[0];return c&&d&&e&&f&&g}function D(){Q={audio:s,video:r}}function E(){O={audio:null,video:null}}function F(a){var b=w(),c=[],d=function(a){var b,c=0,d=[];return a.forEach(function(a){b=Math.max.apply(Math,a.bitrateList.map(function(a){return a.bandwidth})),b>c?(c=b,d=[a]):b===c&&d.push(a)}),d},e=function(a){var b,c=0,d=[];return a.forEach(function(a){b=a.representationCount,b>c?(c=b,d=[a]):b===c&&d.push(a)}),d};switch(b){case t:c=d(a),c.length>1&&(c=e(c));break;case u:c=e(a),c.length>1&&(c=d(a));break;default:I("track selection mode is not supported: "+b)}return c[0]}function G(){return{audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null}}}var H=this.context,I=(0,m.default)(H).getInstance().log,J=(0,i.default)(H).getInstance(),K=(0,o.default)(H).getInstance(),L=(0,q.default)(H).getInstance(),M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=[s,r],T=[t,u];return M={initialize:a,checkInitialMediaSettingsForType:b,addTrack:c,getTracksFor:d,getCurrentTrackFor:e,isCurrentTrack:f,setTrack:h,setInitialSettings:j,getInitialSettings:k,setSwitchMode:l,getSwitchMode:n,setSelectionModeForInitialTrack:p,getSelectionModeForInitialTrack:w,isMultiTrackSupportedByType:x,isTracksEqual:y,setConfig:z,reset:A}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(11),g=d(f),h=a(7),i=d(h),j=a(8),k=d(j),l=a(6),m=d(l),n=a(53),o=d(n),p=a(100),q=d(p),r="neverReplace",s="alwaysReplace",t="highestBitrate",u="widestRange",v=t;e.__dashjs_factory_name="MediaController";var w=k.default.getSingletonFactory(e);w.TRACK_SWITCH_MODE_NEVER_REPLACE=r,w.TRACK_SWITCH_MODE_ALWAYS_REPLACE=s,w.TRACK_SELECTION_MODE_HIGHEST_BITRATE=t,w.TRACK_SELECTION_MODE_WIDEST_RANGE=u,w.DEFAULT_INIT_TRACK_SELECTION_MODE=v,c.default=w,b.exports=c.default},{100:100,11:11,53:53,6:6,7:7,8:8}],64:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){var a="WebKitMediaSource"in window,b="MediaSource"in window;return b?new MediaSource:a?new WebKitMediaSource:null}function b(a,b){var c=window.URL.createObjectURL(a);return b.setSource(c),c}function c(a){a.setSource(null)}function d(a,b){return a.duration!=b&&(a.duration=b),a.duration}function e(a){var b=a.sourceBuffers,c=b.length,d=0;if("open"===a.readyState){for(d;d<c;d++){if(b[d].updating)return;if(0===b[d].buffered.length)return}a.endOfStream()}}var f=void 0;return f={createMediaSource:a,attachMediaSource:b,detachMediaSource:c,setDuration:d,signalEndOfStream
44061:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="MediaSourceController",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],65:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){ma=0,na=NaN,oa=null,ra=null,ta=!1,pa={},sa=(0,k.default)(_).getInstance()}function b(a){qa=a,da=la.getElement(),Z(),ra=qa.manifestInfo.isDynamic,na=qa.start,ba.on(o.default.DATA_UPDATE_COMPLETED,I,this),ba.on(o.default.LIVE_EDGE_SEARCH_COMPLETED,J,this),ba.on(o.default.BYTES_APPENDED,X,this),ba.on(o.default.BUFFER_LEVEL_STATE_CHANGED,Y,this),ba.on(o.default.PERIOD_SWITCH_STARTED,c,this),ta&&(ta=!1,j())}function c(a){a.fromStreamInfo&&pa[a.fromStreamInfo.id]&&delete pa[a.fromStreamInfo.id]}function d(){return C(!0)+qa.duration-r()}function e(){return r()>0}function f(){return qa.id}function h(){return qa.duration}function j(){if(da){da.autoplay=!0;var a=da.play();a&&"undefined"!=typeof Promise&&a instanceof Promise&&a.catch(function(a){"NotAllowedError"===a.name&&ba.trigger(o.default.PLAYBACK_NOT_ALLOWED),aa("Caught pending play exception - continuing ("+a+")")})}else ta=!0}function l(){if(da)return da.paused}function n(){da&&(da.pause(),da.autoplay=!1)}function p(){if(da)return da.seeking}function q(a){la&&(aa("Requesting seek to time: "+a),la.setCurrentTime(a))}function r(){if(da)return da.currentTime}function t(){if(da)return da.playbackRate}function u(){if(da)return da.played}function v(){if(da)return da.ended}function w(){return ra}function x(a){na=a}function y(){return na}function z(a,b){var c=ja.getMpd(ia.getValue()),d=void 0,e=10;d=sa.getUseSuggestedPresentationDelay()&&c.hasOwnProperty("suggestedPresentationDelay")?c.suggestedPresentationDelay:sa.getLiveDelay()?sa.getLiveDelay():isNaN(a)?2*qa.manifestInfo.minBufferTime:a*sa.getLiveDelayFragmentCount();var f=Math.max(b-e,b/2);return Math.min(d,f)}function A(){la&&da&&(ba.off(o.default.DATA_UPDATE_COMPLETED,I,this),ba.off(o.default.BUFFER_LEVEL_STATE_CHANGED,Y,this),ba.off(o.default.LIVE_EDGE_SEARCH_COMPLETED,J,this),ba.off(o.default.BYTES_APPENDED,X,this),F(),$()),la=null,qa=null,da=null,ra=null,a()}function B(a){a&&(a.streamController&&(ea=a.streamController),a.timelineConverter&&(fa=a.timelineConverter),a.metricsModel&&(ga=a.metricsModel),a.dashMetrics&&(ha=a.dashMetrics),a.manifestModel&&(ia=a.manifestModel),a.dashManifestModel&&(ja=a.dashManifestModel),a.adapter&&(ka=a.adapter),a.videoModel&&(la=a.videoModel))}function C(a){var b=void 0,c=(0,i.default)(_).getInstance().getURIFragmentData(),d=parseInt(c.s,10),e=parseInt(c.t,10),f=NaN;if(a||(f=isNaN(d)?e:d),ra)!isNaN(f)&&f>1262304e3&&(b=f-qa.manifestInfo.availableFrom.getTime()/1e3,(b>na||b<na-qa.manifestInfo.DVRWindowSize)&&(b=null)),b=b||na;else if(!isNaN(f)&&f<Math.max(qa.manifestInfo.duration,qa.duration)&&f>=0)b=f;else{var g=pa[qa.id];void 0===g&&(g=ea.getActiveStreamCommonEarliestTime()),b=Math.max(g,qa.start)}return b}function D(a){var b,c=ga.getReadOnlyMetricsFor("video")||ga.getReadOnlyMetricsFor("audio"),d=ha.getCurrentDVRInfo(c),e=d?d.range:null;return e?a>=e.start&&a<=e.end?a:b=Math.max(e.end-2*qa.manifestInfo.minBufferTime,e.start):NaN}function E(){if(null===oa){var a=function(){W()};oa=setInterval(a,sa.getWallclockTimeUpdateInterval())}}function F(){clearInterval(oa),oa=null}function G(){var a=C(!1);a>0&&(q(a),aa("Starting playback at offset: "+a))}function H(){if(!l()&&ra&&0!==da.readyState){var a=r(),b=D(a),c=!isNaN(b)&&b!==a;c&&q(b)}}function I(a){if(!a.error){var b=ka.convertDataToTrack(ia.getValue(),a.currentRepresentation),c=b.mediaInfo.streamInfo;qa.id===c.id&&(qa=c,H())}}function J(a){a.error||0===da.readyState||G()}function K(){ba.trigger(o.default.CAN_PLAY)}function L(){aa("Native video element event: play"),H(),E(),ba.trigger(o.default.PLAYBACK_STARTED,{startTime:r()})}function M(){aa("Native video element event: playing"),ba.trigger(o.default.PLAYBACK_PLAYING,{playingTime:r()})}function N(){aa("Native video element event: pause"),ba.trigger(o.default.PLAYBACK_PAUSED,{ended:v()})}function O(){var a=r();aa("Seeking to: "+a),E(),ba.trigger(o.default.PLAYBACK_SEEKING,{seekTime:a})}function P(){aa("Native video element event: seeked"),ba.trigger(o.default.PLAYBACK_SEEKED)}function Q(){var a=r();a!==ma&&(ma=a,ba.trigger(o.default.PLAYBACK_TIME_UPDATED,{timeToEnd:d(),time:a}))}function R(){ba.trigger(o.default.PLAYBACK_PROGRESS)}function S(){var a=t();aa("Native video element event: ratechange: ",a),ba.trigger(o.default.PLAYBACK_RATE_CHANGED,{playbackRate:a})}function T(){aa("Native video element event: loadedmetadata"),(!ra&&qa.isFirst||fa.isTimeSyncCompleted())&&G(),ba.trigger(o.default.PLAYBACK_METADATA_LOADED),E()}function U(){aa("Native video element event: ended"),n(),F(),ba.trigger(o.default.PLAYBACK_ENDED)}function V(a){var b=a.target||a.srcElement;ba.trigger(o.default.PLAYBACK_ERROR,{error:b.error})}function W(){ba.trigger(o.default.WALLCLOCK_TIME_UPDATED,{isDynamic:ra,time:new Date})}function X(a){var b=a.bufferedRanges;if(b&&b.length){var c=Math.max(b.start(0),qa.start),d=void 0===pa[qa.id]?c:Math.max(pa[qa.id],c);d!==pa[qa.id]&&(!ra&&C(!0)<d&&r()<d&&q(d),pa[qa.id]=d)}}function Y(a){a.streamInfo.id===qa.id&&la.setStallState(a.mediaType,a.state===g.default.BUFFER_EMPTY)}function Z(){da.addEventListener("canplay",K),da.addEventListener("play",L),da.addEventListener("playing",M),da.addEventListener("pause",N),da.addEventListener("error",V),da.addEventListener("seeking",O),da.addEventListener("seeked",P),da.addEventListener("timeupdate",Q),da.addEventListener("progress",R),da.addEventListener("ratechange",S),da.addEventListener("loadedmetadata",T),da.addEventListener("ended",U)}function $(){da.removeEventListener("canplay",K),da.removeEventListener("play",L),da.removeEventListener("playing",M),da.removeEventListener("pause",N),da.removeEventListener("error",V),da.removeEventListener("seeking",O),da.removeEventListener("seeked",P),da.removeEventListener("timeupdate",Q),da.removeEventListener("progress",R),da.removeEventListener("ratechange",S),da.removeEventListener("loadedmetadata",T),da.removeEventListener("ended",U)}var _=this.context,aa=(0,s.default)(_).getInstance().log,ba=(0,m.default)(_).getInstance(),ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0;return ca={initialize:b,setConfig:B,getStreamStartTime:C,getTimeToStreamEnd:d,isPlaybackStarted:e,getStreamId:f,getStreamDuration:h,getTime:r,getPlaybackRate:t,getPlayedRanges:u,getEnded:v,getIsDynamic:w,setLiveStartTime:x,getLiveStartTime:y,computeLiveDelay:z,play:j,isPaused:l,pause:n,isSeeking:p,seek:q,reset:A},a(),ca}Object.defineProperty(c,"__esModule",{value:!0});var f=a(60),g=d(f),h=a(77),i=d(h),j=a(75),k=d(j),l=a(7),m=d(l),n=a(11),o=d(n),p=a(8),q=d(p),r=a(6),s=d(r);e.__dashjs_factory_name="PlaybackController",c.default=q.default.getSingletonFactory(e),b.exports=c.default},{11:11,6:6,60:60,7:7,75:75,77:77,8:8}],66:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){wa=!0,Ra=NaN,Qa=NaN,Sa=[],xa=!1,ya=null,za=null,Aa=!0,Ba=!1,Ca=0,Ea=NaN}function c(a,b){ra=a,Ia=b,La=(0,F.default)(ga).getInstance(),Fa=(0,h.default)(ga).getInstance(),Ga=(0,n.default)(ga).getInstance(),Ha=(0,j.default)(ga).getInstance(),Ja=(0,N.default)(ga).getInstance(),Ka=Ia.getFragmentController(),Ma=Ia.getBufferController(),ta=Ka.getModel(ra),ta.setScheduleController(this),ua=Ia.isDynamic(),Pa=pa.getScheduleWhilePaused(),Na=(0,p.default)(ga).create({dashMetrics:(0,z.default)(ga).getInstance(),metricsModel:(0,v.default)(ga).getInstance(),textSourceBuffer:(0,t.default)(ga).getInstance()}),Oa=(0,r.default)(ga).create({adapter:(0,B.default)(ga).getInstance(),sourceBufferController:(0,D.default)(ga).getInstance(),textSourceBuffer:(0,t.default)(ga).getInstance()}),na.getIsTextTrack(ra)&&ia.on(J.default.TIMED_TEXT_REQUESTED,R,this),ia.on(J.default.LIVE_EDGE_SEARCH_COMPLETED,V,this),ia.on(J.default.QUALITY_CHANGE_REQUESTED,s,this),ia.on(J.default.DATA_UPDATE_STARTED,K,this),ia.on(J.default.DATA_UPDATE_COMPLETED,w,this),ia.on(J.default.FRAGMENT_LOADING_COMPLETED,C,this),ia.on(J.default.STREAM_COMPLETED,A,this),ia.on(J.default.STREAM_INITIALIZED,y,this),ia.on(J.default.BUFFER_LEVEL_STATE_CHANGED,M,this),ia.on(J.default.BUFFER_CLEARED,L,this),ia.on(J.default.BYTES_APPENDED,G,this),ia.on(J.default.INIT_REQUESTED,m,this),ia.on(J.default.QUOTA_EXCEEDED,O,this),ia.on(J.default.BUFFER_LEVEL_STATE_CHANGED,M,this),ia.on(J.default.PLAYBACK_STARTED,S,this),ia.on(J.default.PLAYBACK_SEEKING,T,this),ia.on(J.default.PLAYBACK_RATE_CHANGED,U,this),ia.on(J.default.PLAYBACK_TIME_UPDATED,E,this),ia.on(J.default.URL_RESOLUTION_FAILED,Q,this),ia.on(J.default.FRAGMENT_LOADING_ABANDONED,I,this)}
44061function d(){sa&&(ea(),xa=!1,wa?o(va.quality):k(0),wa&&(wa=!1),ha("Schedule controller starting for "+ra))}function e(){xa||(xa=!0,clearTimeout(Da),ha("Schedule controller stopping for "+ra))}function g(){if(!(xa||Ba||!Ma||Fa.isPaused()&&!Pa)){i();var a=Sa.length>0,b=Na.execute(Ia,ra,Ja.isVideoTrackPresent());if(b||a){var c=function(){if(va.quality!==Ra)Ra=va.quality,Ma.switchInitData(Ia.getStreamInfo().id,va.quality);else{var a=Oa.execute(Ia,Sa.shift());a?ta.executeRequest(a):(Ba=!1,k(250))}};Ba=!0,a?c():Ha.getPlaybackQuality(Ia,c)}else k(500)}}function i(){var a=1.5*va.fragmentDuration,b=ta.getRequests({state:x.default.FRAGMENT_MODEL_EXECUTED,time:Fa.getTime()+a,threshold:0})[0];b&&Sa.indexOf(b)===-1&&!na.getIsTextTrack(ra)&&(!Ga.isCurrentTrack(b.mediaInfo)||pa.getFastSwitchEnabled()&&b.quality<va.quality&&Ma.getBufferLevel()>=a&&Ha.getAbandonmentStateFor(ra)!==j.default.ABANDON_LOAD?(q(b),ha("Reloading outdated fragment at index: ",b.index)):b.quality>va.quality&&X(Fa.getTime()+Ma.getBufferLevel()))}function k(a){clearTimeout(Da),Da=setTimeout(g,a)}function m(a){a.sender.getStreamProcessor()===Ia&&o(va.quality)}function o(a){Ra=a;var b=la.getInitRequest(Ia,a);b&&(Ba=!0,ta.executeRequest(b))}function q(a){Sa.push(a)}function s(a){if(ra===a.mediaType&&Ia.getStreamInfo().id===a.streamInfo.id){if(va=Ia.getRepresentationInfoForQuality(a.newQuality),null===va||void 0===va)throw new Error("Unexpected error! - currentRepresentationInfo is null or undefined");da(new Date,f.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),ea()}}function u(a){var b=ta.getRequests({state:x.default.FRAGMENT_MODEL_EXECUTED,time:Fa.getTime(),threshold:0})[0];b&&Fa.getTime()>=b.startTime&&(b.quality!==Qa&&a&&ia.trigger(J.default.QUALITY_CHANGE_RENDERED,{mediaType:ra,oldQuality:Qa,newQuality:b.quality}),Qa=b.quality)}function w(a){a.error||a.sender.getStreamProcessor()!==Ia||(va=la.convertDataToTrack(ka.getValue(),a.currentRepresentation))}function y(a){a.error||Ia.getStreamInfo().id!==a.streamInfo.id||(va=Ia.getCurrentRepresentationInfo(),ua&&null===La.getLiveEdge()||(sa=!0),xa&&d())}function A(a){a.fragmentModel===ta&&(e(),Ba=!1,ha("Stream is complete"))}function C(a){a.sender===ta&&(na.getIsTextTrack(ra)&&(Ba=!1),a.error&&a.serviceLocation&&!xa&&q(a.request))}function E(){u(!0)}function G(a){a.sender.getStreamProcessor()===Ia&&(Ba=!1,k(0))}function I(a){a.streamProcessor===Ia&&(q(a.request),Ba=!1,k(0))}function K(a){a.sender.getStreamProcessor()===Ia&&e()}function L(a){a.sender.getStreamProcessor()===Ia&&(ta.removeExecutedRequestsBeforeTime(a.to),a.hasEnoughSpaceToAppend&&!Ma.getIsBufferingCompleted()&&xa&&d())}function M(a){a.sender.getStreamProcessor()!==Ia||a.state!==l.default.BUFFER_EMPTY||Fa.isSeeking()||(ha("Buffer is empty! Stalling!"),da(new Date,f.PlayListTrace.REBUFFERING_REASON))}function O(a){a.sender.getStreamProcessor()===Ia&&e()}function Q(){ta.abortRequests(),e()}function R(a){a.sender.getStreamProcessor()===Ia&&o(a.index)}function S(){xa&&d()}function T(a){Ea=a.seekTime,Z(0),xa&&d();var b=ma.getCurrentManifestUpdate(ja.getMetricsFor("stream")),c=va.DVRWindow?va.DVRWindow.end-Fa.getTime():NaN;ja.updateManifestUpdateInfo(b,{latency:c})}function U(a){za&&(za.playbackspeed=a.playbackRate.toString())}function V(a){if(!a.error){var b=va.mediaInfo.streamInfo.manifestInfo.DVRWindowSize/2,c=a.liveEdge-Fa.computeLiveDelay(va.fragmentDuration,b),e=ma.getCurrentManifestUpdate(ja.getMetricsFor("stream")),f=Fa.getLiveStartTime(),g=la.getFragmentRequestForTime(Ia,va,c,{ignoreIsFinished:!0});Ea=f,(isNaN(f)||g.startTime>f)&&(Fa.setLiveStartTime(g.startTime),Ea=g.startTime),ja.updateManifestUpdateInfo(e,{currentTime:Ea,presentationStartTime:a.liveEdge,latency:a.liveEdge-Ea,clientTimeOffset:oa.getClientTimeOffset()}),sa=!0,xa&&d()}}function W(){return Ea}function X(a){Ea=a}function Y(){return ta}function Z(a){Ca=a}function $(){return Ca}function _(){return Ia}function aa(){return Na.getBufferTarget(Ia,ra,Ja.isVideoTrackPresent())}function ba(a){ya=a}function ca(a,b){da(a,b),ya=null}function da(a,b){if(ya&&Aa===!1){var c=za.start,d=a.getTime()-c.getTime();za.duration=d,za.stopreason=b,ya.trace.push(za),Aa=!0}}function ea(){ya&&Aa===!0&&va&&(Aa=!1,za=new f.PlayListTrace,za.representationid=va.id,za.start=new Date,za.mstart=1e3*Fa.getTime(),za.playbackspeed=Fa.getPlaybackRate().toString())}function fa(){ia.off(J.default.LIVE_EDGE_SEARCH_COMPLETED,V,this),ia.off(J.default.DATA_UPDATE_STARTED,K,this),ia.off(J.default.DATA_UPDATE_COMPLETED,w,this),ia.off(J.default.BUFFER_LEVEL_STATE_CHANGED,M,this),ia.off(J.default.QUALITY_CHANGE_REQUESTED,s,this),ia.off(J.default.FRAGMENT_LOADING_COMPLETED,C,this),ia.off(J.default.STREAM_COMPLETED,A,this),ia.off(J.default.STREAM_INITIALIZED,y,this),ia.off(J.default.QUOTA_EXCEEDED,O,this),ia.off(J.default.BYTES_APPENDED,G,this),ia.off(J.default.BUFFER_CLEARED,L,this),ia.off(J.default.INIT_REQUESTED,m,this),ia.off(J.default.PLAYBACK_RATE_CHANGED,U,this),ia.off(J.default.PLAYBACK_SEEKING,T,this),ia.off(J.default.PLAYBACK_STARTED,S,this),ia.off(J.default.PLAYBACK_TIME_UPDATED,E,this),ia.off(J.default.URL_RESOLUTION_FAILED,Q,this),ia.off(J.default.FRAGMENT_LOADING_ABANDONED,I,this),na.getIsTextTrack(ra)&&ia.off(J.default.TIMED_TEXT_REQUESTED,R,this),e(),u(!1),Ba=!1,Ca=0,Ea=NaN,Fa=null,ya=null}var ga=this.context,ha=(0,P.default)(ga).getInstance().log,ia=(0,H.default)(ga).getInstance(),ja=a.metricsModel,ka=a.manifestModel,la=a.adapter,ma=a.dashMetrics,na=a.dashManifestModel,oa=a.timelineConverter,pa=a.mediaPlayerModel,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0,Ka=void 0,La=void 0,Ma=void 0,Na=void 0,Oa=void 0,Pa=void 0,Qa=void 0,Ra=void 0,Sa=void 0;return qa={initialize:c,getStreamProcessor:_,getSeekTarget:W,setSeekTarget:X,getFragmentModel:Y,setTimeToLoadDelay:Z,getTimeToLoadDelay:$,replaceRequest:q,start:d,stop:e,reset:fa,setPlayList:ba,getBufferTarget:aa,finalisePlayList:ca},b(),qa}Object.defineProperty(c,"__esModule",{value:!0});var f=a(132),g=a(65),h=d(g),i=a(57),j=d(i),k=a(60),l=d(k),m=a(63),n=d(m),o=a(91),p=d(o),q=a(92),r=d(q),s=a(53),t=d(s),u=a(76),v=d(u),w=a(73),x=d(w),y=a(15),z=d(y),A=a(13),B=d(A),C=a(67),D=d(C),E=a(105),F=d(E),G=a(7),H=d(G),I=a(11),J=d(I),K=a(8),L=d(K),M=a(68),N=d(M),O=a(6),P=d(O);e.__dashjs_factory_name="ScheduleController",c.default=L.default.getClassFactory(e),b.exports=c.default},{105:105,11:11,13:13,132:132,15:15,53:53,57:57,6:6,60:60,63:63,65:65,67:67,68:68,7:7,73:73,76:76,8:8,91:91,92:92}],67:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){var c=b.codec,d=null;try{if(c.match(/application\/mp4;\s*codecs="(stpp|wvtt)"/i))throw new y.default("not really supported");d=a.addSourceBuffer(c)}catch(e){if(!b.isText&&c.indexOf('codecs="stpp"')===-1&&c.indexOf('codecs="wvtt"')===-1)throw e;d=(0,g.default)(t).getInstance(),d.setConfig({errHandler:(0,m.default)(t).getInstance(),adapter:(0,k.default)(t).getInstance(),dashManifestModel:z,mediaController:(0,i.default)(t).getInstance(),videoModel:(0,w.default)(t).getInstance(),streamController:(0,o.default)(t).getInstance(),textTracks:(0,q.default)(t).getInstance(),VTTParser:(0,s.default)(t).getInstance(),TTMLParser:(0,u.default)(t).getInstance()})}return d}function b(a,b){try{a.removeSourceBuffer(b)}catch(c){}}function c(a,b,c){var d,e,f=null,g=0,h=0,i=null,j=null,k=0,l=c||.15;try{f=a.buffered}catch(m){return null}if(null!==f&&void 0!==f){for(e=0,d=f.length;e<d;e++)if(g=f.start(e),h=f.end(e),null===i)k=Math.abs(g-b),b>=g&&b<h?(i=g,j=h):k<=l&&(i=g,j=h);else{if(k=g-j,!(k<=l))break;j=h}if(null!==i)return{start:i,end:j}}return null}function d(a){var b=null;try{return b=a.buffered}catch(c){return null}}function e(a){var b,c,e=d(a),f=0;if(!e)return f;for(c=0,b=e.length;c<b;c++)f+=e.end(c)-e.start(c);return f}function f(a,b,d){var e,f;return e=c(a,b,d),f=null===e?0:e.end-b}function h(a,b){if(!b)return null;var c,e,f,g,h,i,j,k,l,m=d(b);if(!m)return null;for(var n=0,o=m.length;n<o;n++){if(k=a.length>n,h=k?{start:a.start(n),end:a.end(n)}:null,c=m.start(n),e=m.end(n),!h)return l={start:c,end:e};if(f=h.start===c,g=h.end===e,!f||!g){if(f)l={start:h.end,end:e};else{if(!g)return l={start:c,end:e};l={start:c,end:h.start}}return i=a.length>n+1?{start:a.start(n+1),end:a.end(n+1)}:null,j=n+1<o?{start:m.start(n+1),end:m.end(n+1)}:null,!i||j&&j.start===i.start&&j.end===i.end||(l.end=i.start),l}}return null}function j(a,b){var c=b.bytes,d="append"in a?"append":"appendBuffer"in a?"appendBuffer":null,e="Object"===Object.prototype.toString.call(a).slice(8,-1);if(d)try{r(a,function(){e?a[d](c,b):a[d](c),r(a,function(){v.trigger(C.default.SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:c})})})}catch(f){v.trigger(C.default.SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:c,error:new y.default(f.code,f.message,null)})}}function l(a,b,c,d){try{r(a,function(){b>=0&&c>b&&"ended"!==d.readyState&&a.remove(b,c),r(a,function(){v.trigger(C.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c})})})}catch(e){v.trigger(C.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c,error:new y.default(e.code,e.message,null)})}}function n(a,b){try{"open"===a.readyState?b.abort():b.setTextTrack&&"ended"===a.readyState&&b.abort()}catch(c){}}function p(a){a&&a.dashManifestModel&&(z=a.dashManifestModel)}function r(a,b){var c,d=50,e=function(){a.updating||(clearInterval(c),b())},f=function c(){a.updating||(a.removeEventListener("updateend",c,!1),b())};if(!a.updating)return void b();if("function"==typeof a.addEventListener)try{a.addEventListener("updateend",f,!1)}catch(g){c=setInterval(e,d)}else c=setInterval(e,d)}var t=this.context,v=(0,A.default)(t).getInstance(),x=void 0,z=void 0;return x={append:j,remove:l,abort:n,createSourceBuffer:a,removeSourceBuffer:b,getBufferRange:c,getAllRanges:d,getTotalBufferedTime:e,getBufferLength:f,getRangeDifference:h,setConfig:p}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(53),g=d(f),h=a(63),i=d(h),j=a(13),k=d(j),l=a(102),m=d(l),n=a(68),o=d(n),p=a(54),q=d(p),r=a(110),s=d(r),t=a(108),u=d(t),v=a(78),w=d(v),x=a(113),y=d(x),z=a(7),A=d(z),B=a(11),C=d(B),D=a(8),E=d(D),F=22;e.__dashjs_factory_name="SourceBufferController";var G=E.default.getSingletonFactory(e);G.QUOTA_EXCEEDED_ERROR_CODE=F,c.default=G,b.exports=c.default},{102:102,108:108,11:11,110:110,113:113,13:13,53:53,54:54,63:63,68:68,7:7,78:78,8:8}],68:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){oa=null,ma=[],ya=(0,u.default)(V).getInstance(),qa=!0,ra=!1,sa=!1,za=!1,Aa=!0,Ba=null,ta=!1,ua=!1}function b(a,b){qa=a,pa=b,la.initialize(),ja=(0,B.default)(V).getInstance(),$=(0,k.default)(V).getInstance(),$.setConfig({log:W,manifestModel:aa,dashManifestModel:ba}),$.initialize(_),wa=(0,s.default)(V).getInstance(),xa=(0,g.default)(V).getInstance(),xa.setConfig({streamController:Y,timelineConverter:la,metricsModel:da,dashMetrics:ea,manifestModel:aa,dashManifestModel:ba,adapter:ca,videoModel:wa}),X.on(o.default.TIME_SYNCHRONIZATION_COMPLETED,I,this),X.on(o.default.PLAYBACK_SEEKING,n,this),X.on(o.default.PLAYBACK_TIME_UPDATED,j,this),X.on(o.default.PLAYBACK_ENDED,l,this),X.on(o.default.PLAYBACK_ERROR,h,this),X.on(o.default.PLAYBACK_STARTED,p,this),X.on(o.default.PLAYBACK_PAUSED,r,this),X.on(o.default.MANIFEST_UPDATED,J,this),X.on(o.default.STREAM_BUFFERING_COMPLETED,t,this)}function c(a,b){b=b||new Date,Ba&&(na&&na.getProcessors().forEac
44061h(function(c){var d=c.getScheduleController();d&&d.finalisePlayList(b,a)}),da.addPlayList(Ba),Ba=null)}function d(a){Ba=new x.PlayList,Ba.start=new Date,Ba.mstart=1e3*xa.getTime(),Ba.starttype=a,na&&na.getProcessors().forEach(function(a){var b=a.getScheduleController();b&&b.setPlayList(Ba)})}function e(a,b,c){X.trigger(a,{fromStreamInfo:b?b.getStreamInfo():null,toStreamInfo:c.getStreamInfo()})}function f(){na.isActivated()&&Aa&&0===na.getStreamInfo().index&&(na.startEventController(),qa&&xa.play())}function h(a){if(a.error){var b="";switch(a.error.code){case 1:b="MEDIA_ERR_ABORTED";break;case 2:b="MEDIA_ERR_NETWORK";break;case 3:b="MEDIA_ERR_DECODE";break;case 4:b="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:b="MEDIA_ERR_ENCRYPTED";break;default:b="UNKNOWN"}ta=!0,a.error.msExtendedCode&&(b+=" (0x"+(a.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),W("Video Element Error: "+b),a.error&&W(a.error),ka.mediaSourceError(b),T()}}function j(a){if(K()){var b=wa.getPlaybackQuality();b&&da.addDroppedFrames("video",b)}xa.isSeeking()||a.timeToEnd<U&&ga.signalEndOfStream(va)}function l(){var a=v();a&&C(na,a,NaN),c(a?x.PlayListTrace.END_OF_PERIOD_STOP_REASON:x.PlayListTrace.END_OF_CONTENT_STOP_REASON)}function n(a){var b=w(a.seekTime);b&&b!==na?(c(x.PlayListTrace.END_OF_PERIOD_STOP_REASON),C(na,b,a.seekTime)):c(x.PlayListTrace.USER_REQUEST_STOP_REASON),d(x.PlayList.SEEK_START_REASON)}function p(){Aa?(Aa=!1,d(x.PlayList.INITIAL_PLAYOUT_START_REASON)):za&&(za=!1,d(x.PlayList.RESUME_FROM_PAUSE_START_REASON))}function r(a){a.ended||(za=!0,c(x.PlayListTrace.USER_REQUEST_STOP_REASON))}function t(a){va&&a.streamInfo.isLast&&ga.signalEndOfStream(va)}function v(){var a=na.getStreamInfo().start,b=na.getStreamInfo().duration;return ma.filter(function(c){return c.getStreamInfo().start===a+b})[0]}function w(a){var b=0,c=null,d=ma.length;d>0&&(b+=ma[0].getStartTime());for(var e=0;e<d;e++)if(c=ma[e],b+=c.getDuration(),a<b)return c;return null}function y(a,b){for(var c=null,d=0,e=0,f=null,g=ma.length,h=0;h<g;h++){if(c=ma[h],e=c.getStartTime(),f=c.getDuration(),Number.isFinite(e)&&(d=e),c.getId()===b)return a-d;Number.isFinite(f)&&(d+=f)}return null}function A(){var a=[];
44061return na.getProcessors().forEach(function(b){a.push(b.getIndexHandler().getEarliestTime())}),Math.min.apply(Math,a)}function C(a,b,c){function d(){isNaN(c)?!function(){var a=xa.getStreamStartTime(!0); 44062na.getProcessors().forEach(function(b){ca.setIndexHandlerTime(b,a)}),xa.seek(a)}():xa.seek(c),xa.play(),na.startEventController(),ra=!1,e(o.default.PERIOD_SWITCH_COMPLETED,a,b)}!ra&&a&&b&&a!==b&&(ra=!0,e(o.default.PERIOD_SWITCH_STARTED,a,b),a.deactivate(),na=b,xa.initialize(na.getStreamInfo()),Ca=L(),D(d))}function D(a){function b(){W("MediaSource is open!"),window.URL.revokeObjectURL(c),va.removeEventListener("sourceopen",b),va.removeEventListener("webkitsourceopen",b),E(),na.activate(va),a&&a()}var c=void 0;va?ga.detachMediaSource(wa):va=ga.createMediaSource(),va.addEventListener("sourceopen",b,!1),va.addEventListener("webkitsourceopen",b,!1),c=ga.attachMediaSource(va,wa),W("MediaSource attached to element. Waiting on open...")}function E(){var a,b;a=na.getStreamInfo().manifestInfo.duration,b=ga.setDuration(va,a),W("Duration successfully set to: "+b)}function F(){var a,b,c,d,f,g,h,j=aa.getValue(),k=da.getMetricsFor("stream"),l=ea.getCurrentManifestUpdate(k),m=[];if(j){g=ca.getStreamsInfo(j),oa&&(X.trigger(o.default.PROTECTION_CREATED,{controller:oa,manifest:j}),oa.setMediaElement(wa.getElement()),pa&&oa.setProtectionData(pa));try{if(0===g.length)throw new Error("There are no streams");for(da.updateManifestUpdateInfo(l,{currentTime:xa.getTime(),buffered:wa.getElement().buffered,presentationStartTime:g[0].start,clientTimeOffset:la.getClientTimeOffset()}),sa=!0,d=0,b=g.length;d<b;d++){for(a=g[d],f=0,c=ma.length;f<c;f++)ma[f].getId()===a.id&&(h=ma[f],m.push(h),h.updateData(a));h||(h=(0,i.default)(V).create({manifestModel:aa,manifestUpdater:$,adapter:ca,timelineConverter:la,capabilities:Z,errHandler:ka,baseURLController:ia}),h.initialize(a,oa),X.on(o.default.STREAM_INITIALIZED,H,this),m.push(h),na&&h.updateData(a)),da.addManifestUpdateStreamInfo(l,a.id,a.index,a.start,a.duration),h=null}ma=m,na||(na=ma[0],e(o.default.PERIOD_SWITCH_STARTED,null,na),xa.initialize(na.getStreamInfo()),e(o.default.PERIOD_SWITCH_COMPLETED,null,na)),va||D(),sa=!1,G()}catch(n){ka.manifestError(n.message,"nostreamscomposed",j),ua=!0,T()}}}function G(){if(!sa){var a=ma.length,b=0;for(f(),b;b<a;b++)if(!ma[b].isInitialized())return;X.trigger(o.default.STREAMS_COMPOSED)}}function H(){G()}function I(){F()}function J(a){if(a.error)ua=!0,T();else{var b,c,d=a.manifest,e=ca.getStreamsInfo(d)[0],f=ca.getMediaInfoForType(d,e,"video")||ca.getMediaInfoForType(d,e,"audio");f&&(b=ca.getDataForMedia(f),c=ba.getRepresentationsForAdaptation(d,b)[0].useCalculatedLiveEdgeTime,c&&(W("SegmentTimeline detected using calculated Live Edge Time"),ya.setUseManifestDateHeaderTimeSource(!1)));var g=ba.getUTCTimingSources(a.manifest),h=!ba.getIsDynamic(d)||c?g:g.concat(ya.getUTCTimingSources()),i=(0,q.default)(V).getInstance().isManifestHTTPS();h.forEach(function(a){a.value.replace(/.*?:\/\//g,"")===u.default.DEFAULT_UTC_TIMING_SOURCE.value.replace(/.*?:\/\//g,"")&&(a.value=a.value.replace(i?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),i?"https://":"http://"),W("Matching default timing source protocol to manifest protocol: ",a.value))}),ia.initialize(d),ha.setConfig({metricsModel:da,dashMetrics:ea}),ha.initialize(h,ya.getUseManifestDateHeaderTimeSource())}}function K(){return void 0===Ca&&(Ca=L()),Ca}function L(){var a=!1;
44062return na.getProcessors().forEach(function(b){"video"===b.getMediaInfo().type&&(a=!0)}),a}function M(){return qa}function N(){return na?na.getStreamInfo():null}function O(a){return na.getId()===a.id}function P(a){return ma.filter(function(b){return b.getId()===a})[0]}function Q(a){_.load(a)}function R(a){$.setManifest(a)}function S(a){a&&(a.capabilities&&(Z=a.capabilities),a.manifestLoader&&(_=a.manifestLoader),a.manifestModel&&(aa=a.manifestModel),a.dashManifestModel&&(ba=a.dashManifestModel),a.protectionController&&(oa=a.protectionController),a.adapter&&(ca=a.adapter),a.metricsModel&&(da=a.metricsModel),a.dashMetrics&&(ea=a.dashMetrics),a.liveEdgeFinder&&(fa=a.liveEdgeFinder),a.mediaSourceController&&(ga=a.mediaSourceController),a.timeSyncController&&(ha=a.timeSyncController),a.baseURLController&&(ia=a.baseURLController),a.errHandler&&(ka=a.errHandler),a.timelineConverter&&(la=a.timelineConverter))}function T(){ha.reset(),c(ta||ua?x.PlayListTrace.FAILURE_STOP_REASON:x.PlayListTrace.USER_REQUEST_STOP_REASON);for(var a=0,b=ma.length;a<b;a++){var d=ma[a];X.off(o.default.STREAM_INITIALIZED,H,this),d.reset(ta)}ma=[],X.off(o.default.PLAYBACK_TIME_UPDATED,j,this),X.off(o.default.PLAYBACK_SEEKING,n,this),X.off(o.default.PLAYBACK_ERROR,h,this),X.off(o.default.PLAYBACK_STARTED,p,this),X.off(o.default.PLAYBACK_PAUSED,r,this),X.off(o.default.PLAYBACK_ENDED,l,this),X.off(o.default.MANIFEST_UPDATED,J,this),X.off(o.default.STREAM_BUFFERING_COMPLETED,t,this),ia.reset(),$.reset(),da.clearAllCurrentMetrics(),aa.setValue(null),_.reset(),la.reset(),fa.reset(),ca.reset(),ja.reset(),ra=!1,sa=!1,na=null,ta=!1,ua=!1,Ca=void 0,Aa=!0,za=!1,va&&(ga.detachMediaSource(wa),va=null),wa=null,oa&&(oa.setMediaElement(null),oa=null,pa=null,aa.getValue()&&X.trigger(o.default.PROTECTION_DESTROYED,{data:aa.getValue().url})),X.trigger(o.default.STREAM_TEARDOWN_COMPLETE)}var U=1,V=this.context,W=(0,z.default)(V).getInstance().log,X=(0,m.default)(V).getInstance(),Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0;return Y={initialize:b,getAutoPlay:M,getActiveStreamInfo:N,isStreamActive:O,isVideoTrackPresent:K,getStreamById:P,getTimeRelativeToStreamId:y,load:Q,loadWithManifest:R,getActiveStreamCommonEarliestTime:A,setConfig:S,reset:T},a(),Y}Object.defineProperty(c,"__esModule",{value:!0});var f=a(65),g=d(f),h=a(51),i=d(h),j=a(48),k=d(j),l=a(7),m=d(l),n=a(11),o=d(n),p=a(77),q=d(p),r=a(78),s=d(r),t=a(75),u=d(t),v=a(8),w=d(v),x=a(132),y=a(6),z=d(y),A=a(103),B=d(A);e.__dashjs_factory_name="StreamController",c.default=w.default.getSingletonFactory(e),b.exports=c.default},{103:103,11:11,132:132,48:48,51:51,6:6,65:65,7:7,75:75,77:77,78:78,8:8}],69:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){s=!1,t=null,u=null,v=null,w=null,x=null,o.on(i.default.DATA_UPDATE_COMPLETED,l,this),o.on(i.default.INIT_FRAGMENT_LOADED,m,this)}function c(a,b,c){v=a,h(b),w=c,x=w.getRepresentationController()}function d(a){try{u=p.createSourceBuffer(t,a),s||(u.hasOwnProperty("initialize")&&u.initialize(v,this),s=!0)}catch(b){q.mediaSourceError("Error creating "+v+" source buffer.")}return u}function e(){return u}function f(a){u=a}function h(a){t=a}function j(){return w}function k(a){o.off(i.default.DATA_UPDATE_COMPLETED,l,this),o.off(i.default.INIT_FRAGMENT_LOADED,m,this),a||(p.abort(t,u),p.removeSourceBuffer(t,u))}function l(a){a.sender.getStreamProcessor()===w&&o.trigger(i.default.TIMED_TEXT_REQUESTED,{index:0,sender:a.sender})}function m(a){a.fragmentModel===w.getFragmentModel()&&a.chunk.bytes&&p.append(u,a.chunk)}var n=this.context,o=(0,g.default)(n).getInstance(),p=a.sourceBufferController,q=a.errHandler,r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,x=void 0;return r={initialize:c,createBuffer:d,getBuffer:e,setBuffer:f,getStreamProcessor:j,setMediaSource:h,reset:k},b(),r}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j);e.__dashjs_factory_name="TextController",c.default=k.default.getClassFactory(e),b.exports=c.default},{11:11,7:7,8:8}],70:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){H=b,E=0,F=!1,G=!1,I={"urn:mpeg:dash:utc:http-head:2014":v,"urn:mpeg:dash:utc:http-xsdate:2014":u.bind(null,m),"urn:mpeg:dash:utc:http-iso:2014":u.bind(null,n),"urn:mpeg:dash:utc:direct:2014":t,"urn:mpeg:dash:utc:http-head:2012":v,"urn:mpeg:dash:utc:http-xsdate:2012":u.bind(null,m),"urn:mpeg:dash:utc:http-iso:2012":u.bind(null,n),"urn:mpeg:dash:utc:direct:2012":t,"urn:mpeg:dash:utc:http-ntp:2014":s,"urn:mpeg:dash:utc:ntp:2014":s,"urn:mpeg:dash:utc:sntp:2014":s},e()||(y(a),f(!0))}function b(a){a&&(a.metricsModel&&(J=a.metricsModel),a.dashMetrics&&(K=a.dashMetrics))}function c(){return j()}function d(a){F=a}function e(){return F}function f(a){G=a}function h(a){E=a}function j(){return E}function l(a){var b,c,d=60,e=60,f=1e3,g=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/,h=g.exec(a);return b=Date.UTC(parseInt(h[1],10),parseInt(h[2],10)-1,parseInt(h[3],10),parseInt(h[4],10),parseInt(h[5],10),h[6]&&(parseInt(h[6],10)||0),h[7]&&parseFloat(h[7])*f||0),h[9]&&h[10]&&(c=parseInt(h[9],10)*e+parseInt(h[10],10),b+=("+"===h[8]?-1:1)*c*d*f),new Date(b).getTime()}function m(a){var b=Date.parse(a);return isNaN(b)&&(b=l(a)),b}function n(a){return Date.parse(a)}function r(a){return Date.parse(a)}function s(a,b,c){c()}function t(a,b,c){var d=m(a);return isNaN(d)?void c():void b(d)}function u(a,b,c,d,e){var f,g,h=!1,i=new XMLHttpRequest,j=e?"HEAD":"GET",k=b.match(/\S+/g);b=k.shift(),f=function(){h||(h=!0,k.length?u(a,k.join(" "),c,d,e):d())},g=function(){var b,d;200===i.status&&(b=e?i.getResponseHeader("Date"):i.response,d=a(b),isNaN(d)||(c(d),h=!0))},i.open(j,b),i.timeout=q||0,i.onload=g,i.onloadend=f,i.send()}function v(a,b,c){u(r,a,b,c,!0)}
44062function w(){var a=J.getReadOnlyMetricsFor("stream"),b=K.getLatestMPDRequestHeaderValueByID(a,"Date"),c=null!==b?new Date(b).getTime():Number.NaN;isNaN(c)?x(!0):(h(c-(new Date).getTime()),x(!1,c/1e3,E))}function x(a,b,c){d(!1),C.trigger(k.default.TIME_SYNCHRONIZATION_COMPLETED,{time:b,offset:c,error:a?new g.default(p):null})}function y(a,b){var c=b||0,e=a[c],f=function(a,b){var c=!a||!b;c&&H?w():x(c,a,b)};d(!0),e?I.hasOwnProperty(e.schemeIdUri)?I[e.schemeIdUri](e.value,function(a){var b=(new Date).getTime(),c=a-b;h(c),B("Local time: "+new Date(b)),B("Server time: "+new Date(a)),B("Difference (ms): "+c),f(a,c)},function(){y(a,c+1)}):y(a,c+1):(h(0),f())}function z(){f(!1),d(!1)}var A=this.context,B=(0,o.default)(A).getInstance().log,C=(0,i.default)(A).getInstance(),D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0;return D={initialize:a,getOffsetToDeviceTimeMs:c,setConfig:b,reset:z}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(113),g=d(f),h=a(7),i=d(h),j=a(11),k=d(j),l=a(8),m=d(l),n=a(6),o=d(n),p=1,q=5e3;e.__dashjs_factory_name="TimeSyncController";var r=m.default.getSingletonFactory(e);r.TIME_SYNC_FAILED_ERROR_CODE=p,r.HTTP_TIMEOUT_MS=q,c.default=r,b.exports=c.default},{11:11,113:113,6:6,7:7,8:8}],71:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){A.on(k.default.XLINK_ELEMENT_LOADED,j,C),H=(0,g.default)(z).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){D=a}function d(a){E=a}function e(a){var b;G=new o.default(D,"",(!0)),F=a,b=m(F.Period_asArray,F,t,r),h(b,t,r)}function f(){A.off(k.default.XLINK_ELEMENT_LOADED,j,C),H&&(H.reset(),H=null)}function h(a,b,c){var d,e,f,g={};for(g.elements=a,g.type=b,g.resolveType=c,0===g.elements.length&&l(g),f=0;f<g.elements.length;f++)d=g.elements[f],e=B.isHTTPURL(d.url)?d.url:d.originalContent.BaseURL+d.url,H.load(e,d,g)}function j(a){var b,c,d,e="<response>",f="</response>",g="";b=a.element,c=a.resolveObject,b.resolvedContent&&(d=b.resolvedContent.indexOf(">")+1,g=b.resolvedContent.substr(0,d)+e+b.resolvedContent.substr(d)+f,b.resolvedContent=G.xml_str2json(g)),x(c)&&l(c)}function l(a){var b,c,d=[];if(n(a),a.resolveType===s&&A.trigger(k.default.XLINK_READY,{manifest:F}),a.resolveType===r)switch(a.type){case t:for(b=0;b<F[t+"_asArray"].length;b++)c=F[t+"_asArray"][b],c.hasOwnProperty(u+"_asArray")&&(d=d.concat(m(c[u+"_asArray"],c,u,r))),c.hasOwnProperty(v+"_asArray")&&(d=d.concat(m(c[v+"_asArray"],c,v,r)));h(d,u,r);break;case u:A.trigger(k.default.XLINK_READY,{manifest:F})}}function m(a,b,c,d){var e,f,g,h=[];for(f=a.length-1;f>=0;f--)e=a[f],e.hasOwnProperty("xlink:href")&&e["xlink:href"]===w&&a.splice(f,1);for(f=0;f<a.length;f++)e=a[f],e.hasOwnProperty("xlink:href")&&e.hasOwnProperty("xlink:actuate")&&e["xlink:actuate"]===d&&(g=p(e["xlink:href"],b,c,f,d,e),h.push(g));return h}function n(a){var b,c,d,e,f,g,h=[];for(e=a.elements.length-1;e>=0;e--){if(b=a.elements[e],c=b.type+"_asArray",!b.resolvedContent||y())delete b.originalContent["xlink:actuate"],delete b.originalContent["xlink:href"],h.push(b.originalContent);else if(b.resolvedContent)for(f=0;f<b.resolvedContent[c].length;f++)d=b.resolvedContent[c][f],h.push(d);for(b.parentElement[c].splice(b.index,1),g=0;g<h.length;g++)b.parentElement[c].splice(b.index+g,0,h[g]);h=[]}a.elements.length>0&&E.run(F)}function p(a,b,c,d,e,f){return{url:a,parentElement:b,type:c,index:d,resolveType:e,originalContent:f,resolvedContent:null,resolved:!1}}function x(a){var b,c;for(b=0;b<a.elements.length;b++)if(c=a.elements[b],c.resolved===!1)return!1;return!0}function y(){return!1}var z=this.context,A=(0,i.default)(z).getInstance(),B=(0,q.default)(z).getInstance(),C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0;return C={resolveManifestOnLoad:e,setMatchers:c,setIron:d,reset:f},b(),C}Object.defineProperty(c,"__esModule",{value:!0});var f=a(56),g=d(f),h=a(7),i=d(h),j=a(11),k=d(j),l=a(8),m=d(l),n=a(3),o=d(n),p=a(109),q=d(p),r="onLoad",s="onActuate",t="Period",u="AdaptationSet",v="EventStream",w="urn:mpeg:dash:resolve-to-zero:2013";e.__dashjs_factory_name="XlinkController",c.default=m.default.getClassFactory(e),b.exports=c.default},{109:109,11:11,3:3,56:56,7:7,8:8}],72:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}
vendor: 10,387 bytes, line 44062
44062function f(){function a(){l=new n}function b(a,b,c){var d=p.getBaseURLsFromElement(c);a[b]?q.areSimpleEquivalent(d,a[b].data.baseUrls)||(a[b].data.baseUrls=d,a[b].data.selectedIdx=m):a[b]=new n(d)}function c(a){var c=p.getBaseURLsFromElement(a);q.areSimpleEquivalent(c,l.data.baseUrls)||(l.data.baseUrls=c,l.data.selectedIdx=m),a.Period_asArray&&a.Period_asArray.forEach(function(a,c){b(l.children,c,a),a.AdaptationSet_asArray&&a.AdaptationSet_asArray.forEach(function(a,d){b(l.children[c].children,d,a),a.Representation_asArray&&a.Representation_asArray.sort(p.getRepresentationSortFunction()).forEach(function(a,e){b(l.children[c].children[d].children,e,a)})})})}function d(a,b){var c=b||l;a(c.data),c.children&&c.children.forEach(function(b){return d(a,b)})}function e(a){d(function(b){isNaN(b.selectedIdx)||a===b.baseUrls[b.selectedIdx].serviceLocation&&(b.selectedIdx=m)})}function f(a){c(a)}function g(){l=new n}function i(a){var b=l,c=[b.data];return a.forEach(function(a){b=b.children[a],b&&c.push(b.data)}),c.filter(function(a){return a.baseUrls.length})}var k=void 0,l=void 0,o=this.context,p=(0,h.default)(o).getInstance(),q=(0,j.default)(o).getInstance();return k={reset:g,update:f,getForPath:i,invalidateSelectedIndexes:e},a(),k}Object.defineProperty(c,"__esModule",{value:!0});var g=a(20),h=d(g),i=a(106),j=d(i),k=a(8),l=d(k),m=NaN,n=function a(b,c){e(this,a),this.data={baseUrls:b||null,selectedIdx:c||m},this.children=[]};f.__dashjs_factory_name="BaseURLTreeModel",c.default=l.default.getClassFactory(f),b.exports=c.default},{106:106,20:20,8:8}],73:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){D=null,G=null,E=[],F=[],A.on(i.default.LOADING_COMPLETED,w,C)}function c(a){G=a}function d(a){D=a}function e(){return D}function f(a){var b=function(a,b){return a.action===m.default.ACTION_COMPLETE&&a.action===b.action},c=function(a,b){return!isNaN(a.index)&&a.startTime===b.startTime&&a.adaptationIndex===b.adaptationIndex},d=function(a,b){return isNaN(a.index)&&isNaN(b.index)&&a.quality===b.quality},e=function(e){var f=!1;return e.some(function(e){if(c(a,e)||d(a,e)||b(a,e))return f=!0}),f};return e(E)}function h(a){var b=a.state instanceof Array?a.state:[a.state],c=[];return b.forEach(function(b){var d=u(b);c=c.concat(t(d,a))}),c}function j(a){E=E.filter(function(b){return isNaN(b.startTime)||b.startTime>=a})}function k(){G.abort(),F=[]}function l(a){switch(a.action){case m.default.ACTION_COMPLETE:E.push(a),v(a,q),A.trigger(i.default.STREAM_COMPLETED,{request:a,fragmentModel:this});break;case m.default.ACTION_DOWNLOAD:v(a,p),F.push(a),n(a);break;default:z("Unknown request action.")}}function n(a){A.trigger(i.default.FRAGMENT_LOADING_STARTED,{sender:C,request:a}),G.load(a)}function r(a,b,c){for(var d=a.length-1,e=d;e>=0;e--){var f=a[e],g=f.startTime,h=g+f.duration;if(c=void 0!==c?c:f.duration/2,!isNaN(g)&&!isNaN(h)&&b+c>=g&&b-c<h||isNaN(g)&&isNaN(b))return f}return null}function t(a,b){return b.hasOwnProperty("time")?[r(a,b.time,b.threshold)]:a.filter(function(a){for(var c in b)if("state"!==c&&b.hasOwnProperty(c)&&a[c]!=b[c])return!1;return!0})}function u(a){var b=void 0;switch(a){case p:b=F;break;case q:b=E;break;default:b=[]}return b}function v(a,b){B.addSchedulingInfo(a.mediaType,new Date,a.type,a.startTime,a.availabilityStartTime,a.duration,a.quality,a.range,b),B.addRequestsQueue(a.mediaType,F,E)}function w(a){a.sender===G&&(F.splice(F.indexOf(a.request),1),a.response&&!a.error&&E.push(a.request),v(a.request,a.error?s:q),A.trigger(i.default.FRAGMENT_LOADING_COMPLETED,{request:a.request,response:a.response,error:a.error,sender:this}))}function x(){A.off(i.default.LOADING_COMPLETED,w,this),G&&(G.reset(),G=null),E=[],F=[]}var y=this.context,z=(0,o.default)(y).getInstance().log,A=(0,g.default)(y).getInstance(),B=a.metricsModel,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0;return C={setLoader:c,setScheduleController:d,getScheduleController:e,getRequests:h,isFragmentLoaded:f,removeExecutedRequestsBeforeTime:j,abortRequests:k,executeRequest:l,reset:x},b(),C}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j),l=a(114),m=d(l),n=a(6),o=d(n),p="loading",q="executed",r="canceled",s="failed";e.__dashjs_factory_name="FragmentModel";var t=k.default.getClassFactory(e);t.FRAGMENT_MODEL_LOADING=p,t.FRAGMENT_MODEL_EXECUTED=q,t.FRAGMENT_MODEL_CANCELED=r,t.FRAGMENT_MODEL_FAILED=s,c.default=t,b.exports=c.default},{11:11,114:114,6:6,7:7,8:8}],74:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){return f}function b(a){f=a,a&&d.trigger(i.default.MANIFEST_LOADED,{data:a})}var c=this.context,d=(0,g.default)(c).getInstance(),e=void 0,f=void 0;return e={getValue:a,setValue:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j);e.__dashjs_factory_name="ManifestModel",c.default=k.default.getSingletonFactory(e),b.exports=c.default},{11:11,7:7,8:8}],75:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(){function a(){var a,b;ya=[],xa=!1,wa=!0,Ba=!0,Qa=!1,Sa=!1,Ea={enabled:!0,ttl:l},Fa={enabled:!0,ttl:m},za=k,Aa=void 0,Ca=p,Da=q,Ga=NaN,Ha=t,Ia=u,Ja=v,Ka=w,La=n,Ma=o,Pa=D,Ra=E,a={},e(a,i.HTTPRequest.MPD_TYPE,z),e(a,i.HTTPRequest.XLINK_EXPANSION_TYPE,B),e(a,i.HTTPRequest.MEDIA_SEGMENT_TYPE,x),e(a,i.HTTPRequest.INIT_SEGMENT_TYPE,x),e(a,i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,x),e(a,i.HTTPRequest.INDEX_SEGMENT_TYPE,x),e(a,i.HTTPRequest.OTHER_TYPE,x),Na=a,b={},e(b,i.HTTPRequest.MPD_TYPE,A),e(b,i.HTTPRequest.XLINK_EXPANSION_TYPE,C),e(b,i.HTTPRequest.MEDIA_SEGMENT_TYPE,y),e(b,i.HTTPRequest.INIT_SEGMENT_TYPE,y),e(b,i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,y),e(b,i.HTTPRequest.INDEX_SEGMENT_TYPE,y),e(b,i.HTTPRequest.OTHER_TYPE,y),Oa=b}function b(a){Qa=a}function c(){return Qa}function d(a){La=a}function f(){return La}function g(a){Ma=a}function h(){return Ma}function j(a){Ga=a}function F(){return isNaN(Ga)?Sa?s:r:Ga}function G(a){Ha=a}function H(){return Ha}function I(a){Ia=a}function J(){return Ia}function K(a){Ja=a}function L(){return Ja}function M(a){Ka=a}function N(){return Ka}function O(a){Ca=a}function P(){return Ca}function Q(a,b){Ea.enabled=a,void 0===b||isNaN(b)||"number"!=typeof b||(Ea.ttl=b)}function R(){return Ea}function S(a,b){Fa.enabled=a,void 0===b||isNaN(b)||"number"!=typeof b||(Fa.ttl=b)}function T(){return Fa}function U(a){Da=a}function V(){return Da}function W(a){Na[i.HTTPRequest.MEDIA_SEGMENT_TYPE]=a}function X(a,b){Na[a]=b}function Y(){return Na[i.HTTPRequest.MEDIA_SEGMENT_TYPE]}function Z(a){return Na[a]}function $(a){Oa[i.HTTPRequest.MEDIA_SEGMENT_TYPE]=a}function _(a,b){Oa[a]=b}function aa(){return Oa[i.HTTPRequest.MEDIA_SEGMENT_TYPE]}function ba(a){return Oa[a]}function ca(a){Pa=a}function da(){return Pa}function ea(a){Ba=a}function fa(){return Ba}function ga(a){za=a}function ha(a){Aa=a}function ia(){return za}function ja(){return Aa}function ka(a){wa=a}function la(){return wa}function ma(a){xa=a}function na(){return xa}function oa(a){ya=a}function pa(){return ya}function qa(a){Ra=!!a}function ra(){return Ra}function sa(){return Sa}function ta(a){Sa=a}function ua(){}var va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0,Ka=void 0,La=void 0,Ma=void 0,Na=void 0,Oa=void 0,Pa=void 0,Qa=void 0,Ra=void 0,Sa=void 0;return va={setBufferOccupancyABREnabled:b,getBufferOccupancyABREnabled:c,setBandwidthSafetyFactor:d,getBandwidthSafetyFactor:f,setAbandonLoadTimeout:g,getAbandonLoadTimeout:h,setLastBitrateCachingInfo:Q,getLastBitrateCachingInfo:R,setLastMediaSettingsCachingInfo:S,getLastMediaSettingsCachingInfo:T,setStableBufferTime:j,getStableBufferTime:F,setBufferTimeAtTopQuality:G,getBufferTimeAtTopQuality:H,setBufferTimeAtTopQualityLongForm:I,getBufferTimeAtTopQualityLongForm:J,setLongFormContentDurationThreshold:K,getLongFormContentDurationThreshold:L,setRichBufferThreshold:M,getRichBufferThreshold:N,setBufferToKeep:O,getBufferToKeep:P,setBufferPruningInterval:U,getBufferPruningInterval:V,setFragmentRetryAttempts:W,getFragmentRetryAttempts:Y,setRetryAttemptsForType:X,getRetryAttemptsForType:Z,setFragmentRetryInterval:$,getFragmentRetryInterval:aa,setRetryIntervalForType:_,getRetryIntervalForType:ba,setWallclockTimeUpdateInterval:ca,getWallclockTimeUpdateInterval:da,setScheduleWhilePaused:ea,getScheduleWhilePaused:fa,getUseSuggestedPresentationDelay:na,setUseSuggestedPresentationDelay:ma,setLiveDelayFragmentCount:ga,getLiveDelayFragmentCount:ia,getLiveDelay:ja,setLiveDelay:ha,setUseManifestDateHeaderTimeSource:ka,getUseManifestDateHeaderTimeSource:la,setUTCTimingSources:oa,getUTCTimingSources:pa,setXHRWithCredentials:qa,getXHRWithCredentials:ra,setFastSwitchEnabled:ta,getFastSwitchEnabled:sa,reset:ua},a(),va}Object.defineProperty(c,"__esModule",{value:!0});var g=a(8),h=d(g),i=a(130),j={scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso"},k=4,l=36e4,m=36e4,n=.9,o=1e4,p=30,q=30,r=12,s=20,t=30,u=60,v=600,w=20,x=3,y=1e3,z=3,A=500,B=1,C=500,D=50,E=!1;f.__dashjs_factory_name="MediaPlayerModel";var F=h.default.getSingletonFactory(f);F.DEFAULT_UTC_TIMING_SOURCE=j,c.default=F,b.exports=c.default},{130:130,8:8}],76:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){T={}}function b(a){a&&a.adapter&&(S=a.adapter)}function c(){Q.trigger(C.default.METRICS_CHANGED)}function d(a){Q.trigger(C.default.METRIC_CHANGED,{mediaType:a}),c()}function e(a,b,c){Q.trigger(C.default.METRIC_UPDATED,{mediaType:a,metric:b,value:c}),d(a)}function f(a,b,c){Q.trigger(C.default.METRIC_ADDED,{mediaType:a,metric:b,value:c}),d(a)}function h(a){delete T[a],d(a)}function k(){T={},c()}function m(a){return T.hasOwnProperty(a)?T[a]:null}function o(a){var b;return T.hasOwnProperty(a)?b=T[a]:(b=new g.default,T[a]=b),b}function q(a,b,c,d,e,g){var h=new i.default;return h.tcpid=b,h.dest=c,h.topen=d,h.tclose=e,h.tconnect=g,o(a).TcpList.push(h),f(a,S.metricsList.TCP_CONNECTION,h),h}function s(a,b,c,d){var e=new j.HTTPRequestTrace;return e.s=b,e.d=c,e.b=d,a.trace.push(e),a.interval||(a.interval=0),a.interval+=c,e}function v(a,b,c,d,e,g,h,i,k,l,m,n,p,q){var r=new j.HTTPRequest;
44062return e&&e!==d&&(v(a,null,c,d,null,null,h,i,null,null,null,n,null,null),r.actualurl=e),r.tcpid=b,r.type=c,r.url=d,r.range=h,r.trequest=i,r.tresponse=k,r.responsecode=m,r._tfinish=l,r._stream=a,r._mediaduration=n,r._responseHeaders=p,r._serviceLocation=g,q?q.forEach(function(a){s(r,a.s,a.d,a.b)}):(delete r.interval,delete r.trace),o(a).HttpList.push(r),f(a,S.metricsList.HTTP_REQUEST,r),r}function x(a,b,c,d,e){var g=new l.default;return g.t=b,g.mt=c,g.to=d,e?g.lto=e:delete g.lto,o(a).RepSwitchList.push(g),f(a,S.metricsList.TRACK_SWITCH,g),g}function z(a,b,c){var d=new n.default;return d.t=b,d.level=c,o(a).BufferLevel.push(d),f(a,S.metricsList.BUFFER_LEVEL,d),d}function B(a,b,c){var d=new p.default;return d.target=c,d.state=b,o(a).BufferState.push(d),f(a,S.metricsList.BUFFER_STATE,d),d}function D(a,b,c,d){var e=new r.default;return e.time=b,e.range=d,e.manifestInfo=c,o(a).DVRInfo.push(e),f(a,S.metricsList.DVR_INFO,e),e}function E(a,b){var c=new t.default,d=o(a).DroppedFrames;return c.time=b.creationTime,c.droppedFrames=b.droppedVideoFrames,d.length>0&&d[d.length-1]==c?d[d.length-1]:(d.push(c),f(a,S.metricsList.DROPPED_FRAMES,c),c)}function F(a,b,c,d,e,g,h,i,j){var k=new w.default;return k.mediaType=a,k.t=b,k.type=c,k.startTime=d,k.availabilityStartTime=e,k.duration=g,k.quality=h,k.range=i,k.state=j,o(a).SchedulingInfo.push(k),f(a,S.metricsList.SCHEDULING_INFO,k),k}function H(a,b,c){var d=new A.default;d.loadingRequests=b,d.executedRequests=c,o(a).RequestsQueue=d,f(a,S.metricsList.REQUESTS_QUEUE,d)}function I(a,b,c,d,e,g,h,i,j,k){var l=new u.ManifestUpdate,m=o("stream");return l.mediaType=a,l.type=b,l.requestTime=c,l.fetchTime=d,l.availabilityStartTime=e,l.presentationStartTime=g,l.clientTimeOffset=h,l.currentTime=i,l.buffered=j,l.latency=k,m.ManifestUpdate.push(l),f(a,S.metricsList.MANIFEST_UPDATE,l),l}function J(a,b){if(a){for(var c in b)a[c]=b[c];e(a.mediaType,S.metricsList.MANIFEST_UPDATE,a)}}function K(a,b,c,d,f){if(a){var g=new u.ManifestUpdateStreamInfo;return g.id=b,g.index=c,g.start=d,g.duration=f,a.streamInfo.push(g),e(a.mediaType,S.metricsList.MANIFEST_UPDATE_STREAM_INFO,a),g}return null}function L(a,b,c,d,f,g,h,i){if(a){var j=new u.ManifestUpdateTrackInfo;return j.id=b,j.index=c,j.streamIndex=d,j.mediaType=f,j.startNumber=h,j.fragmentInfoType=i,j.presentationTimeOffset=g,a.trackInfo.push(j),e(a.mediaType,S.metricsList.MANIFEST_UPDATE_TRACK_INFO,a),j}return null}function M(a){var b="stream";return a.trace&&Array.isArray(a.trace)?a.trace.forEach(function(a){a.hasOwnProperty("subreplevel")&&!a.subreplevel&&delete a.subreplevel}):delete a.trace,o(b).PlayList.push(a),f(b,S.metricsList.PLAY_LIST,a),a}function N(a){var b="stream";return o(b).DVBErrors.push(a),f(b,S.metricsList.DVB_ERRORS,a),a}function O(a,b){var c=new G.default;return c._s=b,o(a).BolaState=[c],f(a,"BolaState",c),c}var P=this.context,Q=(0,y.default)(P).getInstance(),R=void 0,S=void 0,T=void 0;return R={metricsChanged:c,metricChanged:d,metricUpdated:e,metricAdded:f,clearCurrentMetricsForType:h,clearAllCurrentMetrics:k,getReadOnlyMetricsFor:m,getMetricsFor:o,addTcpConnection:q,addHttpRequest:v,addRepresentationSwitch:x,addBufferLevel:z,addBufferState:B,addDVRInfo:D,addDroppedFrames:E,addSchedulingInfo:F,addRequestsQueue:H,addManifestUpdate:I,updateManifestUpdateInfo:J,addManifestUpdateStreamInfo:K,addManifestUpdateRepresentationInfo:L,addPlayList:M,addDVBErrors:N,updateBolaState:O,setConfig:b},a(),R}Object.defineProperty(c,"__esModule",{value:!0});var f=a(119),g=d(f),h=a(136),i=d(h),j=a(130),k=a(133),l=d(k),m=a(126),n=d(m),o=a(127),p=d(o),q=a(128),r=d(q),s=a(129),t=d(s),u=a(131),v=a(135),w=d(v),x=a(7),y=d(x),z=a(134),A=d(z),B=a(11),C=d(B),D=a(8),E=d(D),F=a(125),G=d(F);e.__dashjs_factory_name="MetricsModel",c.default=E.default.getSingletonFactory(e),b.exports=c.default},{11:11,119:119,125:125,126:126,127:127,128:128,129:129,130:130,131:131,133:133,134:134,135:135,136:136,7:7,8:8}],77:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){h=new g.default,i=[],j=!1}function b(){return h}function c(){return i}function d(){return j}function e(a){function b(a,b,c,d){var e=d[0].split(/[=]/);return d.push({key:e[0],value:e[1]}),d.shift(),d}function c(a,b,c){return b>0&&(l&&0===i.length?i=c[b].split(/[&]/):m&&(e=c[b].split(/[&]/))),c}if(!a)return null;var d,e=[],f=new RegExp(/[?]/),g=new RegExp(/[#]/),k=new RegExp(/^(https:)?\/\//i),l=f.test(a),m=g.test(a);return j=k.test(a),d=a.split(/[?#]/).map(c),i.length>0&&(i=i.reduce(b,null)),e.length>0&&(e=e.reduce(b,null),e.forEach(function(a){h[a.key]=a.value})),a}var f=void 0,h=void 0,i=void 0,j=void 0;return f={initialize:a,parseURI:e,getURIFragmentData:b,getURIQueryData:c,isManifestHTTPS:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(124),g=d(f),h=a(8),i=d(h);e.__dashjs_factory_name="URIQueryAndFragmentModel",c.default=i.default.getSingletonFactory(e),b.exports=c.default},{124:124,8:8}],78:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){v=[]}function b(a){!s||s.readyState<2||(s.playbackRate=a)}function c(a){if(s.currentTime!=a)try{s.currentTime=a}catch(b){0===s.readyState&&b.code===b.INVALID_STATE_ERR&&setTimeout(function(){s.currentTime=a},400)}}function d(){return s}function e(a){s=a,s.preload="auto"}function f(a){a?s.src=a:(s.removeAttribute("src"),s.load())}function g(){return s.src}function h(){return u}function i(a){u=a}function j(){return t}function k(a){t=a,t.style.position="absolute",t.style.display="flex",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.top=0,t.style.left=0}function l(a,b){p(a,b)}function m(){return v.length>0}function n(a){var c=void 0;null===a||s.seeking||v.indexOf(a)!==-1||(v.push(a),1===v.length&&(c=document.createEvent("Event"),c.initEvent("waiting",!0,!1),w=s.playbackRate,b(0),s.dispatchEvent(c)))}function o(a){var c=v.indexOf(a),d=void 0;null!==a&&(c!==-1&&v.splice(c,1),m()===!1&&0===s.playbackRate&&(d=document.createEvent("Event"),d.initEvent("playing",!0,!1),b(w||1),s.dispatchEvent(d)))}function p(a,b){b?n(a):o(a)}function q(){var a="webkitDroppedFrameCount"in s,b="getVideoPlaybackQuality"in s,c=null;return b?c=s.getVideoPlaybackQuality():a&&(c={droppedVideoFrames:s.webkitDroppedFrameCount,creationTime:new Date}),c}var r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0;return r={initialize:a,setCurrentTime:c,setStallState:l,getElement:d,setElement:e,setSource:f,getSource:g,getVideoContainer:h,setVideoContainer:i,getTTMLRenderingDiv:j,setTTMLRenderingDiv:k,getPlaybackQuality:q}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="VideoModel",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],79:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){return i.mediaInfo.streamInfo}function c(){return i.mediaInfo}function d(){return i}function e(){return k}function f(){return i.mediaInfo.streamInfo.manifestInfo}function g(){return j}var h=void 0,i=a.streamProcessor.getCurrentRepresentationInfo(),j=a.streamProcessor,k=a.currentValue;return h={getStreamInfo:b,getMediaInfo:c,getTrackInfo:d,getCurrentValue:e,getManifestInfo:f,getStreamProcessor:g}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="RulesContext",c.default=g.default.getClassFactory(e),b.exports=c.default},{8:8}],80:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){j={}}function b(a){a&&(a.abrRulesCollection&&(j[p]=a.abrRulesCollection),a.synchronizationRulesCollection&&(j[q]=a.synchronizationRulesCollection))}function c(a,b,c,d,f){var g,h,j={},k={},l=a.length,m=l,n=e(b,d),o=function(a){ 44063var b,e,g;if(a.value!==i.default.NO_CHANGE){var h=f(j[a.priority],a.value);h!==j[a.priority]&&(j[a.priority]=h,k[a.priority]=a.reason)}--l||(j[i.default.WEAK]!==i.default.NO_CHANGE&&(g=i.default.WEAK,b=j[i.default.WEAK],e=k[i.default.WEAK]),j[i.default.DEFAULT]!==i.default.NO_CHANGE&&(g=i.default.DEFAULT,b=j[i.default.DEFAULT],e=k[i.default.DEFAULT]),j[i.default.STRONG]!==i.default.NO_CHANGE&&(g=i.default.STRONG,b=j[i.default.STRONG],e=k[i.default.STRONG]),g!=i.default.STRONG&&g!=i.default.WEAK&&(g=i.default.DEFAULT),c(void 0!==b?{value:b,confidence:g,reason:e}:{value:d,confidence:g,reason:{name:"NO_CHANGE"}}))};for(j[i.default.STRONG]=i.default.NO_CHANGE,j[i.default.WEAK]=i.default.NO_CHANGE,j[i.default.DEFAULT]=i.default.NO_CHANGE,h=0;h<m;h++)g=a[h],g.execute(n,o)}function d(){var a,b,c=j[p],d=j[q],e=(c.getRules(k.default.QUALITY_SWITCH_RULES)||[]).concat(c.getRules(k.default.ABANDON_FRAGMENT_RULES)||[]).concat(d.getRules(m.default.TIME_SYNCHRONIZED_RULES)||[]).concat(d.getRules(m.default.BEST_GUESS_RULES)||[]),f=e.length;for(b=0;b<f;b++)a=e[b],"function"==typeof a.reset&&a.reset();j={}}function e(a,b){return(0,g.default)(f).create({streamProcessor:a,currentValue:b})}var f=this.context,h=void 0,j=void 0;
44063return h={initialize:a,setConfig:b,applyRules:c,reset:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(79),g=d(f),h=a(81),i=d(h),j=a(82),k=d(j),l=a(95),m=d(l),n=a(8),o=d(n),p=0,q=1;e.__dashjs_factory_name="RulesController";var r=o.default.getSingletonFactory(e);r.ABR_RULE=p,r.SYNC_RULE=q,c.default=r,b.exports=c.default},{79:79,8:8,81:81,82:82,95:95}],81:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b,c){var d=void 0===a?h:a,e=void 0===b?i:b,f=void 0===c?null:c,g={value:d,priority:e,reason:f};return g}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=999,i=.5,j=1,k=0;e.__dashjs_factory_name="SwitchRequest";var l=g.default.getClassFactory(e);l.NO_CHANGE=h,l.DEFAULT=i,l.STRONG=j,l.WEAK=k,c.default=l,b.exports=c.default},{8:8}],82:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){e=[],f=[];var a=(0,u.default)(c).getInstance(),b=(0,w.default)(c).getInstance(),d=(0,s.default)(c).getInstance();d.getBufferOccupancyABREnabled()?(e.push((0,o.default)(c).create({metricsModel:a,dashMetrics:(0,w.default)(c).getInstance()})),f.push((0,q.default)(c).create({metricsModel:a,dashMetrics:(0,w.default)(c).getInstance()}))):(e.push((0,g.default)(c).create({metricsModel:a,dashMetrics:b})),e.push((0,i.default)(c).create({metricsModel:a,dashMetrics:b})),e.push((0,k.default)(c).create({metricsModel:a})),f.push((0,m.default)(c).create()))}function b(a){switch(a){case z:return e;case A:return f;default:return null}}var c=this.context,d=void 0,e=void 0,f=void 0;return d={initialize:a,getRules:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(88),g=d(f),h=a(86),i=d(h),j=a(87),k=d(j),l=a(83),m=d(l),n=a(85),o=d(n),p=a(84),q=d(p),r=a(75),s=d(r),t=a(76),u=d(t),v=a(15),w=d(v),x=a(8),y=d(x),z="qualitySwitchRules",A="abandonFragmentRules";e.__dashjs_factory_name="ABRRulesCollection";var B=y.default.getSingletonFactory(e);B.QUALITY_SWITCH_RULES=z,B.ABANDON_FRAGMENT_RULES=A,c.default=B,b.exports=c.default},{15:15,75:75,76:76,8:8,83:83,84:84,85:85,86:86,87:87,88:88}],83:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){o={},p={},q=[],r=(0,i.default)(l).getInstance()}function b(a,b){o[a]=o[a]||{},o[a][b]=o[a][b]||{}}function c(a,b){q[a]=q[a]||[],q[a].push(b)}function d(a,d){var f=a.getMediaInfo(),i=f.type,m=a.getCurrentValue().request,s=(0,g.default)(l).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name});if(!isNaN(m.index)){b(i,m.index);var t=o[i][m.index];if(null===t||null===m.firstByteDate||p.hasOwnProperty(t.id))return void d(s);if(void 0===t.firstByteTime&&(q[i]=[],t.firstByteTime=m.firstByteDate.getTime(),t.segmentDuration=m.duration,t.bytesTotal=m.bytesTotal,t.id=m.index),t.bytesLoaded=m.bytesLoaded,t.elapsedTime=(new Date).getTime()-t.firstByteTime,t.bytesLoaded>0&&t.elapsedTime>0&&c(i,Math.round(8*t.bytesLoaded/t.elapsedTime)),q[i].length>=k&&t.elapsedTime>j&&t.bytesLoaded<t.bytesTotal){var u=q[i].reduce(function(a,b){return a+b},0);if(t.measuredBandwidthInKbps=Math.round(u/q[i].length),t.estimatedTimeOfDownload=(8*t.bytesTotal/t.measuredBandwidthInKbps/1e3).toFixed(2),t.estimatedTimeOfDownload<t.segmentDuration*h||0===a.getTrackInfo().quality)return void d(s);if(!p.hasOwnProperty(t.id)){var v=a.getStreamProcessor().getABRController(),w=t.bytesTotal-t.bytesLoaded,x=v.getBitrateList(f),y=v.getQualityForBitrate(f,t.measuredBandwidthInKbps*r.getBandwidthSafetyFactor()),z=t.bytesTotal*x[y].bitrate/x[v.getQualityFor(i,f.streamInfo)].bitrate;w>z&&(s.value=y,s.priority=g.default.STRONG,s.reason.throughput=t.measuredBandwidthInKbps,p[t.id]=t,n("AbandonRequestsRule ( ",i,"frag id",t.id,") is asking to abandon and switch to quality to ",y," measured bandwidth was",t.measuredBandwidthInKbps),delete o[i][t.id])}}else t.bytesLoaded===t.bytesTotal&&delete o[i][t.id]}d(s)}function f(){a()}var h=1.8,j=500,k=5,l=this.context,n=(0,m.default)(l).getInstance().log,o=void 0,p=void 0,q=void 0,r=void 0,s={execute:d,reset:f};return a(),s}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(75),i=d(h),j=a(8),k=d(j),l=a(6),m=d(l);e.__dashjs_factory_name="AbandonRequestsRule",c.default=k.default.getClassFactory(e),b.exports=c.default},{6:6,75:75,8:8,81:81}],84:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){s={},t=(0,i.default)(l).getInstance()}function c(a,b,c){s[a]={index:b,quality:c}}function d(a,b,c){var d=s[a];return!d||(b!==d.index||c<d.quality)}function f(a,b){var f=a.getMediaInfo(),h=f.type,i=q.getReadOnlyMetricsF
44063or(h),m=a.getCurrentValue(),r=m.request,t=(0,g.default)(l).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name});if(0===i.BolaState.length)return n("WARNING: executing BolaAbandonRule before initializing BolaRule"),s[h]=null,void b(t);var u=i.BolaState[0]._s,v=r.index,w=r.quality;if(isNaN(v)||0===w||!d(h,v,w)||!r.firstByteDate)return void b(t);var x=Date.now(),y=x-r.firstByteDate.getTime(),z=r.bytesLoaded,A=r.bytesTotal,B=A-z,C=r.duration,D=p.getCurrentBufferLevel(i)?p.getCurrentBufferLevel(i):0,E=D+u.virtualBuffer,F=8*z/(.001*y),G=u.bandwidthSafetyFactor*F,H=.001*(r.firstByteDate.getTime()-r.requestStartDate.getTime());H<.001*k&&(H=.001*k);var I=H+8*A/G,J="";o.default.BOLA_DEBUG&&(J="index="+v+" quality="+w+" bytesLoaded/bytesTotal="+z+"/"+A+" bufferLevel="+D+" timeSince1stByte="+(y/1e3).toFixed(3)+" estThroughput="+(G/1e6).toFixed(3)+" latency="+H.toFixed(3));var K=A*u.bitrates[0]/u.bitrates[w],L=B-H*G/8;if(L<1&&(L=1),y<j||B<=K||D>u.bufferTarget||L<=K||I<=C)return void b(t);var M=E-H;M<0&&(M=0);for(var N=0;N+1<w&&A*u.bitrates[N+1]/u.bitrates[w]<L;)++N;var O=w;if(u.state===o.default.BOLA_STATE_STARTUP){O=0;for(var P=0;P<=N&&(K=A*u.bitrates[P]/u.bitrates[w],!(8*K/C>G));++P)O=P}else for(var Q=(u.Vp*(u.utilities[w]+u.gp)-M)/L,P=0;P<=N;++P){K=A*u.bitrates[P]/u.bitrates[w];var R=(u.Vp*(u.utilities[P]+u.gp)-M)/K;R>Q&&(O=P,Q=R)}var S=u.rebufferSafetyFactor*F*(D-H)/8;if(O===w&&L>S&&(O=N),O===w)return void b(t);for(;O>0&&(K=A*u.bitrates[O]/u.bitrates[w],!(K<=S));)--O;u.lastQuality=O,q.updateBolaState(h,u),o.default.BOLA_DEBUG&&n("BolaDebug "+h+" BolaAbandonRule abandon to "+O+" - "+J),c(h,v,w),t.value=O,t.priority=g.default.STRONG,t.reason.state=u.state,t.reason.throughput=F,t.reason.bufferLevel=D,t.reason.bytesLoaded=r.bytesLoaded,t.reason.bytesTotal=r.bytesTotal,t.reason.elapsedTimeMs=y,b(t)}function h(){s={}}var j=500,k=200,l=this.context,n=(0,m.default)(l).getInstance().log,p=a.dashMetrics,q=a.metricsModel,r=void 0,s=void 0,t=void 0;return r={execute:f,reset:h},b(),r}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(75),i=d(h),j=a(8),k=d(j),l=a(6),m=d(l),n=a(85),o=d(n);e.__dashjs_factory_name="BolaAbandonRule",c.default=k.default.getClassFactory(e),b.exports=c.default},{6:6,75:75,8:8,81:81,85:85}],85:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){N={},O=[],P=(0,k.default)(H).getInstance(),Q=(0,m.default)(H).getInstance(),R=(0,p.default)(H).getInstance(),L.on(t.default.BUFFER_EMPTY,q,M),L.on(t.default.PLAYBACK_SEEKING,s,M),L.on(t.default.PERIOD_SWITCH_STARTED,u,M)}function c(a){return a.map(function(a){return Math.log(a)})}function d(a,b,d,e){var f=NaN;if(e?(f=0,e.forEach(function(a,b){a>e[f]&&(f=b)})):(e=c(d),f=e.length-1),0===f)return null;var g=1-e[0]+(e[f]-e[0])/(b/a-1),h=a/(e[0]+g-1);return{utilities:e,gp:g,Vp:h}}function f(a){var b={},c=a.getMediaInfo(),e=a.getStreamProcessor(),f=a.getStreamInfo(),g=a.getTrackInfo(),h=e.isDynamic(),i=f.manifestInfo.duration,j=g.fragmentDuration,k=c.bitrateList.map(function(a){return a.bandwidth}),l=d(A,B,k,null);if(null===l)return b.state=w,b;if(b.state=x,b.bitrates=k,b.utilities=l.utilities,b.Vp=l.Vp,b.gp=l.gp,b.isDynamic=h,b.movieDuration=i,b.fragmentDuration=j,b.bandwidthSafetyFactor=P.getBandwidthSafetyFactor(),b.rebufferSafetyFactor=C,b.bufferTarget=P.getStableBufferTime(),b.lastQuality=0,b.virtualBuffer=0,b.throughputCount=h?F:G,z){for(var m="",n=0;n<k.length;++n){var o=l.utilities[n],p=k[n],q=0;if(n>0){var r=l.utilities[n-1],s=k[n-1];q=l.Vp*((r*p-o*s)/(p-s)+l.gp)}var t=l.Vp*(o+l.gp);m+="\n"+n+":"+(1e-6*k[n]).toFixed(3)+"Mbps "+q.toFixed(3)+"/"+t.toFixed(3)}I("BolaDebug "+c.type+" bitrates"+m)}return b}function h(a,b){for(var c=a.bitrates.length,d=NaN,e=NaN,f=0;f<c;++f){var g=(a.Vp*(a.utilities[f]+a.gp)-b)/a.bitrates[f];(isNaN(e)||g>=e)&&(e=g,d=f)}return d}function i(a,b){for(var c=J.getHttpRequests(a),d=[],e=c.length-1;e>=0&&d.length<b;--e){var f=c[e];f.type===n.HTTPRequest.MEDIA_SEGMENT_TYPE&&f._tfinish&&f.tresponse&&f.trace&&d.push(f)}return d}function j(a,b,c){var d=i(a,b);if(0===d.length)return 0;for(var e=0,f="",g=0;g<d.length;++g){var h=.001*(d[g]._tfinish.getTime()-d[g].trequest.getTime()),j=8*d[g].trace.reduce(function(a,b){return a+b.b[0]},0);z&&(f+=" "+(1e-6*j).toFixed(3)+"/"+h.toFixed(3)+"="+(1e-6*j/h).toFixed(3)+"Mbps"),e+=h/j}return z&&I("BolaDebug "+c+" BolaRule recent throughput = "+(d.length/(1e6*e)).toFixed(3)+"Mbps:"+f),d.length/e}function l(a,b){var c=0;return a.bitrates.some(function(a,d){return a>b||(c=d,!1)}),c}
44063function o(a,b){var c=i(a,1);if(0===c.length)return 0;var d=c[0],e=Date.now(),f=d._tfinish.getTime();f>e&&(f=e);var g=N[b];N[b]=e;var h=0;return h=g&&g>f?e-g:e-f,h<=0?0:.001*h}function q(){z&&I("BolaDebug BUFFER_EMPTY"),O.forEach(function(a){var b=K.getReadOnlyMetricsFor(a);if(0!==b.BolaState.length){var c=b.BolaState[0]._s;c.state===y&&(c.virtualBuffer=0,K.updateBolaState(a,c))}})}function s(a){z&&I("BolaDebug PLAYBACK_SEEKING "+a.seekTime.toFixed(3)),O.forEach(function(a){var b=K.getReadOnlyMetricsFor(a);if(0!==b.BolaState.length){var c=b.BolaState[0]._s;c.state!==w&&(c.state=x),K.updateBolaState(a,c)}})}function u(){}function D(a,b){var c=a.getStreamProcessor();c.getScheduleController().setTimeToLoadDelay(0);var d=(0,g.default)(H).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name}),i=a.getMediaInfo(),k=i.type,m=K.getReadOnlyMetricsFor(k);if(0===m.BolaState.length){z&&I("BolaDebug "+k+"\nBolaDebug "+k+" BolaRule for state=- fragmentStart="+R.getIndexHandlerTime(a.getStreamProcessor()).toFixed(3));var n=f(a);K.updateBolaState(k,n);var p=0;if(n.state!==w){O.push(k);var q=j(m,n.throughputCount,k);if(0===q)return z&&I("BolaDebug "+k+" BolaRule quality unchanged for INITIALIZE"),void b(d);p=l(n,q*n.bandwidthSafetyFactor),n.lastQuality=p,d.value=p,d.priority=g.default.DEFAULT,d.reason.state=n.state,d.reason.throughput=q}return z&&I("BolaDebug "+k+" BolaRule quality "+p+" for INITIALIZE"),void b(d)}var r=m.BolaState[0]._s;if(r.state===w)return z&&I("BolaDebug "+k+" BolaRule quality 0 for ONE_BITRATE"),void b(d);var s=r.bitrates,t=r.utilities;z&&I("BolaDebug "+k+"\nBolaDebug "+k+" EXECUTE BolaRule for state="+r.state+" fragmentStart="+R.getIndexHandlerTime(a.getStreamProcessor()).toFixed(3));var u=J.getCurrentBufferLevel(m)?J.getCurrentBufferLevel(m):0,v=j(m,r.throughputCount,k);
44063u<=.1&&(r.virtualBuffer=0);var A=o(m,k);A>0&&(r.virtualBuffer+=A),r.virtualBuffer<0&&(r.virtualBuffer=0);var B=u+r.virtualBuffer,D=h(r,B);if(z&&I("BolaDebug "+k+" BolaRule bufferLevel="+u.toFixed(3)+"(+"+r.virtualBuffer.toFixed(3)+"="+B.toFixed(3)+") recentThroughput="+(1e-6*v).toFixed(3)+" tentativeQuality="+D),r.state===x){var p=l(r,v*r.bandwidthSafetyFactor);if(u>r.fragmentDuration/C){r.state=y;for(var E=0,F=0;F<p;++F){var G=r.Vp*(r.gp+(s[p]*t[F]-s[F]*t[p])/(s[p]-s[F]));G>E&&(E=G)}E>u&&(r.virtualBuffer=E-u)}return z&&I("BolaDebug "+k+" BolaRule quality "+p+" for STARTUP"),r.lastQuality=p,K.updateBolaState(k,r),d.value=p,d.priority=g.default.DEFAULT,d.reason.state=x,d.reason.throughput=v,void b(d)}if(D>r.lastQuality){var p=l(r,v);D>p&&(p<r.lastQuality&&(p=r.lastQuality),D=p)}if(v>0)for(var L=C*v*u/r.fragmentDuration;D>0&&s[D]>L;)--D;var M=0,N=r.Vp*(t[D]+r.gp);M=B-N,M>0&&(M>r.virtualBuffer?(M-=r.virtualBuffer,r.virtualBuffer=0):(r.virtualBuffer-=M,M=0)),M>0?D===s.length-1?M=0:c.getScheduleController().setTimeToLoadDelay(1e3*M):M=0,r.lastQuality=D,K.updateBolaState(k,r),d.value=D,d.priority=g.default.DEFAULT,d.reason.state=r.state,d.reason.throughput=v,d.reason.bufferLevel=u,z&&I("BolaDebug "+k+" BolaRule quality "+D+" delay="+M.toFixed(3)+" for STEADY"),b(d)}function E(){L.off(t.default.BUFFER_EMPTY,q,M),L.off(t.default.PLAYBACK_SEEKING,s,M),L.off(t.default.PERIOD_SWITCH_STARTED,u,M),b()}var F=2,G=3,H=this.context,I=(0,v.default)(H).getInstance().log,J=a.dashMetrics,K=a.metricsModel,L=(0,r.default)(H).getInstance(),M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0;return M={execute:D,reset:E},b(),M}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(8),i=d(h),j=a(75),k=d(j),l=a(65),m=d(l),n=a(130),o=a(13),p=d(o),q=a(7),r=d(q),s=a(11),t=d(s),u=a(6),v=d(u),w=0,x=1,y=2,z=!1,A=10,B=30,C=.5;e.__dashjs_factory_name="BolaRule";var D=i.default.getClassFactory(e);D.BOLA_STATE_ONE_BITRATE=w,D.BOLA_STATE_STARTUP=x,D.BOLA_STATE_STEADY=y,D.BOLA_DEBUG=z,c.default=D,b.exports=c.default},{11:11,13:13,130:130,6:6,65:65,7:7,75:75,8:8,81:81}],86:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){n=0,p=(0,i.default)(h).getInstance()}function c(a,b){var c=(new Date).getTime()/1e3,d=a.getMediaInfo(),f=a.getTrackInfo(),i=d.type,o=isNaN(f.fragmentDuration)?2:f.fragmentDuration/2,q=a.getCurrentValue(),r=a.getStreamProcessor(),s=r.getABRController(),t=l.getReadOnlyMetricsFor(i),u=m.getCurrentBufferLevel(t),v=t.BufferState.length>0?t.BufferState[t.BufferState.length-1]:null,w=!1,x=d.representationCount-1,y=(0,g.default)(h).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name});return c-n<o||s.getAbandonmentStateFor(i)===k.default.ABANDON_LOAD?void b(y):(null!==v&&u>v.target&&(w=u-v.target>p.getRichBufferThreshold(),w&&d.representationCount>1&&(y.value=x,y.priority=g.default.STRONG,y.reason.bufferLevel=u,y.reason.bufferTarget=v.target)),y.value!==g.default.NO_CHANGE&&y.value!==q&&j("BufferOccupancyRule requesting switch to index: ",y.value,"type: ",i," Priority: ",y.priority===g.default.DEFAULT?"Default":y.priority===g.default.STRONG?"Strong":"Weak"),void b(y))}function d(){n=0}var f=void 0,h=this.context,j=(0,o.default)(h).getInstance().log,l=a.metricsModel,m=a.dashMetrics,n=void 0,p=void 0;return f={execute:c,reset:d},b(),f}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(75),i=d(h),j=a(57),k=d(j),l=a(8),m=d(l),n=a(6),o=d(n);e.__dashjs_factory_name="BufferOccupancyRule",c.default=m.default.getClassFactory(e),b.exports=c.default},{57:57,6:6,75:75,8:8,81:81}],87:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){r={},s=0,t=1e3,n.on(m.default.PLAYBACK_SEEKING,f,p)}function c(a,b){var c=(new Date).getTime(),f=a.getMediaInfo().type,h=a.getCurrentValue(),k=o.getReadOnlyMetricsFor(f),m=k.BufferState.length>0?k.BufferState[k.BufferState.length-1]:null,n=(0,g.default)(j).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name});return c-s<t||null===m?void b(n):(d(f,m.state),m.state===i.default.BUFFER_EMPTY&&void 0!==r[f].firstBufferLoadedEvent&&(n.value=0,n.priority=g.default.STRONG,n.reason.bufferState=m.state,n=(0,g.default)(j).create(0,g.default.STRONG)),n.value!==g.default.NO_CHANGE&&n.value!==h&&l("InsufficientBufferRule requesting switch to index: ",n.value,"type: ",f," Priority: ",n.priority===g.default.DEFAULT?"Default":n.priority===g.default.STRONG?"Strong":"Weak"),s=c,void b(n))}function d(a,b){r[a]=r[a]||{},r[a].state=b,b!==i.default.BUFFER_LOADED||r[a].firstBufferLoadedEvent||(r[a].firstBufferLoadedEvent=!0)}function f(){r={}}function h(){n.off(m.default.PLAYBACK_SEEKING,f,p),r={},s=0}var j=this.context,l=(0,q.default)(j).getInstance().log,n=(0,k.default)(j).getInstance(),o=a.metricsModel,p=void 0,r=void 0,s=void 0,t=void 0;return p={execute:c,reset:h},b(),p}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(60),i=d(h),j=a(7),k=d(j),l=a(11),m=d(l),n=a(8),o=d(n),p=a(6),q=d(p);e.__dashjs_factory_name="InsufficientBufferRule",c.default=o.default.getClassFactory(e),b.exports=c.default},{11:11,6:6,60:60,7:7,8:8,81:81}],88:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){z=[],A={audio:{threshold:s,value:NaN},video:{threshold:q,value:NaN}},B=(0,m.default)(v).getInstance()}
44063function c(a,b){z[a]=z[a]||[],z[a].push(b)}function d(a,b){var c=Math.min(z[a].length,b?o:p),d=z[a].slice(c*-1,z[a].length);return d.length>1&&d.reduce(function(a,b){return(a*u<=b||a>=b*t)&&c++,b}),c=Math.min(z[a].length,c),z[a].slice(c*-1,z[a].length)}function f(a,b){var c=d(a,b),e=0;if(c.length>0){var f=c.reduce(function(a,b){return a+b},0);e=f/c.length}return z[a].length>=l&&z[a].shift(),e/1e3*B.getBandwidthSafetyFactor()}function h(a,b){var d=a.getMediaInfo(),h=d.type,j=a.getCurrentValue(),l=y.getReadOnlyMetricsFor(h),m=a.getStreamProcessor(),o=m.getABRController(),p=m.isDynamic(),q=x.getCurrentHttpRequest(l),r=l.BufferState.length>0?l.BufferState[l.BufferState.length-1]:null,s=(0,g.default)(v).create(g.default.NO_CHANGE,g.default.WEAK,{name:e.__dashjs_factory_name});if(!l||!q||q.type!==n.HTTPRequest.MEDIA_SEGMENT_TYPE||!r)return void b(s);var t=void 0;if(q.trace&&q.trace.length){t=q._tfinish.getTime()-q.tresponse.getTime()+1;var u=q.trace.reduce(function(a,b){return a+b.b[0]},0),z=Math.round(8*u/(t/1e3));t<=A[h].threshold?A[h].value=z/1e3:(A[h].value=NaN,c(h,z))}var B=Math.round(isNaN(A[h].value)?f(h,p):A[h].value);if(o.setAverageThroughput(h,B),o.getAbandonmentStateFor(h)!==k.default.ABANDON_LOAD){if(r.state===i.default.BUFFER_LOADED||p){var C=o.getQualityForBitrate(d,B);m.getScheduleController().setTimeToLoadDelay(0),s.value=C,s.priority=g.default.DEFAULT,s.reason.throughput=B}s.value!==g.default.NO_CHANGE&&s.value!==j&&w("ThroughputRule requesting switch to index: ",s.value,"type: ",h," Priority: ",s.priority===g.default.DEFAULT?"Default":s.priority===g.default.STRONG?"Strong":"Weak","Average throughput",Math.round(B),"kbps")}b(s)}function j(){b()}var l=20,o=3,p=4,q=50,s=5,t=1.3,u=1.3,v=this.context,w=(0,r.default)(v).getInstance().log,x=a.dashMetrics,y=a.metricsModel,z=void 0,A=void 0,B=void 0,C={execute:h,reset:j};return b(),C}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(60),i=d(h),j=a(57),k=d(j),l=a(75),m=d(l),n=a(130),o=a(8),p=d(o),q=a(6),r=d(q);e.__dashjs_factory_name="ThroughputRule",c.default=p.default.getClassFactory(e),b.exports=c.default},{130:130,57:57,6:6,60:60,75:75,8:8,81:81}],89:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a){var b,c=0;return a&&a.some(function(a,b){return c=b,!d.contains(a.serviceLocation)})&&(b=a[c]),b}var c=void 0,d=a.blacklistController;return c={select:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="BasicSelector",c.default=g.default.getClassFactory(e),b.exports=c.default},{8:8}],90:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a){var b=[],c=function(a){return!b.length||!a.dvb_priority||b.indexOf(a.dvb_priority)===-1},d=function(a){return!f.contains(a.serviceLocation)||(a.dvb_priority&&b.push(a.dvb_priority),!1)};return a.filter(d).filter(c)}function c(a){var b,c,d=function(a,b){var c=a.dvb_priority-b.dvb_priority;return isNaN(c)?0:c},e=function(a,b,c){return!b||c[0].dvb_priority&&a.dvb_priority&&c[0].dvb_priority===a.dvb_priority},f=0,g=[],h=0;if(c=a.sort(d).filter(e),c.length)return c.length>1&&(c.forEach(function(a){f+=a.dvb_weight,g.push(f)}),b=Math.floor(Math.random()*(f-1)),g.every(function(a,c){return h=c,!(b<a)})),c[h]}function d(a){return a&&c(b(a))}var e=void 0,f=a.blacklistController;return e={select:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="DVBSelector",c.default=g.default.getClassFactory(e),b.exports=c.default},{8:8}],91:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){k=(0,g.default)(e).getInstance(),l=(0,i.default)(e).getInstance()}function c(a,b,c){var e=f.getCurrentBufferLevel(h.getReadOnlyMetricsFor(b));return e<d(a,b,c)}function d(a,b,c){var d=NaN,e=a.getCurrentRepresentationInfo();if("fragmentedText"===b)d=j.getAllTracksAreDisabled()?0:e.fragmentDuration;else if("audio"===b&&c){var g=f.getCurrentBufferLevel(h.getReadOnlyMetricsFor("video"));d=Math.floor(Math.max(g,e.fragmentDuration))}else{var i=e.mediaInfo.streamInfo,l=a.getABRController();if(l.isPlayingAtTopQuality(i)){var m=i.manifestInfo.duration>=k.getLongFormContentDurationThreshold();d=m?k.getBufferTimeAtTopQualityLongForm():k.getBufferTimeAtTopQuality()}else d=k.getStableBufferTime()}return d}
44063var e=this.context,f=a.dashMetrics,h=a.metricsModel,j=a.textSourceBuffer,k=void 0,l=void 0,m={execute:c,getBufferTarget:d};return b(),m}Object.defineProperty(c,"__esModule",{value:!0});var f=a(75),g=d(f),h=a(65),i=d(h),j=a(8),k=d(j);e.__dashjs_factory_name="BufferLevelRule",c.default=k.default.getClassFactory(e),b.exports=c.default},{65:65,75:75,8:8}],92:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a,b){var c=a.getCurrentRepresentationInfo(),g=c.mediaInfo,i=g.type,j=a.getScheduleController(),k=j.getSeekTarget(),l=!isNaN(k),m=a.getBuffer(),n=l?k:e.getIndexHandlerTime(a);if(isNaN(n)||"fragmentedText"===i&&h.getAllTracksAreDisabled())return null;if(l&&j.setSeekTarget(NaN),m){var o=f.getBufferRange(a.getBuffer(),n);null!==o&&(d("Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end.",n," was changed to ",o.end),n=o.end)}var p=void 0;return b?(n=b.startTime+b.duration/2,p=e.getFragmentRequestForTime(a,c,n,{timeThreshold:0,ignoreIsFinished:!0})):(p=e.getFragmentRequestForTime(a,c,n,{keepIdx:!l}),p&&a.getFragmentModel().isFragmentLoaded(p)&&(p=e.getNextFragmentRequest(a,c)),p&&(e.setIndexHandlerTime(a,p.startTime+p.duration),p.delayLoadingTime=(new Date).getTime()+j.getTimeToLoadDelay(),j.setTimeToLoadDelay(0))),p}var c=this.context,d=(0,g.default)(c).getInstance().log,e=a.adapter,f=a.sourceBufferController,h=a.textSourceBuffer,i={execute:b};return i}Object.defineProperty(c,"__esModule",{value:!0});var f=a(6),g=d(f),h=a(8),i=d(h);e.__dashjs_factory_name="NextFragmentRequestRule",c.default=i.default.getClassFactory(e),b.exports=c.default},{6:6,8:8}],93:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){r=NaN,s=null,t=NaN,u=null,v=!1,w=NaN,x=g.default.DEFAULT}function c(a,b){var c,d;if(y=b,A=a.getStreamProcessor(),z=A.getFragmentLoader(),u=a.getTrackInfo(),w=u.fragmentDuration,d=u.DVRWindow,r=d.end,u.useCalculatedLiveEdgeTime){var i=p.getExpectedLiveEdge();return p.setExpectedLiveEdge(r),void y((0,g.default)(l).create(i,x))}s={start:Math.max(0,r-n),end:r+n},t=Math.floor((d.end-d.start)/2),c=o.getFragmentRequestForTime(A,u,r,{ignoreIsFinished:!0}),e(r,h,f,c)}function d(){r=NaN,s=null,t=NaN,u=null,v=!1,w=NaN,A=null,z=null}function e(a,b,c,d){var f;if(null===d)f=o.generateFragmentRequestForTime(A,u,a),e(a,b,c,f);else{var g=function d(e){m.off(k.default.CHECK_FOR_EXISTENCE_COMPLETED,d,this),e.exists?b(e.request,a):c(e.request,a)};m.on(k.default.CHECK_FOR_EXISTENCE_COMPLETED,g,this),z.checkForExistence(d)}}function f(a,b){var c,d,i;return v?void j(!1,b):(i=b-r,c=i>0?r-i:r+Math.abs(i)+t,void(c<s.start&&c>s.end?y((0,g.default)(l).create(null,x)):(d=o.getFragmentRequestForTime(A,u,c,{ignoreIsFinished:!0}),e(c,h,f,d))))}function h(a,b){var c,d,f=a.startTime;if(!v){if(!u.fragmentDuration)return void y((0,g.default)(l).create(f,x));if(v=!0,s.end=f+2*t,b===r)return d=b+w,c=o.getFragmentRequestForTime(A,u,d,{ignoreIsFinished:!0}),void e(d,function(){j(!0,d)},function(){y((0,g.default)(l).create(d,x))},c)}j(!0,b)}function j(a,b){var c,d,i;a?s.start=b:s.end=b,c=Math.floor(s.end-s.start)<=w,c?y((0,g.default)(l).create(a?b:b-w,x)):(i=(s.start+s.end)/2,d=o.getFragmentRequestForTime(A,u,i,{ignoreIsFinished:!0}),e(i,h,f,d))}var l=this.context,m=(0,i.default)(l).getInstance(),o=a.adapter,p=a.timelineConverter,q=void 0,r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0;return q={execute:c,reset:d},b(),q}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(7),i=d(h),j=a(11),k=d(j),l=a(8),m=d(l),n=43200;e.__dashjs_factory_name="LiveEdgeBinarySearchRule",c.default=m.default.getClassFactory(e),b.exports=c.default},{11:11,7:7,8:8,81:81}],94:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(a,b){var c=a.getTrackInfo(),f=c.DVRWindow.end,h=g.default.DEFAULT;if(c.useCalculatedLiveEdgeTime){var i=e.getExpectedLiveEdge();e.setExpectedLiveEdge(f),b((0,g.default)(d).create(i,h))}else b((0,g.default)(d).create(f,h))}var c=void 0,d=this.context,e=a.timelineConverter;return c={execute:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(81),g=d(f),h=a(8),i=d(h);e.__dashjs_factory_name="LiveEdgeWithTimeSynchronizationRule",c.default=i.default.getClassFactory(e),b.exports=c.default},{8:8,81:81}],95:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){e=[],f=[],e.push((0,m.default)(c).create({timelineConverter:(0,i.default)(c).getInstance()}
44063)),f.push((0,k.default)(c).create({timelineConverter:(0,i.default)(c).getInstance(),adapter:(0,o.default)(c).getInstance()}))}function b(a){switch(a){case p:return e;case q:return f;default:return null}}var c=this.context,d=void 0,e=void 0,f=void 0;return d={initialize:a,getRules:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(35),i=d(h),j=a(93),k=d(j),l=a(94),m=d(l),n=a(13),o=d(n),p="withAccurateTimeSourceRules",q="bestGuestRules";e.__dashjs_factory_name="SynchronizationRulesCollection";var r=g.default.getSingletonFactory(e);r.TIME_SYNCHRONIZED_RULES=p,r.BEST_GUESS_RULES=q,c.default=r,b.exports=c.default},{13:13,35:35,8:8,93:93,94:94}],96:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){l=(0,m.default)(e).create({updateEventName:i.default.SERVICE_LOCATION_BLACKLIST_CHANGED,loadFailedEventName:i.default.FRAGMENT_LOADING_COMPLETED}),n=(0,q.default)(e).create({blacklistController:l}),p=(0,o.default)(e).create({blacklistController:l}),r=n}function b(a){r=h.getIsDVB(a)?p:n}function c(a){var b=a.baseUrls,c=a.selectedIdx;if(!isNaN(c))return b[c];var d=r.select(b);return d?(a.selectedIdx=b.indexOf(d),d):void f.trigger(i.default.URL_RESOLUTION_FAILED,{error:new Error(t,u)})}function d(){l.reset()}var e=this.context,f=(0,g.default)(e).getInstance(),h=(0,k.default)(e).getInstance(),j=void 0,l=void 0,n=void 0,p=void 0,r=void 0;return j={chooseSelectorFromManifest:b,select:c,reset:d},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(20),k=d(j),l=a(59),m=d(l),n=a(90),o=d(n),p=a(89),q=d(p),r=a(8),s=d(r),t=1,u="Failed to resolve a valid URL";e.__dashjs_factory_name="BaseURLSelector";var v=s.default.getClassFactory(e);v.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=t,v.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE=u,c.default=v,b.exports=c.default},{11:11,20:20,59:59,7:7,8:8,89:89,90:90}],97:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){if(!a)return null;void 0===a.fileStart&&(a.fileStart=0);var b=k.default.parseBuffer(a),d=(0,g.default)(c).create();return d.setData(b),d}var b=void 0,c=this.context;return b={parse:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(104),g=d(f),h=a(8),i=d(h),j=a(4),k=d(j);e.__dashjs_factory_name="BoxParser",c.default=i.default.getSingletonFactory(e),b.exports=c.default},{104:104,4:4,8:8}],98:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){g=!1}function b(){var a="WebKitMediaSource"in window,b="MediaSource"in window;return a||b}function c(){return g}function d(a){g=a}function e(a,b){var c=a.canPlayType(b);return"probably"===c||"maybe"===c}var f=void 0,g=void 0;return f={supportsMediaSource:b,supportsEncryptedMedia:c,supportsCodec:e,setEncryptedMediaSupported:d},a(),f}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="Capabilities",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],99:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){var c=0;for(c=0;c<this.customTimeRangeArray.length&&a>this.customTimeRangeArray[c].start;c++);for(this.customTimeRangeArray.splice(c,0,{start:a,end:b}),c=0;c<this.customTimeRangeArray.length-1;c++)this.mergeRanges(c,c+1)&&c--;this.length=this.customTimeRangeArray.length}function b(){this.customTimeRangeArray=[],this.length=0}function c(a,b){for(var c=0;c<this.customTimeRangeArray.length;c++)if(a<=this.customTimeRangeArray[c].start&&b>=this.customTimeRangeArray[c].end)this.customTimeRangeArray.splice(c,1),c--;else{if(a>this.customTimeRangeArray[c].start&&b<this.customTimeRangeArray[c].end){this.customTimeRangeArray.splice(c+1,0,{start:b,end:this.customTimeRangeArray[c].end}),this.customTimeRangeArray[c].end=a;break}a>this.customTimeRangeArray[c].start&&a<this.customTimeRangeArray[c].end?this.customTimeRangeArray[c].end=a:b>this.customTimeRangeArray[c].start&&b<this.customTimeRangeArray[c].end&&(this.customTimeRangeArray[c].start=b)}this.length=this.customTimeRangeArray.length}function d(a,b){var c=this.customTimeRangeArray[a],d=this.customTimeRangeArray[b];return c.start<=d.start&&d.start<=c.end&&c.end<=d.end?(c.end=d.end,this.customTimeRangeArray.splice(b,1),!0):d.start<=c.start&&c.start<=d.end&&d.end<=c.end?(c.start=d.start,this.customTimeRangeArray.splice(b,1),!0):d.start<=c.start&&c.start<=d.end&&c.end<=d.end?(this.customTimeRangeArray.splice(a,1),!0):c.start<=d.start&&d.start<=c.end&&d.end<=c.end&&(this.customTimeRangeArray.splice(b,1),!0)}function e(a){return this.customTimeRangeArray[a].start}function f(a){return this.customTimeRangeArray[a].end}var g=[],h=0;return{customTimeRangeArray:g,length:h,add:a,clear:b,remove:c,mergeRanges:d,start:e,end:f}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="CustomTimeRanges",c.default=g.default.getClassFactory(e),b.exports=c.default},{8:8}],100:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){if(void 0!==t)return t;t=!1;var b,c="1",d="1";
44063try{"undefined"!=typeof window&&(b=window[a])}catch(e){return r("Warning: DOMStorage access denied: "+e.message), 44064t}if(!b||a!==o&&a!==p)return t;try{b.setItem(c,d),b.removeItem(c),t=!0}catch(e){r("Warning: DOMStorage is supported, but cannot be used: "+e.message)}return t}function b(){a(o)&&l.forEach(function(a){var b=localStorage.getItem(a.oldKey);if(b){localStorage.removeItem(a.oldKey);try{localStorage.setItem(a.newKey,b)}catch(c){r(c.message)}}})}function c(){u=(0,i.default)(q).getInstance(),b()}function d(){var a=6e5;return Math.round((new Date).getTime()/a)*a}function e(b,c){return a(b)&&u["get"+c+"CachingInfo"]().enabled}function f(a){if(!e(o,"LastMediaSettings"))return null;var b=n.replace(/\?/,a),c=JSON.parse(localStorage.getItem(b))||{},d=(new Date).getTime()-parseInt(c.timestamp,10)>=u.getLastMediaSettingsCachingInfo().ttl||!1,f=c.settings;return d&&(localStorage.removeItem(b),f=null),f}function g(a){var b=NaN;if(e(o,"LastBitrate")){var c=m.replace(/\?/,a),d=JSON.parse(localStorage.getItem(c))||{},f=(new Date).getTime()-parseInt(d.timestamp,10)>=u.getLastBitrateCachingInfo().ttl||!1,g=parseInt(d.bitrate,10);isNaN(g)||f?f&&localStorage.removeItem(c):(b=g,r("Last saved bitrate for "+a+" was "+g))}return b}function h(a,b){if(e(o,"LastMediaSettings")){var c=n.replace(/\?/,a);try{localStorage.setItem(c,JSON.stringify({settings:b,timestamp:d()}))}catch(f){r(f.message)}}}function j(a,b){if(e(o,"LastBitrate")&&b){var c=m.replace(/\?/,a);try{localStorage.setItem(c,JSON.stringify({bitrate:b/1e3,timestamp:d()}))}catch(f){r(f.message)}}}var q=this.context,r=(0,k.default)(q).getInstance().log,s=void 0,t=void 0,u=void 0;return s={getSavedBitrateSettings:g,setSavedBitrateSettings:j,getSavedMediaSettings:f,setSavedMediaSettings:h,isSupported:a},c(),s}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(75),i=d(h),j=a(6),k=d(j),l=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],m="dashjs_?_bitrate",n="dashjs_?_settings",o="localStorage",p="sessionStorage";e.__dashjs_factory_name="DOMStorage";var q=g.default.getSingletonFactory(e);c.default=q,b.exports=c.default},{6:6,75:75,8:8}],101:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a){function b(){return o}function c(a){o=a}function d(a,b){var c=!0,d=0,e=void 0,f=void 0;if(void 0===b&&(b=!1),a.tag>16777215?(n.getUint32(o)!==a.tag&&(c=!1),d=4):a.tag>65535?(e=n.getUint16(o),f=n.getUint8(o+2),256*e+f!==a.tag&&(c=!1),d=3):a.tag>255?(n.getUint16(o)!==a.tag&&(c=!1),d=2):(n.getUint8(o)!==a.tag&&(c=!1),d=1),!c&&a.required&&!b)throw new i.default("required tag not found");return c&&(o+=d),c}function e(a,b){var c=d(a,b);return c&&h(),c}function f(a){var b=void 0;return d(a),b=h(),m[a.parse](b)}function g(a,b){var c=d(a,b),e=void 0;return c&&(e=h(),o+=e),c}function h(a){var b=1,c=128,d=8,e=-1,f=0,g=n.getUint8(o),h=void 0;for(h=0;h<d;h+=1){if((g&c)===c){f=void 0===a?g&~c:g,e=h;break}c>>=1}for(h=0;h<e;h+=1,b+=1)f=f<<8|255&n.getUint8(o+b);return o+=b,f}function j(a){var b=void 0;switch(a){case 4:b=n.getFloat32(o),o+=4;break;case 8:b=n.getFloat64(o),o+=8}return b}function k(a){var b=0,c=void 0;for(c=0;c<a;c+=1)b<<=8,b|=255&n.getUint8(o+c);return o+=a,b}function l(){return o<n.byteLength}var m=void 0,n=new DataView(a.data),o=0;return m={getPos:b,setPos:c,consumeTag:d,consumeTagAndSize:e,parseTag:f,skipOverElement:g,getMatroskaCodedNum:h,getMatroskaFloat:j,getMatroskaUint:k,moreData:l}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(113),i=d(h);e.__dashjs_factory_name="EBMLParser",c.default=g.default.getClassFactory(e),b.exports=c.default},{113:113,8:8}],102:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){l.trigger(i.default.ERROR,{error:"capability",event:a})}function b(a,b,c){l.trigger(i.default.ERROR,{error:"download",event:{id:a,url:b,request:c}})}function c(a,b,c,d){l.trigger(i.default.ERROR,{error:"manifestError",event:{message:a,id:b,manifest:c,event:d}})}function d(a,b,c){l.trigger(i.default.ERROR,{error:"cc",event:{message:a,id:b,cc:c}})}function e(a){l.trigger(i.default.ERROR,{error:"mediasource",event:a})}function f(a){l.trigger(i.default.ERROR,{error:"key_session",event:a})}function h(a){l.trigger(i.default.ERROR,{error:"key_message",event:a})}var j=void 0,k=this.context,l=(0,g.default)(k).getInstance();return j={capabilityError:a,downloadError:b,manifestError:c,timedTextError:d,mediaSourceError:e,mediaKeySessionError:f,mediaKeyMessageError:h}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(7),g=d(f),h=a(11),i=d(h),j=a(8),k=d(j),l="mediasource",m="mediakeys",n="manifest",o="SIDX",p="content",q="initialization",r="xlink",s="codec",t="parse",u="nostreams",v="parse";e.__dashjs_factory_name="ErrorHandler";var w=k.default.getSingletonFactory(e);w.CAPABILITY_ERROR_MEDIASOURCE=l,w.CAPABILITY_ERROR_MEDIAKEYS=m,w.DOWNLOAD_ERROR_ID_MANIFEST=n,w.DOWNLOAD_ERROR_ID_SIDX=o,w.DOWNLOAD_ERROR_ID_CONTENT=p,w.DOWNLOAD_ERROR_ID_INITIALIZATION=q,w.DOWNLOAD_ERROR_ID_XLINK=r,w.MANIFEST_ERROR_ID_CODEC=s,w.MANIFEST_ERROR_ID_PARSE=t,w.MANIFEST_ERROR_ID_NOSTREAMS=u,w.TIMED_TEXT_ERROR_ID_PARSE=v,c.default=w,b.exports=c.default},{11:11,7:7,8:8}],103:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var b=a.streamId,c=a.mediaInfo.type,e=a.quality;d[b]=d[b]||{},d[b][c]=d[b][c]||{},d[b][c][e]=a}function b(a,b,c){return d[a][b][c]}function c(){d={}}var d={},e={save:a,extract:b,reset:c};return e}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="InitCache",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],104:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){return a&&k&&k.boxes&&0!==k.boxes.length?i(k.fetch(a)
44064):null}function b(a){for(var b,c=k.fetchAll(a),d=[],e=0,f=c.length;e<f;e++)b=i(c[e]),b&&d.push(b);return d}function c(a){k=a}function d(){if(!k||!k.boxes||!k.boxes.length)return null;var a=k.boxes[k.boxes.length-1].type,c=b(a);return c[c.length-1]}function e(){return k._cursor.offset}function f(){l={offset:"_offset",size:"size",type:"type"},m={references:"references",timescale:"timescale",earliest_presentation_time:"earliest_presentation_time",first_offset:"first_offset"},n={reference_type:"reference_type",referenced_size:"referenced_size",subsegment_duration:"subsegment_duration"},o={id:"id",value:"value",timescale:"timescale",scheme_id_uri:"scheme_id_uri",presentation_time_delta:"presentation_time_delta",event_duration:"event_duration",message_data:"message_data"},p={timescale:"timescale"},q={sequence_number:"sequence_number"},r={base_data_offset:"base_data_offset",sample_description_index:"sample_description_index",default_sample_duration:"default_sample_duration",default_sample_size:"default_sample_size",default_sample_flags:"default_sample_flags",flags:"flags"},s={version:"version",baseMediaDecodeTime:"baseMediaDecodeTime",flags:"flags"},t={sample_count:"sample_count",first_sample_flags:"first_sample_flags",data_offset:"data_offset",flags:"flags",samples:"samples"},u={sample_size:"sample_size",sample_duration:"sample_duration",sample_composition_time_offset:"sample_composition_time_offset"}}function h(a,b,c){for(var d in c)b[d]=a[c[d]]}function i(a){if(!a)return null;var b,c,d=new g.default;switch(h(a,d,l),a.hasOwnProperty("_incomplete")&&(d.isComplete=!a._incomplete),d.type){case"sidx":if(h(a,d,m),d.references)for(b=0,c=d.references.length;b<c;b++)h(a.references[b],d.references[b],n);break;case"emsg":h(a,d,o);break;case"mdhd":h(a,d,p);break;case"mfhd":h(a,d,q);break;case"tfhd":h(a,d,r);break;case"tfdt":h(a,d,s);break;case"trun":if(h(a,d,t),d.samples)for(b=0,c=d.samples.length;b<c;b++)h(a.samples[b],d.samples[b],u)}return d}var j=void 0,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,u=void 0;return j={getBox:a,getBoxes:b,setData:c,getLastBox:d,getOffset:e},f(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a(116),g=d(f),h=a(8),i=d(h);e.__dashjs_factory_name="IsoFile",c.default=i.default.getClassFactory(e),b.exports=c.default},{116:116,8:8}],105:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){n=a,p=b,s=!1,t=NaN,v=null,q=(0,o.default)(h).getInstance(),w=g.default.BEST_GUESS_RULES,j.on(m.default.STREAM_INITIALIZED,f,this)}function b(){s=!1,t=NaN}function c(){return v}function d(){j.off(m.default.STREAM_INITIALIZED,f,this),b(),v=null,n=null,p=null,s=!1,t=NaN,w=null,q=null}function e(a){var b=((new Date).getTime()-t)/1e3;v=a.value,j.trigger(m.default.LIVE_EDGE_SEARCH_COMPLETED,{liveEdge:v,searchTime:b,error:null===v?new i.default(r,"live edge has not been found",null):null})}function f(a){!p.isDynamic()||s||a.error||(w=n.isTimeSyncCompleted()?g.default.TIME_SYNCHRONIZED_RULES:g.default.BEST_GUESS_RULES,u=(0,g.default)(h).getInstance().getRules(w),s=!0,t=(new Date).getTime(),q.applyRules(u,p,e,null,function(a,b){return b}))}var h=this.context,j=(0,k.default)(h).getInstance(),l=void 0,n=void 0,p=void 0,q=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0;return l={initialize:a,abortSearch:b,getLiveEdge:c,reset:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(95),g=d(f),h=a(113),i=d(h),j=a(7),k=d(j),l=a(11),m=d(l),n=a(80),o=d(n),p=a(8),q=d(p),r=1;e.__dashjs_factory_name="LiveEdgeFinder";var s=q.default.getSingletonFactory(e);s.LIVE_EDGE_NOT_FOUND_ERROR_CODE=r,c.default=s,b.exports=c.default},{11:11,113:113,7:7,8:8,80:80,95:95}],106:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a,b){return JSON.stringify(a)===JSON.stringify(b)}var b=void 0;return b={areSimpleEquivalent:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="ObjectUtils",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],107:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){return a}function b(a){return a}var c=void 0;return c={modifyRequestURL:a,modifyRequestHeader:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="RequestModifier",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],108:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){a&&a.videoModel&&(ba=a.videoModel)}function b(a){if(a.hasOwnProperty("begin")&&a.hasOwnProperty("end")){var b=o(a.begin),c=o(a.end);return[b,c]}return null}function c(){var a="cue_TTML_"+ca;return ca++,a}function d(a,b,c){function d(a,b){if(a.hasOwnProperty(b)){var c=a[b];f.indexOf(c)<0&&f.push(c)}}for(var e=[],f=[],g=[],h=0;h<a.length;h++){var i=a[h];d(i,"begin"),d(i,"end")}if(0===f.length)return g;if("undefined"!=typeof b&&"undefined"!=typeof c){for(var h=0;h<f.length;h++){var j=o(f[h]);b<j&&j<c&&e.push(j)}e.push(b),e.push(c)}else for(var h=0;h<f.length;
44064h++)e.push(o(f[h]));e.sort(function(a,b){return a-b});for(var h=0;h<e.length-1;h++)g.push([e[h],e[h+1]]);return g}function e(a,b){return"undefined"!=typeof startInterval&&a<b&&(a=b),a}function f(a,b){return"undefined"!=typeof b&&a>b&&(a=b),a}function g(a,b,c){var d=o(a.begin),g=o(a.end);return d=e(d,b),g=f(g,c),"undefined"!=typeof b&&"undefined"!=typeof c&&(g<b||d>c)?(L("TTML: Cue "+d+"-"+g+" outside interval "+b+"-"+c),null):[d,g]}function h(a,c){var d=!0;if(a.hasOwnProperty("span")){var e=b(a.span);null!==e&&(d=e[0]<c[1]&&e[1]>c[0])}return d}function j(a,e,f){var j=void 0,k=void 0,l=void 0,m=void 0,n=void 0,o="",r=new i.default([],"",(!1));if(O=r.xml_str2json(a),!O)throw new Error("TTML document could not be parsed");if(ba.getTTMLRenderingDiv()&&(n="html"),j=O.tt,!j)throw new Error("TTML document lacks tt element");var s=p(j,"http://www.w3.org/ns/ttml");if(s&&q(j,s),m=j["tts:extent"],k=j.head,!k)throw new Error("TTML document lacks head element");if(k.layout&&(Q=k.layout.region_asArray),k.styling&&(P=k.styling.style_asArray),l=j.body,!l)throw new Error("TTML document lacks body element");var w=E(),x=ba.getElement().clientWidth,y=ba.getElement().clientHeight,z=[x/w[0],y/w[1]];V["font-size"]=z[1]+"px;";var D=[];if(Q)for(var J=0;J<Q.length;J++)D.push(B(JSON.parse(JSON.stringify(Q[J])),z));var K=p(O.tt,"http://www.w3.org/ns/ttml#parameter");j.hasOwnProperty(K+":frameRate")&&(j.frameRate=parseInt(j[K+":frameRate"],10));for(var M=[],N=j.body_asArray[0].__children,U=0;U<N.length;U++){var W=N[U].div,X=null;if(null===(X=b(W))){var Y=W.p_asArray;if(null===X&&(!Y||0===Y.length))return o="TTML has div that contains no timing and no paragraphs.",L(o),M;for(var Z=0;Z<Y.length;Z++){var $=Y[Z],_=$.span_asArray,aa=[];if($.hasOwnProperty("begin")&&$.hasOwnProperty("end")){var ca=g($,e,f);null!==ca&&aa.push(ca)}else aa=d(_,e,f);if(0!==aa.length)for(var da=$.__children,ea=0;ea<aa.length;ea++){for(var fa=aa[ea],ga=[],ha=0;ha<da.length;ha++){var ia=da[ha];h(ia,fa)&&ga.push(ia)}if(0!==ga.length)if("html"===n){S={},T={},R={};var ja=H($,W,z),ka=I($,z),la=ka[1];ka=ka[0];var ma=document.createElement("div");ma.className=la;var na=G(ga,z);na.className="cueDirUniWrapper",t("unicode-bidi",ka)&&(na.style.cssText+=u("unicode-bidi",ka),v("unicode-bidi",ka)),t("direction",ka)&&(na.style.cssText+=u("direction",ka),v("direction",ka)),t("padding-left",ka)&&t("padding-right",ka)&&(na.innerHTML=F(na,ka)),t("padding-left",ka)&&t("padding-right",ka)&&(v("padding-left",ka),v("padding-right",ka));var oa="";if(t("regionID",ja)){var pa=u("regionID",ja);oa=pa.slice(pa.indexOf(":")+1,pa.length-1)}ka&&(ma.style.cssText=ka.join(" ")+"display:flex;"),ja&&(ja=ja.join(" ")),ma.appendChild(na);var qa=document.createElement("div");qa.appendChild(ma),qa.id=c(),qa.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+ja,0===Object.keys(R).length&&(R.defaultFontSize="100"),M.push({start:fa[0],end:fa[1],type:"html",cueHTMLElement:qa,regions:D,regionID:oa,cueID:qa.id,videoHeight:y,videoWidth:x,cellResolution:w,fontSize:R||{defaultFontSize:"100"},lineHeight:S,linePadding:T})}else{var ra="",sa=ga;sa.length&&sa.forEach(function(a){if(a.hasOwnProperty("span")){var b=a.span.__children;b.forEach(function(a){b.hasOwnProperty("metadata")||(a.hasOwnProperty("#text")?ra+=a["#text"].replace(/[\r\n]+/gm," ").trim():"br"in a&&(ra+="\n"))})}else ra+=a.hasOwnProperty("br")?"\n":a["#text"].replace(/[\r\n]+/gm," ").trim()}),M.push({start:fa[0],end:fa[1],data:ra,type:"text"})}}else o="TTML: Empty paragraph"}}else{var ta=void 0;if(W.region){var ua=C(Q,W.region);ta=A(ua,m)}ta||(ta=A(W,m));var va=j.head.metadata.image_asArray;if(void 0!==W["smpte:backgroundImage"])for(var wa=0;wa<va.length;wa++)"#"+va[wa]["xml:id"]===W["smpte:backgroundImage"]&&M.push({start:X[0],end:X[1],id:c(),data:"data:image/"+va[wa].imagetype.toLowerCase()+";base64, "+va[wa].__text,type:"image",layout:ta})}}if(""!==o&&L(o),M.length>0)return M;throw new Error(o)}function n(){N=/^([0-9][0-9]+):([0-5][0-9]):([0-5][0-9])|(60)(\.([0-9])+)?$/,R={},S={},T={},U={top:"auto;",left:"auto;",width:"90%;",height:"10%;","align-items":"flex-start;",overflow:"visible;","-ms-writing-mode":"lr-tb, horizontal-tb;","-webkit-writing-mode":"horizontal-tb;","-moz-writing-mode":"horizontal-tb;","writing-mode":"horizontal-tb;"},V={color:"rgb(255,255,255);",direction:"ltr;","font-family":"monospace, sans-serif;","font-style":"normal;","line-height":"normal;","font-weight":"normal;","text-align":"start;","justify-content":"flex-start;","text-decoration":"none;
44064","unicode-bidi":"normal;","white-space":"normal;",width:"100%;"},W={monospace:"font-family: monospace;",sansSerif:"font-family: sans-serif;",serif:"font-family: serif;",monospaceSansSerif:"font-family: monospace, sans-serif;",monospaceSerif:"font-family: monospace, serif;",proportionalSansSerif:"font-family: Arial;",proportionalSerif:"font-family: Times New Roman;",default:"font-family: monospace, sans-serif;"},X={right:["justify-content: flex-end;","text-align: right;"],start:["justify-content: flex-start;","text-align: start;"],center:["justify-content: center;","text-align: center;"],end:["justify-content: flex-end;","text-align: end;"],left:["justify-content: flex-start;","text-align: left;"]},Y={start:"text-align: start;",center:"text-align: center;",end:"text-align: end;",auto:""},Z={wrap:"white-space: normal;",noWrap:"white-space: nowrap;"},$={normal:"unicode-bidi: normal;",embed:"unicode-bidi: embed;",bidiOverride:"unicode-bidi: bidi-override;"},_={before:"align-items: flex-start;",center:"align-items: center;",after:"align-items: flex-end;"},aa={lrtb:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;",rltb:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;direction: rtl;unicode-bidi: bidi-override;",tbrl:"-webkit-writing-mode: vertical-rl;writing-mode: vertical-rl;-webkit-text-orientation: upright;text-orientation: upright;",tblr:"-webkit-writing-mode: vertical-lr;writing-mode: vertical-lr;-webkit-text-orientation: upright;text-orientation: upright;",lr:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;",rl:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;direction: rtl;",tb:"-webkit-writing-mode: vertical-rl;writing-mode: vertical-rl;-webkit-text-orientation: upright;text-orientation: upright;"}}function o(a){var b,c,d,e=N.test(a);if(!e)return NaN;if(b=a.split(":"),c=parseFloat(b[0])*l+parseFloat(b[1])*m+parseFloat(b[2]),b[3]){if(d=O.tt.frameRate,!d||isNaN(d))return NaN;c+=parseFloat(b[3])/d}return c}function p(a,b){var c=Object.keys(a).filter(function(c){return("xmlns"===c.split(":")[0]||"xmlns"===c.split(":")[1])&&a[c]===b}).map(function(a){return a.split(":")[2]||a.split(":")[1]});return 1!=c.length?null:c[0]}function q(a,b){for(var c in a)if(a.hasOwnProperty(c)){if(("object"==typeof a[c]||a[c]instanceof Object)&&!Array.isArray(a[c]))q(a[c],b);else if(Array.isArray(a[c]))for(var d=0;d<a[c].length;d++)q(a[c][d],b);var e=c.slice(c.indexOf(b)+b.length+1);a[e]=a[c],delete a[c]}}function r(a){return a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function s(a){var b=a.slice(1),c=b.match(/.{2}/g),d=parseFloat(parseInt(parseInt(c[3],16)/255*1e3,10)/1e3),e=c.slice(0,3).map(function(a){return parseInt(a,16)});return"rgba("+e.join(",")+","+d+");"}function t(a,b){for(var c=0;c<b.length;c++)if(b[c].indexOf(a)>-1)return!0;return!1}function u(a,b){for(var c=0;c<b.length;c++)if(b[c].indexOf(a)>-1)return b[c];return null}function v(a,b){b.splice(b.indexOf(u(a,b)),1)}function w(a,b){for(var c=0;c<a.length;c++)for(var d=0;d<b.length;d++)a[c]&&a[c].split(":")[0].indexOf(b[d].split(":")[0])>-1&&a.splice(c,1);return a.concat(b)}function x(a,b,c){var d=[];for(var e in a)if(a.hasOwnProperty(e)){var f=e.replace("ebutts:","");f=f.replace("xml:",""),f=f.replace("tts:",""),f=r(f),a[f]=a[e],delete a[e]}if("line-padding"in a){var g=parseFloat(a["line-padding"].slice(a["line-padding"].indexOf(":")+1,a["line-padding"].indexOf("c")));"id"in a&&(T[a.id]=g);var h=g*b[0]+"px;";d.push("padding-left:"+h),d.push("padding-right:"+h)}if("font-size"in a){var i=parseFloat(a["font-size"].slice(a["font-size"].indexOf(":")+1,a["font-size"].indexOf("%")));"id"in a&&(R[a.id]=i);var j=i/100*b[1]+"px;";d.push("font-size:"+j)}if("line-height"in a)if("normal"===a["line-height"])d.push("line-height: normal;");else{var k=parseFloat(a["line-height"].slice(a["line-height"].indexOf(":")+1,a["line-height"].indexOf("%")));"id"in a&&(S[a.id]=k);var l=k/100*b[1]+"px;";d.push("line-height:"+l)}"font-family"in a&&(a["font-family"]in W?d.push(W[a["font-family"]]):d.push("font-family:"+a["font-family"]+";")),"text-align"in a&&a["text-align"]in X&&(d.push(X[a["text-align"]][0]),d.push(X[a["text-align"]][1])),"multi-row-align"in a&&(t("text-align",d)&&"auto"!=a["multi-row-align"]&&v("text-align",d),a["multi-row-align"]in Y&&d.push(Y[a["multi-row-align"]]));var m;return"background-color"in a&&(a["background-color"].indexOf("#")>-1&&a["background-color"].length-1===8?(m=s(a["background-color"]),d.push("background-color: "+m)):d.push("background-color:"+a["background-color"]+";")),"color"in a&&(a.color.indexOf("#")>-1&&a.color.length-1===8?(m=s(a.color),d.push("color: "+m)):d.push("color:"+a.color+";")),"wrap-option"in a&&(a["wrap-option"]in Z?d.push(Z[a["wrap-option"]]):d.push("white-space:"+a["wrap-option"])),"unicode
44064-bidi"in a&&(a["unicode-bidi"]in $?d.push($[a["unicode-bidi"]]):d.push("unicode-bidi:"+a["unicode-bidi"])),"font-style"in a&&d.push("font-style:"+a["font-style"]+";"),"font-weight"in a&&d.push("font-weight:"+a["font-weight"]+";"),"direction"in a&&d.push("direction:"+a.direction+";"),"text-decoration"in a&&d.push("text-decoration:"+a["text-decoration"]+";"),c&&(d=d.concat(B(a,b))),O.tt.hasOwnProperty("xml:space")&&"preserve"===O.tt["xml:space"]&&d.push("white-space: pre;"),d}function y(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(d["xml:id"]===b||d.id===b)return d}return null}function z(a,b,c){var d=[],e=a.match(/\S+/g);return e.forEach(function(a){var e=y(P,a);if(e){var f=x(JSON.parse(JSON.stringify(e)),b,c);d=d.concat(f)}}),d}function A(a,b){var c=/([\d\.]+)(%|px)\s+([\d\.]+)(%|px)/;if("tts:extent"in a&&"tts:origin"in a){var d=c.exec(a["tts:extent"]),e=c.exec(a["tts:origin"]);if(null===d||null===e)return L("Bad extent or origin: "+a["tts:extent"]+" "+a["tts:origin"]),null;var f=parseFloat(d[1]),g=parseFloat(d[3]),h=parseFloat(e[1]),i=parseFloat(e[3]);if(b){var j=c.exec(b);if(null===j||"px"!==j[2]||"px"!==j[4])return L("Bad tt.extent: "+b),null;var k=parseFloat(j[1]),l=parseFloat(j[3]);"px"===d[2]&&(f=f/k*100),"px"===d[4]&&(g=g/l*100),"px"===e[2]&&(h=h/k*100),"px"===e[4]&&(i=i/l*100)}return{left:h,top:i,width:f,height:g}}return null}function B(a,b){var c=[];for(var d in a){var e=d.replace("tts:","");e=e.replace("xml:",""),e=r(e),a[e]=a[d],e!==d&&delete a[d]}if("extent"in a){var f=a.extent.split(/\s/);c.push("width: "+f[0]+";"),c.push("height: "+f[1]+";")}if("origin"in a){var g=a.origin.split(/\s/);c.push("left: "+g[0]+";"),c.push("top: "+g[1]+";")}if("display-align"in a&&c.push(_[a["display-align"]]),"writing-mode"in a&&c.push(aa[a["writing-mode"]]),"style"in a){var h=z(a.style,b,!0);c=c.concat(h)}return"padding"in a&&c.push("padding:"+a.padding+";"),"overflow"in a&&c.push("overflow:"+a.overflow+";"),"show-background"in a&&c.push("show-background:"+a["show-background"]+";"),"id"in a&&c.push("regionID:"+a.id+";"),c}function C(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(d["xml:id"]===b||d.id===b)return d}return null}function D(a,b){var c=[],d=a.match(/\S+/g);return d.forEach(function(a){var d=C(Q,a);if(d){var e=B(JSON.parse(JSON.stringify(d)),b);c=c.concat(e)}}),c}function E(){var a=[32,15];return O.tt.hasOwnProperty("ttp:cellResolution")?O.tt["ttp:cellResolution"].split(" ").map(parseFloat):a}function F(a,b){for(var c=u("padding-left",b),d=u("padding-right",b),e=c.concat(" "+d+" "),f="",g="",h="",i=Array.prototype.slice.call(a.children),j=a.getElementsByClassName("lineBreak")[0],k=i.indexOf(j),l=[];k!=-1;)l.push(k),k=i.indexOf(j,k+1);var m="</span>",n="<br>",o='<span class="spanPadding" style="-webkit-box-decoration-break: clone; box-decoration-break: clone; ';if(l.length)l.forEach(function(a,b){if(0===b){for(var c="",d=0;d<a;d++)f+=i[d].outerHTML,0===d&&(c=e.concat(i[d].style.cssText));f=o+c+'">'+f}for(var j="",k=a+1;k<i.length;k++)g+=i[k].outerHTML,k===i.length-1&&(j+=e.concat(i[k].style.cssText));g=o+j+'">'+g,f&&g&&b===l.length-1?h+=f+m+n+g+m:f&&g&&b!==l.length-1?h+=f+m+n+g+m+n:f&&!g?h+=f+m:!f&&g&&b===l.length-1?h+=g+m:!f&&g&&b!==l.length-1&&(h+=g+m+n)});else{for(var p="",q=0;q<i.length;q++)p+=i[q].style.cssText;h=o+e+p+'">'+a.innerHTML+m}return h}function G(a,b){var c=document.createElement("div");return a.forEach(function(a){if(!a.hasOwnProperty("metadata"))if(a.hasOwnProperty("span")){var d=a.span.__children,e=document.createElement("span");if(a.span.hasOwnProperty("style")){var f=z(a.span.style,b);e.className="spanPadding "+a.span.style,e.style.cssText=f.join(" ")}d.forEach(function(a){if(!d.hasOwnProperty("metadata"))if(a.hasOwnProperty("#text")){var b=document.createTextNode(a["#text"]);e.appendChild(b)}else if("br"in a){e.hasChildNodes()&&c.appendChild(e);var f=document.createElement("br");f.className="lineBreak",c.appendChild(f);var g=document.createElement("span");g.className=e.className,g.style.cssText=e.style.cssText,e=g}}),c.appendChild(e)}else if(a.hasOwnProperty("br")){var g=document.createElement("br");g.className="lineBreak",c.appendChild(g)}else if(a.hasOwnProperty("#text")){var h=document.createElement("span");h.textContent=a["#text"],c.appendChild(h)}}),c}
44064function H(a,b,c){var d,e,f=[],g=a.region,h=b.region;return h&&(d=D(h,c)),g?(e=f.concat(D(g,c)),f=d?w(d,e):e):d&&(f=d),J(f,U),f}function I(a,b){var c,d,e,f=[],g=a.style,h=O.tt.body.style,i=O.tt.body.div.style,j="";return h&&(c=z(h,b),j="paragraph "+h),i&&(d=z(i,b),c?(d=w(c,d),j+=" "+i):j="paragraph "+i),g?(e=z(g,b),c&&d?(f=w(d,e),j+=" "+g):c?(f=w(c,e),j+=" "+g):d?(f=w(d,e),j+=" "+g):(f=e,j="paragraph "+g)):c&&!d?f=c:!c&&d&&(f=d),J(f,V),[f,j]}function J(a,b){for(var c in b)b.hasOwnProperty(c)&&(t(c,a)||a.push(c+":"+b[c]))}var K=this.context,L=(0,k.default)(K).getInstance().log,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=0;return M={parse:j,setConfig:a},n(),M}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(3),i=d(h),j=a(6),k=d(j),l=3600,m=60;e.__dashjs_factory_name="TTMLParser",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{3:3,6:6,8:8}],109:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var b="";return a.indexOf("/")!==-1&&(a.indexOf("?")!==-1&&(a=a.substring(0,a.indexOf("?"))),b=a.substring(0,a.lastIndexOf("/")+1)),b}function b(a){var b=a.match(i);return b?b[1]:""}function c(a){return!g.test(a)}function d(a){return g.test(a)&&"/"===a.charAt(0)}function e(a){return h.test(a)}var f=void 0,g=/^(?:(?:[a-z]+:)?\/)?\//i,h=/^https?:\/\//i,i=/^(https?:\/\/[^\/]+)\/?/i;return f={parseBaseUrl:a,parseOrigin:b,isRelative:c,isPathAbsolute:d,isHTTPURL:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f);e.__dashjs_factory_name="URLUtils",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{8:8}],110:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(){k=/(?:\r\n|\r|\n)/gm,l=/-->/,m=/(^[\s]+|[\s]+$)/g,n=/\s\b/g}function b(a){var b,e,g=[];a=a.split(k),b=a.length,e=-1;for(var i=0;i<b;i++){var j=a[i];if(j.length>0&&"WEBVTT"!==j&&j.match(l)){var n=d(j),o=n.cuePoints,p=n.styles,q=f(a,i+1),r=c(o[0].replace(m,"")),s=c(o[1].replace(m,""));!isNaN(r)&&!isNaN(s)&&r>=e&&s>r?""!==q?(e=r,g.push({start:r,end:s,data:q,styles:p})):h("Skipping cue due to empty/malformed cue text"):h("Skipping cue due to incorrect cue timing")}}return g}function c(a){var b=a.split(":"),c=b.length-1;return a=60*parseInt(b[c-1],10)+parseFloat(b[c]),2===c&&(a+=3600*parseInt(b[0],10)),a}function d(a){var b=a.split(l),c=b[1].split(n);return c.shift(),b[1]=c[0],c.shift(),{cuePoints:b,styles:e(c)}}function e(a){var b={};return a.forEach(function(a){if(a.split(/:/).length>1){var c=a.split(/:/)[1];c&&c.search(/%/)!=-1&&(c=parseInt(c.replace(/%/,""),10)),(a.match(/align/)||a.match(/A/))&&(b.align=c),(a.match(/line/)||a.match(/L/))&&(b.line=c),(a.match(/position/)||a.match(/P/))&&(b.position=c),(a.match(/size/)||a.match(/S/))&&(b.size=c)}}),b}function f(a,b){for(var c,d=b,e="",f="";""!==a[d]&&d<a.length;)d++;if(c=d-b,c>1)for(var g=0;g<c;g++){if(f=a[b+g],f.match(l)){e="";break}e+=f,g!==c-1&&(e+="\n")}else f=a[b],f.match(l)||(e=f);return decodeURI(e)}var g=this.context,h=(0,i.default)(g).getInstance().log,j=void 0,k=void 0,l=void 0,m=void 0,n=void 0;return j={parse:b},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a(8),g=d(f),h=a(6),i=d(h);e.__dashjs_factory_name="VTTParser",c.default=g.default.getSingletonFactory(e),b.exports=c.default},{6:6,8:8}],111:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.qualityIndex=NaN};c.default=e,b.exports=c.default},{}],112:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN};c.default=e,b.exports=c.default},{}],113:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(b,c,e){d(this,a),this.code=b||null,this.message=c||null,this.data=e||null};c.default=e,b.exports=c.default},{}],114:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.action=a.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.qual
44064ity=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer"};e.ACTION_DOWNLOAD="download",e.ACTION_COMPLETE="complete",c.default=e,b.exports=c.default},{}],115:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(114),i=d(h),j=function(a){function b(a){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.url=a||null,this.checkForExistenceOnly=!0}return f(b,a),b}(i.default);c.default=j,b.exports=c.default},{114:114}],116:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.offset=NaN,this.type=null,this.size=NaN,this.isComplete=!0};c.default=e,b.exports=c.default},{}],117:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null};c.default=e,b.exports=c.default},{}],118:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0 44065});var e=function a(){d(this,a),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.co
44065dec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null};c.default=e,b.exports=c.default},{}],119:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[],this.BolaState=[]};c.default=e,b.exports=c.default},{}],120:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isFirst=!0};c.default=e,b.exports=c.default},{}],121:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a(114),i=d(h),j=function(a){function b(a,c){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.url=a||null,this.type=c||null,this.mediaType="stream",this.responseType="text"}return f(b,a),b}(i.default);c.default=j,b.exports=c.default},{114:114}],122:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.video=null,this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1};c.default=e,b.exports=c.default},{}],123:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null};c.default=e,b.exports=c.default},{}],124:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null};c.default=e,b.exports=c.default},{}],125:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this._s=void 0};c.default=e,b.exports=c.default},{}],126:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.t=null,this.level=null};c.default=e,b.exports=c.default},{}],127:[function(a,b,c){;function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var f=a(60),g=d(f),h=function a(){e(this,a),this.target=null,this.state=g.default.BUFFER_EMPTY};c.default=h,b.exports=c.default},{60:60}],128:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.time=null,this.range=null,this.manifestInfo=null};c.default=e,b.exports=c.default},{}],129:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.time=null,this.droppedFrames=null};c.default=e,b.exports=c.default},{}],130:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null},f=function a(){d(this,a),this.s=null,this.d=null,this.b=[]};e.MPD_TYPE="MPD",e.XLINK_EXPANSION_TYPE="XLinkExpansion",e.INIT_SEGMENT_TYPE="InitializationSegment",e.INDEX_SEGMENT_TYPE="IndexSegment",e.MEDIA_SEGMENT_TYPE="MediaSegment",e.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",e.OTHER_TYPE="other",c.HTTPRequest=e,c.HTTPRequestTrace=f},{}],131:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOff
44065set=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.trackInfo=[]},f=function a(){d(this,a),this.id=null,this.index=null,this.start=null,this.duration=null},g=function a(){d(this,a),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null};c.ManifestUpdate=e,c.ManifestUpdateStreamInfo=f,c.ManifestUpdateTrackInfo=g},{}],132:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};e.INITIAL_PLAYOUT_START_REASON="initial_playout",e.SEEK_START_REASON="seek",e.RESUME_FROM_PAUSE_START_REASON="resume",e.METRICS_COLLECTION_START_REASON="metrics_collection_start";var f=function a(){d(this,a),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};f.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",f.REBUFFERING_REASON="rebuffering",f.USER_REQUEST_STOP_REASON="user_request",f.END_OF_PERIOD_STOP_REASON="end_of_period",f.END_OF_CONTENT_STOP_REASON="end_of_content",f.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",f.FAILURE_STOP_REASON="failure",c.PlayList=e,c.PlayListTrace=f},{}],133:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.t=null,this.mt=null,this.to=null,this.lto=null};c.default=e,b.exports=c.default},{}],134:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.loadingRequests=[],this.executedRequests=[]};c.default=e,b.exports=c.default},{}],135:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null};c.default=e,b.exports=c.default},{}],136:[function(a,b,c){;function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function a(){d(this,a),this.tcpid=null,this.dest=null,this.topen=null,this.tclose=null,this.tconnect=null};c.default=e,b.exports=c.default},{}]},{},[49])(49)}); 44066//# sourceMappingURL=dash.mediaplayer.min.js.map 44067!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=8)}([function(t,e,r){;function i(){}function a(t,e){return e="["+t+"] > "+e}function n(t){var e=self.console[t];return e?function(){for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];i[0]&&(i[0]=a(t,i[0])),e.apply(self.console,i)}:i}function o(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];r.forEach(function(e){u[e]=t[e]?t[e].bind(t):n(e)})}r.d(e,"a",function(){return d}),r.d(e,"b",function(){return h});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={trace:i,debug:i,log:i,warn:i,info:i,error:i},u=l,d=function(t){if(!0===t||"object"===(void 0===t?"undefined":s(t))){o(t,"debug","log","info","warn","error");try{u.log()}catch(t){u=l}}else u=l},h=u},function(t,e,r){
vendor: 2,000 bytes, line 44067
44067;e.a={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCH:"hlsLevelSwitch",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCH:"hlsAudioTrackSwitch",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(t,e,r){
vendor: 13,698 bytes, line 44067
44067;r.d(e,"b",function(){return i}),r.d(e,"a",function(){return a});var i={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},a={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(t,e,r){;function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"b",function(){return n});var a=function(){function t(){i(this,t)}return t.isHeader=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.isFooter=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.getID3Data=function(e,r){for(var i=r,a=0;t.isHeader(e,r);){a+=10;a+=t._readSize(e,r+6),t.isFooter(e,r+10)&&(a+=10),r+=a}if(a>0)return e.subarray(i,i+a)},t._readSize=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},t.getTimeStamp=function(e){for(var r=t.getID3Frames(e),i=0;i<r.length;i++){var a=r[i];if(t.isTimeStampFrame(a))return t._readTimeStamp(a)}},t.isTimeStampFrame=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},t._getFrameData=function(e){var r=String.fromCharCode(e[0],e[1],e[2],e[3]),i=t._readSize(e,4);return{type:r,size:i,data:e.subarray(10,10+i)}},t.getID3Frames=function(e){for(var r=0,i=[];t.isHeader(e,r);){var a=t._readSize(e,r+6);r+=10;for(var n=r+a;r+8<n;){var o=t._getFrameData(e.subarray(r)),s=t._decodeFrame(o);s&&i.push(s),r+=o.size+10}t.isFooter(e,r)&&(r+=10)}return i},t._decodeFrame=function(e){return"PRIV"===e.type?t._decodePrivFrame(e):"T"===e.type[0]?t._decodeTextFrame(e):"W"===e.type[0]?t._decodeURLFrame(e):void 0},t._readTimeStamp=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},t._decodePrivFrame=function(e){if(!(e.size<2)){var r=t._utf8ArrayToStr(e.data,!0),i=new Uint8Array(e.data.subarray(r.length+1));return{key:e.type,info:r,data:i.buffer}}},t._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:n}}},t._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data);return{key:e.type,data:n}},t._utf8ArrayToStr=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.length,i=void 0,a=void 0,n=void 0,o="",s=0;s<r;){if(0===(i=t[s++])&&e)return o;if(0!==i&&3!==i)switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:a=t[s++],o+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=t[s++],n=t[s++],o+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&n)<<0)}}return o},t}(),n=a._utf8ArrayToStr;e.a=a},function(t,e,r){;function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(e,r){i(this,t),this.subtle=e,this.aesIV=r}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),l=s,u=function(){function t(e,r){a(this,t),this.subtle=e,this.key=r}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),d=u,h=function(){function t(){n(this,t),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return t.prototype.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},t.prototype.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],a=r[1],n=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],h=s[3],c=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)c[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,t[f]=v,e[v]=f;var y=c[f],m=c[y],b=c[m],E=257*c[v]^16843008*v;i[f]=E<<24|E>>>8,a[f]=E<<16|E>>>16,n[f]=E<<8|E>>>24,o[f]=E,E=16843009*b^65537*m^257*y^16843008*f,l[v]=E<<24|E>>>8,u[v]=E<<16|E>>>16,d[v]=E<<8|E>>>24,h[v]=E,f?(f=y^c[c[c[b^y]]],p^=c[c[p]]):f=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i<e.length&&r;)r=e[i]===this.key[i],i++;if(!r){this.key=e;var a=this.keySize=e.length;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size="+a);var n=this.ksRows=4*(a+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(n),u=this.invKeySchedule=new Uint32Array(n),d=this.sBox,h=this.rcon,c=this.invSubMix,f=c[0],p=c[1],g=c[2],v=c[3],y=void 0,m=void 0;for(o=0;o<n;o++)o<a?y=l[o]=e[o]:(m=y,o%a==0?(m=m<<8|m>>>24,m=d[m>>>24]<<24|d[m>>>16&255]<<16|d[m>>>8&255]<<8|d[255&m],m^=h[o/a|0]<<24):a>6&&o%a==4&&(m=d[m>>>24]<<24|d[m>>>16&255]<<16|d[m>>>8&255]<<8|d[255&m]),l[o]=y=(l[o-a]^m)>>>0);for(s=0;s<n;s++)o=n-s,m=3&s?l[o]:l[o-4],u[s]=s<4||o<=4?m:f[d[m>>>24]]^p[d[m>>>16&255]]^g[d[m>>>8&255]]^v[d[255&m]],u[s]=u[s]>>>0}},t.prototype.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},t.prototype.decrypt=function(t,e,r){for(var i,a,n=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],d=l[1],h=l[2],c=l[3],f=this.uint8ArrayToUint32Array_(r),p=f[0],g=f[1],v=f[2],y=f[3],m=new Int32Array(t),b=new Int32Array(m.length),E=void 0,T=void 0,R=void 0,A=void 0,S=void 0,L=void 0,_=void 0,w=void 0,D=void 0,I=void 0,k=void 0,O=void 0,C=this.networkToHostOrderSwap;e<m.length;){for(D=C(m[e]),I=C(m[e+1]),k=C(m[e+2]),O=C(m[e+3]),S=D^o[0],L=O^o[1],_=k^o[2],w=I^o[3],i=4,a=1;a<n;a++)E=u[S>>>24]^d[L>>16&255]^h[_>>8&255]^c[255&w]^o[i],T=u[L>>>24]^d[_>>16&255]^h[w>>8&255]^c[255&S]^o[i+1],R=u[_>>>24]^d[w>>16&255]^h[S>>8&255]^c[255&L]^o[i+2],A=u[w>>>24]^d[S>>16&255]^h[L>>8&255]^c[255&_]^o[i+3],S=E,L=T,_=R,w=A,i+=4;E=s[S>>>24]<<24^s[L>>16&255]<<16^s[_>>8&255]<<8^s[255&w]^o[i],T=s[L>>>24]<<24^s[_>>16&255]<<16^s[w>>8&255]<<8^s[255&S]^o[i+1],R=s[_>>>24]<<24^s[w>>16&255]<<16^s[S>>8&255]<<8^s[255&L]^o[i+2],A=s[w>>>24]<<24^s[S>>16&255]<<16^s[L>>8&255]<<8^s[255&_]^o[i+3],i+=3,b[e]=C(E^p),b[e+1]=C(A^g),b[e+2]=C(R^v),b[e+3]=C(T^y),p=D,g=I,v=k,y=O,e+=4}return b.buffer},t.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},t}(),c=h,f=r(2),p=r(0),g=function(){function t(e,r){o(this,t),this.observer=e,this.config=r,this.logEnabled=!0;try{var i=crypto||self.crypto;this.subtle=i.subtle||i.webkitSubtle}catch(t){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,r,i){var a=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(p.b.log("JS AES decrypt"),this.logEnabled=!1);var n=this.decryptor;n||(this.decryptor=n=new c),n.expandKey(e),i(n.decrypt(t,0,r))}else{this.logEnabled&&(p.b.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new d(o,e)),this.fastAesKey.expandKey().then(function(n){new l(o,r).decrypt(t,n).catch(function(n){a.onWebCryptoError(n,t,e,r,i)}).then(function(t){i(t)})}).catch(function(n){a.onWebCryptoError(n,t,e,r,i)})}},t.prototype.onWebCryptoError=function(t,e,r,i,a){this.config.enableSoftwareAES?(p.b.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,r,i,a)):(p.b.error("decrypting error : "+t.message),this.observer.trigger(Event.ERROR,{type:f.b.MEDIA_ERROR,details:f.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}();e.a=g},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function n(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,a,s,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}if(r=this._events[t],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(n(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),a=u.length,l=0;l<a;l++)u[l].apply(this,s);return!0},r.prototype.addListener=function(t,e){var a;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,n(this._events[t])&&!this._events[t].warned&&(a=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),a||(a=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var a=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,a,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,a=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(n(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){a=s;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){!function(e){var r=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/;?#]*)(.*)$/,a=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,o={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var a=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");return a.path=o.normalizePath(a.path),o.buildURLFromParts(a)}var n=this.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");
vendor: 1,147 bytes, line 44067
44067if(n.scheme)return r.alwaysNormalize?(n.path=o.normalizePath(n.path),o.buildURLFromParts(n)):e;var s=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=i.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(u.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var d=s.path,h=d.substring(0,d.lastIndexOf("/")+1)+n.path;u.path=o.normalizePath(h)}else u.path=s.path,n.params||(u.params=s.params,n.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(n.path):n.path),o.buildURLFromParts(u)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(a,"");t.length!==(t=t.replace(n,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o}()},function(t,e,r){
vendor: 43,659 bytes, line 44067
44067;function i(t,e,r,i){var a,n,o,s,l,u=navigator.userAgent.toLowerCase(),d=i,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return a=1+((192&e[r+2])>>>6),(n=(60&e[r+2])>>>2)>h.length-1?void t.trigger(Event.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+n}):(s=(1&e[r+2])<<2,s|=(192&e[r+3])>>>6,w.b.log("manifest codec:"+i+",ADTS data:type:"+a+",sampleingIndex:"+n+"["+h[n]+"Hz],channelConfig:"+s),/firefox/i.test(u)?n>=6?(a=5,l=new Array(4),o=n-3):(a=2,l=new Array(2),o=n):-1!==u.indexOf("android")?(a=2,l=new Array(2),o=n):(a=5,l=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&n>=6?o=n-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(n>=6&&1===s||/vivaldi/i.test(u))||!i&&1===s)&&(a=2,l=new Array(2)),o=n)),l[0]=a<<3,l[0]|=(14&n)>>1,l[1]|=(1&n)<<7,l[1]|=s<<3,5===a&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:h[n],channelCount:s,codec:"mp4a.40."+a,manifestCodec:d})}function a(t,e){return 255===t[e]&&240==(246&t[e+1])}function n(t,e){return 1&t[e+1]?7:9}function o(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function s(t,e){return!!(e+1<t.length&&a(t,e))}function l(t,e){if(e+1<t.length&&a(t,e)){var r=n(t,e),i=r;e+5<t.length&&(i=o(t,e));var s=e+i;if(s===t.length||s+1<t.length&&a(t,s))return!0}return!1}function u(t,e,r,a,n){if(!t.samplerate){var o=i(e,r,a,n);t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,w.b.log("parsed codec:"+t.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}}function d(t){return 9216e4/t}function h(t,e,r,i,a){var s,l,u,d=t.length;if(s=n(t,e),l=o(t,e),(l-=s)>0&&e+s+l<=d)return u=r+i*a,{headerLength:s,frameLength:l,stamp:u}}function c(t,e,r,i,a){var n=d(t.samplerate),o=h(e,r,i,a,n);if(o){var s=o.stamp,l=o.headerLength,u=o.frameLength,c={unit:e.subarray(r+l,r+l+u),pts:s,dts:s};return t.samples.push(c),t.len+=u,{sample:c,length:u+l}}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var S=r(1),L=r(2),_=r(4),w=r(0),D=r(3),I=function(){function t(e,r,i){f(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){if(!t)return!1;for(var e=D.a.getID3Data(t,0)||[],r=e.length,i=t.length;r<i;r++)if(l(t,r))return w.b.log("ADTS sync word found !"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=this._audioTrack,n=D.a.getID3Data(t,0)||[],o=D.a.getTimeStamp(n),l=o?90*o:9e4*e,d=0,h=l,f=t.length,p=n.length,g=[{pts:h,dts:h,data:n}];p<f-1;)if(s(t,p)&&p+5<f){u(a,this.observer,t,p,a.manifestCodec);var v=c(a,t,p,l,d);if(!v){w.b.log("Unable to parse AAC frame");break}p+=v.length,h=v.sample.pts,d++}else D.a.isHeader(t,p)?(n=D.a.getID3Data(t,p),g.push({pts:h,dts:h,data:n}),p+=n.length):p++;this.remuxer.remux(a,{samples:[]},{samples:g,inputTimeScale:9e4},{samples:[]},e,r,i)},t.prototype.destroy=function(){},t}(),k=I,O=Math.pow(2,32)-1,C=function(){function t(e,r){p(this,t),this.observer=e,this.remuxer=r}return t.prototype.resetTimeStamp=function(t){this.initPTS=t},t.prototype.resetInitSegment=function(e,r,i,a){if(e&&e.byteLength){var n=this.initData=t.parseInitSegment(e);null==r&&(r="mp4a.40.5"),null==i&&(i="avc1.42e01e");var o={};n.audio&&n.video?o.audiovideo={container:"video/mp4",codec:r+","+i,initSegment:a?e:null}:(n.audio&&(o.audio={container:"audio/mp4",codec:r,initSegment:a?e:null}),n.video&&(o.video={container:"video/mp4",codec:i,initSegment:a?e:null})),this.observer.trigger(S.a.FRAG_PARSING_INIT_SEGMENT,{tracks:o})}else r&&(this.audioCodec=r),i&&(this.videoCodec=i)},t.probe=function(e){return t.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint32=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r},t.writeUint32=function(t,e,r){t.data&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r},t.findBox=function(e,r){var i,a,n,o,s,l,u,d=[];if(e.data?(l=e.start,o=e.end,e=e.data):(l=0,o=e.byteLength),!r.length)return null;for(i=l;i<o;)a=t.readUint32(e,i),n=t.bin2str(e.subarray(i+4,i+8)),u=a>1?i+a:o,n===r[0]&&(1===r.length?d.push({data:e,start:i+8,end:u}):(s=t.findBox({data:e,start:i+8,end:u},r.slice(1)),s.length&&(d=d.concat(s)))),i=u;return d},t.parseInitSegment=function(e){var r=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var i=t.findBox(e,["tkhd"])[0];if(i){var a=i.data[i.start],n=0===a?12:20,o=t.readUint32(i,n),s=t.findBox(e,["mdia","mdhd"])[0];if(s){a=s.data[s.start],n=0===a?12:20;var l=t.readUint32(s,n),u=t.findBox(e,["mdia","hdlr"])[0];if(u){var d=t.bin2str(u.data.subarray(u.start+8,u.start+12)),h={soun:"audio",vide:"video"}[d];if(h){var c=t.findBox(e,["mdia","minf","stbl","stsd"]);if(c.length){c=c[0];var f=t.bin2str(c.data.subarray(c.start+12,c.start+16));w.b.log("MP4Demuxer:"+h+":"+f+" found")}r[o]={timescale:l,type:h},r[h]={timescale:l,id:o}}}}}}),r},t.getStartDTS=function(e,r){var i,a,n;return i=t.findBox(r,["moof","traf"]),a=[].concat.apply([],i.map(function(r){return t.findBox(r,["tfhd"]).map(function(i){var a,n;return a=t.readUint32(i,4),n=e[a].timescale||9e4,t.findBox(r,["tfdt"]).map(function(e){var r,i;return r=e.data[e.start],i=t.readUint32(e,4),1===r&&(i*=Math.pow(2,32),i+=t.readUint32(e,8)),i})[0]/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0},t.offsetStartDTS=function(e,r,i){t.findBox(r,["moof","traf"]).map(function(r){return t.findBox(r,["tfhd"]).map(function(a){var n=t.readUint32(a,4),o=e[n].timescale||9e4;t.findBox(r,["tfdt"]).map(function(e){var r=e.data[e.start],a=t.readUint32(e,4);if(0===r)t.writeUint32(e,4,a-i*o);else{a*=Math.pow(2,32),a+=t.readUint32(e,8),a-=i*o,a=Math.max(a,0);var n=Math.floor(a/(O+1)),s=Math.floor(a%(O+1));t.writeUint32(e,4,n),t.writeUint32(e,8,s)}})})})},t.prototype.append=function(e,r,i,a){var n=this.initData;n||(this.resetInitSegment(e,this.audioCodec,this.videoCodec),n=this.initData);var o=void 0,s=this.initPTS;if(void 0===s){var l=t.getStartDTS(n,e);this.initPTS=s=l-r,this.observer.trigger(S.a.INIT_PTS_FOUND,{initPTS:s})}t.offsetStartDTS(n,e,s),o=t.getStartDTS(n,e),this.remuxer.remux(n.audio,n.video,null,null,o,i,a,e)},t.prototype.destroy=function(){},t}(),P=C,x={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(t,e,r,i,a){if(!(r+24>e.length)){var n=this.parseHeader(e,r);if(n&&r+n.frameLength<=e.length){var o=9e4*n.samplesPerFrame/n.sampleRate,s=i+a*o,l={unit:e.subarray(r,r+n.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=n.channelCount,t.samplerate=n.sampleRate,t.samples.push(l),t.len+=n.frameLength,{sample:l,length:n.frameLength}}}},parseHeader:function(t,e){var r=t[e+1]>>3&3,i=t[e+1]>>1&3,a=t[e+2]>>4&15,n=t[e+2]>>2&3,o=t[e+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==n){var s=3===r?3-i:3===i?3:4,l=1e3*x.BitratesMap[14*s+a-1],u=3===r?0:2===r?1:2,d=x.SamplingRateMap[3*u+n],h=t[e+3]>>6==3?1:2,c=x.SamplesCoefficients[r][i],f=x.BytesInSlot[i],p=8*c*f;return{sampleRate:d,channelCount:h,frameLength:parseInt(c*l/d+o,10)*f,samplesPerFrame:p}}},isHeaderPattern:function(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])},isHeader:function(t,e){return!!(e+1<t.length&&this.isHeaderPattern(t,e))},probe:function(t,e){if(e+1<t.length&&this.isHeaderPattern(t,e)){var r=this.parseHeader(t,e),i=4;r&&r.frameLength&&(i=r.frameLength);var a=e+i;if(a===t.length||a+1<t.length&&this.isHeaderPattern(t,a))return!0}return!1}},F=x,N=function(){function t(e){g(this,t),this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return t.prototype.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,i=new Uint8Array(4),a=Math.min(4,e);if(0===a)throw new Error("no bytes available");i.set(t.subarray(r,r+a)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a},t.prototype.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&w.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?r<<e|this.readBits(e):r},t.prototype.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e,r,i=8,a=8;for(e=0;e<t;e++)0!==a&&(r=this.readEG(),a=(i+r+256)%256),i=0===a?i:a},t.prototype.readSPS=function(){var t,e,r,i,a,n,o,s=0,l=0,u=0,d=0,h=this.readUByte.bind(this),c=this.readBits.bind(this),f=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),v=this.skipEG.bind(this),y=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(h(),t=h(),c(5),g(3),h(),y(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var b=f();if(3===b&&g(1),y(),y(),g(1),p())for(n=3!==b?8:12,o=0;o<n;o++)p()&&m(o<6?16:64)}y();var E=f();if(0===E)f();else if(1===E)for(g(1),v(),v(),e=f(),o=0;o<e;o++)v();y(),g(1),r=f(),i=f(),a=c(1),0===a&&g(1),g(1),p()&&(s=f(),l=f(),u=f(),d=f());var T=[1,1];if(p()&&p()){switch(h()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:T=[h()<<8|h(),h()<<8|h()]}}return{width:Math.ceil(16*(r+1)-2*s-2*l),height:(2-a)*(i+1)*16-(a?2:4)*(u+d),pixelRatio:T}},t.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}(),M=N,U=function(){function t(e,r,i,a){v(this,t),this.decryptdata=i,this.discardEPB=a,this.decrypter=new _.a(e,r)}return t.prototype.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,e)},t.prototype.decryptAacSample=function(t,e,r,i){var a=t[e].unit,n=a.subarray(16,a.length-a.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),s=this;this.decryptBuffer(o,function(n){n=new Uint8Array(n),a.set(n,16),i||s.decryptAacSamples(t,e+1,r)})},t.prototype.decryptAacSamples=function(t,e,r){for(;;e++){if(e>=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,a=32;a<=t.length-16;a+=160,i+=16)r.set(t.subarray(a,a+16),i);return r},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(e.subarray(r,r+16),i);return t},t.prototype.decryptAvcSample=function(t,e,r,i,a,n){var o=this.discardEPB(a.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){a.data=l.getAvcDecryptedUnit(o,s),n||l.decryptAvcSamples(t,e,r+1,i)})},t.prototype.decryptAvcSamples=function(t,e,r,i){for(;;e++,r=0){if(e>=t.length)return void i();for(var a=t[e].units;!(r>=a.length);r++){var n=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,n,o),!o)return}}}},t}(),B=U,G={video:0,audio:1,id3:2,text:3},j=function(){function t(e,r,i,a){y(this,t),this.observer=e,this.config=i,this.typeSupported=a,this.remuxer=r,this.sampleAes=null}return t.prototype.setDecryptData=function(t){null!=t&&null!=t.key&&"SAMPLE-AES"===t.method?this.sampleAes=new B(this.observer,this.config,t,this.discardEPB):this.sampleAes=null},t.probe=function(e){var r=t._syncOffset(e);return!(r<0)&&(r&&w.b.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},t._syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),r=0;r<e;){if(71===t[r]&&71===t[r+188]&&71===t[r+376])return r;r++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:G[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===t?0:void 0,isAAC:"audio"===t||void 0,duration:"audio"===t?e:void 0}},t.prototype.resetInitSegment=function(e,r,i,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",a),this._audioTrack=t.createTrack("audio",a),this._id3Track=t.createTrack("id3",a),this._txtTrack=t.createTrack("text",a),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=i,this._duration=a},t.prototype.resetTimeStamp=function(){},t.prototype.append=function(e,r,i,a){var n,o,s,l,u,d=e.length,h=!1;this.contiguous=i;var c=this.pmtParsed,f=this._avcTrack,p=this._audioTrack,g=this._id3Track,v=f.pid,y=p.pid,m=g.pid,b=this._pmtId,E=f.pesData,T=p.pesData,R=g.pesData,A=this._parsePAT,_=this._parsePMT,D=this._parsePES,I=this._parseAVCPES.bind(this),k=this._parseAACPES.bind(this),O=this._parseMPEGPES.bind(this),C=this._parseID3PES.bind(this),P=t._syncOffset(e);for(d-=(d+P)%188,n=P;n<d;n+=188)if(71===e[n]){if(o=!!(64&e[n+1]),s=((31&e[n+1])<<8)+e[n+2],(48&e[n+3])>>4>1){if((l=n+5+e[n+4])===n+188)continue}else l=n+4;switch(s){case v:o&&(E&&(u=D(E))&&I(u,!1),E={data:[],size:0}),E&&(E.data.push(e.subarray(l,n+188)),E.size+=n+188-l);break;case y:o&&(T&&(u=D(T))&&(p.isAAC?k(u):O(u)),T={data:[],size:0}),T&&(T.data.push(e.subarray(l,n+188)),T.size+=n+188-l);break;case m:o&&(R&&(u=D(R))&&C(u),R={data:[],size:0}),R&&(R.data.push(e.subarray(l,n+188)),R.size+=n+188-l);break;case 0:o&&(l+=e[l]+1),b=this._pmtId=A(e,l);break;case b:o&&(l+=e[l]+1);var x=_(e,l,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);v=x.avc,v>0&&(f.pid=v),y=x.audio,y>0&&(p.pid=y,p.isAAC=x.isAAC),m=x.id3,m>0&&(g.pid=m),h&&!c&&(w.b.log("reparse from beginning"),h=!1,n=P-188),c=this.pmtParsed=!0;break;case 17:case 8191:break;default:h=!0}}else this.observer.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E&&(u=D(E))?(I(u,!0),f.pesData=null):f.pesData=E,T&&(u=D(T))?(p.isAAC?k(u):O(u),p.pesData=null):(T&&T.size&&w.b.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=T),R&&(u=D(R))?(C(u),g.pesData=null):g.pesData=R,null==this.sampleAes?this.remuxer.remux(p,f,g,this._txtTrack,r,i,a):this.decryptAndRemux(p,f,g,this._txtTrack,r,i,a)},t.prototype.decryptAndRemux=function(t,e,r,i,a,n,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,i,a,n,o)})}else this.decryptAndRemuxAvc(t,e,r,i,a,n,o)},t.prototype.decryptAndRemuxAvc=function(t,e,r,i,a,n,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,i,a,n,o)})}else this.remuxer.remux(t,e,r,i,a,n,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,r,i){var a,n,o,s,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=(15&t[e+1])<<8|t[e+2],n=e+3+a-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<n;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!i){w.b.log("unkown stream type:"+t[e]);break}case 15:-1===l.audio&&(l.audio=s);break;case 21:-1===l.id3&&(l.id3=s);break;case 219:if(!i){w.b.log("unkown stream type:"+t[e]);break}case 27:-1===l.avc&&(l.avc=s);break;case 3:case 4:r?-1===l.audio&&(l.audio=s,l.isAAC=!1):w.b.log("MPEG audio found, not supported in this browser for now");break;case 36:w.b.warn("HEVC stream type found, not supported for now");break;default:w.b.log("unkown stream type:"+t[e])}e+=5+((15&t[e+3])<<8|t[e+4])}return l},t.prototype._parsePES=function(t){var e,r,i,a,n,o,s,l,u=0,d=t.data;if(!t||0===t.size)return null;for(;d[0].length<19&&d.length>1;){var h=new Uint8Array(d[0].length+d[1].length);h.set(d[0]),h.set(d[1],d[0].length),d[0]=h,d.splice(1,1)}if(e=d[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((i=(e[4]<<8)+e[5])&&i>t.size-6)return null;r=e[7],192&r&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&r?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(w.b.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),a=e[8],l=a+9,t.size-=l,n=new Uint8Array(t.size);for(var c=0,f=d.length;c<f;c++){e=d[c];var p=e.byteLength;if(l){if(l>p){l-=p;continue}e=e.subarray(l),p-=l,l=0}n.set(e,u),u+=p}return i&&(i-=a+3),{data:n,pts:o,dts:s,len:i}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var r=e.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(i||this.contiguous)?(t.id=i,r.push(t)):e.dropped++}t.debug.length&&w.b.log(t.pts+"/"+t.dts+":"+t.debug)},t.prototype._parseAVCPES=function(t,e){var r,i,a,n=this,o=this._avcTrack,s=this._parseAVCNALu(t.data),l=this.avcSample,u=!1,d=this.pushAccesUnit.bind(this),h=function(t,e,r,i){return{key:t,pts:e,dts:r,units:[],debug:i}};t.data=null,l&&s.length&&!o.audFound&&(d(l,o),l=this.avcSample=h(!1,t.pts,t.dts,"")),s.forEach(function(e){switch(e.type){case 1:i=!0,l||(l=n.avcSample=h(!0,t.pts,t.dts,"")),l.frame=!0;var s=e.data;if(u&&s.length>4){var c=new M(s).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=h(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new M(n.discardEPB(e.data)),r.readUByte();for(var f=0,p=0,g=!1,v=0;!g&&r.bytesAvailable>1;){f=0;do{v=r.readUByte(),f+=v}while(255===v);p=0;do{v=r.readUByte(),p+=v}while(255===v);if(4===f&&0!==r.bytesAvailable){g=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var y=r.readUByte(),m=r.readUByte(),b=31&y,E=[y,m];for(a=0;a<b;a++)E.push(r.readUByte()),E.push(r.readUByte()),E.push(r.readUByte());n._insertSampleInOrder(n._txtTrack.samples,{type:3,pts:t.pts,bytes:E})}}}}}else if(p<r.bytesAvailable)for(a=0;a<p;a++)r.readUByte()}break;case 7:if(i=!0,u=!0,!o.sps){r=new M(e.data);var T=r.readSPS();o.width=T.width,o.height=T.height,o.pixelRatio=T.pixelRatio,o.sps=[e.data],o.duration=n._duration;var R=e.data.subarray(1,4),A="avc1.";for(a=0;a<3;a++){var S=R[a].toString(16);S.length<2&&(S="0"+S),A+=S}o.codec=A}break;case 8:i=!0,o.pps||(o.pps=[e.data]);break;case 9:i=!1,o.audFound=!0,l&&d(l,o),l=n.avcSample=h(!1,t.pts,t.dts,"");break;case 12:i=!1;break;default:i=!1,l&&(l.debug+="unknown NAL "+e.type+" ")}if(l&&i){l.units.push(e)}}),e&&l&&(d(l,o),this.avcSample=null)},t.prototype._insertSampleInOrder=function(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)},t.prototype._getLastNalUnit=function(){var t=this.avcSample,e=void 0;if(!t||0===t.units.length){var r=this._avcTrack,i=r.samples;t=i[i.length-1]}if(t){var a=t.units;e=a[a.length-1]}return e},t.prototype._parseAVCNALu=function(t){var e,r,i,a,n,o=0,s=t.byteLength,l=this._avcTrack,u=l.naluState||0,d=u,h=[],c=-1;for(-1===u&&(c=0,n=31&t[0],u=0,o=1);o<s;)if(e=t[o++],u)if(1!==u)if(e)if(1===e){if(c>=0)i={data:t.subarray(c,o-u-1),type:n},h.push(i);else{var f=this._getLastNalUnit();if(f&&(d&&o<=4-d&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-d)),(r=o-u-1)>0)){var p=new Uint8Array(f.data.byteLength+r);p.set(f.data,0),p.set(t.subarray(0,r),f.data.byteLength),f.data=p}}o<s?(a=31&t[o],c=o,n=a,u=0):u=-1}else u=0;else u=3;else u=e?0:2;else u=e?0:1;if(c>=0&&u>=0&&(i={data:t.subarray(c,s),type:n,state:u},h.push(i)),0===h.length){var g=this._getLastNalUnit();if(g){var v=new Uint8Array(g.data.byteLength+t.byteLength);v.set(g.data,0),v.set(t,g.data.byteLength),g.data=v}}return l.naluState=u,h},t.prototype.discardEPB=function(t){for(var e,r,i=t.byteLength,a=[],n=1;n<i-2;)0===t[n]&&0===t[n+1]&&3===t[n+2]?(a.push(n+2),n+=2):n++;if(0===a.length)return t;e=i-a.length,r=new Uint8Array(e);var o=0;for(n=0;n<e;o++,n++)o===a[0]&&(o++,a.shift()),r[n]=t[o];return r},t.prototype._parseAACPES=function(t){var e,r,i,a,n,o=this._audioTrack,l=t.data,h=t.pts,f=this.aacOverFlow,p=this.aacLastPTS;if(f){var g=new Uint8Array(f.byteLength+l.byteLength);g.set(f,0),g.set(l,f.byteLength),l=g}for(i=0,n=l.length;i<n-1&&!s(l,i);i++);if(i){var v,y;if(i<n-1?(v="AAC PES did not start with ADTS header,offset:"+i,y=!1):(v="no ADTS header found in AAC PES",y=!0),w.b.warn("parsing error:"+v),this.observer.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:y,reason:v}),y)return}if(u(o,this.observer,l,i,this.audioCodec),r=0,e=d(o.samplerate),f&&p){var m=p+e;Math.abs(m-h)>1&&(w.b.log("AAC: align PTS for overlapping frames by "+Math.round((m-h)/90)),h=m)}for(;i<n;)if(s(l,i)&&i+5<n){var b=c(o,l,i,h,r);if(!b)break;i+=b.length,a=b.sample.pts,r++}else i++;f=i<n?l.subarray(i,n):null,this.aacOverFlow=f,this.aacLastPTS=a},t.prototype._parseMPEGPES=function(t){for(var e=t.data,r=e.length,i=0,a=0,n=t.pts;a<r;)if(F.isHeader(e,a)){var o=F.appendFrame(this._audioTrack,e,a,n,i);if(!o)break;a+=o.length,i++}else a++},t.prototype._parseID3PES=function(t){this._id3Track.samples.push(t)},t}(),H=j,K=function(){function t(e,r,i){m(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e,r,i=D.a.getID3Data(t,0);if(i&&void 0!==D.a.getTimeStamp(i))for(e=i.length,r=Math.min(t.length-1,e+100);e<r;e++)if(F.probe(t,e))return w.b.log("MPEG Audio sync word found !"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=D.a.getID3Data(t,0),n=D.a.getTimeStamp(a),o=n?90*n:9e4*e,s=a.length,l=t.length,u=0,d=0,h=this._audioTrack,c=[{pts:o,dts:o,data:a}];s<l;)if(F.isHeader(t,s)){var f=F.appendFrame(h,t,s,o,u);if(!f)break;s+=f.length,d=f.sample.pts,u++}else D.a.isHeader(t,s)?(a=D.a.getID3Data(t,s),c.push({pts:d,dts:d,data:a}),s+=a.length):s++;this.remuxer.remux(h,{samples:[]},{samples:c,inputTimeScale:9e4},{samples:[]},e,r,i)},t.prototype.destroy=function(){},t}(),W=K,V=function(){function t(){b(this,t)}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},t}(),Y=V,z=Math.pow(2,32)-1,X=function(){function t(){E(this,t)}return t.init=function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=n,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,a))},t.box=function(t){for(var e,r=Array.prototype.slice.call(arguments,1),i=8,a=r.length,n=a;a--;)i+=r[a].byteLength;for(e=new Uint8Array(i),e[0]=i>>24&255,e[1]=i>>16&255,e[2]=i>>8&255,e[3]=255&i,e.set(t,4),a=0,i=8;a<n;a++)e.set(r[a],i),i+=r[a].byteLength;return e},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,r){r*=e;var i=Math.floor(r/(z+1)),a=Math.floor(r%(z+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(z+1)),a=Math.floor(r%(z+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,n)},t.sdtp=function(e){var r,i,a=e.samples||[],n=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)r=a[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,n)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r,i,a,n=[],o=[];for(r=0;r<e.sps.length;r++)i=e.sps[r],a=i.byteLength,n.push(a>>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)i=e.pps[r],a=i.byteLength,o.push(a>>>8&255),o.push(255&a),o=o.concat(Array.prototype.slice.call(i));var s=t.box(t.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|e.sps.length].concat(n).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,a=e.width,n=e.height,o=Math.floor(i/(z+1)),s=Math.floor(i%(z+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),a=e.id,n=Math.floor(r/(z+1)),o=Math.floor(r%(z+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,a,n,o,s,l,u=e.samples||[],d=u.length,h=12+16*d,c=new Uint8Array(h);for(r+=8+h,c.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i<d;i++)a=u[i],n=a.duration,o=a.size,s=a.flags,l=a.cts,c.set([n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var r,i=t.moov(e);return r=new Uint8Array(t.FTYP.byteLength+i.byteLength),r.set(t.FTYP),r.set(i,t.FTYP.byteLength),r},t}(),q=X,Q=function(){function t(e,r,i,a){T(this,t),this.observer=e,this.config=r,this.typeSupported=i;var n=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&n&&!n.match("CriOS"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,r,i,a,n,o){if(this.ISGenerated||this.generateIS(t,e,a),this.ISGenerated){var s=t.samples.length,l=e.samples.length,u=a,d=a;if(s&&l){var h=(t.samples[0].dts-e.samples[0].dts)/e.inputTimeScale;u+=Math.max(0,h),d+=Math.max(0,-h)}if(s){t.timescale||(w.b.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,a));var c=this.remuxAudio(t,u,n,o);if(l){var f=void 0;c&&(f=c.endPTS-c.startPTS),e.timescale||(w.b.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,a)),this.remuxVideo(e,d,n,f,o)}}else{var p=void 0;l&&(p=this.remuxVideo(e,d,n,o)),p&&t.codec&&this.remuxEmptyAudio(t,u,n,p)}}r.samples.length&&this.remuxID3(r,a),i.samples.length&&this.remuxText(i,a),this.observer.trigger(S.a.FRAG_PARSED)},t.prototype.generateIS=function(t,e,r){var i,a,n=this.observer,o=t.samples,s=e.samples,l=this.typeSupported,u="audio/mp4",d={},h={tracks:d},c=void 0===this._initPTS;if(c&&(i=a=1/0),t.config&&o.length&&(t.timescale=t.samplerate,w.b.log("audio sampling rate : "+t.samplerate),t.isAAC||(l.mpeg?(u="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3")),d.audio={container:u,codec:t.codec,initSegment:!t.isAAC&&l.mpeg?new Uint8Array:q.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(i=a=o[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&s.length){var f=e.inputTimeScale;e.timescale=f,d.video={container:"video/mp4",codec:e.codec,initSegment:q.initSegment([e]),metadata:{width:e.width,height:e.height}},c&&(i=Math.min(i,s[0].pts-f*r),a=Math.min(a,s[0].dts-f*r),this.observer.trigger(S.a.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(d).length?(n.trigger(S.a.FRAG_PARSING_INIT_SEGMENT,h),this.ISGenerated=!0,c&&(this._initPTS=i,this._initDTS=a)):n.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},t.prototype.remuxVideo=function(t,e,r,i,a){var n,o,s,l,u,d,h,c=8,f=t.timescale,p=t.samples,g=[],v=p.length,y=this._PTSNormalize,m=this._initDTS,b=this.nextAvcDts,E=this.isSafari;E&&(r|=p.length&&b&&(a&&Math.abs(e-b/f)<.1||Math.abs(p[0].pts-b-m)<f/5)),r||(b=e*f),p.forEach(function(t){t.pts=y(t.pts-m,b),t.dts=y(t.dts-m,b)}),p.sort(function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||(i||t.id-e.id)});var T=p.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(T<0){w.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var R=0;R<p.length;R++)p[R].dts+=T}var A=p[0];u=Math.max(A.dts,0),l=Math.max(A.pts,0);var _=Math.round((u-b)/90);r&&_&&(_>1?w.b.log("AVC:"+_+" ms hole between fragments detected,filling it"):_<-1&&w.b.log("AVC:"+-_+" ms overlapping between fragments detected"),u=b,p[0].dts=u,l=Math.max(l-_,b),p[0].pts=l,w.b.log("Video/PTS/DTS adjusted: "+Math.round(l/90)+"/"+Math.round(u/90)+",delta:"+_+" ms")),A=p[p.length-1],h=Math.max(A.dts,0),d=Math.max(A.pts,0,h),E&&(n=Math.round((h-u)/(p.length-1)));for(var D=0,I=0,k=0;k<v;k++){for(var O=p[k],C=O.units,P=C.length,x=0,F=0;F<P;F++)x+=C[F].data.length;I+=x,D+=P,O.length=x,O.dts=E?u+k*n:Math.max(O.dts,u),O.pts=Math.max(O.pts,O.dts)}var N=I+4*D+8;try{o=new Uint8Array(N)}catch(t){return void this.observer.trigger(S.a.ERROR,{type:L.b.MUX_ERROR,details:L.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:"fail allocating video mdat "+N})}var M=new DataView(o.buffer);M.setUint32(0,N),o.set(q.types.mdat,4);for(var U=0;U<v;U++){for(var B=p[U],G=B.units,j=0,H=void 0,K=0,W=G.length;K<W;K++){var V=G[K],Y=V.data,z=V.data.byteLength;M.setUint32(c,z),c+=4,o.set(Y,c),c+=z,j+=4+z}if(E)H=Math.max(0,n*Math.round((B.pts-B.dts)/n));else{if(U<v-1)n=p[U+1].dts-B.dts;else{var X=this.config,Q=B.dts-p[U>0?U-1:U].dts;if(X.stretchShortVideoTrack){var J=X.maxBufferHole,$=X.maxSeekHole,Z=Math.floor(Math.min(J,$)*f),tt=(i?l+i*f:this.nextAudioPts)-B.pts;tt>Z?(n=tt-Q,n<0&&(n=Q),w.b.log("It is approximately "+tt/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=Q}else n=Q}H=Math.round(B.pts-B.dts)}g.push({size:j,duration:n,cts:H,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=h+n;var et=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,g.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var rt=g[0].flags;rt.dependsOn=2,rt.isNonSync=0}t.samples=g,s=q.moof(t.sequenceNumber++,u,t),t.samples=[];var it={data1:s,data2:o,startPTS:l/f,endPTS:(d+n)/f,startDTS:u/f,endDTS:this.nextAvcDts/f,type:"video",nb:g.length,dropped:et};return this.observer.trigger(S.a.FRAG_PARSING_DATA,it),it},t.prototype.remuxAudio=function(t,e,r,i){var a,n,o,s,l,u,d,h=t.inputTimeScale,c=t.timescale,f=h/c,p=t.isAAC?1024:1152,g=p*f,v=this._PTSNormalize,y=this._initDTS,m=!t.isAAC&&this.typeSupported.mpeg,b=t.samples,E=[],T=this.nextAudioPts;if(r|=b.length&&T&&(i&&Math.abs(e-T/h)<.1||Math.abs(b[0].pts-T-y)<20*g),b.forEach(function(t){t.pts=t.dts=v(t.pts-y,e*h)}),b=b.filter(function(t){return t.pts>=0}),0!==b.length){if(r||(T=i?e*h:b[0].pts),t.isAAC)for(var R=this.config.maxAudioFramesDrift,A=0,_=T;A<b.length;){var D,I=b[A],k=I.pts;D=k-_;var O=Math.abs(1e3*D/h);if(D<=-R*g)w.b.warn("Dropping 1 audio frame @ "+(_/h).toFixed(3)+"s due to "+Math.round(O)+" ms overlap."),b.splice(A,1),t.len-=I.unit.length;else if(D>=R*g&&O<1e4&&_){var C=Math.round(D/g);w.b.warn("Injecting "+C+" audio frame @ "+(_/h).toFixed(3)+"s due to "+Math.round(1e3*D/h)+" ms gap.");for(var P=0;P<C;P++){var x=Math.max(_,0);o=Y.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(w.b.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=I.unit.subarray()),b.splice(A,0,{unit:o,pts:x,dts:x}),t.len+=o.length,_+=g,A++}I.pts=I.dts=_,_+=g,A++}else Math.abs(D),I.pts=I.dts=_,_+=g,A++}for(var F=0,N=b.length;F<N;F++){var M=b[F],U=M.unit,B=M.pts;if(void 0!==d)n.duration=Math.round((B-d)/f);else{var G=Math.round(1e3*(B-T)/h),j=0;if(r&&t.isAAC&&G){if(G>0&&G<1e4)j=Math.round((B-T)/g),w.b.log(G+" ms hole between AAC samples detected,filling it"),j>0&&(o=Y.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(o=U.subarray()),t.len+=j*o.length);else if(G<-12){w.b.log("drop overlapping AAC sample, expected/parsed/delta:"+(T/h).toFixed(3)+"s/"+(B/h).toFixed(3)+"s/"+-G+"ms"),t.len-=U.byteLength;continue}B=T}if(u=B,!(t.len>0))return;var H=m?t.len:t.len+8;a=m?0:8;try{s=new Uint8Array(H)}catch(t){return void this.observer.trigger(S.a.ERROR,{type:L.b.MUX_ERROR,details:L.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}if(!m){new DataView(s.buffer).setUint32(0,H),s.set(q.types.mdat,4)}for(var K=0;K<j;K++)o=Y.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(w.b.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=U.subarray()),s.set(o,a),a+=o.byteLength,n={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},E.push(n)}s.set(U,a);var W=U.byteLength;a+=W,n={size:W,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},E.push(n),d=B}var V=0,z=E.length;if(z>=2&&(V=E[z-2].duration,n.duration=V),z){this.nextAudioPts=T=d+f*V,t.len=0,t.samples=E,l=m?new Uint8Array:q.moof(t.sequenceNumber++,u/f,t),t.samples=[];var X=u/h,Q=T/h,J={data1:l,data2:s,startPTS:X,endPTS:Q,startDTS:X,endDTS:Q,type:"audio",nb:z};return this.observer.trigger(S.a.FRAG_PARSING_DATA,J),J}return null}},t.prototype.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,n=t.samplerate?t.samplerate:a,o=a/n,s=this.nextAudioPts,l=(void 0!==s?s:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,d=1024*o,h=Math.ceil((u-l)/d),c=Y.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(w.b.warn("remux empty Audio"),!c)return void w.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var f=[],p=0;p<h;p++){var g=l+p*d;f.push({unit:c,pts:g,dts:g}),t.len+=c.length}t.samples=f,this.remuxAudio(t,e,r)},t.prototype.remuxID3=function(t,e){var r,i=t.samples.length,a=t.inputTimeScale,n=this._initPTS,o=this._initDTS;if(i){for(var s=0;s<i;s++)r=t.samples[s],r.pts=(r.pts-n)/a,r.dts=(r.dts-o)/a;this.observer.trigger(S.a.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[],e=e},t.prototype.remuxText=function(t,e){t.samples.sort(function(t,e){return t.pts-e.pts});var r,i=t.samples.length,a=t.inputTimeScale,n=this._initPTS;if(i){for(var o=0;o<i;o++)r=t.samples[o],r.pts=(r.pts-n)/a;this.observer.trigger(S.a.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[],e=e},t.prototype._PTSNormalize=function(t,e){var r;if(void 0===e)return t;for(r=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=r;return t},t}(),J=Q,$=function(){function t(e){R(this,t),this.observer=e}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,r,i,a,n,o,s){var l=this.observer,u="";t&&(u+="audio"),e&&(u+="video"),l.trigger(S.a.FRAG_PARSING_DATA,{data1:s,startPTS:a,startDTS:a,type:u,nb:1,dropped:0}),l.trigger(S.a.FRAG_PARSED)},t}(),Z=$,tt=function(){function t(e,r,i,a){A(this,t),this.observer=e,this.typeSupported=r,this.config=i,this.vendor=a}return t.prototype.destroy=function(){var t=this.demuxer;t&&t.destroy()},t.prototype.push=function(t,e,r,i,a,n,o,s,l,u,d,h){if(t.byteLength>0&&null!=e&&null!=e.key&&"AES-128"===e.method){var c=this.decrypter;null==c&&(c=this.decrypter=new _.a(this.observer,this.config));var f,p=this;try{f=performance.now()}catch(t){f=Date.now()}c.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var c;try{c=performance.now()}catch(t){c=Date.now()}p.observer.trigger(S.a.FRAG_DECRYPTED,{stats:{tstart:f,tdecrypt:c}}),p.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,u,d,h)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,u,d,h)},t.prototype.pushDecrypted=function(t,e,r,i,a,n,o,s,l,u,d,h){var c=this.demuxer;if(!c||o&&!this.probe(t)){for(var f=this.observer,p=this.typeSupported,g=this.config,v=[{demux:H,remux:J},{demux:P,remux:Z},{demux:k,remux:J},{demux:W,remux:J}],y=0,m=v.length;y<m;y++){var b=v[y],E=b.demux.probe;if(E(t)){var T=this.remuxer=new b.remux(f,g,p,this.vendor);c=new b.demux(f,T,g,p),this.probe=E;break}}if(!c)return void f.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=c}var R=this.remuxer;(o||s)&&(c.resetInitSegment(r,i,a,u),R.resetInitSegment()),o&&(c.resetTimeStamp(h),R.resetTimeStamp(h)),"function"==typeof c.setDecryptData&&c.setDecryptData(e),c.append(t,n,l,d)},t}();e.a=tt},function(t,e,r){
vendor: 125,459 bytes, line 44067
44067;function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){var r=jt[e];return!!r&&!0===r[t.slice(0,4)]}function o(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)return null;for(var r=null,i=0;i<t.length;i++){var a=t[i];a.id===e&&(r=a)}return r}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function y(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e,r){var i=t[e],a=t[r],n=a.startPTS;isNaN(n)?a.start=r>e?i.start+i.duration:Math.max(i.start-a.duration,0):r>e?(i.duration=n-i.start,i.duration<0&&Pt.b.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-n,a.duration<0&&Pt.b.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}function E(t,e,r,i,a,n){var o=r;if(!isNaN(e.startPTS)){var s=Math.abs(e.startPTS-r);isNaN(e.deltaPTS)?e.deltaPTS=s:e.deltaPTS=Math.max(s,e.deltaPTS),o=Math.max(r,e.startPTS),r=Math.min(r,e.startPTS),i=Math.max(i,e.endPTS),a=Math.min(a,e.startDTS),n=Math.max(n,e.endDTS)}var l=r-e.start;e.start=e.startPTS=r,e.maxStartPTS=o,e.endPTS=i,e.startDTS=a,e.endDTS=n,e.duration=i-r;var u=e.sn;if(!t||u<t.startSN||u>t.endSN)return 0;var d,h,c;for(d=u-t.startSN,h=t.fragments,h[d]=e,c=d;c>0;c--)b(h,c,c-1);for(c=d;c<h.length-1;c++)b(h,c,c+1);return t.PTSKnown=!0,l}function T(t,e){var r,i=Math.max(t.startSN,e.startSN)-e.startSN,a=Math.min(t.endSN,e.endSN)-e.startSN,n=e.startSN-t.startSN,o=t.fragments,s=e.fragments,l=0;if(a<i)return void(e.PTSKnown=!1);for(var u=i;u<=a;u++){var d=o[n+u],h=s[u];h&&d&&(l=d.cc-h.cc,isNaN(d.startPTS)||(h.start=h.startPTS=d.startPTS,h.endPTS=d.endPTS,h.duration=d.duration,h.backtracked=d.backtracked,h.dropped=d.dropped,r=h))}if(l)for(Pt.b.log("discontinuity sliding from playlist, take drift into account"),u=0;u<s.length;u++)s[u].cc+=l;if(r)E(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS);else if(n>=0&&n<o.length){var c=o[n].start;for(u=0;u<s.length;u++)s[u].start+=c}e.PTSKnown=t.PTSKnown}function R(t,e){for(var r=null,i=0;i<t.length;i+=1){var a=t[i];if(a&&a.cc===e){r=a;break}}return r}function A(t,e){return re.search(t,function(t){return t.cc<e?1:t.cc>e?-1:0})}function S(t,e,r){var i=!1;return e&&e.details&&r&&(r.endCC>r.startCC||t&&t.cc<r.startCC)&&(i=!0),i}function L(t,e){var r=t.fragments,i=e.fragments;if(!i.length||!r.length)return void Pt.b.log("No fragments to align");var a=R(r,i[0].cc);return!a||a&&!a.startPTS?void Pt.b.log("No frag in previous level to align on"):a}function _(t,e){e.fragments.forEach(function(e){if(e){var r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}),e.PTSKnown=!0}function w(t,e,r){if(S(t,e,r)){var i=L(e.details,r);i&&(Pt.b.log("Adjusting PTS using last level due to CC increase within current level"),_(i.start,r))}if(!1===r.PTSKnown&&e&&e.details){var a=e.details.programDateTime,n=r.programDateTime,o=(n-a)/1e3+e.details.fragments[0].start;isNaN(o)||(Pt.b.log("adjusting PTS using programDateTime delta, sliding:"+o.toFixed(3)),_(o,r))}}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function P(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function M(){var t=y(),e=window.SourceBuffer||window.WebKitSourceBuffer,r=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!r&&!!i}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function H(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function V(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function Y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function X(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function J(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function et(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function at(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function nt(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new Qe,this.regionList=[]}function ot(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+(0|i)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function st(){this.values=Object.create(null)}function lt(t,e,r,i){var a=i?t.split(i):[t];for(var n in a)if("string"==typeof a[n]){var o=a[n].split(r);if(2===o.length){var s=o[0],l=o[1];e(s,l)}}}function ut(t,e,r){function i(){var e=ot(t);if(null===e)throw new Error("Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}var n=t;if(a(),e.startTime=i(),a(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);t=t.substr(3),a(),e.endTime=i(),a(),function(t,e){var i=new st;lt(t,function(t,e){switch(t){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===e){i.set(t,r[a].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var n=e.split(","),o=n[0];i.integer(t,o),i.percent(t,o)&&i.set("snapToLines",!1),i.alt(t,o,["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",$e,"end"]);break;case"position":n=e.split(","),i.percent(t,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",$e,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",$e,"end","left","right"])}},/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var a=i.get("line","auto");"auto"===a&&-1===Je.line&&(a=-1),e.line=a,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",$e);var n=i.get("position","auto");"auto"===n&&50===Je.position&&(n="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=n}(t,e)}function dt(t){return t.replace(/<br(?: \/)?>/gi,"\n")}function ht(t,e,r,i){for(var a,n,o,s,l,u=window.VTTCue||window.TextTrackCue,d=0;d<i.rows.length;d++)if(a=i.rows[d],o=!0,s=0,l="",!a.isEmpty()){for(var h=0;h<a.chars.length;h++)a.chars[h].uchar.match(/\s/)&&o?s++:(l+=a.chars[h].uchar,o=!1);a.cueStartTime=e,e===r&&(r+=1e-4),n=new u(e,r,dt(l.trim())),s>=16?s--:s++,navigator.userAgent.match(/Firefox\//)?n.line=d+1:n.line=d>7?d-2:d+1,n.align="left",n.position=Math.max(0,Math.min(100,s/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(n)}}function ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function vt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function yt(t){if(t&&t.cues)for(;t.cues.length>0;)t.removeCue(t.cues[0])}function mt(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function bt(t,e,r,i){return Math.min(e,i)-Math.max(t,r)}function Et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function At(t){for(var e=[],r=0;r<t.length;r++)"subtitles"===t[r].kind&&e.push(t[r]);return e}function St(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function wt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var Dt={};r.d(Dt,"newCue",function(){return ht});var It=r(6),kt=r.n(It),Ot=r(1),Ct=r(2),Pt=r(0),xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft=function(){function t(e){i(this,t),this.hls=e,this.onEvent=this.onEvent.bind(this);for(var r=arguments.length,a=Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];this.handledEvents=a,this.useGenericHandler=!0,this.registerListeners()}return t.prototype.destroy=function(){this.unregisterListeners()},t.prototype.isEventHandler=function(){return"object"===xt(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent},t.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){if("hlsEventGeneric"===t)throw new Error("Forbidden event name: "+t);this.hls.on(t,this.onEvent)},this)},t.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){this.hls.off(t,this.onEvent)},this)},t.prototype.onEvent=function(t,e){this.onEventGeneric(t,e)},t.prototype.onEventGeneric=function(t,e){var r=function(t,e){var r="on"+t.replace("hls","");if("function"!=typeof this[r])throw new Error("Event "+t+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,e)};try{r.call(this,t,e).call()}catch(e){Pt.b.error("internal error happened while processing "+t+":"+e.message),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.OTHER_ERROR,details:Ct.a.INTERNAL_EXCEPTION,fatal:!1,event:t,err:e})}},t}(),Nt=Ft,Mt=/^(\d+)x(\d+)$/,Ut=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,Bt=function(){function t(e){a(this,t),"string"==typeof e&&(e=t.parseAttrList(e));for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r])}return t.prototype.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;i<e.length/2;i++)r[i]=parseInt(e.slice(2*i,2*i+2),16);return r}return null},t.prototype.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.decimalFloatingPoint=function(t){return parseFloat(this[t])},t.prototype.enumeratedString=function(t){return this[t]},t.prototype.decimalResolution=function(t){var e=Mt.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(Ut.lastIndex=0;null!==(e=Ut.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}(),Gt=Bt,jt={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}},Ht=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Kt=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Wt=/#EXT-X-MEDIA:(.*)/g,Vt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Yt=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,zt=function(){function t(){u(this,t),this.method=null,this.key=null,this.iv=null,this._uri=null}return Ht(t,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=kt.a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),t}(),Xt=function(){function t(){u(this,t),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return t.prototype.createInitializationVector=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e},t.prototype.fragmentDecryptdataFromLevelkey=function(t,e){var r=t;return t&&t.method&&t.uri&&!t.iv&&(r=new zt,r.method=t.method,r.baseuri=t.baseuri,r.reluri=t.reluri,r.iv=this.createInitializationVector(e)),r},t.prototype.cloneObj=function(t){return JSON.parse(JSON.stringify(t))},Ht(t,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=kt.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var t=this._byteRange=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var r=this.lastByteRangeEndOffset;t[0]=r||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),t}(),qt=function(t){function e(r){u(this,e);var i=s(this,t.call(this,r,Ot.a.MANIFEST_LOADING,Ot.a.LEVEL_LOADING,Ot.a.AUDIO_TRACK_LOADING,Ot.a.SUBTITLE_TRACK_LOADING));return i.loaders={},i}return l(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},Nt.prototype.destroy.call(this)},e.prototype.onManifestLoading=function(t){this.load(t.url,{type:"manifest"})},e.prototype.onLevelLoading=function(t){this.load(t.url,{type:"level",level:t.level,id:t.id})},e.prototype.onAudioTrackLoading=function(t){this.load(t.url,{type:"audioTrack",id:t.id})},e.prototype.onSubtitleTrackLoading=function(t){this.load(t.url,{type:"subtitleTrack",id:t.id})},e.prototype.load=function(t,e){var r=this.loaders[e.type];if(void 0!==r){var i=r.context;if(i&&i.url===t)return void Pt.b.trace("playlist request ongoing");Pt.b.warn("abort previous loader for type:"+e.type),r.abort()}var a=this.hls.config,n=void 0,o=void 0,s=void 0,l=void 0;"manifest"===e.type?(n=a.manifestLoadingMaxRetry,o=a.manifestLoadingTimeOut,s=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):"level"===e.type?(n=0,o=a.levelLoadingTimeOut):(n=a.levelLoadingMaxRetry,o=a.levelLoadingTimeOut,s=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,Pt.b.log("loading playlist for "+e.type+" "+(e.level||e.id))),r=this.loaders[e.type]=e.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),e.url=t,e.responseType="";var u=void 0,d=void 0;u={timeout:o,maxRetry:n,retryDelay:s,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(e,u,d)},e.prototype.resolve=function(t,e){return kt.a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},e.prototype.parseMasterPlaylist=function(t,e){var r=[],i=void 0;for(Kt.lastIndex=0;null!=(i=Kt.exec(t));){var a={},o=a.attrs=new Gt(i[1]);a.url=this.resolve(i[2],e);var s=o.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),a.name=o.NAME,function(t,e){["video","audio"].forEach(function(r){var i=t.filter(function(t){return n(t,r)});if(i.length){var a=i.filter(function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)});e[r+"Codec"]=a.length>0?a[0]:i[0],t=t.filter(function(t){return-1===i.indexOf(t)})}}),e.unknownCodecs=t}([].concat((o.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=this.avc1toavcoti(a.videoCodec)),r.push(a)}return r},e.prototype.parseMasterPlaylistMedia=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=void 0,n=[],o=0;for(Wt.lastIndex=0;null!==(a=Wt.exec(t));){var s={},l=new Gt(a[1]);if(l.TYPE===r){if(s.groupId=l["GROUP-ID"],s.name=l.NAME,s.type=r,s.default="YES"===l.DEFAULT,s.autoselect="YES"===l.AUTOSELECT,s.forced="YES"===l.FORCED,l.URI&&(s.url=this.resolve(l.URI,e)),s.lang=l.LANGUAGE,s.name||(s.name=s.lang),i.length){var u=d(i,s.groupId);s.audioCodec=u?u.codec:i[0].codec}s.id=o++,n.push(s)}}return n},e.prototype.avc1toavcoti=function(t){var e,r=t.split(".");return r.length>2?(e=r.shift()+".",e+=parseInt(r.shift()).toString(16),e+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):e=t,e},e.prototype.parseLevelPlaylist=function(t,e,r,i){var a,n,o=0,s=0,l={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},u=new zt,d=0,h=null,c=new Xt;for(Vt.lastIndex=0;null!==(a=Vt.exec(t));){var f=a[1];if(f){c.duration=parseFloat(f);var p=(" "+a[2]).slice(1);c.title=p||null,c.tagList.push(p?["INF",f,p]:["INF",f])}else if(a[3]){if(!isNaN(c.duration)){var g=o++;c.type=i,c.start=s,c.levelkey=u,c.sn=g,c.level=r,c.cc=d,c.baseurl=e,c.relurl=(" "+a[3]).slice(1),l.fragments.push(c),h=c,s+=c.duration,c=new Xt}}else if(a[4]){if(c.rawByteRange=(" "+a[4]).slice(1),h){var v=h.byteRangeEndOffset;v&&(c.lastByteRangeEndOffset=v)}}else if(a[5])c.rawProgramDateTime=(" "+a[5]).slice(1),c.tagList.push(["PROGRAM-DATE-TIME",c.rawProgramDateTime]),void 0===l.programDateTime&&(l.programDateTime=new Date(new Date(Date.parse(a[5]))-1e3*s));else{for(a=a[0].match(Yt),n=1;n<a.length&&void 0===a[n];n++);var y=(" "+a[n+1]).slice(1),m=(" "+a[n+2]).slice(1);switch(a[n]){case"#":c.tagList.push(m?[y,m]:[y]);break;case"PLAYLIST-TYPE":l.type=y.toUpperCase();break;case"MEDIA-SEQUENCE":o=l.startSN=parseInt(y);break;case"TARGETDURATION":l.targetduration=parseFloat(y);break;case"VERSION":l.version=parseInt(y);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"DIS":d++,c.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":d=parseInt(y);break;case"KEY":var b=y,E=new Gt(b),T=E.enumeratedString("METHOD"),R=E.URI,A=E.hexadecimalInteger("IV");T&&(u=new zt,R&&["AES-128","SAMPLE-AES"].indexOf(T)>=0&&(u.method=T,u.baseuri=e,u.reluri=R,u.key=null,u.iv=A));break;case"START":var S=y,L=new Gt(S),_=L.decimalFloatingPoint("TIME-OFFSET");isNaN(_)||(l.startTimeOffset=_);break;case"MAP":var w=new Gt(y);c.relurl=w.URI,c.rawByteRange=w.BYTERANGE,c.baseurl=e,c.level=r,c.type=i,c.sn="initSegment",l.initSegment=c,c=new Xt;break;default:Pt.b.warn("line parsed but not handled: "+a)}}}return c=h,c&&!c.relurl&&(l.fragments.pop(),s-=c.duration),l.totalduration=s,l.averagetargetduration=s/l.fragments.length,l.endSN=o-1,l.startCC=l.fragments[0]?l.fragments[0].cc:0,l.endCC=d,l},e.prototype.loadsuccess=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.data,n=t.url,o=r.type,s=r.id,l=r.level,u=this.hls;if(this.loaders[o]=void 0,void 0!==n&&0!==n.indexOf("data:")||(n=r.url),e.tload=performance.now(),0===a.indexOf("#EXTM3U"))if(a.indexOf("#EXTINF:")>0){var d="audioTrack"!==o&&"subtitleTrack"!==o,h=isNaN(l)?isNaN(s)?0:s:l,c=this.parseLevelPlaylist(a,n,h,"audioTrack"===o?"audio":"subtitleTrack"===o?"subtitle":"main");c.tload=e.tload,"manifest"===o&&u.trigger(Ot.a.MANIFEST_LOADED,{levels:[{url:n,details:c}],audioTracks:[],url:n,stats:e,networkDetails:i}),e.tparsed=performance.now(),c.targetduration?d?u.trigger(Ot.a.LEVEL_LOADED,{details:c,level:l||0,id:s||0,stats:e,networkDetails:i}):"audioTrack"===o?u.trigger(Ot.a.AUDIO_TRACK_LOADED,{details:c,id:s,stats:e,networkDetails:i}):"subtitleTrack"===o&&u.trigger(Ot.a.SUBTITLE_TRACK_LOADED,{details:c,id:s,stats:e,networkDetails:i}):u.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"invalid targetduration",networkDetails:i})}else{var f=this.parseMasterPlaylist(a,n);if(f.length){var p=f.map(function(t){return{id:t.attrs.AUDIO,codec:t.audioCodec}}),g=this.parseMasterPlaylistMedia(a,n,"AUDIO",p),v=this.parseMasterPlaylistMedia(a,n,"SUBTITLES");if(g.length){var y=!1;g.forEach(function(t){t.url||(y=!0)}),!1===y&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(Pt.b.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main"}))}u.trigger(Ot.a.MANIFEST_LOADED,{levels:f,audioTracks:g,subtitles:v,url:n,stats:e,networkDetails:i})}else u.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"no level found in manifest",networkDetails:i})}else u.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"no EXTM3U delimiter",networkDetails:i})},e.prototype.loaderror=function(t,e){var r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e.loader;switch(e.type){case"manifest":r=Ct.a.MANIFEST_LOAD_ERROR,i=!0;break;case"level":r=Ct.a.LEVEL_LOAD_ERROR,i=!1;break;case"audioTrack":r=Ct.a.AUDIO_TRACK_LOAD_ERROR,i=!1}n&&(n.abort(),this.loaders[e.type]=void 0),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:r,fatal:i,url:n.url,loader:n,response:t,context:e,networkDetails:a})},e.prototype.loadtimeout=function(t,e){var r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e.loader;switch(e.type){case"manifest":r=Ct.a.MANIFEST_LOAD_TIMEOUT,i=!0;break;case"level":r=Ct.a.LEVEL_LOAD_TIMEOUT,i=!1;break;case"audioTrack":r=Ct.a.AUDIO_TRACK_LOAD_TIMEOUT,i=!1}n&&(n.abort(),this.loaders[e.type]=void 0),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:r,fatal:i,url:n.url,loader:n,context:e,networkDetails:a})},e}(Nt),Qt=qt,Jt=function(t){function e(r){h(this,e);var i=c(this,t.call(this,r,Ot.a.FRAG_LOADING));return i.loaders={},i}return f(e,t),e.prototype.destroy=function(){var t=this.loaders;for(var e in t){var r=t[e];r&&r.destroy()}this.loaders={},Nt.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag,r=e.type,i=this.loaders[r],a=this.hls.config;e.loaded=0,i&&(Pt.b.warn("abort previous fragment loader for type:"+r),i.abort()),i=this.loaders[r]=e.loader=void 0!==a.fLoader?new a.fLoader(a):new a.loader(a);var n=void 0,o=void 0,s=void 0;n={url:e.url,frag:e,responseType:"arraybuffer",progressData:!1};var l=e.byteRangeStartOffset,u=e.byteRangeEndOffset;isNaN(l)||isNaN(u)||(n.rangeStart=l,n.rangeEnd=u),o={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout},s={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},i.load(n,o,s)},e.prototype.loadsuccess=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.data,n=r.frag;n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(Ot.a.FRAG_LOADED,{payload:a,frag:n,stats:e,networkDetails:i})},e.prototype.loaderror=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.FRAG_LOAD_ERROR,fatal:!1,frag:e.frag,response:t,networkDetails:r})},e.prototype.loadtimeout=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e.frag,networkDetails:r})},e.prototype.loadprogress=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.frag;a.loaded=t.loaded,this.hls.trigger(Ot.a.FRAG_LOAD_PROGRESS,{frag:a,stats:t,networkDetails:i})},e}(Nt),$t=Jt,Zt=function(t){function e(r){p(this,e);var i=g(this,t.call(this,r,Ot.a.KEY_LOADING));return i.loaders={},i.decryptkey=null,i.decrypturl=null,i}return v(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},Nt.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(t){var e=t.frag,r=e.type,i=this.loaders[r],a=e.decryptdata,n=a.uri;if(n!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;i&&(Pt.b.warn("abort previous key loader for type:"+r),i.abort()),e.loader=this.loaders[r]=new o.loader(o),this.decrypturl=n,this.decryptkey=null;var s=void 0,l=void 0,u=void 0;s={url:n,frag:e,responseType:"arraybuffer"},l={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(s,l,u)}else this.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(Ot.a.KEY_LOADED,{frag:e}))},e.prototype.loadsuccess=function(t,e,r){var i=r.frag;this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(Ot.a.KEY_LOADED,{frag:i})},e.prototype.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.prototype.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Ot.a.ERROR,{type:Ct.b.NETWORK_ERROR,details:Ct.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}(Nt),te=Zt,ee={search:function(t,e){for(var r=0,i=t.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=t[a];var o=e(n);if(o>0)r=a+1;else{if(!(o<0))return n;i=a-1}}return null}},re=ee,ie={isBuffered:function(t,e){try{if(t)for(var r=t.buffered,i=0;i<r.length;i++)if(e>=r.start(i)&&e<=r.end(i))return!0}catch(t){}return!1},bufferInfo:function(t,e,r){try{if(t){var i,a=t.buffered,n=[];for(i=0;i<a.length;i++)n.push({start:a.start(i),end:a.end(i)});return this.bufferedInfo(n,e,r)}}catch(t){}return{len:0,start:e,end:e,nextStart:void 0}},bufferedInfo:function(t,e,r){var i,a,n,o,s,l=[];for(t.sort(function(t,e){var r=t.start-e.start;return r||e.end-t.end}),s=0;s<t.length;s++){var u=l.length;if(u){var d=l[u-1].end;t[s].start-d<r?t[s].end>d&&(l[u-1].end=t[s].end):l.push(t[s])}else l.push(t[s])}for(s=0,i=0,a=n=e;s<l.length;s++){var h=l[s].start,c=l[s].end;if(e+r>=h&&e<c)a=h,n=c,i=n-e;else if(e+r<h){o=h;break}}return{len:i,start:a,end:n,nextStart:o}}},ae=ie,ne=r(7),oe=r(5),se=r.n(oe),le=r(9),ue=r.n(le),de=y(),he=function(){function t(e,r){m(this,t),this.hls=e,this.id=r;var i=this.observer=new se.a,a=e.config;i.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];i.emit.apply(i,[t,t].concat(r))},i.off=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];i.removeListener.apply(i,[t].concat(r))};var n=function(t,r){r=r||{},r.frag=this.frag,r.id=this.id,e.trigger(t,r)}.bind(this);i.on(Ot.a.FRAG_DECRYPTED,n),i.on(Ot.a.FRAG_PARSING_INIT_SEGMENT,n),i.on(Ot.a.FRAG_PARSING_DATA,n),i.on(Ot.a.FRAG_PARSED,n),i.on(Ot.a.ERROR,n),i.on(Ot.a.FRAG_PARSING_METADATA,n),i.on(Ot.a.FRAG_PARSING_USERDATA,n),i.on(Ot.a.INIT_PTS_FOUND,n);var o={mp4:de.isTypeSupported("video/mp4"),mpeg:de.isTypeSupported("audio/mpeg"),mp3:de.isTypeSupported('audio/mp4; codecs="mp3"')},s=navigator.vendor;if(a.enableWorker&&"undefined"!=typeof Worker){Pt.b.log("demuxing in webworker");var l=void 0;try{l=this.w=ue()(10),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(t){e.trigger(Ot.a.ERROR,{type:Ct.b.OTHER_ERROR,details:Ct.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:t.message+" ("+t.filename+":"+t.lineno+")"}})},l.postMessage({cmd:"init",typeSupported:o,vendor:s,id:r,config:JSON.stringify(a)})}catch(t){Pt.b.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),l&&URL.revokeObjectURL(l.objectURL),this.demuxer=new ne.a(i,o,a,s),this.w=void 0}}else this.demuxer=new ne.a(i,o,a,s)}return t.prototype.destroy=function(){var t=this.w;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.w=null;else{var e=this.demuxer;e&&(e.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},t.prototype.push=function(t,e,r,i,a,n,o,s){var l=this.w,u=isNaN(a.startDTS)?a.start:a.startDTS,d=a.decryptdata,h=this.frag,c=!(h&&a.cc===h.cc),f=!(h&&a.level===h.level),p=h&&a.sn===h.sn+1,g=!f&&p;if(c&&Pt.b.log(this.id+":discontinuity detected"),f&&Pt.b.log(this.id+":switch detected"),this.frag=a,l)l.postMessage({cmd:"demux",data:t,decryptdata:d,initSegment:e,audioCodec:r,videoCodec:i,timeOffset:u,discontinuity:c,trackSwitch:f,contiguous:g,duration:n,accurateTimeOffset:o,defaultInitPTS:s},t instanceof ArrayBuffer?[t]:[]);else{var v=this.demuxer;v&&v.push(t,d,e,r,i,u,c,f,g,n,o,s)}},t.prototype.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case Ot.a.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data2&&(e.data.data2=new Uint8Array(e.data2));default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},t}(),ce=he,fe={toString:function(t){for(var e="",r=t.length,i=0;i<r;i++)e+="["+t.start(i).toFixed(3)+","+t.end(i).toFixed(3)+"]";return e}},pe=fe,ge=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),ve={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_LEVEL:"WAITING_LEVEL",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR"},ye=function(t){function e(r){D(this,e);var i=I(this,t.call(this,r,Ot.a.MEDIA_ATTACHED,Ot.a.MEDIA_DETACHING,Ot.a.MANIFEST_LOADING,Ot.a.MANIFEST_PARSED,Ot.a.LEVEL_LOADED,Ot.a.KEY_LOADED,Ot.a.FRAG_LOADED,Ot.a.FRAG_LOAD_EMERGENCY_ABORTED,Ot.a.FRAG_PARSING_INIT_SEGMENT,Ot.a.FRAG_PARSING_DATA,Ot.a.FRAG_PARSED,Ot.a.ERROR,Ot.a.AUDIO_TRACK_SWITCHING,Ot.a.AUDIO_TRACK_SWITCHED,Ot.a.BUFFER_CREATED,Ot.a.BUFFER_APPENDED,Ot.a.BUFFER_FLUSHED));return i.config=r.config,i.audioCodecSwap=!1,i.ticks=0,i._state=ve.STOPPED,i.ontick=i.tick.bind(i),i}return k(e,t),e.prototype.destroy=function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),Nt.prototype.destroy.call(this),this.state=ve.STOPPED},e.prototype.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;-1===i&&(i=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&-1===t&&(Pt.b.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=ve.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=ve.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=ve.STOPPED,this.forceStartLoad=!1},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){switch(this.state){case ve.ERROR:break;case ve.BUFFER_FLUSHING:this.fragLoadError=0;break;case ve.IDLE:this._doTickIdle();break;case ve.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=ve.IDLE);break;case ve.FRAG_LOADING_WAITING_RETRY:var e=performance.now(),r=this.retryDate;(!r||e>=r||this.media&&this.media.seeking)&&(Pt.b.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=ve.IDLE);break;case ve.ERROR:case ve.STOPPED:case ve.FRAG_LOADING:case ve.PARSING:case ve.PARSED:case ve.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},e.prototype._doTickIdle=function(){var t=this.hls,e=t.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&e.startFragPrefetch)){var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=t.nextLoadLevel,n=this.levels[a];if(n){var o=n.bitrate,s=void 0;s=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,s=Math.min(s,e.maxMaxBufferLength);var l=ae.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,e.maxBufferHole),u=l.len;if(!(u>=s)){Pt.b.trace("buffer length of "+u.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=a;var d=n.details;if(void 0===d||!0===d.live&&this.levelLastLoaded!==a)return void(this.state=ve.WAITING_LEVEL);var h=this.fragPrevious;if(!d.live&&h&&!h.backtracked&&h.sn===d.endSN&&!l.nextStart){if(Math.min(r.duration,h.start+h.duration)-Math.max(l.end,h.start)<=Math.max(.2,h.duration)){var c={};return this.altAudio&&(c.type="video"),this.hls.trigger(Ot.a.BUFFER_EOS,c),void(this.state=ve.ENDED)}}this._fetchPayloadOrEos(i,l,d)}}}},e.prototype._fetchPayloadOrEos=function(t,e,r){var i=this.fragPrevious,a=this.level,n=r.fragments,o=n.length;if(0!==o){var s=n[0].start,l=n[o-1].start+n[o-1].duration,u=e.end,d=void 0;if(r.initSegment&&!r.initSegment.data)d=r.initSegment;else if(r.live){var h=this.config.initialLiveManifestSize;if(o<h)return void Pt.b.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+h);if(null===(d=this._ensureFragmentAtLivePoint(r,u,s,l,i,n,o)))return}else u<s&&(d=n[0]);d||(d=this._findFragment(s,i,o,n,u,l,r)),d&&this._loadFragmentOrKey(d,a,r,t,u)}},e.prototype._ensureFragmentAtLivePoint=function(t,e,r,i,a,n,o){var s=this.hls.config,l=this.media,u=void 0,d=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*t.targetduration;if(e<Math.max(r-s.maxFragLookUpTolerance,i-d)){var h=this.liveSyncPosition=this.computeLivePosition(r,t);Pt.b.log("buffer end: "+e.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+h.toFixed(3)),e=h,l&&l.readyState&&l.duration>h&&(l.currentTime=h),this.nextLoadPosition=h}if(t.PTSKnown&&e>i&&l&&l.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(a){var c=a.sn+1;if(c>=t.startSN&&c<=t.endSN){var f=n[c-t.startSN];a.cc===f.cc&&(u=f,Pt.b.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=re.search(n,function(t){return a.cc-t.cc}))&&Pt.b.log("live playlist, switching playlist, load frag with same CC: "+u.sn)}u||(u=n[Math.min(o-1,Math.round(o/2))],Pt.b.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u},e.prototype._findFragment=function(t,e,r,i,a,n,o){var s=this.hls.config,l=void 0,u=void 0,d=s.maxFragLookUpTolerance,h=e?i[e.sn-i[0].sn+1]:void 0,c=function(t){var e=Math.min(d,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-e<=a?1:t.start-e>a&&t.start?-1:0};if(a<n?(a>n-d&&(d=0),u=h&&!c(h)?h:re.search(i,c)):u=i[r-1],u){l=u;var f=l.sn-o.startSN,p=e&&l.level===e.level,g=i[f-1],v=i[f+1];if(e&&l.sn===e.sn)if(p&&!l.backtracked)if(l.sn<o.endSN){var y=e.deltaPTS;y&&y>s.maxBufferHole&&e.dropped&&f?(l=g,Pt.b.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),e.loadCounter--):(l=v,Pt.b.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.backtracked&&(v&&v.backtracked?(Pt.b.warn("Already backtracked from fragment "+v.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+v.sn),l=v):(Pt.b.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,g?(g.loadCounter&&g.loadCounter--,l=g,l.backtracked=!0):f&&(l=null)))}return l},e.prototype._loadFragmentOrKey=function(t,e,r,i,a){var n=this.hls,o=n.config;if(!t.decryptdata||null==t.decryptdata.uri||null!=t.decryptdata.key){if(Pt.b.log("Loading "+t.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+e+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,t.loadCounter){t.loadCounter++;var s=o.fragLoadingLoopThreshold;if(t.loadCounter>s&&Math.abs(this.fragLoadIdx-t.loadIdx)<s)return void n.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:t})}else t.loadCounter=1;return t.loadIdx=this.fragLoadIdx,t.autoLevel=n.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.fragCurrent=t,this.startFragRequested=!0,isNaN(t.sn)||t.bitrateTest||(this.nextLoadPosition=t.start+t.duration),n.trigger(Ot.a.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new ce(n,"main")),void(this.state=ve.FRAG_LOADING)}Pt.b.log("Loading key for "+t.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+e),this.state=ve.KEY_LOADING,n.trigger(Ot.a.KEY_LOADING,{frag:t})},e.prototype.getBufferedFrag=function(t){return re.search(this._bufferedFrags,function(e){return t<e.startPTS?-1:t>e.endPTS?1:0})},e.prototype.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},e.prototype._checkFragmentChanged=function(){var t,e,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(e=r.currentTime,e>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),ae.isBuffered(r,e)?t=this.getBufferedFrag(e):ae.isBuffered(r,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var i=t;if(i!==this.fragPlaying){this.hls.trigger(Ot.a.FRAG_CHANGED,{frag:i});var a=i.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(Ot.a.LEVEL_SWITCHED,{level:a}),this.fragPlaying=i}}},e.prototype.immediateLevelSwitch=function(){if(Pt.b.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,ae.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},e.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var e=void 0,r=void 0,i=void 0;if(void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),r=this.getBufferedFrag(t.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)e=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*o)+1:0}if((i=this.getBufferedFrag(t.currentTime+e))&&(i=this.followingBufferedFrag(i))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.maxStartPTS,Number.POSITIVE_INFINITY)}}},e.prototype.flushMainBuffer=function(t,e){this.state=ve.BUFFER_FLUSHING;var r={startOffset:t,endOffset:e};this.altAudio&&(r.type="video"),this.hls.trigger(Ot.a.BUFFER_FLUSHING,r)},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(Pt.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0,t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){var t=this.media,e=t?t.currentTime:void 0,r=this.config;isNaN(e)||Pt.b.log("media seeking to "+e.toFixed(3));var i=this.mediaBuffer?this.mediaBuffer:t,a=ae.bufferInfo(i,e,this.config.maxBufferHole);if(this.state===ve.FRAG_LOADING){var n=this.fragCurrent;if(0===a.len&&n){var o=r.maxFragLookUpTolerance,s=n.start-o,l=n.start+n.duration+o;e<s||e>l?(n.loader&&(Pt.b.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=ve.IDLE):Pt.b.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===ve.ENDED&&(0===a.len&&(this.fragPrevious=0),this.state=ve.IDLE);t&&(this.lastCurrentTime=e),this.state!==ve.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()},e.prototype.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:void 0;isNaN(e)||Pt.b.log("media seeked to "+e.toFixed(3)),this.tick()},e.prototype.onMediaEnded=function(){Pt.b.log("media ended"),this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestLoading=function(){Pt.b.log("trigger BUFFER_RESET"),this.hls.trigger(Ot.a.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestParsed=function(t){var e,r=!1,i=!1;t.levels.forEach(function(t){(e=t.audioCodec)&&(-1!==e.indexOf("mp4a.40.2")&&(r=!0),-1!==e.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&Pt.b.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)},e.prototype.onLevelLoaded=function(t){var e=t.details,r=t.level,i=this.levels[this.levelLastLoaded],a=this.levels[r],n=e.totalduration,o=0;if(Pt.b.log("level "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+n),e.live){var s=a.details;s&&e.fragments.length>0?(T(s,e),o=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),e.PTSKnown&&!isNaN(o)?Pt.b.log("live playlist sliding:"+o.toFixed(3)):(Pt.b.log("live playlist - outdated PTS, unknown sliding"),w(this.fragPrevious,i,e))):(Pt.b.log("live playlist - first load, unknown sliding"),e.PTSKnown=!1,w(this.fragPrevious,i,e))}else e.PTSKnown=!1;if(a.details=e,this.levelLastLoaded=r,this.hls.trigger(Ot.a.LEVEL_UPDATED,{details:e,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var l=e.startTimeOffset;isNaN(l)?e.live?(this.startPosition=this.computeLivePosition(o,e),Pt.b.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(l<0&&(Pt.b.log("negative start time offset "+l+", count from end of last fragment"),l=o+n+l),Pt.b.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===ve.WAITING_LEVEL&&(this.state=ve.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===ve.KEY_LOADING&&(this.state=ve.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===ve.FRAG_LOADING&&e&&"main"===r.type&&r.level===e.level&&r.sn===e.sn){var i=t.stats,a=this.levels[e.level],n=a.details;if(Pt.b.log("Loaded "+e.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+e.level),this.bitrateTest=!1,this.stats=i,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=ve.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(Ot.a.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=ve.IDLE,i.tparsed=i.tbuffered=performance.now(),n.initSegment.data=t.payload,this.hls.trigger(Ot.a.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.tick();else{this.state=ve.PARSING;var o=n.totalduration,s=e.level,l=e.sn,u=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(Pt.b.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,Pt.b.log("Parsing "+l+" of ["+n.startSN+" ,"+n.endSN+"],level "+s+", cc "+e.cc);var d=this.demuxer;d||(d=this.demuxer=new ce(this.hls,"main"));var h=this.media,c=h&&h.seeking,f=!c&&(n.PTSKnown||!n.live),p=n.initSegment?n.initSegment.data:[];d.push(t.payload,p,u,a.videoCodec,e,o,f,void 0)}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===ve.PARSING){var i,a,n=t.tracks;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(Pt.b.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",Pt.b.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=t.id}a=n.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=t.id),this.hls.trigger(Ot.a.BUFFER_CODECS,n);for(i in n){a=n[i],Pt.b.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(Ot.a.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}},e.prototype.onFragParsingData=function(t){var e=this,r=this.fragCurrent,i=t.frag;if(r&&"main"===t.id&&i.sn===r.sn&&i.level===r.level&&("audio"!==t.type||!this.altAudio)&&this.state===ve.PARSING){var a=this.levels[this.level],n=r;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),Pt.b.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(n.dropped=t.dropped,n.dropped)if(n.backtracked)Pt.b.warn("Already backtracked on this fragment, appending with the gap");else{var o=a.details;if(!o||n.sn!==o.startSN)return Pt.b.warn("missing video frame(s), backtracking fragment"),n.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=ve.IDLE,this.fragPrevious=n,void this.tick();Pt.b.warn("missing video frame(s) on first frag, appending with gap")}else n.backtracked=!1;var s=E(a.details,n,t.startPTS,t.endPTS,t.startDTS,t.endDTS),l=this.hls;l.trigger(Ot.a.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:s,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(r){r&&r.length&&e.state===ve.PARSING&&(e.appended=!0,e.pendingBuffering=!0,l.trigger(Ot.a.BUFFER_APPENDING,{type:t.type,data:r,parent:"main",content:"data"}))}),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===ve.PARSING&&(this.stats.tparsed=performance.now(),this.state=ve.PARSED,this._checkAppendedParsed())},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url,r=t.id;if(!e){if(this.mediaBuffer!==this.media){Pt.b.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(Pt.b.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=ve.IDLE}var a=this.hls;a.trigger(Ot.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(Ot.a.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}},e.prototype.onAudioTrackSwitched=function(t){var e=t.id,r=!!this.hls.audioTracks[e].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(Pt.b.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},e.prototype.onBufferCreated=function(t){var e=t.tracks,r=void 0,i=void 0,a=!1;for(var n in e){var o=e[n];"main"===o.id?(i=n,r=o,"video"===n&&(this.videoBuffer=e[n].buffer)):a=!0}a&&r?(Pt.b.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},e.prototype.onBufferAppended=function(t){if("main"===t.parent){var e=this.state;e!==ve.PARSING&&e!==ve.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==ve.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;Pt.b.log("main buffered : "+pe.toString(e.buffered));var r=this._bufferedFrags.filter(function(t){return ae.isBuffered(e,(t.startPTS+t.endPTS)/2)});r.push(t),this._bufferedFrags=r.sort(function(t,e){return t.startPTS-e.startPTS}),this.fragPrevious=t;var i=this.stats;i.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*i.total/(i.tbuffered-i.tfirst)),this.hls.trigger(Ot.a.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.state=ve.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag||this.fragCurrent;if(!e||"main"===e.type){var r=!!this.media&&ae.isBuffered(this.media,this.media.currentTime)&&ae.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case Ct.a.FRAG_LOAD_ERROR:case Ct.a.FRAG_LOAD_TIMEOUT:case Ct.a.KEY_LOAD_ERROR:case Ct.a.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var i=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);e.loadCounter=0,Pt.b.warn("mediaController: frag loading failed, retry in "+i+" ms"),this.retryDate=performance.now()+i,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=ve.FRAG_LOADING_WAITING_RETRY}else Pt.b.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=ve.ERROR;break;case Ct.a.FRAG_LOOP_LOADING_ERROR:t.fatal||(r?(this._reduceMaxBufferLength(e.duration),this.state=ve.IDLE):e.autoLevel&&0!==e.level||(t.fatal=!0,this.state=ve.ERROR));break;case Ct.a.LEVEL_LOAD_ERROR:case Ct.a.LEVEL_LOAD_TIMEOUT:this.state!==ve.ERROR&&(t.fatal?(this.state=ve.ERROR,Pt.b.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==ve.WAITING_LEVEL||(this.state=ve.IDLE));break;case Ct.a.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==ve.PARSING&&this.state!==ve.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=ve.IDLE):(Pt.b.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},e.prototype._reduceMaxBufferLength=function(t){var e=this.config;e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,Pt.b.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*e.fragLoadingLoopThreshold))},e.prototype._checkBuffer=function(){var t=this.media,e=this.config;if(t&&t.readyState){var r=t.currentTime,i=this.mediaBuffer?this.mediaBuffer:t,a=i.buffered;if(!this.loadedmetadata&&a.length){this.loadedmetadata=!0;var n=t.seeking?r:this.startPosition,o=ae.isBuffered(i,n),s=a.start(0),l=!o&&Math.abs(n-s)<e.maxSeekHole;(r!==n||l)&&(Pt.b.log("target start position:"+n),l&&(n=s,Pt.b.log("target start position not buffered, seek to buffered.start(0) "+n)),Pt.b.log("adjust currentTime from "+r+" to "+n),t.currentTime=n)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var u=ae.bufferInfo(t,r,0),d=!(t.paused||t.ended||0===t.buffered.length),h=r!==this.lastCurrentTime;if(h)this.stallReported&&(Pt.b.warn("playback not stuck anymore @"+r+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(d){var c=performance.now(),f=this.hls;if(this.stalled){var p=c-this.stalled,g=u.len,v=this.nudgeRetry||0;if(g<=.5&&p>1e3*e.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,Pt.b.warn("playback stalling in low buffer @"+r),f.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}));var y=u.nextStart,m=y-r;if(y&&m<e.maxSeekHole&&m>0){this.nudgeRetry=++v;var b=v*e.nudgeOffset;Pt.b.log("adjust currentTime from "+t.currentTime+" to next buffered @ "+y+" + nudge "+b),t.currentTime=y+b,this.stalled=void 0,f.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:y+b-r})}}else if(g>.5&&p>1e3*e.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,Pt.b.warn("playback stalling in high buffer @"+r),f.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:g})),this.stalled=void 0,this.nudgeRetry=++v,v<e.nudgeMaxRetry){var E=t.currentTime,T=E+v*e.nudgeOffset;Pt.b.log("adjust currentTime from "+E+" to "+T),t.currentTime=T,f.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else Pt.b.error("still stuck in high buffer @"+r+" after "+e.nudgeMaxRetry+", raise fatal error"),f.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_STALLED_ERROR,fatal:!0})}else this.stalled=c,this.stallReported=!1}}}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=ve.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter(function(e){return ae.isBuffered(t,(e.startPTS+e.endPTS)/2)}),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.state=ve.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(t,e){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-r)},ge(e,[{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,Pt.b.log("main stream:"+e+"->"+t),this.hls.trigger(Ot.a.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(Nt),me=ye,be=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ee=function(t){function e(r){O(this,e);var i=C(this,t.call(this,r,Ot.a.MANIFEST_LOADED,Ot.a.LEVEL_LOADED,Ot.a.FRAG_LOADED,Ot.a.ERROR));return i.canload=!1,i.currentLevelIndex=null,i.manualLevelIndex=-1,i.timer=null,i}return P(e,t),e.prototype.destroy=function(){this.cleanTimer(),this.manualLevelIndex=-1},e.prototype.cleanTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.startLoad=function(){var t=this._levels;this.canload=!0,this.levelRetryCount=0,t&&t.forEach(function(t){t.loadError=0;var e=t.details;e&&e.live&&(t.details=void 0)}),null!==this.timer&&this.loadLevel()},e.prototype.stopLoad=function(){this.canload=!1},e.prototype.onManifestLoaded=function(t){var e=[],r=void 0,i={},a=null,n=!1,s=!1,l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=[];if(t.levels.forEach(function(t){t.loadError=0,t.fragmentError=!1,n=n||!!t.videoCodec,s=s||!!t.audioCodec||!(!t.attrs||!t.attrs.AUDIO),!0===l&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0),a=i[t.bitrate],void 0===a?(t.url=[t.url],t.urlId=0,i[t.bitrate]=t,e.push(t)):a.url.push(t.url)}),!0===n&&!0===s&&(e=e.filter(function(t){return!!t.videoCodec})),e=e.filter(function(t){var e=t.audioCodec,r=t.videoCodec;return(!e||o(e))&&(!r||o(r))}),t.audioTracks&&(u=t.audioTracks.filter(function(t){return!t.audioCodec||o(t.audioCodec,"audio")})),e.length>0){r=e[0].bitrate,e.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=e;for(var d=0;d<e.length;d++)if(e[d].bitrate===r){this._firstLevel=d,Pt.b.log("manifest loaded,"+e.length+" level(s) found, first bitrate:"+r);break}this.hls.trigger(Ot.a.MANIFEST_PARSED,{levels:e,audioTracks:u,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:n,altAudio:u.length>0})}else this.hls.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},e.prototype.setLevelInternal=function(t){var e=this._levels,r=this.hls;if(t>=0&&t<e.length){if(this.cleanTimer(),this.currentLevelIndex!==t){Pt.b.log("switching to level "+t),this.currentLevelIndex=t;var i=e[t];i.level=t,r.trigger(Ot.a.LEVEL_SWITCH,i),r.trigger(Ot.a.LEVEL_SWITCHING,i)}var a=e[t],n=a.details;if(!n||!0===n.live){var o=a.urlId;r.trigger(Ot.a.LEVEL_LOADING,{url:a.url[o],level:t,id:o})}}else r.trigger(Ot.a.ERROR,{type:Ct.b.OTHER_ERROR,details:Ct.a.LEVEL_SWITCH_ERROR,level:t,fatal:!1,reason:"invalid level idx"})},e.prototype.onError=function(t){if(!0===t.fatal)return void(t.type===Ct.b.NETWORK_ERROR&&this.cleanTimer());var e=!1,r=!1,i=void 0;switch(t.details){case Ct.a.FRAG_LOAD_ERROR:case Ct.a.FRAG_LOAD_TIMEOUT:case Ct.a.FRAG_LOOP_LOADING_ERROR:case Ct.a.KEY_LOAD_ERROR:case Ct.a.KEY_LOAD_TIMEOUT:i=t.frag.level,r=!0;break;case Ct.a.LEVEL_LOAD_ERROR:case Ct.a.LEVEL_LOAD_TIMEOUT:i=t.context.level,e=!0;break;case Ct.a.REMUX_ALLOC_ERROR:i=t.level,e=!0}void 0!==i&&this.recoverLevel(t,i,e,r)},e.prototype.recoverLevel=function(t,e,r,i){var a=this,n=this.hls.config,o=t.details,s=this._levels[e],l=void 0,u=void 0,d=void 0;if(s.loadError++,s.fragmentError=i,!0===r){if(!(this.levelRetryCount+1<=n.levelLoadingMaxRetry))return Pt.b.error("level controller, cannot recover from "+o+" error"),this.currentLevelIndex=null,this.cleanTimer(),void(t.fatal=!0);u=Math.min(Math.pow(2,this.levelRetryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return a.loadLevel()},u),t.levelRetry=!0,this.levelRetryCount++,Pt.b.warn("level controller, "+o+", retry in "+u+" ms, current retry count is "+this.levelRetryCount)}!0!==r&&!0!==i||(l=s.url.length,l>1&&s.loadError<l?(Pt.b.warn("level controller, "+o+" for level "+e+": switching to redundant stream id "+s.urlId),s.urlId=(s.urlId+1)%l,s.details=void 0):-1===this.manualLevelIndex?(d=0===e?this._levels.length-1:e-1,Pt.b.warn("level controller, "+o+": switch to "+d),this.hls.nextAutoLevel=this.currentLevelIndex=d):!0===i&&(Pt.b.warn("level controller, "+o+": reload a fragment"),this.currentLevelIndex=null))},e.prototype.onFragLoaded=function(t){var e=t.frag;if(void 0!==e&&"main"===e.type){var r=this._levels[e.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},e.prototype.onLevelLoaded=function(t){var e=this,r=t.level;if(r===this.currentLevelIndex){var i=this._levels[r];!1===i.fragmentError&&(i.loadError=0,this.levelRetryCount=0);var a=t.details;if(a.live){var n=1e3*(a.averagetargetduration?a.averagetargetduration:a.targetduration),o=i.details;o&&a.endSN===o.endSN&&(n/=2,Pt.b.log("same live playlist, reload twice faster")),n-=performance.now()-t.stats.trequest,n=Math.max(1e3,Math.round(n)),Pt.b.log("live playlist, reload in "+n+" ms"),this.timer=setTimeout(function(){return e.loadLevel()},n)}else this.cleanTimer()}},e.prototype.loadLevel=function(){var t=void 0,e=void 0;null!==this.currentLevelIndex&&!0===this.canload&&void 0!==(t=this._levels[this.currentLevelIndex])&&t.url.length>0&&(e=t.urlId,this.hls.trigger(Ot.a.LEVEL_LOADING,{url:t.url[e],level:this.currentLevelIndex,id:e}))},be(e,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e=this._levels;e&&(t=Math.min(t,e.length-1),this.currentLevelIndex===t&&void 0!==e[t].details||this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}]),e}(Nt),Te=Ee,Re=r(3),Ae=function(t){function e(r){x(this,e);var i=F(this,t.call(this,r,Ot.a.MEDIA_ATTACHED,Ot.a.MEDIA_DETACHING,Ot.a.FRAG_PARSING_METADATA));return i.id3Track=void 0,i.media=void 0,i}return N(e,t),e.prototype.destroy=function(){Nt.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){this.media=t.media,this.media},e.prototype.onMediaDetaching=function(){this.media=void 0},e.prototype.onFragParsingMetadata=function(t){var e=t.frag,r=t.samples;this.id3Track||(this.id3Track=this.media.addTextTrack("metadata","id3"),this.id3Track.mode="hidden");for(var i=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,a=0;a<r.length;a++){var n=Re.a.getID3Frames(r[a].data);if(n){var o=r[a].pts,s=a<r.length-1?r[a+1].pts:e.endPTS;o===s&&(s+=1e-4);for(var l=0;l<n.length;l++){var u=n[l];if(!Re.a.isTimeStampFrame(u)){var d=new i(o,s,"");d.value=u,this.id3Track.addCue(d)}}}}},e}(Nt),Se=Ae,Le=function(){function t(e){U(this,t),this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return t.prototype.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},t.prototype.getTotalWeight=function(){return this.totalWeight_},t.prototype.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_},t}(),_e=Le,we=function(){function t(e,r,i,a){B(this,t),this.hls=e,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new _e(r),this.fast_=new _e(i)}return t.prototype.sample=function(t,e){t=Math.max(t,this.minDelayMs_);var r=8e3*e/t,i=t/1e3;this.fast_.sample(i,r),this.slow_.sample(i,r)},t.prototype.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},t.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.prototype.destroy=function(){},t}(),De=we,Ie=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),ke=function(t){function e(r){G(this,e);var i=j(this,t.call(this,r,Ot.a.FRAG_LOADING,Ot.a.FRAG_LOADED,Ot.a.FRAG_BUFFERED,Ot.a.ERROR));return i.lastLoadedFragLevel=0,i._nextAutoLevel=-1,i.hls=r,i.timer=null,i._bwEstimator=null,i.onCheck=i._abandonRulesCheck.bind(i),i}return H(e,t),e.prototype.destroy=function(){this.clearTimer(),Nt.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag;if("main"===e.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var r=this.hls,i=t.frag.level,a=r.levels[i].details.live,n=r.config,o=void 0,s=void 0;a?(o=n.abrEwmaFastLive,s=n.abrEwmaSlowLive):(o=n.abrEwmaFastVoD,s=n.abrEwmaSlowVoD),this._bwEstimator=new De(r,s,o,n.abrEwmaDefaultEstimate)}this.fragCurrent=e}},e.prototype._abandonRulesCheck=function(){var t=this.hls,e=t.media,r=this.fragCurrent,i=r.loader,a=t.minAutoLevel;if(!i||i.stats&&i.stats.aborted)return Pt.b.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var n=i.stats;if(e&&n&&(!e.paused&&0!==e.playbackRate||!e.readyState)&&r.autoLevel&&r.level){var o=performance.now()-n.trequest,s=Math.abs(e.playbackRate);if(o>500*r.duration/s){var l=t.levels,u=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/o),d=l[r.level],h=d.realBitrate?Math.max(d.realBitrate,d.bitrate):d.bitrate,c=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*h/8)),f=e.currentTime,p=(c-n.loaded)/u,g=(ae.bufferInfo(e,f,t.config.maxBufferHole).end-f)/s;if(g<2*r.duration/s&&p>g){var v=void 0,y=void 0;for(y=r.level-1;y>a;y--){var m=l[y].realBitrate?Math.max(l[y].realBitrate,l[y].bitrate):l[y].bitrate;if((v=r.duration*m/(6.4*u))<g)break}v<p&&(Pt.b.warn("loading too slow, abort fragment loading and switch to level "+y+":fragLoadedDelay["+y+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+v.toFixed(1)+"<"+p.toFixed(1)+":"+g.toFixed(1)),t.nextLoadLevel=y,this._bwEstimator.sample(o,n.loaded),i.abort(),this.clearTimer(),t.trigger(Ot.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:n}))}}}},e.prototype.onFragLoaded=function(t){var e=t.frag;if("main"===e.type&&!isNaN(e.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=this.hls.levels[e.level],i=(r.loaded?r.loaded.bytes:0)+t.stats.loaded,a=(r.loaded?r.loaded.duration:0)+t.frag.duration;r.loaded={bytes:i,duration:a},r.realBitrate=Math.round(8*i/a)}if(t.frag.bitrateTest){var n=t.stats;n.tparsed=n.tbuffered=n.tload,this.onFragBuffered(t)}}},e.prototype.onFragBuffered=function(t){var e=t.stats,r=t.frag;if(!(!0===e.aborted||1!==r.loadCounter||"main"!==r.type||isNaN(r.sn)||r.bitrateTest&&e.tload!==e.tbuffered)){var i=e.tparsed-e.trequest;Pt.b.log("latency/loading/parsing/append/kbps:"+Math.round(e.tfirst-e.trequest)+"/"+Math.round(e.tload-e.tfirst)+"/"+Math.round(e.tparsed-e.tload)+"/"+Math.round(e.tbuffered-e.tparsed)+"/"+Math.round(8*e.loaded/(e.tbuffered-e.trequest))),this._bwEstimator.sample(i,e.loaded),e.bwEstimate=this._bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}},e.prototype.onError=function(t){switch(t.details){case Ct.a.FRAG_LOAD_ERROR:case Ct.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},e.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},e.prototype._findBestLevel=function(t,e,r,i,a,n,o,s,l){for(var u=a;u>=i;u--){var d=l[u],h=d.details,c=h?h.totalduration/h.fragments.length:e,f=!!h&&h.live,p=void 0;p=u<=t?o*r:s*r;var g=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,v=g*c/p;if(Pt.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(p)+"/"+g+"/"+c+"/"+n+"/"+v),p>g&&(!v||f&&!this.bitrateTestDelay||v<n))return u}return-1},Ie(e,[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var r=this._nextABRAutoLevel;return-1!==t&&(r=Math.min(t,r)),r},set:function(t){this._nextAutoLevel=t}},{key:"_nextABRAutoLevel",get:function(){var t=this.hls,e=t.maxAutoLevel,r=t.levels,i=t.config,a=t.minAutoLevel,n=t.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,l=n?n.currentTime:0,u=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,d=this._bwEstimator?this._bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,h=(ae.bufferInfo(n,l,i.maxBufferHole).end-l)/u,c=this._findBestLevel(o,s,d,a,e,h,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(c>=0)return c;Pt.b.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var f=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,g=i.abrBandWidthUpFactor;if(0===h){var v=this.bitrateTestDelay;if(v){f=(s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay)-v,Pt.b.trace("bitrate test took "+Math.round(1e3*v)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*f)+" ms"),p=g=1}}return c=this._findBestLevel(o,s,d,a,e,h+f,p,g,r),Math.max(c,0)}}]),e}(Nt),Oe=ke,Ce=y(),Pe=function(t){function e(r){K(this,e);var i=W(this,t.call(this,r,Ot.a.MEDIA_ATTACHING,Ot.a.MEDIA_DETACHING,Ot.a.MANIFEST_PARSED,Ot.a.BUFFER_RESET,Ot.a.BUFFER_APPENDING,Ot.a.BUFFER_CODECS,Ot.a.BUFFER_EOS,Ot.a.BUFFER_FLUSHING,Ot.a.LEVEL_PTS_UPDATED,Ot.a.LEVEL_UPDATED));return i._msDuration=null,i._levelDuration=null,i._live=null,i._objectUrl=null,i.onsbue=i.onSBUpdateEnd.bind(i),i.onsbe=i.onSBUpdateError.bind(i),i.pendingTracks={},i.tracks={},i}return V(e,t),e.prototype.destroy=function(){Nt.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(t){var e=t.type,r=this.tracks.audio;if("audio"===e&&r&&"audio/mpeg"===r.container){var i=this.sourceBuffer.audio;if(Math.abs(i.timestampOffset-t.start)>.1){var a=i.updating;try{i.abort()}catch(t){a=!0,Pt.b.warn("can not abort audio buffer: "+t)}a?this.audioTimestampOffset=t.start:(Pt.b.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+t.start),i.timestampOffset=t.start)}}},e.prototype.onManifestParsed=function(t){var e=t.audio,r=t.video||t.levels.length&&t.audio,i=0;t.altAudio&&(e||r)&&(i=(e?1:0)+(r?1:0),Pt.b.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i},e.prototype.onMediaAttaching=function(t){var e=this.media=t.media;if(e){var r=this.mediaSource=new Ce;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),e.src=URL.createObjectURL(r),this._objectUrl=e.src}},e.prototype.onMediaDetaching=function(){Pt.b.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){Pt.b.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):Pt.b.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(Ot.a.MEDIA_DETACHED)},e.prototype.onMediaSourceOpen=function(){Pt.b.log("media source opened"),this.hls.trigger(Ot.a.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},e.prototype.checkPendingTracks=function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},e.prototype.onMediaSourceClose=function(){Pt.b.log("media source closed")},e.prototype.onMediaSourceEnded=function(){Pt.b.log("media source ended")},e.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;Pt.b.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,r=this.segments.reduce(function(t,r){return r.parent===e?t+1:t},0);this.hls.trigger(Ot.a.BUFFER_APPENDED,{parent:e,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},e.prototype.onSBUpdateError=function(t){Pt.b.error("sourceBuffer error:",t),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferReset=function(){var t=this.sourceBuffer;for(var e in t){var r=t[e];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},e.prototype.onBufferCodecs=function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}},e.prototype.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;for(var i in t)if(!e[i]){var a=t[i],n=a.levelCodec||a.codec,o=a.container+";codecs="+n;Pt.b.log("creating sourceBuffer("+o+")");try{var s=e[i]=r.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=s}catch(t){Pt.b.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:o})}}this.hls.trigger(Ot.a.BUFFER_CREATED,{tracks:t})},e.prototype.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},e.prototype.onBufferAppendFail=function(t){Pt.b.error("sourceBuffer error:",t.event),this.hls.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferEos=function(t){var e=this.sourceBuffer,r=t.type;for(var i in e)r&&i!==r||e[i].ended||(e[i].ended=!0,Pt.b.log(i+" sourceBuffer now EOS"));this.checkEos()},e.prototype.checkEos=function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var r in t){var i=t[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}Pt.b.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){Pt.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},e.prototype.onBufferFlushing=function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()},e.prototype.onLevelUpdated=function(t){var e=t.details;e.fragments.length>0&&(this._levelDuration=e.totalduration+e.fragments[0].start,this._live=e.live,this.updateMediaElementDuration())},e.prototype.updateMediaElementDuration=function(){var t=this.hls.config,e=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(!0===this.sourceBuffer[r].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===t.liveDurationInfinity?(Pt.b.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||e===1/0||isNaN(e))&&(Pt.b.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,r=this.sourceBuffer;try{for(var i in r)e+=r[i].buffered.length}catch(t){Pt.b.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(Ot.a.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var t=this.hls,e=this.sourceBuffer,r=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void Pt.b.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=e[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(e){Pt.b.error("error while trying to append buffer:"+e.message),r.unshift(i);var o={type:Ct.b.MEDIA_ERROR,parent:i.parent};if(22===e.code)return this.segments=[],o.details=Ct.a.BUFFER_FULL_ERROR,o.fatal=!1,void t.trigger(Ot.a.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=Ct.a.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry)return Pt.b.log("fail "+t.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],o.fatal=!0,void t.trigger(Ot.a.ERROR,o);o.fatal=!1,t.trigger(Ot.a.ERROR,o)}}}},e.prototype.flushBuffer=function(t,e,r){var i,a,n,o,s,l,u=this.sourceBuffer;if(Object.keys(u).length){if(Pt.b.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter<this.appended){for(var d in u)if(!r||d===r){if(i=u[d],i.ended=!1,i.updating)return Pt.b.warn("cannot flush, sb updating in progress"),!1;try{for(a=0;a<i.buffered.length;a++)if(n=i.buffered.start(a),o=i.buffered.end(a),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&e===Number.POSITIVE_INFINITY?(s=t,l=e):(s=Math.max(n,t),l=Math.min(o,e)),Math.min(l,o)-s>.5)return this.flushBufferCounter++,Pt.b.log("flush "+d+" ["+s+","+l+"], of ["+n+","+o+"], pos:"+this.media.currentTime),i.remove(s,l),!1}catch(t){Pt.b.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else Pt.b.warn("abort flushing too many retries");Pt.b.log("buffer flushed")}return!0},e}(Nt),xe=Pe,Fe=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ne=function(t){function e(r){return Y(this,e),z(this,t.call(this,r,Ot.a.FPS_DROP_LEVEL_CAPPING,Ot.a.MEDIA_ATTACHING,Ot.a.MANIFEST_PARSED))}return X(e,t),e.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=this.restrictedLevels=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer)))},e.prototype.onFpsDropLevelCapping=function(t){e.isLevelAllowed(t.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(t.droppedLevel)},e.prototype.onMediaAttaching=function(t){this.media=t.media instanceof HTMLVideoElement?t.media:null},e.prototype.onManifestParsed=function(t){var e=this.hls;this.restrictedLevels=[],e.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=t.levels,e.firstLevel=this.getMaxLevel(t.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},e.prototype.detectPlayerSize=function(){if(this.media){var t=this.levels?this.levels.length:0;if(t){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t-1),e.autoLevelCapping>this.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},e.prototype.getMaxLevel=function(t){var r=this;if(!this.levels)return-1;var i=this.levels.filter(function(i,a){return e.isLevelAllowed(a,r.restrictedLevels)&&a<=t});return e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},e.isLevelAllowed=function(t){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(t)},e.getMaxLevelByMediaSize=function(t,e,r){if(!t||t&&!t.length)return-1;for(var i=t.length-1,a=0;a<t.length;a+=1){var n=t[a];if((n.width>=e||n.height>=r)&&function(t,e){return!e||(t.width!==e.width||t.height!==e.height)}(n,t[a+1])){i=a;break}}return i},Fe(e,[{key:"mediaWidth",get:function(){var t=void 0,r=this.media;return r&&(t=r.width||r.clientWidth||r.offsetWidth,t*=e.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t=void 0,r=this.media;return r&&(t=r.height||r.clientHeight||r.offsetHeight,t*=e.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t}}]),e}(Nt),Me=Ne,Ue=function(t){function e(r){return q(this,e),Q(this,t.call(this,r,Ot.a.MEDIA_ATTACHING))}return J(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){"function"==typeof(this.video=t.media instanceof HTMLVideoElement?t.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}},e.prototype.checkFPS=function(t,e,r){var i=performance.now();if(e){if(this.lastTime){var a=i-this.lastTime,n=r-this.lastDroppedFrames,o=e-this.lastDecodedFrames,s=1e3*n/a,l=this.hls;if(l.trigger(Ot.a.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:r}),s>0&&n>l.config.fpsDroppedMonitoringThreshold*o){var u=l.currentLevel;Pt.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=u)&&(u-=1,l.trigger(Ot.a.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.prototype.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},e}(Nt),Be=Ue,Ge=function(){function t(e){$(this,t),e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return t.prototype.destroy=function(){this.abort(),this.loader=null},t.prototype.abort=function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},t.prototype.load=function(t,e,r){this.context=t,this.config=e,this.callbacks=r,this.stats={trequest:performance.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},t.prototype.loadInternal=function(){var t,e=this.context;t=this.loader=new XMLHttpRequest;var r=this.stats;r.tfirst=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(t,e.url)}catch(r){t.open("GET",e.url,!0),i(t,e.url)}t.readyState||t.open("GET",e.url,!0)}catch(r){return void this.callbacks.onError({code:t.status,text:r.message},e,t)}e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()},t.prototype.readystatechange=function(t){var e=t.currentTarget,r=e.readyState,i=this.stats,a=this.context,n=this.config;if(!i.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var o=e.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());var s=void 0,l=void 0;"arraybuffer"===a.responseType?(s=e.response,l=s.byteLength):(s=e.responseText,l=s.length),i.loaded=i.total=l;var u={url:e.responseURL,data:s};this.callbacks.onSuccess(u,i,a,e)}else i.retry>=n.maxRetry||o>=400&&o<499?(Pt.b.error(o+" while loading "+a.url),this.callbacks.onError({code:o,text:e.statusText},a,e)):(Pt.b.warn(o+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),i.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),n.timeout)},t.prototype.loadtimeout=function(){Pt.b.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},t.prototype.loadprogress=function(t){var e=t.currentTarget,r=this.stats;r.loaded=t.loaded,t.lengthComputable&&(r.total=t.total);var i=this.callbacks.onProgress;i&&i(r,this.context,null,e)},t}(),je=Ge,He=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ke=function(t){function e(r){Z(this,e);var i=tt(this,t.call(this,r,Ot.a.MANIFEST_LOADING,Ot.a.MANIFEST_PARSED,Ot.a.AUDIO_TRACK_LOADED,Ot.a.ERROR));return i.ticks=0,i.ontick=i.tick.bind(i),i}return et(e,t),e.prototype.destroy=function(){this.cleanTimer(),Nt.prototype.destroy.call(this)},e.prototype.cleanTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){this.updateTrack(this.trackId)},e.prototype.onError=function(t){t.fatal&&t.type===Ct.b.NETWORK_ERROR&&this.cleanTimer()},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestParsed=function(t){var e=this,r=t.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(Ot.a.AUDIO_TRACKS_UPDATED,{audioTracks:r});var a=0;r.forEach(function(t){if(t.default&&!i)return e.audioTrack=a,void(i=!0);a++}),!1===i&&r.length&&(Pt.b.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)},e.prototype.onAudioTrackLoaded=function(t){t.id<this.tracks.length&&(Pt.b.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*t.details.targetduration)),!t.details.live&&this.timer&&this.cleanTimer())},e.prototype.setAudioTrackInternal=function(t){if(t>=0&&t<this.tracks.length){this.cleanTimer(),this.trackId=t,Pt.b.log("switching to audioTrack "+t);var e=this.tracks[t],r=this.hls,i=e.type,a=e.url,n={id:t,type:i,url:a};r.trigger(Ot.a.AUDIO_TRACK_SWITCH,n),r.trigger(Ot.a.AUDIO_TRACK_SWITCHING,n);var o=e.details;!a||void 0!==o&&!0!==o.live||(Pt.b.log("(re)loading playlist for audioTrack "+t),r.trigger(Ot.a.AUDIO_TRACK_LOADING,{url:a,id:t}))}},e.prototype.updateTrack=function(t){if(t>=0&&t<this.tracks.length){this.cleanTimer(),this.trackId=t,Pt.b.log("updating audioTrack "+t);var e=this.tracks[t],r=e.url,i=e.details;!r||void 0!==i&&!0!==i.live||(Pt.b.log("(re)loading playlist for audioTrack "+t),this.hls.trigger(Ot.a.AUDIO_TRACK_LOADING,{url:r,id:t}))}},He(e,[{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.trackId===t&&void 0!==this.tracks[t].details||this.setAudioTrackInternal(t)}}]),e}(Nt),We=Ke,Ve=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ye={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS"},ze=function(t){function e(r){rt(this,e);var i=it(this,t.call(this,r,Ot.a.MEDIA_ATTACHED,Ot.a.MEDIA_DETACHING,Ot.a.AUDIO_TRACKS_UPDATED,Ot.a.AUDIO_TRACK_SWITCHING,Ot.a.AUDIO_TRACK_LOADED,Ot.a.KEY_LOADED,Ot.a.FRAG_LOADED,Ot.a.FRAG_PARSING_INIT_SEGMENT,Ot.a.FRAG_PARSING_DATA,Ot.a.FRAG_PARSED,Ot.a.ERROR,Ot.a.BUFFER_RESET,Ot.a.BUFFER_CREATED,Ot.a.BUFFER_APPENDED,Ot.a.BUFFER_FLUSHED,Ot.a.INIT_PTS_FOUND));return i.config=r.config,i.audioCodecSwap=!1,i.ticks=0,i._state=Ye.STOPPED,i.ontick=i.tick.bind(i),i.initPTS=[],i.waitingFragment=null,i.videoTrackCC=null,i}return at(e,t),e.prototype.destroy=function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),Nt.prototype.destroy.call(this),this.state=Ye.STOPPED},e.prototype.onInitPtsFound=function(t){var e=t.id,r=t.frag.cc,i=t.initPTS;"main"===e&&(this.initPTS[r]=i,this.videoTrackCC=r,Pt.b.log("InitPTS for cc:"+r+" found from video track:"+i),this.state===Ye.WAITING_INIT_PTS&&this.tick())},e.prototype.startLoad=function(t){if(this.tracks){var e=this.lastCurrentTime;this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.fragLoadError=0,e>0&&-1===t?(Pt.b.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=Ye.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=Ye.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=Ye.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=Ye.STOPPED},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){var t,e,r,i=this.hls,a=i.config;switch(this.state){case Ye.ERROR:case Ye.PAUSED:case Ye.BUFFER_FLUSHING:break;case Ye.STARTING:this.state=Ye.WAITING_TRACK,this.loadedmetadata=!1;break;case Ye.IDLE:var n=this.tracks;if(!n)break;if(!this.media&&(this.startFragRequested||!a.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=this.videoBuffer?this.videoBuffer:this.media,l=ae.bufferInfo(o,t,a.maxBufferHole),u=ae.bufferInfo(s,t,a.maxBufferHole),d=l.len,h=l.end,c=this.fragPrevious,f=Math.max(a.maxBufferLength,u.len),p=this.audioSwitch,g=this.trackId;if((d<f||p)&&g<n.length){if(void 0===(r=n[g].details)){this.state=Ye.WAITING_TRACK;break}if(!p&&!r.live&&c&&c.sn===r.endSN&&!l.nextStart&&(!this.media.seeking||this.media.duration-h<c.duration/2)){this.hls.trigger(Ot.a.BUFFER_EOS,{type:"audio"}),this.state=Ye.ENDED;break}var v=r.fragments,y=v.length,m=v[0].start,b=v[y-1].start+v[y-1].duration,E=void 0;if(p)if(r.live&&!r.PTSKnown)Pt.b.log("switching audiotrack, live stream, unknown PTS,load first fragment"),h=0;else if(h=t,r.PTSKnown&&t<m){if(!(l.end>m||l.nextStart))return;Pt.b.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=m+.05}if(r.initSegment&&!r.initSegment.data)E=r.initSegment;else if(h<=m){if(E=v[0],null!==this.videoTrackCC&&E.cc!==this.videoTrackCC&&(E=A(v,this.videoTrackCC)),r.live&&E.loadIdx&&E.loadIdx===this.fragLoadIdx){var T=l.nextStart?l.nextStart:m;return Pt.b.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(T+.05)),void(this.media.currentTime=T+.05)}}else{var R=void 0,S=a.maxFragLookUpTolerance,L=c?v[c.sn-v[0].sn+1]:void 0,_=function(t){var e=Math.min(S,t.duration);return t.start+t.duration-e<=h?1:t.start-e>h&&t.start?-1:0};h<b?(h>b-S&&(S=0),R=L&&!_(L)?L:re.search(v,_)):R=v[y-1],R&&(E=R,m=R.start,c&&E.level===c.level&&E.sn===c.sn&&(E.sn<r.endSN?(E=v[E.sn+1-r.startSN],Pt.b.log("SN just loaded, load next one: "+E.sn)):E=null))}if(E)if(E.decryptdata&&null!=E.decryptdata.uri&&null==E.decryptdata.key)Pt.b.log("Loading key for "+E.sn+" of ["+r.startSN+" ,"+r.endSN+"],track "+g),this.state=Ye.KEY_LOADING,i.trigger(Ot.a.KEY_LOADING,{frag:E});else{if(Pt.b.log("Loading "+E.sn+", cc: "+E.cc+" of ["+r.startSN+" ,"+r.endSN+"],track "+g+", currentTime:"+t+",bufferEnd:"+h.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,E.loadCounter){E.loadCounter++;var w=a.fragLoadingLoopThreshold;if(E.loadCounter>w&&Math.abs(this.fragLoadIdx-E.loadIdx)<w)return void i.trigger(Ot.a.ERROR,{type:Ct.b.MEDIA_ERROR,details:Ct.a.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:E})}else E.loadCounter=1;E.loadIdx=this.fragLoadIdx,this.fragCurrent=E,this.startFragRequested=!0,isNaN(E.sn)||(this.nextLoadPosition=E.start+E.duration),i.trigger(Ot.a.FRAG_LOADING,{frag:E}),this.state=Ye.FRAG_LOADING}}break;case Ye.WAITING_TRACK:e=this.tracks[this.trackId],e&&e.details&&(this.state=Ye.IDLE);break;case Ye.FRAG_LOADING_WAITING_RETRY:var D=performance.now(),I=this.retryDate;o=this.media;var k=o&&o.seeking;(!I||D>=I||k)&&(Pt.b.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=Ye.IDLE);break;case Ye.WAITING_INIT_PTS:var O=this.videoTrackCC;if(void 0===this.initPTS[O])break;var C=this.waitingFragment;if(C){var P=C.frag.cc;O!==P?(e=this.tracks[this.trackId],e.details&&e.details.live&&(Pt.b.warn("Waiting fragment CC ("+P+") does not match video track CC ("+O+")"),this.waitingFragment=null,this.state=Ye.IDLE)):(this.state=Ye.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=Ye.IDLE;break;case Ye.STOPPED:case Ye.FRAG_LOADING:case Ye.PARSING:case Ye.PARSED:case Ye.ENDED:}},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(Pt.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.tracks;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){this.state===Ye.ENDED&&(this.state=Ye.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()},e.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},e.prototype.onAudioTracksUpdated=function(t){Pt.b.log("audio tracks updated"),this.tracks=t.audioTracks},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=Ye.PAUSED,this.waitingFragment=null,e?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=Ye.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()},e.prototype.onAudioTrackLoaded=function(t){var e=t.details,r=t.id,i=this.tracks[r],a=e.totalduration,n=0;if(Pt.b.log("track "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+a),e.live){var o=i.details;o&&e.fragments.length>0?(T(o,e),n=e.fragments[0].start,e.PTSKnown?Pt.b.log("live audio playlist sliding:"+n.toFixed(3)):Pt.b.log("live audio playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,Pt.b.log("live audio playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(i.details=e,!this.startFragRequested){if(-1===this.startPosition){var s=e.startTimeOffset;isNaN(s)?this.startPosition=0:(Pt.b.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===Ye.WAITING_TRACK&&(this.state=Ye.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===Ye.KEY_LOADING&&(this.state=Ye.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===Ye.FRAG_LOADING&&e&&"audio"===r.type&&r.level===e.level&&r.sn===e.sn){var i=this.tracks[this.trackId],a=i.details,n=a.totalduration,o=e.level,s=e.sn,l=e.cc,u=this.config.defaultAudioCodec||i.audioCodec||"mp4a.40.2",d=this.stats=t.stats;if("initSegment"===s)this.state=Ye.IDLE,d.tparsed=d.tbuffered=performance.now(),a.initSegment.data=t.payload,this.hls.trigger(Ot.a.FRAG_BUFFERED,{stats:d,frag:e,id:"audio"}),this.tick();else{this.state=Ye.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new ce(this.hls,"audio"));var h=this.initPTS[l],c=a.initSegment?a.initSegment.data:[];if(a.initSegment||void 0!==h){this.pendingBuffering=!0,Pt.b.log("Demuxing "+s+" of ["+a.startSN+" ,"+a.endSN+"],track "+o);this.demuxer.push(t.payload,c,u,null,e,n,!1,h)}else Pt.b.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+s+" of ["+a.startSN+" ,"+a.endSN+"],track "+o),this.waitingFragment=t,this.state=Ye.WAITING_INIT_PTS}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===Ye.PARSING){var i=t.tracks,a=void 0;if(i.video&&delete i.video,a=i.audio){a.levelCodec=a.codec,a.id=t.id,this.hls.trigger(Ot.a.BUFFER_CODECS,i),Pt.b.log("audio track:audio,container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var n=a.initSegment;if(n){var o={type:"audio",data:n,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(Ot.a.BUFFER_APPENDING,o))}this.tick()}}},e.prototype.onFragParsingData=function(t){var e=this,r=this.fragCurrent,i=t.frag;if(r&&"audio"===t.id&&"audio"===t.type&&i.sn===r.sn&&i.level===r.level&&this.state===Ye.PARSING){var a=this.trackId,n=this.tracks[a],o=this.hls;isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),Pt.b.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),E(n.details,r,t.startPTS,t.endPTS);var s=this.audioSwitch,l=this.media,u=!1;if(s&&l)if(l.readyState){var d=l.currentTime;Pt.b.log("switching audio track : currentTime:"+d),d>=t.startPTS&&(Pt.b.log("switching audio track : flushing all audio"),this.state=Ye.BUFFER_FLUSHING,o.trigger(Ot.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(Ot.a.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,o.trigger(Ot.a.AUDIO_TRACK_SWITCHED,{id:a});var h=this.pendingData;this.audioSwitch||([t.data1,t.data2].forEach(function(e){e&&e.length&&h.push({type:t.type,data:e,parent:"audio",content:"data"})}),!u&&h.length&&(h.forEach(function(t){e.state===Ye.PARSING&&(e.pendingBuffering=!0,e.hls.trigger(Ot.a.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===Ye.PARSING&&(this.stats.tparsed=performance.now(),this.state=Ye.PARSED,this._checkAppendedParsed())},e.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},e.prototype.onBufferCreated=function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},e.prototype.onBufferAppended=function(t){if("audio"===t.parent){var e=this.state;e!==Ye.PARSING&&e!==Ye.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==Ye.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,r=this.hls;if(t){this.fragPrevious=t,e.tbuffered=performance.now(),r.trigger(Ot.a.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;Pt.b.log("audio buffered : "+pe.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(Ot.a.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=Ye.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag;if(!e||"audio"===e.type)switch(t.details){case Ct.a.FRAG_LOAD_ERROR:case Ct.a.FRAG_LOAD_TIMEOUT:if(!t.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r,e.loadCounter=0;var a=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);Pt.b.warn("audioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=performance.now()+a,this.state=Ye.FRAG_LOADING_WAITING_RETRY}else Pt.b.error("audioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=Ye.ERROR}break;case Ct.a.FRAG_LOOP_LOADING_ERROR:case Ct.a.AUDIO_TRACK_LOAD_ERROR:case Ct.a.AUDIO_TRACK_LOAD_TIMEOUT:case Ct.a.KEY_LOAD_ERROR:case Ct.a.KEY_LOAD_TIMEOUT:this.state!==Ye.ERROR&&(this.state=t.fatal?Ye.ERROR:Ye.IDLE,Pt.b.warn("audioStreamController: "+t.details+" while loading frag,switch to "+this.state+" state ..."));break;case Ct.a.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===Ye.PARSING||this.state===Ye.PARSED)){var n=this.mediaBuffer,o=this.media.currentTime;if(n&&ae.isBuffered(n,o)&&ae.isBuffered(n,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,Pt.b.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=Ye.IDLE}else Pt.b.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=Ye.BUFFER_FLUSHING,this.hls.trigger(Ot.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}},e.prototype.onBufferFlushed=function(){var t=this,e=this.pendingData;e&&e.length?(Pt.b.log("appending pending audio data on Buffer Flushed"),e.forEach(function(e){t.hls.trigger(Ot.a.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=Ye.PARSED):(this.state=Ye.IDLE,this.fragPrevious=null,this.tick())},Ve(e,[{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,Pt.b.log("audio stream:"+e+"->"+t)}},get:function(){return this._state}}]),e}(Nt),Xe=ze,qe=function(){function t(t){return"string"==typeof t&&(!!n[t.toLowerCase()]&&t.toLowerCase())}function e(t){return"string"==typeof t&&(!!o[t.toLowerCase()]&&t.toLowerCase())}function r(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)t[i]=r[i]}return t}function i(i,n,o){var s=this,l=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),u={};l?s=document.createElement("custom"):u.enumerable=!0,s.hasBeenReset=!1;var d="",h=!1,c=i,f=n,p=o,g=null,v="",y=!0,m="auto",b="start",E=50,T="middle",R=50,A="middle";if(Object.defineProperty(s,"id",r({},u,{get:function(){return d},set:function(t){d=""+t}})),Object.defineProperty(s,"pauseOnExit",r({},u,{get:function(){return h},set:function(t){h=!!t}})),Object.defineProperty(s,"startTime",r({},u,{get:function(){return c},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");c=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",r({},u,{get:function(){return f},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");f=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",r({},u,{get:function(){return p},set:function(t){p=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",r({},u,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",r({},u,{get:function(){return v},set:function(e){var r=t(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");v=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",r({},u,{get:function(){return y},set:function(t){y=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",r({},u,{get:function(){return m},set:function(t){if("number"!=typeof t&&t!==a)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",r({},u,{get:function(){return b},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");b=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",r({},u,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",r({},u,{get:function(){return T},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",r({},u,{get:function(){return R},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");R=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",r({},u,{get:function(){return A},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");A=r,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var a="auto",n={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}(),Qe=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};st.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var i=0;i<r.length;++i)if(e===r[i]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var Je=new qe(0,0,0),$e="middle"===Je.align?"middle":"center";nt.prototype={parse:function(t){function e(){var t=r.buffer,e=0;for(t=dt(t);e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var i=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,r.buffer=t.substr(e),i}var r=this;t&&(r.buffer+=r.decoder.decode(t,{stream:!0}));try{var i;if("INITIAL"===r.state){if(!/\r\n|\n/.test(r.buffer))return this;i=e();var a=i.match(/^()?WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var n=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;switch(n?n=!1:i=e(),r.state){case"HEADER":/:/.test(i)?function(t){lt(t,function(t,e){switch(t){case"Region":console.log("parse region",e)}},/:/)}(i):i||(r.state="ID");continue;case"NOTE":i||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){r.state="NOTE";break}if(!i)continue;if(r.cue=new qe(0,0,""),r.state="CUE",-1===i.indexOf("--\x3e")){r.cue.id=i;continue}case"CUE":try{ut(i,r.cue,r.regionList)}catch(t){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var o=-1!==i.indexOf("--\x3e");if(!i||o&&(n=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i;continue;case"BADCUE":i||(r.state="ID");continue}}}catch(t){"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new Error("Malformed WebVTT signature.")}catch(t){throw t}return t.onflush&&t.onflush(),this}};var Ze=nt,tr={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},er=function(t){var e=t;return tr.hasOwnProperty(t)&&(e=tr[t]),String.fromCharCode(e)},rr=15,ir=100,ar={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},nr={17:2,18:4,21:6,22:8,23:10,19:13,20:15},or={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},sr={25:2,26:4,29:6,30:8,31:10,27:13,28:15},lr=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ur={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(t){this.time=t},log:function(t,e){var r=this.verboseFilter[t];this.verboseLevel>=r&&console.log(this.time+" ["+t+"] "+e)}},dr=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].toString(16));return e},hr=function(){function t(e,r,i,a,n){ct(this,t),this.foreground=e||"white",this.underline=r||!1,this.italics=i||!1,this.background=a||"black",this.flash=n||!1}return t.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.prototype.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(this[i]=t[i])}},t.prototype.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.prototype.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},t.prototype.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},t.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),cr=function(){function t(e,r,i,a,n,o){ct(this,t),this.uchar=e||" ",this.penState=new hr(r,i,a,n,o)}return t.prototype.reset=function(){this.uchar=" ",this.penState.reset()},t.prototype.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},t.prototype.setPenState=function(t){this.penState.copy(t)},t.prototype.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},t.prototype.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},t.prototype.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),fr=function(){function t(){ct(this,t),this.chars=[];for(var e=0;e<ir;e++)this.chars.push(new cr);this.pos=0,this.currPenState=new hr}return t.prototype.equals=function(t){for(var e=!0,r=0;r<ir;r++)if(!this.chars[r].equals(t.chars[r])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<ir;e++)this.chars[e].copy(t.chars[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<ir;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},t.prototype.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(ur.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>ir&&(ur.log("ERROR","Too large cursor position "+this.pos),this.pos=ir)},t.prototype.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r<e+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(e)},t.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.prototype.insertChar=function(t){t>=144&&this.backSpace();var e=er(t);if(this.pos>=ir)return void ur.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},t.prototype.clearFromPos=function(t){var e;for(e=t;e<ir;e++)this.chars[e].reset()},t.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.prototype.getTextString=function(){for(var t=[],e=!0,r=0;r<ir;r++){var i=this.chars[r].uchar;" "!==i&&(e=!1),t.push(i)}return e?"":t.join("")},t.prototype.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),pr=function(){function t(){ct(this,t),this.rows=[];for(var e=0;e<rr;e++)this.rows.push(new fr);this.currRow=rr-1,this.nrRollUpRows=null,this.reset()}return t.prototype.reset=function(){for(var t=0;t<rr;t++)this.rows[t].clear();this.currRow=rr-1},t.prototype.equals=function(t){for(var e=!0,r=0;r<rr;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<rr;e++)this.rows[e].copy(t.rows[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<rr;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},t.prototype.backSpace=function(){this.rows[this.currRow].backSpace()},t.prototype.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.prototype.insertChar=function(t){this.rows[this.currRow].insertChar(t)},t.prototype.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},t.prototype.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},t.prototype.setCursor=function(t){ur.log("INFO","setCursor: "+t),this.rows[this.currRow].setCursor(t)},t.prototype.setPAC=function(t){ur.log("INFO","pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var r=0;r<rr;r++)this.rows[r].clear();var i=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){var n=a.rows[i].cueStartTime;if(n&&n<ur.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(a.rows[i+o])}}this.currRow=e;var s=this.rows[this.currRow];if(null!==t.indent){var l=t.indent,u=Math.max(l-1,0);s.setCursor(t.indent),t.color=s.chars[u].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},t.prototype.setBkgData=function(t){ur.log("INFO","bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},t.prototype.setRollUpRows=function(t){this.nrRollUpRows=t},t.prototype.rollUp=function(){if(null===this.nrRollUpRows)return void ur.log("DEBUG","roll_up but nrRollUpRows not set yet");ur.log("TEXT",this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),ur.log("INFO","Rolling up")},t.prototype.getDisplayText=function(t){t=t||!1;for(var e=[],r="",i=-1,a=0;a<rr;a++){var n=this.rows[a].getTextString();n&&(i=a+1,t?e.push("Row "+i+": '"+n+"'"):e.push(n.trim()))}return e.length>0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},t.prototype.getTextAndFormat=function(){return this.rows},t}(),gr=function(){function t(e,r){ct(this,t),this.chNr=e,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new pr,this.nonDisplayedMemory=new pr,this.lastOutputScreen=new pr,this.currRollUpRow=this.displayedMemory.rows[rr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return t.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[rr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},t.prototype.getHandler=function(){return this.outputFilter},t.prototype.setHandler=function(t){this.outputFilter=t},t.prototype.setPAC=function(t){this.writeScreen.setPAC(t)},t.prototype.setBkgData=function(t){this.writeScreen.setBkgData(t)},t.prototype.setMode=function(t){t!==this.mode&&(this.mode=t,ur.log("INFO","MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},t.prototype.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";ur.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(ur.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.prototype.ccRCL=function(){ur.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.prototype.ccBS=function(){ur.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.prototype.ccAOF=function(){},t.prototype.ccAON=function(){},t.prototype.ccDER=function(){ur.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.prototype.ccRU=function(t){ur.log("INFO","RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},t.prototype.ccFON=function(){ur.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.prototype.ccRDC=function(){ur.log("INFO","RDC - Resume Direct
44067Captioning"),this.setMode("MODE_PAINT-ON")},t.prototype.ccTR=function(){ur.log("INFO","TR"),this.setMode("MODE_TEXT")},t.prototype.ccRTD=function(){ur.log("INFO","RTD"),this.setMode("MODE_TEXT")},t.prototype.ccEDM=function(){ur.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.prototype.ccCR=function(){ur.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.prototype.ccENM=function(){ur.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.prototype.ccEOC=function(){if(ur.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,ur.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.prototype.ccTO=function(t){ur.log("INFO","TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},t.prototype.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[r]}ur.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},t.prototype.outputDataUpdate=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=ur.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),!0===t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},t.prototype.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),vr=function(){function t(e,r,i){ct(this,t),this.field=e||1,this.outputs=[r,i],this.channels=[new gr(1,r),new gr(2,i)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return t.prototype.getHandler=function(t){return this.channels[t].getHandler()},t.prototype.setHandler=function(t,e){this.channels[t].setHandler(e)},t.prototype.addData=function(t,e){var r,i,a,n=!1;this.lastTime=t,ur.setTime(t);for(var o=0;o<e.length;o+=2)if(i=127&e[o],a=127&e[o+1],0!==i||0!==a){if(ur.log("DATA","["+dr([e[o],e[o+1]])+"] -> ("+dr([i,a])+")"),r=this.parseCmd(i,a),r||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(n=this.parseChars(i,a)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(n)}else ur.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:n?this.dataCounters.char+=2:(this.dataCounters.other+=2,ur.log("WARNING","Couldn't parse cleaned data "+dr([i,a])+" orig: "+dr([e[o],e[o+1]])))}else this.dataCounters.padding+=2},t.prototype.parseCmd=function(t,e){var r=null,i=(20===t||28===t)&&32<=e&&e<=47,a=(23===t||31===t)&&33<=e&&e<=35;if(!i&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,ur.log("DEBUG","Repeated command ("+dr([t,e])+") is dropped"),!0;r=20===t||23===t?1:2;var n=this.channels[r-1];return 20===t||28===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.parseMidrow=function(t,e){var r=null;if((17===t||25===t)&&32<=e&&e<=47){if((r=17===t?1:2)!==this.currChNr)return ur.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(e),ur.log("DEBUG","MIDROW ("+dr([t,e])+")"),!0}return!1},t.prototype.parsePAC=function(t,e){var r=null,i=null,a=(17<=t&&t<=23||25<=t&&t<=31)&&64<=e&&e<=127,n=(16===t||24===t)&&64<=e&&e<=95;if(!a&&!n)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=t<=23?1:2,i=64<=e&&e<=95?1===r?ar[t]:or[t]:1===r?nr[t]:sr[t];var o=this.interpretPAC(i,e);return this.channels[r-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.interpretPAC=function(t,e){var r=e,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},t.prototype.parseChars=function(t,e){var r=null,i=null,a=null;if(t>=25?(r=2,a=t-8):(r=1,a=t),17<=a&&a<=19){var n=e;n=17===a?e+80:18===a?e+112:e+144,ur.log("INFO","Special char '"+er(n)+"' in channel "+r),i=[n]}else 32<=t&&t<=127&&(i=0===e?[t]:[t,e]);if(i){var o=dr(i);ur.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i}
vendor: 22,033 bytes, line 44067
44067,t.prototype.parseBackgroundAttributes=function(t,e){var r,i,a,n,o=(16===t||24===t)&&32<=e&&e<=47,s=(23===t||31===t)&&45<=e&&e<=47;return!(!o&&!s)&&(r={},16===t||24===t?(i=Math.floor((e-32)/2),r.background=lr[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0)),a=t<24?1:2,n=this.channels[a-1],n.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)},t.prototype.reset=function(){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].reset();this.lastCmdA=null,this.lastCmdB=null},t.prototype.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].cueSplitAtTime(t)},t}(),yr=vr,mr=function(){function t(e,r){ft(this,t),this.timelineController=e,this.track=r,this.startTime=null,this.endTime=null,this.screen=null}return t.prototype.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues("textTrack"+this.track,this.startTime,this.endTime,this.screen),this.startTime=null)},t.prototype.newCue=function(t,e,r){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.track)},t}(),br=mr,Er=function(t,e,r){return t.substr(r||0,e.length)===e},Tr=function(t){var e=parseInt(t.substr(-3)),r=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),a=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;return isNaN(e)||isNaN(r)||isNaN(i)||isNaN(a)?-1:(e+=1e3*r,e+=6e4*i,e+=36e5*a)},Rr=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return(e>>>0).toString()},Ar=function(t,e,r){var i=t[e],a=t[i.prevCC];if(!a||!a.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;a&&a.new;)t.ccOffset+=i.start-a.start,i.new=!1,i=a,a=t[i.prevCC];t.presentationOffset=r},Sr={parse:function(t,e,r,i,a,n){var o=/\r\n|\n\r|\n|\r/g,s=Object(Re.b)(new Uint8Array(t)).trim().replace(o,"\n").split("\n"),l="00:00.000",u=0,d=0,h=0,c=[],f=void 0,p=!0,g=new Ze;g.oncue=function(t){var e=r[i],a=r.ccOffset;e&&e.new&&(void 0!==d?a=r.ccOffset=e.start:Ar(r,i,h)),h&&(a=h+r.ccOffset-r.presentationOffset),t.startTime+=a-d,t.endTime+=a-d,t.id=Rr(t.startTime.toString())+Rr(t.endTime.toString())+Rr(t.text),t.text=decodeURIComponent(encodeURIComponent(t.text)),t.endTime>0&&c.push(t)},g.onparsingerror=function(t){f=t},g.onflush=function(){if(f&&n)return void n(f);a(c)},s.forEach(function(t){if(p){if(Er(t,"X-TIMESTAMP-MAP=")){p=!1,t.substr(16).split(",").forEach(function(t){Er(t,"LOCAL:")?l=t.substr(6):Er(t,"MPEGTS:")&&(u=parseInt(t.substr(7)))});try{e=e<0?e+8589934592:e,u-=e,d=Tr(l)/1e3,h=u/9e4,-1===d&&(f=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){f=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(p=!1)}g.parse(t+"\n")}),g.flush()}},Lr=Sr,_r=function(t){function e(r){pt(this,e);var i=gt(this,t.call(this,r,Ot.a.MEDIA_ATTACHING,Ot.a.MEDIA_DETACHING,Ot.a.FRAG_PARSING_USERDATA,Ot.a.FRAG_DECRYPTED,Ot.a.MANIFEST_LOADING,Ot.a.MANIFEST_LOADED,Ot.a.FRAG_LOADED,Ot.a.LEVEL_SWITCHING,Ot.a.INIT_PTS_FOUND));if(i.hls=r,i.config=r.config,i.enabled=!0,i.Cues=r.config.cueHandler,i.textTracks=[],i.tracks=[],i.unparsedVttFrags=[],i.initPTS=void 0,i.cueRanges=[],i.config.enableCEA708Captions){var a=new br(i,1),n=new br(i,2);i.cea608Parser=new yr(0,a,n)}return i}return vt(e,t),e.prototype.addCues=function(t,e,r,i){for(var a=this.cueRanges,n=!1,o=a.length;o--;){var s=a[o],l=bt(s[0],s[1],e,r);if(l>=0&&(s[0]=Math.min(s[0],e),s[1]=Math.max(s[1],r),n=!0,l/(r-e)>.5))return}n||a.push([e,r]),this.Cues.newCue(this[t],e,r,i)},e.prototype.onInitPtsFound=function(t){var e=this;void 0===this.initPTS&&(this.initPTS=t.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(t){e.onFragLoaded(t)}),this.unparsedVttFrags=[])},e.prototype.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r<e.textTracks.length;r++){var i=e.textTracks[r],a="textTrack"+t;if(!0===i[a])return i}return null},e.prototype.sendAddTrackEvent=function(t,e){var r=null;try{r=new window.Event("addtrack")}catch(t){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)},e.prototype.createCaptionsTrack=function(t){var e="textTrack"+t;if(!this[e]){var r=this.getExistingTrack(t);if(r)this[e]=r,yt(this[e]),this.sendAddTrackEvent(this[e],this.media);else{var i=this.createTextTrack("captions",this.config["captionsTextTrack"+t+"Label"],this.config.captionsTextTrack1LanguageCode);i&&(i[e]=!0,this[e]=i)}}},e.prototype.createTextTrack=function(t,e,r){var i=this.media;if(i)return i.addTextTrack(t,e,r)},e.prototype.destroy=function(){Nt.prototype.destroy.call(this)},e.prototype.onMediaAttaching=function(t){this.media=t.media,this._cleanTracks()},e.prototype.onMediaDetaching=function(){yt(this.textTrack1),yt(this.textTrack2)},e.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0},this._cleanTracks()},e.prototype._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var r=0;r<e.length;r++)yt(e[r])}},e.prototype.onManifestLoaded=function(t){var e=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=t.subtitles||[];var r=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,i){var a=void 0;if(i<r.length){var n=r[i];mt(n,t)&&(a=n)}a||(a=e.createTextTrack("subtitles",t.name,t.lang)),a.mode=t.default?"showing":"hidden",e.textTracks.push(a)})}},e.prototype.onLevelSwitching=function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions},e.prototype.onFragLoaded=function(t){var e=t.frag,r=t.payload;if("main"===e.type){var i=e.sn;if(i!==this.lastSn+1){var a=this.cea608Parser;a&&a.reset()}this.lastSn=i}else if("subtitle"===e.type)if(r.byteLength){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(t);var n=e.decryptdata;null!=n&&null!=n.key&&"AES-128"===n.method||this._parseVTTs(e,r)}else this.hls.trigger(Ot.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})},e.prototype._parseVTTs=function(t,e){var r=this.vttCCs;r[t.cc]||(r[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);var i=this.textTracks,a=this.hls;Lr.parse(e,this.initPTS,r,t.cc,function(e){var r=i[t.trackId];e.forEach(function(t){if(!r.cues.getCueById(t.id))try{r.addCue(t)}catch(i){var e=new window.TextTrackCue(t.startTime,t.endTime,t.text);e.id=t.id,r.addCue(e)}}),a.trigger(Ot.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){Pt.b.log("Failed to parse VTT cue: "+e),a.trigger(Ot.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})},e.prototype.onFragDecrypted=function(t){var e=t.payload,r=t.frag;if("subtitle"===r.type){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(t);this._parseVTTs(r,e)}},e.prototype.onFragParsingUserdata=function(t){if(this.enabled&&this.config.enableCEA708Captions)for(var e=0;e<t.samples.length;e++){var r=this.extractCea608Data(t.samples[e].bytes);this.cea608Parser.addData(t.samples[e].pts,r)}},e.prototype.extractCea608Data=function(t){for(var e,r,i,a,n,o=31&t[0],s=2,l=[],u=0;u<o;u++)e=t[s++],r=127&t[s++],i=127&t[s++],a=0!=(4&e),n=3&e,0===r&&0===i||a&&0===n&&(l.push(r),l.push(i));return l},e}(Nt),wr=_r,Dr=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ir=function(t){function e(r){Et(this,e);var i=Tt(this,t.call(this,r,Ot.a.MEDIA_ATTACHED,Ot.a.MEDIA_DETACHING,Ot.a.MANIFEST_LOADING,Ot.a.MANIFEST_LOADED,Ot.a.SUBTITLE_TRACK_LOADED));return i.tracks=[],i.trackId=-1,i.media=void 0,i.subtitleDisplay=!1,i}return Rt(e,t),e.prototype._onTextTracksChanged=function(){if(this.media){for(var t=-1,e=At(this.media.textTracks),r=0;r<e.length;r++)"showing"===e[r].mode&&(t=r);this.subtitleTrack=t}},e.prototype.destroy=function(){Nt.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){var e=this;this.media=t.media,this.media&&(void 0!==this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval(function(){e.trackChangeListener()},500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},e.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=void 0)},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestLoaded=function(t){var e=this,r=t.subtitles||[];this.tracks=r,this.trackId=-1,this.hls.trigger(Ot.a.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:r}),r.forEach(function(t){t.default&&(e.media?e.subtitleTrack=t.id:e.queuedDefaultTrack=t.id)})},e.prototype.onTick=function(){var t=this.trackId,e=this.tracks[t];if(e){var r=e.details;void 0!==r&&!0!==r.live||(Pt.b.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(Ot.a.SUBTITLE_TRACK_LOADING,{url:e.url,id:t}))}},e.prototype.onSubtitleTrackLoaded=function(t){var e=this;t.id<this.tracks.length&&(Pt.b.log("subtitle track "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(function(){e.onTick()},1e3*t.details.targetduration,this)),!t.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))},e.prototype.setSubtitleTrackInternal=function(t){if(!(t<-1||t>=this.tracks.length)){this.timer&&(clearInterval(this.timer),this.timer=null);var e=At(this.media.textTracks);if(-1!==this.trackId&&this.subtitleDisplay&&(e[this.trackId].mode="hidden"),this.trackId=t,Pt.b.log("switching to subtitle track "+t),this.hls.trigger(Ot.a.SUBTITLE_TRACK_SWITCH,{id:t}),-1!==t){var r=this.tracks[t];this.subtitleDisplay&&(e[t].mode="showing");var i=r.details;void 0!==i&&!0!==i.live||(Pt.b.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(Ot.a.SUBTITLE_TRACK_LOADING,{url:r.url,id:t}))}}},Dr(e,[{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.trackId!==t&&this.setSubtitleTrackInternal(t)}}]),e}(Nt),kr=Ir,Or=r(4),Cr={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"},Pr=function(t){function e(r){St(this,e);var i=Lt(this,t.call(this,r,Ot.a.MEDIA_ATTACHED,Ot.a.ERROR,Ot.a.KEY_LOADED,Ot.a.FRAG_LOADED,Ot.a.SUBTITLE_TRACKS_UPDATED,Ot.a.SUBTITLE_TRACK_SWITCH,Ot.a.SUBTITLE_TRACK_LOADED,Ot.a.SUBTITLE_FRAG_PROCESSED));return i.config=r.config,i.vttFragSNsProcessed={},i.vttFragQueues=void 0,i.currentlyProcessing=null,i.state=Cr.STOPPED,i.currentTrackId=-1,i.ticks=0,i.decrypter=new Or.a(r.observer,r.config),i}return _t(e,t),e.prototype.destroy=function(){Nt.prototype.destroy.call(this),this.state=Cr.STOPPED},e.prototype.clearVttFragQueues=function(){var t=this;this.vttFragQueues={},this.tracks.forEach(function(e){t.vttFragQueues[e.id]=[]})},e.prototype.nextFrag=function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var t=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.fragCurrent=t,this.hls.trigger(Ot.a.FRAG_LOADING,{frag:t}),this.state=Cr.FRAG_LOADING}},e.prototype.onSubtitleFragProcessed=function(t){t.success&&this.vttFragSNsProcessed[t.frag.trackId].push(t.frag.sn),this.currentlyProcessing=null,this.state=Cr.IDLE,this.nextFrag()},e.prototype.onMediaAttached=function(){this.state=Cr.IDLE},e.prototype.onError=function(t){var e=t.frag;e&&"subtitle"!==e.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())},e.prototype.tick=function(){var t=this;1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(function(){t.tick()},1),this.ticks=0)},e.prototype.doTick=function(){var t=this;switch(this.state){case Cr.IDLE:var e=this.tracks,r=this.currentTrackId,i=this.vttFragSNsProcessed[r],a=this.vttFragQueues[r],n=this.currentlyProcessing?this.currentlyProcessing.sn:-1,o=function(t){return i.indexOf(t.sn)>-1},s=function(t){return a.some(function(e){return e.sn===t.sn})};if(!e)break;var l;if(r<e.length&&(l=e[r].details),void 0===l)break;l.fragments.forEach(function(e){o(e)||e.sn===n||s(e)||(e.decryptdata&&null!=e.decryptdata.uri&&null==e.decryptdata.key?(Pt.b.log("Loading key for "+e.sn),t.state=Cr.KEY_LOADING,t.hls.trigger(Ot.a.KEY_LOADING,{frag:e})):(e.trackId=r,a.push(e),t.nextFrag()))})}},e.prototype.onSubtitleTracksUpdated=function(t){var e=this;Pt.b.log("subtitle tracks updated"),this.tracks=t.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(t){e.vttFragSNsProcessed[t.id]=[]})},e.prototype.onSubtitleTrackSwitch=function(t){this.currentTrackId=t.id,this.clearVttFragQueues()},e.prototype.onSubtitleTrackLoaded=function(){this.tick()},e.prototype.onKeyLoaded=function(){this.state===Cr.KEY_LOADING&&(this.state=Cr.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag.decryptdata,i=t.frag,a=this.hls;if(this.state===Cr.FRAG_LOADING&&e&&"subtitle"===t.frag.type&&e.sn===t.frag.sn&&t.payload.byteLength>0&&null!=r&&null!=r.key&&"AES-128"===r.method){var n;try{n=performance.now()}catch(t){n=Date.now()}this.decrypter.decrypt(t.payload,r.key.buffer,r.iv.buffer,function(t){var e;try{e=performance.now()}catch(t){e=Date.now()}a.trigger(Ot.a.FRAG_DECRYPTED,{frag:i,payload:t,stats:{tstart:n,tdecrypt:e}})})}},e}(Nt),xr=Pr,Fr={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,maxSeekHole:2,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,fragLoadingLoopThreshold:3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:je,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,fetchSetup:void 0,abrController:Oe,bufferController:xe,capLevelController:Me,fpsController:Be,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0};Fr.subtitleStreamController=xr,Fr.subtitleTrackController=kr,Fr.timelineController=wr,Fr.cueHandler=Dt,Fr.enableCEA708Captions=!0,Fr.enableWebVTT=!0,Fr.captionsTextTrack1Label="English",Fr.captionsTextTrack1LanguageCode="en",Fr.captionsTextTrack2Label="Spanish",Fr.captionsTextTrack2LanguageCode="es",Fr.audioStreamController=Xe,Fr.audioTrackController=We;var Nr=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Mr=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};wt(this,t);var i=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in i)a in r||(r[a]=i[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');Object(Pt.a)(r.debug),this.config=r,this._autoLevelCapping=-1;var n=this.observer=new se.a;n.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n.emit.apply(n,[t,t].concat(r))},n.off=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n.removeListener.apply(n,[t].concat(r))},this.on=n.on.bind(n),this.off=n.off.bind(n),this.trigger=n.trigger.bind(n);var o=this.abrController=new r.abrController(this),s=new r.bufferController(this),l=new r.capLevelController(this),u=new r.fpsController(this),d=new Qt(this),h=new $t(this),c=new te(this),f=new Se(this),p=this.levelController=new Te(this),g=this.streamController=new me(this),v=[p,g],y=r.audioStreamController;y&&v.push(new y(this)),this.networkControllers=v;var m=[d,h,c,o,s,l,u,f];if(y=r.audioTrackController){var b=new y(this);this.audioTrackController=b,m.push(b)}if(y=r.subtitleTrackController){var E=new y(this);this.subtitleTrackController=E,m.push(E)}[r.subtitleStreamController,r.timelineController].forEach(function(t){t&&m.push(new t(e))}),this.coreComponents=m}return t.isSupported=function(){return M()},Nr(t,null,[{key:"version",get:function(){return"0.8.9"}},{key:"Events",get:function(){return Ot.a}},{key:"ErrorTypes",get:function(){return Ct.b}},{key:"ErrorDetails",get:function(){return Ct.a}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:Fr},set:function(e){t.defaultConfig=e}}]),t.prototype.destroy=function(){Pt.b.log("destroy"),this.trigger(Ot.a.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(t){t.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(t){Pt.b.log("attachMedia"),this.media=t,this.trigger(Ot.a.MEDIA_ATTACHING,{media:t})},t.prototype.detachMedia=function(){Pt.b.log("detachMedia"),this.trigger(Ot.a.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(t){t=kt.a.buildAbsoluteURL(window.location.href,t,{alwaysNormalize:!0}),Pt.b.log("loadSource:"+t),this.url=t,this.trigger(Ot.a.MANIFEST_LOADING,{url:t})},t.prototype.startLoad=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Pt.b.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},t.prototype.stopLoad=function(){Pt.b.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})},t.prototype.swapAudioCodec=function(){Pt.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){Pt.b.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)},Nr(t,[{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){Pt.b.log("set currentLevel:"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){Pt.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){Pt.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){Pt.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){Pt.b.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){Pt.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var t=this,e=t.levels,r=t.config.minAutoBitrate,i=e?e.length:0,a=0;a<i;a++){if((e[a].realBitrate?Math.max(e[a].realBitrate,e[a].bitrate):e[a].bitrate)>r)return a}return 0}},{key:"maxAutoLevel",get:function(){var t=this,e=t.levels,r=t.autoLevelCapping;return-1===r&&e&&e.length?e.length-1:r}},{key:"nextAutoLevel",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}
44067,set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}}]),t}();e.default=Mr},function(t,e,r){function i(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e.oe=function(t){throw console.error(t),t};var i=e(e.s=ENTRY_MODULE);return i.default||i}function a(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function n(t){var e=[],r=t.toString(),i=r.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return e;for(var n,o=i[1],s=new RegExp("(\\\\n|\\W)"+a(o)+"\\((/\\*.*?\\*/)?s?.*?([\\.|\\-|\\w|/|@]+).*?\\)","g");n=s.exec(r);)e.push(n[3]);return e}function o(t,e){for(var r=[e],i=[],a={};r.length;){var o=r.pop();if(!a[o]&&t[o]){a[o]=!0,i.push(o);var s=n(t[o]);r=r.concat(s)}}return i}t.exports=function(t,e){e=e||{};var a=r.m,n=e.all?Object.keys(a):o(a,t),s="("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+n.map(function(t){return JSON.stringify(t)+": "+a[t].toString()}).join(",")+"})(self);",l=new window.Blob([s],{type:"text/javascript"});if(e.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,d=u.createObjectURL(l),h=new window.Worker(d);return h.objectURL=d,h}},function(t,e,r){;Object.defineProperty(e,"__esModule",{value:!0});var i=r(7),a=r(1),n=r(0),o=r(5),s=r.n(o),l=function(t){var e=new s.a;e.trigger=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e.emit.apply(e,[t,t].concat(i))},e.off=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e.removeListener.apply(e,[t].concat(i))};var r=function(e,r){t.postMessage({event:e,data:r})};t.addEventListener("message",function(a){var o=a.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);t.demuxer=new i.a(e,o.typeSupported,s,o.vendor);try{Object(n.a)(!0===s.debug)}catch(t){console.warn("demuxerWorker: unable to enable logs")}r("init",null);break;case"demux":t.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}}),e.on(a.a.FRAG_DECRYPTED,r),e.on(a.a.FRAG_PARSING_INIT_SEGMENT,r),e.on(a.a.FRAG_PARSED,r),e.on(a.a.ERROR,r),e.on(a.a.FRAG_PARSING_METADATA,r),e.on(a.a.FRAG_PARSING_USERDATA,r),e.on(a.a.INIT_PTS_FOUND,r),e.on(a.a.FRAG_PARSING_DATA,function(e,r){var i=[],a={event:e,data:r};r.data1&&(a.data1=r.data1.buffer,i.push(r.data1.buffer),delete r.data1),r.data2&&(a.data2=r.data2.buffer,i.push(r.data2.buffer),delete r.data2),t.postMessage(a,i)})};e.default=l}]).default}); 44068/*! Idle Timer v1.1.0 2016-03-21 | https://github.com/thorst/jquery-idletimer | (c) 2016 Paul Irish | Licensed MIT */ 44069!function(a){a.idleTimer=function(b,c){var d;"object"==typeof b?(d=b,b=null):"number"==typeof b&&(d={timeout:b},b=null),c=c||document,d=a.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},d);var e=a(c),f=e.data("idleTimerObj")||{},g=function(b){var d=a.data(c,"idleTimerObj")||{};d.idle=!d.idle,d.olddate=+new Date;var e=a.Event((d.idle?"idle":"active")+".idleTimer");a(c).trigger(e,[c,a.extend({},d),b])},h=function(b){var d=a.data(c,"idleTimerObj")||{};if(("storage"!==b.type||b.originalEvent.key===d.timerSyncId)&&null==d.remaining){if("mousemove"===b.type){if(b.pageX===d.pageX&&b.pageY===d.pageY)return;if("undefined"==typeof b.pageX&&"undefined"==typeof b.pageY)return;var e=+new Date-d.olddate;if(200>e)return}clearTimeout(d.tId),d.idle&&g(b),d.lastActive=+new Date,d.pageX=b.pageX,d.pageY=b.pageY,"storage"!==b.type&&d.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(d.timerSyncId,d.lastActive),d.tId=setTimeout(g,d.timeout)}},i=function(){var b=a.data(c,"idleTimerObj")||{};b.idle=b.idleBackup,b.olddate=+new Date,b.lastActive=b.olddate,b.remaining=null,clearTimeout(b.tId),b.idle||(b.tId=setTimeout(g,b.timeout))},j=function(){var b=a.data(c,"idleTimerObj")||{};null==b.remaining&&(b.remaining=b.timeout-(+new Date-b.olddate),
44069clearTimeout(b.tId))},k=function(){var b=a.data(c,"idleTimerObj")||{};null!=b.remaining&&(b.idle||(b.tId=setTimeout(g,b.remaining)),b.remaining=null)},l=function(){var b=a.data(c,"idleTimerObj")||{};clearTimeout(b.tId),e.removeData("idleTimerObj"),e.off("._idleTimer")},m=function(){var b=a.data(c,"idleTimerObj")||{};if(b.idle)return 0;if(null!=b.remaining)return b.remaining;var d=b.timeout-(+new Date-b.lastActive);return 0>d&&(d=0),d};if(null===b&&"undefined"!=typeof f.idle)return i(),e;if(null===b);else{if(null!==b&&"undefined"==typeof f.idle)return!1;if("destroy"===b)return l(),e;if("pause"===b)return j(),e;if("resume"===b)return k(),e;if("reset"===b)return i(),e;if("getRemainingTime"===b)return m();if("getElapsedTime"===b)return+new Date-f.olddate;if("getLastActiveTime"===b)return f.lastActive;if("isIdle"===b)return f.idle}return e.on(a.trim((d.events+" ").split(" ").join("._idleTimer ")),function(a){h(a)}),d.timerSyncId&&a(window).bind("storage",h),f=a.extend({},{olddate:+new Date,lastActive:+new Date,idle:d.idle,idleBackup:d.idle,timeout:d.timeout,remaining:null,timerSyncId:d.timerSyncId,tId:null,pageX:null,pageY:null}),f.idle||(f.tId=setTimeout(g,f.timeout)),a.data(c,"idleTimerObj",f),e},a.fn.idleTimer=function(b){return this[0]?a.idleTimer(b,this[0]):this}}(jQuery); 44070/*! 44071 * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/) 44072 * Copyright (c) 2016 Edson Hilios 44073 * 44074 * Permission is hereby granted, free of charge, to any person obtaining a copy of 44075 * this software and associated documentation files (the "Software"), to deal in 44076 * the Software without restriction, including without limitation the rights to 44077 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 44078 * the Software, and to permit persons to whom the Software is furnished to do so, 44079 * subject to the following conditions: 44080 * 44081 * The above copyright notice and this permission notice shall be included in all 44082 * copies or substantial portions of the Software. 44083 * 44084 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44085 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 44086 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 44087 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 44088 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 44089 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 44090 */ 44091!function(a){;"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){;function b(a){if(a instanceof Date)return a;
vendor: 5,425 bytes, lines 44091-44134
44091if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}}); 44092/*! rangeslider.js - v2.2.1 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */ 44093(function(factory) { 44094 'use strict'; 44095 44096 if (typeof define === 'function' && define.amd) { 44097 // AMD. Register as an anonymous module. 44098 define(['jquery'], factory); 44099 } else if (typeof exports === 'object') { 44100 // CommonJS 44101 module.exports = factory(require('jquery')); 44102 } else { 44103 // Browser globals 44104 /* Not working with Tennis Davis Cup, because multiple jQuery Version are loaded on the same page */ 44105 //factory(jQuery); 44106 factory($); 44107 } 44108}(function($) { 44109 'use strict'; 44110 44111 // Polyfill Number.isNaN(value) 44112 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN 44113 Number.isNaN = Number.isNaN || function(value) { 44114 return typeof value === 'number' && value !== value; 44115 }; 44116 44117 /** 44118 * Range feature detection 44119 * @return {Boolean} 44120 */ 44121 function supportsRange() { 44122 var input = document.createElement('input'); 44123 input.setAttribute('type', 'range'); 44124 return input.type !== 'text'; 44125 } 44126 44127 var pluginName = 'rangeslider', 44128 pluginIdentifier = 0, 44129 hasInputRangeSupport = supportsRange(), 44130 defaults = { 44131 polyfill: true, 44132 orientation: 'horizontal', 44133 rangeClass: 'rangeslider', 44134 disabledClass: 'rangeslider--disabled',
vendor: 6,130 bytes, lines 44135-44317
44135 horizontalClass: 'rangeslider--horizontal', 44136 verticalClass: 'rangeslider--vertical', 44137 fillClass: 'rangeslider__fill', 44138 handleClass: 'rangeslider__handle', 44139 startEvent: ['mousedown', 'touchstart', 'pointerdown'], 44140 moveEvent: ['mousemove', 'touchmove', 'pointermove'], 44141 endEvent: ['mouseup', 'touchend', 'pointerup'] 44142 }, 44143 constants = { 44144 orientation: { 44145 horizontal: { 44146 dimension: 'width', 44147 direction: 'left', 44148 directionStyle: 'left', 44149 coordinate: 'x' 44150 }, 44151 vertical: { 44152 dimension: 'height', 44153 direction: 'top', 44154 directionStyle: 'bottom', 44155 coordinate: 'y' 44156 } 44157 } 44158 }; 44159 44160 /** 44161 * Delays a function for the given number of milliseconds, and then calls 44162 * it with the arguments supplied. 44163 * 44164 * @param {Function} fn [description] 44165 * @param {Number} wait [description] 44166 * @return {Function} 44167 */ 44168 function delay(fn, wait) { 44169 var args = Array.prototype.slice.call(arguments, 2); 44170 return setTimeout(function(){ return fn.apply(null, args); }, wait); 44171 } 44172 44173 /** 44174 * Returns a debounced function that will make sure the given 44175 * function is not triggered too much. 44176 * 44177 * @param {Function} fn Function to debounce. 44178 * @param {Number} debounceDuration OPTIONAL. The amount of time in milliseconds for which we will debounce the function. (defaults to 100ms) 44179 * @return {Function} 44180 */ 44181 function debounce(fn, debounceDuration) { 44182 debounceDuration = debounceDuration || 100; 44183 return function() { 44184 if (!fn.debouncing) { 44185 var args = Array.prototype.slice.apply(arguments); 44186 fn.lastReturnVal = fn.apply(window, args); 44187 fn.debouncing = true; 44188 } 44189 clearTimeout(fn.debounceTimeout); 44190 fn.debounceTimeout = setTimeout(function(){ 44191 fn.debouncing = false; 44192 }, debounceDuration); 44193 return fn.lastReturnVal; 44194 }; 44195 } 44196 44197 /** 44198 * Check if a `element` is visible in the DOM 44199 * 44200 * @param {Element} element 44201 * @return {Boolean} 44202 */ 44203 function isHidden(element) { 44204 return ( 44205 element && ( 44206 element.offsetWidth === 0 || 44207 element.offsetHeight === 0 || 44208 // Also Consider native `<details>` elements. 44209 element.open === false 44210 ) 44211 ); 44212 } 44213 44214 /** 44215 * Get hidden parentNodes of an `element` 44216 * 44217 * @param {Element} element 44218 * @return {[type]} 44219 */ 44220 function getHiddenParentNodes(element) { 44221 var parents = [], 44222 node = element.parentNode; 44223 44224 while (isHidden(node)) { 44225 parents.push(node); 44226 node = node.parentNode; 44227 } 44228 return parents; 44229 } 44230 44231 /** 44232 * Returns dimensions for an element even if it is not visible in the DOM. 44233 * 44234 * @param {Element} element 44235 * @param {String} key (e.g. offsetWidth â¦) 44236 * @return {Number} 44237 */ 44238 function getDimension(element, key) { 44239 var hiddenParentNodes = getHiddenParentNodes(element), 44240 hiddenParentNodesLength = hiddenParentNodes.length, 44241 inlineStyle = [], 44242 dimension = element[key]; 44243 44244 // Used for native `<details>` elements 44245 function toggleOpenProperty(element) { 44246 if (typeof element.open !== 'undefined') { 44247 element.open = (element.open) ? false : true; 44248 } 44249 } 44250 44251 if (hiddenParentNodesLength) { 44252 for (var i = 0; i < hiddenParentNodesLength; i++) { 44253 44254 // Cache style attribute to restore it later. 44255 inlineStyle[i] = hiddenParentNodes[i].style.cssText; 44256 44257 // visually hide 44258 if (hiddenParentNodes[i].style.setProperty) { 44259 hiddenParentNodes[i].style.setProperty('display', 'block', 'important'); 44260 } else { 44261 hiddenParentNodes[i].style.cssText += ';display: block !important'; 44262 } 44263 hiddenParentNodes[i].style.height = '0'; 44264 hiddenParentNodes[i].style.overflow = 'hidden'; 44265 hiddenParentNodes[i].style.visibility = 'hidden'; 44266 toggleOpenProperty(hiddenParentNodes[i]); 44267 } 44268 44269 // Update dimension 44270 dimension = element[key]; 44271 44272 for (var j = 0; j < hiddenParentNodesLength; j++) { 44273 44274 // Restore the style attribute 44275 hiddenParentNodes[j].style.cssText = inlineStyle[j]; 44276 toggleOpenProperty(hiddenParentNodes[j]); 44277 } 44278 } 44279 return dimension; 44280 } 44281 44282 /** 44283 * Returns the parsed float or the default if it failed. 44284 * 44285 * @param {String} str 44286 * @param {Number} defaultValue 44287 * @return {Number} 44288 */ 44289 function tryParseFloat(str, defaultValue) { 44290 var value = parseFloat(str); 44291 return Number.isNaN(value) ? defaultValue : value; 44292 } 44293 44294 /** 44295 * Capitalize the first letter of string 44296 * 44297 * @param {String} str 44298 * @return {String} 44299 */ 44300 function ucfirst(str) { 44301 return str.charAt(0).toUpperCase() + str.substr(1); 44302 } 44303 44304 /** 44305 * Plugin 44306 * @param {String} element 44307 * @param {Object} options 44308 */ 44309 function Plugin(element, options) { 44310 this.$window = $(window); 44311 this.$document = $(document); 44312 this.$element = $(element); 44313 this.options = $.extend( {}, defaults, options ); 44314 this.polyfill = this.options.polyfill; 44315 this.orientation = this.$element[0].getAttribute('data-orientation') || this.options.orientation; 44316 this.onInit = this.options.onInit; 44317 this.onSlide = this.options.onSlide;
44318 this.onSlideEnd = this.options.onSlideEnd; 44319 this.DIMENSION = constants.orientation[this.orientation].dimension; 44320 this.DIRECTION = constants.orientation[this.orientation].direction; 44321 this.DIRECTION_STYLE = constants.orientation[this.orientation].directionStyle; 44322 this.COORDINATE = constants.orientation[this.orientation].coordinate; 44323 44324 // Plugin should only be used as a polyfill 44325 if (this.polyfill) { 44326 // Input range support? 44327 if (hasInputRangeSupport) { return false; } 44328 } 44329 44330 this.identifier = 'js-' + pluginName + '-' +(pluginIdentifier++); 44331 this.startEvent = this.options.startEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 44332 this.moveEvent = this.options.moveEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 44333 this.endEvent = this.options.endEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 44334 this.toFixed = (this.step + '').replace('.', '').length - 1; 44335 this.$fill = $('<div class="' + this.options.fillClass + '" />'); 44336 this.$handle = $('<div class="' + this.options.handleClass + '" />'); 44337 this.$range = $('<div class="' + this.options.rangeClass + ' ' + this.options[this.orientation + 'Class'] + '" id="' + this.identifier + '" />').insertAfter(this.$element).prepend(this.$fill, this.$handle); 44338 44339 // visually hide the input 44340 this.$element.css({ 44341 'position': 'absolute', 44342 'width': '1px', 44343 'height': '1px', 44344 'overflow': 'hidden', 44345 'opacity': '0' 44346 }); 44347 44348 // Store context 44349 this.handleDown = $.proxy(this.handleDown, this); 44350 this.handleMove = $.proxy(this.handleMove, this); 44351 this.handleEnd = $.proxy(this.handleEnd, this); 44352 44353 this.init(); 44354 44355 // Attach Events 44356 var _this = this; 44357 this.$window.on('resize.' + this.identifier, debounce(function() { 44358 // Simulate resizeEnd event. 44359 delay(function() { _this.update(false, false); }, 300); 44360 }, 20)); 44361 44362 this.$document.on(this.startEvent, '#' + this.identifier + ':not(.' + this.options.disabledClass + ')', this.handleDown); 44363 44364 // Listen to programmatic value changes 44365 this.$element.on('change.' + this.identifier, function(e, data) { 44366 if (data && data.origin === _this.identifier) { 44367 return; 44368 } 44369 44370 var value = e.target.value, 44371 pos = _this.getPositionFromValue(value); 44372 _this.setPosition(pos); 44373 }); 44374 } 44375 44376 Plugin.prototype.init = function() { 44377 this.update(true, false); 44378 44379 if (this.onInit && typeof this.onInit === 'function') { 44380 this.onInit(); 44381 } 44382 }; 44383 44384 Plugin.prototype.update = function(updateAttributes, triggerSlide) { 44385 updateAttributes = updateAttributes || false; 44386 44387 if (updateAttributes) { 44388 this.min = tryParseFloat(this.$element[0].getAttribute('min'), 0); 44389 this.max = tryParseFloat(this.$element[0].getAttribute('max'), 100); 44390 this.value = tryParseFloat(this.$element[0].value, Math.round(this.min + (this.max-this.min)/2)); 44391 this.step = tryParseFloat(this.$element[0].getAttribute('step'), 1); 44392 } 44393 44394 this.handleDimension = getDimension(this.$handle[0], 'offset' + ucfirst(this.DIMENSION)); 44395 this.rangeDimension = getDimension(this.$range[0], 'offset' + ucfirst(this.DIMENSION)); 44396 this.maxHandlePos = this.rangeDimension - this.handleDimension; 44397 this.grabPos = this.handleDimension / 2; 44398 this.position = this.getPositionFromValue(this.value); 44399 44400 // Consider disabled state 44401 if (this.$element[0].disabled) { 44402 this.$range.addClass(this.options.disabledClass); 44403 } else { 44404 this.$range.removeClass(this.options.disabledClass); 44405 } 44406 44407 this.setPosition(this.position, triggerSlide); 44408 }; 44409 44410 Plugin.prototype.handleDown = function(e) { 44411 var self = this; 44412 var volumeContainer = $(this.$element).parent().parent(); 44413 44414 volumeContainer.on('mouseleave', function() { 44415 removeHandler(self); 44416 }); 44417 44418 this.$document.on(this.moveEvent, this.handleMove); 44419 this.$document.on(this.endEvent, this.handleEnd); 44420 44421 // If we click on the handle don't set the new position 44422 if ((' ' + e.target.className + ' ').replace(/[\n\t]/g, ' ').indexOf(this.options.handleClass) > -1) { 44423 return; 44424 } 44425 44426 var pos = this.getRelativePosition(e), 44427 rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION], 44428 handlePos = this.getPositionFromNode(this.$handle[0]) - rangePos, 44429 setPos = (this.orientation === 'vertical') ? (this.maxHandlePos - (pos - this.grabPos)) : (pos - this.grabPos); 44430 44431 this.setPosition(setPos); 44432 44433 if (pos >= handlePos && pos < handlePos + this.handleDimension) { 44434 this.grabPos = pos - handlePos; 44435 } 44436 44437 function removeHandler(self) { 44438 self.$document.off(self.moveEvent, self.handleMove); 44439 self.$document.off(self.endEvent, self.handleEnd); 44440 self.$document.off('mouseleave'); 44441 } 44442 }; 44443 44444 Plugin.prototype.handleMove = function(e) { 44445 e.preventDefault(); 44446 var pos = this.getRelativePosition(e); 44447 var setPos = (this.orientation === 'vertical') ? (this.maxHandlePos - (pos - this.grabPos)) : (pos - this.grabPos); 44448 this.setPosition(setPos); 44449 }; 44450 44451 Plugin.prototype.handleEnd = function(e) { 44452 e.preventDefault(); 44453 this.$document.off(this.moveEvent, this.handleMove); 44454 this.$document.off(this.endEvent, this.handleEnd); 44455 44456 // Ok we're done fire the change event 44457 this.$element.trigger('change', { origin: this.identifier }); 44458 44459 if (this.onSlideEnd && typeof this.onSlideEnd === 'function') { 44460 this.onSlideEnd(this.position, this.value); 44461 } 44462 }; 44463 44464 Plugin.prototype.cap = function(pos, min, max) { 44465 if (pos < min) { return min; } 44466 if (pos > max) { return max; } 44467 return pos; 44468 }; 44469 44470 Plugin.prototype.setPosition = function(pos, triggerSlide) { 44471 var value, newPos; 44472 44473 if (triggerSlide === undefined) { 44474 triggerSlide = true; 44475 } 44476 44477 // Snapping steps 44478 value = this.getValueFromPosition(this.cap(pos, 0, this.maxHandlePos)); 44479 newPos = this.getPositionFromValue(value); 44480 44481 // Update ui 44482 this.$fill[0].style[this.DIMENSION] = (newPos + this.grabPos) + 'px'; 44483 this.$handle[0].style[this.DIRECTION_STYLE] = newPos + 'px'; 44484 this.setValue(value); 44485 44486 // Update globals 44487 this.position = newPos; 44488 this.value = value; 44489 44490 44491 if (triggerSlide && this.onSlide && typeof this.onSlide === 'function') { 44492 this.onSlide(newPos, value); 44493 } 44494 }; 44495 44496 // Returns element position relative to the parent 44497 Plugin.prototype.getPositionFromNode = function(node) { 44498 var i = 0; 44499 while (node !== null) { 44500 i += node.offsetLeft; 44501 node = node.offsetParent; 44502 } 44503 return i; 44504 }; 44505 44506 Plugin.prototype.getRelativePosition = function(e) { 44507 // Get the offset DIRECTION relative to the viewport 44508 var ucCoordinate = ucfirst(this.COORDINATE), 44509 rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION], 44510 pageCoordinate = 0; 44511 44512 //changed page to client 44513 44514 if (typeof e['client' + ucCoordinate] !== 'undefined') { 44515 pageCoordinate = e['client' + ucCoordinate]; 44516 } 44517 // IE8 support :) 44518 else if (typeof e.originalEvent['client' + ucCoordinate] !== 'undefined') { 44519 pageCoordinate = e.originalEvent['client' + ucCoordinate]; 44520 } 44521 else if (e.originalEvent.touches && e.originalEvent.touches[0] && typeof e.originalEvent.touches[0]['page' + ucCoordinate] !== 'undefined') { 44522 pageCoordinate = e.originalEvent.touches[0]['page' + ucCoordinate]; 44523 } 44524 else if(e.currentPoint && typeof e.currentPoint[this.COORDINATE] !== 'undefined') { 44525 pageCoordinate = e.currentPoint[this.COORDINATE]; 44526 } 44527 44528 return pageCoordinate - rangePos; 44529 }; 44530 44531 Plugin.prototype.getPositionFromValue = function(value) { 44532 var percentage, pos; 44533 percentage = (value - this.min)/(this.max - this.min); 44534 pos = (!Number.isNaN(percentage)) ? percentage * this.maxHandlePos : 0; 44535 return pos; 44536 }; 44537 44538 Plugin.prototype.getValueFromPosition = function(pos) { 44539 var percentage, value; 44540 44541 percentage = ((pos) / (this.maxHandlePos || 1)); 44542 44543 44544 44545 value = this.step * Math.round(percentage * (this.max - this.min) / this.step) + this.min; 44546 return Number((value).toFixed(this.toFixed)); 44547 }; 44548 44549 Plugin.prototype.setValue = function(value) { 44550 if (value === this.value && this.$element[0].value !== '') { 44551 return; 44552 } 44553 44554 // Set the new value and fire the `input` event 44555 this.$element 44556 .val(value) 44557 .trigger('input', { origin: this.identifier }); 44558 }; 44559 44560 Plugin.prototype.destroy = function() { 44561 this.$document.off('.' + this.identifier); 44562 this.$window.off('.' + this.identifier); 44563 44564 this.$element 44565 .off('.' + this.identifier) 44566 .removeAttr('style') 44567 .removeData('plugin_' + pluginName); 44568 44569 // Remove the generated markup 44570 if (this.$range && this.$range.length) { 44571 this.$range[0].parentNode.removeChild(this.$range[0]); 44572 } 44573 }; 44574 44575 // A really lightweight plugin wrapper around the constructor, 44576 // preventing against multiple instantiations 44577 $.fn[pluginName] = function(options) { 44578 var args = Array.prototype.slice.call(arguments, 1); 44579 44580 return this.each(function() { 44581 var $this = $(this), 44582 data = $this.data('plugin_' + pluginName); 44583 44584 // Create a new instance. 44585 if (!data) { 44586 $this.data('plugin_' + pluginName, (data = new Plugin(this, options))); 44587 } 44588 44589 // Make it possible to access methods from public. 44590 // e.g `$element.rangeslider('method');` 44591 if (typeof options === 'string') { 44592 data[options].apply(data, args); 44593 } 44594 }); 44595 }; 44596 44597 return 'rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);'; 44598 44599})); 44600 44601/** 44602 * Copyright Marc J. Schmidt. See the LICENSE file at the top-level 44603 * directory of this distribution and at 44604 * https://github.com/marcj/css-element-queries/blob/master/LICENSE. 44605 */ 44606; 44607(function (root, factory) { 44608 if (typeof define === "function" && define.amd) { 44609 define(factory); 44610 } else if (typeof exports === "object") { 44611 module.exports = factory(); 44612 } else { 44613 root.ResizeSensor = factory(); 44614 } 44615}(this, function () { 44616 44617 // Make sure it does not throw in a SSR (Server Side Rendering) situation 44618 if (typeof window === "undefined") { 44619 return null; 44620 } 44621 // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor. 44622 // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and 44623 // would generate too many unnecessary events. 44624 var requestAnimationFrame = window.requestAnimationFrame || 44625 window.mozRequestAnimationFrame || 44626 window.webkitRequestAnimationFrame || 44627 function (fn) { 44628 return window.setTimeout(fn, 20); 44629 }; 44630 44631 /** 44632 * Iterate over each of the provided element(s). 44633 * 44634 * @param {HTMLElement|HTMLElement[]} elements 44635 * @param {Function} callback 44636 */ 44637 function forEachElement(elements, callback){ 44638 var elementsType = Object.prototype.toString.call(elements); 44639 var isCollectionTyped = ('[object Array]' === elementsType 44640 || ('[object NodeList]' === elementsType) 44641 || ('[object HTMLCollection]' === elementsType) 44642 || ('[object Object]' === elementsType) 44643 || ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery 44644 || ('undefined' !== typeof Elements && elements instanceof Elements) //mootools 44645 ); 44646 var i = 0, j = elements.length; 44647 if (isCollectionTyped) { 44648 for (; i < j; i++) { 44649 callback(elements[i]); 44650 } 44651 } else { 44652 callback(elements); 44653 } 44654 } 44655 44656 /** 44657 * Class for dimension change detection. 44658 * 44659 * @param {Element|Element[]|Elements|jQuery} element 44660 * @param {Function} callback 44661 * 44662 * @constructor 44663 */ 44664 var ResizeSensor = function(element, callback) { 44665 /** 44666 * 44667 * @constructor 44668 */ 44669 function EventQueue() { 44670 var q = []; 44671 this.add = function(ev) { 44672 q.push(ev); 44673 }; 44674 44675 var i, j; 44676 this.call = function() { 44677 for (i = 0, j = q.length; i < j; i++) { 44678 q[i].call(); 44679 } 44680 }; 44681 44682 this.remove = function(ev) { 44683 var newQueue = []; 44684 for(i = 0, j = q.length; i < j; i++) { 44685 if(q[i] !== ev) newQueue.push(q[i]); 44686 } 44687 q = newQueue; 44688 } 44689 44690 this.length = function() { 44691 return q.length; 44692 } 44693 } 44694 44695 /** 44696 * @param {HTMLElement} element 44697 * @param {String} prop 44698 * @returns {String|Number} 44699 */ 44700 function getComputedStyle(element, prop) { 44701 if (element.currentStyle) { 44702 return element.currentStyle[prop]; 44703 } 44704 if (window.getComputedStyle) { 44705 return window.getComputedStyle(element, null).getPropertyValue(prop); 44706 } 44707 44708 return element.style[prop]; 44709 } 44710 44711 /** 44712 * 44713 * @param {HTMLElement} element 44714 * @param {Function} resized 44715 */ 44716 function attachResizeEvent(element, resized) { 44717 if (element.resizedAttached) { 44718 element.resizedAttached.add(resized); 44719 return; 44720 } 44721 44722 element.resizedAttached = new EventQueue(); 44723 element.resizedAttached.add(resized); 44724 44725 element.resizeSensor = document.createElement('div'); 44726 element.resizeSensor.className = 'resize-sensor'; 44727 var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;'; 44728 var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;'; 44729 44730 element.resizeSensor.style.cssText = style; 44731 element.resizeSensor.innerHTML = 44732 '<div class="resize-sensor-expand" style="' + style + '">' + 44733 '<div style="' + styleChild + '"></div>' + 44734 '</div>' + 44735 '<div class="resize-sensor-shrink" style="' + style + '">' + 44736 '<div style="' + styleChild + ' width: 200%; height: 200%"></div>' + 44737 '</div>'; 44738 element.appendChild(element.resizeSensor); 44739 44740 if (getComputedStyle(element, 'position') == 'static') { 44741 element.style.position = 'relative'; 44742 } 44743 44744 var expand = element.resizeSensor.childNodes[0]; 44745 var expandChild = expand.childNodes[0]; 44746 var shrink = element.resizeSensor.childNodes[1]; 44747 var dirty, rafId, newWidth, newHeight; 44748 var lastWidth = element.offsetWidth; 44749 var lastHeight = element.offsetHeight; 44750 44751 var reset = function() { 44752 expandChild.style.width = '100000px'; 44753 expandChild.style.height = '100000px'; 44754 44755 expand.scrollLeft = 100000; 44756 expand.scrollTop = 100000; 44757 44758 shrink.scrollLeft = 100000; 44759 shrink.scrollTop = 100000; 44760 }; 44761 44762 reset(); 44763 44764 var onResized = function() { 44765 rafId = 0; 44766 44767 if (!dirty) return; 44768 44769
44769 lastWidth = newWidth; 44770 lastHeight = newHeight; 44771 44772 if (element.resizedAttached) { 44773 element.resizedAttached.call(); 44774 } 44775 }; 44776 44777 var onScroll = function() { 44778 newWidth = element.offsetWidth; 44779 newHeight = element.offsetHeight; 44780 dirty = newWidth != lastWidth || newHeight != lastHeight; 44781 44782 if (dirty && !rafId) { 44783 rafId = requestAnimationFrame(onResized); 44784 } 44785 44786 reset(); 44787 }; 44788 44789 var addEvent = function(el, name, cb) { 44790 if (el.attachEvent) { 44791 el.attachEvent('on' + name, cb); 44792 } else { 44793 el.addEventListener(name, cb); 44794 } 44795 }; 44796 44797 addEvent(expand, 'scroll', onScroll); 44798 addEvent(shrink, 'scroll', onScroll); 44799 } 44800 44801 forEachElement(element, function(elem){ 44802 attachResizeEvent(elem, callback); 44803 }); 44804 44805 this.detach = function(ev) { 44806 ResizeSensor.detach(element, ev); 44807 }; 44808 }; 44809 44810 ResizeSensor.detach = function(element, ev) { 44811 forEachElement(element, function(elem){ 44812 if(elem.resizedAttached && typeof ev == "function"){ 44813 elem.resizedAttached.remove(ev); 44814 if(elem.resizedAttached.length()) return; 44815 } 44816 if (elem.resizeSensor) { 44817 if (elem.contains(elem.resizeSensor)) { 44818 elem.removeChild(elem.resizeSensor); 44819 } 44820 delete elem.resizeSensor; 44821 delete elem.resizedAttached; 44822 } 44823 }); 44824 }; 44825 44826 return ResizeSensor; 44827 44828})); 44829 44830(function () { 44831 44832 this.L1Ads = function (playerMain) { 44833 44834 this.playerMain = playerMain; 44835 this.container = playerMain.subPlayerContainer; 44836 this.videoElement = null; 44837 44838 this.adPlaylist = []; 44839 this.adPlaylistName = ""; 44840 this.actualAd = 0; 44841 44842 this.linearAdIsPlaying = false; 44843 this.controlsIsVisible = false; 44844 44845 this.adsLoader = null; 44846 this.adsManager = null; 44847 /* 44848 this.seeked = false; 44849 this.currentPosition = 0; 44850 this.seekedPosition = null; 44851 */ 44852 this.adPlaying = false; 44853 this.settings = null; 44854 this.interval = null; 44855 this.volume = 100; 44856 44857 this.isSplitScreen = false; 44858 44859 this.checkTime = null; 44860 this.schleifeSecondsStartTime = null; 44861 this.schleifeAvailable = false; 44862 this.schleifeCount = -1; 44863 }; 44864 44865 // ------------------------------- PLAYER MAIN FUNKTIONEN ------------------------------- 44866 44867 L1Ads.prototype.init = function(hdVideo) { 44868 var self = this; 44869 44870 this.settings = hdVideo; 44871 44872 this.videoElement = this.container.querySelector("#l1pVideoHtml5Element"); 44873 this.adContainer = this.container.querySelector("#l1pAdContainer"); 44874 this.skipAdButton(); 44875 44876 this.videoElement.load(); 44877 //this.videoElement.addEventListener('ended', this.contentEndedListener); 44878 this.setCountdownTimer(); 44879 44880 44881 if (typeof google == 'undefined') { 44882 addIMA(); 44883 44884 setTimeout(function() { 44885 if(typeof google != 'undefined') { 44886 self.setupIMA(); 44887 } 44888 }, 100); 44889 44890 } else { 44891 self.setupIMA(); 44892 } 44893 44894 function addIMA() { 44895 var script = document.createElement('script'); 44896 script.type = "text/javascript"; 44897 script.src = "//imasdk.googleapis.com/js/sdkloader/ima3.js"; 44898 44899 var scriptExists = detectScript(script.src); 44900 44901 if(!scriptExists) { 44902 //return document.getElementsByTagName('head')[0].appendChild(script); 44903 try { 44904 return document.getElementsByTagName('head')[0].appendChild(script); 44905 } catch(e) { 44906 console.log('ima script not added'); 44907 } 44908 } 44909 } 44910 44911 function detectScript(url) { 44912 var scripts = document.getElementsByTagName('script'); 44913 for (var i = scripts.length; i--;) { 44914 if (scripts[i].src == url) return true; 44915 } 44916 return false;
44917 } 44918 44919 }; 44920 44921 L1Ads.prototype.setupIMA = function() { 44922 var adDisplayContainer = new google.ima.AdDisplayContainer(this.adContainer, this.videoElement); 44923 // Must be done as the result of a user action on mobile 44924 adDisplayContainer.initialize(); 44925 // Re-use this AdsLoader instance for the entire lifecycle of your page 44926 this.adsLoader = new google.ima.AdsLoader(adDisplayContainer); 44927 this.adsLoader.getSettings().setNumRedirects(6); 44928 // Add event listeners 44929 this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded, false, this); 44930 this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError, false, this); 44931 }; 44932 44933 L1Ads.prototype.setCountdownTimer = function() { 44934 var language = this.playerMain.getLanguage(); 44935 44936 var text = document.getElementById("l1pUIAdText"); 44937 var playPauseBtn = document.getElementById("l1pUIControlsAdButtonPlayPause"); 44938 var skipBtn = document.getElementById("l1pUIControlsAdButtonSkip"); 44939 44940 if(language) { 44941 text.innerHTML = language.commercial; 44942 text.innerHTML = text.innerHTML.replace('(-[time])', ''); 44943 playPauseBtn.innerHTML = language['pause_ad']; 44944 skipBtn.innerHTML = language['skip_ad']; 44945 } 44946 }; 44947 44948 L1Ads.prototype.changeCountdownTimer = function() { 44949 var self = this; 44950 var textValue = null; 44951 var language = this.playerMain.getLanguage(); 44952 44953 var text = document.getElementById("l1pUIAdText"); 44954 44955 if(language) { 44956 textValue = language.commercial; 44957 } else { 44958 textValue = 'Advertisement, action starts soon (-[time])'; 44959 } 44960 44961 var interval = setInterval(function() { 44962 var remainingTime = Number(self.adsManager.getRemainingTime().toFixed(0)); 44963 44964 if(self.linearAdIsPlaying === false) { text.innerHTML = textValue; clearInterval(interval); } 44965 44966 text.innerHTML = textValue; 44967 text.innerHTML = text.innerHTML.replace("[time]", remainingTime); 44968 44969 }, 500); 44970 }; 44971 44972 L1Ads.prototype.showAds = function(isLinear) { 44973 //console.log('show Ads', this); 44974 $(this.container).find("#l1pAdContainer").removeClass().addClass( "l1pShow" ); 44975 //this.adContainer.classList.add( "l1pShow" ); 44976 44977 if(this.isSplitScreen) { 44978 return; 44979 } 44980 44981 if(isLinear) { 44982 var ui = $('#l1pUI'); 44983 ui.find("#l1pUIAdCommercial").removeClass().addClass( "l1pShow" ); 44984 ui.find("#l1pUIAd").removeClass().addClass("l1pShow"); 44985 44986 $(this.container).find("#l1pUIPopUpsUserClickArea").removeClass().addClass("l1pHide"); 44987 44988 if (this.playerMain.player.playerConfig.adPause == 'true') { 44989 ui.find("#l1pUIControlsAdButtonPlayPause").removeClass("l1pHide").addClass("l1pShow"); 44990 } 44991 if(this.settings && this.settings.werbung && this.settings.werbung.skipad) { 44992 if (this.settings.werbung.skipad == 'true') { 44993 if (this.adsManager.getRemainingTime() >= this.settings.werbung.skipadtimer) { 44994 //var sec = this.settings.werbung.skipadtimer * 100; 44995 var sec = this.settings.werbung.skipadtimer * 1000; 44996 setTimeout(function () { 44997 ui.find('#l1pUIControlsAdButtonSkip').removeClass("l1pHide").addClass("l1pShow"); 44998 }, sec); 44999 } 45000 } 45001 } 45002 } 45003 }; 45004 45005 L1Ads.prototype.hideAds = function() { 45006 this.isSplitScreen = false; 45007 this.resizePlayer(); 45008 45009 var ui = $('#l1pUI'); 45010 ui.find("#l1pUIAdCommercial").removeClass().addClass( "l1pHide" ); 45011 ui.find("#l1pUIAd").removeClass().addClass( "l1pHide" ); 45012 45013 $(this.container).find("#l1pAdContainer").removeClass().addClass( "l1pHide" ); 45014 $(this.container).find("#l1pUIPopUpsUserClickArea").removeClass().addClass( "l1pShow" ); 45015 45016 if( this.playerMain.player.playerConfig.adPause == 'true') {
45017 ui.find("#l1pUIControlsAdButtonPlayPause").removeClass("l1pShow").addClass("l1pHide"); 45018 } 45019 45020 if(this.settings && this.settings.werbung && this.settings.werbung.skipad) { 45021 if (this.settings.werbung.skipad == 'true') { 45022 ui.find('#l1pUIControlsAdButtonSkip').removeClass("l1pShow").addClass("l1pHide"); 45023 } 45024 } 45025 45026 }; 45027 45028 L1Ads.prototype.showSkipButton = function(container) { 45029 $(container).find('#l1pUIControlsAdButtonSkip').removeClass("l1pHide").addClass("l1pShow"); 45030 }; 45031 45032 L1Ads.prototype.clickPausePlayButton = function(evt) { 45033 var language = this.playerMain.getLanguage(); 45034 if(!language) { 45035 language = { "play_ad" : "Play Ad", "pause_ad" : "Pause Ad"}; 45036 } 45037 45038 var self = this; 45039 if(this.adPlaying) { $("#l1pUIControlsAdButtonPlayPause").html(language['pause_ad']); } 45040 45041 $("#l1pUIControlsAdButtonPlayPause").on('click', function() { 45042 if(self.adPlaying) { 45043 $(this).html(language['play_ad']); 45044 self.adsManager.pause(); 45045 } else { 45046 $(this).html(language['pause_ad']); 45047 self.adsManager.resume(); 45048 } 45049 }); 45050 }; 45051 45052 L1Ads.prototype.skipAdButton = function(evt) { 45053 var self = this; 45054 $("#l1pUIControlsAdButtonSkip").on('click', function() { 45055 clearInterval(self.interval); 45056 self.linearAdIsPlaying = false; 45057 self.setVolume(self.volume); 45058 self.playNextAd(); 45059 }); 45060 }; 45061 45062 L1Ads.prototype.setVolume = function(vol) { 45063 return this.playerMain.videoInterface.setVolume(vol); 45064 }; 45065 45066 L1Ads.prototype.startPrerolls = function(prerolls) { 45067 this.adPlaylist = prerolls; 45068 45069 if (typeof google != 'undefined') { 45070 //console.log("START PREROLLS!"); 45071 this.playAdFromPlaylist("prerolls", 0); 45072 } else { 45073 this.playerMain.adsPrerollComplete(); 45074 } 45075 }; 45076 45077 L1Ads.prototype.startMidrolls = function(midrolls) { 45078 this.adPlaylist = midrolls; 45079 45080 if (typeof google != 'undefined') { 45081 this.playAdFromPlaylist("midrolls", 0); 45082 } else { 45083 this.playerMain.adsMidrollComplete(); 45084 } 45085 }; 45086 45087 L1Ads.prototype.checkInVideos = function(inVideos, currentTime, duration) { 45088 var roundCurrentTime = Math.round(currentTime); 45089 45090 //this.adPlaylistName = "invideos"; 45091 if (this.playerMain.player.playerConfig.deviceInfo.isIOS) { 45092 return; 45093 } 45094 45095 for(var count = 0; count < inVideos.length; count++) { 45096 if(inVideos[count].schleife === true && !this.schleifeAvailable) { 45097 this.schleifeAvailable = true; 45098 this.schleifeSecondsStartTime = inVideos[count].time; 45099 } 45100 } 45101 45102 if (typeof google != 'undefined' && inVideos && inVideos.length > 0) { 45103 //console.log(currentTime, times, currentTime % this.schleifeSecondsStartTime == 0); 45104 45105 if(this.checkTime != currentTime && currentTime % this.schleifeSecondsStartTime == 0) { 45106 this.schleifeCount++; 45107 //console.log('schleife++', this.schleifeCount); 45108 } 45109 this.checkTime = currentTime; 45110 45111 for (var index = 0; index < inVideos.length; index++) { 45112 var inVideosIndex = inVideos[index]; 45113 45114 //console.log('schleifeCount > 0: ', this.schleifeCount > 0, currentTime == Number( (this.schleifeCount * this.schleifeSecondsStartTime) + (Number(inVideosIndex.time) - this.schleifeSecondsStartTime) ) ); 45115 /* 45116 if (inVideosIndex.time == roundCurrentTime) { 45117 this.actualAd = index; 45118 if (this.countPlayedInVideos != roundCurrentTime) { 45119 if (this.playerMain.player.playerConfig.deviceInfo.isIOS) { return; } 45120 45121 if (inVideosIndex.id === "splitt") { 45122 if (this.playerMain.player.playerConfig.deviceInfo.isMobile === true) { 45123 return; 45124 } 45125 this.isSplitScreen = true; 45126 } 45127 45128 this.countPlayedInVideos = roundCurrentTime; 45129 this.adPlaylist = inVideos; 45130 45131 this.adPlaylistName = "invideos"; 45132 this.playAdFromPlaylist("invideos", index); 45133 } 45134 }*/ 45135 45136 if(this.schleifeCount > 0) { 45137 //console.log(currentTime, Number((this.schleifeCount * this.schleifeSecondsStartTime) + (Number(inVideosIndex.time) - this.schleifeSecondsStartTime))); 45138 if(currentTime == Number((this.schleifeCount * this.schleifeSecondsStartTime) + (Number(inVideosIndex.time) - this.schleifeSecondsStartTime))) { 45139 //console.log('repeat'); 45140 45141 this.actualAd = index; 45142 if (this.countPlayedInVideos != roundCurrentTime) { 45143 45144 this.countPlayedInVideos = roundCurrentTime; 45145 this.adPlaylist = inVideos; 45146 45147 this.adPlaylistName = "invideos"; 45148 this.playAdFromPlaylist("invideos", index); 45149 } 45150 45151 } 45152 } else { 45153 if (inVideosIndex.time == roundCurrentTime) { 45154 this.actualAd = index; 45155 if (this.countPlayedInVideos != roundCurrentTime) { 45156 if (this.playerMain.player.playerConfig.deviceInfo.isIOS) { return; } 45157 45158 if (inVideosIndex.id === "splitt") { 45159 if (this.playerMain.player.playerConfig.deviceInfo.isMobile === true) { 45160 return; 45161 } 45162 this.isSplitScreen = true; 45163 } 45164 45165 this.countPlayedInVideos = roundCurrentTime; 45166 this.adPlaylist = inVideos; 45167 45168 this.adPlaylistName = "invideos"; 45169 this.playAdFromPlaylist("invideos", index); 45170 } 45171 } 45172 } 45173 45174 } 45175 45176 } 45177 }; 45178 45179 L1Ads.prototype.startPostrolls = function(postrolls) { 45180 45181 this.adPlaylist = postrolls; 45182 45183 if (typeof google != 'undefined') { 45184 this.playAdFromPlaylist("postrolls", 0); 45185 } else { 45186 this.playerMain.adsPostrollComplete(); 45187 } 45188 }; 45189 45190 /* 45191 L1Ads.prototype.skipAd = function() { 45192 if (typeof google != 'undefined') { 45193 if (this.adsManager) { 45194 this.adsManager.stop(); 45195 } 45196 } 45197 }; 45198 */ 45199 45200 L1Ads.prototype.handleScroll = function(isVisible) { 45201 var language = this.playerMain.getLanguage(); 45202 if(!language) { language = { "play_ad" : "Play Ad", "pause_ad" : "Pause Ad"}; } 45203 45204 if(!isVisible) {
45205 $('#l1pUIControlsAdButtonPlayPause').html(language['play_ad']); 45206 this.adsManager.pause(); 45207 } else { 45208 $('#l1pUIControlsAdButtonPlayPause').html(language['pause_ad']); 45209 this.adsManager.resume(); 45210 } 45211 }; 45212 45213 L1Ads.prototype.handleBlur = function() { 45214 var language = this.playerMain.getLanguage(); 45215 if(!language) { language = { "play_ad" : "Play Ad", "pause_ad" : "Pause Ad"}; } 45216 45217 $('#l1pUIControlsAdButtonPlayPause').html(language['play_ad']); 45218 this.adsManager.pause(); 45219 }; 45220 45221 L1Ads.prototype.resize = function(controlsIsVisible) { 45222 //console.log('resize', this.playerMain.player.stageInterface.isFullscreen()); 45223 //var fullScreen = this.playerMain.player.stageInterface.isFullscreen(); 45224 45225 this.controlsIsVisible = controlsIsVisible; 45226 if (typeof google != 'undefined') { 45227 if (this.adsManager) { 45228 /* 45229 if(fullScreen && this.playerMain.player.playerConfig.deviceInfo.isMobile == true) { 45230 this.adsManager.resize(640, 320, google.ima.ViewMode.FULLSCREEN); 45231 return; 45232 }*/ 45233 45234 if (this.controlsIsVisible) { 45235 this.adsManager.resize($(this.playerMain.subPlayerContainer).width(), $(this.playerMain.subPlayerContainer).height() - 110, google.ima.ViewMode.NORMAL); 45236 } else { 45237 this.adsManager.resize($(this.playerMain.subPlayerContainer).width(), $(this.playerMain.subPlayerContainer).height(), google.ima.ViewMode.NORMAL); 45238 } 45239 45240 if (this.isSplitScreen) { 45241 this.adContainer.classList.add("l1pSplitScreen"); 45242 $(this.videoElement).css('width', '40%'); 45243 this.adsManager.resize($(this.adContainer).width(), $(this.playerMain.subPlayerContainer).height(), google.ima.ViewMode.NORMAL); 45244 } 45245 } 45246 } 45247 }; 45248 45249 L1Ads.prototype.resizePlayer = function() { 45250 this.adContainer.classList.remove("l1pSplitScreen"); 45251 $(this.videoElement).css('width', '100%'); 45252 }; 45253 45254 45255 // ------------------------------- WERBUNGS FUNKTIONEN ------------------------------- 45256 45257 45258 L1Ads.prototype.onAdsManagerLoaded = function(adsManagerLoadedEvent) { 45259 //console.log('onAdsManagerLoaded',adsManagerLoadedEvent, this.adPlaying); 45260 if(this.adPlaying) { this.adsManager.destroy(); } 45261 clearInterval(this.interval); 45262 45263 var adsRenderingSettings = new google.ima.AdsRenderingSettings(); 45264 //adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true; 45265 adsRenderingSettings.useStyledNonLinearAds = true; 45266 //adsRenderingSettings.mimeTypes = ['video/mp4']; 45267 //adsRenderingSettings.uiElements = [google.ima.UiElements.COUNTDOWN, google.ima.UiElements.AD_ATTRIBUTION]; 45268 //adsRenderingSettings.uiElements = [google.ima.UiElements.AD_ATTRIBUTION]; 45269 45270 // Get the ads manager. 45271 this.adsManager = adsManagerLoadedEvent.getAdsManager(this.videoElement, adsRenderingSettings); // See API reference for contentPlayback 45272 45273 45274 // Add listeners to the required events. 45275 this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError, false, this); 45276 this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, this.onAdStarted, false, this); 45277 this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, this.onAdLoaded, false, this); 45278 this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED, this.onAdPaused, false, this); 45279 this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED, this.onAdResumed, false, this); 45280 this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, this.onAdComplete, false, this); 45281 45282 this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, this.onContentPauseRequested, false, this); 45283 this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, this.onContentResumeRequested, false, this); 45284 45285 try { 45286 // Initialize the ads manager. Ad rules playlist will start at this time. 45287 if (this.controlsIsVisible) { 45288 this.adsManager.init($(this.playerMain.subPlayerContainer).width(), $(this.playerMain.subPlayerContainer).height() - 110, google.ima.ViewMode.NORMAL); 45289 } else { 45290 this.adsManager.init($(this.playerMain.subPlayerContainer).width(), $(this.playerMain.subPlayerContainer).height(), google.ima.ViewMode.NORMAL); 45291 } 45292 45293 //this.adsManager.init($(this.playerMain.subPlayerContainer).width(), $(this.playerMain.subPlayerContainer).height(), google.ima.ViewMode.NORMAL); 45294 // Call start to show ads. Single video and overlay ads will 45295 // start at this time; this call will be ignored for ad rules, as ad rules 45296 // ads start when the adsManager is initialized. 45297 this.adsManager.start(); 45298 } catch (adError) { 45299 // An error may be thrown if there was a problem with the VAST response. 45300 } 45301 }; 45302 45303 L1Ads.prototype.onAdLoaded = function(adEvent) { 45304 var self = this; 45305 //console.log('onAdLoaded:', adEvent); 45306 //this.playerMain.adsStart(); 45307 this.volume = this.playerMain.videoInterface.getVolume(); 45308 45309 var ad = adEvent.getAd(); 45310 if (ad.isLinear()) { 45311 this.playerMain.player.userInterface.hideControls(); 45312 this.linearAdIsPlaying = true; 45313 /* 45314 this.playerMain.player.handleBlur(false, function() { 45315 self.handleBlur() 45316 }); 45317 this.playerMain.player.handleScroll(false, this.videoElement, function(isVisible) { 45318 self.handleScroll(isVisible) 45319 }); 45320 */ 45321 this.changeCountdownTimer(); 45322 } else { 45323 this.linearAdIsPlaying = false;
45324 } 45325 45326 this.showAds(ad.isLinear()); 45327 this.resize(); 45328 45329 //this.setIosEventHandlers(true); 45330 }; 45331 45332 L1Ads.prototype.onAdStarted = function(adEvent) { 45333 //console.log('onAdStarted', adEvent); 45334 45335 this.playerMain.player.detectIP(this); 45336 45337 var ad = adEvent.getAd(); 45338 45339 if (ad.isLinear()) { 45340 this.linearAdIsPlaying = true; 45341 45342 this.clickPausePlayButton(); 45343 this.setVolume(0); 45344 45345 } else { 45346 this.linearAdIsPlaying = false; 45347 } 45348 45349 this.adPlaying = true; 45350 this.resize(); 45351 }; 45352 45353 L1Ads.prototype.onAdPaused = function(adEvent) { 45354 this.adPlaying = false; 45355 }; 45356 45357 L1Ads.prototype.onAdResumed = function(adEvent) { 45358 this.adPlaying = true; 45359 }; 45360 45361 L1Ads.prototype.onAdComplete = function(adEvent) { 45362 var self = this; 45363 45364 if(!this.playerMain.player.playerConfig.deviceInfo.isMobile) { 45365 this.playerMain.player.userInterface.showControls(); 45366 } 45367 /* 45368 //this.setIosEventHandlers(false); 45369 this.playerMain.player.handleBlur(true, function() { 45370 self.handleBlur() 45371 }); 45372 this.playerMain.player.handleScroll(true, this.videoElement, function(isVisible) { 45373 self.handleScroll(isVisible) 45374 });*/ 45375 45376 this.setVolume(this.volume); 45377 45378 this.linearAdIsPlaying = false; 45379 this.adPlaying = false; 45380 45381 this.playerMain.adsComplete(); 45382 this.playNextAd(); 45383 45384 //this.adsManager.destroy(); 45385 }; 45386 45387 L1Ads.prototype.onAdError = function(adErrorEvent) { 45388 //console.log('onAdError', adErrorEvent); 45389 clearInterval(this.interval); 45390 this.linearAdIsPlaying = false; 45391 this.playerMain.adsComplete(); 45392 45393 // Handle the error logging and destroy the AdsManager 45394 this.playNextAd(); 45395 }; 45396 45397 L1Ads.prototype.playAdFromPlaylist = function(name, adToPlay) { 45398 this.adPlaylistName = name; 45399 this.actualAd = adToPlay; 45400 45401 //console.log("playAdFromPlaylist", this.adPlaylist); 45402 45403 this.requestAd(this.adPlaylist[this.actualAd].url); 45404 }; 45405 45406 L1Ads.prototype.playListComplete = function() { 45407 //console.log('playListComplete', this.adPlaylistName); 45408 if (this.adPlaylistName == "prerolls") { 45409 this.playerMain.adsPrerollComplete(); 45410 } 45411 if (this.adPlaylistName == "postrolls") { 45412 this.playerMain.adsPostrollComplete(); 45413 } 45414 if (this.adPlaylistName == "midrolls") { 45415 this.playerMain.adsMidrollComplete(); 45416 } 45417 }; 45418 45419 L1Ads.prototype.playNextAd = function() { 45420 //this.adsManager.destroy(); 45421 if(this.adsManager) { 45422 this.adsManager.destroy(); 45423 } 45424 45425 this.hideAds(); 45426 45427 if (this.adPlaylistName == "prerolls" || this.adPlaylistName == "postrolls" || this.adPlaylistName == "midrolls") { 45428 this.actualAd++; 45429 if (this.actualAd < this.adPlaylist.length) { 45430 this.requestAd(this.adPlaylist[this.actualAd].url); 45431 } else { 45432 this.playListComplete(); 45433 } 45434 } 45435 45436 if (this.adPlaylistName == "invideos") { 45437 this.playerMain.player.userInterface.showControls(); 45438 this.videoElement.play(); 45439 } 45440 }; 45441 45442 L1Ads.prototype.requestAd = function(adUrl) { 45443 //console.log("REQEST AD: ", adUrl); 45444 var self = this; 45445 var url = this.replaceAdValue(adUrl); 45446 // Request video ads. 45447 var adsRequest = new google.ima.AdsRequest(); 45448 adsRequest.adTagUrl = url; 45449 //adsRequest.adTagUrl = 'http://search.spotxchange.com/vast/2.0/85394?VPAID=JS&content_page_url=http%3A%2F%2Fwww.laola1.tv&cb=_ADTIME_&player_width=744&player_height=419'; 45450 45451 // Specify the linear and nonlinear slot sizes. This helps the SDK to 45452 // select the correct creative if multiple are returned. 45453 45454 if (this.controlsIsVisible) { 45455 adsRequest.nonLinearAdSlotHeight = $(this.playerMain.subPlayerContainer).height(); 45456 } else { 45457 adsRequest.nonLinearAdSlotHeight = $(this.playerMain.subPlayerContainer).height() - 110; 45458 } 45459 adsRequest.linearAdSlotWidth = $(this.playerMain.subPlayerContainer).width(); 45460 adsRequest.linearAdSlotHeight = $(this.playerMain.subPlayerContainer).height(); 45461 adsRequest.nonLinearAdSlotWidth = $(this.playerMain.subPlayerContainer).width(); 45462 45463 if (typeof google != 'undefined') { 45464 this.interval = setInterval(function() { 45465 if(!self.adPlaying) { 45466 self.setupIMA(); 45467 self.adsLoader.requestAds(adsRequest); 45468 } 45469 }, 3000); 45470 if (this.adsLoader) { 45471 this.adsLoader.requestAds(adsRequest); 45472 } 45473 } 45474 45475 }; 45476 45477 L1Ads.prototype.replaceAdValue = function(adUrl) { 45478 var self = this; 45479 var ad = adUrl; 45480 var newUrl = null; 45481 45482 if(ad) { 45483 if(this.playerMain.player.playerConfig.deviceInfo.isMobile === true) { 45484 if(ad.indexOf('kvdevice=desktop') >= 0) { 45485 ad = ad.replace('kvdevice=desktop', 'kvdevice=mobile'); 45486 } 45487 } 45488 newUrl = replaceParams(self, ad); 45489 } 45490 45491 function replaceParams(self, ad) { 45492 //console.log('adtag: '); 45493 var url = ad; 45494 45495 var date = Date.now(); 45496 45497 var playerSize = self.playerMain.player.stageInterface.getPlayerSize(self.playerMain.player); 45498 var width = playerSize.width.toFixed(0); 45499 var height = playerSize.height.toFixed(0); 45500 45501 var shareUrl = encodeURIComponent(encodeURIComponent(self.playerMain.player.playerConfig.shareurl)); 45502 45503 if(url.indexOf('[TIMESTAMP]') >= 0) { 45504 url = url.replace('[TIMESTAMP]', date); 45505 } 45506 if(url.indexOf('[PLAYER_WIDTH]') >= 0) { 45507 url = url.replace('[PLAYER_WIDTH]', width); 45508 } 45509 if(url.indexOf('[PLAYER_HEIGHT]') >= 0) { 45510 url = url.replace('[PLAYER_HEIGHT]', height); 45511 } 45512 if(url.indexOf('[PAGE_URL]') >= 0) { 45513 url = url.replace('[PAGE_URL]', shareUrl); 45514 } 45515 45516 return url; 45517 } 45518 45519 return newUrl; 45520 }; 45521 45522 L1Ads.prototype.onContentPauseRequested = function() { 45523 //console.log('onContentPauseRequested:'); 45524 if(this.adPlaylistName == "midrolls") { 45525 if(this.videoElement.paused) { 45526 this.videoElement.play(); 45527 this.playerMain.player.videoPlay(); 45528 } 45529 } 45530 45531 if(this.adPlaylistName == "invideos" && this.isSplitScreen == false) { 45532 this.videoElement.pause(); 45533 } 45534 }; 45535 45536 L1Ads.prototype.onContentResumeRequested = function() { 45537 if(this.adPlaylistName == "invideos") { 45538 this.videoElement.play(); 45539 } 45540 this.hideAds(); 45541 }; 45542 45543 45544 /* ------------ IOS Seeking ---------------- */ 45545 /* 45546 L1Ads.prototype.adSeeking = function() { 45547 this.seeked = true; 45548 this.seekedPosition = this.videoElement.currentTime; 45549 45550 if(this.videoElement.paused === false) { 45551 if(this.seekedPosition > this.currentPosition) { 45552 console.log('seeking'); 45553 this.videoElement.currentTime = this.currentPosition; 45554 this.videoElement.pause(); 45555 } 45556 } 45557 }; 45558 45559 L1Ads.prototype.adProgress = function() { 45560 var self = this; 45561 45562 //setInterval(function(){ getSec(self); }, 500); 45563 45564 if(this.seeked) { 45565 if(this.videoElement.currentTime === this.videoElement.duration) { 45566 //this.playNextAd(); 45567 } else { 45568 } 45569 } 45570 45571 function getSec(self) { 45572 self.currentPosition = self.videoElement.currentTime; 45573 } 45574 }; 45575 45576 L1Ads.prototype.addIosHandlers = function() { 45577 console.log('add ios handler'); 45578 var self = this; 45579 45580 this.videoElement.addEventListener('seeking', function() { 45581 self.adSeeking(); 45582 }, false); 45583 45584 this.videoElement.addEventListener('timeupdate', function() { 45585 self.adProgress(); 45586 }, false); 45587 45588 }; 45589 45590 L1Ads.prototype.removeIosHandlers = function() { 45591 console.log('remove ios handler'); 45592 var self = this; 45593 45594 this.videoElement.removeEventListener('seeking', function() { 45595 self.adSeeking(); 45596 }, false); 45597 45598 this.videoElement.removeEventListener('timeupdate', function() { 45599 self.adProgress(); 45600 }, false); 45601 45602 }; 45603 45604 L1Ads.prototype.setIosEventHandlers = function(boolean) { 45605 if(this.playerMain.player.playerConfig.deviceInfo.isIOS) { 45606 if(boolean) { 45607 this.addIosHandlers(); 45608 } else { 45609 this.removeIosHandlers(); 45610 } 45611 } 45612 }; 45613 */ 45614 45615}()); 45616(function () { 45617 /** 45618 * Proxy auf den aktuellen Video player. 45619 * Entscheidet welcher Videoplayer (HTML5 / FLASH). 45620 */ 45621 this.L1Analytics = function (subPlayer) { 45622 this.subPlayer = subPlayer; 45623 this.akaPlugin = null; 45624 45625 this.state = 0; 45626 }; 45627 45628 L1Analytics.prototype.setAnalytics = function (akamaiAnalyticsObject) { 45629 /* Defining the akaPluginCallBack object*/ 45630 45631 45632 //akaPluginCallBack["streamHeadPosition"] = getStreamHeadPosition; 45633 //akaPluginCallBack["streamLength"] = getStreamLength; 45634 //akaPluginCallBack["streamURL "] = getStreamURL; 45635 45636 //var script = document.createElement('script'); 45637 // script.type = "text/javascript"; 45638 // script.src = "//79423.analytics.edgekey.net/js/csma.js"; 45639 // document.getElementsByTagName('head')[0].appendChild(script); 45640 45641 45642 this.checkAkamaiAnalytics(this, akamaiAnalyticsObject); 45643 }; 45644 45645 L1Analytics.prototype.checkAkamaiAnalytics = function(self, akamaiAnalyticsObject) { 45646 var url = '//ma95-r.analytics.edgekey.net/config/beacon-2631.xml?enableGenericAPI=1'; 45647 if(akamaiAnalyticsObject) { 45648 url = akamaiAnalyticsObject.beaconUrl; 45649 45650 if(akamaiAnalyticsObject.enabled == 'false') { 45651 return; 45652 } 45653 } 45654 45655 var attemptCount = 0; 45656 45657 //var AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH = '//ma95-r.analytics.edgesuite.net/config/beacon-2631.xml?enableGenericAPI=1'; 45658 45659 45660 if (typeof AkaHTML5MediaAnalytics == 'undefined' && typeof AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH == 'undefined') { 45661 45662 //console.log("KEIN AkamaiAnalytics GEFUNDEN!"); 45663 45664 var script1 = document.createElement('script'); 45665 script1.type = "text/javascript"; 45666 script1.innerHTML ="var AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH = '" + url + "';"; //2631 16571 45667 document.getElementsByTagName('head')[0].appendChild(script1); 45668 //console.log("AK CONFIG PATH: " , AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH); 45669 var script = document.createElement('script'); 45670 script.type = "text/javascript"; 45671 script.src = "//79423.analytics.edgekey.net/js/csma.js"; 45672 document.getElementsByTagName('head')[0].appendChild(script); 45673 } 45674 45675 function waitForAkamaiAnalytics() { 45676 attemptCount++; 45677 if (typeof AkaHTML5MediaAnalytics != 'undefined') { // JQuery is loaded! 45678 init(); 45679 return; 45680 } 45681 if (attemptCount < 100) { 45682 setTimeout(waitForAkamaiAnalytics, 100); // Check 10x a second 45683 } 45684 return; 45685 } 45686
45687 function init() { 45688 if (arguments.callee.done) return; 45689 if (typeof AkaHTML5MediaAnalytics != 'undefined') { 45690 //console.log("AkaHTML5MediaAnalytics LOADED!"); 45691 arguments.callee.done = true; 45692 self.checkAkamaiAnalyticsComplete(self); 45693 } 45694 } 45695 45696 waitForAkamaiAnalytics(); 45697 }; 45698 45699 L1Analytics.prototype.checkAkamaiAnalyticsComplete = function(self) { 45700 //console.log("ANALYTICS LOADED!"); 45701 45702 var akaPluginCallBack = {}; 45703 this.akaPlugin = new AkaHTML5MediaAnalytics(akaPluginCallBack); 45704 45705 /* 45706 streamController.analyticsSetData("streamID", StreamID + "-" + Titel); 45707 streamController.analyticsSetData("title", Titel); 45708 streamController.analyticsSetData("partnerID", PartnerID); 45709 streamController.analyticsSetData("playerId", Version); 45710 streamController.analyticsSetData("device", "Flash " + flash.system.Capabilities.version); 45711 streamController.analyticsSetData("viewerId", String(UserID)); 45712 */ 45713 45714 45715 try{ 45716 this.akaPlugin.setData("streamID", self.subPlayer.getInfo().streamid + "-" + self.subPlayer.getInfo().title); 45717 this.akaPlugin.setData("title", self.subPlayer.getInfo().title); 45718 this.akaPlugin.setData("partnerID", self.subPlayer.partnerid); 45719 this.akaPlugin.setData("playerId", self.subPlayer.player.playerConfig.version); 45720 this.akaPlugin.setData("device", "mobile_" + self.subPlayer.player.playerConfig.deviceInfo.mobileSupport); 45721 this.akaPlugin.setData("viewerId", ""); 45722 } catch(error) { 45723 45724 } 45725 45726 45727 //akaPlugin.handlePlaying(); 45728 }; 45729 45730 L1Analytics.prototype.startMainVideo = function () { 45731 45732 //setAkamaiMediaAnalyticsData("title", "TEST!"); 45733 45734 if (this.akaPlugin) { 45735 45736 45737 this.akaPlugin.handleSessionInit(); 45738 45739 } 45740 45741 if(typeof ga_l1 != "undefined") { 45742 //console.log(this.subPlayer); 45743 var eventLabel = (this.subPlayer.videoConfig && this.subPlayer.videoConfig.hdVideo) ? this.subPlayer.videoConfig.hdVideo.video.title : "" ; 45744 45745 ga_l1('send', { 45746 hitType: 'event', 45747 eventCategory: 'Video', 45748 eventAction: 'start', 45749 eventLabel: eventLabel 45750 }); 45751 45752 //ga('send', 'event', 'Video', 'play', this.subPlayer.videoConfig.hdVideo.video.title); 45753 45754 } 45755 45756 }; 45757 45758 L1Analytics.prototype.videoPlay = function (started) { 45759 if (this.akaPlugin) { 45760 if (started) { 45761 this.akaPlugin.handlePlaying(); 45762 } else { 45763 this.akaPlugin.handleResume(); 45764 } 45765 } 45766 45767 if(typeof ga_l1 != "undefined") { 45768 //console.log(this.subPlayer); 45769 var eventLabel = (this.subPlayer.videoConfig && this.subPlayer.videoConfig.hdVideo) ? this.subPlayer.videoConfig.hdVideo.video.title : "" ; 45770 45771 ga_l1('send', { 45772 hitType: 'event', 45773 eventCategory: 'Video', 45774 eventAction: 'play', 45775 eventLabel: eventLabel 45776 }); 45777 45778 //ga('send', 'event', 'Video', 'play', this.subPlayer.videoConfig.hdVideo.video.title); 45779 45780 } 45781 }; 45782 45783 L1Analytics.prototype.videoPause = function () { 45784 if (this.akaPlugin) { 45785 this.akaPlugin.handlePause(); 45786 } 45787 45788 if(typeof ga_l1 != "undefined") { 45789 //console.log(this.subPlayer); 45790 var eventLabel = (this.subPlayer.videoConfig && this.subPlayer.videoConfig.hdVideo) ? this.subPlayer.videoConfig.hdVideo.video.title : "" ; 45791 45792 ga_l1('send', { 45793 hitType: 'event', 45794 eventCategory: 'Video', 45795 eventAction: 'pause', 45796 eventLabel: eventLabel 45797 }); 45798 45799 //ga('send', 'event', 'Video', 'play', this.subPlayer.videoConfig.hdVideo.video.title); 45800 45801 } 45802 }; 45803 45804 L1Analytics.prototype.videoProgress = function (currentTime, duration) { 45805 if(typeof ga_l1 != "undefined") { 45806 //console.log(this.subPlayer); 45807 var eventLabel = (this.subPlayer.videoConfig && this.subPlayer.videoConfig.hdVideo) ? this.subPlayer.videoConfig.hdVideo.video.title : "" ; 45808 var percent = (currentTime / duration) * 100; 45809 45810 if(this.state == 0 && percent.toFixed(0) > 25 && percent.toFixed(0) < 50) { 45811 //console.log('25%'); 45812 this.state = 1; 45813 ga_l1('send', 'event', 'Video', '25% reached', eventLabel); 45814 } else if(this.state == 1 && percent.toFixed(0) > 50 && percent.toFixed(0) < 75) { 45815 //console.log('50%'); 45816 this.state = 2; 45817 ga_l1('send', 'event', 'Video', '50% reached', eventLabel); 45818 } else if(this.state == 2 && percent.toFixed(0) == 75 && percent.toFixed(0) < 100) { 45819 //console.log('75%'); 45820 this.state = 3; 45821 ga_l1('send', 'event', 'Video', '75% reached', eventLabel); 45822 } else if(this.state == 3 && percent.toFixed(0) == 100) { 45823 //console.log('100%'); 45824 this.state = 4; 45825 ga_l1('send', 'event', 'Video', '100% reached', eventLabel); 45826 } 45827 } 45828 }; 45829 45830 L1Analytics.prototype.videoSwitchVideoIndex = function (newIndex, newBitrate) { 45831 //console.log("AKAMAI SWITCH INDEX: " , newIndex); 45832 if (this.akaPlugin) { 45833 this.akaPlugin.handleBitRateSwitch(newBitrate); 45834 } 45835 }; 45836 45837 L1Analytics.prototype.destroy = function () { 45838 if (this.akaPlugin) { 45839 this.akaPlugin.handleApplicationExit(); 45840 } 45841 }; 45842 45843 L1Analytics.prototype.videoComplete = function () { 45844 if (this.akaPlugin) { 45845 this.akaPlugin.handlePlayEnd("complete"); 45846 } 45847 45848 if(typeof ga_l1 != "undefined") { 45849 //console.log(this.subPlayer); 45850 var eventLabel = (this.subPlayer.videoConfig && this.subPlayer.videoConfig.hdVideo) ? this.subPlayer.videoConfig.hdVideo.video.title : "" ; 45851 45852 ga_l1('send', { 45853 hitType: 'event', 45854 eventCategory: 'Video', 45855 eventAction: 'start', 45856 eventLabel: eventLabel 45857 }); 45858 //ga('send', 'event', 'Video', 'stop', this.subPlayer.videoConfig.hdVideo.video.title); 45859 } 45860 }; 45861 45862 L1Analytics.prototype.videoError = function (error) { 45863 if (this.akaPlugin) { 45864 this.akaPlugin.handleError(error); 45865 this.akaPlugin.handlePlayEnd("error"); 45866 } 45867 }; 45868 45869 /* 45870 // SET 45871 L1VideoInterface.prototype.playOrPause = function () { 45872 45873 }; 45874 45875 L1VideoInterface.prototype.play = function () { 45876 45877 }; 45878 45879 L1VideoInterface.prototype.pause = function () { 45880 45881 }; 45882 45883 L1VideoInterface.prototype.forward = function (sec) { 45884 45885 }; 45886 45887 L1VideoInterface.prototype.rewind = function (sec) { 45888 45889 }; 45890 45891 L1VideoInterface.prototype.seek = function (second) { 45892 45893 }; 45894 45895 L1VideoInterface.prototype.seekTo = function (prozent) { 45896 45897 }; 45898 45899 L1VideoInterface.prototype.setManualVideoIndex = function(newIndex) { 45900 45901 }; 45902 45903 L1VideoInterface.prototype.setVolume = function (prozent) { 45904 45905 }; 45906 45907 L1VideoInterface.prototype.destroy = function () { 45908 45909 }; 45910 */ 45911 45912 45913}()); 45914 45915(function () { 45916 45917 this.L1Api = function (playerMain) { 45918 this.playerMain = playerMain; 45919 }; 45920 45921 //SET 45922 L1Api.prototype.play = function() { 45923 45924 if (this.playerMain.subPlayer.videoConfig.status == "auto
45924play") { 45925 this.playerMain.subPlayer.onAutoplayClick(); 45926 } 45927 else if (this.playerMain.subPlayer.videoConfig.status == "related") { 45928 this.playerMain.onclickReplay(); 45929 } 45930 else { 45931 this.playerMain.subPlayer.play(); 45932 } 45933 45934 this.playerMain.tracking("play"); 45935 }; 45936 45937 L1Api.prototype.pause = function() { 45938 this.playerMain.subPlayer.pause(); 45939 this.playerMain.tracking("pause"); 45940 45941 }; 45942 45943 L1Api.prototype.playOrPause = function() { 45944 this.playerMain.subPlayer.playOrPause(); 45945 this.playerMain.tracking("playPause"); 45946 }; 45947 45948 L1Api.prototype.rewind = function(sec) { 45949 this.playerMain.subPlayer.rewind(sec); 45950 this.playerMain.tracking("rewind"); 45951 }; 45952 45953 L1Api.prototype.forward = function(sec) { 45954 this.playerMain.subPlayer.forward(sec); 45955 this.playerMain.tracking("forward"); 45956 }; 45957 45958 L1Api.prototype.volume = function(percent) { 45959 if (percent !== undefined) { 45960 //only set on userInterface - video change volume from slider update 45961 this.playerMain.userInterface.setVolume(percent); 45962 //this.subPlayer.setVolume(percent); 45963 } else { 45964 return this.playerMain.subPlayer.getVolume(); 45965 } 45966 this.playerMain.tracking("volume"); 45967 }; 45968 45969 L1Api.prototype.mute = function() { 45970 this.playerMain.userInterface.setVolume(0); 45971 this.playerMain.tracking("mute"); 45972 }; 45973 45974 L1Api.prototype.unmute = function() { 45975 this.playerMain.userInterface.setVolume(100); 45976 this.playerMain.tracking("unmute"); 45977 }; 45978 45979 L1Api.prototype.muteOrUnmute = function() { 45980 45981 if (this.playerMain.subPlayer.getVolume() === 0) { 45982 this.playerMain.userInterface.setVolume(100); 45983 } else { 45984 this.playerMain.userInterface.setVolume(0); 45985 } 45986 45987 this.playerMain.tracking("muteOrUnmute"); 45988 45989 }; 45990 45991 L1Api.prototype.seek = function(second) { 45992 this.playerMain.subPlayer.seek(second); 45993 45994 this.playerMain.tracking("seek"); 45995 }; 45996 45997 L1Api.prototype.seekPercent = function(percent) { 45998 this.playerMain.subPlayer.seekTo(percent); 45999 46000 this.playerMain.tracking("seek"); 46001 }; 46002 46003 L1Api.prototype.index = function(newIndex) { 46004 this.playerMain.subPlayer.setManualVideoIndex(newIndex); 46005 46006 this.playerMain.tracking("index"); 46007 }; 46008 46009 L1Api.prototype.fullscreenEnter = function() { 46010 this.playerMain.stageInterface.enterFullscreen(); 46011 46012 //this.playerMain.tracking("fullscreenEnter"); 46013 }; 46014 46015 L1Api.prototype.fullscreenExit = function() { 46016 this.playerMain.stageInterface.exitFullscreen(); 46017 46018 //this.playerMain.tracking("fullscreenExit"); 46019 }; 46020 46021 L1Api.prototype.fullscreenToggle = function() { 46022 this.playerMain.stageInterface.checkFullscreen(); 46023 46024 //this.playerMain.tracking("fullscreenToggle"); 46025 }; 46026 46027 L1Api.prototype.resize = function() { 46028 this.playerMain.stageInterface.resize(); 46029 this.playerMain.adsInterface.resize(); 46030 }; 46031 46032 L1Api.prototype.showShare = function() { 46033 this.playerMain.userInterface.showShare(); 46034 46035 }; 46036 46037 L1Api.prototype.showDownload = function() { 46038 this.playerMain.userInterface.showDownload(); 46039 46040 }; 46041 46042 L1Api.prototype.showInfo = function() { 46043 this.playerMain.userInterface.showInfo(); 46044 }; 46045 46046 L1Api.prototype.showPremium = function() { 46047 this.playerMain.userInterface.showPremium(); 46048 }; 46049 46050 L1Api.prototype.showMultiview = function() { 46051 this.playerMain.userInterface.showMultiview(); 46052 46053 }; 46054 L1Api.prototype.showHD = function() { 46055 this.playerMain.userInterface.showHD(); 46056 }; 46057 46058 L1Api.prototype.showSettings = function() { 46059 this.playerMain.userInterface.showSettings(); 46060 }; 46061 46062 L1Api.prototype.showStatistics = function() { 46063 this.playerMain.userInterface.showStatistics(); 46064 }; 46065 46066 L1Api.prototype.showRelated = function(language) { 46067 this.playerMain.userInterface.showRelated(language); 46068 }; 46069 46070 L1Api.prototype.showError = function(text, textObject) { 46071 this.playerMain.userInterface.videoError(text, textObject); 46072 }; 46073 46074 L1Api.prototype.skipAd = function() { 46075 this.playerMain.adsInterface.skipAd(); 46076 }; 46077 46078 46079 46080 46081 46082 46083 // GET 46084 46085 L1Api.prototype.currentTime = function() { 46086 return this.playerMain.subPlayer.getCurrentTime(); 46087 }; 46088 46089 L1Api.prototype.duration = function() { 46090 return this.playerMain.subPlayer.getDuration(); 46091 }; 46092 46093 L1Api.prototype.paused = function() { 46094 return this.playerMain.subPlayer.getPaused(); 46095 }; 46096 46097 L1Api.prototype.played = function() { 46098 return this.playerMain.subPlayer.getPlayed(); 46099 }; 46100 L1Api.prototype.status = function() { 46101 return this.playerMain.subPlayer.videoConfig.status; 46102 }; 46103 L1Api.prototype.config = function() { 46104 return this.playerMain.playerConfig; 46105 }; 46106 46107 /* 46108 L1Api.prototype.autoplay = true; 46109 L1Api.prototype.buffered = true; 46110 L1Api.prototype.controls = true; 46111 L1Api.prototype.currentSrc = true; 46112 L1Api.prototype.defaultMuted = true; 46113 L1Api.prototype.ended = true; 46114 L1Api.prototype.error = true; 46115 L1Api.prototype.loop = true; 46116 L1Api.prototype.muted = true; 46117 L1Api.prototype.paused = true; 46118 L1Api.prototype.played = true; 46119 L1Api.prototype.src = ""; 46120 L1Api.prototype.index = 0; 46121 */ 46122 46123}()); 46124(function () { 46125 46126 this.L1Loader = function (config) { 46127 this.config = config; 46128 }; 46129 46130 L1Loader.prototype.loadHDVideo = function(path, finishFunction, errorFunction) { 46131 this.loadData(path, finishFunction, errorFunction); 46132 }; 46133 46134 L1Loader.prototype.loadStreamAccess = function(path, finishFunction, errorFunction, paramter) { 46135 this.loadData(path, finishFunction, errorFunction, "POST", paramter); 46136 }; 46137 46138 L1Loader.prototype.loadStreamData = function(path, finishFunction, errorFunction) { 46139 this.loadData(path, finishFunction, errorFunction); 46140 }; 46141 46142 L1Loader.prototype.loadLiveStreams = function(path, finishFunction, errorFunction) { 46143 this.loadData(path, finishFunction, errorFunction); 46144 }; 46145 46146 L1Loader.prototype.loadHeartbeat = function(path, finishFunction, errorFunction, method, paramter) { 46147 this.loadData(path, finishFunction, errorFunction, method, paramter); 46148 }; 46149 46150 46151 L1Loader.prototype.loadData = function(path, success, error, method, parameter) { 46152 //function loadData(path, success, error, method, parameter) { 46153 parameter = parameter || null; 46154 method = method || "GET"; 46155 46156 var xhr = new XMLHttpRequest(); 46157 46158 xhr.onreadystatechange = function () { 46159 if (xhr.readyState === XMLHttpRequest.DONE) { 46160 if (xhr.status === 200) { 46161 if (success) { 46162 success(xhr.responseText); 46163 } 46164 } else { 46165 if (error) { 46166 error(xhr); 46167 } 46168 } 46169 } 46170 }; 46171 46172 xhr.open(method, path, true); 46173 //Abfrage für Premium Schnittstelle 46174 if(this.config.hasOwnProperty('hdVideo')) { 46175 if(this.config.hdVideo.video.abo.streamPay === "freemium" || this.config.hdVideo.video.abo.streamPay === "pay") { 46176 if(path.indexOf('stream-access') >= 0) { 46177 xhr.setRequestHeader('content-type', 'application/json'); 46178 xhr.withCredentials = true; 46179 } 46180 } 46181 } 46182 /* 46183 if(path.indexOf('stream-access') >= 0) { 46184 xhr.setRequestHeader('content-type', 'application/json'); 46185 xhr.withCredentials = true; 46186 }*/ 46187 46188 xhr.send(parameter); 46189 }; 46190 46191 46192}()); 46193(function () { 46194 this.L1VideoPlayer = function (userConfig) { 46195 46196 var self = this; 46197 46198 this.playerConfig = userConfig; 46199 46200 this.playerConfig.version = "8.6.16"; 46201 this.playerConfig.status = "init"; 46202 46203 46204 console.log("%c ââ L1Player " + this.playerConfig.version + " ", "background: #000; color: #FFF"); 46205 46206 this.stageInterface = new L1Stage(this); 46207 46208 this.stageInterface.initStage(this.playerConfig); 46209 46210 }; 46211 46212 L1VideoPlayer.prototype.stageInitComplete = function () { 46213 46214 this.playerContainer = this.playerConfig.container; 46215 46216 this.userInterface = new L1UI(this); 46217 //this.playerConfigInterface = new L1Loader(); 46218 //this.videoInterface = new L1VideoInterface(this); 46219 46220 46221 this.api = new L1Api(this); 46222 46223 this.userInterface.setMainHtml(); 46224 this.userInterface.setUserInterfaceHtml(); 46225 46226 this.l1Player = this.playerConfig.container.querySelector("#l1pPlayer"); 46227 46228 46229 46230 try { 46231 if (typeof l1PlayerInstance === 'undefined') { 46232 $(this.playerConfig.container).append("<script>var l1PlayerInstance = [];</script>"); 46233 } 46234 l1PlayerInstance.push(this); 46235 } catch(err) { 46236 //console.log("Keine PlayerInstance"); 46237 } 46238 46239 46240 46241 46242 46243 this.stageInterface.setStage(); 46244 46245 // this.adsInterface = new L1Ads(this); 46246 46247 this.subPlayer0 = new L1SubPlayer(this, 0); 46248 this.subPlayer1 = new L1SubPlayer(this, 1); 46249 this.subPlayer2 = new L1SubPlayer(this, 2); 46250 this.subPlayer3 = new L1SubPlayer(this, 3); 46251 46252 this.subPlayer = this.subPlayer0; 46253 this.subPlayer.isActiveSubPlayer = true; 46254 46255 this.playerConfig.videoConfig = this.subPlayer.videoConfig; 46256 this.subPlayer0.start(this.playerConfig.configUrl, this.playerConfig.videoid, this.playerConfig.partnerid, this.playerConfig.language, false, this.playerConfig.videoSource, this.playerConfig.ads); 46257 }; 46258 46259 // -------------------- TRACKING -------------------- 46260 46261 L1VideoPlayer.prototype.pixel = function (action) { 46262 if (typeof window[this.playerConfig.pixel] === "function") { 46263 try { 46264 window[this.playerConfig.pixel](action, this.playerConfig); 46265 } 46266 catch(err) { 46267 } 46268 } 46269 }; 46270 46271 L1VideoPlayer.prototype.tracking = function (action) { 46272 if (typeof window[this.playerConfig.tracking] === "function") { 46273 try { 46274 window[this.playerConfig.tracking](action, this.playerConfig); 46275 } 46276 catch(err) { 46277 } 46278 } 46279 }; 46280 46281 L1VideoPlayer.prototype.pixelGA = function (action) { 46282 if (typeof window[this.playerConfig.pixelGA] === "function") { 46283 try { 46284 window[this.playerConfig.pixelGA](action, this.playerConfig); 46285 } 46286 catch(err) { 46287 } 46288 } 46289 }; 46290 46291 L1VideoPlayer.prototype.share = function (social, url) { 46292 var title = this.subPlayer.getInfo().title; 46293 var description = this.subPlayer.getInfo().description; 46294 46295 if (!title) {title = "Title"} 46296 if (!description) {description = ""} 46297 46298 if (social == "facebook") { 46299 window.open('http://www.facebook.com/sharer/sharer.php?u=' + url, 'facebook_share', 'width=670,height=300,status=yes,scrollbars=no,resizable=no'); 46300 } 46301 46302 if (social == "twitter") { 46303 window.open('https://twitter.com/share?url=' + url, 'twitter_share', 'menubar=no,width=670,height=470,scrollbars=yes,resizable=yes'); 46304 } 46305 46306 if (social == "google") { 46307 window.open('https://plus.google.com/share?url=' + url, 'googleplus_share', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=600,height=500'); 46308 } 46309 46310 if (social == "mail") { 46311 window.top.location.href = "mailto:?subject=" + title + "&body=" + description + "%0A" + url; 46312 } 46313 46314 46315 46316 /* 46317 if (typeof window[this.playerConfig.sharejs] === "function") { 46318 try { 46319 window[this.playerConfig.sharejs](social, this.playerConfig.videoConfig.hdVideo, url); 46320 } 46321 catch(err) { 46322 } 46323 } 46324 */ 46325 }; 46326 46327 //this.share(social, url); 46328 //this.playerConfig.sharejs(social, this.playerConfig.videoid, url); 46329 46330 L1VideoPlayer.prototype.handleBlur = function (adComplete, callback) { 46331 this.stageInterface.handleBlur(adComplete, callback); 46332 }; 46333 46334 L1VideoPlayer.prototype.handleScroll = function (adComplete, videoElement, callback) { 46335 this.stageInterface.handleScroll(adComplete, videoElement, callback); 46336 }; 46337 46338 L1VideoPlayer.prototype.detectIP = function(playerMain) { 46339 this.stageInterface.detectIP(playerMain); 46340 }; 46341 46342 // -------------------- ALL CONFIG LOADED -------------------- 46343 46344 /* 46345 L1VideoPlayer.prototype.checkCountdown = function () { 46346 this.playerConfig.status = "countdown"; 46347 this.userInterface.showCountdown(); 46348 this.api.resize(); 46349 } 46350 46351 46352 L1VideoPlayer.prototype.checkAutoplay = function () { 46353 this.playerConfig.status = "autoplay"; 46354 this.api.resize(); 46355
46356 if (this.playerConfig.autoplay) { 46357 this.onAutoplayClick(); 46358 } else { 46359 this.userInterface.showAutoplay(); 46360 } 46361 }; 46362 */ 46363 46364 /* 46365 L1VideoPlayer.prototype.readyToStartVideo = function () { 46366 46367 //this.adsPrerollComplete(); 46368 }; 46369 */ 46370 // -------------------- STAGE -------------------- 46371 46372 L1VideoPlayer.prototype.userIdle = function () { 46373 this.userInterface.hideControlsFaded(); 46374 this.subPlayer.resize(); 46375 }; 46376 L1VideoPlayer.prototype.userActive = function () { 46377 this.userInterface.showControlsFaded(); 46378 this.subPlayer.resize(); 46379 }; 46380 46381 L1VideoPlayer.prototype.resizeComplete = function () { 46382 if (this.subPlayer) { 46383 this.subPlayer.resize(); 46384 } 46385 }; 46386 46387 46388 46389 46390 // -------------------- SUB PLAYER -------------------- 46391 46392 46393 L1VideoPlayer.prototype.setPlayerAktiv = function (id) { 46394 this.subPlayer = this["subPlayer" + id]; 46395 46396 this.subPlayer0.setInActive(); 46397 this.subPlayer1.setInActive(); 46398 this.subPlayer2.setInActive(); 46399 this.subPlayer3.setInActive(); 46400 46401 this.subPlayer.setActive(); 46402 46403 //console.log(this.playerConfig); 46404 this.userInterface.setTitle(this.subPlayer.getTitle(), this.playerConfig.showTitle, this.subPlayer.getInfo()); 46405 //this.userInterface.setTitle(this.subPlayer.getTitle(), this.playerConfig.showTitle, this.subPlayer.getInfo().meta.mediatyp); 46406 46407 this.userInterface.setDownload(this.subPlayer.getDownload()); 46408 this.userInterface.setShare(this.subPlayer.getShare(), this.subPlayer.getLanguage()); //.share, this.playerConfig.shareurl, this.playerConfig.sharejs); 46409 this.userInterface.setRelated(this.subPlayer.getRelated(), this.playerConfig.showTimer, this.subPlayer.getInfo()); 46410 this.userInterface.setInfo(this.subPlayer.getInfo(), this.subPlayer.getLanguage(), this.playerConfig.showInfo); 46411 this.userInterface.setSettings(this.subPlayer.getLanguage()); 46412 }; 46413 46414 46415 L1VideoPlayer.prototype.openStreamSelects = function (id) { 46416 this.userInterface.showStreams(id); 46417 this.subPlayer.loadLiveStreams(id, this.playerConfig.language, this.playerConfig.portalid, this.playerConfig.partnerid, this.playerConfig.streamUrl); 46418 }; 46419 46420 46421 46422 // -------------------- USER INTERFACE -------------------- 46423 46424 L1VideoPlayer.prototype.onCountdownComplete = function () { 46425 this.loadConfig(); 46426 }; 46427 46428 L1VideoPlayer.prototype.onclickReplay = function() { 46429 this.pixel("play"); 46430 46431 this.playerConfig.status = "video"; 46432 this.subPlayer.videoConfig.status = "video"; 46433 46434 this.userInterface.closeAllPopups(); 46435 //console.log('device', this.playerConfig.deviceInfo); 46436 if(!this.playerConfig.deviceInfo.isMobile) { 46437 this.userInterface.showControls(); 46438 } 46439 this.api.seek(0); 46440 this.api.play(); 46441 }; 46442 46443 L1VideoPlayer.prototype.onclickRewind = function() { 46444 this.pixel("rewind"); 46445 this.api.rewind(); 46446 }; 46447 46448 L1VideoPlayer.prototype.onclickForward = function() { 46449 this.pixel("forward"); 46450 this.api.forward(); 46451 }; 46452 46453 L1VideoPlayer.prototype.onclickPlay = function() { 46454 this.pixelGA("button_play"); 46455 this.pixel("play"); 46456 this.api.play(); 46457 }; 46458 46459 L1VideoPlayer.prototype.onclickPause = function() { 46460 this.pixelGA("button_pause"); 46461 this.pixel("pause"); 46462 this.api.pause(); 46463 }; 46464 46465 L1VideoPlayer.prototype.onclickPlayPause = function() { 46466 //this.pixel("playPause"); 46467 //console.log(this.api.played()); 46468 46469 if (this.api.played()) { 46470 this.onclickPause(); 46471 } else { 46472 this.onclickPlay(); 46473 } 46474 //this.api.playOrPause(); 46475 }; 46476 46477 L1VideoPlayer.prototype.onclickTimeline = function(prozentTime) { 46478 this.pixelGA("timeline"); 46479 this.pixel("timeline"); 46480 this.api.seekPercent(prozentTime); 46481 }; 46482 46483 L1VideoPlayer.prototype.onMouseMoveTimeline = function(prozentTime) { 46484 this.userInterface.showTimelineTooltip(prozentTime, this.api.duration(), this.subPlayer.getLiveStatus()); 46485 }; 46486 46487 L1VideoPlayer.prototype.onclickFullscreen = function() { 46488 this.pixelGA("fullscreen"); 46489 this.pixel("fullscreen"); 46490 this.api.fullscreenToggle(); 46491 }; 46492 46493 L1VideoPlayer.prototype.onclickSingleIndex = function(newIndex) { 46494 this.pixel("index"); 46495 this.api.index(newIndex); 46496 }; 46497 46498 L1VideoPlayer.prototype.onclickVolume = function(vol) { 46499 this.pixel("volume"); 46500 //NICHT zur API - sonst ist es doppelt 46501 this.subPlayer.setVolume(vol); 46502 }; 46503 46504 L1VideoPlayer.prototype.onclickShare = function() { 46505 this.pixel("share"); 46506 this.api.showShare(); 46507 }; 46508 46509 L1VideoPlayer.prototype.onclickDownload = function() { 46510 this.pixel("download"); 46511 this.api.showDownload(); 46512 }; 46513 46514 L1VideoPlayer.prototype.onclickPremiumStream = function() { 46515 this.pixel("octoshape"); 46516 //funktion premium stream wechseln 46517 }; 46518 46519 L1VideoPlayer.prototype.onclickMultiview = function() { 46520 this.pixel("multiview"); 46521 //this.api.showMultiview(); 46522 if(this.subPlayer.videoConfig.streamAccess.premium.allowHD === true) { 46523 this.api.showMultiview(); 46524 } else { 46525 this.api.showPremium(); 46526 this.userInterface.setPremium("multiview"); 46527 } 46528 }; 46529 46530 L1VideoPlayer.prototype.onAutoplayClick = function() { 46531 //console.log('autoplay clicked'); 46532 this.pixel("autoplay"); 46533 this.subPlayer.onAutoplayStart(); 46534 }; 46535 46536 46537 46538 L1VideoPlayer.prototype.onclickMultiviewSelection = function(multiview) { 46539 this.pixel("multiviewselection"); 46540 if (multiview == "single") { 46541 $(this.l1Player).find("#l1pVideo").removeClass().addClass( "l1pVideoSingle" ); 46542 46543 this.setPlayerAktiv(0); 46544 46545 closeSubPlayers(this, 1); 46546 46547 //this.subPlayer1.destroy(); 46548 //this.subPlayer2.destroy(); 46549 //this.subPlayer3.destroy(); 46550 } 46551 46552 if (multiview == "dual") { 46553 $(this.l1Player).find("#l1pVideo").removeClass().addClass( "l1pVideoDual" ); 46554 46555 if (this.subPlayer2.isActiveSubPlayer || this.subPlayer3.isActiveSubPlayer) { 46556 this.setPlayerAktiv(0); 46557 } 46558 46559 closeSubPlayers(this, 2); 46560 46561 //this.subPlayer2.destroy(); 46562 //this.subPlayer3.destroy(); 46563 } 46564 46565 if (multiview == "quad") { 46566 $(this.l1Player).find("#l1pVideo").removeClass().addClass( "l1pVideoQuad" ); 46567 } 46568 46569 if (multiview == "overlay") { 46570 $(this.l1Player).find("#l1pVideo").removeClass().addClass( "l1pVideoOverlay" ); 46571 46572 if (this.subPlayer2.isActiveSubPlayer || this.subPlayer3.isActiveSubPlayer) { 46573 this.setPlayerAktiv(0); 46574 } 46575 46576 closeSubPlayers(this, 2); 46577 46578 //this.subPlayer2.destroy(); 46579 //this.subPlayer3.destroy(); 46580 } 46581 46582 this.onClickCloseAllPopups(); 46583 46584 function closeSubPlayers(self, subPlayers) { 46585 for(var i = subPlayers; i <= 3; i++) { 46586 if(self['subPlayer' + i].videoid !== "") { 46587 self.closeStream(i); 46588 } 46589 } 46590 } 46591 46592 }; 46593 46594 L1VideoPlayer.prototype.onclickCopy = function() { 46595 this.pixel("copy"); 46596 }; 46597 46598 L1VideoPlayer.prototype.onclickSocial = function(social, url) { 46599 this.pixel("social"); 46600 this.share(social, url); 46601 //this.playerConfig.sharejs(social, this.playerConfig.videoid, url); 46602 }; 46603 46604 L1VideoPlayer.prototype.onclickInfo = function() { 46605 this.pixel("info"); 46606 this.api.showInfo(); 46607 }; 46608 46609 L1VideoPlayer.prototype.onclickPremium = function() { 46610 this.pixel("premium"); 46611 this.api.showPremium(); 46612 }; 46613 46614 46615 46616 L1VideoPlayer.prototype.onclickHD = function() { 46617 this.pixel("hd"); 46618 /* 46619 var indexList = $(this.l1Player).find('#l1pUIPopUpsSettingsistManuell'); 46620 var hdIndex = indexList[0].children.length - 1; 46621 46622 this.checkVideoIndex(hdIndex); 46623 this.api.index(hdIndex); 46624 */ 46625 46626 if(this.subPlayer.videoConfig.streamAccess.premium.allowHD === true) { 46627 var indexList = $(this.l1Player).find('#l1pUIPopUpsSettingsistManuell'); 46628 var hdIndex = indexList[0].children.length - 1; 46629 46630 this.checkVideoIndex(hdIndex); 46631 this.api.index(hdIndex); 46632 } else { 46633 //this.api.showHD(); 46634 this.api.showPremium(); 46635 this.userInterface.setPremium("hd"); 46636 } 46637 }; 46638 46639 L1VideoPlayer.prototype.onclickSettings = function(vol) { 46640 this.pixel("settings"); 46641 this.api.showSettings(); 46642 }; 46643 46644 L1VideoPlayer.prototype.onclickStatistics = function() { 46645 this.pixel("statistics"); 46646 this.api.showStatistics(); 46647 }; 46648 46649 L1VideoPlayer.prototype.onClickCloseAllPopups = function(vol) { 46650 this.pixel("close"); 46651 this.userInterface.closeAllPopups(); 46652 }; 46653 46654 L1VideoPlayer.prototype.closeStream = function(id) { 46655 //var currentStream = this['subPlayer' + id]; 46656 this.setPlayerAktiv(id); 46657 this.subPlayer.closeStream(id); 46658 }; 46659 46660 46661 // -------------------- VIDEO INTERFACE -------------------- 46662 46663 L1VideoPlayer.prototype.videoProgress = function (currentTime, duration, isLive, allowDVR) { 46664 this.userInterface.videoProgress(currentTime, duration, isLive, allowDVR); 46665 }; 46666 46667 46668 L1VideoPlayer.prototype.videoLoading = function (percent, loadStartPercentage) { 46669 this.userInterface.videoLoading(percent, loadStartPercentage); 46670 }; 46671 46672 46673 L1VideoPlayer.prototype.videoPlay = function () { 46674 this.userInterface.videoPlay(); 46675 }; 46676 46677 L1VideoPlayer.prototype.videoPause = function () { 46678 this.userInterface.videoPause(); 46679 }; 46680 46681 L1VideoPlayer.prototype.videoComplete = function () { 46682 this.tracking("complete"); 46683 }; 46684 46685 L1VideoPlayer.prototype.videoError = function (error) { 46686 this.api.showError(error); 46687 }; 46688 46689 L1VideoPlayer.prototype.videoCreateVideoIndexList = function (data) { 46690 //this.userInterface.videoCreateVideoIndexList(data, this.subPlayer.getLanguage(), this.subPlayer.getHdVideoSettings().qualities); 46691 this.userInterface.videoCreateVideoIndexList(data, this.subPlayer.getLanguage(), this.subPlayer.getHdVideoSettings()); 46692 }; 46693 46694 L1VideoPlayer.prototype.videoSwitchVideoIndex = function (newIndex) { 46695 this.userInterface.videoSwitchVideoIndex(newIndex); 46696 }; 46697 46698 L1VideoPlayer.prototype.checkVideoIndex = function (newIndex) { 46699 this.userInterface.checkVideoIndex(newIndex); 46700 }; 46701 46702 46703}()); 46704(function () { 46705 46706 this.L1Stage = function (playerMain) { 46707 this.playerMain = playerMain; 46708 }; 46709 46710 L1Stage.prototype.initStage = function(configObject) { 46711 //this.checkJquery(this); 46712 46713 /* 46714 var script = document.createElement('script'); 46715 script.type = "text/javascript"; 46716 script.src = "//imasdk.googleapis.com/js/sdkloader/ima3.js"; 46717 document.getElementsByTagName('head')[0].appendChild(script); 46718 */ 46719 46720 this.checkConfig(configObject); 46721 this.checkDevice(configObject); 46722 this.playerMain.stageInitComplete(); 46723 }; 46724 46725 L1Stage.prototype.checkConfig = function(configObject) { 46726 46727 if (!configObject.id) { 46728 configObject.id = "L1VideoPlayer"; 46729 } 46730 46731 configObject.container = document.getElementById(configObject.id); 46732 46733 if (!configObject.language) { 46734 configObject.language = "de"; 46735 } 46736 46737 if (configObject.share === undefined) { 46738 configObject.share = true; 46739 } 46740 46741 46742 46743 if (configObject.shareurl === undefined) { 46744 configObject.share = false;
46745 } 46746 46747 if (configObject.showTitlePoster === undefined) { 46748 configObject.showTitlePoster = true; 46749 } 46750 46751 46752 46753 46754 //console.log("SHARE: ", configObject.share, configObject.shareurl); 46755 /* 46756 if (configObject.tracking === undefined) { 46757 if (configObject.trackingjs === undefined) { 46758 configObject.tracking = false; 46759 } else { 46760 configObject.tracking = true; 46761 } 46762 } 46763 */ 46764 46765 if (configObject.volume === undefined) { 46766 configObject.volume = 100; 46767 } 46768 46769 if (configObject.mute) { 46770 configObject.volume = 0; 46771 } 46772 46773 if (configObject.showTitle === undefined) { 46774 configObject.showTitle = true; 46775 } 46776 46777 if (!configObject.startTime) { 46778 configObject.startTime = 0; 46779 } 46780 46781 if (!configObject.autoplay) { 46782 configObject.autoplay = false; 46783 } 46784 46785 if (!configObject.watermarkpos) { 46786 configObject.watermarkpos = "TR"; 46787 } 46788 46789 46790 46791 //configObject.startTime = 200; 46792 //configObject.autoplay = true; 46793 }; 46794 46795 L1Stage.prototype.checkDevice = function(configObject) { 46796 46797 var hlsSupport = !!Hls.isSupported(); 46798 //var mobileSupport = !!/Android|webOS|iPhone|iPod|iPad|SmartTv|SMART-TV|BlackBerry/i.test(navigator.userAgent); 46799 var mobileSupport = false; 46800 var html5Support = (typeof(document.createElement('video').canPlayType) != 'undefined'); 46801 //var hasFlashPlayer = swfobject ? swfobject.getFlashPlayerVersion().major > 9 : false; 46802 var isIE = /Trident\/|MSIE /.test(window.navigator.userAgent); 46803 var isEdge = /Edge\/\d./i.test(navigator.userAgent); 46804 46805 var isWinXP = navigator.userAgent.indexOf('Windows NT 5.1') != -1; 46806 var isWinVista = navigator.userAgent.indexOf('Windows NT 6.0') != -1; 46807 var isWin8 = navigator.userAgent.indexOf('Windows NT 6.2') != -1; 46808 var isWin10 = navigator.userAgent.indexOf('Windows NT 10.0') != -1; 46809 46810 var isAndroid = !!/Android/i.test(navigator.userAgent); 46811 var isIOS = !!/iPhone|iPod|iPad/i.test(navigator.userAgent); 46812 var isBlackberry = !!/BlackBerry|PlayBook/i.test(navigator.userAgent); 46813 var isKindle = !!/Kindle/i.test(navigator.userAgent); 46814 var isWindowsPhone = !!/Windows Phone/i.test(navigator.userAgent); 46815 var isSmartTV = !!/SmartTv|SMART-TV|smarttv|SMARTTV/i.test(navigator.userAgent); 46816 46817 var iosphonemobileweb = !!/iphone|ipod/i.test(navigator.userAgent.toLowerCase()); 46818 var iostabletmobileweb = !!/iPad/i.test(navigator.userAgent.toLowerCase()); 46819 var androidphonemobileweb = !!/android.+(mobile)|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|webOS/i.test(navigator.userAgent.toLowerCase()); 46820 var androidtabletmobileweb = !!/android/i.test(navigator.userAgent.toLowerCase()); 46821 46822 if (isAndroid || isIOS || isBlackberry || isKindle || isWindowsPhone || isSmartTV) { 46823 mobileSupport = true; 46824 } 46825 46826 var deviceObject = { 46827 'hasHTML5HlsSupport': hlsSupport, 46828 'hasHTML5Support': html5Support, 46829 //'hasFlashPlayer': hasFlashPlayer, 46830 'isIE' : isIE, 46831 'isEdge' : isEdge, 46832 46833 'isWinXP' : isWinXP, 46834 'isWinVista' : isWinVista, 46835 'isWin8' : isWin8, 46836 'isWin10' : isWin10, 46837 46838 'isMobile': mobileSupport, 46839 'isAndroid' : isAndroid, 46840 'isIOS' : isIOS, 46841 'isBlackberry' : isBlackberry, 46842 'isKindle' : isKindle, 46843 'isWindowsPhone' : isWindowsPhone, 46844 'isSmartTV' : isSmartTV, 46845 'mobileSupport' : mobileSupport, 46846 'isIosPhone' : iosphonemobileweb, 46847 'isIosTablet' : iostabletmobileweb, 46848 'isAndroidPhone' : androidphonemobileweb, 46849 'isAndroidTablet' : androidtabletmobileweb 46850 }; 46851 46852 configObject.deviceInfo = deviceObject; 46853 }; 46854 46855 46856 46857 46858 L1Stage.prototype.setStage = function() { 46859 46860 var self = this; 46861 46862 $( window ).resize(function() { 46863 self.resize(); 46864 }); 46865 46866 //console.log("ELEMENT: ", $(self.playerMain.playerContainer)[0] ); 46867 var element = $(self.playerMain.playerContainer)[0]; //document.getElementById('myElement'); 46868 // $(self.playerMain.playerContainer) 46869 new ResizeSensor(element, function() { 46870 //console.log('Changed to ' + element.clientWidth); 46871 self.resize(); 46872 }); 46873 46874 $(self.playerMain.playerContainer)[0].onkeydown = function(event) { 46875 //document.onkeydown = function(event) { 46876 if (event.keyCode == 96 || event.keyCode == 82) { 46877 //RESTART 46878 self.playerMain.api.seek(0); 46879 } 46880 46881 if (event.keyCode == 106 || event.keyCode == 13) { 46882 self.playerMain.api.play(); 46883 } 46884 46885 if (event.keyCode == 109) { 46886 self.playerMain.api.pause(); 46887 } 46888 46889 if (event.keyCode == 37 || event.keyCode == 74) { 46890 self.playerMain.api.rewind(); 46891 } 46892 46893 if (event.keyCode == 39 || event.keyCode == 76) { 46894 self.playerMain.api.forward(); 46895 } 46896 46897 if (event.keyCode == 38) { 46898 self.playerMain.api.volume( self.playerMain.api.volume() + 10); 46899 } 46900 46901 if (event.keyCode == 40) { 46902 self.playerMain.api.volume( self.playerMain.api.volume() - 10); 46903 } 46904 46905 if (event.keyCode == 32) { 46906 self.playerMain.api.playOrPause(); 46907 } 46908 46909 if (event.keyCode == 49) { 46910 self.playerMain.api.seekPercent(10); 46911 } 46912 46913 if (event.keyCode == 50) { 46914 self.playerMain.api.seekPercent(20); 46915 } 46916 46917 if (event.keyCode == 51) { 46918 self.playerMain.api.seekPercent(30); 46919 } 46920 46921 if (event.keyCode == 52) { 46922 self.playerMain.api.seekPercent(40); 46923 } 46924 46925 if (event.keyCode == 53) { 46926 self.playerMain.api.seekPercent(50); 46927 } 46928 46929 if (event.keyCode == 54) { 46930 self.playerMain.api.seekPercent(60); 46931 } 46932
46933 if (event.keyCode == 55) { 46934 self.playerMain.api.seekPercent(70); 46935 } 46936 46937 if (event.keyCode == 56) { 46938 self.playerMain.api.seekPercent(80); 46939 } 46940 46941 if (event.keyCode == 57) { 46942 self.playerMain.api.seekPercent(90); 46943 } 46944 46945 if (event.keyCode == 70) { 46946 //self.playerMain.api.fullscreenEnter(); 46947 } 46948 46949 if (event.keyCode == 77) { 46950 self.playerMain.api.muteOrUnmute(); 46951 } 46952 }; 46953 46954 46955 46956 46957 /* 46958 $(document).ready(function(){ 46959 $('input').keypress(function(e){ 46960 if (e.which == 179) 46961 { 46962 self.playerMain.api.playOrPause(); 46963 } 46964 }); 46965 }); 46966 */ 46967 46968 this.resize(); 46969 46970 this.checkIdle(this.playerMain); 46971 }; 46972 46973 46974 46975 /* 46976 L1Stage.prototype.checkJquery = function(self) { 46977 46978 var attemptCount = 0; 46979 46980 if (typeof jQuery == 'undefined') { 46981 console.log("KEIN JQUERY GEFUNDEN!"); 46982 var script = document.createElement('script'); 46983 script.type = "text/javascript"; 46984 script.src = "//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"; 46985 document.getElementsByTagName('head')[0].appendChild(script); 46986 } 46987 46988 function waitForJQuery() { 46989 attemptCount++; 46990 if (typeof jQuery != 'undefined') { // JQuery is loaded! 46991 init(); 46992 return; 46993 } 46994 if (attemptCount < 100) { 46995 setTimeout(waitForJQuery, 100); // Check 10x a second 46996 } 46997 return; 46998 } 46999 47000 function init() { 47001 if (arguments.callee.done) return; 47002 if (typeof jQuery != 'undefined') { 47003 console.log("JQUERY LOADED!"); 47004 arguments.callee.done = true; 47005 self.checkJqueryComplete(self); 47006 } 47007 } 47008 47009 waitForJQuery(); 47010 } 47011 47012 L1Stage.prototype.checkJqueryComplete = function(self) { 47013 self.playerMain.stageCheckComplete(); 47014 } 47015 */ 47016 47017 47018 47019 L1Stage.prototype.checkIdle = function(playerMain) { 47020 47021 var self = this; 47022 47023 $(function() { 47024 //document 47025 $(self.playerMain.playerContainer).idleTimer( 2000 ); 47026 $(self.playerMain.playerContainer).on( "idle.idleTimer", function(event, elem, obj){ 47027 playerMain.userIdle(); 47028 }); 47029 47030 $(self.playerMain.playerContainer).on( "active.idleTimer", function(event, elem, obj, triggerevent){ 47031 playerMain.userActive(); 47032 }); 47033 47034 47035 }); 47036 }; 47037 47038 L1Stage.prototype.resize = function() { 47039 this.resizeHandler(this.playerMain); 47040 }; 47041 47042 L1Stage.prototype.checkFullscreen = function() { 47043 this.fullscreenHandler(this); 47044 }; 47045 47046 L1Stage.prototype.resizeHandler = function(self) { 47047 var playerWidth = $(self.playerContainer).width(); 47048 var playerHeight = (playerWidth / 16) * 9; 47049 47050 var playerWidthL1Player = $(self.l1Player).width(); 47051 47052 $(self.playerContainer).height(playerHeight); 47053 47054 if (self.l1Player !== null) { 47055 if (playerWidthL1Player > 700) { 47056 self.l1Player.className = 'l1ScaleLarge'; 47057 } 47058 47059 if (playerWidthL1Player < 700) { 47060 self.l1Player.className = 'l1ScaleMedium'; 47061 } 47062 47063 if (playerWidthL1Player < 500) { 47064 self.l1Player.className = 'l1ScaleSmall'; 47065 } 47066 47067 if (playerWidthL1Player <= 350) { 47068 self.l1Player.className = 'l1ScaleTiny'; 47069 } 47070 } 47071 47072 self.resizeComplete(); 47073 }; 47074 47075 L1Stage.prototype.getPlayerSize = function(self) { 47076 var playerWidth = $(self.playerContainer).width(); 47077 var playerHeight = (playerWidth / 16) * 9; 47078 47079 var playerSize = { width : playerWidth, height : playerHe
47079ight}; 47080 47081 return playerSize; 47082 }; 47083 47084 47085 L1Stage.prototype.fullscreenHandler = function (self) { 47086 47087 toggleFullScreen(); 47088 47089 function toggleFullScreen() { 47090 if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { 47091 self.enterFullscreen(); 47092 } else { 47093 self.exitFullscreen(); 47094 } 47095 } 47096 }; 47097 47098 L1Stage.prototype.enterFullscreen = function () { 47099 47100 var documentElement = this.playerMain.l1Player; 47101 47102 if (documentElement.requestFullscreen) { 47103 documentElement.requestFullscreen(); 47104 } else if (documentElement.msRequestFullscreen) { 47105 documentElement.msRequestFullscreen(); 47106 } else if (documentElement.mozRequestFullScreen) { 47107 documentElement.mozRequestFullScreen(); 47108 } else if (documentElement.webkitRequestFullscreen) { 47109 documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); 47110 } 47111 }; 47112 47113 L1Stage.prototype.exitFullscreen = function () { 47114 var videoElement = this.playerMain.l1Player.querySelector("#l1pVideoHtml5Element"); 47115 47116 if (document.exitFullscreen) { 47117 document.exitFullscreen(); 47118 } else if (document.msExitFullscreen) { 47119 document.msExitFullscreen(); 47120 } else if (document.mozCancelFullScreen) { 47121 document.mozCancelFullScreen(); 47122 } else if (document.webkitExitFullscreen) { 47123 document.webkitExitFullscreen(); 47124 } 47125 47126 if(this.playerMain.playerConfig.deviceInfo.isMobile) { 47127 //for iphone: 47128 videoElement.webkitExitFullscreen(); 47129 } 47130 47131 }; 47132 47133 L1Stage.prototype.isFullscreen = function(){ 47134 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement; 47135 }; 47136 47137 L1Stage.prototype.handleScroll = function (adComplete, videoElement, callback) { 47138 //console.log('scroll'); 47139 if(!adComplete) { 47140 $(window).bind('scroll', function(){ 47141 handleScrollVisibility(videoElement); 47142 }); 47143 /* 47144 window.addEventListener('scroll', function(){ 47145 handleScrollVisibility(videoElement); 47146 });*/ 47147 47148 } else { 47149 $(window).unbind('scroll'); 47150 /* 47151 window.removeEventListener('scroll', function(){ 47152 handleScrollVisibility(videoElement); 47153 });*/ 47154 } 47155 47156 function handleScrollVisibility(videoElement) { 47157 var isVisible = checkVisible(videoElement); 47158 callback(isVisible); 47159 } 47160 47161 function checkVisible(videoElement){ 47162 var win = window; 47163 47164 var viewport = { 47165 top : win.pageYOffset, 47166 left : win.pageXOffset 47167 }; 47168 47169 viewport.right = viewport.left + win.innerWidth; 47170 viewport.bottom = viewport.top + win.innerHeight; 47171 47172 var height = videoElement.offsetHeight; 47173 var width = videoElement.offsetWidth; 47174 if(!width || !height){ return false; } 47175 47176 var bounds = {}; 47177 bounds.top = videoElement.offsetTop; 47178 bounds.left = videoElement.offsetLeft; 47179 47180 bounds.right = bounds.left + width; 47181 bounds.bottom = bounds.top + height; 47182 47183 var visible = (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 47184 if(!visible){ return false; } 47185 47186 var deltas = { 47187 top : Math.min( 1, ( bounds.bottom - viewport.top ) / height), 47188 bottom : Math.min(1, ( viewport.bottom - bounds.top ) / height), 47189 left : Math.min(1, ( bounds.right - viewport.left ) / width), 47190 right : Math.min(1, ( viewport.right - bounds.left ) / width) 47191 }; 47192 47193 return (deltas.left * deltas.right) >= 1 && (deltas.top * deltas.bottom) >= 1; 47194 } 47195 }; 47196 47197 L1Stage.prototype.handleBlur = function (adComplete, callback) { 47198 //console.log('blur'); 47199 if(!adComplete) { 47200 $(window).bind('blur', function(){ 47201 handleVisibility(callback); 47202 }); 47203 //window.addEventListener('blur', handler); 47204 } else { 47205 $(window).unbind('blur'); 47206 //window.removeEventListener('blur', handler); 47207 } 47208 47209 function handleVisibility() { 47210 var hidden = isHidden(); 47211 if(document[hidden]) { 47212 callback(); 47213 } 47214 } 47215 47216 function isHidden() { 47217 var hidden = null; 47218 47219 if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support 47220 hidden = "hidden"; 47221 } else if (typeof document.msHidden !== "undefined") { 47222 hidden = "msHidden"; 47223 } else if (typeof document.webkitHidden !== "undefined") { 47224 hidden = "webkitHidden"; 47225 } 47226 47227 return hidden; 47228 } 47229 }; 47230 47231 L1Stage.prototype.detectIP = function(playerAdv){ 47232 //console.log('get ip', this, playerAdv); 47233 47234 var self = this; 47235 var element = this.playerMain.l1Player; 47236 47237 element.addEventListener('mousedown', function(e) { 47238 //console.log('mousedown', e); 47239 if(e.target.id == "l1pUIAdText" && e.button === 2) { 47240 47241 e.target.addEventListener('contextmenu', function(e) { 47242 e.preventDefault(); 47243 }); 47244 47245 handleShowButtons(self, playerAdv); 47246 47247 this.removeEventListener('mousedown', arguments.callee); 47248 } 47249 }); 47250 47251 /* 47252 element.addEventListener('contextmenu', function(e) { 47253 console.log("right clicked"); 47254 e.preventDefault(); 47255 });*/ 47256 47257 function handleShowButtons(self, playerAdv) { 47258 /* 47259 self.playerMain.subPlayer.configInterface.loadData('http://whatismyip.akamai.com/', function(response) { 47260 //console.log('Response:', response); 47261 if(response == "80.120.171.50") { 47262 playerAdv.showSkipButton(element); 47263 } 47264 }, function(error){ 47265 console.log('Error'); 47266 });*/ 47267 47268 // get ip: https://jsonip.com/ 47269 self.playerMain.subPlayer.configInterface.loadData('https://freegeoip.net/json/', function(response) { 47270 //console.log('Response:', response); 47271 var jsonResponse = JSON.parse(response); 47272 if(jsonResponse.ip == "80.120.171.50") { 47273 playerAdv.showSkipButton(element); 47274 } 47275 }, function(error){ 47276 console.log('Error'); 47277 }); 47278 47279 } 47280 47281 }; 47282 47283}()); 47284(function () { 47285 /** 47286 * Proxy auf den aktuellen Video player. 47287 */ 47288 47289 this.L1SubPlayer = function (player, id) { 47290 this.player = player; 47291 this.id = id; 47292 this.videoid = ""; 47293 this.partnerid = ""; 47294 this.startAsSubPlayer = false;
47295 this.isActiveSubPlayer = false; 47296 this.videoHasStarted = false; 47297 47298 this.subPlayerContainer = this.player.l1Player.querySelector("#l1pVideo" + String(this.id)); 47299 47300 this.videoConfig = {}; 47301 this.configInterface = new L1Loader(this.videoConfig); 47302 this.videoInterface = new L1VideoInterface(this); 47303 this.subPlayerUI = new L1SubPlayerUI(this, this.subPlayerContainer); 47304 this.adsInterface = new L1Ads(this); 47305 this.analytics = new L1Analytics(this); 47306 47307 this.time = 0; 47308 this.tempCurrentTime = 0; 47309 }; 47310 47311 47312 L1SubPlayer.prototype.start = function (configURL, videoID, partnerID, language, startAsSubPlayer, videoSource, videoAds) { 47313 this.videoid = videoID; 47314 this.partnerid = partnerID; 47315 47316 if (videoSource && Object.keys(videoSource).length > 0) { 47317 this.startPlayer(videoSource, videoAds); 47318 } else { 47319 this.loadConfig(configURL, videoID, partnerID, language, startAsSubPlayer); 47320 } 47321 }; 47322 47323 L1SubPlayer.prototype.startPlayer = function (videoSource, videoAds) { 47324 var self = this; 47325 var playerSource = null; 47326 47327 this.videoConfig.hdVideo = {}; 47328 this.videoConfig.streamData = {}; 47329 this.videoConfig.streamAccess = { "premium" : { "allowDVR" : false } }; 47330 47331 if(this.player.playerConfig.deviceInfo.isIE) { 47332 playerSource = videoSource.hls; 47333 } else if(this.player.playerConfig.deviceInfo.isMobile) { 47334 playerSource = videoSource.hls; 47335 } else if(videoSource.dash) { 47336 playerSource = videoSource.dash; 47337 } else { 47338 playerSource = videoSource.hls; 47339 } 47340 47341 this.videoConfig.streamData.url = playerSource; 47342 this.videoConfig.hdVideo.werbung = videoAds; 47343 47344 this.player.userInterface.disableHD(); 47345 this.player.userInterface.disableOcotoshape(); 47346 this.player.userInterface.disableMultiview(); 47347 47348 if(this.player.playerConfig.deviceInfo.isMobile === true) { 47349 this.subPlayerUI.showAutoplay(); 47350 $(this.player.playerContainer).find("#l1pUIPopUpsAutoplay").off(); 47351 47352 $(this.player.playerContainer).find("#l1pPlayer").bind('click', function() { 47353 $(this).unbind('click'); 47354 47355 self.subPlayerUI.hideAutoplay(); 47356 47357 self.player.setPlayerAktiv(self.id); 47358 self.adsInterface.init(); 47359 self.readyToStartVideo(); 47360 }); 47361 47362 }else { 47363 this.player.setPlayerAktiv(this.id); 47364 this.adsInterface.init(); 47365 this.readyToStartVideo(); 47366 } 47367 }; 47368 47369 L1SubPlayer.prototype.setActive = function () { 47370 this.isActiveSubPlayer = true; 47371 47372 this.player.api.volume(this.player.playerConfig.volume); 47373 this.setVolume(this.player.playerConfig.volume); 47374 47375 $(this.subPlayerContainer).removeClass().addClass( "l1pVideoSubPlayer l1pVideoSubPlayerActive" ); 47376 47377 if (this.getPaused()) { 47378 this.videoPause(); 47379 } else { 47380 this.videoPlay(); 47381 } 47382 47383 var currentLevel = this.videoInterface.getCurrentLevel(); 47384 if(currentLevel) { 47385 var loadlevel = (currentLevel === -1) ? 0 : currentLevel; 47386 //console.log('set Video Active', currentLevel, loadlevel); 47387 this.player.checkVideoIndex(loadlevel); 47388 this.player.videoSwitchVideoIndex(loadlevel); 47389 } 47390 47391 }; 47392 47393 L1SubPlayer.prototype.setInActive = function () { 47394 this.isActiveSubPlayer = false; 47395 this.setVolume(0); 47396 47397 $(this.subPlayerContainer).removeClass().addClass( "l1pVideoSubPlayer l1pVideoSubPlayerInActive" ); 47398 }; 47399 47400 L1SubPlayer.prototype.destroy = function () { 47401 this.isActiveSubPlayer = false; 47402 this.setVolume(0); 47403 47404 this.videoInterface.destroy(); 47405 47406 $(this.subPlayerContainer).removeClass().addClass( "l1pVideoSubPlayer l1pVideoSubPlayerInActive" ); 47407 }; 47408 47409 L1SubPlayer.prototype.closeStream = function (id) { 47410 //console.log('close Stream', this); 47411 this.videoInterface.closeStream(id); 47412 47413 this.videoid = ""; 47414 this.isActiveSubPlayer = false;
47415 47416 $(this.subPlayerContainer).removeClass().addClass( "l1pVideoSubPlayer l1pVideoSubPlayerInActive" ); 47417 47418 $(this.subPlayerContainer).find('#l1pUIPopUpsCloseVideoBtn').removeClass('l1pShow').addClass('l1pHide'); 47419 $(this.subPlayerContainer).find('#l1pUIPopUpsOpenVideoBtn').removeClass('l1pHide').addClass('l1pShow'); 47420 47421 $(this.subPlayerContainer).find('#l1pUIWatermark').find('img').replaceWith('<img>'); 47422 47423 this.player.setPlayerAktiv(0); 47424 }; 47425 47426 // -------------------- CONFIG -------------------- 47427 47428 L1SubPlayer.prototype.loadConfig = function (configURL, videoID, partnerID, language, startAsSubPlayer) { 47429 var self = this; 47430 47431 this.startAsSubPlayer = startAsSubPlayer; 47432 47433 //var urlToLoad = 'http://www.laola1.tv/service/player/videoConfig.php?videoid=718524&partnerid=24&language=de&format=iphone&width=800&test=abc'; 47434 var urlToLoad = configURL + "?videoid=" + videoID + "&partnerid=" + partnerID + "&language=" + language + "&format=iphone"; 47435 47436 //console.log("configData", this.player.playerConfig.configData); 47437 if(this.player.playerConfig.v5ident) { 47438 urlToLoad += "&v5ident=" + this.player.playerConfig.v5ident; 47439 } 47440 47441 if(this.player.playerConfig.portalid) { 47442 urlToLoad += "&portal=" + this.player.playerConfig.portalid; 47443 } 47444 47445 if(this.player.playerConfig.configData) { 47446 urlToLoad += "&" + this.player.playerConfig.configData; 47447 } 47448 47449 if (videoID && partnerID) { 47450 this.configInterface.loadHDVideo(urlToLoad, 47451 function(response) { self.configLoadedComplete(response); }, 47452 function(errorMeldung, errorCode){ self.configLoadedError(errorMeldung, errorCode); } 47453 ); 47454 } else { 47455 this.player.api.showError("video/partner-ID Error"); 47456 } 47457 }; 47458 47459 47460 L1SubPlayer.prototype.configLoadedComplete = function (response) { 47461 47462 this.videoConfig.hdVideo = JSON.parse(response); 47463 47464 if (this.videoConfig.hdVideo.hasOwnProperty('error')) { 47465 this.player.api.showError("configLoadError"); 47466 return; 47467 } 47468 47469 if (!this.player.playerConfig.deviceInfo.isEdge) { 47470 if (this.player.playerConfig.deviceInfo.isIE || this.player.playerConfig.deviceInfo.isWinXP || this.player.playerConfig.deviceInfo.isWinVista) { 47471 //if(!this.player.playerConfig.deviceInfo.hasHTML5HlsSupport) { 47472 if (!this.player.playerConfig.deviceInfo.isMobile) { 47473 this.videoConfig.hdVideo.video.streamAccess = this.videoConfig.hdVideo.video.streamAccess.replace('&format=iphone', '&format=desktop'); 47474 } 47475 //} 47476 } 47477 } 47478 //this.videoConfig.hdVideo.video.streamAccess = this.videoConfig.hdVideo.video.streamAccess.replace('&format=iphone', '&format=desktop'); 47479 //console.log('streamAccess', this.videoConfig.hdVideo.video.streamAccess); 47480 47481 this.analytics.setAnalytics(this.videoConfig.hdVideo.settings.akamaianalytics); 47482 47483 if (this.videoConfig.hdVideo.video.isLivestream && !this.videoConfig.hdVideo.video.isLive) { 47484 this.player.userInterface.setCountdown(this.videoConfig.hdVideo.video.title, this.videoConfig.hdVideo.video.image, this.videoConfig.hdVideo.video.startDate, this.videoConfig.hdVideo.language); 47485 this.checkCountdown(); 47486 } else { 47487 47488 this.subPlayerUI.setAutoplay(this.videoConfig.hdVideo.video.title, this.videoConfig.hdVideo.video.image, this.player.playerConfig.showTitlePoster); 47489 //this.player.userInterface.setShare(this.videoConfig.share, this.videoConfig.shareurl, this.videoConfig.sharejs, this.videoConfig.hdVideo.language.share, this.videoConfig.hdVideo.language.copy); 47490 47491 47492 //this.player.userInterface.setShare(this.getShare(), this.videoConfig.hdVideo.language.share, this.videoConfig.hdVideo.language.copy); 47493 //this.player.userInterface.setSettings(); 47494 //this.player.userInterface.setRelated(this.videoConfig.hdVideo.related, this.videoConfig.hdVideo.language.related, this.videoConfig.hdVideo.language.recommendable); 47495 this.player.userInterface.setError(); 47496 this.player.userInterface.setLanguage(this.getLanguage()); 47497 //this.player.userInterface.setTitle(this.videoConfig.hdVideo.title, this.videoConfig.showtitle); //this.videoConfig.hdVideo.title 47498 47499 /* 47500 if (this.player.playerConfig.watermark) { 47501 this.subPlayerUI.setWatermark(this.player.playerConfig.watermark, this.player.playerConfig.watermarkpos); 47502 } 47503 */ 47504 if (this.videoConfig.hdVideo.settings.watermark.visible) { 47505 this.subPlayerUI.setWatermark(this.videoConfig.hdVideo.settings.watermark.url, this.videoConfig.hdVideo.settings.watermark.pos); 47506 } 47507 47508 /*if (this.startAsSubPlayer) { 47509 this.this.onAutoplayClick(); 47510 } 47511 else { 47512 //this.subPlayerUI.showAutoplay(); 47513 this.checkAutoplay(); 47514 }*/ 47515 47516 this.checkAutoplay(); 47517 } 47518 }; 47519 47520 L1SubPlayer.prototype.configLoadedError = function (errorMeldung, errorCode) { 47521 this.player.api.showError("configLoadError"); 47522 }; 47523 47524 L1SubPlayer.prototype.loadStreamaccess = function () { 47525 this.videoConfig.status = "loadStreamaccess"; 47526 var self = this; 47527 47528 var url = self.videoConfig.hdVideo.video.streamAccess; 47529 47530 //var req_liga_abos = "tv.laola1.laolatv.premiumclub,tv.laola1.laolatv.premiumclub_all_access"; 47531 //var checkAbosValue = req_liga_abos ? req_liga_abos.split(',') : []; 47532 //var videoAbos = JSON.stringify(checkAbosValue); 47533 47534 47535 var videoAbos; 47536 try { 47537 //videoAbos = self.videoConfig.hdVideo.video.abo.required; 47538 videoAbos = JSON.stringify(self.videoConfig.hdVideo.video.abo.required); 47539 } catch(err) { 47540 47541 } 47542 //var url = "https://club.laola1.tv/sp/laola1/api/v3/user/session/premium/player/stream-access?videoId=303342&target=17&label=&area=ice_hockey_oeehv_national_team&format=iphone"; 47543 47544 self.configInterface.loadStreamAccess(url, 47545 function(response) { self.streamaccessLoadedComplete(response); }, 47546 function(errorMeldung, errorCode){ self.streamaccessLoadedError(errorMeldung, errorCode); }, 47547 videoAbos 47548 ); 47549 }; 47550 47551 L1SubPlayer.prototype.streamaccessLoadedComplete = function (response) { 47552 this.videoConfig.streamAccess = JSON.parse(response); 47553 47554 var organisation = this.videoConfig.hdVideo.video.metaInformation.organisation; 47555 //console.log('streamAccess', this.videoConfig.streamAccess); 47556 47557 if (!this.videoConfig.streamAccess.data.user) { 47558 this.videoConfig.streamAccess.data.user = 0; 47559 } 47560 47561 this.videoConfig.streamAccess.premium = {}; 47562 this.videoConfig.streamAccess.premium.allowDVR = true; 47563 if (this.videoConfig.streamAccess.status == "success") { 47564 this.videoConfig.streamAccess.premium.allowHD = true; 47565 if(this.videoConfig.hdVideo.werbung.hasOwnProperty('premium') 47566 && (this.player.playerConfig.partnerid == 1 || this.player.playerConfig.partnerid == 22) 47567 && organisation.substr(0,3).indexOf('EHF') == -1 47568 ) { 47569 this.videoConfig.hdVideo.werbung = this.videoConfig.hdVideo.werbung.premium; 47570 } else { 47571 setClassicAd(this); 47572 } 47573 } else { 47574 this.videoConfig.streamAccess.premium.allowHD = false;
47575 if(this.player.playerConfig.partnerid == "1" && organisation.substr(0,3).indexOf('EHF') == -1) { 47576 //HOTFIX FÃR EHF, SPÃTER WIEDER AUF FALSE STELLEN 47577 this.videoConfig.streamAccess.premium.allowDVR = false; 47578 } 47579 47580 if(organisation === "DFL Deutsche FuÃball Liga") { 47581 this.videoConfig.streamAccess.premium.allowHD = true; 47582 this.videoConfig.streamAccess.premium.allowDVR = true; 47583 } 47584 47585 setClassicAd(this); 47586 47587 //multiple Devices 47588 if(this.videoConfig.streamAccess.code === 7) { 47589 if(this.videoConfig.hdVideo.video.isLivestream === true) { 47590 //this.player.api.showError(this.videoConfig.streamAccess.message); 47591 this.player.api.showError(this.videoConfig.hdVideo.language['multiple_devices']); 47592 return ; 47593 } else { 47594 //VOD 47595 this.videoConfig.streamAccess.premium.allowHD = true; 47596 } 47597 } 47598 47599 //this.videoConfig.hdVideo.video.metaInformation.organisation = "FREE - mobile free" 47600 //Laola1.tv mobile livestreams 47601 if(this.player.playerConfig.partnerid === '1' && 47602 this.player.playerConfig.deviceInfo.isMobile === true && 47603 this.videoConfig.hdVideo.video.isLivestream === true && 47604 this.videoConfig.hdVideo.video.metaInformation.organisation.substr(0,3).indexOf('EHF') == -1 ) 47605 { 47606 if (this.videoConfig.hdVideo.video.metaInformation 47607 && this.videoConfig.hdVideo.video.metaInformation.organisation !== "DFL Deutsche FuÃball Liga" 47608 && this.videoConfig.hdVideo.video.metaInformation.organisation !== "FREE - mobile free" 47609 && this.videoConfig.hdVideo.video.metaInformation.liga !== 'ETTU European Youth Championships' 47610 && this.videoConfig.hdVideo.video.metaInformation.liga !== 'ETTU Jugend-Europameisterschaft' 47611 && this.videoConfig.hdVideo.video.metaInformation.liga !== 'ETTU Europe Youth Top 10' 47612 && this.videoConfig.hdVideo.video.metaInformation.liga !== 'ETTU Europas Jugend Top 10') 47613 { 47614 this.player.api.showError( 47615 this.videoConfig.hdVideo.language['fehler_premium'], 47616 { 47617 "errortext" : this.videoConfig.hdVideo.language['fehler_errortext_premium'], 47618 "loggedtext" : this.videoConfig.hdVideo.language['fehler_logged_premium'], 47619 "buttontext" : this.videoConfig.hdVideo.language['fehler_premium_button'] 47620 } 47621 ); 47622 47623 return ; 47624 } 47625 } 47626 } 47627 47628 /* 47629 //check if mobile livestream is allowed 47630 if(this.player.playerConfig.deviceInfo.isMobile === true && this.videoConfig.hdVideo.video.isLivestream === true && this.videoConfig.hdVideo.video.allowMobileLive === false) { 47631 this.player.api.showError(this.videoConfig.streamAccess.message); 47632 return; 47633 } 47634 */ 47635 47636 47637 if (this.videoConfig.streamAccess.data["stream-access"][0]) { 47638 if (this.videoConfig.hdVideo.video.streamPay == "pay" && this.videoConfig.streamAccess.status == "error") { 47639 this.player.api.showError("streamAccessError: " + this.videoConfig.streamAccess.code + " " + this.videoConfig.streamAccess.message); 47640 } else { 47641 this.loadStreamData(); 47642 } 47643 } else { 47644 this.player.api.showError("streamAccessError: " + this.videoConfig.streamAccess.code + " " + this.videoConfig.streamAccess.message); 47645 } 47646 /* 47647 if (this.videoConfig.streamAccess.status == "success") { 47648 this.loadStreamData(); 47649 } else { 47650 if (this.videoConfig.streamAccess.code == 7) { 47651 this.loadStreamData(); 47652 } else { 47653 this.player.api.showError("streamAccessError: " + this.videoConfig.streamAccess.code + " " + this.videoConfig.streamAccess.message); 47654 } 47655 } 47656 */ 47657 function setClassicAd(self) { 47658 if(self.videoConfig.hdVideo.werbung.hasOwnProperty('classic')) { 47659 self.videoConfig.hdVideo.werbung = self.videoConfig.hdVideo.werbung.classic; 47660 } 47661 } 47662 47663 }; 47664 47665 L1SubPlayer.prototype.streamaccessLoadedError = function (errorMeldung, errorCode) { 47666 this.player.api.showError("streamAccessLoadError"); 47667 }; 47668 47669 // -------------------- STREAMDATA -------------------- 47670 47671 L1SubPlayer.prototype.loadStreamData = function () { 47672 this.videoConfig.status = "loadStreamData"; 47673 var self = this; 47674 47675 this.configInterface.loadStreamData(this.videoConfig.streamAccess.data["stream-access"][0], 47676 function(response) { self.streamDataLoadedComplete(response); }, 47677 function(errorMeldung, errorCode){ self.streamDataLoadedError(errorMeldung, errorCode); } 47678 ); 47679 }; 47680 47681 L1SubPlayer.prototype.streamDataLoadedComplete = function (response) { 47682 var streamDataXml = $.parseXML(response); 47683 var bitrate = 10000; 47684 //var streamDataObject = $(streamDataXml).find("auth"); 47685 47686 this.player.userInterface.disableHD(); 47687 this.player.userInterface.disableOcotoshape(); 47688 this.player.userInterface.disableMultiview(); 47689 47690 this.player.userInterface.enableHD(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.metaInformation.organisation); 47691 this.player.userInterface.enableMultiview(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.isLivestream, this.videoConfig.hdVideo.video.metaInformation.organisation); 47692 47693 if (this.videoConfig.streamAccess.premium.allowHD) { 47694 //this.player.userInterface.enableHD(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.metaInformation.organisation); 47695 //this.player.userInterface.enableMultiview(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.isLivestream, this.videoConfig.hdVideo.video.metaInformation.organisation); 47696 this.player.userInterface.enableOcotoshape(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.isLivestream, this.videoConfig.hdVideo.video.metaInformation.organisation); 47697 bitrate = 10000; 47698 } else { 47699 this.player.userInterface.disablePremiumEvents(this.player.playerConfig.partnerid, this.videoConfig.hdVideo.video.isLivestream, this.videoConfig.streamAccess.premium.allowDVR, this.videoConfig.hdVideo.video.metaInformation.organisation); 47700 if(this.videoConfig.hdVideo.video.metaInformation.organisation.substr(0,3).indexOf('EHF') == -1) { 47701 bitrate = 1700; 47702 } 47703 } 47704 47705 var streamDataObject = { 47706 auth: $(streamDataXml).find('token').attr('auth'), 47707 //if(premium) 47708 url: $(streamDataXml).find('token').attr('url') + "?hdnea=" + $(streamDataXml).find('token').attr('auth') + "&custom-mdt=on&b=0-" + bitrate, 47709 //url: $(streamDataXml).find('token').attr('url') + "?hdnea=" + $(streamDataXml).find('token').attr('auth'), 47710 //&b=0-2000 47711 stream: $(streamDataXml).find('token').attr('stream'), 47712 status: $(streamDataXml).find('token').attr('status'), 47713 statustext: $(streamDataXml).find('token').attr('statustext'), 47714 aifp: $(streamDataXml).find('token').attr('aifp') 47715 }; 47716 47717 //console.log('streamData', streamDataObject); 47718 this.videoConfig.streamData = streamDataObject; 47719 47720 if (this.videoConfig.streamData.status === "0") { 47721 47722 if (this.startAsSubPlayer) { 47723 this.startMainVideo(); 47724 } 47725 else { 47726 this.readyToStartVideo(); 47727 } 47728 47729 } 47730 else if (this.videoConfig.streamData.status === "-1") { 47731 this.player.api.showError(this.videoConfig.hdVideo.language.errorGeo); 47732 } 47733 47734 else { 47735 this.player.api.showError("streamDataError: " + this.videoConfig.streamData.status + " " + this.videoConfig.streamData.statustext); 47736 } 47737 }; 47738 47739 L1SubPlayer.prototype.streamDataLoadedError = function (errorMeldung, errorCode) { 47740 this.player.api.showError("streamDataLoadError"); 47741 }; 47742 47743 // -------------------- LIVE-STREAMS -------------------- 47744 47745 L1SubPlayer.prototype.loadLiveStreams = function (id, lang, portal, partner, url) { 47746 this.videoConfig.status = "loadLiveStreams"; 47747 47748 portal = portal || "at"; 47749 47750 var self = this; 47751 47752 if (!url) { 47753 url = "//www.laola1.tv/service/player/live-streams.php?partnerid=" + partner + "&language=" + lang + "&portal=" + portal + ""; 47754 } else { 47755 url = url + "?partnerid=" + partner + "&language=" + lang + "&portal=" + portal + ""; 47756 } 47757 47758 //TEST PORTAL "http://intg-titan-laola1-tv-2015.laola1.at/service/player/live-streams.php?partnerid=1&language=en&portal=at"; 47759
47760 $('.l1pUIPopUpsStreamsSlider').html("<p class='saving'>" + this.videoConfig.hdVideo.language.stream_load + "<span>.</span><span>.</span><span>.</span></p>"); 47761 var interval = setInterval(function() { 47762 if(!$('.l1pUIPopUpsStreamsSlider').children().is('p')) { 47763 clearInterval(interval); 47764 } 47765 }, 100); 47766 47767 this.configInterface.loadLiveStreams(url, 47768 function(response) { self.liveStreamsLoadedComplete(id, response); }, 47769 function(errorMeldung, errorCode){ self.liveStreamsLoadedError(errorMeldung, errorCode); } 47770 ); 47771 }; 47772 47773 L1SubPlayer.prototype.liveStreamsLoadedComplete = function (id, response) { 47774 this.videoConfig.liveStream = JSON.parse(response); 47775 //this.player.userInterface.showStreams(this.id, this.videoConfig.liveStream); 47776 this.player.userInterface.setMultiviewStreamSelection(id, this.videoConfig.liveStream, this.videoConfig.hdVideo.language); 47777 }; 47778 47779 L1SubPlayer.prototype.liveStreamsLoadedError = function (errorMeldung, errorCode) { 47780 this.player.api.showError("liveStreamsLoadError"); 47781 }; 47782 47783 // -------------------- VIDEO -------------------- 47784 47785 L1SubPlayer.prototype.checkAutoplay = function () { 47786 this.videoConfig.status = "autoplay"; 47787 //this.api.resize(); 47788 47789 if (this.player.playerConfig.deviceInfo.isMobile === false && ( this.startAsSubPlayer || this.player.playerConfig.autoplay) ) { 47790 this.onAutoplayStart(); 47791 } else { 47792 this.subPlayerUI.showAutoplay(); 47793 } 47794 // if (this.videoConfig.autoplay) { 47795 // this.onAutoplayClick(); 47796 // } else { 47797 // this.subPlayerUI.showAutoplay(); 47798 // } 47799 }; 47800 47801 L1SubPlayer.prototype.checkCountdown = function () { 47802 this.videoConfig.status = "countdown"; 47803 this.subPlayerUI.showCountdown(); 47804 //this.api.resize(); 47805 47806 // this.onAutoplayClick(); 47807 47808 //this.checkAutoplay(); 47809 }; 47810 47811 L1SubPlayer.prototype.readyToStartVideo = function () { 47812 this.adsPrerollStart(); 47813 //this.adsPrerollComplete(); 47814 }; 47815 47816 //this.subPlayer.videoInterface.generatePlayer(this, this.subPlayer.config.streamData.url); 47817 47818 L1SubPlayer.prototype.adsPrerollStart = function() { 47819 this.videoConfig.status = "prerolls"; 47820 // this.userInterface.hideControls(); 47821 // this.userInterface.showAds(); 47822 47823 //var prerolls = []; 47824 //prerolls[0] = { position: "preroll1", url: "http://aus.laola1.tv/RealMedia/ads/adstream_sx.ads/vfbtv.de/interviews/18148520@Video1" }; 47825 //prerolls[1] = { position: "preroll1", url: "http://webat3.laola1.at/demo/flash/videoplayer/werbung/preroll_sma.php" }; 47826 //prerolls[2] = { position: "preroll1", url: "http://webat3.laola1.at/demo/flash/videoplayer/werbung/preroll_sma.php" }; 47827 //this.adsInterface.startPrerolls(prerolls); 47828 47829 //console.log("START PREROLLS!", this.videoConfig.hdVideo.werbung.prerolls); 47830 47831 //this.adsPrerollComplete(); 47832 47833 if(this.videoConfig.hdVideo.werbung && this.videoConfig.hdVideo.werbung.prerolls && this.videoConfig.hdVideo.werbung.prerolls.length > 0) { 47834 //console.log("adsPrerollStart"); 47835 this.adsInterface.startPrerolls(this.videoConfig.hdVideo.werbung.prerolls); 47836 } else { 47837 //console.log("adsPrerollStart adsPrerollComplete"); 47838 this.adsPrerollComplete(); 47839 } 47840 }; 47841 47842 L1SubPlayer.prototype.adsPrerollComplete = function () { 47843 this.startMainVideo(); 47844 }; 47845 47846 L1SubPlayer.prototype.adsMidrollStart = function(trigger) { 47847 47848 this.pause(); 47849 this.videoConfig.status = "midrolls"; 47850 47851 var prerolls = []; 47852 //prerolls[0] = { position: "preroll1", url: "http://aus.laola1.tv/RealMedia/ads/adstream_sx.ads/vfbtv.de/interviews/18148520@Video1" }; 47853 //prerolls[1] = { position: "preroll1", url: "http://webat3.laola1.at/demo/flash/videoplayer/werbung/preroll_adv.php" }; 47854 //prerolls[2] = { position: "preroll1", url: "http://webat3.laola1.at/demo/flash/videoplayer/werbung/preroll_sma.php" }; 47855 47856 if(this.videoConfig.hdVideo.werbung && this.videoConfig.hdVideo.werbung.trigger) { 47857 //this.adsInterface.startMidrolls(this.videoConfig.hdVideo.werbung.midrolls); 47858 this.tempCurrentTime = this.getCurrentTime(); 47859 console.log("START WERBEINSEL, time: ", this.tempCurrentTime); 47860 if(trigger === "insel") { 47861 this.adsInterface.startMidrolls(this.videoConfig.hdVideo.werbung.trigger.werbeinseln); 47862 } else if(trigger === "overlay") { 47863 this.adsInterface.startMidrolls(this.videoConfig.hdVideo.werbung.trigger.invideos); 47864 } else if(trigger === "midroll") { 47865 this.adsInterface.startMidrolls(this.videoConfig.hdVideo.werbung.trigger.midrolls); 47866 } else if(trigger === "split") { 47867 if(this.player.playerConfig.deviceInfo.isMobile === false) { 47868 this.adsInterface.startMidrolls(this.videoConfig.hdVideo.werbung.trigger.splitscreens); 47869 this.adsInterface.isSplitScreen = true; 47870 } else { 47871 this.play(); 47872 } 47873 } 47874 47875 } else { 47876 this.adsMidrollComplete(); 47877 } 47878 47879 }; 47880 47881 L1SubPlayer.prototype.adsMidrollComplete = function () { 47882 this.play(); 47883 console.log("midroll Complete!"); 47884 //if (this.tempCurrentTime != 0) { 47885 console.log("seek to ", this.getDuration()); 47886 this.seek(this.getDuration()); 47887 //} 47888 //console.log("MIDROLLS COMPLETE!"); 47889 this.videoConfig.status = "video"; 47890 //this.startMainVideo(); 47891 }; 47892 47893 L1SubPlayer.prototype.adsPostrollStart = function() { 47894 this.videoConfig.status = "postrolls"; 47895 this.player.userInterface.hideControls(); 47896 //this.userInterface.showAds(); 47897 //this.adsInterface.startPostrolls(this.videoConfig.hdVideo.werbung.postrolls); 47898 47899 if(this.videoConfig.hdVideo.werbung && this.videoConfig.hdVideo.werbung.postrolls && this.videoConfig.hdVideo.werbung.postrolls.length > 0) { 47900 this.adsInterface.startPostrolls(this.videoConfig.hdVideo.werbung.postrolls); 47901 } else { 47902 this.adsPostrollComplete(); 47903 } 47904 }; 47905 47906 L1SubPlayer.prototype.adsPostrollComplete = function() { 47907 this.videoConfig.status = "related"; 47908 //this.userInterface.hideAds(); 47909 47910 //console.log('postroll complete', this); 47911 47912 if(this.player.playerConfig.deviceInfo.isIOS) { 47913 this.videoInterface.actualPlayer.videoElement.src = this.videoConfig.streamData.url; 47914 $('#l1pVideoHtml5Element')[0].webkitExitFullscreen(); 47915 } 47916 /* 47917 if(!this.player.config.deviceInfo.isMobile) { 47918 this.player.userInterface.showControls(); 47919 } 47920 */ 47921 47922 this.player.api.fullscreenExit(); 47923 this.player.api.showRelated(); 47924 }; 47925 47926 47927 L1SubPlayer.prototype.adsStart = function() { 47928 this.adsInterface.showAds(); 47929 }; 47930 47931 L1SubPlayer.prototype.adsComplete = function() { 47932 this.adsInterface.hideAds(); 47933 }; 47934 47935 L1SubPlayer.prototype.startMainVideo = function () { 47936 this.player.pixelGA("play"); 47937 this.analytics.startMainVideo(); 47938 47939 this.startSession(); 47940 47941 this.videoConfig.status = "video"; 47942 this.videoInterface.generatePlayer(this.videoConfig.streamData.url, this.subPlayerContainer, this.player.playerConfig.deviceInfo); 47943 47944 if(this.player.playerConfig.deviceInfo.isMobile) { 47945 this.player.userInterface.hideControls(); 47946 this.adsInterface.videoElement.controls = true; 47947 } else { 47948 this.player.userInterface.showControls(); 47949 } 47950 }; 47951 47952 47953 // -------------------- UI -------------------- 47954 47955 L1SubPlayer.prototype.resize = function () { 47956 if (this.adsInterface) { 47957 if ($(this.player.playerContainer).find("#l1pUIControl
47957s").attr('class') == "l1pFadeIn" || $(this.player.playerContainer).find("#l1pUIControls").attr('class') == "l1pShow" ) { 47958 this.adsInterface.resize(true); 47959 } else { 47960 this.adsInterface.resize(false); 47961 } 47962 } 47963 }; 47964 47965 L1SubPlayer.prototype.onAutoplayClick = function () { 47966 this.player.onAutoplayClick(); 47967 //this.onAutoplayStart(); 47968 }; 47969 47970 L1SubPlayer.prototype.onAutoplayStart = function () { 47971 //this.tracking("click", "play"); 47972 //this.api.volume(this.videoConfig.volume); 47973 this.player.setPlayerAktiv(this.id); 47974 this.adsInterface.init(this.videoConfig.hdVideo.settings); 47975 this.loadStreamaccess(); 47976 this.subPlayerUI.hideAutoplay(); 47977 }; 47978 47979 L1SubPlayer.prototype.onUserClickAreaClick = function () { 47980 if (this.player.playerConfig.videoSource && (this.player.playerConfig.videoSource.dash !== "" || this.player.playerConfig.videoSource.hls !== "")) { 47981 this.player.onclickPlayPause(); 47982 return; 47983 } 47984 47985 if (!this.videoid) { 47986 this.player.openStreamSelects(this.id); 47987 } else { 47988 if (this.isActiveSubPlayer) { 47989 this.player.onclickPlayPause(); 47990 } else { 47991 this.player.setPlayerAktiv(this.id); 47992 } 47993 } 47994 47995 //QUICK FIX 47996 //this.player.onclickPlayPause(); 47997 }; 47998 47999 L1SubPlayer.prototype.onUserClickAreaDBClick = function () { 48000 this.player.onclickFullscreen(); 48001 //this.player.api.fullscreenToggle(); 48002 }; 48003 48004 L1SubPlayer.prototype.setClickStream = function () { 48005 this.player.openStreamSelects(this.id); 48006 }; 48007 48008 48009 L1SubPlayer.prototype.startSession = function () { 48010 48011 this.time = Date.now(); 48012 48013 var allow = false; 48014 var url = ""; 48015 var method; 48016 var ticket = JSON.stringify({ 48017 cmd : "getkey", 48018 url : encodeURIComponent(window.location.href), 48019 time: this.time, 48020 expire : "310", 48021 target: "web", 48022 play: this.player.playerConfig.videoid 48023 }); 48024 48025 try{ 48026 if(this.videoConfig.hdVideo.settings.heartbeat) { 48027 allow = this.videoConfig.hdVideo.settings.heartbeat.enabled; 48028 url = this.videoConfig.hdVideo.settings.heartbeat.url; 48029 method = this.videoConfig.hdVideo.settings.heartbeat.method; 48030 } 48031 } catch(err) { 48032 48033 } 48034 48035 if(url && this.player.playerConfig.ticket) { 48036 ticket = this.player.playerConfig.ticket; 48037 if (url.indexOf("{{Ticket}}") > 0) { 48038 url = url.replace("{{Ticket}}", ticket); 48039 } 48040 } 48041 48042 if (JSON.parse(allow) === true && url !== null) { 48043 this.checkSession(url, method, ticket); 48044 } 48045 }; 48046 48047 L1SubPlayer.prototype.checkSession = function (url, method, ticket) { 48048 var self = this; 48049 48050 if (url) { 48051 this.configInterface.loadHeartbeat(url, 48052 function(response) { self.loadSessionComplete(response); }, 48053 function(errorMeldung, errorCode){ self.loadSessionError(errorMeldung, errorCode); }, method, ticket 48054 ); 48055 } 48056 }; 48057 48058 L1SubPlayer.prototype.loadSessionComplete = function (response) { 48059 var sessionJSON = JSON.parse(response); 48060 //console.log("SESSION COMPLETE", response, sessionJSON.success); 48061 48062 if(sessionJSON.success === false) { 48063 //console.log("SESSION SUCCESS FALSE"); 48064 this.player.api.showError("getKeyError"); 48065 this.destroy(); 48066 } 48067 }; 48068 48069 L1SubPlayer.prototype.loadSessionError = function (errorMeldung, errorCode) { 48070 //console.log("SESSION ERROR", errorMeldung); 48071 this.player.api.showError("heartbeat"); 48072 this.destroy(); 48073 }; 48074 48075 var timerHeartbeat; 48076 48077 L1SubPlayer.prototype.startHeartbeat = function () { 48078 48079 var allow = false; 48080 var url = ""; 48081 var time; 48082 var method; 48083 var js; 48084 var ticket = JSON.stringify({ 48085 cmd : "heartbeat", 48086 url : encodeURIComponent(window.location.href), 48087 time: this.time, 48088 expire : "310", 48089 target: "web" 48090 }); 48091 48092 /* 48093 this.videoConfig.hdVideo.settings.heartbeat = []; 48094 this.videoConfig.hdVideo.settings.heartbeat.enabled = true; 48095 this.videoConfig.hdVideo.settings.heartbeat.url = "https://www.telekomeishockey.de/service/player/heartbeat.php"; 48096 this.videoConfig.hdVideo.settings.heartbeat.time = 30; 48097 this.videoConfig.hdVideo.settings.heartbeat.method = "POST"; 48098 this.videoConfig.hdVideo.settings.heartbeat.js = ""; 48099 */ 48100 48101 try{ 48102 allow = this.videoConfig.hdVideo.settings.heartbeat.enabled; 48103 url = this.videoConfig.hdVideo.settings.heartbeat.url; 48104 time = this.videoConfig.hdVideo.settings.heartbeat.time; 48105 method = this.videoConfig.hdVideo.settings.heartbeat.method; 48106 js = this.videoConfig.hdVideo.settings.heartbeat.js; 48107 } catch(err) { 48108 48109 } 48110 48111 var self = this; 48112 48113 if(url && this.player.playerConfig.ticket) { 48114 ticket = this.player.playerConfig.ticket; 48115 if (url.indexOf("{{Ticket}}") > 0) { 48116 url = url.replace("{{Ticket}}", ticket); 48117 } 48118 } 48119 48120 if (time < 15) { 48121 time = 15; 48122 } 48123
48124 if (!method) { 48125 method = "GET"; 48126 } 48127 48128 if (method == "GET") { 48129 var stringvar = url.indexOf("{{Ticket}}"); 48130 if (stringvar > 0) { 48131 url = url.replace("{{Ticket}}", ticket); 48132 } 48133 } 48134 48135 if (JSON.parse(allow) === true && url !== null) { 48136 if (timerHeartbeat) { 48137 clearInterval(timerHeartbeat); 48138 } 48139 48140 timerHeartbeat = setInterval(function() { self.checkHeartbeat(url, method, ticket); }, time*1000 ); 48141 self.checkHeartbeat(url, method, ticket); 48142 48143 } 48144 }; 48145 48146 48147 48148 L1SubPlayer.prototype.checkHeartbeat = function (url, method, ticket) { 48149 //console.log("CHECK HEARTBEAT!", timerHeartbeat); 48150 48151 var self = this; 48152 48153 if (url) { 48154 this.configInterface.loadHeartbeat(url, 48155 function(response) { self.loadHeartbeatComplete(response); }, 48156 function(errorMeldung, errorCode){ self.loadHeartbeatError(errorMeldung, errorCode); }, method, ticket 48157 ); 48158 } 48159 48160 }; 48161 48162 48163 L1SubPlayer.prototype.loadHeartbeatComplete = function (response) { 48164 var heartbeatJSON = JSON.parse(response); 48165 //console.log("HEARTBEAT COMPLETE", response, heartbeatJSON.success); 48166 48167 if(heartbeatJSON.success === false) { 48168 //console.log("HEARTBEAT SUCCESS FALSE"); 48169 //this.pause(); 48170 //this.destroy(); 48171 //this.player.api.showError("heartbeatError"); 48172 //this.clearHeartbeat(); 48173 this.errorHeartbeat(); 48174 } else { 48175 //console.log("HEARTBEAT SUCCESS TRUE") 48176 } 48177 48178 }; 48179 48180 L1SubPlayer.prototype.loadHeartbeatError = function (errorMeldung, errorCode) { 48181 //this.player.api.showError("heartbeatError"); 48182 //this.clearHeartbeat(); 48183 //this.pause(); 48184 // this.destroy(); 48185 48186 this.errorHeartbeat(); 48187 }; 48188 48189 L1SubPlayer.prototype.errorHeartbeat = function () { 48190 this.player.api.showError("heartbeatError"); 48191 this.clearHeartbeat(); 48192 this.pause(); 48193 this.destroy(); 48194 //console.log("HEARTBEAT ERROR!"); 48195 if (this.videoConfig.hdVideo.settings.heartbeat.js) { 48196 //console.log("HEARTBEAT ERROR HAS JS"); 48197 if (typeof window[this.videoConfig.hdVideo.settings.heartbeat.js] === "function") { 48198 //console.log("HEARTBEAT ERROR HAS JS ON THE PAGE"); 48199 try { 48200 //console.log("Heartbeat Funktion wird aufgerufen!"); 48201 window[this.videoConfig.hdVideo.settings.heartbeat.js](); 48202 } 48203 catch(err) { 48204 //console.log("Heartbeat Funktion wird NICHT aufgerufen wegen error!"); 48205 } 48206 } 48207 } 48208 }; 48209 48210 L1SubPlayer.prototype.pauseHeartbeat = function () { 48211 if (timerHeartbeat) { 48212 clearInterval(timerHeartbeat); 48213 } 48214 }; 48215 48216 L1SubPlayer.prototype.resumeHeartbeat = function () { 48217 48218 }; 48219 48220 L1SubPlayer.prototype.clearHeartbeat = function () { 48221 if (timerHeartbeat) { 48222 clearInterval(timerHeartbeat); 48223 } 48224 }; 48225 48226 48227 48228 48229 // SET 48230 48231 L1SubPlayer.prototype.playOrPause = function () { 48232 if (this.videoInterface) { 48233 this.videoInterface.playOrPause(); 48234 } 48235 }; 48236 48237 L1SubPlayer.prototype.play = function () { 48238 if (this.videoInterface) { 48239 this.videoInterface.play(); 48240 } 48241 }; 48242 48243 L1SubPlayer.prototype.pause = function () { 48244 if (this.videoInterface) { 48245 this.videoInterface.pause(); 48246 } 48247 }; 48248 48249 L1SubPlayer.prototype.forward = function (sec) { 48250 if (this.videoInterface) { 48251 this.videoInterface.forward(sec); 48252 } 48253 }; 48254 48255 L1SubPlayer.prototype.rewind = function (sec) { 48256 if (this.videoInterface) { 48257 this.videoInterface.rewind(sec); 48258 } 48259 }; 48260 48261 L1SubPlayer.prototype.seek = function (second) { 48262 if (this.videoInterface) { 48263 this.videoInterface.seek(second); 48264 } 48265 }; 48266 48267 L1SubPlayer.prototype.seekTo = function (prozent) { 48268 if (this.videoInterface) { 48269 this.videoInterface.seekTo(prozent, this.getLiveStatus()); 48270 } 48271 }; 48272 48273 L1SubPlayer.prototype.setManualVideoIndex = function(newIndex) { 48274 if (this.videoInterface) { 48275 this.videoInterface.setManualVideoIndex(newIndex); 48276 } 48277 }; 48278 48279 L1SubPlayer.prototype.setVolume = function (prozent) { 48280 this.volume = prozent; 48281 48282 if (this.videoInterface) { 48283 this.videoInterface.setVolume(prozent); 48284 } 48285 }; 48286 48287 // 48288 48289 L1SubPlayer.prototype.getCurrentTime = function () { 48290 if (this.videoInterface && this.videoInterface.getCurrentTime()) { 48291 return Number( this.videoInterface.getCurrentTime() ); 48292 } 48293 }; 48294 48295 L1SubPlayer.prototype.getDuration = function () { 48296 if (this.videoInterface && this.videoInterface.getDuration()) { 48297 return Number( this.videoInterface.getDuration() ); 48298 } 48299 }; 48300 48301 L1SubPlayer.prototype.getVolume = function () { 48302 if (this.videoInterface && this.videoInterface.getVolume()) { 48303 return Number( this.videoInterface.getVolume() ); 48304 } 48305 }; 48306 48307 L1SubPlayer.prototype.getPaused = function () { 48308 if (this.videoInterface) { 48309 return this.videoInterface.getPaused(); 48310 } 48311 }; 48312 48313 L1SubPlayer.prototype.getPlayed = function () { 48314 if (this.videoInterface) { 48315 return this.videoInterface.getPlayed(); 48316 } 48317 }; 48318 48319 // VIDEO (HLS, FLASH) 48320 L1SubPlayer.prototype.videoProgress = function (currentTime, duration) { 48321 if(this.videoConfig.streamAccess.status == "error" && this.videoConfig.hdVideo.settings && this.videoConfig.hdVideo.settings.stop) { 48322 if(currentTime > this.videoConfig.hdVideo.settings.stop.time) { 48323 this.destroy(); 48324 if (typeof window[this.videoConfig.hdVideo.settings.stop.js] === "function") { 48325 try { 48326 window[this.videoConfig.hdVideo.settings.stop.js](); 48327 } 48328 catch(err) { 48329 } 48330 } 48331 } 48332 } 48333 48334 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48335 48336 if(this.player.playerConfig.hasOwnProperty('isLive')) { 48337 if(this.player.playerConfig.isLive === true) { 48338 this.player.videoProgress(currentTime, duration, true, this.videoConfig.streamAccess.premium.allowDVR); 48339 } else { 48340 this.player.videoProgress(currentTime, duration, false, this.videoConfig.streamAccess.premium.allowDVR); 48341 } 48342 48343 } else { 48344 this.player.videoProgress(currentTime, duration, this.getLiveStatus(), this.videoConfig.streamAccess.premium.allowDVR); 48345 } 48346 48347 if (!this.videoHasStarted) { 48348 this.videoHasStarted = true; 48349 this.player.tracking("play"); 48350 this.analytics.videoPlay(); 48351 //this.setHeartbeat(true, "https://www.telekomeishockey.de/service/player/heartbeat.php", 5, "POST", this.player.playerConfig.ticket); 48352 //this.startSession(); 48353 this.startHeartbeat(); 48354 } 48355 48356 if(this.videoConfig.hdVideoo && this.videoConfig.hdVideoo.video && this.videoConfig.hdVideo.video.isLivestream) { 48357 this.analytics.videoProgress(currentTime, duration); 48358 } 48359 } 48360
48361 //var invideos = []; 48362 //invideos[0] = { position: "invideo1", time: 12, url: "https://adserver.adtech.de/?adrawdata/3.0/1692.1/5920394/0/16/header=yes;cookie=no;adct=204;grp=101;kvdevice=desktop;kvposition=preroll2;misc=[TIMESTAMP];cors=yes" }; 48363 //invideos[1] = { position: "invideo2", time: 30, url: "http://webat3.laola1.at/demo/flash/videoplayer/werbung/invideo.php" }; 48364 // this.adsInterface.checkInVideos(invideos, currentTime, duration); 48365 if(this.adsInterface.linearAdIsPlaying !== true) { 48366 if (this.videoConfig.hdVideo.werbung && this.videoConfig.hdVideo.werbung.invideos) { 48367 this.adsInterface.checkInVideos(this.videoConfig.hdVideo.werbung.invideos, this.videoInterface.getAdvertTimer(), duration); 48368 //this.adsInterface.checkInVideos(this.videoConfig.hdVideo.werbung.invideos, currentTime, duration); 48369 } 48370 } 48371 }; 48372 48373 L1SubPlayer.prototype.videoLoading = function (percent, loadStartPercentage) { 48374 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48375 this.player.videoLoading(percent, loadStartPercentage); 48376 } 48377 }; 48378 48379 L1SubPlayer.prototype.videoPlay = function () { 48380 48381 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48382 48383 this.player.videoPlay(); 48384 //this.player.api.play(); 48385 48386 48387 48388 //this.analytics.videoPlay(); 48389 } 48390 }; 48391 48392 L1SubPlayer.prototype.videoPause = function () { 48393 48394 48395 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48396 this.player.videoPause(); 48397 this.analytics.videoPause(); 48398 } 48399 }; 48400 48401 L1SubPlayer.prototype.videoComplete = function () { 48402 48403 48404 //if(this.adsInterface.linearAdIsPlaying != true) { 48405 48406 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48407 this.analytics.videoComplete(); 48408 this.player.videoComplete(); 48409 this.adsPostrollStart(); 48410 } 48411 48412 //} 48413 }; 48414 48415 L1SubPlayer.prototype.videoError = function (error) { 48416 48417 48418 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48419 this.analytics.videoError(error); 48420 this.player.videoError(error); 48421 } 48422 }; 48423 48424 L1SubPlayer.prototype.videoCreateVideoIndexList = function (data) { 48425 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48426 this.player.videoCreateVideoIndexList(data); 48427 } 48428 }; 48429 48430 L1SubPlayer.prototype.videoSwitchVideoIndex = function (newIndex, newBitrate) { 48431 48432 48433 if (this.isActiveSubPlayer && !this.adsInterface.linearAdIsPlaying) { 48434 this.analytics.videoSwitchVideoIndex(newIndex, newBitrate); 48435 this.player.videoSwitchVideoIndex(newIndex); 48436 } 48437 }; 48438 48439 L1SubPlayer.prototype.videoTrigger = function (trigger) { 48440 //console.log("TRIGGER", trigger); 48441 this.adsMidrollStart(trigger); 48442 //this.adsPrerollStart(); 48443 }; 48444 48445 L1SubPlayer.prototype.checkVideoIndex = function (newIndex) { 48446 this.player.checkVideoIndex(newIndex); 48447 }; 48448 48449 // GET 48450 48451 L1SubPlayer.prototype.getTitle = function () { 48452 48453 try { 48454 return this.videoConfig.hdVideo.video.title; 48455 } 48456 catch(e) { 48457 return ""; 48458 } 48459 48460 }; 48461 48462 L1SubPlayer.prototype.getShare = function () { 48463 48464 try { 48465 var shareObject = {}; 48466 shareObject.shareAllow = this.player.playerConfig.share; 48467 shareObject.shareURL = this.player.playerConfig.shareurl; //"abc.xyz_" + this.videoConfig.hdVideo.id; 48468 shareObject.shareJS = this.player.playerConfig.sharejs; //"sharePlayer"; 48469 48470 return shareObject; 48471 } 48472 catch(e) { 48473 return {}; 48474 } 48475 }; 48476 48477 L1SubPlayer.prototype.getDownload = function () { 48478 48479 try { 48480 return this.player.playerConfig.downloadUrl; 48481 } 48482 catch(e) { 48483 return {}; 48484 } 48485 }; 48486 48487 L1SubPlayer.prototype.getRelated = function () { 48488 try { 48489 if(typeof this.videoConfig.hdVideo.related == "undefined") { 48490 return {}; 48491 } 48492 return this.videoConfig.hdVideo.related; 48493 } 48494 catch (e) { 48495 } 48496 }; 48497 48498 L1SubPlayer.prototype.getLiveStatus = function () { 48499 48500 try { 48501 return this.videoConfig.hdVideo.video.isLivestream; 48502 } 48503 catch(e) { 48504 return false;
48505 } 48506 48507 }; 48508 48509 L1SubPlayer.prototype.getInfo = function () { 48510 var informationObject = {}; 48511 48512 try { 48513 if (this.videoConfig.hdVideo) { 48514 informationObject = { streamid: this.videoConfig.hdVideo.video.id, image : this.videoConfig.hdVideo.video.image, title : this.videoConfig.hdVideo.video.title, description : this.videoConfig.hdVideo.video.description, date: this.videoConfig.hdVideo.video.startDate, meta : this.videoConfig.hdVideo.video.metaInformation }; 48515 } 48516 48517 return informationObject; 48518 } 48519 catch(e) { 48520 return {}; 48521 } 48522 }; 48523 48524 L1SubPlayer.prototype.getLanguage = function () { 48525 48526 try { 48527 return this.videoConfig.hdVideo.language; 48528 } 48529 catch(e) { 48530 } 48531 }; 48532 48533 L1SubPlayer.prototype.getHdVideoSettings = function () { 48534 48535 try { 48536 return this.videoConfig.hdVideo.settings; 48537 } 48538 catch(e) { 48539 } 48540 }; 48541 48542 L1SubPlayer.prototype.getHdVideo = function () { 48543 48544 try { 48545 return this.videoConfig.hdVideo.video; 48546 } 48547 catch(e) { 48548 } 48549 }; 48550 48551 48552 48553 48554 48555 48556 48557}()); 48558 48559(function () { 48560 /** 48561 * Proxy auf den aktuellen Video player. 48562 */ 48563 48564 this.L1SubPlayerUI = function (subPlayer, container) { 48565 this.subPlayer = subPlayer; 48566 this.playerMain = subPlayer.player; 48567 this.container = container; 48568 48569 this.setUI(); 48570 }; 48571 48572 48573 L1SubPlayerUI.prototype.setUI = function () { 48574 this.setEventListener(); 48575 }; 48576 48577 L1SubPlayerUI.prototype.setAutoplay = function(text, image, allowTitle) { 48578 //console.log("SET IMAGE: ", text, image); 48579 $(this.container).find("#l1pUIPopUpsAutoplayImage").css( "background-image", "url('" + image
48579+ "')" ); 48580 48581 if (!allowTitle) { 48582 $(this.container).find("#l1pUIPopUpsAutoplayText").find("span").html(""); 48583 $(this.container).find("#l1pUIPopUpsAutoplayTextContainer").removeClass().addClass( "l1pHide" ); 48584 } else { 48585 $(this.container).find("#l1pUIPopUpsAutoplayText").find("span").html(text); 48586 } 48587 }; 48588 48589 L1SubPlayerUI.prototype.showAutoplay = function() { 48590 $(this.container).find("#l1pUIPopUpsAutoplay").removeClass().addClass( "l1pShow" ); 48591 }; 48592 48593 L1SubPlayerUI.prototype.hideAutoplay = function() { 48594 $(this.container).find("#l1pUIPopUpsAutoplay").removeClass().addClass( "l1pHide" ); 48595 }; 48596 48597 L1SubPlayerUI.prototype.showCountdown = function() { 48598 $(this.container).find("#l1pUIPopUpsCountdown").removeClass().addClass( "l1pShow" ); 48599 }; 48600 48601 L1SubPlayerUI.prototype.hideCountdown = function() { 48602 $(this.container).find("#l1pUIPopUpsCountdown").removeClass().addClass( "l1pHide" ); 48603 }; 48604 48605 /* 48606 L1SubPlayerUI.prototype.setStreamSelection = function() { 48607 $(this.container).find("#l1pUIPopUpsAutoplayImage").css( "background-image", "url('" + image
48607+ "')" ); 48608 $(this.container).find("#l1pUIPopUpsAutoplayText").find("span").html(text); 48609 }; 48610 */ 48611 48612 // WATERMARK 48613 L1SubPlayerUI.prototype.setWatermark = function(url, pos) { 48614 if (url) { 48615 $(this.container).find("#l1pUIWatermark").find("img").attr("src",url); 48616 } 48617 48618 if (pos) { 48619 if (pos == "TR") { 48620 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosTR" ); 48621 } 48622 else if (pos == "BL") { 48623 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosBL" ); 48624 } 48625 else if (pos == "BR") { 48626 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosBR" ); 48627 } 48628 else { 48629 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosTL" ); 48630 } 48631 } 48632 }; 48633 48634 48635 L1SubPlayerUI.prototype.setEventListener = function() { 48636 48637 var self = this.subPlayer; 48638 48639 $(this.container).find("#l1pUIPopUpsAutoplay").click(function() { 48640 self.onAutoplayClick(); 48641 }); 48642 48643 $(this.container).find("#l1pUIPopUpsUserClickArea").click(function() { 48644 self.onUserClickAreaClick(); 48645 }); 48646 48647 $(this.container).find("#l1pUIPopUpsUserClickArea").dblclick(function() { 48648 self.onUserClickAreaDBClick(); 48649 }); 48650 48651 $(this.container).find('#l1pUIPopUpsOpenVideoBtn').click(function() { 48652 self.setClickStream(); 48653 }); 48654 }; 48655 48656 48657 48658 48659}()); 48660 48661(function () { 48662 48663 this.L1UI = function (playerMain) { 48664 this.playerMain = playerMain; 48665 this.container = this.playerMain.playerContainer; 48666 48667 var relatedNextId; 48668 var relatedNextInterval; 48669 var relatedNextLink; 48670 var relatedNextTarget; 48671 var relatedNextAllowTimer = true; 48672 }; 48673 48674 L1UI.prototype.setMainHtml = function() { 48675 48676 resetMainLayer(this); 48677 generateMainLayer(this); 48678 48679 function resetMainLayer(self) { 48680 $(self.container).html(''); 48681 } 48682 48683 function generateMainLayer(self) { 48684 $(self.container).append('<div id="l1pPlayer" tabindex="1"></div>'); 48685 } 48686 }; 48687 48688 L1UI.prototype.setUserInterfaceHtml = function() { 48689 generateVideoLayer(this); 48690 generateUILayer(this); 48691 generateUIAdText(this); 48692 generateUIAd(this); 48693 generateUIControls(this); 48694 generateUIPopUps(this); 48695 generateVolume(this); 48696 setEventListener(this); 48697 48698 48699 48700 function generateVolume(self) { 48701 var $element = $(self.container).find("#l1pUIControlsButtonVolumeHoverSlider"); 48702 48703 $element 48704 .rangeslider({ 48705 polyfill: false, 48706 vertical: true, 48707 onInit: function() { 48708 } 48709 }) 48710 .on('input', function() { 48711 percent = this.value; 48712 self.playerMain.onclickVolume(this.value); 48713 if (percent <= 0) { 48714 $(self.container).find("#l1pUIControlsButtonVolume").find("i").removeClass().addClass( "fa fa-volume-off" ); 48715 } else if (percent < 50) { 48716 $(self.container).find("#l1pUIControlsButtonVolume").find("i").removeClass().addClass( "fa fa-volume-down" ); 48717 } else { 48718 $(self.container).find("#l1pUIControlsButtonVolume").find("i").removeClass().addClass( "fa fa-volume-up" ); 48719 } 48720 }); 48721 48722 /* 48723 $document.on('click', '#js-example-change-value button', function(e) { 48724 var $inputRange = $('[data-rangeslider]', e.target.parentNode); 48725 var value = $('input[type="number"]', e.target.parentNode)[0].value; $inputRange .val(value) .change(); 48726 }); 48727 */ 48728 } 48729 48730 function generateVideoLayer(self) { 48731 48732 48733 var htmlCodePopUpAutoplay = '' 48734 + '<div id="l1pUIPopUpsAutoplay" class="l1pHide">' 48735 + '<div id="l1pUIPopUpsAutoplayImage" style="background-image: url(""); ">' 48736 + '</div>' 48737 + '<div id="l1pUIPopUpsAutoplayTextContainer">' 48738 + '<div id="l1pUIPopUpsAutoplayText"><span></span></div>' 48739 + '</div>' 48740 + '<div id="l1pUIPopUpsAutoplayPlayButton"><i class="fa fa-play"></i></div>' 48741 + '</div>'; 48742 48743 var htmlCodePopUpCountdown = '' 48744 + '<div id="l1pUIPopUpsCountdown" class="l1pHide">' 48745 48746 + '<div id="l1pUIPopUpsCountdownImage" style="background-image: url(""); "></div>' 48747 + '<div id="l1pUIPopUpsCountdownOverlay"></div>' 48748 + '<div id="l1pUIPopUpsCountdownText"><span></span></div>' 48749 + '<div id="l1pUIPopUpsCountdownTimeText"><span></span></div>' 48750 + '<div id="l1pUIPopUpsCountdownTimeClockText"><span></span></div>' 48751 48752 + '</div>'; 48753 48754 var htmlCodePopUpUserClickArea = '' 48755 + '<div id="l1pUIPopUpsUserClickArea" class="">' 48756 + '</div>'; 48757 48758 var htmlCodeAdContainer = '' 48759 + '<div id="l1pAdContainer" class="l1pHide">' 48760 + '</div>'; 48761 /* 48762 var htmlCodeIframe = '' 48763 + '<div id="l1pIframeContainer"><iframe id="l1pIframeContainerContent" scrolling="no" frameBorder="0" src="https://app.singular.live/appinstances/3688/outputs/Output/onair?aspect=16:9"></iframe></div>'; 48764 */ 48765 var htmlCodeOpenCloseButton = '' 48766 + '<div id="l1pUIPopUpsOpenCloseVideo" class="">'
48767 + '<div id="l1pUIPopUpsCloseVideoBtn" class="l1pUIControlsButton l1pHide"><i class="fa fa-times"></i></div>' 48768 48769 + '</div>' 48770 48771 + '<div id="l1pUIPopUpsOpenVideoBtn" class="l1pShow"><i class="fa fa-plus-circle"></i></div>'; 48772 48773 48774 48775 $(self.container).find("#l1pPlayer").append('<div id="l1pVideo" class="l1pVideoSingle"></div>'); 48776 //$(self.container).find("#l1pVideo").append('<div id="l1pAdContainer"></div>'); 48777 //NEU TEST 48778 htmlCodePopUpUserClickArea = !self.playerMain.playerConfig.deviceInfo.isMobile ? htmlCodePopUpUserClickArea : '' ; 48779 48780 $(self.container).find("#l1pVideo").append('<div id="l1pVideo0" class="l1pVideoSubPlayer"><div id="l1pVideoFlash"><div id="l1pVideoFlashContainer"></div></div><div id="l1pVideoHtml5"><video id="l1pVideoHtml5Element" type="video/mp4"></video></div><div id="l1pUIWatermark" class="l1pPosTL"><img/></div>'+ htmlCodePopUpUserClickArea + htmlCodeAdContainer + htmlCodePopUpAutoplay + htmlCodePopUpCountdown + '</div>'); 48781 $(self.container).find("#l1pVideo").append('<div id="l1pVideo1" class="l1pVideoSubPlayer"><div id="l1pVideoFlash"><div id="l1pVideoFlashContainer"></div></div><div id="l1pVideoHtml5"><video id="l1pVideoHtml5Element" type="video/mp4"></video></div><div id="l1pUIWatermark" class="l1pPosTL"><img/></div>'+ htmlCodePopUpUserClickArea + htmlCodeAdContainer + htmlCodePopUpAutoplay + htmlCodePopUpCountdown + htmlCodeOpenCloseButton + '</div>'); 48782 $(self.container).find("#l1pVideo").append('<div id="l1pVideo2" class="l1pVideoSubPlayer"><div id="l1pVideoFlash"><div id="l1pVideoFlashContainer"></div></div><div id="l1pVideoHtml5"><video id="l1pVideoHtml5Element" type="video/mp4"></video></div><div id="l1pUIWatermark" class="l1pPosTL"><img/></div>'+ htmlCodePopUpUserClickArea + htmlCodeAdContainer + htmlCodePopUpAutoplay + htmlCodePopUpCountdown + htmlCodeOpenCloseButton + '</div>'); 48783 $(self.container).find("#l1pVideo").append('<div id="l1pVideo3" class="l1pVideoSubPlayer"><div id="l1pVideoFlash"><div id="l1pVideoFlashContainer"></div></div><div id="l1pVideoHtml5"><video id="l1pVideoHtml5Element" type="video/mp4"></video></div><div id="l1pUIWatermark" class="l1pPosTL"><img/></div>'+ htmlCodePopUpUserClickArea + htmlCodeAdContainer + htmlCodePopUpAutoplay + htmlCodePopUpCountdown + htmlCodeOpenCloseButton + '</div>'); 48784 48785 } 48786 48787 function generateUILayer(self) { 48788 $(self.container).find("#l1pPlayer").append('<div id="l1pUI"><div id="l1pUIAdCommercial" class="l1pHide"></div><div id="l1pUIAd" class="l1pHide"></div><div id="l1pUIControls" class="l1pHide"></div><div id="l1pUITitle" class="l1pHide"><span id="l1pUITitleMediatyp"></span><span id="l1pUITitleText"></span></div><div id="l1pUIPopUps" class="l1pHide"></div></div>'); 48789 } 48790 48791 function generateUIAdText(self) { 48792 var htmlCodeButtons = '' 48793 + '<div id="l1pUIAdText" class="l1pUIAdLanguage">Advertisement, action starts soon</div>'; 48794 $(self.container).find("#l1pUIAdCommercial").append(htmlCodeButtons); 48795 } 48796 48797 function generateUIAd(self) { 48798 var htmlCodeButtons = '' 48799 + '<div id="l1pUIControlsAdButtonPlayPause" class="l1pUIButton l1pHide">Pause Ad</div>' 48800 + '<div id="l1pUIControlsAdButtonSkip" class="l1pUIButton l1pHide">Skip Ad</div>'; 48801 $(self.container).find("#l1pUIAd").append(htmlCodeButtons); 48802 } 48803 48804 function generateUIControls(self) { 48805 var htmlCodeButtonsMain = '' 48806 + '<div id="l1pUIControlsButtonsMain">' 48807 + '<div id="l1pUIControlsButtonRewind" class="l1pUIControlsButton"><i class="fa fa-backward"></i></div>' 48808 + '<div id="l1pUIControlsButtonPlayPause" class="l1pUIControlsButton"><i class="fa fa-play"></i></div>' 48809 + '<div id="l1pUIControlsButtonForward" class="l1pUIControlsButton"><i class="fa fa-forward"></i></div>' 48810 + '</div>'; 48811 48812 48813 var htmlCodeButtonsSub1 = '' 48814 + '<div id="l1pUIControlsButtonsSub1">' 48815 + '<div id="l1pUIControlsButtonInfo" class="l1pUIControlsButton"><i class="fa fa-info"></i></div>' 48816 + '<div id="l1pUIControlsButtonMultiview" class="l1pUIControlsButton"><i class="fa fa-th-large"></i></div>' 48817 + '<div id="l1pUIControlsButtonShare" class="l1pUIControlsButton"><i class="fa fa-share-alt"></i></div>'
48818 + '<div id="l1pUIControlsButtonDownload" class="l1pUIControlsButton l1pHide"><a href="" download><i class="fa fa-download"></i></a></div>' //<a href="" download><i class="fa fa-download"></i></a> 48819 //+ '<div id="l1pUIControlsButtonOctoShape" class="l1pUIControlsButton"><i class="fa fa-share-alt"></i></div>' 48820 //+ '<div id="l1pUIControlsButtonStatistics" class="l1pUIControlsButton"><i class="fa fa-bar-chart"></i></div>' 48821 + '</div>'; 48822 48823 var htmlCodeButtonsSub2 = '' 48824 + '<div id="l1pUIControlsButtonsSub2">' 48825 + '<div id="l1pUIControlsButtonHD" class="l1pUIControlsButton"><i>HD</i></div>' 48826 + '<div id="l1pUIControlsButtonSettings" class="l1pUIControlsButton"><i class="fa fa-cog"></i></div>' 48827 + '<div id="l1pUIControlsButtonVolumeContainer">' 48828 48829 + '<div id="l1pUIControlsButtonVolume" class="l1pUIControlsButton"><i class="fa fa-volume-up"></i></div>' 48830 + '<div id="l1pUIControlsButtonVolumeHover">' 48831 + '<input id="l1pUIControlsButtonVolumeHoverSlider" min="0" value="1" max="100" type="range" data-rangeslider data-orientation="vertical" />' 48832 /* 48833 + '<div id="l1pUIControlsButtonVolumeHoverBarBG"></div>' 48834 + '<div id="l1pUIControlsButtonVolumeHoverBar"></div>' 48835 + '<div id="l1pUIControlsButtonVolumeHoverButton"></div>' 48836 */ 48837 + '</div>' 48838 + '</div>' 48839 + '<div id="l1pUIControlsButtonFullscreen" class="l1pUIControlsButton"><i class="fa fa-arrows-alt"></i></div>' 48840 + '</div>'; 48841 48842 var htmlCodeTimeline = '' 48843 + '<div id="l1pUIControlsTimeline">' 48844 + '<span id="l1pUIControlsTimelineTimeLeft">00:00</span>' 48845 + '<div id="l1pUIControlsTimelineProgressBar"><div id="l1pUIControlsTimelineProgressBarDuration"></div><div id="l1pUIControlsTimelineProgressBarLoading"></div><div id="l1pUIControlsTimelineProgressBarViewTime"></div><div id="l1pUIControlsTimelineTooltip">00:00</div></div>' 48846 + '<span id="l1pUIControlsTimelineTimeRight">00:00</span>' 48847 + '' 48848 + '</div>'; 48849 48850 $(self.container).find("#l1pUIControls").append(htmlCodeButtonsMain + htmlCodeButtonsSub2 + htmlCodeButtonsSub1 + htmlCodeTimeline); 48851 } 48852 48853 function generateUIPopUps(self) { 48854 var htmlCodePopUpCloseBtn = '' 48855 + '<div id="l1pUIPopUpsClose">' 48856 + '<div id="l1pUIPopUpsCloseBtn" class="l1pUIControlsButton"><i class="fa fa-times"></i></div>' 48857 + '<div id="l1pUIPopUpsCloseText"><span>close</span></div>' 48858 + '</div>'; 48859 48860 var htmlCodePopUpShare = '' 48861 + '<div id="l1pUIPopUpsShare" class="l1pUIPopUpsSingle">' 48862 + '<div id="l1pUIPopUpsContent">' 48863 + '<h1 id="l1pUIPopUpsShareText1">Share</h1>' 48864 + '<div id="l1pUIPopUpsShareCopy">' 48865 + '<input type="text" id="l1pUIPopUpsShareUrl" value="" readonly>' 48866 + '<div id="l1pUIPopUpsShareUrlCopyButton" data-clipboard-target="#l1pUIPopUpsShareUrl">Copy</div>' 48867 + '</div>' 48868 + '<div id="l1pUIPopUpsShareSocial">' 48869 + '<div id="l1pUIPopUpsShareSocialFacebook" class="l1pUIPopUpsShareSocialButton"><span>Facebook</span><div class="l1pUIPopUpsShareSocialImage"><i class="fa fa-facebook"></i></div></div>' 48870 + '<div id="l1pUIPopUpsShareSocialTwitter" class="l1pUIPopUpsShareSocialButton"><span>Twitter</span><div class="l1pUIPopUpsShareSocialImage"><i class="fa fa-twitter"></i></div></div>' 48871 + '<div id="l1pUIPopUpsShareSocialGoogle" class="l1pUIPopUpsShareSocialButton"><span>Google+</span><div class="l1pUIPopUpsShareSocialImage"><i class="fa fa-google-plus"></i></div></div>' 48872 + '<div id="l1pUIPopUpsShareSocialMail" class="l1pUIPopUpsShareSocialButton"><span>Mail</span><div class="l1pUIPopUpsShareSocialImage"><i class="fa fa-envelope-o"></i></div></div>' 48873 + '</div>' 48874 + '</div>' 48875 + '</div>'; 48876 /* 48877 var htmlCodePupUpHD = '' 48878 + '<div id="l1pUIPopUpsHD" class="l1pUIPopUpsSingle">' 48879 + '<div id="l1pUIPopUpsContent">' 48880 + '<h1 id="l1pUIPopUpsHDText1">HD</h1>' 48881 + '<div id="l1pUIPopUpsHDImage"></div>' 48882 + '<span id="l1pUIPopUpsHDText">HD Qualität ist nur für LAOLA1.tv Premium Mitglieder verfügbar</span>' 48883 + '<div id="l1pUIPopUpsHDButton">JEZT UPGRADEN</div>' 48884 + '<div id="l1pUIPopUpsHDText2">Werde Premium User und profitiere auch von</div>' 48885 + '<div id="l1pUIPopUpsHDIcons">ICON</div>' 48886 + '</div>' 48887 + '</div>'; 48888 */ 48889 var htmlCodePupUpSettings = '' 48890 + '<div id="l1pUIPopUpsSettings" class="l1pUIPopUpsSingle">' 48891 + '<div id="l1pUIPopUpsContent">' 48892 + '<h1 id="l1pUIPopUpsSettingsText1">Settings</h1>' 48893 + '<span id="l1pUIPopUpsSettingsText">Quality automatically adjusts to connection speed and browser capabilities.</span>' 48894 + '<div id="l1pUIPopUpsSettingsList">' 48895 + '<ul id="l1pUIPopUpsSettingsListAuto"></ul>' 48896 + '<ul id="l1pUIPopUpsSettingsistManuell"></ul>' 48897 + '</div>' 48898 + '</div>' 48899 + '</div>'; 48900 48901 //<div class="l1pUIPopUpsStatisticsWidget"><iframe src="https://app.singular.live/appinstances/3688/outputs/Output/onair?aspect=16:9"></iframe></div> 48902 48903 var htmlCodePupUpStatistics = '' 48904 + '<div id="l1pUIPopUpsStatistics" class="l1pUIPopUpsSingle">' 48905 + '<div id="l1pUIPopUpsContent">' 48906 + '<h1 id="l1pUIPopUpsStatisticsText1">Statistics</h1>' 48907 + '<div id="l1pUIPopUpsStatisticsContainer">' 48908 + '<div class="l1pUIPopUpsStatisticsWidget"></div>' 48909 + '</div>' 48910 + '</div>' 48911 + '</div>'; 48912 48913 var htmlCodePupUpPremium = '' 48914 + '<div id="l1pUIPopUpsPremium" class="l1pUIPopUpsSingle">' 48915 + '<div id="l1pUIPopUpsContent">' 48916 + '<h1 id="l1pUIPopUpsPremiumText1">Premium</h1>' 48917 + '<div id="l1pUIPopUpsPremiumContainerTop">' 48918 + '<div id="l1pUIPopUpsPremiumImageContainer">' 48919 + '<div id="l1pUIPopUpsPremiumImage" class="">' //l1pUIPopUpsPremiumImageHD 48920 + '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1
48920x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRFIUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
48920EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII=">' 48921 + '</div>' 48922 + '</div>' 48923 + '<div id="l1pUIPopUpsPremiumTexte">' 48924 + '<span id="l1pUIPopUpsPremiumTextTop">HD Qualität ist nur für LAOLA1.tv Premium Mitglieder verfügbar.</span>' 48925 + '<div id="l1pUIPopUpsPremiumButton">JETZT UPGRADEN</div>' 48926 + '</div>' 48927 + '</div>' 48928 48929 + '<div id="l1pUIPopUpsPremiumContainerBottom">' 48930 + '<h1 id="l1pUIPopUpsPremiumTextBottom">WERDE PREMIUM USER UND PROFITIERE AUCH VON:</h1>' 48931 48932 + '<div id="l1pUIPopUpsPremiumBottomButtons1" class="l1pUIPopUpsPremiumBottomButtons">' 48933 //+ '<div id="l1pUIPopUpsPremiumBottomButtonsImg" class="l1pUIPopUpsPremiumImageHD"></div>' 48934 + '<img class="l1pUIPopUpsPremiumBottomButtonsImg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRF
48934IUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
48934EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII=">' 48935 + '<span class="l1pUIPopUpsPremiumBottomButtonsText">TEST</span>' 48936 + '</div>' 48937 + '<div id="l1pUIPopUpsPremiumBottomButtons2" class="l1pUIPopUpsPremiumBottomButtons">' 48938 + '<img class="l1pUIPopUpsPremiumBottomButtonsImg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRFIUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4
48938LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
48938EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII=">' 48939 + '<span class="l1pUIPopUpsPremiumBottomButtonsText">TEST</span>' 48940 + '</div>' 48941 + '<div id="l1pUIPopUpsPremiumBottomButtons3" class="l1pUIPopUpsPremiumBottomButtons">' 48942 + '<img class="l1pUIPopUpsPremiumBottomButtonsImg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRFIUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4
48942LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
48942EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII=">' 48943 + '<span class="l1pUIPopUpsPremiumBottomButtonsText">TEST</span>' 48944 + '</div>' 48945 + '<div id="l1pUIPopUpsPremiumBottomButtons4" class="l1pUIPopUpsPremiumBottomButtons">' 48946 + '<img class="l1pUIPopUpsPremiumBottomButtonsImg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRFIUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4
48946LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
48946EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII=">' 48947 + '<span class="l1pUIPopUpsPremiumBottomButtonsText">TEST</span>' 48948 + '</div>' 48949 + '</div>' 48950 + '</div>' 48951 + '</div>'; 48952 48953 var htmlCodePupUpMultiview = '' 48954 + '<div id="l1pUIPopUpsMultiview" class="l1pUIPopUpsSingle">' 48955 + '<div id="l1pUIPopUpsContent">' 48956 + '<h1>Multiview</h1>' 48957 + '<div id="l1pUIPopUpsMultiviewSelection">' 48958 + '<div id="l1pUIPopUpsMultiviewSelectionSingle" class="l1pUIPopUpsMultiviewSelectionButton"><span>Single</span><div class="l1pUIPopUpsMultiviewSelectionImage"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAABkCAYAAABU19jRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8xMi8xNYoYyL8AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAFCUlEQVR4nO3dTWgcZRzH8d/zzGx3s4mblyJBg0Swm1ICtSAhGCRVkR5y8CKI9iJC66EnEQ8qCCKIVz3EijkUEiLkECgkHqR4z2ETCEJN8CBUqCAE3RC2jTPP8/eQTJhudrf+a7tv/X3gIbM7E+bZ8GXellIjIjj0EYAPAZw8fH20gh5bAuA2gC8BfAMARkSeALDqvX/JWmuPthT2QgdExFlrfwTwJkTkM+ecj+NYrl27JqdOnRIclMXxGA9rrYyPj8vi4qLEcSzOOS8iH0NEfvfey9WrVyUIgpZPlKO9RhiGsrS0JN57EZFfISKxc06KxWLLJ8fRnmNqakqccyIiFSMizntvgyAAUS35fB67u7sIgiC2AIQXuNRIpVJJFo1ttCFRNQZDKgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTD0nxhjAP6rAdJiMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqTAYUmEwpMJgSOUomDAMWzkPamP5fP5o2QJwxhiMjY21bkbU1iYnJ5PFuxCR35xzsrCwIAA4OI6NlZUVcc6JiGxARD5xzrn9/X1ZXFyUyclJyeVyLZ8kR2tHLpeT8+fPy+rqqkRRJM65WETeMSLSD+A77/0bAAIRAVHi8P9Jctba7wG8Zw4DGQTwNoArAJ4DkGnZDKldCIAIwC8AvgWwBGDXdPoRZX9/v94qA2AIQHDz5s3rIvJi+rMaYyAix36mlxMiAmvtPa9r/a4xZrtYLL6ay+VuN5pzNpv9H5+4tbr5XloA7JRKJTM0NHTi8NCK6mi898cCSW+XBFFzB8ej6bl169ZeN99xdnMwAIDR0dFBa20BQN2jx/2iAI7O5cfCqtruJLr8YWjXB9PX1/ektbYvHUW95eR1I/fZPi8iPQD+fljzbzddH0xPT89TAApN2p0B8AyAP5q0v6br6sPnoWcB9DZxf+eauK+mexyCOdPk/U3h4EjTlTr+lHT58uVab5u5uTkBgDt37kwkt8TpC97kWqTR9UuyLtkufXudrLPWVl/XvFwulwv9/f3lOnPD/Pz8g3zUttDxwdSQAdADYHdra+v1kZGRqXQk6WUA8N7f8zq9TaP3E8lteWrb0Z2dnXfPnj37FYAcgLsP/RO2UDcFY3EQygkA2VKp9Nrp06e/zmaz2VoP4aqPNLVurZOY6r1X7/a8t7f3i83NzX8AXAewi4MnpnWfMHaSbgkmHBwcHJ6enh6fmJh4ZXh4+AKA5wEELZpPfmBgYHZubu79crn8w8bGxk/r6+ub29vbf6LDw+n4rwZmZ2dx6dKltwB8AOAFtO+F/M8AVpeXlz+9ePGia/VkHlTHH2EKhYIBcAHAuSiK4kwm49FmdylxHCMMwzMAhgYGBj4HwGBa5caNG2ZtbW1eRG6LyNP5fD7MZDLGWoswDE0mk0EYhvfc6SSqH/dXf5mY3i65Rkmuf9Lr019MRlGEKIoQx7E45+Cck0ql4r33fwVBsL63t2dmZmYe9Z/lken4UxI1V7ue76lNMRhSYTCkwmBIhcGQCoMhFQZDKv8C01i5mi/FhzwAAAAASUVORK5CYII=" /></div></div>' 48959 + '<div id="l1pUIPopUpsMultiviewSelectionDual" class="l1pUIPopUpsMultiviewSelectionButton"><span>Dual</span><div class="l1pUIPopUpsMultiviewSelectionImage"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAABkCAYAAABU19jRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8xMi8xNYoYyL8AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAFdUlEQVR4nO3dTWgcZRzH8d/zzGx3s5v3IkGLRLBpKYFakBAM0qpIDz14EUR7EaH14EnEgwqCCOJVD7FiDoWUCDkUCo0HKd57SAJBqA0ehAoVhKCbZreNO8/z95CddLLd2fiv7b7+PjBkdmfCzA5fZmf2ZdaICKo+AvAhgIPV27sTqGcJgNsAvgTwDQAYERkAsOS9f9Faa3fnFPZCO0TEWWt/BPAGROQz55yPokguXrwohw8fFuyUxaGHB2utTE5OysLCgkRRJM45LyIfQ0R+997LhQsXJAiClq8oh/YawjCUxcVF8d6LiPwKEYmcczIx
48959MdHylePQnsPMzIw450REykZEnPfeBkEAonry+Tw2NzcRBEFkAQgPcKmRcrkcjxrbaEaiWgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEglTJtw584dFAqFZq5Ly5VKJQwMDOy5j9thL1P9xF0Qhnvb8d7DGNMzHwaPH2vic/AAuB1iURQhCAKXuocBUPcfu5X3PnUat8N9vbEV6JFhMKTCYEiFwZAKg6H/xBgD8FsDpMVgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqTAYUmEwpNLwch/GmH0v/9AtGl0DhtvhvtQ9TKlU6pmL6AA714AplUoP3M/tsFfqFaiIkpxzsNZ6HsOQCoMhFQZDKgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKSyGww/D0Np8vn87rgF4IwxOHLkSOvWiNra9PR0PHoPIvKbc04uXbokADhweGC4evWqOOdERFYhIp8459z29rYsLCzI9PS05HK5lq8kh9YOuVxOTp06JUtLS1KpVMQ5F4nI20ZEhgB8571/HUDQSx94pv1VfyfJWWu/B/CuqQYyAuAtAO8BeBZApmVrSO1CAFQA/ALgWwCLADZNp+9Rtre30yYZAKMAghs3blwRkReSjzX+/k3t3+R4rPZniGvnS/xdn5iYeCWXy91utM7ZbPZ/POLW6uZzaQGwsby8bEZHRw9Ud62ojSbth8zj23EQdRfwYDR9t27d2urmM85uDgYAMD4+PmKtHQSQuvfYLwpg97k89Utt1fsPostfDO36YPr7+5+w1vYno0gbj283ss/8eRHpA/D3o1r/dtP1wfT19T0JYLBJizMAngbwR5OW13RdvfusegZAoYnLO9HEZTVdLwRzrMnLm8HOnqYrdfxT0vnz5+vdbebm5gQA7t69OxWfEicPeONjkUbHL/G0eL7k6XU8zVpbe1zzUrFYHBwaGiqmrBvm5+cf5qG2hY4Ppo4MgD4Amzdv3nzt0KFDM8lIkuMAdq/7Um+eRvfH4tPyxLzjGxsb7xw/fvwrADkA9x75I2yhbgrGYieUAwCyy8vLrx49evTrbDabrfciXO2ept6pdb2LCCXvSzs9LxQKX6ytrf0D4AqATey8Ypr6CmMn6ZZgwpGRkbGTJ09OTk1NvTw2NnYawHMAghatT354eHh2bm7u/WKx+MPq6upPKysra+vr63+iw8Pp+LcGZmdnce7cuTcBfADgebTvgfzPAJYuX7786dmzZ12rV+ZhdfweZnBw0AA4DeBEpVKJMpmMR5udpURRhDAMjwEYHR4e/hwAg2mVa9eumevXr8+LyG0ReSqfz4eZTMZYaxGGoclkMgjDcM+ZTqz25f7aNxOT88XHKPHxT3J68o3JSqWCSqWCKIrEOQfnnJTLZe+9/ysIgpWtrS1z5syZx71ZHpuOf0qi5mrX53tqUwyGVBgMqTAYUmEwpMJgSIXBkMq/LgAdBIezpycAAAAASUVORK5CYII=" /></div></div>' 48960 + '<div id="l1pUIPopUpsMultiviewSelectionQuad" class="l1pUIPopUpsMultiviewSelectionButton"><span>Quad</span><div class="l1pUIPopUpsMultiviewSelectionImage"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAABkCAYAAABU19jRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8xMi8xNYoYyL8AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAFSElEQVR4nO3cTWgcZRzH8d/zzGx3s4l5KxK0SATzQgnUgoRgkFZFeujBiyCaiwitB08iHlQQRBCveogRcwikRMihUGg8SPHeQxIIQm3wIFSoIATdELaNM8/z97A7yeRlU//a7sxufh8YMrszZZ4N387OCxkjIqj7EMAHAE7WX+8soGNLANwF8AWArwHAiMhjAJa89y9Ya+3OmsJeqEZEnLX2BwCvQ0Q+dc75OI5lbm5OhoaGBLWyju2UyHocWU7WWhkbG5OFhQWJ41icc15EPoKI/Oa9l5mZGQmCIPOB5mFiMLtTGIayuLgo3nsRkV8gIrFzToaHhzMfXF4mBrN3mpycFOeciEjViIjz3tsgCEA1yfGbMSbjkeRDuVzG5uYmgiCILWr/o7IeE+VYtVpNZo09akWi/RgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcHQv1L/kxv+1QDpMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqYTJDJ8RcxB/JwdxD0MqO3sYPp5rFx9ZdpBzDtZa7mFIh8GQCoMhFQZDKgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqTAYUtkJJgzDo9ajY6xcLu/MWwDOGIORkZHsRkS5NjExkczeh4j86pyTK1euCABOgCSyHkdepuvXr4tzTkRkFSLysXPObW9vy8LCgkxMTEipVMp8kFlODAZSKpXk/PnzsrS0JFEUiXMuFpG3jIj0APjWe/8agIBPjgSCIABQe67bcVd/zp+z1n4H4B1TD6QPwJsA3gXwDIBCZiPMh6D+8zgXIwAiAD8D+AbAIoBN0+p7lO3t7UaLDIB+AMGtW7euicjz6c9qjIGIHPiZnk+ICKy1e14f9m+NMevDw8Mvl0qlu0eNuVgs/o9PnK12PpcWABvLy8umv7//RPII1f3ReO8PBJJeLwni0A0cjKbjzp07W+18xtnOwQAABgcH+6y13QAa7j0eFAWw+8zeRnvk+vsn0eYXQ9s+mK6ursettV3pKBrNJ6+P8oD1yyLSAeCvhzX+vGn7YDo6Op4A0N2kzRkATwH4vUnba7q23n3WPQ2gs4nbO9vEbTXdcQjmdJO3N4nanqYttfxX0uXLlw9728zOzgoA3Lt3bzw5JU4f8CbHIkcdvyTLkvXSp9fJMmvt/uOaFyuVSndPT0+lwdgwPz//Xz5qLrR8MIcoAOgAsHn79u1XT506NZmOJD0PAN77Pa/T6xz1fiI5LU+tO7ixsfH2mTNnvgRQAnD/oX/CDLVTMBa1UE4AKC4vL78yOjr6VbFYLB52EW7/nuawU+skpkbvNTo97+zs/Hxtbe1vANcAbKJ2xbThFcZW0i7BhH19fQPnzp0bGx8ff2lgYOACgGexe4m/2cq9vb3Ts7Oz71Uqle9XV1d/XFlZWVtfX/8DLR5Oy98amJ6exqVLl94A8D6A55DfA/mfACxdvXr1k6mpqZa9R9Xye5ju7m4D4AKAs1EUxYVCwSNnZylxHCMMw9MA+nt7ez9DC9/UbPlgbty4YW7evDkvIndF5MlyuRwWCgVjrUUYhqZQKCAMwz1nOon9l/v330xMr5ccoyTHP+nl6RuTURQhiiLEcSzOOTjnpFqteu/9n0EQrGxtbZmLFy8+6l/LI9PyX0nUXHn9vqecYjCkwmBIhcGQCoMhFQZDKgyGVP4BvvXqek5Jy38AAAAASUVORK5CYII=" /></div></div>' 48961 + '<div id="l1pUIPopUpsMultiviewSelectionOverlay" class="l1pUIPopUpsMultiviewSelectionButton"><span>Overlay</span><div class="l1pUIPopUpsMultiviewSelectionImage"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAABkCAYAAABU19jRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8xMi8xNYoYyL8AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAFXklEQVR4nO3dT2gcZRzG8ed9Z7a72c3/IkGLRLBJKYFakBAM0qpIDz14EUR7EaH10JOIBxUEEcSrHmLFHAopEXIoFBoPUrz3kASCUBs8CBUqCEE3zaaNM+/785CdMN3upvnVdmf/PB94ye7OhHl3+TI7swuzRkRQ9TGAjwAcrN7fXUBdSwDcBvAVgG8BwIhIH4BF7/3L1lq7u6awF9ohIs5a+xOAtyAinzvnfBzHcvHiRTl8+LBgpyyOLh7WWpmYmJD5+XmJ41icc15EPoGI/OG9lwsXLkgQBJlPlKO1RhiGsrCwIN57EZHfICKxc07GxsYynxxHa47p6WlxzomIbBkRcd57GwQBqL47d+6gVCplPY2mqlQq6OvrAwAUi0VsbGwgCILYVPcwQRiGGU+xdXnvYYzpmhOB5LmmzoEQxzGCIHCsZJ9qX8BO5r1vuKw7XgF6bBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBoX4wxAGAYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAyp8HIf+2SM2fMyGJ1kr2vhcA+zD5VKpWsuJgTsXAunUqnUXcY9zD4kl+4i7mFIicGQCoMhFQZDKgyGVBgMqTAYUmEwpMJgSIXBkAqDIRUGQyoMhlQYDKkwGFJhMKTCYEiFwZAKgyEVBkMqDIZUGAypMBhSYTCkwmBIhcGQCoMhFQZDKgyGVBgMqTAYUtkNJgx5qRiqr1gs7t62AJwxBuPj49nNiFra1NRUcvMeROR355xcunRJAHBwPDCuXr0qzjkRkRWIyKfOObe9vS3z8/MyNTUlhUIh80lyZDsKhYKcPHlSFhcXJYoicc7FIvKuEZEBAN97798EEHTTxf/o4aq/k+SstT8AeN9UAxkC8A6A8wCeB5DLbIbUKgRABOBXAN8BWACwYdp9j7K9vd1okQEwDCC4cePGFRF5Kf1ck2vR1v5N306ICKy1992v97/GmLWxsbHXCoXC7b3mnM/n/8czzlYnn0sLgPWlpSUzPDx8oLprRW003vu6FzJO7idB1N3Ag9H03Lp1a7OTzzg7ORgAwOjo6JC1th9Aw73Hw6IAdt/LG17gufr4QXT4h6EdH0xvb+9T1tredBSNbif39/KQ9Ysi0gPgn8c1/1bT8cH09PQ8DaC/SZszAJ4F8GeTttd0Hb37rHoOQKmJ2zvexG01XTcEc7TJ25vGzp6mI7X9W9K5c+fqPWxmZ2cFAO7evTuZnBKnD3iTY5G9jl+SZcl66dPrZJm1tva45pVyudw/MDBQbjA3zM3NPcpTbQltH0wdOQA9ADZu3rz5xqFDh6bTkaRvA9j9DaR66+z1eCI5LU+tO7q+vv7esWPHvgZQAHDvsT/DDHVSMBY7oRwAkF9aWnr9yJEj3+Tz+Xy9D+Fq9zT1Tq3r/aBW+rFGp+elUunL1dXVfwFcAbCBnU9MG37C2E46JZhwaGho5MSJExOTk5OvjoyMnALwAoAgo/kUBwcHZ2ZnZz8ol8s/rqys/Ly8vLy6trb2F9o8nLb/amBmZgZnz559G8CHAF5E6x7I/wJg8fLly5+dOXPGZT2ZR9X2e5j+/n4D4BSA41EUxblczqPFzlLiOEYYhkcBDA8ODn4BgMFk5dq1a+b69etzInJbRJ4pFothLpcz1lqEYWhyuRzCMLzvTCdR+3F/7ZeJ6fWSY5Tk+Ce9PP3FZBRFiKIIcRyLcw7OOdna2vLe+7+DIFje3Nw0p0+fftIvyxPT9m9J1Fyt+n5PLYrBkAqDIRUGQyoMhlQYDKkwGFL5D5ws5JIFB/73AAAAAElFTkSuQmCC" /></div></div>' 48962 + '</div>' 48963 + '</div>' 48964 + '</div>'; 48965 48966 var htmlCodePupUpStreams = ''
48967 + '<div id="l1pUIPopUpsStreams" class="l1pUIPopUpsSingle">' 48968 + '<div id="l1pUIPopUpsContent">' 48969 + '<h1>Streamauswahl</h1>' 48970 + '<div class="l1pUIPopUpsStreamsSlider">' 48971 + '<span>Streams werden geladen ...</span>' 48972 + '</div>' 48973 + '</div>' 48974 + '</div>'; 48975 48976 var htmlCodePupUpInfo = '' 48977 + '<div id="l1pUIPopUpsInfo" class="l1pUIPopUpsSingle">' 48978 + '<div id="l1pUIPopUpsContent">' 48979 + '<h1 id="l1pUIPopUpsInfoText1">Info</h1>' 48980 + '<div id="l1pUIPopUpsInfoImage">' 48981 + '</div>' 48982 + '<div id="l1pUIPopUpsInfoBeschreibung">' 48983 + '</div>' 48984 + '<div id="l1pUIPopUpsInfoTexte">' 48985 + '</div>' 48986 //+ '<h2 id="l1pUIPopUpsInfoText2">Auch empfehlenswert:</h2>' 48987 + '<div id="l1pUIPopUpsInfoList">' 48988 + '<ul>' 48989 + '</ul>' 48990 + '</div>' 48991 + '</div>' 48992 + '</div>'; 48993 48994 var htmlCodePupUpRelated = '' 48995 + '<div id="l1pUIPopUpsRelated" class="l1pUIPopUpsSingle">' 48996 + '<div id="l1pUIPopUpsContent">' 48997 //+ '<h1 id="l1pUIPopUpsRelatedText1">Play Again</h1>' 48998 + '<div id="l1pUIPopUpsRelatedTop">' 48999 + '<div id="l1pUIPopUpsRelatedThis">' 49000 + '<h2 id="l1pUIPopUpsRelatedTopHeaderText">Nochmal abspielen:</h2>' 49001 + '</div>' 49002 + '<div id="l1pUIPopUpsRelatedNext">' 49003 + '<h2 id="l1pUIPopUpsRelatedTopHeaderText">Nächstes Video:</h2>' 49004 + '</div>' 49005 + '</div>' 49006 + '<h2 id="l1pUIPopUpsRelatedText2">Recommendable:</h2>' 49007 + '<div id="l1pUIPopUpsRelatedList">' 49008 + '</div>' 49009 + '</div>' 49010 + '</div>'; 49011 49012 var htmlCodePupUpError = '' 49013 + '<div id="l1pUIPopUpsError" class="l1pUIPopUpsSingle">' 49014 + '<div id="l1pUIPopUpsContent">' 49015 + '<h1>Error</h1>' 49016 + '<span id="l1pUIPopUpsErrorTitle">The connection to the server was interrupted.</span>' 49017 + '<br>' 49018 + '<span id="l1pUIPopUpsErrorText"></span>' 49019 + '</div>' 49020 + '</div>'; 49021 49022 $(self.container).find("#l1pUIPopUps").append(htmlCodePopUpCloseBtn + htmlCodePopUpShare + htmlCodePupUpInfo + htmlCodePupUpSettings + htmlCodePupUpStatistics + htmlCodePupUpMultiview + htmlCodePupUpPremium + htmlCodePupUpStreams + htmlCodePupUpRelated + htmlCodePupUpError); 49023 } 49024 49025 function setEventListener(self) { 49026 $(self.container).find("#l1pUIPopUpsCloseBtn").click(function() { 49027 self.clickClosePopups(); 49028 }); 49029 49030 /* 49031 $(self.container).find("#l1pUIPopUpsAutoplay").click(function() { 49032 self.clickAutoplay(); 49033 }); 49034 */ 49035 49036 $(self.container).find("#l1pUIControlsButtonRewind").click(function() { 49037 self.clickRewind(); 49038 }); 49039 $(self.container).find("#l1pUIControlsButtonForward").click(function() { 49040 self.clickForward(); 49041 }); 49042 $(self.container).find("#l1pUIControlsButtonPlayPause").click(function() { 49043 self.clickPlayPause(); 49044 }); 49045 $(self.container).find("#l1pUIControlsTimelineProgressBar").click(function(e) { 49046 self.clickTimeline(e); 49047 }); 49048 $(self.container).find("#l1pUIControlsTimelineProgressBar").mousemove(function(e) { 49049 self.mouseMoveTimeline(e); 49050 }); 49051 $(self.container).find("#l1pUIControlsButtonShare").click(function(e) { 49052 self.clickShare(); 49053 }); 49054 $(self.container).find("#l1pUIControlsButtonOctoShape").click(function(e) { 49055 self.clickPremiumStream(); 49056 }); 49057 $(self.container).find("#l1pUIControlsButtonMultiview").click(function(e) { 49058 self.clickMultiview(); 49059 }); 49060 $(self.container).find("#l1pUIControlsButtonInfo").click(function(e) { 49061 self.clickInfo(); 49062 //self.clickPremium(); 49063 //self.setPremium("seek"); 49064 }); 49065 $(self.container).find("#l1pUIPopUpsShareUrlCopyButton").click(function(e) { 49066 self.clickCopy(); 49067 }); 49068 $(self.container).find("#l1pUIPopUpsShareSocialFacebook").click(function(e) { 49069 self.clickSocial("facebook"); 49070 }); 49071 $(self.container).find("#l1pUIPopUpsShareSocialTwitter").click(function(e) { 49072 self.clickSocial("twitter"); 49073 }); 49074 $(self.container).find("#l1pUIPopUpsShareSocialGoogle").click(function(e) { 49075 self.clickSocial("google"); 49076 }); 49077 $(self.container).find("#l1pUIPopUpsShareSocialMail").click(function(e) { 49078 self.clickSocial("mail"); 49079 }); 49080 $(self.container).find("#l1pUIPopUpsMultiviewSelectionSingle").click(function(e) { 49081 self.clickMultiviewSelection("single"); 49082 }); 49083 $(self.container).find("#l1pUIPopUpsMultiviewSelectionDual").click(function(e) { 49084 self.clickMultiviewSelection("dual"); 49085 }); 49086 $(self.container).find("#l1pUIPopUpsMultiviewSelectionQuad").click(function(e) { 49087 self.clickMultiviewSelection("quad"); 49088 }); 49089 $(self.container).find("#l1pUIPopUpsMultiviewSelectionOverlay").click(function(e) { 49090 self.clickMultiviewSelection("overlay"); 49091 });
49092 $(self.container).find("#l1pUIControlsButtonHD").click(function(e) { 49093 self.clickHD(); 49094 }); 49095 $(self.container).find("#l1pUIControlsButtonSettings").click(function(e) { 49096 self.clickSettings(); 49097 }); 49098 $(self.container).find("#l1pUIControlsButtonStatistics").click(function(e) { 49099 self.clickStatistics(); 49100 }); 49101 $(self.container).find("#l1pUIControlsButtonFullscreen").click(function(e) { 49102 self.clickFullscreen(); 49103 }); 49104 $(self.container).find("#l1pUIControlsButtonDownload").click(function(e) { 49105 self.clickDownload(); 49106 }); 49107 49108 } 49109 }; 49110 49111 49112 L1UI.prototype.showControls = function() { 49113 $(this.container).find("#l1pUIControls").removeClass().addClass( "l1pShow" ); 49114 $(this.container).find("#l1pUITitle").removeClass().addClass( "l1pShow" ); 49115 }; 49116 49117 L1UI.prototype.hideControls = function() { 49118 $(this.container).find("#l1pUIControls").removeClass().addClass( "l1pHide" ); 49119 $(this.container).find("#l1pUITitle").removeClass().addClass( "l1pHide" ); 49120 }; 49121 49122 L1UI.prototype.showControlsFaded = function() { 49123 if ($(this.container).find("#l1pUIControls").attr('class') != "l1pHide") { 49124 $(this.container).find("#l1pUIControls").removeClass().addClass( "l1pFadeIn" ); 49125 49126 if ($(this.container).find("#l1pUITitle").attr('class') != "l1pHide") { 49127 $(this.container).find("#l1pUITitle").removeClass().addClass( "l1pFadeIn" ); 49128 } 49129 } 49130 }; 49131 49132 L1UI.prototype.hideControlsFaded = function() { 49133 if ($(this.container).find("#l1pUIControls").attr('class') != "l1pHide") { 49134 $(this.container).find("#l1pUIControls").removeClass().addClass( "l1pFadeOut" ); 49135 49136 if ($(this.container).find("#l1pUITitle").attr('class') != "l1pHide") { 49137 $(this.container).find("#l1pUITitle").removeClass().addClass( "l1pFadeOut" ); 49138 } 49139 } 49140 }; 49141 49142 L1UI.prototype.showUserInterface = function() { 49143 $(this.container).find("#l1pUI").removeClass().addClass( "l1pShow" ); 49144 }; 49145 49146 L1UI.prototype.hideUserInterface = function() { 49147 $(this.container).find("#l1pUI").removeClass().addClass( "l1pHide" ); 49148 }; 49149 49150 L1UI.prototype.showAds = function() { 49151 $(this.container).find("#l1pAdContainer").removeClass().addClass( "l1pShow" ); 49152 }; 49153 49154 L1UI.prototype.hideAds = function() { 49155 $(this.container).find("#l1pAdContainer").removeClass().addClass( "l1pHide" ); 49156 }; 49157 49158 L1UI.prototype.showInfoButton = function() { 49159 $(this.container).find("#l1pUIControlsButtonInfo").removeClass().addClass( "l1pShow" ); 49160 }; 49161 49162 L1UI.prototype.hideInfoButton = function() { 49163 $(this.container).find("#l1pUIControlsButtonInfo").removeClass().addClass( "l1pHide" ); 49164 }; 49165 49166 L1UI.prototype.showFlashPlayer = function() { 49167 $(this.container).find("#l1pVideoFlash").removeClass().addClass( "l1pShow" ); 49168 }; 49169 49170 L1UI.prototype.hideFlashPlayer = function() { 49171 $(this.container).find("#l1pVideoFlash").removeClass().addClass( "l1pHide" ); 49172 }; 49173 49174 L1UI.prototype.enableHD = function(partner, organisation) { 49175 //Partnerid 9 = laola1.at NEU 49176 if((partner == "1" || partner == "22" || partner == "9") && organisation.substr(0,3).indexOf('EHF') == -1){ 49177 //$(this.container).find('#l1pUIControlsButtonHD').css('display', 'block'); 49178 $(this.container).find('#l1pUIControlsButtonHD').removeClass('l1pHide'); 49179 } 49180 }; 49181 49182 L1UI.prototype.disableHD = function() { 49183 //$(this.container).find('#l1pUIControlsButtonHD').css('display', 'none'); 49184 $(this.container).find('#l1pUIControlsButtonHD').addClass('l1pHide'); 49185 }; 49186 49187 L1UI.prototype.enableOcotoshape = function(partner, isLive, organisation) { 49188 if(partner == "1" && isLive == true && organisation.substr(0,3).indexOf('EHF') == -1) { 49189 $(this.container).find("#l1pUIControlsButtonOctoShape").css('display', 'block'); 49190 } 49191 }; 49192 49193 L1UI.prototype.disableOcotoshape = function() { 49194 $(this.container).find("#l1pUIControlsButtonOctoShape").css('display', 'none'); 49195 }; 49196 49197 L1UI.prototype.disablePremiumEvents = function(partner, isLive, allowDVR, organisation) { 49198 var premiumEventsButtons = ['l1pUIControlsButtonRewind', 'l1pUIControlsButtonForward', 'l1pUIControlsTimelineProgressBar']; 49199 var self = this; 49200 49201 if(partner == "1" && isLive == true && allowDVR == false && organisation.substr(0,3).indexOf('EHF') == -1) {
49202 $(this.container).find("#l1pUIControlsButtonRewind").unbind('click'); 49203 $(this.container).find("#l1pUIControlsButtonForward").unbind('click'); 49204 49205 $(this.container).find("#l1pUIControlsTimelineProgressBar").unbind(); 49206 $(this.container).find("#l1pUIControlsTimelineTooltip").addClass('l1pHide'); 49207 //$(this.container).find("#l1pUIControlsTimelineProgressBar").unbind('mousemove'); 49208 //$(this.container).find("#l1pUIControlsTimelineProgressBar").unbind('click'); 49209 49210 redirectLink(premiumEventsButtons); 49211 } 49212 49213 function redirectLink(buttons) { 49214 for(var i = 0; i < buttons.length; i++) { 49215 $('#' + buttons[i]).on('click', function() { 49216 //window.open('https://club.laola1.tv/sp/laola1tv/web/info', '_blank'); 49217 self.setPremium("seek"); 49218 self.showPremium(); 49219 }); 49220 } 49221 } 49222 }; 49223 49224 L1UI.prototype.enableMultiview = function(partner, isLive, organisation) { 49225 if(((partner == "1" && organisation.substr(0,3).indexOf('EHF') == -1 ) || partner == "2871") && isLive == true && organisation !== "DFL Deutsche FuÃball Liga") { //&& organisation.substr(0,3).indexOf('EHF') == -1 49226 //if( (partner == "1" || partner == "2871") && isLive == true && organisation !== "DFL Deutsche FuÃball Liga") { 49227 $(this.container).find("#l1pUIControlsButtonMultiview").css('display', 'block'); 49228 } 49229 }; 49230 49231 L1UI.prototype.disableMultiview = function() { 49232 $(this.container).find("#l1pUIControlsButtonMultiview").css('display', 'none'); 49233 }; 49234 49235 // ----------------------- SET POPUPS ----------------------- 49236 49237 L1UI.prototype.setLanguage = function(language) { 49238 $(this.container).find("#l1pUIPopUpsCloseText").find("span").html(language.close); 49239 $(this.container).find("#l1pUIPopUpsStreams").find("h1").html(language['stream_select']); 49240 $(this.container).find('#l1pUIPopUpsRelatedThis').find('#l1pUIPopUpsRelatedTopHeaderText').html(language['play_again']); 49241 $(this.container).find('#l1pUIPopUpsRelatedText2').html(language['recommendable']); 49242 $(this.container).find('#l1pUIPopUpsErrorTitle').html(language['video_error']); 49243 $(this.container).find('#l1pUIPopUpsRelatedNext').find('#l1pUIPopUpsRelatedTopHeaderText').html(language['next']); 49244 }; 49245 49246 49247 // AUTOPLAY 49248 /* 49249 L1UI.prototype.setAutoplay = function(text, image) { 49250 $(this.container).find("#l1pUIPopUpsAutoplayImage").css( "background-image", "url('" + image
49250+ "')" ); 49251 $(this.container).find("#l1pUIPopUpsAutoplayText").find("span").html(text); 49252 }; 49253 */ 49254 49255 L1UI.prototype.setCountdown = function(text, image, startDate, language) { 49256 var self = this; 49257 49258 $(this.container).find("#l1pUIPopUpsCountdownImage").css( "background-image", "url('" + image + "')" ); 49259 $(this.container).find("#l1pUIPopUpsCountdownText").find("span").html(text); 49260 $(this.container).find("#l1pUIPopUpsCountdownTimeText").find("span").html(language['stream_start']); 49261 49262 var getTimeStampNow = new Date().getTime(); 49263 var getTimeStampStreamDate = Math.round(new Date(startDate)); 49264 49265 var formattedDate = new Date(startDate); 49266 49267 var d = formattedDate.getDate(); 49268 var m = formattedDate.getMonth(); 49269 m += 1; // JavaScript months are 0-11 49270 var y = formattedDate.getFullYear(); 49271 49272 var hou = formattedDate.getHours(); 49273 var min = formattedDate.getMinutes(); 49274 var sec = formattedDate.getSeconds(); 49275 49276 if (d < 10) {d = "0" + d;} 49277 if (m < 10) {m = "0" + m;} 49278 49279 if (hou < 10) {hou = "0" + hou;} 49280 if (min < 10) {min = "0" + min;} 49281 if (sec < 10) {sec = "0" + sec;} 49282 49283 $("#txtDate").val(d + "." + m + "." + y); 49284 49285 //$(this.container).find("#l1pUIPopUpsCountdownTimeClockText").find("span").html(d + "." + m + "." + y + " - " + hou + ":" + min + ":" + sec + " Uhr"); 49286 49287 //var formattedDate = new Date().getTime() + (5000); 49288 49289 $('#l1pUIPopUpsCountdownTimeClockText').find("span").countdown(formattedDate).on('update.countdown', function(event) { 49290 var $this = $(this); 49291 //$this.html(event.strftime('<span>%D %!D:Tag,Tage;</span>' + '<span>%H %!H:Stunde,Stunden;</span>' + '<span>%M %!M:Minute,Minuten;</span>' + '<span>%S %!S:Sekunde,Sekunden;</span>' )); 49292 $this.html(event.strftime('' 49293 + '<span>%D %!D:' + language['day'] + ',' + language['days'] + ';</span>' 49294 + '<span>%H %!H:' + language['hour'] + ',' + language['hours'] + ';</span>' 49295 + '<span>%M %!M:' + language['minute'] + ',' + language['minutes'] + ';</span>' 49296 + '<span>%S %!S:' + language['sekunde'] + ',' + language['sekunden'] + ';</span>' 49297 )); 49298 }); 49299 49300 $('#l1pUIPopUpsCountdownTimeClockText').find("span").countdown(formattedDate).on('finish.countdown', function(event) { 49301 var $this = $(this); 49302 //self.playerMain.onCountdownComplete(); 49303 $this.html("Reload"); 49304 }); 49305 49306 if (getTimeStampNow > getTimeStampStreamDate) { 49307 $(this.container).find("#l1pUIPopUpsCountdownTimeText").find("span").html(language['video_live_dvr_error']); 49308 $(this.container).find("#l1pUIPopUpsCountdownTimeClockText").removeClass().addClass( "l1pHide" ); 49309 } 49310 }; 49311 // SHARE 49312 L1UI.prototype.setShare = function(shareObject, language){ //allowShare, shareUrl, sharejs) { 49313 49314 if(language) { 49315 $(this.container).find("#l1pUIPopUpsShareText1").html(language.share); 49316 $(this.container).find("#l1pUIPopUpsShareUrlCopyButton").html(language.copy); 49317 } 49318 49319 if (shareObject) { 49320 var allowShare = shareObject.shareAllow; 49321 var shareUrl = shareObject.shareURL; 49322 var sharejs = shareObject.shareJS; 49323 49324 if (!allowShare) { 49325 $(this.container).find("#l1pUIControlsButtonShare").removeClass().addClass( "l1pHide" ); 49326 } 49327 49328 if (!shareUrl) { 49329 //$(this.container).find("#l1pUIPopUpsShareUrl").val(window.top.location); 49330 //$(this.container).find("#l1pUIPopUpsShareUrl").val(shareUrl); 49331 $(this.container).find("#l1pUIControlsButtonShare").removeClass().addClass( "l1pHide" ); 49332 } else { 49333 $(this.container).find("#l1pUIPopUpsShareUrl").val(shareUrl); 49334 } 49335 49336 var clipboard = new Clipboard('#l1pUIPopUpsShareUrlCopyButton'); 49337 /* 49338 if (!sharejs) { 49339 $(this.container).find("#l1pUIPopUpsShareSocial").removeClass().addClass( "l1pHide" ); 49340 } 49341 */ 49342 } 49343 }; 49344 49345 L1UI.prototype.setDownload = function(url){ //allowShare, shareUrl, sharejs) { 49346 49347 if (url) { 49348 49349 //var fileName = "data.mp4"; 49350 //var link = document.createElement("a"); 49351 49352 49353 49354 //$(this.container).find("#l1pUIControlsButtonDownload").html(""); 49355 49356 var linkButton = $(this.container).find("#l1pUIControlsButtonDownload").find("a"); 49357 //var link = document.createElement("a"); 49358 49359 linkButton.attr("href", url); 49360 linkButton.attr("target", "_blank"); 49361 linkButton.attr("download", "demo.mp4"); 49362 49363 //linkButton.append(link); 49364
49365 //$(this.container).find("#l1pUIControlsButtonDownload").find("a").html('<i class="fa fa-download"></i>'); 49366 //console.log(linkButton); 49367 49368 //if (linkButton.download !== undefined) { 49369 //console.log("NO DOWNLOAD!") 49370 //linkButton.attr("href", "abc.mp4"); 49371 //linkButton.attr("download", "download2.mp4"); 49372 //} else { 49373 // console.log("DOWNLOAD!") 49374 //} 49375 49376 $(this.container).find("#l1pUIControlsButtonDownload").removeClass("l1pHide").addClass( "l1pShow" ); 49377 49378 49379 } else { 49380 $(this.container).find("#l1pUIControlsButtonDownload").removeClass("l1pShow").addClass( "l1pHide" ); 49381 } 49382 }; 49383 49384 // SETTINGS 49385 L1UI.prototype.setSettings = function(language) { 49386 if(language) { 49387 $(this.container).find("#l1pUIPopUpsSettingsText1").html(language.settings); 49388 $(this.container).find("#l1pUIPopUpsSettingsText").html(language.qualityAutoInfo); 49389 } 49390 }; 49391 49392 // TITLE 49393 L1UI.prototype.setTitle = function(text, showTitle, data) { 49394 //console.log("SET TITLE: " , text, showTitle); 49395 if (showTitle) { 49396 //$(this.container).find("#l1pUITitle").removeClass().addClass( "l1pShow" ); 49397 $(this.container).find("#l1pUITitle").find("#l1pUITitleText").html(text); 49398 if (data && data.meta && data.meta.mediatyp) { 49399 //$(this.container).find("#l1pUITitle").find("#l1pUITitleMediatyp").html(data.meta.mediatyp); 49400 } 49401 } else { 49402 //$(this.container).find("#l1pUITitle").removeClass().addClass( "l1pHide" ); 49403 $(this.container).find("#l1pUITitle").css("display", "none"); 49404 } 49405 }; 49406 49407 /*// WATERMARK 49408 L1UI.prototype.setWatermark = function(url, pos) { 49409 if (url) { 49410 $(this.container).find("#l1pUIWatermark").find("img").attr("src",url); 49411 } 49412 49413 if (pos) { 49414 if (pos == "TR") { 49415 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosTR" ); 49416 } 49417 else if (pos == "BL") { 49418 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosBL" ); 49419 } 49420 else if (pos == "BR") { 49421 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosBR" ); 49422 } 49423 else { 49424 $(this.container).find("#l1pUIWatermark").removeClass().addClass( "l1pPosTL" ); 49425 } 49426 } 49427 };*/ 49428 49429 49430 /* 49431 //RELATED 49432 L1UI.prototype.setRelated = function(allRelated) { 49433 var nextRelated = $(this.container).find("#l1pUIPopUpsRelatedNext").find("ul"); 49434 var listRelated = $(this.container).find("#l1pUIPopUpsRelatedList").find("ul"); 49435 49436 var listInfoRelated = $(this.container).find("#l1pUIPopUpsInfoList").find("ul"); 49437 49438 nextRelated.html(""); 49439 listRelated.html(""); 49440 listInfoRelated.html(""); 49441 49442 function generateRelatedSingleVideoHTML(imagePath, titel, time, link, target) { 49443 return '' 49444 + '<li>' 49445 + '<a href="' + link + '" target="' + target + '">' 49446 + '<div class="l1pUIPopUpsRelatedVideoElement">' 49447 + '<img id="l1pUIPopUpsRelatedVideoElementImage" src="' + imagePath + '" />' 49448 + '<p id="l1pUIPopUpsRelatedVideoElementTime">' + time +'</p>' 49449 + '<p id="l1pUIPopUpsRelatedVideoElementTitle">' + titel + '</p>' 49450 + '</div>' 49451 + '</a>' 49452 + '</li>'; 49453 } 49454 49455 for (var relatedVideo in allRelated) { 49456 var actualRelated = allRelated[relatedVideo]; 49457 if (relatedVideo == 0) { 49458 nextRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, actualRelated.start_date, actualRelated.link, actualRelated.target)); 49459 } else if (relatedVideo < 5) { 49460 listRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, actualRelated.start_date, actualRelated.link, actualRelated.target)); 49461 listInfoRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, actualRelated.start_date, actualRelated.link, actualRelated.target)); 49462 } 49463 } 49464 49465 }; 49466 */ 49467 49468 49469 // PREMIUM 49470 49471 L1UI.prototype.setPremium = function(premiumFeature) { 49472 49473 var imageHD = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQvklEQVR4nO2de7BdVX3HP/vew+UmTS6BkHeaAgk3ISGAkoBUQhMr1ikIxbY2pbVosa1Yx9bOtNQRokUQ22rpVDuglZYRccaq09ZWzYhFnhYbjCSEkMSEJEACgbzfj3vz7R+/c8g5+6y991r77PNIOZ+ZNcnde5+111q/vfd6/B4rksRJSAT0Af3lf0vAXGAAOFY+NguYCCwDdgCnlH+7DtgOHC5fewQYamHZC6HU7gJ4ciowDhgLnAdcBPxC+f9nYwILZS3wUvnfFcCzwCvANmB/40VuLlEHv3EDmIBmAYuAecCMJt9zJ/AE8GNgJSbQF5p8z1
49473x0ouCuAH4VuARYQHu/CquAR4DHge8Ce9tYlho6RXBnAtcD12Jv2RntLU4dAn4KPAr8E7C6vcVpv+DOBJYA78L6rChnPqpKYIONdcAB4HxgRPl4VJXy8gqwHPgs8MMG8mmIdgluMvAR4A+B0wN+dxQbOOzHGm8T1hdtAl4GtlZdewwT5CmcENQYYBAYD/w88Cas35wMnAaMDCjLYewNvB3rE48G/LZhWi24iZiwPoo1og87McGsAh4CnsJGgEUyACzE+tf5wFnAtIDffwW4C3i64HIl0krB/RZwM/aU+/Ao8DD2OXq4OUVKZCbwTmxwdDkwweM3Q8BngM8DrzavaEYrBDcduAMTXBY7gW8A3weWAgebWC5fLsbexvcCF3pcvwz4FPCfTSwTSGpmukHSBmXzkqRbJc1pcnkaSVMkvVvSEx71OSDp7yUNNKs8zapkv6S7JR3OqOBOSbeXG6XdgvFNYyRdI+knkoYz6veYpIuaUY5mVGympEczKrRbJtiJzahUi1JJ0ockbc6o605J1xd9/6Ir8zZJGzMq8oikRU1u1FamcZK+JGkoo95LJPUWdd8iK7BY0qGUgh+UdJukvjY2cjPTYknPpNRfkr4sqaeI+xVV6L+QdDSlwMslXdEBjdvsNK0snDT+pYh7FVHYv8wo6DclTeqARm1ViiR9VNL+lDa5t9H7NFrIjyl5ZDUkGzH2d0BjtiO9U9KOhLaR7M3M3ec1UrDfkXQkoVAHZCOudjdeu9M8SWsS2kiyNy/Kk3feAr1D0r6EwuyU9Jsd0GidkmYqfRHiU3nyzbPkNYitH052nNsJvBtTPnY5wSDwX8C5CedvAu4JyTBUcP3YCv1ljnNDwGLgWyEZvoGYgQlvpuPcQeAqAhbTewJvfhduoQ0Df0pXaGmsB64BNjvOjQS+CEzyzSxEcO8HPpBw7k7gHwPyeqOyDmvDA45zg1gb+snEszOcJun5hM71K7J1u3YPAk6mdKOSl8i8RuM+fVwP8K/ArzvOrQbehtkidvEkiiIkfR74sOP0RqxNN6Xl4fNaXg/8muP4PswMoSu0QMovy8cxy7E4ZwO3kSGbLMGdCXwS6HWc+wfMeLRLPvZi4waXmcNi4O1pP84S3E2Y6UGcxzD1fJfGWIGNJuOcgrXv6KQfpvVxUzDLqrg11l7s09k2m8L/Z/QAT2LWZXE+iFuwqW/cx3Gb0D1AV2hFchy4JeHcLcDPuU4kCW4s8D7H8R1Yx9mlWL6PWbfFmQr8sesHSYK7lRNm29V8EjPB7lI8H8NtjvhezN+vBpfgJuGes60B7m+oaF3S2ADc6zg+G4c8XIL7XWxgEudLwJ6GitYli3upd6rsAd4XRVHdwWp6gaup92bZjq1sd2kuzwHfcRy/RNKC6gNxwV0BXOD44QPAz4opW5cUjmLd0bHY8THAldUH4oK7kvopwEHg34ssXZdUHsNcyOK8iyqHz2o33bGYr3WcJ8spLxHmxtSHzVmSrjmEW92RRD8wihPOjHF6MD3h7th9S1gggCL82XqA1wrIp5q9wIPApbHj5wNvBn4AtYKbjXv2/hjmxJeX6ZjnStby2hcwFyVfPgLcmHHNfsxLaH3VsSXAb5P8EIWyo5zXfmztdjXWuI0M5P4NW8AfX3WshLmo1QnuzdQvJr9K44OS8VjkhCxCK3olpnxMYyW1DvcjsCe5WdEbfgX7cuwDvgn8DW6NdypRFC2XtIFawYGpe+4B9lXegj7qX02wOCAu1UMIvo6Mru96GllCA9M47676ewLma95MRmAN/iHMOfOq0AzK68dPUd8NzMe6tNc/XxMw78s4y7B+Ii8Rbu1CnMPAroB8x2E+21msp7YvG4/pu1rFNOCrmFdrKN+jfiVlLObm/LrgxmPrYtUcwfq3RhiBe3oRZzlh0XzmcCLEUxrxsBbjcSwfNZkxWN8dEqQALLbKIcfxRUBUEZzL3m8fjfte9+P3qdyAu5BJTMEvcM3u2N8+b38zuAibI4ewD3c8lXlAfw82IPlFxwXbgS2BN4szgF+wmbVRFIUMz+eT/cZtxh6ICpVRWbtwmTVm8d+OY3OA/hL26XB991fluFGc8z2vW+1htFTNuWQHmdlYThV6scHKgzQWFEDlew9i3UuiljrGbEy3FjJX3eA4Ng0YmSa4ImKJzPG4RoQZHPVS3x+7eI3az+8R4NPlVBRvxZYDfUaqeSIaPc2JB6U6n8EebIASH1oLCwfYKOd4XPMiYRHqJuLX0bue1qJ5AvgEyas3jbIR96h+Vgl7el39RRFLOfM8rtmCPTx9CeWo5hAWUHSUR74bHcdGk75i0ot9ykKmQOvKebos4aopkS+G2Abq/Q1mlnCPKI/T+BtXwi+s0hzg29h8K6vyR7EhfdYcbg/1gvsANilOezsizNtoU0b+1fhOL14kvG8dxj2/HV0iuSLbA28SZyYW2TWLAfwi9oTwGqbbqhBhw/GsUeVBwt+K6fgZFm8lfDHjGDYleEvs+Lk92FwrznEaD/B5AX6Cawb7sGh6FUr4LZE9RHgXMQM/Ya8MzBfspXK9paUe3BqBpE4xhJm0fpWiwhZqy1/C4jdnsZXwz9lsz+viiwE+RLjfZvXg7qy307jgfJa6mkW8f55Kgn1ijNWEq3t81j4rQboLI+nb3EtjUVTB7XnZCoaonwrMw68fWhN4r7H4hURcgXuUm5se3AIaprG5yWm07zO5B/hR7Nh0sh/EY1jfGMJ5uMcIcbZQcAjHEqZzi3MR1vBHcuZ7MWW9UQbD2BA/622oPEQlsgdNR6jVeINfP7QWG7KHMBW/BzRYmVqmOs50DSXcc5b+pB94MpXsSfJxTEP8VbLnZUPY5/s2YtZODvZSvx7os2a6hfAp0Hyy3ziRfxUnaXBSKuEesqt8PO+OF4Nkr4JsA76Ofyj4UR55ggW2rqYPvyWyLYSplsAeiKxP8E7g+cB8K/RSVpzGeLUHd6fpq7lOwucJ30VYhSpbsmSxNfb3m/AbUYbu6HEB1iVksZnaxYAQeqm3OwF4tgdba4sTYd6oefFRdewhbDAwmewR3HHgJ7FjM3A7sMQJFdyt+PXjPyPfHA7sM+laqN9f+X7GO+WI/JZQ0/FTc4SuhfoMu49Tr0f0WXrbhf9bUcJMCa/zuHYIMxjKS5ImZF2pnPlWbAOFavKuHw7idhqpRgTMa8pRCnzmhceo19r79EPHsPqegnvTCGGf24uB38B/jroVs5HMyznU6+MAVpaw+cVPqTfPy9vHTSR7pHWIAEWtpH78Gusp6qcwrj4izngCY2l58gi1a6ahzKdeaEeAHRUzbdcgYZB8i8RJgcaqOURYhz0Kv6Wl56ndxG8SZsrXDvZi+y00gsuQ+H+Ag5U+zmX0Oop8Bi4+OrhhwpaABvAzg6io+iucQ/t2xvpzGtNpRriNuJ4FDlUEt4n6Ed4o3EayaZyO38DkGcLmTFPxGxnGraHPxn8PnyL5AuYI2ghzcX/mnwSOVwT3GvWVjjBb9RCm4DcaDTVE8rFdgfo53Hm0duNAYZ/HPykgr4W4B0or4MRyyh7s2xnnLOpHm2mcgQ1OsghZu+ulXgOclGd8pcfHGqwI9mLttzCKolsoxhPo7dQ/dCspq4eqT8RX1MEmvQvxd9r3FfL/el4HVkafEe4aagV3KsU7eBzGPvHDWNfyKjbhf4By+wXahyYxBffq0+OYW1eN4J7DVg+qBxd92HZcD+D3FK3F/M/S9hIVYSPKYeA+bI/SpDL0YxPvaj++PuDLmPNEI/591bzMia2ot5B/1T+La3A/dD+krOCuDgkVYSv118cu3gb8EsXYWXbx4xvYRL+arZgc1kOtykCYt2P8XZ+A7RLcpTXMxbqnOEupmm/HdT3fxf1mXUd7htVvRK6jfoF/CPvkv95VxAW3DXOKiHM59pp2aS7TcMdQW0XZ97uCS7t6P/Ua5AgLwdeoAVGXdBbiXtpbSkw1lBSv8mHcb9gCbEjapXhGYEt2ccPdbZhXUI35Q5KRzpKE45+l+9Y1iz/CbW39EA6blbQIsUux8A9x3oM7tmKX/IzFNOVxpekQptqp2188zSwuSSVxO2E71HfJ5g7cmu5/JmFT+DTBLQP+w3F8kMb1TF1OsAD3HukHsQ3hnaQJ7nD5hy6j2BvJCK/exYsBLJSGa478t6QsqWVZEP8Yt0p/NPC58o275OcTuG171mDtm7g+7GP6/Ve4Y1VeANwRj1zaxZurMA9ZF7eQYbro48GyCwtl79JY3yQpK4Jdl3pmYRpyl1HV13CPLWrw2vivbB53H3CD4/QB4FrcwVS61HMGFrjVZRayGngHHoGBQnZsHMDCQ7gUfKux3T+64X/T6cF0m4sd545g0c5dMZmdGfmyF4tc4PLzmo0FE22VqcDJyp24hQY2gvcSGpBrV+IPJmxYJ0k/knRaB2ys14npr1Pa7euh+eUtxOdSCv
49473EdSeM7oKE6KX0mpb0ekjQ6NM+8BSnJNh9P4hlJszqgwdqdeiR9OqWdXpA0N0/ejRSqT9K3Uwq1WtJbOqDx2pVOl/S1lPZ5QdLlefNvtHCTJD2SUrhdkq7pgEZsdZqV0S4vSXprI/coopATJP0gpZCStETSiA5o0FakayVtSmmLLZIua/Q+RRV2QNJ9KYWVTLi5vucnSTpVNmgbTmmDrZIuLeJ+RRa8JOmLKYWWpBclfbgDGrnotEjSUxl1f1jSnKLuWXQFSpL+TNKxlAoMyeZ7C3LOIzspnSnpHkm7U+orSd8qX1vYvZtVoaslbcyozCFJd0uaKSlqUjmalcZJ+gNJ2zLqeFDSnbIHutAyNLNyZ8sm41kck3SXpAubWJai0jRJN0h6zqNeayW9p1llCVlkDqasVbgZuJnsIDEHMOeOB/FQa7SYizEz/MX4hZe6H1OFhYaY8qapgqviUkx4PiEmwCzMHscWXZ3GMi1gDLZa/8uYg6dPuI6VmDFV063gWiU4MIPPqzGbTd/9CF7GHB2+h20X8zjFbR/m4iysjJdjGv5Z+NmRHgDuAu6m3iu2KbRScBVOB34fc7cN8Xbdi6nzl2O2MKuwJ3w7Zn84TG3EBRe95VTC4pbMxmw+5mL2i5WAML7uxwexOCZLyB+vKxftEFyFkVhkgt/D7OXzGK8cxwS6ATPV3owJMK5nrIQPnIyF0JiOecTk2cQBTEO9DNsXfUWO3zdMOwVXYQB4P2b+cBl+gTvbxTNY0Jm/o+CIr6F0guCquRqzxViEO8h3O9iKuTgtLf9b9J6oueg0wVWYgIUrXIB5DV2CX6zKoliPTUuWlVMRG0QVSqcKrpqxWKCWGdin9BJsXlWUh+xhbMCzGhv0PA28EkXRS53cNieD4KqJsEHNSMzM7ULMl2EUFjJqHMlh9yNMSOuwMBdrMYvhFzGb0cPUb5zesfwfJazWWH91m9AAAAAASUVORK5CYII='; 49474 var imageWerbung = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAATIklEQVR4nNWdebRdVX3HP/fmkYQQHnlJSAJoJBCSlMEgJVAoQcK0XMggKBK0hVor2JZVxFWBVkspgtKWiktUZFIGsWIRtS0SBAEDYWgACRggEwFCGEMgZCDJe8m3f/zOJZfz9j5n73PPufflu9ZeLzl3nz2c3x5+0/7tmiS2QtSAwcDQ5G8XsA/QDfQmz6YA44C5wJvJsw3AM8BaYH2SdwPQ197mt46uTjcgEEOAHYGRwETgQGA88EfABIxgsVgAvJT8nQfMB14FXgPWtN7kalEbwDOuG9gXmzkzgP0xolWJlcAc4BHgSYygL1ZcZyEMRMIdChwDHABMp7Orwh+A3wEPAL8G3ulgW96HgUK4YcDngJOwWTays83pBwG/B2YD1wBPd7Y5nSfcaOACbIZNAOoFy1FTAmM2nk3+PYUts7bWlIriVeBx4DLg3hbKaQmdItzOwN8BZwA9Ee9txBiHNdjHex7bi54HXgFebsrbm/zdpunZCGASMAb4IPARYA/gA8B2SQrFemwGXoztiRsj3m0Z7SbcOIxY52AfMQQrMcL8AbgHeBTjAMvEWGAacFjyd1eMaw3FjcDlwBMlt8uLdhLuFOA8bJSHYDZwH7Yc3VdNk7yYDHwMOAQ4grBVoQ+4FLgCeL26phnaQbjdgUswwuVhJfBfwG+AWcC6CtsVioMwTvdUYGpA/rnA14H/qbJRSKoynS5pifKxUtKFkvaquD2tpF0knSRpTkB/1kr6tqTuqtpTVSeHSrpS0vqcDq6UdLGk8VV1sII0QtLxkh6TtCmnf/dL2reKdlTRscmSZud06G0ZYcdV0ak2pS5JfyPphZy+rpT0mbLrL7szh0tamtOR30maUfFHbWfaUdLVkvpy+n2BpEFl1VtmB2ZKejej4eskXSRpcAc/cpVppqSnMvovSddKqpdRX1mNPlfSxowGPy7p0AHwcatO4xPiZOFHZdRVRmPPz2norZJ2avMHHCRpqqS9JY1tc901SedIWpPxTa5rtZ5W5bh/wFQ+Lh3jJkwgvRhTD5WJoZhi+mBMFzk5SeOTtgwCtk3y9mLqKAGrMBXZckxlNg9YBrybtLdMfAy4Gb/C/DrgzML1tkD1z0ra4BlRa2UcV5kjeZykA2Xy3gPKZwZCsFnGTF0jY/EnqNw9eH9Jz2bUf51shkaXXbRBMySt9jRmpaSTy+h4MrD+VMaRzc/4AGXhLUk3SDpGJq+VQbzJylZCfL1IuUUaMjGjIW9K+mhJHT5B0k9ls6ITuFfS36scAk6StDCjri/GlhnbgKGSHvJU3ivpkyV08jhJv1Q5S2EZmCvpS2q9XxPlXzbXSjosprzYyq/0VNwn6W9b7NhYST+U9I7/G3YUD0o6Uq3PvOc95S9QBPcdU+nnZLPKhULrdJK6JJ0m6ZXs7zYgsFbSdyQNV/H+Him/qHCbAgX00MrGS3rOU9mNso9fpBOj5J/FAxkPSfqIihPv8/JvBUHceEgldZkQ7cJ8FRdwJ8q051srVslEoui+J9zyFZ5yn5O0a24ZARX9mdyj4x0Zq16EaB+XtCj8Gw1onK9i36Bbpgp04UblLJl5mpPRwMOYFTuNS4CvFZD5P4n5aAwr8K4P64AHgcWYJ/JGYCnmaj4R2AHYHtOuTMA8oMvEvwPnA5sj35uKWfvHpJ73Ascmv7mRMyr+yTMiZksaUmCUnSJbYlpFn6R5kr4qabpM47GDMswmSV+3ly3te8oYoltVHhd7la/unHSRp7xHkvZGL5W7yDQJaaxSMXva8WqdaC9K+q7Mqjy0QBvSqUvSaJl140n5ueZQfE3xKqy6pP/zlHem772sAr/vKez7kQ1D0u5qTWW1TNK/qUIfDtkHP0v+fScURYT1ozP6vZ3rHV9Bo2SGzzRWKN7dYLikh4t8gQQ3yMwzVREsnQZLOlv5RlEf3lEx2+PPPOWd68rvK+TbnkLOKtCgm+P7LskE8kLsdknp0YLtlsziMDqyvt1lAn4aT8lhsXAVsJNsiqbxjIwBiGnMaQU7fo9Mq94Jgo2UdHfBdjfjNsXvd99xlLNJ0qnpvK6XvyK3Rv6cyEZMkPRagQ5fp2r3snYQrYEzIuufKre57M60BJB+cZDMCyuNNyTtEdqApJIfFejodQEiSlWpW9JdBdqchaUyL7DQNgyWmbLSeEsm9ryXN+1ycCjwYYe4dzOwKFSqlHQ08KnQ/AmuB/5K6sjpoR7gNuDIksvdFfjHiPwbgZvYctKogRHAUc0P0oQ7iv6naNYBv4yovAacBQyPeGcO8AW2nG9rJ3qAX2CHO6rAnxN25qCB+zF/mDSOo8l/pZlwo7Cz1mk8nKRQHEncyH0BmElnIh80iPbRCusYBZyNOTCF4B3gLsfzvYH9Gv9pJtye2NmwNO4n3EtrCHb+bdu8jAl6gXOx6AftxkjgVooRbXGSQnEipicNxS/of1Sri6Yjas2E24/+o+J14H8jKtwPa2Qofgj8LCJ/WRiR1Ht4gXcXJO99lXDXuhHAx2u1sBPMtVrtcWCJ46fDMWX5e4QbjMUOSeMl7NB6SGVge2TokrAM+FZg3jIxAjuDV2RPW4wt68swwsfs/X8hKSgoQcKgPUr/PX8atvS+R7ixWGiKNOYSOKokjQI+G5I3wU3Awoj8ZaAH+DnFuMfnMJNU83HhSzFn2hDsSZw56Q76H+wchXGq7xFuDHaAvRkbsP0tFPtgB+ND8BLtn20jsBlSZHlcDJyAeUE341Hg9ohyPkV4xIcHcA+KGUCtQbg9HBlWE372ug4cH5gXbPN9MyJ/qxiJyWmHFnh3EfAJLHiACzED8ESMgQvBatzxVPYHhjb87A92ZFiB+diHYAjhe8ZmzG++XejB9jSXqJOHhdjymBXl4VHCxaUPEb4qAfzW8WwvEsINxsz5afhGmAujMTkjBPdSfrgLH1rhHhcCnwaeysnXi83mUMTMehdnOR4YlkW4mI+7H+FRge6mPcJ2Y6YVYUQa3OO8wPy/IVw0OCSiHU/Qn7OsAZPq2AdPT19h8kooXIK7D34HmPLQKvd4EoFiUIJlhA/00JUJzOHJNSCm1DFuchvHj29EVLBLYL7XeH/YpirQg3GPRfa0xRiTlbc8prEKC6gTgrH09+rKgmu5nFzHzVFuJm7GhY6ieZjLXFUYic20ItzjQozrK7L/bgIeC8xbx3iC0HLfcjzfvo5fI78isHCwURSC+bVabXVEuTEYSXHucQFwMnEMWRorCLNuDCYRogPQi1sk2KOOHctNYzPhAT63IVyoXFWRvW0H4BaKc48z6S9cx+IVwkJYbUN4PE55yuyq42YsfJuiC5MI90p+LTBfDFphRJZgMcbKiHrXHC+zLNRwc+vqwu02vYJwwsW4Xb8QkTcEDcv1YQXeXUK2RiQWrQYwjYJvORxUUSNCLQchaMUIuhgjWrsUAaWjjptAmwif9jEEDjWw5qHBPRYh2iJMTiubaFUslV7UcVuf98W4nxC8Sn/nFh/KCD/fg6mxiuoeTyZeTgtBzFIZms87GOpY2Nw0hvpecGAl4fvhdqFWYA+6MaIVMYIuIk6NFYvhhDFpmzGTWQh8zElXHbeZQZ7nPoTG499Dkkv8CEErLnTPYTMtRo0VizGEzaQNuLUhLgzCLfO9XsdY/zRquA8z+uAqw4UJFDvQOILiLnRLMDVWVTOtgVDt0UZMtxmCQbjVY/PruN0HaoSrZcAuGgrBh4nzt4Stg3vcDjNwhmAz4cG268BujudrGutnegTUiGMkQmWhIcTpERsudIdFvNPAQox7LEtOy8JI3D47LsQwRuNwR2BfWMdsYy6NfYz3bcyIPio/C9AeI2hZ2I/EbS4AcyPK3Q03k/hkHdOFuTbtmD3uacKV0keTf1lEKy50VXOPLsR4t8U4YE2jP8OzAXizjrHyzzlemkQ4Z7keu4UjBOOw2eDDCIrrHpdSPfeYxhhsMIZgI3Ezborj2UPAusYe5+rocOyyhBD0YR87FH/ped4D/IriLnTH0d6ZBhYsdIfAvHcCbwfmreF24poPvNsg3POYO1gzhhO+4YKNpFB5bhp2g1UzOmUEbQU92PVpobiZcGXFPrhFgYeBzQ3CvUH/oz014kb+csKdQ+tYcJtG/a0YQRtqrHZwj2n8NW5HKxfWELdMHoZb5p0HWz7cKmztTGNX7LquEGzE5K1QHISN1m5aM4KeQutG0CLYE1smQ3ELcWatI+lvvXmSxKbZrAd70PHyzsTJUA8Sd5vhlzGnz6IudGUZQWMxCLiI8KvKNmLyaOgyuQtuTcwDJB7gzYR7hv4XuQ7GonmH+kwuB64NzAs2akM1Ds1ouNB1gmgAn8c8nEMxG7trNRTHY17PadxLQvxmgizBKJrGEbg9wXy4gTgPsVgUdaErC3tjsy0UfVjQudBTPWDbRnqyvEzTQG3+UZiXcVpSH0t/DjALK7EDi1UYFasygoZiMiauhHq1gcm3P43Ivw/u7WkWTfJ2mqq/xj1bTiT8akywWwvLXsYaLnSdmmk92Jk+l9LXhzXAdwk3NIN967SCvw87L7fFv8cRa8MV3WazLJx8TNyQmSovkvlCVXQPW2CapGLxyK6OrMcXQvn3SoXRd708Te5gz3coPsTRDQU6m8YiWcSdThFtX0lPF2j3UkkfjKzLF0Lrm+m8vgLu8xRwSGRDRiv7ooQ8zFN858tMX1DxQKRHRda1rSyEfRqvygK0vS+/j82/wPP8MuK8ulZggWeKup3H2gXLwm6YSelqws01zbgMd6ySLJyJ+9DjPbhcHTJGwCzPSCpyb86Xig1aSRZV9ha1J5petyzKqy9UfwhuU3w4/1GyO4nS6JVnb88qbLqnYQskDYtsWE3SJQU+QjPekPSTpCNl3jhVl9QjC+j5fIttvE/SmAJt+IGnPG+c56zChsruuHHh8gKNQ3YFS6vok/RbWUjBiZJG5KwcrjRM0odkd7p+T+UE+H5Y0s6R7WhMEFfs67Wy0JHO9/LC1/8JFnkhbVBdjQnCd8cs4rVaDUnXA6fHvJcBYdqex4BHMFvXG5h8+jamI2zIRMMwwXkqFm9kBuGnZvIwF7MxxlooujF1mMtN5F8wDY37bEbOaKjJH+Z3nooFBK3JIplXhbWy+8eXytj4Ncq+9rJVzFHx207+w1PmM8oIXa+cpbKReuRn6a8IIL4vnRv8aQYublWxPQ3ZbSe+W5xzr3MLreRkuaOi98ku+ClKvOMkLQ/9SgMM35TJXkX6PUX+ft+sAK40qKJkVl3vqWiNpCMKdgDZBvwrtX5ZQ7uwTNInVPBuU1nc59mesufLLurIp0lEhd3yx+Kfr4iYzZ50puwmj4GKNZJ+rMAP60l1Sf/pKX+9bPkMm0yRFR8od2x8ya6R/EALnULG3l+lctjzMnGnbJa10jck/WtGHRfGlFWk8i9mVP6g4u8mcKUZMgJuyqirHZgl01e22p88ot0SW17RRvjYWEm6XcU5rXQ6WNI/y618rQrrZIPmWHnutSmQLs2o7x7lsP6uVLQhXbKLHXx4SsY5ldFpZLePHCPpWrm1DK1ivWw5PEO2V3uvM4tMdUnfyKj3RUn7FCk7T3OShcGY59Jxnt+fwbQJMRHU8zAIO9K0J+aXMR3TqA9P2jOULdaLhranly3ah17M92Nj0r65mKV+DmbJCD0pGoIe4HvAqZ7flwGfwe3nk4tWCAewE+ZP4fM+fhtTb/13K5UEYBwWk2x3LACMMJ/QHTE11DqM6K9h7oNVR12fAlyF/7ssx1wL5xSuoYTlYKzy76O5QMWF1a0tnaBsK8NySQe1Wk9Zje2WX0Bv4G4VXM+3kjRExrRlccIvy0Sqlusrs+FdMm4sC8tU7A66gZ5mKP++ufsk7VVWnWV3oEvSl5WtvuqTyXvTS1qqO5lGy4ygb2f0V5J+rviLANtKuEY6VmZWycK7kq6UuSQU1ft1Ku0oE8zz7sdbJ1NGx7oydIxwyJTHt+d0TLLZebk664IXmsZLOl1mL8vDAkmfrqotrYoDmUgs3ucB5+GOHtCMtdgdcndhbt4DCX+MueHPxGTIPNyE3b0TGs8kGpUSrgkHYsQLvTBpFiaY3k7nTuSMwE7kHIEJ+yHnBRZg7gY/qbBdQPsIBxY571jMZzM0Cs8r2EGHO7BoBQ8QFx8zFrtibTwEC6YzhTA/0rXA5cA19D+qVgnaSbgGejBV2NmEn3YFO1++Gjvy/AimEXkSU1X1YefGsu4zEKY96Ur+DseWvanYCZlpbAkIExrWeB12CvcC3JErKkMnCNfAMOArwGnYOeoiYfU2YwRdgqmzXsAI6PLQ7sVug5qEHYofT/GorssxPeeFtD/KA9BZwjXQjZ0FPwE7F140ul478BR2svRbhAeeqwQDgXDNOBbT+M8g7vaQKvEy5j86K/kbc5FGZRhohGtgLHYf6HQsat4BuG8jqQqLMbFkbpI6EYojEwO
49474VcM0Yhe1JE7Gl9ABMroo5IZuF9RjD8zTG9DwBvFqr1V4ayN9mayBcM2oYUzMMcx+fyhZD6l6Y/c0XkqKGEWkhFi9yAfAsJiS/m/wWc+S3o/h/stOjoNMReFIAAAAASUVORK5CYII='; 49475 var imageMultiview = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAP/ElEQVR4nO2dedQdZX3HP3Pf+2YjC5CEGA1qkMUkRGIiDZoEy+LCUg6bgrhQj9oioket0lZF8Li1WJFFbQ8lNnKouAG2KltNBQKhKGlKNoRoFgyHQjYgQJJ3+/rHb4Y779xn7p25s9ybk/s55znJO3fmeZ55fvPsv9/v8SSxj9ELjPLDq4BXA4f5oQ+YARwYeeZZ4FGgCjwN/B54zP//bv+5PSXkPTe8fUBwo4BXAK8E5gJvAGYDs4BxGeMeBFYAm4GHgAeBrcAWTKAdS6cKbjQwH5gJvBVYgNWuMngeuBv4H0yoD9GBQuw0wc0BTgcWAW9vc14C7gbuA/4bq5EdQdsF53keks4B3gccS3k1Ky1bsRr478BNbc5LWwVXAd4PfBI4AjighTjkhxeA9dgg41ls8NHj3zMIHI4NWEb4aY0FPD+kZS+wCbgZ+AbwUgtxZKYdghsPnAZ8BhtoVBM+twd4DngC+/L/gPU/G/3rA5gQh/z/h6liH4rn/38CNgqd5edhHnCof310inf5I3ANcIOfh9IoW3CnAJcBb054/05MQGuAO4F7sCF8EUwATvLDsVgtPSjhs78BrgJuBfoLyV2EsgQ3C/g48NcJ7/8tcD/wc+DXRWWqCSdgH9p84PiEz/wQuBprCYpFUtHhIkmblYybJb1X0sQS8pU0jJF0tqQfSHoxwTvskHRp0WVbZORTJN2S4EX3Srpe0iJJ1SJfNmPokTRH0rck9Sd4r19Kml5Ufop6yRMl/a7Ji/VLukPSXHW2wKLBk3SEpCWS+pq840ZJpxeRj3wjs+bhYkkvNHmhhyS9Q/YVt1sQWQS4SNJySQMN3nVA0ucljcgz/TxfpFfSlQ1eQJKekXRFSX1rmeESSX9s8u7fkzQurzTzzPySJhm/T9Jb2lSwZYTZsqa/EXdJOiSP9PLI8BRJtzbJ8DckjW9zwZYRqrJmsVHfd79fZm0V3FRJ9zbI5LOSLuiAAi07nCJpS4NyuVfSK7KkkSVzPZJ+0iBz6ySd1AGF2K4wU9LaBuVzjzLUvFYzVZW0uEGmHpP0+g4ovHaH6ZKWNiinW9TiaLPVDH2zQWZWSjqqAwqtU8IESbc3KK8lrcTbSkYuapCJVZIO7oDC6rQwQY1HnF9IG2faReY/B34JjHH89hjwF9i+WJd6DgRuw8rQxWnA7UkjSyO4qdi2ypGO39YBZ9IVWjOmAXdhujRRNmFbShuSRFRJmGAPttvrEtou4BN0hZaELcB5mEJSlNcC11HbuW9IUsF9GHiv4/ogtse2NGE8XWxT+N249ThPBT6bJJIkgpsCfCrmt3/GNg+7pOMu4Msxv/0NtvHckGZ9nAd8F7jI8dsaTN/RVe27NGckNhg50fHbDzFFqqjuzMs0E9wC4L+oV6B5GhsFrUiT0xDTSN5Mp6UHeBF4BiucSZiCUJE6GhVM02xbyucOx3Q2pzp+Oxe4Je7BRoIbA/wnNtKJ8k1MSystvcBPMK2qVlTjkuABy4DzMaWfxcDBBaUVZgBY4nneFSmnWJcA36Je220Fpveyy/lUg0ne+TGTxZWSxrY4EZ0m25Mrmnv99BZJeq6E9ALWyt4x+QqIyeDBmPg+HfdcXHNVAS6N+e1rWLPQChVMaTVMP6bevZZac/YENlkNVPEGsCblFyTT4w9U5BRKbzPWp4T75GV+vAHbgZ8CjydIw8UQKbsAX3ifxUboUT5JnKJwjEQ/EPMF3NngmSTh1arf7ljl/zZD0qB/7TL/2jX+3zslTfKvrYzJW5hf+fculLTNv/YR/9pNofuCfAWqFt/3/z4lQRouVsvesZWy+X5MnJe67o/TIr4k5vrlStd+J2Ey8LfAdGr93slYzTjO//sA4KvY6sK0lPEHGT4bU0GfG/rty1gtCSa9x2NTn5NTppEHX8EGJNHlxPdjuprDWyqHNN8haY9D8re1+CVFa9yT6T7ilgjXuK0lpBeQpcYh6VpHnIOS3hO911Xj/hIbRg+TL6ZinRVhRhPRfq6Hmt4/WM2r+H8HNSboO4ZoTtDHDflp9YXiDPclrjh7cPc3Segn27TjRuBihi97VYALPc+7WaHWLjodOAybtx0WifBOrBq/mCFTYNOBWViTVRQ9wA5st2IsZp0zgmLncVCbyz1G6/YDIzDhnRe5vhXbeXlZtT1a406hXmgAPyO70MBe6P9yiCcpLwArS0wvK33AD4B3MXx0Ohl4GzGCq+KebK8H/iOnjB0MfJ7kVjCtUMGW4/4Jq22XYKZdZdS4J7CBxI4M8SzHPrZ5kesnYBN1q0ChDm+OTCsrynczdLbR8FqZrUDRrPDTO6GEtMI8JXvHrOX0D46490haENwTro5zMBuxMLuBX2X4eqIMYe110ez0/+0n/fphFraRbPDUjNupr7UjCdkVBoKr4rYB2wDckUNGuqRjGe6d8OPwF/wDwU0GFjpuXEcHuorYDxBu48j5wESoCe4QrCMP049NA7q0h/up3yWfhnlSellw0x0PvkAZJrFd4liK26PDPDDBVYC3OG7YiU0mu7SHrZjbjyizgWoF85X1RscNa2mwdd6lFFwaBrOBURVsmcXVVC4vNEtdkrCB+oWDWfiCGwm8LvKjsFWALu3lN9QLbhwwrYIpYkYR3f6tE9iAe0f9NRXinZ65OsYu5bIdt/rjYRXMh1WUPbS+J9UlP4RbtX96nOB+R3dE2QkI997e3jiNpL0Usw3iYVssRTPW/7eH+oXzIhlH/vqiUW0BgIlxykKBi8C82Y2tfE8qIO4wwebpdsyRW1nC20S+a7t9wCPUbwDMSOorMi+ewTSMy2INcE6J6eWNh9vsaqhswY3EHHuOJp99Kxe92HLRGqxZnoGtDhU92OrFvNOuw7qaPAgrUA2jbMFNwnT5X8nwPtSjvk+NXgua7mZ9bw/m4/IcTGg3+ukOxcTZLN2k9GDLhOcDT7bwvAsP++iiVKq4+7KwWlye9GCWKRMLiDvMZP/fEX56Wc8nSMohJLQoTUgv8HrH9UcruIf9YyjOmibajLyE+TS+n9rH8ghmlxcsu/VjJkeLSaZtFozEAj1OsCbsKuD/Q/fdjNkoBGXwFOZjuVXzMdcIMCuuD2FHBfcE75iYB4rgceAjmPFkILgfAR/D1ALB9gY/gZk0p7U1Dz7AqzFrz7AOzfs8zzub2khwKWZoEWctWjYValObYVSxDjXKoP9AHrqUzTgc+DrDbQfeg9WCwFrzIMywfQPupqMRwcfwAUw9MKyi8W1J/dQK5wxMh/+ElGkUhYCjHNfXVzEX7FE8rCCL8jgeZizwd5Frs4ErI9fObjH+QHALqder+Wjk7/GY3mencCjWz0XZWsEmjVE8EhiQt0iR6ucBwWjZo94OokhchZwF13IkwOoq1r4/gvVrAUGNy5stWNUvyv4brIYFg40HsW2rVk/1SJvuIHGmv60x13FtF7Ctio2ENjFccHEPZUXYKLJCcSrhPQy31tlNzfKnSAJLoDzf643Uf3BrgYFAcK6R2hzyf+FJmOH/ITnHG2YEtnP8OWwg80VscFPGysl64HLy09ae7bi2GthdxQrwAeq9KIzCamGe1i5jMJ9fRU+Ig1HiZOAsyulXwXRT/zGnuCbhdqOxGhgI+pr11O/7TCDe01uriHIc2gTOBQZLSi9gF/k1lafj3gJbAbVBwtPAqsgNFdxq6V3K4UTqW4ot+KtJFQDP87ZhR0tGmUP8kLRLcfRSP1gEk9F28AUnMyd2Ce5QOmcVYX9iIW7vEkvxl+fC86nl1OtS9uK2Uu1SLOdS78ZqLyEz7LDgNmIr9FFOwm0X3qUYpuAeFC7HNoeB4YIT5nEhOr96FTaE71IOp+J2/XsHIVdc0aWne3CvXZ5J/Wn2XfJnBOZOMsqTRCyDo4LbhPtoy4V0ByllMB9bMIjyMKFmEtyLvf9C/T6ch3l4c+k/dMmPT1Mvkz7gX6M3ugT3sB+ivBl4e+asdYljPu6xxGrsrIdhxG2vfDHm+uUtZqpLc66IuX6t62Kc4O7DPHVHmQtcmD5PXZpwFvBOx/WVwE2uBxptaH415vrl1NTfumRnDPEt3JXEbH81EtxvsZPko0wHvu55RW8o75O0stP+99iacJQHcfRtAY0EtwerXS5NrwsknZsqe0ZZ1jOBl9UeylOGBRt1pzFPOwb4K8f1AcwndqwaRDMV9DWYPmJU82k0dtbOMtJpgu3AFkqPoFjbgXX+/5/HWo6JFLsD7mFleQvJd7/HA/+GaQNEuRH3on8tQTX3sTweWydzaX3dClxAOiOHg7BaV5TgqtjSUHBgxGT/WpE6J4FVzWYSfCCe5yHpOty+rzdiZlVbGkaS0A3faYr33/+pHNz87W/hQ4o/9P3iJHGkSe
49475waudkr6Z0dUBj7SjhZNXf5UW6SVEkST5qD/yZgo5wFjt92YOrbDySNbD/lSOBu4DWO3x7FttCeShJRGsXU5zAP3a7O92DgeswOoIubw7GzilxCewn4IAmFBuk1ilcBH4r5bSZm3+061XF/50isbFwGHGBWRKk8FbaiCv5z4k8VPALbN4rL4P7IUViZRP2BBnwF25FJR4ZO9rqYDlaSNks6sQMGAu0OM2SH2cexWJLXStxZMlWRdEODTO2UdGoHFF67wttkH3AcN0jqaTX+PDK4uEHmhmRnoI3sgIIsK3iyQ+6fb1Aui7Omk1dmv9cgk5L0Y2U7LGhfCVPVuBWSX1aZ08orwxXFT9ADVstOgWx34RYVTpMdVNGIJUo4wW4W8s78Z5pkfEDS9ZImt6FgiwoHSLpK8ashAV+S1JtXukW8yJmyo0oasUHShZKqBRdqkaEq6V1qPGqUpO2ytclc0y/qpeZIWtbkhQZlTcsZkg4sKB9FhNGSjpUdoBu3UBywStJxReSjyBccL+lqSS82eTlJekDSWZIOKjA/WcOBkk6S9NME79Mn68/GFZWfNIvMrXIGcBnwpgT3/ho7efgObNG1E3gdZqt2HskMYB7FNLZ+XGCeShEc2C7vxzF/Jkkcv23ENM2WYcfE5OXULClTMcOLU4E/I/n667XYGW+bCslViLIEF3AM8AXMjCgJAv7gh7swYbbqZ6sZ87Cd50XA0ZibjaR+S27DVDzua3ZjXpQtODCFmmMxAR5PcrX2wIfILsxlxAqsZq7DXEXtxpRs4lQUPEwQozGzsZmYxto8TC1jHKamkXThvQ/TyfkSZuVU6qlf7RBcmLdi/cHRtO7uV6GwkdpBf2E1uSFM8+toaip0reoX7gT+F/gO1h+3epBtJtotuID5mAe9+VjhdiKPYzv8N2LmaG2lUwQXMAU7NnkB1oy22xL2CczZzZ2YWuGmtuYmRKcJLsyR2GBmgR+STCfy4GFMi/ghrEnslGnJMDpZcGEmY7VxGibEmZgOxxsyxvsIpgv5OLVzSZ+mnAN4M7GvCO5lfGXSUZiy62hsUDMLG2zMJt7N4SDmQek5rBZtw0aCfZhCb9FO2nLlT6R+/VJOW8bDAAAAAElFTkSuQmCC'; 49476 var imageSeek = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAPIklEQVR4nO2de7QVVR3HP3O4XBQNXxAioKKgIGIaIeUrNUgzoswsM235SFu1WJpUlqlLtFIzyygrl4JpZkGWWlRqPlLxgSm+SB6GiqAR4RUXiChc7rc/fnPwMGfPOXPOnT0zV+93rb0uzJyZ/dv7N3vv3/69diCJLoyeQGtFCYBewBigo+J3rwHzw393AOsrSntWxKaJlrwJaACtQF+gH7AbMBQYAQwGdgaGYIysh3XAC8CLwDJgIbAIWAqsDEtH7NMFQVDwEdcP2AcYDnwI2A/Yy2N9j4flnxgznwRWe6yvaRSRcS3AscD+GLPG5kRHOzAbmBOWP+dEhxNFYtwo4BTgg2EpEt7CmPd34AZsis0VuTIuCAIkHQCcC4wG+nfylar4W9mwICxU/G0Wy4CHgIt4W+DJHHkxbgvgMOC72Jq1ZQPPvgWsBdYALwNPYYLGYuAVoAQsAdoqntkRGBT+ezdgB2zdHAHsBLwH2Ipkwk0Za4E/AJdjAk6m0mkejDsYmAR8toFnVmDMmQ/cDTwBPJMiTaOB9wOHA3sAuwLbJ3y2HbgGuAp4OkWaaiJLxg0FJgNfSfj7NuB+4FGMWf/0RJcLh2IzwlhgHNAjwTPrgCnANOBVX4SVkRXjTgbOAYYl+O0jwF+BOzGBIDeEa/CRGCM/QbKtyMPAJcAsj6SBJJ9lsKQblAx3STpOUn/PNDVbdpZ0uqQFCdqyVtJPJPXxRY/Phn5K0ot1Gtgu6W5JH/bZyJRLP0kTJM2X1FGnfbMl7euDDh8Na5V0jqQ36jRqoaTjJfXw0bAMyhaSzpC0rE47X5F0atr1p92YbSRdX6chqyRdKmlbzx2bVdlF0jWy2aMWLpTUM61602xAX9k6VQv3STo8w07NshwnaV6d9l+XVn1pEb2XpMfqEP19vXNGWVzZWdK0Ov1ws1IQwNIgdpRsvYrDSzJBJe9OzaoEks6S9HqNPrlP0o6dqaezRO4lk67iMFfS+wrQmXmU8aotVd8rW14yZ9x2kubUIOwemeicdwfmWUZIWlSjj6bLpPCG311qct++NTCDeFvZDcAnMWvyuxkLgInAYzH3TwGuburNTXC7JGlGja9oWgG+9KKVrSXdVqPPzmv0nc0Q8e0aBNwoqaUAHVXEsq2kZ2r03TGNvK9RJfMnsSlyC8e9e4GPA280NfTfHRgG3IpbWb0cOAKYl+RFjTBuEGa6H+G49wTwUcyQ2Y3a2Bt4EOjjuHc7ZoWoa5RNKpwEwGW4mbYCM9t0My0Z/oUZkd903DsSs+nVRVLGnQgc47jeDpyGuQ90IznuwNw2XJhEAmepJFNlf0ycHeS4dylmIO1G4+iFrXdHOu7dH15fF/dwzREXBAHAN3Az7THgwqRUdqMKb2FLjMvV7xDgpFoP1xtxBwD3YF9HJVZhTqt3J6WyG7E4GXM0ao1cX45NmUtdD9UacS3AWVQzDcyrqZtp6eBXmH9NFAOAM+MeqjXixuJ21nkWG4ltjnvdaA57AnMx385KrMI8vF+OPlBrxJ0fc30K3UxLG4uAHzuubwd8x/VA3Ig7AAt4iDL2wSAIDmpQ29KNZOiHOdTuGLnehs1+z1VejBtx34m5d07BmbY9nY8NSIptca//zWIlcIXj+g7AqdGLLubsg3sD+AgWO1ZUjAL+hMUB+Mb5wLeADSm/9yYs6DKKiZiwsgkuxh2LcbkSAn6CBToUEeMx7+eDgI0e62nFNB4XYaM77cjVF4DrHNf3xPZ2mxBlXC9MWRzF47hF1iLgNIxpg7FNra+5vC+2DTov/H/ao62MW6iOPWjBlM+bloEo4z6Kaa+juJXiSZI9MAn3at4Oj6qMg0sTe2J98MWKa77W0nmYLjOKj2CRREA148YDvSPXVlG80VbC3CMuyKCuQ4G/AQdmUFcZt1E9onfEQquBzRm3DRYcH8VDxPtM5IFdgLuAz2dQ1xeAP2LBkFliFm4h5TBC1Vgl4/alWpoU8AB+F/xGcDA2+g/zXE8LJjlOJ3mAY5p4DbcEP45wn1fJuFFU5z1ZSXGmyS9gmQ+SxNh1Bn2AX2CSY5r7tEbxN0zYqsROwEB4m3ElLJw2ihcxHVremAz8Btv0+sQQ4PeYpJo3bse9/To4CIJNjOuLxUBH8aQ3spJha2Aq8KMM6hqDfeVHZFBXEqzEvc4dImnLMuP6AyMjP2jH4q/zwkBsT3NGBnUdjQkEwzOoqxH83XFtf6BXmXEDqQ5QX4OpufLAPtjXPy6Duk7DthadzbHiA65lqh+wcyl0T3CJu69jHklZYyJwH8Y8n9gS+DkmiETtYEXBv3Cr1UaUJLVgW4EoXox5yCcmYfsm30LIe4GZwFcpdgbBZbjjL/YrYeqigY6bC72SVI3vAT/Df0fuAfwF0/0VHe24E/EMKGEd1c9xc4lPiirwXuB3WD4v3xiHKaTHZFBXGtiIzXxR7FHC4gBcm9osQqT2xhSqx2VQ11ew3FtDM6grFQRBsBG3cn9gCZMmo2uKcO8h0sSh2NfvWl/TRA8s089PMX1sl0HobfCs49bgFtx6SMVcTwufw9zSGsma1wz6YOvmF+v9sMCIqr0AU3Vt7bjuy67VC7OhzcAf08of3K7YiO7KTIMYv6AWTLkchUhfONkK2zP57MgOLApmf+C3wO4e68oVJdxffgduaaZZjMI0IVl8/Wdg1up3LNPAGPefmOt7OK43iwOIOLt4Qg/MwDqg3g+7OkpYStwoAtJt/I3A2fhPf9uOZTL4i+d6ckcJt1pLMdebxevAD7GpcnmK742ihLlzH4NJk0Wx3HcGTm+yEm6ppXzUSdr4HWbv8hXBGmBr9npsrfs67pDdLoHQANDXcWt9CWvkf6PPYNZgH5iHMS+LMK2pwPGYp1qXg6QAcw2MYmGZca7guV080rQCM15e77GOMm4BjsK9lhcdcXrkN0rYHOqSLH0yDsxQeyoWYOLbfDQH8xkt1DErCVDCHcb9dAmTxFwCQ9SVwQc2YnrEz+HfU3oJcAJwred60kQrMbbSMuNcPnw7kJ2R8Q/Y/muB53rKo/xCusa5cbviFhKfLEuUzztu9sbt+eULd2LGzSzOGpiCmXm8H+zQSYzCrTOeV2bcS1RrofuQjbajEs9hx6TMyKCuaZiA5Nt81Rns77i2GFhdZlwb1XurEvBhn1TFYB0mwl+cQV33Y6P8oQzqagYuL7dHgHUlgCAI2nATvxtus49vKAiCczHXudjsOinhGcyzbKbnehrFXrglykeCIFhfgk2WVpfz62As0CJzhDRNwzbrPtVkYDPOiZiEWxSh5SiqB42Ah6TNU/suovo80PfgPzKmHmYDE/Af6rUB21NOxnSreeNAqp2UF2DyyGaMm497ujyIfKbLSjyOMe/2DOr6GbbG5nmc5mDcQTj3E+53Kxm3DjfjRlOMM0tXYBlqL8+grllYttuHM6jLheMw5kXxD8KpPGoZuINqt7xWrBFFwHrgm9h05it4vox52Ifi9xy4avTGHTH0HBWxHFHGPYo7XuAEiuWPeAX2VfrOSrsS0+hc5bmeSnwQt0B4GxXuJFHGCbiZ6pQTfbGo/yLhZkzyqtT6+EiVsRaLMTiXzbcmqdcV2t+OoToF4puYx1pF7dWp0QdIWupIr75AdrpH3mngo6W/pDtDGjsk9fZY17GSVoR1Xenh/cMr3l+J2bLzHjb91mX9Xo7bZ2M48JnOf1epYwW2gb4B0+v5VIzfhK17L2MxD2njJMd7N2DhzZuZvuKy5w3FFufo+QLLwnvr06AyTYQH0Z6JJazxrW3ZD/OCu4X0+mJPTMaI5iJbjMUKbtamuOx5i3GrgAYTn8cyV4Qf4FT8Mw3snIWZpOuMdAHVTBPm2FvVploZYkdiwfvRqWcFluGmyFr1robxmMNwtK9fAt6Hw/xUK0PsQizpWBT9sU1wsydhdWNz9AK+j3ttPp8Ym2Gtzt8YvtC1V5pA1w+mKArOBT7guP4UNSwW9UbNyxjzomjFQn9dZoduJMcYLNO8y8r9NZo9MCLEdNw6zIFY1oI80yZ1ZQzA3BNdCvxfYwrlWCRh3Bosja3LC2siplXoRmPoiWWadR0y9TyWR6ymy2JSAeMB4Jcx9y7FfT5MN+IxCQtOceFiIhnPXWjk/LiemPXAZVhtw/wj8s791RVwAjYVuta1a4DTk7yk0RMbh2KH1rnUPeWDXLuiq3dWOBDbr7kO/ZuLpVZO5DLY6F5sMfClmHsjQqLSDIh8J+FALFLWxbSVmM9LYj/PZjbRszBjpgvDMLuRK8Lk3YxDMKa5QqY2YNNjY17cnTBBTHOYH8pYFJoo8jb5FKEcKqmtRl9Nbua9nSGoh2ozb76kjxSg4/IsJ0paHdM/HZKmNPvuNIibHkOYJL0m6fgCdGDWpYdsJHXU6JsLOlNHWoReW4NASbpE0pYF6NAsyoAE/TGls/WkRWxJ0nV1iL1L0qgCdKzPcpikuXX64aI06kqT6J6SLqtD9DJJk3LsWF+lVdKFkl6t0faNkr6cVp2pNiCUUidL2lCjAe2S7pA0upNSbRFKSdIRkubVaK8kLZf06VT72lODJkh6oU5j1km6QtIgTzT4Lu+XNFO1P1JJmiNp77Tr99mwIZL+WqdRku1xvi5pmEda0iyjZOvU+jrt6pB0lWwaTZ0Or40Mp8JvqfbcX8ZSSVMlHeKTpk60Y6Js3/pagra8IOkknzQ1qmRuFmMxm97RCX67BjutajamRc/z3Lp9gY9hkblJTwCZjp1M4jURQVaMA0vVNAH4AcmzFi3EfC8ewJx0l3ihbHOMxOgcj0WFJk1GNxc4OwiCe7Lo0ywZV0Zf4GQsiDDp+QLtWFqn/2Em/XuBf2PWinZMUbuROv78odNsgNkWW8K/IzGH07GYBn8H7PztpBlyF2If463Y8WGZIA/GlTEYY954mksKKuANzL9zAZYd6VXc6a2ERXcOwZxOd68oPWkujfFTmCfzleQwnefJuDJ6A9/GLOijqY5UKRJWY17Ms8jmhK1YFIFxZbTw9tpyFJZVpyh4FEuc8yeyyfpXF0ViXCWGY+mAP4AxMo+gynmYQPQAJnisyIGGWBSVccAmYWIQ5vY+BhPLx2BrVZou8BswYWcOJvw8iTEqmsezMCg04xzoha2J22LBELthIvswzLF0JLUddNuwkQSWZeLZ8O/TWEqstfiPLU8F/wdLaoYuHo/m7gAAAABJRU5ErkJggg=='; 49477 var imageStream = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMi8xMC8xNRH5GqkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAVA0lEQVR4nO2debRUxbXGf91cLhcUGRQQQQEnxCjG5WxEReMQFY04JhrfiyaaGDUxz6hxiKLGRF/ydGmWQ57zkBjn+HBWxAFxABIj4ogMjoCiMsgF4X7vj30azj1ddfqc7nP6Nq58a+11+3ZX7dqn6tS0q+qrgiRWM3QJpCvQDxgKbBx8Xg4MA3pG4rwPzA7ivQvMBKYCXwCtgXyVv+nZoamjDUiArsBAYADwLWBLYAiwDdCpRt0LgdeAV4F/AVOAD4GPscJsWBQatMatBWwNbAvsCOwdfFcPfABMAJ4GpgEvAkvqlHZiNFrBjQRGBH93BYodaw4AjwGPB3//1cG2rEQjFFxn4MfAQcD2lPdPjYL3gMnAbYVC4Z6OzreOLLhuwK+Ao4ANqa6/EtAGfIoNOoQ1dR+zqrauwAYvPYFmYBNgTaAQSFosBt4GLgduDdKvOzqi4HoBxwI/B9ZPEW8J8BlWMJOxAcU/gLeApdiIEqygVkTiNmEFWQg+98AGONsDmwE7AesE37cktGc51nT+ARiLDXTqhnoWXFfgAOA3wBYJ48wFZgEvA08B/4cVUh7oB+wO7IvZtxH2kiXBc8A52ICmLqhXwe0AnAEcnDD8M8BLwD3AC3kZVQEjgVHALsB2CeNcC1wGvJmXUSXUo+BOB86k8tv7JXAH8CDwSPB/I2BtYH+stTgsQfjpWPN5TZ5GISkv+Yakh1QZX0m6TNI3c7QlC+ksaYSkuxM8kyTdKqlfXvbk9ZA/kPR+hQdbIulqSUMlFfJ6wBykq6TtJT0se+ni8JqknfKwI2uFzZIulLQi5mGWS3pc0oica3ze0knSwZKmxDyrJC2U9LOs089S2dqSbqjwEO9JOqlOGVsv6SZpjKS5FZ59jKy5baiC6yvpmQqGPyxpyw7I2HrJzgny4CZJxSzSy8LgfpKeizF2maSzJTU1QObmLWtJujImLyTpxizSqlXBupKejjHyfUnfaYAMrbccL2lBTL5cX2satczj+gN/BXbz/D4VOAJbGukIFDBf4q7APzGf4nzMz/ge5u34FFhGPt6YvYDrgA08v18PnEC5ey4Zqizx7pKeinmjxkrqndPb3CxpfUkDK4QrSnosxsY2SR/I+t5TJQ2XtE7Gtg6T9GaMDderyqlQNcYUZO20Dw9J6plxBpRkuKSbZU3wDFmG+zr7opI5AMJ4QdIvJW1Xw0sdlaGSpsekeWE1eqsx5LcxRjwsqUdGDxyVvpLedqS5jyd8MbCnGiyWdIekQzKyfVNJb8Wk959pdaY14PsxiT+s/GoaMndTmyNd3+S2KJvo14rHJY3OwP6NJb3hSWO+pB3S6EuT8JayPsGFqcqmphUkbSHrGzpFfhui8rd2dvC9T9cVkmbJvDW1YJGkvwW21Vrz5nnSeFU2nci04DrJ3+x8KGnzGh8I2WDjPtkw+gtZX9a80lDrc3aVuZhel3SVzGfofjAL3yJ7odaWNbXbSPqepEskPSrpI0lfep7LhU8knRzorfY595a9CC7clLRvTZrYmZ6Elsjfx6SRJknPOvRnoTtOukg6SNJ1kqbJnAVJcL+kwTWk+2OP3i8lHZZER5JEtpK/ep9Vg/FhGSjpc4f+42rU21fWtyTpe1skHSNrWeImzyXMltWeauzqJP/I/C0lmEoleZgHPQmMk72xWRRcN0kzI/pnyDK+Wp0FSdfIRqLPSLpH0p8lnSPpUFl/44s7UtanVcKXkk6r
494770r7esn7NhctVYX5XSfkhHsWzZJPgLAqtJLvJMni2pD9J2qRGfUX53XFfyeZW4yRdIHcfXZQ0StIkj44wqm159pS7drdK2jEubpzSXiqvBaWHrmV9qSBrKlxvVE9JA5SNBz3NPO5jmSdotMpHs+vIaumSmPhtMkd6NXZe5tF5v2JatDiF/+VR+EQNXoUNZbXqiyCjhlWpJ+uCK2GZpImylqZbRN8+kt6JidsmK+C0dnaT3y02yhcvTtlsh6Ilknapwjhkyz+vRPTdlqFryVVwEzwZkgT3q3z9cKjifbSSrQyktfUwj64pvvzxKTrXo+iaKowqycUOfU8rv/0mBZl77jHZ3G+60k/EP1d5t9Bb8T7QhbL5ZlpbX3DoapNnSuRS0l1up+hixY/EKsnpDp2/qUFf0gzpJFs33CzIhBMl/a/cfk8fblT7IXqTbITqwwylX2nYxaPrSVd4l4IT5N7sc2VKQ6KytqQXQ/r+LHtJ8iy4OBki60Nu9mRYFBMkrReK3yzLVB/uVfrW5D6HnlY5anD7f6w9da1hLZAtqdSaWb1kmbWLQu6sPCR4li6y/rpFtlHHlZHNwbPdLWmp49nDmCipfyhuT0njY8Kn7e/2lNuRfmPZ80W+GCHpM1fEHAcReUlB0gOyN3aWbFBxpaSjZHPENRzh95TthYzD82rfDG4hv/N9hqQ+KWzuKfeGo3cUcbFFI17giLRM0v4pEg/LMGU/UU8qlaYD90k6Uu2bPyStKXNgxw1kxqt9wR8eEzZtF/NLh44ViqzZhSP0lvQPR6SXlGK5Qasy7Q8y7/tUVTdEzrvgSpgi6VhH/JMqxLs60gpd7wm3QNJ2KeweIvcu8NsVaurDEb4t95bqajwCP4ro+EI2B2rEgivhAZWvtx0hW7by4buhsP3kn6Bfp3QDFdeAaZbMgYGkdmest6achWEOdiYtDZqAYyLfdcNOgtYbac6Qj8JOCR0Y+u5vwLn4d2JdC6wXfJ4D/M4T7vsYEUFSPEE5fccGwM6lf0oP1h3Yw6HgXezkZxoUsCO7YbyBnR6tJ4QdiHwWo8BYQGUukwHYlsP/CH13A3YY04W+wAWh/28FJjrCdQWOKBQSn1x+CttCGMWOK3UEVW+wbHU3jDbZ0n81zdRPZR4EyfZTHFWlnixloOwU0VjFN3+SufaOicT3LfMslfStULgfyj2wmSFzBCS19x6HjkkKRqmlQCMdgRaptl3Io2SekZE16MhLhsm8J3HbFhZHbO8l/za7x0PhmuVfZwv3iZXkVJU7QpYp8F6VAp3tSGSeOtazUQ/ZT7Z/xYeZaj+d8a1PLpK0bSjcRXLXuruUfMlqa1lrFcV+kg1OmoFvONrT16gzk0CGaMH6q/7BXx8ewgYlkzy/D8L6sM7B/38HnnSEWwNjkSjhCtxHofclOY/LK7hpqXYqFAoUsYcc7gjg6mQbGV2B44GHsYeeADwf/H0VuAljLYriHexs98sevUeH4i0HLvSE2x5jbgBjixjvCLNmEC4J2rAzD1FsLqkLMt9b1D/WpvLOuZJ0k/VpL8oOOA5IGb8WGSXbbFrpaO9iSY/IvcqxufwrBn+XHSFG5pZyHStbIenokL5TPLp+l+K5LnLEnyJpLWRnlF1G7Jw0AcBl6H3K2ZEcyBmeDIrDTLlXl4+W28mrSH782hPm6lCYrT1hnnOk65NjHfZ8KalnESNiiaJICq4OSc3AdyJffxtr+/PE6cDvq4g3CLifcv6S2/CTzIwOfX4Wd/8/nFV92NvAPEeYTbB5cxJMd3zXFVi/CGzq+HEO6aj+mjA+rjDmsoqmKQ/sBVzi+D7pgb8iNrmO0imOwe0pORzLNDDyHFefuDmrKsJXuMcJzbgriwszcHOFbV7EOsykEXxoxdxFYfwVIyzLA0XgUs9vi4A/4h4cRLEFcHLku/G4W5v1Md4vsMOQMxxhemKkqBQKhaUY12UUzRiPWBLMw+22KxRZ9RaFIZK/uWCFfDZwPvaWnY01YXkxy+2PMcW60AkYB3wXO/VZCUdT3qTf5Qgn7HRrCT7uyh5Aqe93NZWdSE6aWsBGvVEML+ImRHub9M3cIqyZ2R24OPg/L4zGT5NYxPqQL7DpwSnYkWEfBmPzqzBcTVyB9vPdWbjnauH8fMvxezP+ly6KFbht71LEXRUXUn1tWVZlvDTYqsLvJW9uG3AlNsn2zdNaHPpe8YQNDyo+wV1w4fx0DWAK1M4lLd+yR7UknPVAd4zNPA0mAvsBf8L9BkcHC75uYpfQ564Yx2UUvUOffXb29nwfhbccsmZB74O9wa4liaxQIDkZaBifYIOWQx2/Rfv5+cAhwLqR78M17DXgOIctYW/HO8DPHOn5anRi+Aou1eCkUCgg6TTsQZqwwcGvsDWwrLGA6nyoB2Ij0WhhALwe+f8r4N4K+j7CphNxmAdclcg6N7zlUMQ9Z+lOitVjSUOxUeRmGP/x8YRWa3OAq9P3oQW4CPgLdrlEFMtT6qsnfE1lsYi7096EdM3oIMo73KRzlWowrsLvJcKZwcCd2PTE58WZj02oGxGdcPNWLyriHuGkHZx84PguT3bwuzFibRdK2xN2w5ZgRlXQ9TzlTWWjoA130z65iLm3ohhCuo02r2O+vxLmYLzKeeET/J6TIta/jqfcDRfFctrvGWk09MHdxxWacDsy+2EjraS8yG3Y/QE/wobAj5H/W3wJsCfmzA5jDYyOPgnOpv6bmNJgEO4KNA3ZvvkoUi3rdKD0U/zBizjkfVII2RreebIlrnOUnmbjJLmXdXohOyAf3R/RJjuO1NEFk0R6y3ZgJeUrmS/pF5DvWYhAf3gvT5ukM1Om6+K+nCxprSK2fDM5UhULJL/UoaMxH6NXPAhrot+nfElqIebxvw7zE15eyty8IKkH8JPQVwXgcEkup74PLp/mNKC1CRs6z6R8L8Q2KRIIow9wJLbE8Sj1G2o/HsjGmO2bYoOPVqzQniS/W0Jc6EKwxBPCTJJfMNgF91rprEKhsKxUJV0H9T9VuiNCyLbzhTeOzpct4Xd0c9oR0l3lx68OTRF/d7mpNFZuzwP3gl83bNSWBpvS/hqWXsBZKXV8XbAQ83fejW11OIt05zBGUL7IvRDbzr/SOzILcwyHZ+ktmDf8jhSJtWIT476h7yrNpb7OeAE7ANMV64vTYA/KnSBTCFY3SjXuE9x90Q6OyHF4HbvIKIwPU8T/OmIJ6QttIOaui2IitkC8suCW4L41akPaL9dXQht2Id6j2IDgWWw7w7+RDiNZdXwrjOdLH8KO5InYqCu8+Ncb29+R5l60t7CtAL3w+xO/rihg3qMtsFp2BSnzIFgi24fyo2qzCXujQqOYNeT2QkyWUV109ChtdZCfRPLu9ip0bCn3YY+/KHSqNewHW4wdqIvim7gPPf4b7bEB8OvId3uTfJtCCftQftfeUmxEutJrEHVgPkb5lrIidigi7T6PEroAv8Wq+evYsdqvI/php4PCmE661fo+uC8XnI4dL14FR1V18VS1qfp70EZHdH2m9FxXq4P0VXuymsUy/uc0Og525L3kOBnsWjK4lvI9lQXgeynenDCiK7g9cW+gWd0xF9sVfQ/mejsJ282dFC3YOmIUi4Bbyr51lHqLbEASxWJVx3Y+UuVHYu/tgBrR6HKgI88lDwmbq8a1YrUu6j7vhp8OIg7jsT6uhBXON2j1QwE77ZPV/tPzPN+7V+g9pd8iu13RhWqYv5tk7ffJSnmjRYPKCFmr9JHsIGcsf3IC+aknrx/xxYlT9gOPspeU0a2D0soFx+7KjlE9b9lKtnISxoM16BssNwVUm+wFccaL2xB0H27/5XZk58bqKelSbAryBOlXIzoCB1A+N6tqK2JANnMuboKB24m7vL7C27C33LdfzFE293afH9G7UOm4QDpCTnDkRzUk2sjW51xbLharwj0+lRQXJd3iUCwZh3CU8zGtuBjnvO16g0hvGdF2m4yzeYyqO+s+UMY25MJ5leInSWCwpHc9CVxcYyYc59A5tkadWcloWaEc4PitSTbN8V7KVEE6y5gcXHhV5dT5VRUcsh1fLiyVUQNWmzktspFma6BvttxNcC/VfvNHUhkgu+lqcWDTArn5LGsRF5OTZPSQiUhdkyZUlE2aXVggo8St5UGGStpXkVWIoA/+oYye6jMZre5uCfrmWsRF3R/mOalVDpWfj+WypHrSJNhf/hspXlM+NWJdlQ+9P5VR0bvCd1fl2+17yGr1NrINtdHfXX36XartzriS7OF4nhLGJbC9qoJD1q773pY3FGIwzUg2lXtUG71jbQ0ZQc5Y2e32J8l99dhWas/yPkl2TVk4zOFq76J7U5bhtT7LxrLRuAtzHHZkWnBI+oUnccnoitbM4CFL0iT3lShRjmMX/dKlkTDdPLr+6Ej3UFmzdY6yeRnjLrdtVRVk5dUacpXHCEl6WdnyL68n2/f5T9mtioer3HMz1mHHeLXnQe4v931BN2Roq6/Q4q6TPqUavdUa0yI/67dkzYuvH6pW+srPsHq+w4Y7I4OYTjJm9jA+VvVD+iSyl/x3Ekh2XUBVumsxqlnGHO7DNNU+2kzzIt0oq1EfyDp61xJUN0k/l/WDpyvfa9AOk/vyjRKuq2V0XKtx/eW/FVEyz8LRjnh5Sl63YyWVLvLfBlbC9bWmk4Wh/eSf45VwhdLf7rQ6ygaS7qyQFzUXmjIquJLcVMHgF7R6HJasVo6Un0S7hDHKqEXI0vDOsiF4HOZK+m9lO2XoaBkkY1SPu4tnmaxvzSzdTB8i6GxPlP9m+RKmyIb10YtkVydpCp7VtQgaxkey/STZ5nVOD7WHzJMSh+Wyu2+2V3Z+wHpIz6AgJst9QWIYT6q2Wy7rXnDIBi2+tbwo7pbtteyRoz21Sl/ZvpkkF+YulvQ/slqZiz0FKd+z0Ng9NWcAwxKEfQJjAhqHm8ajIzAc24J/BLBjgvCTMIr7B/I0qh4FB3bW61SM9DMJ3sJOCD2BbYv/PB+zvBiAnTjaAztmFj3L7cJyjM/sSmxzbK6oV8GVMAIjhdknYfil2I1ab2Bn7Z6hnCEiCxQw0rhtMTb3jQJJumfyFuAy3Bc85IJ6FxwY88+BwG
49477kYHUTn+OAr0YZRHs7HKCNewQitp2GFuwRjNPA9UBE7D9gLawE2wg5ubhPY0T2wLSl7ayv2Il2EnaGvBzPuSnREwZXQhJF+nohR6yYlmI5CIZmK0VgVI7+DsbkOYRXBXLU7kOcF6Ywh3YHPTNGRBRfGfhgb+XYYT0kjYip2fvBm8mmuU6FRCq6EjbBBwW7YoKBffPDc8S7WHE7ADha6mAY7BI1WcGFsFci2GBtemjtGa8EkrKAmYP1oQ7LHNnLBhdEHq30bYtwrW2NcKq7r05JiCTZaLQ1wJmA8YHNwX/TQUFhdCi6M0u0kTcHfQdg8qxdGSewbFS7F7pETxmA+FxsZLisUCq2rWz78P2OHFmaZ1rm9AAAAAElFTkSuQmCC'; 49478 49479 //TEXTE 49480 var textHD = "HD QUALITÃT"; 49481 var textWerbung = "KEINE WERBUNG"; 49482 var textMultiview = "BILD IM BILD"; 49483 var textSeek = "ZURÃCKSPULEN"; 49484 var textstream = "PREMIUM STREAM"; 49485 var textIsOnlyForPremiumMember = '" ist nur für LAOLA1.tv PREMIUM Mitglieder verfügbar.'; 49486 var textNowUpgrade = "JETZT UPGRADEN"; 49487 var textGetPremiumAndHaveFeature = "WERDE PREMIUM USER UND PROFITIERE AUCH VON:"; 49488 49489 if (this.playerMain.playerConfig.language && this.playerMain.playerConfig.language == "en") { 49490 textHD = "HD QUALITY"; 49491 textWerbung = "NO ADS"; 49492 textMultiview = "PICTURE IN PICTURE"; 49493 textSeek = "REWIND"; 49494 textstream = "PREMIUM STREAM"; 49495 textIsOnlyForPremiumMember = '" is only available for LAOLA1.tv PREMIUM members.'; 49496 textNowUpgrade = "UPGRADE NOW"; 49497 textGetPremiumAndHaveFeature = "BECOME A PREMIUM USER AND MAKE THE MOST OF EVEN:"; 49498 } 49499 49500 49501 var premiumButton = $(this.container).find("#l1pUIPopUpsPremiumContainerTop").find("#l1pUIPopUpsPremiumButton"); 49502 var premiumTextBottom = $(this.container).find("#l1pUIPopUpsPremiumContainerBottom").find("#l1pUIPopUpsPremiumTextBottom"); 49503 49504 var imageTop = $(this.container).find("#l1pUIPopUpsPremiumContainerTop").find("#l1pUIPopUpsPremiumImage").find("img"); 49505 var textTop = $(this.container).find("#l1pUIPopUpsPremiumContainerTop").find("#l1pUIPopUpsPremiumTextTop"); 49506 49507 var imageBottom1 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons1").find(".l1pUIPopUpsPremiumBottomButtonsImg"); 49508 var textBottom1 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons1").find(".l1pUIPopUpsPremiumBottomButtonsText"); 49509 var imageBottom2 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons2").find(".l1pUIPopUpsPremiumBottomButtonsImg"); 49510 var textBottom2 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons2").find(".l1pUIPopUpsPremiumBottomButtonsText"); 49511 var imageBottom3 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons3").find(".l1pUIPopUpsPremiumBottomButtonsImg"); 49512 var textBottom3 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons3").find(".l1pUIPopUpsPremiumBottomButtonsText"); 49513 var imageBottom4 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons4").find(".l1pUIPopUpsPremiumBottomButtonsImg"); 49514 var textBottom4 = $(this.container).find("#l1pUIPopUpsPremiumBottomButtons4").find(".l1pUIPopUpsPremiumBottomButtonsText"); 49515 49516 49517 49518 49519 $(premiumButton).text(textNowUpgrade); 49520 $(premiumTextBottom).text(textGetPremiumAndHaveFeature); 49521 49522 $(premiumButton).off(); 49523 $(premiumButton).on('click', function(event) { 49524 //console.log("CLICK"); 49525 window.open("https://club.laola1.tv/sp/laola1tv/web/info", "_blank"); 49526 }); 49527 49528 if (premiumFeature == "hd") { 49529 $(imageTop).html("").attr("src", imageHD); 49530 $(textTop).html("").text('"' + textHD + textIsOnlyForPremiumMember); 49531 49532 $(imageBottom1).attr("src", imageWerbung); 49533 $(textBottom1).html("").text(textWerbung); 49534 49535 $(imageBottom2).attr("src", imageMultiview); 49536 $(textBottom2).html("").text(textMultiview); 49537 49538 $(imageBottom3).attr("src", imageSeek); 49539 $(textBottom3).html("").text(textSeek); 49540 49541 $(imageBottom4).attr("src", imageStream); 49542 $(textBottom4).html("").text(textstream); 49543 } 49544 49545 if (premiumFeature == "multiview") { 49546 $(imageTop).html("").attr("src", imageMultiview); 49547 $(textTop).html("").text('"' + textMultiview + textIsOnlyForPremiumMember); 49548 49549 $(imageBottom1).attr("src", imageHD); 49550 $(textBottom1).html("").text(textHD); 49551 49552 $(imageBottom2).attr("src", imageWerbung); 49553 $(textBottom2).html("").text(textWerbung); 49554 49555 $(imageBottom3).attr("src", imageSeek); 49556 $(textBottom3).html("").text(textSeek); 49557 49558 $(imageBottom4).attr("src", imageStream); 49559 $(textBottom4).html("").text(textstream); 49560 } 49561 49562 if (premiumFeature == "seek") { 49563 $(imageTop).html("").attr("src", imageSeek); 49564 $(textTop).html("").text('"' + textSeek + textIsOnlyForPremiumMember); 49565 49566 $(imageBottom1).html("").attr("src", imageHD); 49567 $(textBottom1).html("").text(textHD); 49568 49569 $(imageBottom2).html("").attr("src", imageWerbung); 49570 $(textBottom2).html("").text(textWerbung); 49571 49572 $(imageBottom3).html("").attr("src", imageMultiview); 49573 $(textBottom3).html("").text(textMultiview); 49574 49575 $(imageBottom4).html("").attr("src", imageStream); 49576 $(textBottom4).html("").text(textstream); 49577 } 49578 } 49579 49580 49581 //RELATED 49582 49583 L1UI.prototype.setRelated = function(allRelated, allowTimer, actualVideo, videolisturl) { 49584 49585 var self = this; 49586 49587 //$(this.container).find("#l1pUIPopUpsRelatedList").html(""); 49588 //$(this.container).find("#l1pUIPopUpsRelatedVideoElement").html(""); 49589 49590 $(this.container).find("#l1pUIPopUpsRelatedList").append("<ul></ul>"); 49591 var listRelated = $(this.container).find("#l1pUIPopUpsRelatedList").find("ul"); 49592 49593 var listThis = $(this.container).find("#l1pUIPopUpsRelatedThis"); 49594 var listNext = $(this.container).find("#l1pUIPopUpsRelatedNext"); 49595 49596 49597 $(this.container).find("#l1pUIPopUpsRelatedTop").css("width", "100%"); 49598 49599 //disable Recommend if only 1 related 49600 if (allRelated.length <= 1) { 49601 $(this.container).find("#l1pUIPopUpsRelatedText2").css("display", "none"); 49602 $(this.container).find("#l1pUIPopUpsRelatedNext").css("display", "none"); 49603 } 49604 49605 //disable Timer 49606 if (!allowTimer) { 49607 self.relatedNextAllowTimer = false;
49608 } else { 49609 self.relatedNextAllowTimer = true; 49610 } 49611 49612 function generateRelatedSingleVideoHTML(imagePath, titel, time, link, target, isActualVideo, isNextVideo, id) { 49613 49614 var linkgebinn = ''; 49615 var linkend = ''; 49616 var ullibeginn = '<li>'; 49617 var ulliend = '</li>'; 49618 var icon = ''; 49619 var iconshare = ''; 49620 var countdown = '<div id="l1pUIPopUpsRelatedCountdownContainer">' 49621 + '<span id="l1pUIPopUpsRelatedCountdownTimer">10</span>' 49622 + '<div id="l1pUIPopUpsRelatedCountdownTimerClose"><span id="l1pUIPopUpsRelatedCountdownTimerCloseText">stop</span></div>' 49623 + '</div>'; 49624 49625 if(id) { 49626 linkgebinn = '<li data-id="' + id + '">'; 49627 linkend = '</li>'; 49628 } 49629 49630 if (link) { 49631 linkgebinn = '<a href="' + link + '" target="' + target + '">'; 49632 linkend = '</a>'; 49633 } 49634 49635 if (isActualVideo || isNextVideo) { 49636 icon = '<div id="l1pUIPopUpsRelatedVideoElementImageIcon"> <span class="fa fa-refresh" aria-hidden="true"></span></div>'; 49637 49638 if (self.playerMain.playerConfig.shareurl) { 49639 //iconshare = '<div id="l1pUIPopUpsRelatedVideoElementShare"><span class="icon-share"></span></div>'; 49640 } 49641 49642 if (isNextVideo) { 49643 icon = ''; 49644 } 49645 49646 ullibeginn = ''; 49647 ulliend = ''; 49648 } 49649 49650 if (!isNextVideo) { 49651 countdown = ""; 49652 } 49653 49654 return '' 49655 + ullibeginn 49656 + linkgebinn 49657 + '<div class="l1pUIPopUpsRelatedVideoElement" id="' + id + '">' 49658 + '<div id="l1pUIPopUpsRelatedVideoElementImageContainer">' 49659 49660 + '<div id="l1pUIPopUpsRelatedVideoElementImageContainer2">' 49661 + '<img id="l1pUIPopUpsRelatedVideoElementImage" src="' + imagePath + '" />' 49662 + '<div id="l1pUIPopUpsRelatedVideoElementImageBG"></div>' 49663 + countdown 49664 + icon 49665 + '</div>' 49666 + '</div>' 49667 + '<div id="l1pUIPopUpsRelatedVideoElementText">' 49668 + '<p id="l1pUIPopUpsRelatedVideoElementTime">' + time +'</p>' 49669 + '<p id="l1pUIPopUpsRelatedVideoElementTitle">' + titel + '</p>' 49670 + iconshare 49671 + '</div>' 49672 + '</div>' 49673 + linkend 49674 + ulliend; 49675 } 49676 49677 49678 49679 // PLAY AGAIN 49680 if (actualVideo) { 49681 listThis.append(generateRelatedSingleVideoHTML(actualVideo.image, actualVideo.title, actualVideo.date, "", actualVideo.target, true, false)); 49682 $(this.container).find("#l1pUIPopUpsRelatedThis").on('click', function(event) { 49683 //console.log("CLICK"); 49684 self.relatedReplay(); 49685 }); 49686 } 49687 49688 // NEXT VIDEO 49689 if (allRelated[0]) { 49690 var nextVideo = allRelated[0]; 49691 49692 self.relatedNextId = nextVideo.id; 49693 self.relatedNextLink = nextVideo.link; 49694 self.relatedNextTarget = nextVideo.target; 49695 49696 49697 listNext.append(generateRelatedSingleVideoHTML(nextVideo.image, nextVideo.title, nextVideo.startDate, "", nextVideo.target, false, true)); 49698 49699 $(this.container).find("#l1pUIPopUpsRelatedNext").on('click', function(event) { 49700 //console.log("CLICK", event.target.id); 49701 49702 var target = event.target.id; 49703 if (target == "l1pUIPopUpsRelatedCountdownTimerClose" || target == "l1pUIPopUpsRelatedCountdownTimerCloseText") { 49704 //console.log("STOP TIMER"); 49705 self.clearRelatedInterval(); 49706 } else { 49707 //NEU 49708 if(nextVideo.target == "_self") { 49709 self.clearRelatedInterval(); 49710 self.playerMain.playerConfig.videoid = nextVideo.id; 49711 self.playerMain.playerConfig.shareurl = nextVideo.link; 49712 49713 new L1VideoPlayer(self.playerMain.playerConfig); 49714 } else { 49715 window.open(nextVideo.link, nextVideo.target); 49716 } 49717 } 49718 }); 49719 } 49720 49721 49722 // VIDEO LIST 49723 for (var relatedVideo in allRelated) { 49724 var actualRelated = allRelated[relatedVideo]; 49725 49726 if (relatedVideo > 0 && relatedVideo < 5) { 49727 var subText = actualRelated.mediatyp; 49728 if (!subText) { 49729 subText = actualRelated.startDate; 49730 } 49731 //listRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, subText, actualRelated.link, actualRelated.target, false)); 49732 49733 //NEU 49734 if(actualRelated.target == "_self") { 49735 listRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, subText, '', '', false, false, actualRelated.id)); 49736 } else { 49737 listRelated.append(generateRelatedSingleVideoHTML(actualRelated.image, actualRelated.title, subText, actualRelated.link, actualRelated.target, false)); 49738 } 49739 49740 } 49741 } 49742 49743 //NEU 49744 $(this.container).find('#l1pUIPopUpsRelatedList').on('click', function(event) { 49745 49746 var targetId = event.target.id; 49747 var element = event.target.closest('li'); 49748 var elementId = element.getAttribute('data-id'); 49749 49750 if(targetId == 'l1pUIPopUpsRelatedVideoElementTitle' || targetId == "l1pUIPopUpsRelatedVideoElementImage") { 49751 self.playerMain.playerConfig.videoid = elementId; 49752 self.playerMain.playerConfig.shareurl = getShareUrl(allRelated, elementId); 49753 49754 new L1VideoPlayer(self.playerMain.playerConfig); 49755 } 49756 }); 49757 49758 function getShareUrl(related, id) { 49759 var link = ''; 49760 for(var actual in related) { 49761 var singleRelated = related[actual]; 49762 if(singleRelated.id == id) { 49763 link = singleRelated.link; 49764 } 49765 } 49766 return link; 49767 } 49768 49769 }; 49770 49771 L1UI.prototype.setMultiviewStreamSelection = function(id, streams, language) { 49772 var allStreams = streams.videos; 49773 var currentLive = streams.currentLive;
49774 var listStreams = $(this.container).find(".l1pUIPopUpsStreamsSlider"); 49775 49776 listStreams.html(""); 49777 var checkStreams = streamsInUse(this); 49778 49779 function generateRelatedSingleVideoHTML(id, imagePath, titel, time, link, target) { 49780 49781 var linkgebinn = ''; 49782 var linkend = ''; 49783 var ullibeginn = '<li data-id="' + id + '">'; 49784 var ulliend = '</li>'; 49785 49786 if (link) { 49787 linkgebinn = '<a href="' + link + '" target="' + target + '">'; 49788 linkend = '</a>'; 49789 49790 } else { 49791 linkgebinn = ''; 49792 linkend = ''; 49793 } 49794 49795 return '' 49796 + ullibeginn 49797 + linkgebinn 49798 + '<div class="l1pUIPopUpsRelatedVideoElement">' 49799 + '<div id="l1pUIPopUpsRelatedVideoElementImageContainer">' 49800 + '<div id="l1pUIPopUpsRelatedVideoElementImageContainer2">' 49801 + '<img id="l1pUIPopUpsRelatedVideoElementImage" src="' + imagePath + '" />' 49802 + '<div id="l1pUIPopUpsRelatedVideoElementImageBG"></div>' 49803 + '</div>' 49804 + '</div>' 49805 + '<div id="l1pUIPopUpsRelatedVideoElementText">' 49806 + '<p id="l1pUIPopUpsRelatedVideoElementTime">' + time +'</p>' 49807 + '<p id="l1pUIPopUpsRelatedVideoElementTitle">' + titel + '</p>' 49808 + '</div>' 49809 + '</div>' 49810 + linkend 49811 + ulliend; 49812 } 49813 49814 function createSlider(allStreams, streamInUse) { 49815 var object = '<ul id="multiview-streams">'; 49816 for (var liveStreamVideo in allStreams) { 49817 var actualLiveStream = allStreams[liveStreamVideo]; 49818 if(streamInUse.indexOf(actualLiveStream.id.toString()) == -1) { 49819 object += generateRelatedSingleVideoHTML(actualLiveStream.id, actualLiveStream.image, actualLiveStream.title, actualLiveStream.startDate, ""); 49820 } 49821 } 49822 object += '</ul>'; 49823 return object; 49824 } 49825 49826 function streamsInUse(self) { 49827 var streamInUse = []; 49828 for(var i = 0; i <= 3; i++) { 49829 var id = self.playerMain['subPlayer' + i].videoid; 49830 if (id) { 49831 streamInUse.push(id); 49832 } 49833 } 49834 return streamInUse; 49835 } 49836 49837 if(currentLive > 0) { 49838 listStreams.append(createSlider(allStreams, checkStreams)); 49839 this.addStream(id); 49840 49841 if(document.getElementById('multiview-streams').childNodes.length == 0) { 49842 listStreams.append('<div>' + language['livestreams_status'] + '</div>'); 49843 } 49844 } else { 49845 listStreams.append('<div>' + language['livestreams_none'] + '</div>'); 49846 } 49847 }; 49848 49849 L1UI.prototype.setError = function() { 49850 49851 }; 49852 49853 L1UI.prototype.setInfo = function(information, language, showInfo) { 49854 if(showInfo == false) { this.hideInfoButton(); return; } 49855 49856 if(Object.keys(information).length === 0) { 49857 this.hideInfoButton(); 49858 return ; 49859 } 49860 49861 if(language) { 49862 $(this.container).find("#l1pUIPopUpsInfoText1").html(language.info); 49863 } 49864 //$(this.container).find("#l1pUIPopUpsInfoText2").html(language.recommendable); 49865 49866 var listImage = $(this.container).find("#l1pUIPopUpsInfoImage"); 49867 var listDescription = $(this.container).find("#l1pUIPopUpsInfoBeschreibung"); 49868 var listInformation = $(this.container).find("#l1pUIPopUpsInfoTexte"); 49869 49870 listImage.html(""); 49871 listDescription.html(""); 49872 listInformation.html(""); 49873 49874 function generatePopUpImage(image) { 49875 return "<img src='" + image + "' />" ; 49876 } 49877 49878 function generatePopUpDescription(title, description, date) { 49879 var checkedDate = checkParamValue(date); 49880 49881 return '' 49882 + '<span id="l1pUIPopUpsInfoBeschreibungTitle">'+ checkParamValue(title) + '</span>' 49883 + '<span id="l1pUIPopUpsInfoBeschreibungSubTitle">'+ checkParamValue(description) + '</span>' 49884 + '<span id="l1pUIPopUpsInfoBeschreibungDate">'+ formatDate(checkedDate) + '</span>'; 49885 } 49886 49887 function checkParamValue(string) { 49888 return string ? string : ''; 49889 } 49890 49891 function formatDate(startDate) { 49892 var formattedDate = new Date(startDate); 49893 49894 var d = formattedDate.getDate(); 49895 var m = formattedDate.getMonth(); 49896 m += 1; // JavaScript months are 0-11 49897 var y = formattedDate.getFullYear(); 49898 49899 var hou = formattedDate.getHours(); 49900 var min = formattedDate.getMinutes(); 49901 var sec = formattedDate.getSeconds(); 49902 49903 if (d < 10) {d = "0" + d;} 49904 if (m < 10) {m = "0" + m;} 49905 49906 if (hou < 10) {hou = "0" + hou;} 49907 if (min < 10) {min = "0" + min;} 49908 if (sec < 10) {sec = "0" + sec;} 49909 49910 var composedDate = '' + y + '-' + m + '-' + d + ' ' + hou + ':' + min + ':' + sec; 49911 49912 return composedDate; 49913 } 49914 49915 function generatePopUpText(metaData) { 49916 var metaInformation = metaData; 49917 49918 for(var key in metaInformation) { 49919 if(metaInformation[key] !== null && metaInformation[key] !== "") { 49920 listInformation.append('' 49921 + '<div id="l1pUIPopUpsInfoSingleText">' 49922 + '<span>' + capitalizeFirstLetter(key) + ':</span>' 49923 + '<span>' + metaInformation[key] + '</span>' 49924 + '</div>' 49925 ); 49926 } 49927 } 49928 } 49929 49930 function capitalizeFirstLetter(string) { 49931 return string.charAt(0).toUpperCase() + string.slice(1); 49932 } 49933 49934 listImage.append(generatePopUpImage(information.image)); 49935 listDescription.append(generatePopUpDescription(information.title, information.description, information.date)); 49936 49937 generatePopUpText(information.meta); 49938 49939 }; 49940 49941 L1UI.prototype.addStream = function(id) { 49942 var self = this;
49943 var listStreams = $(this.container).find(".l1pUIPopUpsStreamsSlider").find('.l1pUIPopUpsRelatedVideoElement'); 49944 49945 listStreams.on('click', function(event) { 49946 //TODO: JS 49947 var element = event.target.closest('li'); 49948 var parentElement = element.parentElement; 49949 var relatedId = element.getAttribute("data-id"); 49950 49951 if(self.playerMain['subPlayer' + id].videoid == "" && relatedId !== null) { 49952 self.streamAddCloseButton(self, id); 49953 self.playerMain['subPlayer' + id].start(self.playerMain.playerConfig.configUrl, relatedId, self.playerMain.playerConfig.partnerid, self.playerMain.playerConfig.language, true); 49954 } 49955 49956 49957 self.clickClosePopups(); 49958 }); 49959 49960 }; 49961 49962 L1UI.prototype.streamAddCloseButton = function(self, id) { 49963 var stream = $(self.container).find('#l1pVideo' + id).find('#l1pUIPopUpsOpenCloseVideo'); 49964 49965 var close = $(self.container).find('#l1pVideo' + id).find('#l1pUIPopUpsOpenCloseVideo').find('#l1pUIPopUpsCloseVideoBtn'); 49966 var open = $(self.container).find('#l1pVideo' + id).find('#l1pUIPopUpsOpenVideoBtn'); 49967 49968 //stream.removeClass('l1pShow').addClass('l1pShow'); 49969 close.removeClass('l1pHide').addClass('l1pShow'); 49970 open.removeClass('l1pShow').addClass('l1pHide'); 49971 49972 close.on('click', function() { 49973 //stream.removeClass('l1pShow').addClass('l1pHide'); 49974 close.removeClass('l1pShow').addClass('l1pHide'); 49975 open.removeClass('l1pHide').addClass('l1pShow'); 49976 49977 self.closeStream(id); 49978 }); 49979 }; 49980 49981 L1UI.prototype.closeStream = function(id) { 49982 this.playerMain.closeStream(id); 49983 }; 49984 49985 49986 // ----------------------- POPUPS ----------------------- 49987 49988 L1UI.prototype.showPopup = function(name, allowClose) { 49989 49990 var popupName = ""; 49991 49992 switch(name) { 49993 case "autoplay": 49994 popupName = "l1pUIPopUpsAutoplay"; 49995 break; 49996 case "countdown": 49997 popupName = "l1pUIPopUpsCountdown"; 49998 break; 49999 case "share": 50000 popupName = "l1pUIPopUpsShare"; 50001 break; 50002 case "info": 50003 popupName = "l1pUIPopUpsInfo"; 50004 break; 50005 case "hd": 50006 popupName = "l1pUIPopUpsHD"; 50007 break; 50008 case "settings": 50009 popupName = "l1pUIPopUpsSettings"; 50010 break; 50011 case "statistics": 50012 popupName = "l1pUIPopUpsStatistics"; 50013 break; 50014 case "multiview": 50015 popupName = "l1pUIPopUpsMultiview"; 50016 break; 50017 case "streams": 50018 popupName = "l1pUIPopUpsStreams"; 50019 break; 50020 case "related": 50021 popupName = "l1pUIPopUpsRelated"; 50022 break; 50023 case "error": 50024 popupName = "l1pUIPopUpsError"; 50025 break; 50026 case "premium": 50027 popupName = "l1pUIPopUpsPremium"; 50028 break; 50029 default: 50030 popupName = ""; 50031 } 50032 50033 if (popupName) { 50034 $(this.container).find("#l1pUIPopUps").removeClass().addClass( "l1pShow" ); 50035 //$(this.container).find("#" + popupName).removeClass().addClass( "l1pShow" ); 50036 //$(this.container).find("#" + popupName).toggleClass()( "l1pHide l1pShow" ); 50037 $(this.container).find("#" + popupName).removeClass("l1pHide").addClass("l1pShow"); 50038 } 50039 50040 if (allowClose) { 50041 $(this.container).find("#l1pUIPopUpsClose").removeClass().addClass( "l1pShow" ); 50042 } else { 50043 $(this.container).find("#l1pUIPopUpsClose").removeClass().addClass( "l1pHide" ); 50044 } 50045 }; 50046 50047 L1UI.prototype.closeAllPopups = function() { 50048 $(this.container).find("#l1pUIPopUps").removeClass().addClass( "l1pHide" ); 50049 50050 /* 50051 $(this.container).find("#l1pUIPopUpsAutoplay").removeClass().addClass( "l1pHide" ); 50052 $(this.container).find("#l1pUIPopUpsCountdown").removeClass().addClass( "l1pHide" ); 50053 $(this.container).find("#l1pUIPopUpsShare").removeClass().addClass( "l1pHide" ); 50054 $(this.container).find("#l1pUIPopUpsInfo").removeClass().addClass( "l1pHide" ); 50055 $(this.container).find("#l1pUIPopUpsSettings").removeClass().addClass( "l1pHide" ); 50056 $(this.container).find("#l1pUIPopUpsStatistics").removeClass().addClass( "l1pHide" ); 50057 $(this.container).find("#l1pUIPopUpsStreams").removeClass().addClass( "l1pHide" ); 50058 $(this.container).find("#l1pUIPopUpsMultiview").removeClass().addClass( "l1pHide" ); 50059 $(this.container).find("#l1pUIPopUpsRelated").removeClass().addClass( "l1pHide" ); 50060 $(this.container).find("#l1pUIPopUpsError").removeClass().addClass( "l1pHide" ); 50061 */ 50062 50063 $(this.container).find("#l1pUIPopUpsAutoplay").removeClass("l1pShow").addClass("l1pHide"); 50064 $(this.container).find("#l1pUIPopUpsCountdown").removeClass("l1pShow").addClass("l1pHide"); 50065 $(this.container).find("#l1pUIPopUpsShare").removeClass("l1pShow").addClass("l1pHide"); 50066 $(this.container).find("#l1pUIPopUpsInfo").removeClass("l1pShow").addClass("l1pHide"); 50067 $(this.container).find("#l1pUIPopUpsHD").removeClass("l1pShow").addClass("l1pHide"); 50068 $(this.container).find("#l1pUIPopUpsSettings").removeClass("l1pShow").addClass("l1pHide"); 50069 $(this.container).find("#l1pUIPopUpsStatistics").removeClass("l1pShow").addClass("l1pHide");
50070 $(this.container).find("#l1pUIPopUpsStreams").removeClass("l1pShow").addClass("l1pHide"); 50071 $(this.container).find("#l1pUIPopUpsMultiview").removeClass("l1pShow").addClass("l1pHide"); 50072 $(this.container).find("#l1pUIPopUpsPremium").removeClass("l1pShow").addClass("l1pHide"); 50073 $(this.container).find("#l1pUIPopUpsRelated").removeClass("l1pShow").addClass("l1pHide"); 50074 $(this.container).find("#l1pUIPopUpsError").removeClass("l1pShow").addClass("l1pHide"); 50075 }; 50076 50077 L1UI.prototype.showAutoplay = function() { 50078 this.closeAllPopups(); 50079 this.showPopup("autoplay", false); 50080 }; 50081 50082 L1UI.prototype.hideAutoplay = function() { 50083 this.closeAllPopups(); 50084 }; 50085 50086 L1UI.prototype.showCountdown = function() { 50087 this.closeAllPopups(); 50088 this.showPopup("countdown", false); 50089 }; 50090 50091 L1UI.prototype.hideCountdown = function() { 50092 this.closeAllPopups(); 50093 }; 50094 50095 L1UI.prototype.showShare = function() { 50096 this.closeAllPopups(); 50097 this.showPopup("share", true); 50098 }; 50099 50100 L1UI.prototype.showDownload = function() { 50101 window.location.href = 'videos/video1.mp4'; 50102 }; 50103 50104 L1UI.prototype.showInfo = function() { 50105 this.closeAllPopups(); 50106 this.showPopup("info", true); 50107 50108 /* 50109 $(document).ready(function(){ 50110 $('#l1pUIPopUpsInfoList').slick({ 50111 infinite: false, 50112 slidesToShow: 5, 50113 slidesToScroll: 5 50114 }); 50115 }); 50116 50117 $('.l1pUIPopUpsStreamsSlider').slick('setPosition'); 50118 */ 50119 }; 50120 50121 L1UI.prototype.showMultiview = function() { 50122 this.closeAllPopups(); 50123 this.showPopup("multiview", true); 50124 }; 50125 50126 L1UI.prototype.showPremium = function() { 50127 this.closeAllPopups(); 50128 this.showPopup("premium", true); 50129 }; 50130 50131 L1UI.prototype.showStreams = function(id) { 50132 this.closeAllPopups(); 50133 this.showPopup("streams", true); 50134 }; 50135 50136 L1UI.prototype.hideShare = function() { 50137 this.closeAllPopups(); 50138 }; 50139 50140 L1UI.prototype.showHD = function() { 50141 this.closeAllPopups(); 50142 this.showPopup("hd", true); 50143 }; 50144 50145 L1UI.prototype.showSettings = function() { 50146 this.closeAllPopups(); 50147 this.showPopup("settings", true); 50148 }; 50149 50150 L1UI.prototype.showStatistics = function() { 50151 this.closeAllPopups(); 50152 this.showPopup("statistics", true); 50153 }; 50154 50155 L1UI.prototype.hideSettings = function() { 50156 this.closeAllPopups(); 50157 }; 50158 50159 L1UI.prototype.showRelated = function() { 50160 this.closeAllPopups(); 50161 this.showPopup("related", false); 50162 this.setRelatedContent(); 50163 }; 50164 50165 L1UI.prototype.setRelatedContent = function() { 50166 50167 var self = this; 50168 var countdownTimer = $(this.container).find('#l1pUIPopUpsRelatedNext').find('#l1pUIPopUpsRelatedCountdownTimer'); 50169 var interval; 50170 var second = 0; 50171 var seconds = 9; 50172 var countdownIsVisible = $(this.container).find('#l1pUIPopUpsRelatedCountdownContainer').is(":visible"); 50173 50174 //SET COUNTDOWN TEXT TO SECONDS 50175 countdownTimer.text(seconds+1); 50176 50177 //SHOW COUNTDOWN TEXT (maybe its hide from replay) 50178 $(this.container).find("#l1pUIPopUpsRelatedCountdownContainer").removeClass().addClass("l1pShow"); 50179 $(this.container).find("#l1pUIPopUpsRelatedNext").find("#l1pUIPopUpsRelatedVideoElementImageBG").removeClass().addClass("l1pShow"); 50180 50181 //REMOVE COUNTDOWN IF MOBILE OR HIDDEN (player is too small) 50182 if(this.playerMain.playerConfig.deviceInfo.isMobile || !this.relatedNextAllowTimer || !countdownIsVisible) { 50183 self.clearRelatedInterval(); 50184 } else { 50185 self.relatedNextInterval = setInterval(function() 50186 { 50187 countdownTimer.text(seconds - second); 50188 50189 if (second >= seconds) { 50190 self.clearRelatedInterval(); 50191 var metaOrganisation = self.playerMain.subPlayer.getInfo(); 50192 metaOrganisation = (metaOrganisation.meta && metaOrganisation.meta.organisation) ? metaOrganisation.meta.organisation : ""; 50193 //NEU 50194 if(self.relatedNextTarget == "_self") { 50195 self.playerMain.playerConfig.videoid = self.relatedNextId; 50196 self.playerMain.playerConfig.shareurl = self.relatedNextLink; 50197 50198 new L1VideoPlayer(self.playerMain.playerConfig); 50199 } else { 50200 if(metaOrganisation.substr(0,3).indexOf('EHF') == -1 && (self.playerMain.playerConfig.partnerid == '1' || self.playerMain.playerConfig.partnerid == '22')) { 50201 self.relatedNextLink = self.relatedNextLink + '?autoredirect=true'; 50202 window.open(self.relatedNextLink, self.relatedNextTarget); 50203 }else { 50204 window.open(self.relatedNextLink, self.relatedNextTarget); 50205 } 50206 } 50207 50208 //window.open(self.relatedNextLink, self.relatedNextTarget); 50209 } 50210 50211 second++; 50212 }, 1000); 50213 } 50214 }; 50215 50216 50217 L1UI.prototype.clearRelatedInterval = function() { 50218 clearInterval(this.relatedNextInterval); 50219 $(this.container).find("#l1pUIPopUpsRelatedCountdownContainer").removeClass().addClass("l1pHide"); 50220 $(this.container).find("#l1pUIPopUpsRelatedNext").find("#l1pUIPopUpsRelatedVideoElementImageBG").removeClass().addClass("l1pHide"); 50221 }; 50222 50223 L1UI.prototype.relatedReplay = function() { 50224 this.clearRelatedInterval(); 50225 this.playerMain.onclickReplay(); 50226 }; 50227 50228 L1UI.prototype.hideRelated = function() { 50229 this.closeAllPopups(); 50230 }; 50231 50232 L1UI.prototype.showError = function() { 50233 this.closeAllPopups(); 50234 this.showPopup("error", false); 50235 }; 50236 50237 L1UI.prototype.hideError = function() { 50238 this.closeAllPopups(); 50239 }; 50240 50241 // ----------------------- VIDEO EVENTS ----------------------- 50242 50243 L1UI.prototype.videoProgress = function(currentTime, duration, isLive, allowDVR) { 50244 50245 var UITimelineViewtimeBar = $(this.container).find("#l1pUIControl
50245sTimelineProgressBarViewTime"); 50246 var UITimelineTimeLeft = $(this.container).find("#l1pUIControlsTimelineTimeLeft"); 50247 var UITimelineTimeRight = $(this.container).find("#l1pUIControlsTimelineTimeRight"); 50248 50249 if (currentTime && duration) { 50250 UITimelineTimeLeft.html(formatTime(currentTime)); 50251 UITimelineTimeRight.html(formatTime(duration)); 50252 50253 var timeWidthInProzent = 100 / duration * currentTime; 50254 UITimelineViewtimeBar.css("width", timeWidthInProzent + "%"); 50255 50256 if(isLive) { 50257 UITimelineTimeLeft.html('00:00'); 50258 UITimelineTimeRight.html("LIVE"); 50259 UITimelineViewtimeBar.css("width", "100%"); 50260 50261 var leftTime = duration - currentTime; 50262 if(leftTime < 30) { timeWidthInProzent = 100; leftTime = 0} 50263 50264 if(allowDVR) { 50265 if (duration > 600) { 50266 var start = duration - 600; 50267 timeWidthInProzent = ((currentTime - start) / 600) * 100; 50268 if (start == currentTime) { 50269 timeWidthInProzent = 0; 50270 } 50271 } 50272 50273 if (leftTime > 30) { 50274 UITimelineTimeLeft.html(' - ' + formatTime(leftTime)); 50275 UITimelineViewtimeBar.css("width", timeWidthInProzent + '%'); 50276 } 50277 } else { 50278 //$(this.container).find("#l1pUIControlsTimelineProgressBar").unbind(); 50279 $(this.container).find("#l1pUIControlsTimelineTooltip").addClass('l1pHide'); 50280 } 50281 } 50282 } 50283 }; 50284 50285 L1UI.prototype.videoLoading = function(percent, loadStartPercentage) { 50286 var UITimelineLoadingBar = $(this.container).find("#l1pUIControlsTimelineProgressBarLoading"); 50287 UITimelineLoadingBar.css("width", percent + "%"); 50288 50289 if (loadStartPercentage || loadStartPercentage == 0) { 50290 UITimelineLoadingBar.css("left", loadStartPercentage + "%"); 50291 } 50292 }; 50293 50294 L1UI.prototype.videoPlay = function() { 50295 $(this.container).find("#l1pUIControlsButtonPlayPause").find("i").removeClass().addClass("fa fa-pause"); 50296 50297 }; 50298 50299 L1UI.prototype.videoPause = function() { 50300 $(this.container).find("#l1pUIControlsButtonPlayPause").find("i").removeClass().addClass("fa fa-play"); 50301 50302 }; 50303 50304 L1UI.prototype.videoError = function(text, textObject) { 50305 //console.log(text, textObject); 50306 var ausgabe = text; 50307 50308 /* 50309 ausgabe = ausgabe.replace("[url]", "<a "); 50310 ausgabe = ausgabe.replace("[link]", "href='"); 50311 ausgabe = ausgabe.replace("[/link]", "' "); 50312 ausgabe = ausgabe.replace("[target]", "target='"); 50313 ausgabe = ausgabe.replace("[/target]", "'"); 50314 ausgabe = ausgabe.replace("[text]", ">"); 50315 ausgabe = ausgabe.replace("[/text]", ""); 50316 ausgabe = ausgabe.replace("[/url]", "</a>"); 50317 */ 50318 50319 ausgabe = ausgabe.replace(/</gi, "<").replace(/>/gi, ">"); 50320 50321 $(this.container).find("#l1pUIPopUpsErrorText").html(ausgabe); 50322 50323 if(textObject && textObject.errortext && textObject.loggedtext && textObject.buttontext) { 50324 $(this.container).find("#l1pUIPopUpsError").find('h1').html(textObject.errortext); 50325 $(this.container).find("#l1pUIPopUpsErrorTitle").html(textObject.loggedtext); 50326 50327 var errorContent = $(this.container).find('#l1pUIPopUpsError').find('#l1pUIPopUpsContent'); 50328 errorContent.append('<a id="l1pUIPopUpsPremiumLink" href="https://www.laola1.tv/premium/"><div id="l1pUIPopUpsPremiumBtn" class="l1pUIControlsButton">' + textObject.buttontext + '</div></a>'); 50329 } 50330 50331 /* 50332 if (code == "geo") { 50333 $(this.container).find("#l1pUIPopUpsErrorTitle").html(text); 50334 } 50335 */ 50336 this.showError(); 50337 50338 }; 50339 50340 L1UI.prototype.videoCreateVideoIndexList = function (data, language, settingsQuality) { 50341 var autoSelectIndexList = $(this.container).find("#l1pUIPopUpsSettingsListAuto")[0]; 50342 var manualSelectIndexList = $(this.container).find("#l1pUIPopUpsSettingsistManuell")[0]; 50343 50344 function createListElement(self, id, name) { 50345 var element = document.createElement('li'); 50346 element.className = 'l1pActive'; 50347 element.innerHTML = name; 50348 element.addEventListener('click', function(){ 50349 self.clickSingleIndex(id); 50350 if(id == -1) { 50351 autoSelectIndexList.children[0].classList.add('l1pActive'); 50352 } else { 50353 autoSelectIndexList.children[0].classList.remove('l1pActive'); 50354 } 50355 }); 50356 return element; 50357 } 50358 50359 $(autoSelectIndexList).html(""); 50360 $(manualSelectIndexList).html(""); 50361 50362 $(autoSelectIndexList).append(createListElement(this, -1, 'AUTO')); 50363 //$(autoSelectIndexList).append(createListElement(this, -1, language.auto)); 50364 50365 for(var i = 0; i < data.length; i++) { 50366 var bitrate = data[i].bitrate; 50367 bitrate = bitrate / 1000; 50368 //console.log("BITRATE: " , bitrate); 50369 50370 if(bitrate <= 350) { 50371 $(manualSelectIndexList).append(createListElement(this, i, 'LOW')); 50372 } else if(bitrate > 350 && bitrate <= 600) { 50373 $(manualSelectIndexList).append(createListElement(this, i, 'MID')); 50374 } else if(bitrate > 600 && bitrate <= 1050) { 50375 $(manualSelectIndexList).append(createListElement(this, i, 'REG')); 50376 } else if(bitrate > 1050 && bitrate <= 1700) { 50377 $(manualSelectIndexList).append(createListElement(this, i, 'HIGH')); 50378 } else if(bitrate > 1700 && bitrate <= 2500) { 50379 $(manualSelectIndexList).append(createListElement(this, i, 'HD')); 50380 } else if(bitrate > 2500) { 50381 $(manualSelectIndexList).append(createListElement(this, i, 'FullHD')); 50382 } 50383 } 50384 50385 /* 50386 //Dynamisch Qualitätsstufen erstellen 50387 var defaultBitrate = [ 50388 { "label": "LOW", "bitrate": 350}, 50389 { "label": "MID", "bitrate": 600}, 50390 { "label": "REG", "bitrate": 1050}, 50391 { "label": "HIGH", "bitrate": 1700}, 50392 { "label": "HD", "bitrate": 2500}, 50393 { "label": "FullHD", "bitrate": 5000} 50394 ]; 50395 50396 var bits = null; 50397 if(settingsQuality && settingsQuality.qualities) { 50398 bits = createQualitiesBitRate(this, data, settingsQuality.qualities); 50399 } else { 50400 bits = createQualitiesBitRate(this, data, defaultBitrate); 50401 } 50402 50403 for(var i = 0; i < bits.length; i++) { 50404 $(manualSelectIndexList).append(createListElement(this, i, bits[i].name.label)); 50405 } 50406 50407 function createQualitiesBitRate(self, data, settings) { 50408 var indexArray = []; 50409 var indexBitRateArray = []; 50410 var indexNameArr = []; 50411 50412 //console.log('createQualitiesBitRate: ', self, data, settings); 50413 50414 for(var i = 0; i < data.length; i++) { 50415 var dataBitRate = data[i].bitrate / 1000; 50416 indexBitRateArray.push(dataBitRate); 50417 for(var j = 0; j < settings.length; j++) { 50418 if(checkRange(Number(settings[j- 1] + 1), indexBitRateArray[i], settings[j])) { 50419 indexNameArr.push(settings[j]); 50420 } 50421 } 50422 indexArray.push( { "name": indexNameArr[i], "bitrate": indexBitRateArray[i]} ); 50423 } 50424 //console.log('array',indexArray); 50425 50426 return indexArray; 50427 50428 function checkRange(min, val, max) { 50429 max = max.bitrate; 50430 //console.log('val:', min, val, max); 50431 return min > val ? false : (max < val ? false : true); 50432 } 50433 }*/ 50434 50435 }; 50436 50437 L1UI.prototype.videoSwitchVideoIndex = function (newIndex) { 50438 50439 var manualSelectIndexList = $(this.container).find("#l1pUIPopUpsSettingsistManuell")[0]; 50440 var anzahlNodes = $(this.container).find("#l1pUIPopUpsSettingsistManuell")[0].children.length; 50441 50442 function setNewIndex(list, newIndex) { 50443 50444 if (anzahlNodes > 0) { 50445 for(var i = 0; i < list.childNodes.length; i++) { 50446 list.childNodes[i].classList.remove('l1pActive'); 50447 } 50448 list.childNodes[newIndex].classList.add('l1pActive'); 50449 } 50450 } 50451 setNewIndex(manualSelectIndexList, newIndex); 50452 }; 50453 50454 L1UI.prototype.checkVideoIndex = function (newIndex) { 50455 //this.playerMain.subPlayer.videoConfig.streamAccess.premium.allowHD 50456 var self = this; 50457 50458 var indexList = $(this.container).find("#l1pUIPopUpsSettingsistManuell");
50459 var hd = $(this.container).find('#l1pUIControlsButtonHD'); 50460 var hdIndex = indexList[0].children.length - 1; 50461 50462 if(this.playerMain.subPlayer.videoConfig.streamAccess.premium.allowHD === false) { 50463 hdIndex = -1; 50464 } 50465 50466 if(newIndex == hdIndex) { 50467 hd.unbind('click'); 50468 hd.addClass('l1pUIControlsHDActive'); 50469 } else { 50470 hd.bind('click', function() { 50471 self.clickHD(); 50472 }); 50473 hd.removeClass('l1pUIControlsHDActive'); 50474 } 50475 }; 50476 50477 L1UI.prototype.setVolume = function (percent) { 50478 $(this.container).find("#l1pUIControlsButtonVolumeHoverSlider").val(percent).change(); 50479 }; 50480 50481 L1UI.prototype.showTimelineTooltip = function (prozentTime, duration, isLive) { 50482 var sekunde = (duration / 100) * prozentTime; 50483 50484 if (sekunde < 0 ) { sekunde = 0; } 50485 if (sekunde > duration ) { sekunde = duration; } 50486 50487 50488 if (!isNaN(sekunde)) { 50489 $(this.container).find("#l1pUIControlsTimelineTooltip").html(formatTime(sekunde)); 50490 } else { 50491 $(this.container).find("#l1pUIControlsTimelineTooltip").html(""); 50492 } 50493 50494 if(isLive) { 50495 var leftTime = (prozentTime / 100) * 600; 50496 leftTime = 600 - leftTime; 50497 $(this.container).find("#l1pUIControlsTimelineTooltip").html(' - ' + formatTime(leftTime)); 50498 } 50499 50500 }; 50501 50502 // ----------------------- CLICK EVENTS ----------------------- 50503 50504 L1UI.prototype.clickAutoplay = function() { 50505 this.playerMain.onAutoplayClick(); 50506 }; 50507 50508 L1UI.prototype.clickRewind = function() { 50509 this.playerMain.onclickRewind(); 50510 }; 50511 50512 L1UI.prototype.clickForward = function() { 50513 this.playerMain.onclickForward(); 50514 }; 50515 50516 L1UI.prototype.clickPlayPause = function() { 50517 this.playerMain.onclickPlayPause(); 50518 }; 50519 50520 L1UI.prototype.clickTimeline = function(e) { 50521 var parentOffset = $(this.container).find("#l1pUIControlsTimelineProgressBar").offset(); 50522 var durationBarWidth = $(this.container).find("#l1pUIControlsTimelineProgressBar").width(); 50523 50524 var relX = e.pageX - parentOffset.left; 50525 var relY = e.pageY - parentOffset.top; 50526 50527 var prozentTime = Math.round(100 / (durationBarWidth / relX)); 50528 this.playerMain.onclickTimeline(prozentTime); 50529 }; 50530 50531 L1UI.prototype.mouseMoveTimeline = function(e) { 50532 50533 var tooltip = $(this.container).find("#l1pUIControlsTimelineTooltip"); 50534 50535 var parentOffset = $(this.container).find("#l1pUIControlsTimelineProgressBar").offset(); 50536 var durationBarWidth = $(this.container).find("#l1pUIControlsTimelineProgressBar").width(); 50537 50538 var relX = e.pageX - parentOffset.left; 50539 var relY = e.pageY - parentOffset.top; 50540 50541 var prozentTime = Math.round(100 / (durationBarWidth / relX)); 50542 50543 if (relX < 0 || relX > durationBarWidth) { 50544 $(this.container).find("#l1pUIControlsTimelineTooltip").css("display", "none"); 50545 } else { 50546 $(this.container).find("#l1pUIControlsTimelineTooltip").css("display", ""); 50547 } 50548 $(this.container).find("#l1pUIControlsTimelineTooltip").css("left", (relX) + "px"); 50549 50550 this.playerMain.onMouseMoveTimeline(prozentTime); 50551 }; 50552 50553 50554 L1UI.prototype.clickMultiview = function() { 50555 this.playerMain.onclickMultiview(); 50556 //this.showShare(); 50557 }; 50558 50559 L1UI.prototype.clickPremium = function() { 50560 this.playerMain.onclickPremium(); 50561 //this.showShare(); 50562 }; 50563 50564 L1UI.prototype.clickInfo = function() { 50565 this.playerMain.onclickInfo(); 50566 //this.showShare(); 50567 }; 50568 50569 L1UI.prototype.clickShare = function() { 50570 this.playerMain.onclickShare(); 50571 //this.showShare(); 50572 }; 50573 L1UI.prototype.clickDownload = function() { 50574 //this.playerMain.onclickDownload(); 50575 //this.showShare(); 50576 50577 //var fileName = "demo.mp4"; 50578 //var link = document.createElement("a"); 50579 50580 //link.setAttribute("href", "demo.mp4"); 50581 //link.setAttribute("download", fileName); 50582 //document.body.appendChild(link); 50583 //link.click(); 50584 //document.body.removeChild(link); 50585 }; 50586 50587 L1UI.prototype.clickPremiumStream = function() { 50588 this.playerMain.onclickPremiumStream(); 50589 }; 50590 50591 L1UI.prototype.clickCopy = function() { 50592 this.playerMain.onclickCopy(); 50593 //this.showShare(); 50594 }; 50595 50596 L1UI.prototype.clickSocial = function(social) { 50597 this.playerMain.onclickSocial(social, $(this.container).find("#l1pUIPopUpsShareUrl").val()); 50598 }; 50599 50600 L1UI.prototype.clickMultiviewSelection = function(multiview) { 50601 this.playerMain.onclickMultiviewSelection(multiview); 50602 }; 50603 L1UI.prototype.clickHD = function() { 50604 this.playerMain.onclickHD(); 50605 //this.showSettings(); 50606 }; 50607 50608 L1UI.prototype.clickSettings = function() { 50609 this.playerMain.onclickSettings(); 50610 //this.showSettings(); 50611 }; 50612 50613 L1UI.prototype.clickStatistics = function() { 50614 this.playerMain.onclickStatistics(); 50615 //this.showSettings(); 50616 }; 50617 50618 L1UI.prototype.clickSingleIndex = function(newIndex) { 50619 this.playerMain.onclickSingleIndex(newIndex); 50620 }; 50621 50622 L1UI.prototype.clickFullscreen = function() { 50623 this.playerMain.onclickFullscreen(); 50624 }; 50625 50626 L1UI.prototype.clickClosePopups = function() { 50627 this.playerMain.onClickCloseAllPopups(); 50628 }; 50629 50630 function formatTime(totalSeconds) { 50631 function format(number) { 50632 return (number >= 10) ? number : "0" + number; 50633 } 50634 50635 var hours = Math.floor(totalSeconds / 3600); 50636 50637 var totalSecs = totalSeconds % (60 * 60); 50638 var minutes = Math.floor(totalSecs / 60); 50639 50640 var seconds = Math.floor(totalSeconds % 60); 50641 50642 var formattedHours = format(hours); 50643 var formattedMinutes = format(minutes); 50644 var formattedSeconds = format(seconds); 50645 50646 if (hours > 0) { 50647 return formattedHours + ":" + formattedMinutes + ":" + formattedSeconds; 50648 } else { 50649 return formattedMinutes + ":" + formattedSeconds; 50650 } 50651 } 50652 50653}()); 50654(function() { 50655 this.L1VideoFlashPlayer = function (videoInterface, videoElement, url) { 50656 //console.log('new FlashPlayer', videoInterface, videoElement); 50657 50658 this.videoInterface = videoInterface; 50659 this.videoElement = videoElement; 50660 this.url = url; 50661 50662 var random = 'flashplayer_' + Math.round(Math.random() * (100000 - 0)) + 0; 50663 this.random1 = random; 50664 50665 var flashRandomContainer = document.createElement('div'); 50666 flashRandomContainer.id = random; 50667 this.videoElement.appendChild(flashRandomContainer); 50668 50669 this.swfobject = swfobject; 50670 this.api = null; 50671 50672 var flashvars = {}; 50673 flashvars.jsCallbackFunction = "flashlsCallback" + this.random1; 50674 var params = {wmode:"transparent", allowScriptAccess:"always", allowfullscreen:"true"}; 50675 var attributes = { name: 'laola1player', id: this.random1 }; 50676 50677 //this.swfobject.embedSWF("assets/flashplayer_9.swf", this.random1, "100%", "100%", "9.0.0", false, flashvars, params, attributes); 50678 this.swfobject.embedSWF("//cdn.laola1.tv/player/dist/latest/hdsplayer.swf", this.random1, "100%", "100%", "9.0.0", false, flashvars, params, attributes); 50679 50680 var self = this; 50681 var name = "flashlsCallback" + this.random1; 50682 50683 window[name] = function(eventName, args, args2) { 50684 //console.log('event', eventName); 50685 if(eventName === 'loaded') { 50686 //console.log("SWF IS LOADED EVENT", args, args2); 50687 self.api = new flashAPI(self.swfobject.getObjectById(random)); 50688 self.api.load(self.url); 50689 } 50690 if(eventName === 'progress') { 50691 //console.log('VIDEO PROGRESS', args, args2); 50692 var currentTime = Number(args); 50693 var duration = Number(args2); 50694 self.videoInterface.videoProgress(currentTime.toFixed(2), duration.toFixed(2)); 50695 } 50696 50697 if(eventName === 'setLevels') { 50698 //console.log('levels', args); 50699 self.videoInterface.videoCreateVideoIndexList(args); 50700 } 50701 50702 if(eventName === 'switch') { 50703 //console.log('levels', args); 50704 self.videoInterface.videoSwitchVideoIndex(args); 50705 } 50706 50707 if(eventName === 'playing') { 50708 self.videoInterface.videoPlay(); 50709 } 50710 50711 if(eventName === 'paused') { 50712 self.videoInterface.videoPause(); 50713 } 50714 50715 if(eventName === 'error') { 50716 self.videoInterface.videoError(); 50717 //console.log("FLASH: error", args, args2); 50718 } 50719 50720 if(eventName === 'trigger') { 50721 self.videoInterface.videoTrigger(args); 50722 } 50723 50724 if(eventName === 'complete') { 50725 self.videoInterface.videoComplete(); 50726 } 50727 }; 50728 50729 }; 50730 50731 /* 50732 switch: function(newLevel) { 50733 //console.log('switch level', newLevel); 50734 self.videoInterface.videoSwitchVideoIndex(newLevel); 50735 self.videoInterface.checkVideoIndex(newLevel); 50736 } 50737 */ 50738 50739 L1VideoFlashPlayer.prototype.playOrPause = function () { 50740 if(this.api.getPlayed()) { 50741 this.api.pause(); 50742 } else { 50743 this.api.play(); 50744 } 50745 }; 50746 50747 L1VideoFlashPlayer.prototype.play = function () { 50748 this.api.play(); 50749 }; 50750 50751 L1VideoFlashPlayer.prototype.pause = function () { 50752 this.api.pause(); 50753 }; 50754 50755 L1VideoFlashPlayer.prototype.forward = function () { 50756 this.api.seek(this.api.getPosition() + 10); 50757 }; 50758 50759 L1VideoFlashPlayer.prototype.rewind = function () { 50760 this.api.seek(this.api.getPosition() - 10); 50761 }; 50762 50763 L1VideoFlashPlayer.prototype.seek = function (second) { 50764 this.api.seek(second); 50765 }; 50766 50767 L1VideoFlashPlayer.prototype.seekTo = function (prozent) { 50768 this.api.seek((this.api.getDuration() / 100) * prozent); 50769 }; 50770 50771 L1VideoFlashPlayer.prototype.setManualVideoIndex = function(newIndex) { 50772 this.api.setIndex(newIndex); 50773 }; 50774 50775 L1VideoFlashPlayer.prototype.setVolume = function(prozent) { 50776 if (prozent >= 0 && this.api) { 50777 this.api.volume(prozent); 50778 } 50779 }; 50780 50781 L1VideoFlashPlayer.prototype.destroy = function () { 50782 this.api.pause(); 50783 }; 50784 50785 L1VideoFlashPlayer.prototype.closeStream = function (id) { 50786 //this.hls.detachMedia(); 50787 }; 50788 50789 L1VideoFlashPlayer.prototype.getCurrentTime = function () { 50790 return this.api.getPosition(); 50791 }; 50792 50793 L1VideoFlashPlayer.prototype.getDuration = function () { 50794 if (this.api) { 50795 return this.api.getDuration(); 50796 } else { 50797 return 0; 50798 } 50799 }; 50800 50801 L1VideoFlashPlayer.prototype.getVolume = function () { 50802 return this.api.getVolume(); 50803 }; 50804 50805 L1VideoFlashPlayer.prototype.getPaused = function () { 50806 return this.api.getPaused(); 50807 }; 50808 50809 L1VideoFlashPlayer.prototype.getPlayed = function () { 50810 return this.api.getPlayed(); 50811 }; 50812 50813}()); 50814 50815function flashAPI(flashObject) { 50816 this.constructor = function(flashObject) { 50817 this.flashObject = flashObject; 50818 }; 50819 this.constructor(flashObject); 50820 50821 /* SET */ 50822 this.load = function(url) { 50823 this.flashObject.getFromJs('load', url); 50824 }; 50825 50826 this.play = function() { 50827 this.flashObject.getFromJs('play'); 50828 }; 50829 50830 this.pause = function() { 50831 this.flashObject.getFromJs('pause'); 50832 }; 50833 50834 this.seek = function(time) { 50835 this.flashObject.getFromJs('seek', time); 50836 }; 50837 50838 this.setIndex = function(index) { 50839 this.flashObject.getFromJs('setIndex', index); 50840 }; 50841 50842 this.volume = function(volume) { 50843 this.flashObject.getFromJs('volume', volume); 50844 }; 50845 50846 /* GET */ 50847 this.getPaused = function() { 50848 return this.flashObject.getFromJs('getPaused'); 50849 }; 50850 50851 this.getPlayed = function() { 50852 return this.flashObject.getFromJs('getPlayed'); 50853 }; 50854 50855 this.getPosition = function() { 50856 return Number(this.flashObject.getFromJs('getCurrentTime')); 50857 }; 50858 50859 this.getDuration = function() { 50860 return Number(this.flashObject.getFromJs('getDuration')); 50861 }; 50862 50863 this.getVolume = function() { 50864 return Number(this.flashObject.getFromJs('getVolume')); 50865 }; 50866} 50867 50868var flashlsAPI = function(flashObject) { 50869 50870 this.constructor = function(flashObject) { 50871 this.flashObject = flashObject; 50872 }; 50873 this.constructor(flashObject); 50874 50875 this.load = function(url) { 50876 this.flashObject.playerLoad(url); 50877 }; 50878 50879 this.play = function(offset) { 50880 this.flashObject.playerPlay(offset); 50881 }; 50882 50883 this.pause = function() { 50884 this.flashObject.playerPause(); 50885 }; 50886 50887 this.resume = function() { 50888 this.flashObject.playerResume(); 50889 }; 50890 50891 this.seek = function(offset) { 50892 this.flashObject.playerSeek(offset); 50893 }; 50894 50895 this.stop = function() { 50896 this.flashObject.playerStop(); 50897 }; 50898 50899 this.volume = function(volume) { 50900 this.flashObject.playerVolume(volume); 50901 }; 50902 50903 this.setCurrentLevel = function(level) { 50904 this.flashObject.playerSetCurrentLevel(level); 50905 }; 50906 50907 this.setNextLevel = function(level) { 50908 this.flashObject.playerSetNextLevel(level); 50909 }; 50910 50911 this.setLoadLevel = function(level) { 50912 this.flashObject.playerSetLoadLevel(level); 50913 }; 50914 50915 this.setMaxBufferLength = function(len) { 50916 this.flashObject.playerSetmaxBufferLength(len); 50917 }; 50918 50919 this.getPosition = function() { 50920 return this.flashObject.getPosition(); 50921 }; 50922 50923 this.getDuration = function() { 50924 return this.flashObject.getDuration(); 50925 }; 50926 50927 this.getbufferLength = function() { 50928 return this.flashObject.getbufferLength(); 50929 }; 50930 50931 this.getbackBufferLength = function() { 50932 return this.flashObject.getbackBufferLength(); 50933 }; 50934 50935 this.getLowBufferLength = function() { 50936 return this.flashObject.getlowBufferLength(); 50937 }; 50938 50939 this.getMinBufferLength = function() { 50940 return this.flashObject.getminBufferLength(); 50941 }; 50942 50943 this.getMaxBufferLength = function() { 50944 return this.flashObject.getmaxBufferLength(); 50945 }; 50946 50947 this.getLevels = function() { 50948 return this.flashObject.getLevels(); 50949 }; 50950 50951 this.getAutoLevel = function() { 50952 return this.flashObject.getAutoLevel(); 50953 }; 50954 50955 this.getCurrentLevel = function() { 50956 return this.flashObject.getCurrentLevel(); 50957 }; 50958 50959 this.getNextLevel = function() { 50960 return this.flashObject.getNextLevel(); 50961 }; 50962 50963 this.getLoadLevel = function() { 50964 return this.flashObject.getLoadLevel(); 50965 }; 50966 50967 this.getAudioTrackList = function() { 50968 return this.flashObject.getAudioTrackList(); 50969 }; 50970
50971 this.getStats = function() { 50972 return this.flashObject.getStats(); 50973 }; 50974 50975 this.setAudioTrack = function(trackId) { 50976 this.flashObject.playerSetAudioTrack(trackId); 50977 }; 50978 50979 this.playerSetLogDebug = function(state) { 50980 this.flashObject.playerSetLogDebug(state); 50981 }; 50982 50983 this.getLogDebug = function() { 50984 return this.flashObject.getLogDebug(); 50985 }; 50986 50987 this.playerSetLogDebug2 = function(state) { 50988 this.flashObject.playerSetLogDebug2(state); 50989 }; 50990 50991 this.getLogDebug2 = function() { 50992 return this.flashObject.getLogDebug2(); 50993 }; 50994 50995 this.playerSetUseHardwareVideoDecoder = function(state) { 50996 this.flashObject.playerSetUseHardwareVideoDecoder(state); 50997 }; 50998 50999 this.getUseHardwareVideoDecoder = function() { 51000 return this.flashObject.getUseHardwareVideoDecoder(); 51001 }; 51002 51003 this.playerSetflushLiveURLCache = function(state) { 51004 this.flashObject.playerSetflushLiveURLCache(state); 51005 }; 51006 51007 this.getflushLiveURLCache = function() { 51008 return this.flashObject.getflushLiveURLCache(); 51009 }; 51010 51011 this.playerSetJSURLStream = function(state) { 51012 this.flashObject.playerSetJSURLStream(state); 51013 }; 51014 51015 this.getJSURLStream = function() { 51016 return this.flashObject.getJSURLStream(); 51017 }; 51018 51019 this.playerCapLeveltoStage = function(state) { 51020 this.flashObject.playerCapLeveltoStage(state); 51021 }; 51022 51023 this.getCapLeveltoStage = function() { 51024 return this.flashObject.getCapLeveltoStage(); 51025 }; 51026 51027 this.playerSetAutoLevelCapping = function(level) { 51028 this.flashObject.playerSetAutoLevelCapping(level); 51029 }; 51030 51031 this.getAutoLevelCapping = function() { 51032 return this.flashObject.getAutoLevelCapping(); 51033 }; 51034 51035}; 51036 51037 51038(function () { 51039 this.L1VideoFlashPlayerHLS = function (videoInterface, videoElement, url) { 51040 51041 this.videoInterface = videoInterface; 51042 this.videoElement = videoElement; 51043 51044 //this.config = config; 51045 this.url = url; 51046 51047 //this.streamAccess = this.config.streamData; 51048 this.videoElementID = this.videoElement.id; 51049 51050 this.playing = false; 51051 this.volumeTemp = 100; 51052 51053 var random = 'flashplayer_' + Math.round(Math.random() * (100000 - 0)) + 0; 51054 var flashRandomContainer = document.createElement('div'); 51055 flashRandomContainer.id = random; 51056 this.videoElement.appendChild(flashRandomContainer); 51057 51058 this.swfobject = swfobject; 51059 51060 51061 var self = this; 51062 this.api = null; 51063 var flashvars = {}; 51064 flashvars.callback = "flashlsCallback" + random; 51065 var params = {wmode:"transparent", allowScriptAccess:"always", allowfullscreen:"true"}; 51066 var attributes = { name: 'laola1player' }; 51067 51068 //HLSSettings.startFromLevel = 0.0 51069 this.swfobject.embedSWF("//cdn.laola1.tv/player/dist/latest/flashlsChromeless.swf", random, "100%", "100%", "9.0.0", false, flashvars, params, attributes); 51070 //TESTING 51071 //this.swfobject.embedSWF("/assets/flashlsChromeless_debug.swf", random, "100%", "100%", "9.0.0", false, flashvars, params, attributes); 51072 51073 var name = "flashlsCallback" + random; 51074 window[name] = function(eventName, args) { 51075 flashlsEvent[eventName].apply(null, args); 51076 }; 51077 51078 var flashlsEvent = { 51079 ready: function(flashTime) { 51080 self.api = new flashlsAPI(self.swfobject.getObjectById(random)); 51081 self.api.load(self.url); 51082 //self.api.load('master_notworking.m3u8'); 51083 //self.api.load('master_working.m3u8'); 51084 51085 self.api.playerSetLogDebug(true); 51086 //self.api.playerSetLogDebug2(true); 51087 //self.api.playerSetUseHardwareVideoDecoder(false); 51088 51089 //self.api.setLoadLevel(1); 51090 //self.api.setCurrentLevel(1); 51091 }, 51092 error: function(code, url, message) { 51093 //console.log("FLASH: error", code, url, message); 51094 self.videoInterface.videoError(message); 51095 }, 51096 manifest: function(duration, levels, loadmetrics) { 51097 //console.log('mani', levels); 51098 //var levels2 = self.api.getLevels(); 51099 51100 self.videoInterface.videoCreateVideoIndexList(levels); 51101 51102 /* 51103 if (self.config.startTime > 0) { 51104 self.api.play(self.config.startTime); 51105 } else { 51106 self.api.play(-1); 51107 } 51108 */ 51109 51110 self.api.play(-1); 51111 self.api.playerSetflushLiveURLCache(true); 51112 51113 }, 51114 position: function(timemetrics) { 51115 self.videoInterface.videoProgress(timemetrics.position.toFixed(2), timemetrics.duration.toFixed(2)); 51116 }, 51117 state: function(newState) { 51118 //console.log("FLASH: state", newState); 51119 switch(newState) { 51120 case "PLAYING": 51121 self.playing = true; 51122 self.videoInterface.videoPlay(); 51123 51124 break; 51125 case "PAUSED": 51126 self.playing = false;
51127 self.videoInterface.videoPause(); 51128 break; 51129 default: 51130 } 51131 }, 51132 switch: function(newLevel) { 51133 //console.log('switch level', newLevel); 51134 self.videoInterface.videoSwitchVideoIndex(newLevel); 51135 self.videoInterface.checkVideoIndex(newLevel); 51136 } 51137 }; 51138 }; 51139 51140 L1VideoFlashPlayerHLS.prototype.playOrPause = function () { 51141 if(this.playing) { 51142 this.api.pause(); 51143 } else { 51144 this.api.resume(); 51145 } 51146 }; 51147 51148 L1VideoFlashPlayerHLS.prototype.play = function () { 51149 this.api.resume(); 51150 }; 51151 51152 L1VideoFlashPlayerHLS.prototype.pause = function () { 51153 this.api.pause(); 51154 }; 51155 51156 L1VideoFlashPlayerHLS.prototype.forward = function () { 51157 this.api.seek(this.api.getPosition() + 10); 51158 }; 51159 51160 L1VideoFlashPlayerHLS.prototype.rewind = function () { 51161 this.api.seek(this.api.getPosition() - 10); 51162 }; 51163 51164 L1VideoFlashPlayerHLS.prototype.seek = function (second) { 51165 this.api.seek(second); 51166 }; 51167 51168 L1VideoFlashPlayerHLS.prototype.seekTo = function (prozent) { 51169 this.api.seek((this.api.getDuration() / 100) * prozent); 51170 }; 51171 51172 L1VideoFlashPlayerHLS.prototype.setManualVideoIndex = function(newIndex) { 51173 this.api.setCurrentLevel(newIndex); 51174 }; 51175 51176 L1VideoFlashPlayerHLS.prototype.setVolume = function(prozent) { 51177 51178 if (prozent >= 0 && this.api) { 51179 this.volumeTemp = prozent; 51180 this.api.volume(prozent); 51181 } 51182 }; 51183 51184 L1VideoFlashPlayerHLS.prototype.getCurrentTime = function () { 51185 return this.api.getPosition(); 51186 }; 51187 51188 L1VideoFlashPlayerHLS.prototype.getDuration = function () { 51189 // return 100; 51190 if (this.api) { 51191 return this.api.getDuration(); 51192 } else { 51193 return 0; 51194 } 51195 }; 51196 51197 L1VideoFlashPlayerHLS.prototype.getVolume = function () { 51198 return this.volumeTemp; 51199 }; 51200 51201 L1VideoFlashPlayerHLS.prototype.getPaused = function () { 51202 if (this.playing) { 51203 return false; 51204 } else { 51205 return true; 51206 } 51207 }; 51208 51209 L1VideoFlashPlayerHLS.prototype.getPlayed = function () { 51210 if (this.playing) { 51211 return true; 51212 } else { 51213 return false; 51214 } 51215 }; 51216 51217}()); 51218(function () { 51219 this.L1VideoHtml5Player = function (videoInterface, videoElement, url, parameter) { 51220 51221 this.videoInterface = videoInterface; 51222 this.videoElement = videoElement; 51223 51224 this.url = url; 51225 this.hls = null; 51226 51227 var self = this; 51228 51229 //this.isMobile = parameter.isMobile; 51230 this.devices = parameter; 51231 51232 this.videoElement.onplay = function () { 51233 videoInterface.videoPlay(); 51234 }; 51235 this.videoElement.onpause = function () { 51236 videoInterface.videoPause(); 51237 }; 51238 this.videoElement.ontimeupdate = function (event) { 51239 videoInterface.videoProgress(event.target.currentTime, event.target.duration); 51240 }; 51241 this.videoElement.onprogress = function (event) { 51242 var range = 0; 51243 var bf = this.buffered; 51244 var time = this.currentTime; 51245 51246 for (i = 0; i<bf.length; i++) { 51247 if ((bf.start(i) <= time && time <= bf.end(i) )) { 51248 range = i; 51249 } 51250 } 51251 51252 try { 51253 var loadStartPercentage = (bf.start(range) / this.duration).toFixed(4)*100; 51254 var loadEndPercentage = (bf.end(range) / this.duration).toFixed(4)*100; 51255 var loadPercentage = (loadEndPercentage - loadStartPercentage).toFixed(4); 51256 51257 videoInterface.videoLoading(loadPercentage, loadStartPercentage); 51258 } 51259 catch(err) { 51260 //console.log("KEINE BUFFER AUSGABE"); 51261 } 51262 51263 }; 51264 this.videoElement.onended = function (event) { 51265 videoInterface.videoComplete(); 51266 }; 51267 this.videoElement.onerror = function (event) { //TO DO: auch ABORT, STALLED, SUSPEND 51268 videoInterface.videoError(); 51269 }; 51270 51271 this.videoElement.onloadedmetadata = function (event) { //TO DO: auch ABORT, STALLED, SUSPEND 51272 }; 51273 51274 this.videoElement.onloadeddata = function (event) { //TO DO: auch ABORT, STALLED, SUSPEND 51275 }; 51276 51277 this.videoElement.onvolumechange = function() { 51278 }; 51279 51280 this.generateHTML5Player(); 51281 }; 51282 51283 L1VideoHtml5Player.prototype.generateHTML5Player = function () { 51284 51285 //console.log("generateHTML5Player", this); 51286 51287 var self = this; 51288 51289 if (Hls.isSupported()) { 51290 51291 //console.log("Hls isSupported", this); 51292 51293 var config = { 51294 //debug: true, 51295 //startLevel: 3, 51296 nudgeMaxRetry: 2 //Max nb of nudge retries before hls.js raise a fatal BUFFER_STALLED_ERROR 51297 //liveSyncDurationCount: 10 51298 }; 51299 51300 /* 51301 if (this.config.startTime > 0) { 51302 config.startPosition = this.config.startTime; 51303 } 51304 */ 51305 51306 this.hls = new Hls(config); 51307 this.lastQuality = null; 51308 //console.log('new hls',this.hls, this.videoElement); 51309 //this.hls.loadSource("http://dev-media.spalk.co:9191/master/maat/bunnyPlaylist.m3u8"); 51310 51311 this.hls.loadSource(this.url); 51312 //this.hls.loadSource('http://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/master.m3u8'); 51313 51314 this.hls.attachMedia(this.videoElement); 51315
51316 this.hls.on(Hls.Events.MEDIA_ATTACHED, function (event, data) { 51317 //console.log("MEDIA_ATTACHED", event, data); 51318 //self.hls.loadSource(self.url); 51319 }); 51320 51321 this.hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { 51322 //console.log("MANIFEST_PARSED", event, data ); 51323 //self.lastQuality = data.levels.length - 1; 51324 self.lastQuality = 3; 51325 51326 self.videoInterface.videoCreateVideoIndexList(data.levels); 51327 self.videoInterface.videoSwitchVideoIndex(self.lastQuality); //self.hls.startLevel 51328 }); 51329 51330 this.hls.on(Hls.Events.MANIFEST_LOADED, function (event, data) { 51331 //console.log('manifest loaded', event, data); 51332 //self.videoInterface.setManualVideoIndex(self.lastQuality); 51333 self.hls.startLevel = self.lastQuality; 51334 self.play(); 51335 //self.videoElement.play(); 51336 }); 51337 51338 this.hls.on(Hls.Events.FRAG_PARSING_METADATA, function (name, data) { 51339 console.log('FRAG_PARSING_METADATA'); 51340 var testArray = data.samples["0"].data; 51341 var str = String.fromCharCode.apply(null, testArray); 51342 //console.log('Trigger ausgabe:',str); 51343 51344 console.log('id3 :', str); 51345 51346 var currentTime = Number(self.getCurrentTime()); 51347 var startTrigger = Number(data.frag.start); 51348 var bufferTrigger = startTrigger.toFixed(0) - currentTime.toFixed(0); 51349 bufferTrigger = bufferTrigger * 1000; 51350 51351 checkVideoTrigger(str, "midroll", bufferTrigger); 51352 checkVideoTrigger(str, "insel", bufferTrigger); 51353 checkVideoTrigger(str, "overlay", bufferTrigger); 51354 checkVideoTrigger(str, "split", bufferTrigger); 51355 51356 /* 51357 if (str.indexOf("insel") > 0) { 51358 self.videoInterface.videoTrigger("insel"); 51359 } 51360 51361 if (str.indexOf("midroll") > 0) { 51362 self.videoInterface.videoTrigger("midroll"); 51363 } 51364 51365 if (str.indexOf("overlay") > 0) { 51366 self.videoInterface.videoTrigger("overlay"); 51367 } 51368 */ 51369 }); 51370 51371 function checkVideoTrigger(element, name, time) { 51372 setTimeout(function() { 51373 if (element.indexOf(name) > 0) { 51374 self.videoInterface.videoTrigger(name); 51375 } 51376 }, time); 51377 51378 } 51379 51380 this.hls.on(Hls.Events.LEVEL_UPDATED, function (event, data) { 51381 var isLive = data.details.live; 51382 var hdVideo = self.videoInterface.subPlayer.getHdVideo(); 51383 51384 //console.log('LEVEL_UPDATED', isLive, hdVideo.isLive, hdVideo.isLivestream); 51385 51386 if(isLive === false && hdVideo.isLivestream === true) { 51387 self.hls.destroy(); 51388 self.videoInterface.videoComplete(); 51389 } 51390 51391 }); 51392 51393 this.hls.on(Hls.Events.LEVEL_SWITCH, function (name, newLevel) { 51394 //console.log("self.hls.levels: ", self.hls.levels); 51395 //console.log("self.hls.levels: ", name, newLevel); 51396 if (self.hls.levels[self.hls.loadLevel]) { 51397 //console.log("SWITCH2.0: ", self.hls.levels[self.hls.loadLevel].bitrate); 51398 } 51399 //self.videoInterface.checkVideoIndex(newLevel.level); 51400 //console.log("SWITCH2: ", data.levels[data.firstLevel].bitrate); 51401 self.videoInterface.videoSwitchVideoIndex(newLevel.level, self.hls.levels[self.hls.loadLevel].bitrate); 51402 }); 51403 /* 51404 this.hls.on(Hls.Events.FRAG_CHANGED , function (event, data) { 51405 var currentTime = self.getCurrentTime(); 51406 var duration = self.getDuration(); 51407 var buffer = duration - 120; 51408 //console.log('FRAG_CHANGED: ', self.videoInterface.subPlayer.videoConfig.streamAccess.status, currentTime, buffer); 51409 51410 if(self.videoInterface.subPlayer.videoConfig.streamAccess.status === "error" && currentTime < buffer) { 51411 //console.log('------------------------Seek to Live-------------------------'); 51412 self.seekTo(self.hls.liveSyncPosition); 51413 } 51414 51415 }); 51416 */ 51417 51418 this.hls.on(Hls.Events.ERROR, function (event, data) { 51419 var errorType = data.type; 51420 var errorDetails = data.details; 51421 var errorFatal = data.fatal; 51422 //console.log('hls error', errorType, errorDetails); 51423 51424 switch(errorDetails) { 51425 //Firefox VOD FIX 51426 case Hls.ErrorDetails.BUFFER_APPENDING_ERROR: 51427 self.hls.recoverMediaError(); 51428 break; 51429 case Hls.ErrorDetails.MANIFEST_LOAD_ERROR: 51430 self.hls.destroy(); 51431 self.videoInterface.videoError(errorDetails); 51432 break; 51433 case Hls.ErrorDetails.LEVEL_SWITCH_ERROR: 51434 //console.log('LEVEL_SWITCH_ERROR', data); 51435 break; 51436 case Hls.ErrorDetails.FRAG_LOOP_LOADING_ERROR : 51437 //console.log('FRAG_LOOP_LOADING_ERROR ', data); 51438 break; 51439 case Hls.ErrorDetails.LEVEL_LOAD_ERROR: 51440 //console.log('LEVEL_LOAD_ERROR', data); 51441 51442 } 51443 51444 if (errorFatal) { 51445 //self.videoInterface.videoError(errorDetails); 51446 switch(data.type) {
51447 case Hls.ErrorTypes.NETWORK_ERROR: 51448 // try to recover network error 51449 self.hls.startLoad(); 51450 break; 51451 case Hls.ErrorTypes.MEDIA_ERROR: 51452 self.hls.recoverMediaError(); 51453 self.play(); 51454 break; 51455 default: 51456 // cannot recover 51457 self.hls.destroy(); 51458 self.videoInterface.videoError(errorDetails); 51459 break; 51460 } 51461 } 51462 }); 51463 51464 } else { 51465 51466 //console.log("generate HLS NATIV Player", this.url); 51467 51468 //this.videoElement.src = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'; 51469 this.videoElement.src = this.url; 51470 this.videoElement.play(); 51471 this.videoElement.controls = true; 51472 } 51473 51474 }; 51475 51476 51477 L1VideoHtml5Player.prototype.playOrPause = function () { 51478 if (this.videoElement.paused) { 51479 this.videoElement.play(); 51480 } else { 51481 this.videoElement.pause(); 51482 } 51483 }; 51484 51485 L1VideoHtml5Player.prototype.play = function () { 51486 this.videoElement.play(); 51487 }; 51488 51489 L1VideoHtml5Player.prototype.pause = function () { 51490 this.videoElement.pause(); 51491 }; 51492 51493 L1VideoHtml5Player.prototype.forward = function (sec) { 51494 if (!sec) {sec = 10;} 51495 this.videoElement.currentTime += sec; 51496 }; 51497 51498 L1VideoHtml5Player.prototype.rewind = function (sec) { 51499 if (!sec) {sec = 10;} 51500 this.videoElement.currentTime -= sec; 51501 }; 51502 51503 L1VideoHtml5Player.prototype.seek = function (second) { 51504 this.videoElement.currentTime = second; 51505 }; 51506 51507 L1VideoHtml5Player.prototype.seekTo = function (prozent, isLive) { 51508 if(isLive) { 51509 //LIVESTREAM 51510 if(this.videoElement.duration > 600 ) { 51511 var bufferStart = this.videoElement.duration - 600; 51512 this.videoElement.currentTime = bufferStart + ((600 / 100) * prozent); 51513 } else { 51514 this.videoElement.currentTime = (this.videoElement.duration / 100) * prozent; 51515 } 51516 } else { 51517 this.videoElement.currentTime = (this.videoElement.duration / 100) * prozent; 51518 } 51519 }; 51520 51521 L1VideoHtml5Player.prototype.setManualVideoIndex = function(newIndex) { 51522 this.hls.currentLevel = newIndex; 51523 }; 51524 51525 L1VideoHtml5Player.prototype.setVolume = function(prozent) { 51526 if (prozent >= 0) { 51527 this.videoElement.volume = prozent / 100; 51528 } 51529 }; 51530 51531 L1VideoHtml5Player.prototype.destroy = function () { 51532 if(this.hls) { 51533 this.hls.destroy(); 51534 } else { 51535 this.videoElement.src = ''; 51536 this.videoElement.load(); 51537 } 51538 }; 51539 51540 L1VideoHtml5Player.prototype.closeStream = function (id) { 51541 this.hls.detachMedia(); 51542 }; 51543 51544 // GET 51545 51546 L1VideoHtml5Player.prototype.getCurrentLevel = function () { 51547 return this.hls.currentLevel; 51548 }; 51549 51550 L1VideoHtml5Player.prototype.getCurrentTime = function () { 51551 return this.videoElement.currentTime; 51552 }; 51553 51554 L1VideoHtml5Player.prototype.getDuration = function () { 51555 return this.videoElement.duration; 51556 }; 51557 51558 L1VideoHtml5Player.prototype.getVolume = function () { 51559 return this.videoElement.volume; 51560 }; 51561 51562 L1VideoHtml5Player.prototype.getPaused = function () { 51563 if (this.videoElement.paused) { 51564 return true; 51565 } else { 51566 return false; 51567 } 51568 }; 51569 51570 L1VideoHtml5Player.prototype.getPlayed = function () { 51571 if (this.videoElement.paused) { 51572 return false; 51573 } else { 51574 return true; 51575 } 51576 }; 51577 51578 51579 51580}()); 51581(function () { 51582 this.L1VideoHtml5PlayerDash = function (videoInterface, videoElement, url) { 51583 51584 this.videoInterface = videoInterface; 51585 this.videoElement = videoElement; 51586 this.url = url; 51587 51588 this.dash = null; 51589 51590 this.videoElement.onplay = function () { 51591 videoInterface.videoPlay(); 51592 }; 51593 this.videoElement.onpause = function () { 51594 videoInterface.videoPause(); 51595 }; 51596 this.videoElement.ontimeupdate = function (event) { 51597 videoInterface.videoProgress(event.target.currentTime, event.target.duration); 51598 }; 51599 this.videoElement.onprogress = function (event) { 51600 var range = 0; 51601 var bf = this.buffered; 51602 var time = this.currentTime; 51603 51604 for (i = 0; i<bf.length; i++) { 51605 if ((bf.start(i) <= time && time <= bf.end(i) )) { 51606 range = i; 51607 } 51608 } 51609 51610 var loadStartPercentage = (bf.start(range) / this.duration).toFixed(4)*100; 51611 var loadEndPercentage = (bf.end(range) / this.duration).toFixed(4)*100; 51612 var loadPercentage = (loadEndPercentage - loadStartPercentage).toFixed(4); 51613 51614 videoInterface.videoLoading(loadPercentage, loadStartPercentage); 51615 51616 51617 }; 51618 this.videoElement.onended = function (event) { 51619 //videoInterface.videoComplete(); 51620 }; 51621 this.videoElement.onerror = function (event) { //TO DO: auch ABORT, STALLED, SUSPEND 51622 videoInterface.videoError(); 51623 }; 51624 51625 this.videoElement.onvolumechange = function() { 51626 }; 51627 51628 this.generateHTML5Player(); 51629 }; 51630 51631 L1VideoHtml5PlayerDash.prototype.generateHTML5Player = function () { 51632 51633 var self = this; 51634 //var url = "http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifsest.mpd"; 51635 51636 this.dash = dashjs.MediaPlayer().create(); 51637 this.dash.initialize(this.videoElement, this.url, true); 51638 this.dash.setFastSwitchEnabled(true); 51639 51640 this.dash.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, function(event) { 51641 //console.log('STREAM_INITIALIZED', event); 51642 51643 /* 51644 var bitrate = self.dash.getBitrateInfoListFor('video'); 51645 var currentBitrate = self.dash.getQualityFor('video'); 51646 51647 self.videoInterface.videoCreateVideoIndexList(bitrate); 51648 self.videoInterface.videoSwitchVideoIndex(currentBitrate); 51649 51650 $('#l1pUIPopUpsSettingsListAuto').on('click', function() { 51651 self.dash.setAutoSwitchQuality(true); 51652 });*/ 51653 51654 }, {}); 51655 51656 this.dash.on(dashjs.MediaPlayer.events.CAN_PLAY, function(event) { 51657 //console.log('CAN_PLAY', event); 51658 51659 var bitrate = self.dash.getBitrateInfoListFor('video'); 51660 var currentBitrate = self.dash.getQualityFor('video'); 51661 51662 self.videoInterface.videoCreateVideoIndexList(bitrate); 51663 self.videoInterface.videoSwitchVideoIndex(currentBitrate); 51664 51665 $('#l1pUIPopUpsSettingsListAuto').on('click', function() { 51666 self.dash.setAutoSwitchQuality(true); 51667 }); 51668 51669 }, {}); 51670 51671 this.dash.on(dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED, function(event) { 51672 //console.log('QUALITY_CHANGE_REQUESTED', event.newQuality);
51673 self.videoInterface.videoSwitchVideoIndex(event.newQuality); 51674 }, {}); 51675 51676 this.dash.on(dashjs.MediaPlayer.events.ERROR, function(event) { 51677 //console.log('ERROR', event); 51678 self.dash.reset(); 51679 self.videoInterface.videoError(event.error); 51680 }, {}); 51681 51682 }; 51683 51684 L1VideoHtml5PlayerDash.prototype.playOrPause = function () { 51685 if (this.videoElement.paused) { 51686 this.videoElement.play(); 51687 } else { 51688 this.videoElement.pause(); 51689 } 51690 }; 51691 51692 L1VideoHtml5PlayerDash.prototype.play = function () { 51693 this.videoElement.play(); 51694 }; 51695 51696 L1VideoHtml5PlayerDash.prototype.pause = function () { 51697 this.videoElement.pause(); 51698 }; 51699 51700 L1VideoHtml5PlayerDash.prototype.forward = function (sec) { 51701 if (!sec) {sec = 10;} 51702 this.videoElement.currentTime += sec; 51703 }; 51704 51705 L1VideoHtml5PlayerDash.prototype.rewind = function (sec) { 51706 if (!sec) {sec = 10;} 51707 this.videoElement.currentTime -= sec; 51708 //this.dash.seek(sec); 51709 }; 51710 51711 L1VideoHtml5PlayerDash.prototype.seek = function (sec) { 51712 this.videoElement.currentTime = sec; 51713 //this.dash.seek(second); 51714 }; 51715 51716 L1VideoHtml5PlayerDash.prototype.seekTo = function (prozent) { 51717 this.videoElement.currentTime = (this.videoElement.duration / 100) * prozent; 51718 }; 51719 51720 L1VideoHtml5PlayerDash.prototype.setManualVideoIndex = function(newIndex) { 51721 this.dash.setAutoSwitchQuality(false); 51722 this.dash.setQualityFor('video', newIndex); 51723 }; 51724 51725 L1VideoHtml5PlayerDash.prototype.setVolume = function(prozent) { 51726 if (prozent) { 51727 this.videoElement.volume = prozent / 100; 51728 } 51729 }; 51730 51731 // GET 51732 51733 L1VideoHtml5PlayerDash.prototype.getCurrentTime = function () { 51734 return this.videoElement.currentTime; 51735 }; 51736 51737 L1VideoHtml5PlayerDash.prototype.getDuration = function () { 51738 //return this.videoElement.duration; 51739 return this.dash.duration(); 51740 }; 51741 51742 L1VideoHtml5PlayerDash.prototype.getVolume = function () { 51743 return this.videoElement.volume; 51744 }; 51745 51746 L1VideoHtml5PlayerDash.prototype.getPaused = function () { 51747 return this.videoElement.paused; 51748 }; 51749 51750 L1VideoHtml5PlayerDash.prototype.getPlayed = function () { 51751 if (this.videoElement.paused) { 51752 return false; 51753 } else { 51754 return true; 51755 } 51756 }; 51757 51758 51759 51760}()); 51761(function () { 51762 /** 51763 * Proxy auf den aktuellen Video player. 51764 * Entscheidet welcher Videoplayer (HTML5 / FLASH). 51765 */ 51766 this.L1VideoInterface = function (subPlayer) { 51767 this.subPlayer = subPlayer; 51768 this.actualPlayer = null; 51769 this.volume = 100; 51770 51771 this.adIntervalTimer = null; 51772 this.advTimer = 0; 51773 }; 51774 51775 L1VideoInterface.prototype.generatePlayer = function (url, element, configDevice) { 51776 51777 //var url = playerMain.config.streamData.url; 51778 51779 //console.log("GENERATE PLAYER: ", url, element, configDevice); 51780 51781 function addSWF() { 51782 var script = document.createElement('script'); 51783 script.type = "text/javascript"; 51784 script.src = "//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"; 51785 return document.getElementsByTagName('head')[0].appendChild(script); 51786 } 51787 51788 var videotype = ""; 51789 var self = this; 51790 51791 if (url) { 51792 51793 if (url.indexOf(".m3u8") > 0) { 51794 videotype = "hls"; 51795 51796 if(configDevice.isIE) { 51797 51798 addSWF(); 51799 setTimeout(function() { 51800 self.actualPlayer = new L1VideoFlashPlayerHLS(self, element.querySelector("#l1pVideoFlashContainer"), url); 51801 }, 1000); 51802 51803 } else { 51804 // this.actualPlayer = new L1VideoHtml5Player(this, element.querySelector("#l1pVideoHtml5Element"), url, {isMobile: configDevice.isMobile}); 51805 this.actualPlayer = new L1VideoHtml5Player(this, element.querySelector("#l1pVideoHtml5Element"), url, configDevice); 51806 } 51807 } 51808 else if (url.indexOf(".f4m") > 0) { 51809 videotype = "hds"; 51810 51811 addSWF(); 51812 setTimeout(function() { 51813 self.actualPlayer = new L1VideoFlashPlayer(self, element.querySelector("#l1pVideoFlashContainer"), url); 51814 }, 1000); 51815 //this.actualPlayer = new L1VideoFlashPlayer(this, element.querySelector("#l1pVideoFlashContainer"), url); 51816 } 51817 else if (url.indexOf("rtmp://") > 0 || url.indexOf("rtmps://") > 0 || url.indexOf("rtmpt://") > 0 ) { 51818 videotype = "rtmp"; 51819 } 51820 else if (url.indexOf(".mp4") > 0) { 51821 videotype = "mp4"; 51822 } 51823 else if (url.indexOf(".flv") > 0) { 51824 videotype = "flv"; 51825 } 51826 else if (url.indexOf(".mpd") > 0) { 51827 videotype = "dash"; 51828 this.actualPlayer = new L1VideoHtml5PlayerDash(this, element.querySelector("#l1pVideoHtml5Element"), url); 51829 } 51830 else { 51831 videotype = ""; 51832 } 51833 51834 if (videotype) { 51835 if (this.actualPlayer) { 51836 this.actualPlayer.setVolume(this.volume); 51837 } 51838 } else { 51839 this.subPlayer.videoError("no video format"); 51840 } 51841 51842 } else { 51843 this.subPlayer.videoError("no video url"); 51844 } 51845 51846 /* 51847 function generateActualPlayer(type, self) { 51848 51849 switch(type) { 51850 case "hls": 51851 if (Hls.isSupported()) { 51852 51853 //self.actualPlayer = new L1VideoHtml5Player(self, $(self.player.l1Player).find("#l1pVideoHtml5Element"), self.player.config); 51854 51855 self.actualPlayer = new L1VideoHtml5Player(self, self.player.l1Player.querySelector("#l1pVideo0").querySelector("#l1pVideoHtml5Element"), self.config); 51856 //self.actualPlayer = new L1VideoHtml5Player(self, self.player.l1Player.querySelector("#l1pVideo1").querySelector("#l1pVideoHtml5Element"), self.player.config); 51857 //self.actualPlayer = new L1VideoHtml5Player(self, self.player.l1Player.querySelector("#l1pVideo2").querySelector("#l1pVideoHtml5Element"), self.player.config); 51858 //self.actualPlayer = new L1VideoHtml5Player(self, self.player.l1Player.querySelector("#l1pVideo3").querySelector("#l1pVideoHtml5Element"), self.player.config); 51859 51860 51861 } 51862 else if(swfobject.getFlashPlayerVersion().major > 9) 51863 { 51864 self.actualPlayer = new L1VideoFlashPlayer(self, self.player.l1Player.querySelector("#l1pVideoFlashContainer"), self.config); 51865 } else { 51866 self.actualPlayer = new L1VideoHtml5Player(self, self.player.l1Player.querySelector("#l1pVideoHtml5Element"), self.config); 51867 } 51868 break; 51869 case "hds": 51870 51871 break; 51872 case "rtmp": 51873 51874 break; 51875 case "mp4": 51876 51877 break; 51878 case "flv": 51879 51880 break; 51881 case "dash": 51882 self.actualPlayer = new L1VideoHtml5PlayerDash(self, self.player.l1Player.querySelector("#l1pVideoHtml5Element"), self.config); 51883 break; 51884 default: 51885 51886 } 51887 51888 self.actualPlayer.setVolume(this.volume); 51889 } 51890 */ 51891 51892 51893 51894 /* 51895 if (Hls.isSupported()) { 51896 this.actualPlayer = new L1VideoHtml5Player(this, this.subPlayer.l1Player.querySelector("#l1pVideoHtml5Element"), this.subPlayer.config); 51897 } 51898 else if(swfobject.getFlashPlayerVersion().major > 9) 51899 { 51900 this.actualPlayer = new L1VideoFlashPlayer(this, this.subPlayer.l1Player.querySelector("#l1pVideoFlashContainer"), this.subPlayer.config); 51901 } else { 51902 this.actualPlayer = new L1VideoHtml5Player(this, this.subPlayer.l1Player.querySelector("#l1pVideoHtml5Element"), this.subPlayer.config); 51903 } 51904 */ 51905 51906 //this.actualPlayer = new L1VideoHtml5PlayerDash(this, this.subPlayer.l1Player.querySelector("#l1pVideoHtml5Element"), this.subPlayer.config); 51907 51908 }; 51909 51910 // SET 51911 51912 L1VideoInterface.prototype.playOrPause = function () { 51913 if (this.actualPlayer) { 51914 this.actualPlayer.playOrPause(); 51915 } 51916 }; 51917 51918 L1VideoInterface.prototype.play = function () { 51919 if (this.actualPlayer) { 51920 this.actualPlayer.play(); 51921 } 51922 }; 51923 51924 L1VideoInterface.prototype.pause = function () { 51925 if (this.actualPlayer) { 51926 this.actualPlayer.pause(); 51927 } 51928 }; 51929 51930 L1VideoInterface.prototype.forward = function (sec) { 51931 if (this.actualPlayer) { 51932 this.actualPlayer.forward(sec); 51933 } 51934 }; 51935 51936 L1VideoInterface.prototype.rewind = function (sec) { 51937 if (this.actualPlayer) { 51938 this.actualPlayer.rewind(sec); 51939 } 51940 }; 51941 51942 L1VideoInterface.prototype.seek = function (second) { 51943 if (this.actualPlayer) { 51944 this.actualPlayer.seek(second); 51945 } 51946 }; 51947 51948 L1VideoInterface.prototype.seekTo = function (prozent, isLive) { 51949 if (this.actualPlayer) { 51950 this.actualPlayer.seekTo(prozent, isLive); 51951 } 51952 }; 51953 51954 L1VideoInterface.prototype.setManualVideoIndex = function(newIndex) { 51955 if (this.actualPlayer) { 51956 this.actualPlayer.setManualVideoIndex(newIndex); 51957 } 51958 }; 51959 51960 L1VideoInterface.prototype.setVolume = function (prozent) { 51961 this.volume = prozent; 51962 51963 if (this.actualPlayer) { 51964 this.actualPlayer.setVolume(prozent); 51965 } 51966 }; 51967 51968 L1VideoInterface.prototype.destroy = function () { 51969 this.subPlayer.player.api.fullscreenExit(); 51970 51971 if (this.actualPlayer) { 51972 this.actualPlayer.destroy(); 51973 } 51974 }; 51975 51976 L1VideoInterface.prototype.closeStream = function (id) { 51977 if (this.actualPlayer) { 51978 this.actualPlayer.closeStream(id); 51979 } 51980 }; 51981 51982 // GET 51983 51984 L1VideoInterface.prototype.getCurrentTime = function () { 51985 if (this.actualPlayer) { 51986 return Number( this.actualPlayer.getCurrentTime().toFixed(0) ); 51987 } 51988 }; 51989 51990 L1VideoInterface.prototype.getDuration = function () { 51991 if (this.actualPlayer) { 51992 return Number( this.actualPlayer.getDuration().toFixed(0) ); 51993 } 51994 }; 51995 51996 L1VideoInterface.prototype.getVolume = function () { 51997 if (this.actualPlayer) { 51998 return Number( (this.actualPlayer.getVolume() * 100).toFixed(0) ); 51999 } 52000 }; 52001 52002 L1VideoInterface.prototype.getPaused = function () { 52003 if (this.actualPlayer) { 52004 return this.actualPlayer.getPaused(); 52005 } 52006 }; 52007 52008 L1VideoInterface.prototype.getPlayed = function () { 52009 if (this.actualPlayer) { 52010 return this.actualPlayer.getPlayed(); 52011 } 52012 }; 52013 52014 L1VideoInterface.prototype.getCurrentLevel = function () { 52015 if (this.actualPlayer) { 52016 return this.actualPlayer.getCurrentLevel(); 52017 } 52018 }; 52019 52020 L1VideoInterface.prototype.getAdvertTimer = function () { 52021 return this.advTimer; 52022 }; 52023 52024 52025 // VIDEO (HLS, FLASH) 52026 L1VideoInterface.prototype.videoProgress = function (currentTime, duration) { 52027 this.subPlayer.videoProgress(currentTime, duration); 52028 }; 52029 52030 L1VideoInterface.prototype.videoLoading = function (percent, loadStartPercentage) { 52031 this.subPlayer.videoLoading(percent, loadStartPercentage); 52032 }; 52033 52034 L1VideoInterface.prototype.videoPlay = function () { 52035 this.subPlayer.videoPlay(); 52036 52037 this.setAdvTimer(); 52038 }; 52039 52040 L1VideoInterface.prototype.videoPause = function () { 52041 this.subPlayer.videoPause(); 52042 52043 this.clearAdvTimer(); 52044 }; 52045 52046 L1VideoInterface.prototype.videoComplete = function () { 52047 this.subPlayer.videoComplete(); 52048 52049 this.clearAdvTimer(); 52050 this.resetAdvTimer(); 52051 }; 52052 52053 L1VideoInterface.prototype.videoError = function (error) { 52054 this.subPlayer.videoError(error); 52055 52056 this.clearAdvTimer(); 52057 }; 52058 52059 L1VideoInterface.prototype.videoCreateVideoIndexList = function (data) { 52060 this.subPlayer.videoCreateVideoIndexList(data); 52061 }; 52062 52063 L1VideoInterface.prototype.videoSwitchVideoIndex = function (newIndex, newBitrate) { 52064 this.subPlayer.videoSwitchVideoIndex(newIndex, newBitrate); 52065 this.subPlayer.checkVideoIndex(newIndex); 52066 }; 52067 52068 L1VideoInterface.prototype.videoTrigger = function (trigger) { 52069 this.subPlayer.videoTrigger(trigger); 52070 }; 52071 /* 52072 L1VideoInterface.prototype.checkVideoIndex = function (newIndex) { 52073 this.subPlayer.checkVideoIndex(newIndex); 52074 }; 52075*/ 52076 52077 L1VideoInterface.prototype.setAdvTimer = function () { 52078 var self = this; 52079 this.adIntervalTimer = setInterval(function() { 52080 //console.log('timer', self.advTimer); 52081 self.advTimer++; 52082 }, 1000); 52083 }; 52084 52085 L1VideoInterface.prototype.clearAdvTimer = function () { 52086 clearInterval(this.adIntervalTimer); 52087 }; 52088 52089 L1VideoInterface.prototype.resetAdvTimer = function () { 52090 this.advTimer = 0; 52091 }; 52092 52093}()); 52094 52095;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/Video/Fe/js/videoPlayerLoader.js 52096var VideoPlayerLoader = { 52097 init: function() { 52098 $('.videoPlayerLoader').each(function(){ 52099 VideoPlayerLoader.loadVideo($(this)); 52100 }); 52101 }, 52102 loadVideo: function(videoPlayerDom) { 52103 var videoId = videoPlayerDom.data('video'); 52104 var ajaxUrl = videoPlayerDom.data('ajaxurl'); 52105 var width = videoPlayerDom.data('width'); 52106 var height = videoPlayerDom.data('height'); 52107 var loadTemplates = videoPlayerDom.data('load-templates') 52108 52109 if($.isNumeric(videoId) && ajaxUrl.length) { 52110 $.ajax({ 52111 url: ajaxUrl, 52112 type: 'POST', 52113 data: { videoId: videoId, width: width, height: height, loadTemplates: loadTemplates }, 52114 dataType: 'json', 52115 success: function(data, status) { 52116 if(data.success == true) { 52117 videoPlayerDom.html(data.html); 52118 } 52119 } 52120 }); 52121 } 52122 } 52123} 52124 52125var VideoPrioList = { 52126 init: function() { 52127 $('.videoPrioListOneVisible').each(function() { 52128 var videoPrioListOneVisible = this; 52129 $(videoPrioListOneVisible).on('click', '.videoSwitcher', function() { 52130 var newVideoId = $(this).data('video'); 52131 if($.isNumeric(newVideoId)) { 52132 var videoPlayerDom = $(videoPrioListOneVisible).find('.videoPlayerLoader'); 52133 var oldVideoId = videoPlayerDom.data('video'); 52134 if(oldVideoId !== newVideoId) { 52135 videoPlayerDom.data('video', newVideoId);
52136 VideoPlayerLoader.loadVideo(videoPlayerDom); 52137 } 52138 } 52139 }); 52140 }); 52141 } 52142} 52143 52144$(document).ready(function(){ 52145 VideoPrioList.init(); 52146}); 52147;// /var/www/www.vfb.de/httpdocs/current/static/js/videoPlayerLoaderVfB.js 52148var VideoPlayerLoaderVfB = { 52149 init: function() { 52150 $(document).on('click', '.videoplayerNoAccess', function() { 52151 var videoplayerImage = $(this).find('img.videplayerImage'); 52152 if(typeof videoplayerImage.attr('data-url') !== 'undefined') { 52153 window.location.href = videoplayerImage.attr('data-url'); 52154 } else { 52155 var code = $(this).data('code'); 52156 if(code === 512 || code === 514) { 52157 var videoplayerImageIcon = $(this).find('.vfbtv'); 52158 52159 videoplayerImage.attr('src', $(videoplayerImage).attr('data-code-'+code)); 52160 videoplayerImageIcon.remove(); 52161 videoplayerImage.attr('data-url', $(videoplayerImage).attr('data-url-'+code)) 52162 } else { 52163 alert('Es ist ein Fehler aufgetreten'); 52164 } 52165 } 52166 }); 52167 } 52168}; 52169 52170$(document).ready(function() { 52171 VideoPlayerLoaderVfB.init(); 52172}); 52173 52174var VideoPrioListVfB = { 52175 init: function() { 52176 $('.videoPrioListOneVisible .videoSwitcher:first td:first').addClass('highlight'); 52177 $('.videoPrioListOneVisible').each(function() { 52178 var videoPrioListDom = $(this); 52179 videoPrioListDom.on('click', '.videoSwitcher', function() { 52180 videoPrioListDom.find('.videoSwitcher td').removeClass('highlight'); 52181 $(this).find('td').addClass('highlight'); 52182 }); 52183 }); 52184 } 52185} 52186 52187$(document).ready(function(){ 52188 VideoPrioListVfB.init(); 52189}); 52190;// /var/www/www.vfb.de/httpdocs/current/static/js/VfBAdition.js 52191var adition = {}; 52192 52193$(document).ready(function () { 52194 52195 // Setup callback queue 52196 adition = adition || {}; 52197 adition.srq = adition.srq || []; 52198 52199 // Load external js 52200 loadExternalJs(); 52201 52202 // push ads into que 52203 adition.srq.push(function (api) { 52204 adition.api = api; 52205 52206 // get screenWidth 52207 var screenWidth = getScreenWidth(); 52208 52209 // set screenWidth 52210 // set device or profile ( destkop > 1024 | tablet = 1024 | mobile < 1024) 52211 var profile = getProfile(screenWidth); 52212 52213 api.registerAdfarm("ad1.adfarm1.adition.com") 52214 .setProfile("screenwidth", '' + screenWidth) 52215 .setProfile("device", profile); 52216 52217 // push ad into que 52218 if (typeof(aditionJson) !== 'undefined') { 52219 52220 for (var zoneName in aditionJson) { 52221 52222 // #96687 // #96691 52223 // skip Skyscraper if Profile is Mobile! 52224 // skip Skyscraper if screenWidth is less than 1840 52225 // skip Pres_CAD if screenWidth is 831 52226 if ( 52227 (profile === 'mobile' && zoneName === 'skyscraper') || 52228 (zoneName === 'skyscraper' && screenWidth < 1840) || 52229 (zoneName === 'pres_cad' && screenWidth < 831) 52230 ) { 52231 continue; 52232 } 52233 52234 // #96694 && #96691 52235 // just send ad Request if add is in HTML-DOM 52236 var $adElement = $(document).find('.ad-container#' + zoneName); 52237 52238 // is adElementExisting on page OR is forceCAD set and Zone is MedRect2 (contel 16.html) 52239 if (typeof($adElement) != 'undefined' && $adElement.length || (zoneName === 'medium_rectangle_2' && typeof(force_cad_for_teaserLoader) != 'undefined')) { 52240 api.configureRenderSlot(zoneName).setContentunitId(parseInt(aditionJson[zoneName])); 52241 } 52242 } 52243 } 52244 52245 var os = new OnScreen({ 52246 tolerance: 0, 52247 debounce: 100, 52248 container: window 52249 }); 52250 52251 os.on('enter', '.ad-container', function (elem) { 52252 if (!$(elem).hasClass('loaded')) { 52253 api.renderSlot($(elem).attr('id')); 52254 $(elem).addClass('loaded'); 52255 } 52256 }); 52257 52258 api.load().completeRendering(); 52259 }); 52260}); 52261 52262 52263var loadExternalJs = function () { 52264 var script = document.createElement("script"); 52265 script.type = "text/javascript"; 52266 script.src = (document.location.protocol === "https:" ? 52267 "https:" : "http:") + "//imagesrv.adition.com/js/srp.js"; 52268 script.charset = "utf-8"; 52269 script.async = true; 52270 var firstScript = document.getElementsByTagName("script")[0]; 52271 firstScript.parentNode.insertBefore(script, firstScript); 52272}; 52273 52274var getScreenWidth = function () { 52275 return window.top.innerWidth || window.top.document.documentElement.clientWidth || window.top.document.body.clientWidth; 52276}; 52277 52278var getProfile = function (screenWidth) { 52279 return (screenWidth < 1024 ? "mobile" : (screenWidth == 1024 ? "tablet" : "desktop")) 52280} 52281;// /var/www/www.vfb.de/httpdocs/current/static/js/formular.js 52282// Formular 52283$(document).on('click', '.form, .formsubmit', function (event, data) { 52284 id = $(this).attr("data-contelPageId"); 52285 var form = $(this).parents('form'); 52286 var postData = new FormData(); 52287 52288 postData.append('formData', JSON.stringify(form.serializeJSON())); 52289 52290 $.each(form.children(':file'), function(index, input) { 52291 if(input.files !== undefined && input.files.length) { 52292 postData.append($(input).attr('name'), input.files[0]); 52293 } 52294 }); 52295 52296 $.ajax({ 52297 url: form.attr('action') + (form.attr('action').split('?')[1] ? '&' : '?') + 'noCache=1', 52298 type: "POST", 52299 cache: false, 52300 data: postData, 52301 headers: {"X-Requested-With": "IFrame"}, 52302 processData: false, 52303 contentType: false 52304 }).complete(function (data) { 52305 try { 52306 data = JSON.parse(data.responseText); 52307 } catch (e) { 52308 data = false;
vendor: 6,909 bytes, lines 52309-52500
52309 } 52310 if (data.status === true) { 52311 form.replaceWith('<p style="color:green">Das Formular wurde erfolgreich abgeschickt!</p>'); 52312 52313 window.emosPropertiesEvent({ 52314 content: 'formular sent', 52315 Target: ['formular', 'formular id: ' + id, 1, 'd'] 52316 }); 52317 52318 } else { 52319 if ($('#recaptcha').length) { 52320 grecaptcha.reset(); 52321 } 52322 $('.formError').html(''); 52323 $.each(data, function (inputName, errorMsg) { 52324 form.find('.formError.' + inputName).html('<span>'+errorMsg+'</span>').removeClass('hovered'); 52325 }); 52326 } 52327 }); 52328 52329}); 52330;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/static/javascript/lazyload.js 52331/* 52332 * Lazy Load - jQuery plugin for lazy loading images 52333 * 52334 * Copyright (c) 2007-2013 Mika Tuupola 52335 * 52336 * Licensed under the MIT license: 52337 * http://www.opensource.org/licenses/mit-license.php 52338 * 52339 * Project home: 52340 * http://www.appelsiini.net/projects/lazyload 52341 * 52342 * Version: 1.9.3 52343 * 52344 */ 52345 52346(function ($, window, document, undefined) { 52347 var $window = $(window); 52348 52349 $.fn.lazyload = function (options) { 52350 var elements = this; 52351 var $container; 52352 var settings = { 52353 threshold: 0, 52354 failure_limit: 0, 52355 event: "scroll", 52356 effect: "show", 52357 container: window, 52358 data_attribute: "original", 52359 skip_invisible: true, 52360 appear: null, 52361 load: null, 52362 placeholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" 52363 }; 52364 52365 function update() { 52366 var counter = 0; 52367 52368 elements.each(function () { 52369 var $this = $(this); 52370 if (settings.skip_invisible && !$this.is(":visible")) { 52371 return; 52372 } 52373 if ($.abovethetop(this, settings) || 52374 $.leftofbegin(this, settings)) { 52375 /* Nothing. */ 52376 } else if (!$.belowthefold(this, settings) && !$.rightoffold(this, settings)) { 52377 $this.trigger("appear"); 52378 /* if we found an image we'll load, reset the counter */ 52379 counter = 0; 52380 } else { 52381 if (++counter > settings.failure_limit) { 52382 return false; 52383 } 52384 } 52385 }); 52386 52387 } 52388 52389 if (options) { 52390 /* Maintain BC for a couple of versions. */ 52391 if (undefined !== options.failurelimit) { 52392 options.failure_limit = options.failurelimit; 52393 delete options.failurelimit; 52394 } 52395 if (undefined !== options.effectspeed) { 52396 options.effect_speed = options.effectspeed; 52397 delete options.effectspeed; 52398 } 52399 52400 $.extend(settings, options); 52401 } 52402 52403 /* Cache container as jQuery as object. */ 52404 $container = (settings.container === undefined || 52405 settings.container === window) ? $window : $(settings.container); 52406 52407 /* Fire one scroll event per scroll. Not one scroll event per image. */ 52408 if (0 === settings.event.indexOf("scroll")) { 52409 $container.bind(settings.event, function () { 52410 return update(); 52411 }); 52412 } 52413 52414 this.each(function () { 52415 var self = this; 52416 var $self = $(self); 52417 52418 self.loaded = false; 52419 52420 /* If no src attribute given use data:uri. */ 52421 if ($self.attr("src") === undefined || $self.attr("src") === false) { 52422 if ($self.is("img")) { 52423 $self.attr("src", settings.placeholder); 52424 } 52425 } 52426 52427 /* When appear is triggered load original image. */ 52428 $self.one("appear", function () { 52429 if (!this.loaded) { 52430 if (settings.appear) { 52431 var elements_left = elements.length; 52432 settings.appear.call(self, elements_left, settings); 52433 } 52434 $("<img />") 52435 .bind("load", function () { 52436 52437 var original = $self.attr("data-" + settings.data_attribute); 52438 $self.hide(); 52439 if ($self.is("img")) { 52440 $self.attr("src", original); 52441 } else { 52442 $self.css("background-image", "url('" + original + "')"); 52443 } 52444 $self[settings.effect](settings.effect_speed); 52445 52446 self.loaded = true; 52447 52448 /* Remove image from array so it is not looped next time. */ 52449 var temp = $.grep(elements, function (element) { 52450 return !element.loaded; 52451 }); 52452 elements = $(temp); 52453 52454 if (settings.load) { 52455 var elements_left = elements.length; 52456 settings.load.call(self, elements_left, settings); 52457 } 52458 }) 52459 .attr("src", $self.attr("data-" + settings.data_attribute)); 52460 } 52461 }); 52462 52463 /* When wanted event is triggered load original image */ 52464 /* by triggering appear. */ 52465 if (0 !== settings.event.indexOf("scroll")) { 52466 $self.bind(settings.event, function () { 52467 if (!self.loaded) { 52468 $self.trigger("appear"); 52469 } 52470 }); 52471 } 52472 }); 52473 52474 /* Check if something appears when window is resized. */ 52475 $window.bind("resize", function () { 52476 update(); 52477 }); 52478 52479 /* With IOS5 force loading images when navigating with back button. */ 52480 /* Non optimal workaround. */ 52481 if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) { 52482 $window.bind("pageshow", function (event) { 52483 if (event.originalEvent && event.originalEvent.persisted) { 52484 elements.each(function () { 52485 $(this).trigger("appear"); 52486 }); 52487 } 52488 }); 52489 } 52490 52491 /* Force initial check if images should appear. */ 52492 $(document).ready(function () { 52493 update(); 52494 }); 52495 52496 return this; 52497 }; 52498 52499 /* Convenience methods in jQuery namespace. */ 52500 /* Use as $.belowthefold(element, {threshold : 100, container : window}
52500) */ 52501 52502 $.belowthefold = function (element, settings) { 52503 var fold; 52504 52505 if (settings.container === undefined || settings.container === window) { 52506 fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop(); 52507 } else { 52508 fold = $(settings.container).offset().top + $(settings.container).height(); 52509 } 52510 52511 return fold <= $(element).offset().top - settings.threshold; 52512 }; 52513 52514 $.rightoffold = function (element, settings) { 52515 var fold; 52516 52517 if (settings.container === undefined || settings.container === window) { 52518 fold = $window.width() + $window.scrollLeft(); 52519 } else { 52520 fold = $(settings.container).offset().left + $(settings.container).width(); 52521 } 52522 52523 return fold <= $(element).offset().left - settings.threshold; 52524 }; 52525 52526 $.abovethetop = function (element, settings) { 52527 var fold; 52528 52529 if (settings.container === undefined || settings.container === window) { 52530 fold = $window.scrollTop(); 52531 } else { 52532 fold = $(settings.container).offset().top; 52533 } 52534 52535 return fold >= $(element).offset().top + settings.threshold + $(element).height(); 52536 }; 52537 52538 $.leftofbegin = function (element, settings) { 52539 var fold; 52540 52541 if (settings.container === undefined || settings.container === window) { 52542 fold = $window.scrollLeft(); 52543 } else { 52544 fold = $(settings.container).offset().left; 52545 } 52546 52547 return fold >= $(element).offset().left + settings.threshold + $(element).width(); 52548 }; 52549 52550 $.inviewport = function (element, settings) { 52551 return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings); 52552 }; 52553 52554 /* Custom selectors for your convenience. */ 52555 /* Use as $("img:below-the-fold").something() or */ 52556 /* $("img").filter(":below-the-fold").something() which is faster */ 52557 52558 $.extend($.expr[":"], { 52559 "below-the-fold": function (a) { 52560 return $.belowthefold(a, {threshold: 0}); 52561 }, 52562 "above-the-top": function (a) { 52563 return !$.belowthefold(a, {threshold: 0}); 52564 }, 52565 "right-of-screen": function (a) { 52566 return $.rightoffold(a, {threshold: 0}); 52567 }, 52568 "left-of-screen": function (a) { 52569 return !$.rightoffold(a, {threshold: 0}); 52570 }, 52571 "in-viewport": function (a) { 52572 return $.inviewport(a, {threshold: 0}); 52573 }, 52574 /* Maintain BC for couple of versions. */ 52575 "above-the-fold": function (a) { 52576 return !$.belowthefold(a, {threshold: 0}); 52577 }, 52578 "right-of-fold": function (a) { 52579 return $.rightoffold(a, {threshold: 0}); 52580 }, 52581 "left-of-fold": function (a) { 52582 return !$.rightoffold(a, {threshold: 0}); 52583 } 52584 }); 52585 52586})(jQuery, window, document); 52587;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core/src/LAOLA1/CmsCore/Plugin/JsonFeeds/Fe/js/teaserArchive.js 52588var TeaserArchive = { 52589 loadTeaserArchive: function(teaserArchiveDom) { 52590 var ajaxUrl = teaserArchiveDom.data('url'); 52591 52592 var area = teaserArchiveDom.data('area'); 52593 var activePage = teaserArchiveDom.data('active-page'); 52594 var page = teaserArchiveDom.data('page'); 52595 var month = teaserArchiveDom.data('month'); 52596 var year = teaserArchiveDom.data('year'); 52597 52598 var data = {}; 52599 52600 data['area'] = area; 52601 data['activePage'] = activePage; 52602 data['page'] = page; 52603 data['month'] = month; 52604 data['year'] = year; 52605 52606 $.ajax({ 52607 type: "POST", 52608 url: ajaxUrl, 52609 data: data, 52610 dataType: 'json', 52611 success: function(data) { 52612 if(data.html) { 52613 teaserArchiveDom.html(data.html); 52614 } 52615 }, 52616 complete: function() { 52617 teaserArchiveDom.removeClass('loading'); 52618 } 52619 }); 52620 52621 function computeFilter($this) { 52622 var filterData = $this.data('filter'); 52623 var filterValue = $this.data('value'); 52624 52625 var teaserArchiveDom = $this.closest('.teaserArchive'); 52626 teaserArchiveDom.data(filterData, filterValue); 52627 teaserArchiveDom.data('active-page', 1); 52628 teaserArchiveDom.html(''); 52629 52630 TeaserArchive.unbindAndLoadTeaserArchive(teaserArchiveDom); 52631 } 52632 52633 teaserArchiveDom.on('click', '.filterValue', function() { 52634 computeFilter($(this)); 52635 }); 52636 52637 teaserArchiveDom.on('change', '.dropdown-filter', function() { 52638 computeFilter($(this).find('option:selected')); 52639 }); 52640 52641 teaserArchiveDom.on('change', '.selectize-filter', function() { 52642 var $selectedOption = $(this)[0].selectize.getOption($(this).val()); 52643 computeFilter($selectedOption); 52644 }); 52645 52646 teaserArchiveDom.on('click', '.switchPage', function() { 52647 teaserArchiveDom.data('active-page', $(this).data('page')); 52648 teaserArchiveDom.html(''); 52649 52650 TeaserArchive.unbindAndLoadTeaserArchive(teaserArchiveDom); 52651 }); 52652 52653 teaserArchiveDom.on('click', '.resetFilters', function() { 52654 teaserArchiveDom.data('month', '0'); 52655 teaserArchiveDom.data('year', '0'); 52656 teaserArchiveDom.data('page', '0'); 52657 52658 teaserArchiveDom.html(''); 52659 52660 TeaserArchive.unbindAndLoadTeaserArchive(teaserArchiveDom); 52661 }); 52662 }, 52663 unbindAndLoadTeaserArchive: function(teaserArchiveDom) { 52664 teaserArchiveDom.unbind('click'); 52665 teaserArchiveDom.unbind('change'); 52666 teaserArchiveDom.addClass('loading'); 52667 this.loadTeaserArchive(teaserArchiveDom); 52668 } 52669}; 52670 52671$(document).ready(function() { 52672 $('.teaserArchive').each(function() { 52673 var $this = $(this); 52674 $this.addClass('loading'); 52675 TeaserArchive.loadTeaserArchive($this); 52676 }); 52677}); 52678;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/JsonFeeds/Fe/js/teaserLoaded.js 52679window.TeaserLoaded = { 52680 collectionKeys: {}, 52681 collectionKeysString: null, 52682 init: function() { 52683 $('.teaserLoaded[data-collection]').each(function() { 52684 var collectionKey = $(this).data('collection'); 52685 TeaserLoaded.collectionKeys[collectionKey] = collectionKey; 52686 }); 52687 52688 $('.c-hero-teaser[data-collection]').each(function() { 52689 var collectionKey = $(this).data('collection'); 52690 TeaserLoaded.collectionKeys[collectionKey] = collectionKey; 52691 }); 52692 52693 $('.c-news__item[data-collection]').each(function() { 52694 var collectionKey = $(this).data('collection'); 52695 TeaserLoaded.collectionKeys[collectionKey] = collectionKey; 52696 }); 52697 52698 this.collectionKeysString = JSON.stringify(this.collectionKeys); 52699 } 52700} 52701 52702$(document).ready(function() { 52703 TeaserLoaded.init(); 52704}); 52705 52706;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/Plugin/JsonFeeds/Fe/js/teaserLoader.js 52707window.TeaserLoader = { 52708 /*setPredefinedTeaser: function(thisNewsLoadWrapper) { 52709 var newsLoader = $(thisNewsLoadWrapper).find($(thisNewsLoadWrapper).data('newsloader-selector')); 52710 52711 var preDefinedNews = []; 52712 $('.predefined-news').each(function(){ 52713 preDefinedNews.push($(this).data('predefined-news')); 52714 }); 52715 52716 newsLoader.attr('data-predefined-loaded', preDefinedNews.join()); 52717 },*/ 52718 loadTeaser: function($thisTeaserLoadWrapper) { 52719 var $thisTeaserLoader = $thisTeaserLoadWrapper.find($thisTeaserLoadWrapper.data('teaserloader-selector')); 52720 52721 var ajaxUrl = $thisTeaserLoader.data('loadurl'); 52722 var contelPageId = $thisTeaserLoader.data('contelpage'); 52723 var paging = $thisTeaserLoader.attr('data-paging'); 52724 var teaserIndex = $thisTeaserLoader.attr('data-teaser-index'); 52725 var preDefinedIndex = $thisTeaserLoader.attr('data-predefined-index'); 52726 var advertisementIndex = $thisTeaserLoader.attr('data-advertisement-index'); 52727 var areaId = $thisTeaserLoader.attr('data-area'); 52728 var newsPerPage = $thisTeaserLoader.attr('data-news-per-page'); 52729 52730 var loading = $thisTeaserLoadWrapper.data('loading-selector'); 52731 var loadMore = $thisTeaserLoadWrapper.data('loadmore-selector'); 52732 $thisTeaserLoadWrapper.find(loading).show(); 52733 $thisTeaserLoadWrapper.find(loadMore).hide(); 52734 52735 $.ajax({ 52736 url: ajaxUrl, 52737 type: 'POST', 52738 data: { 52739 contelPageId: contelPageId, 52740 areaId: areaId, 52741 teaserIndex: teaserIndex, 52742 teaserLoaded: TeaserLoaded.collectionKeysString, 52743 preDefinedIndex: preDefinedIndex, 52744 advertisementIndex: advertisementIndex, 52745 paging: paging, 52746 newsPerPage: newsPerPage 52747 }, 52748 dataType: 'json', 52749 success: function(data, status) { 52750 if(data.success == true) { 52751 52752 $thisTeaserLoader.attr('data-teaser-index', data.teaserIndex); 52753 $thisTeaserLoader.attr('data-predefined-index', data.preDefinedIndex); 52754 $thisTeaserLoader.attr('data-advertisement-index', data.advertisementIndex); 52755 52756 if(typeof TeaserLoader.Project.appendTeaserHtmls == 'function') { 52757 TeaserLoader.Project.appendTeaserHtmls($thisTeaserLoader, data.teaserHtmls); 52758 } else { 52759 $.each(data.teaserHtmls, function(index, value) { 52760 $thisTeaserLoader.append(this); 52761 }); 52762 } 52763 52764 $thisTeaserLoadWrapper.find(loading).hide(); 52765 if(data.teaserHtmls.length) { 52766 $thisTeaserLoadWrapper.find(loadMore).show(); 52767 } 52768 52769 if(typeof TeaserLoader.Project.callback == 'function') { 52770 TeaserLoader.Project.callback($thisTeaserLoader); 52771 } 52772 } 52773 } 52774 }); 52775 }, 52776 Project: {} 52777} 52778 52779$(document).ready(function(){ 52780 $('.teaserLoaderWrapper').each(function(){ 52781 var $teaserLoaderWrapper = $(this); 52782 52783 var loadMoreSelector = $teaserLoaderWrapper.data('loadmore-selector');
52784 if(typeof loadMoreSelector !== 'undefined') { 52785 $teaserLoaderWrapper.on('click', loadMoreSelector, function() { 52786 TeaserLoader.loadTeaser($(this).parents('.teaserLoaderWrapper')); 52787 }); 52788 } 52789 52790 TeaserLoader.loadTeaser($teaserLoaderWrapper); 52791 }); 52792}); 52793 52794;// /var/www/www.vfb.de/httpdocs/current/?proxy=laola1/cms-core//src/LAOLA1/CmsCore/static/javascript/urlHash.js 52795/*** 52796 * URL hash manipulation 52797 */ 52798if (typeof(hashFragmentStart) == 'undefined') { 52799 var hashFragmentStart = ''; 52800} 52801var urlHash; 52802( function(window, undefined) { 52803 var hash = (function() { 52804 52805 var fromHash = function() { 52806 var uHash = window.location.hash.replace(/^\#'+hashFragmentStart+'/, '#'); 52807 var params = uHash ? uHash.substr(1).split("&") : [], 52808 paramsObject = {}; 52809 for(var i = 0; i < params.length; i++) { 52810 var a = params[i].split("="); 52811 paramsObject[a[0]] = decodeURIComponent(a[1]); 52812 } 52813 urlHash = uHash; 52814 return paramsObject; 52815 }; 52816 52817 var toHash = function(params) { 52818 52819 var str = []; 52820 params = sortObj(params); 52821 for(var p in params) { 52822 str.push(p + "=" + encodeURIComponent(params[p])); 52823 } 52824 // prevent scrolling to the top 52825 if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1){ 52826 var scr = document.documentElement.scrollTop; 52827 window.location.hash = (str.length?hashFragmentStart:'') + str.join("&"); 52828 document.documentElement.scrollTop = scr; 52829 }else{ 52830 var scr = document.body.scrollTop; 52831 window.location.hash = (str.length?hashFragmentStart:'') + str.join("&"); 52832 document.body.scrollTop = scr; 52833 } 52834 //console.log(scr); 52835 if (window.location.hash == '') { 52836 removeHash(); 52837 } 52838 urlHash = window.location.hash.replace(/^\#'+hashFragmentStart+'/, '#'); 52839 }; 52840 52841 return { 52842 get: function(param, def) { 52843 var params = fromHash(); 52844 if (param) { 52845 if (typeof params[param] != 'undefined') { 52846 return params[param]; 52847 } else { 52848 if (arguments.length>1) { 52849 return arguments[1]; 52850 } else { 52851 return null; 52852 } 52853 } 52854 } else { 52855 return params; 52856 } 52857 }, 52858 add: function(newParams) { 52859 var params = fromHash(); 52860 for (var p in newParams) { 52861 params[p] = newParams[p]; 52862 } 52863 toHash(params); 52864 }, 52865 remove: function(removeParams) { 52866 removeParams = (typeof(removeParams)=='string') ? [removeParams] : removeParams; 52867 var params = fromHash(); 52868 for (var i = 0; i < removeParams.length; i++) { 52869 delete params[removeParams[i]]; 52870 } 52871 toHash(params); 52872 }, 52873 clear: function() { 52874 toHash({}); 52875 }, 52876 hashchangeFromHash: function () { 52877 if (typeof urlHash == undefined) { 52878 return false; 52879 }; 52880 //console.log('Vergleich: "' + urlHash.replace(/^\#'+hashFragmentStart+'|#/, '') + '" - "' + window.location.hash.replace(/^\#'+hashFragmentStart+'|#/, '')+'"'); 52881 return urlHash.replace(/^\#'+hashFragmentStart+'|#/, '') != window.location.hash.replace(/^\#'+hashFragmentStart+'|#/, ''); 52882 } 52883 }; 52884 })(); 52885 52886 window.hash = hash; 52887})(window); 52888 52889/*** 52890 * sort a Javascript object? 52891 * @param obj 52892 * @param type 52893 * @param caseSensitive 52894 * @returns obj 52895 */ 52896sortObj = function(obj, type, caseSensitive) { 52897 var temp_array = []; 52898 for (var key in obj) { 52899 if (obj.hasOwnProperty(key)) { 52900 if (!caseSensitive) { 52901 key = (key['toLowerCase'] ? key.toLowerCase() : key); 52902 } 52903 temp_array.push(key); 52904 } 52905 } 52906 if (typeof type === 'function') { 52907 temp_array.sort(type); 52908 } else if (type === 'value') { 52909 temp_array.sort(function(a,b) { 52910 var x = obj[a]; 52911 var y = obj[b]; 52912 if (!caseSensitive) { 52913 x = (x['toLowerCase'] ? x.toLowerCase() : x); 52914 y = (y['toLowerCase'] ? y.toLowerCase() : y); 52915 } 52916 return ((x < y) ? -1 : ((x > y) ? 1 : 0)); 52917 }); 52918 } else { 52919 temp_array.sort(); 52920 } 52921 var temp_obj = {}; 52922 for (var i=0; i<temp_array.length; i++) { 52923 temp_obj[temp_array[i]] = obj[temp_array[i]]; 52924 } 52925 return temp_obj; 52926}; 52927 52928/*** 52929 * remove the hash from window.location 52930 */ 52931function removeHash () { 52932 history.pushState('', document.title, window.location.pathname + window.location.search); 52933}
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.