1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BrightHorizons = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2var $ = jQuery = require('jquery'); 3window.$ = window.jQuery = $; 4var brightHorizonsExports = require("../sites/clientmicrosites"); 5//var owlCarousel = require("../vendor/owl.carousel.js"); 6//var picturefill = require('../vendor/picturefill.min.js'); 7module.exports = brightHorizonsExports; 8},{"../sites/clientmicrosites":13,"jquery":36}],2:[function(require,module,exports){ 9module.exports = { 10 'Navigation': require('./navigation'), 11 'LeavingSiteModal': require('./leaving-site-modal') 12} 13},{"./leaving-site-modal":5,"./navigation":8}],3:[function(require,module,exports){ 14module.exports = function (element, jQElement) { 15 16 if (location.hostname === element.hostname || 17 !element.hostname.length || 18 element.hostname.indexOf("brighthorizons.com") > 0 || 19 element.hostname.indexOf("parentalleavetoolkit.com") > 0 || 20 element.hostname.indexOf("getintocollege.com") > 0 || 21 element.hostname.indexOf("myedassist.com") > 0 || 22 element.hostname.indexOf("edassist.com") > 0 || 23 element.hostname.indexOf("familymattersresourceroom.com") > 0 || 24 element.hostname.indexOf("brighthorizons.co.uk") > 0 || 25 element.hostname.indexOf("sandbox.my.site.com") > 0 || 26 element.hostname.indexOf("help.brighthorizons.com") > 0 || 27 element.hostname.indexOf("bhclientassist.com") > 0) { 28 jQElement.addClass("internal-link"); 29 } else { 30 jQElement.addClass("external-link"); 31 } 32}; 33},{}],4:[function(require,module,exports){ 34module.exports = function (element) { 35 //Add the active-modal and link-overflow classes to the underlay. 36 // Link overflow allows the darken to appear over any other modals on the page. 37 if ($(".darken-overlay").hasClass("link-overflow")) { 38 $(".darken-overlay").removeClass("link-overflow"); 39 } else { 40 $(".darken-overlay").removeClass("active-modal"); 41 } 42 $(".leaving-site-modal").removeClass("active"); 43}; 44},{}],5:[function(require,module,exports){ 45module.exports = { 46 'Init': require('./init'), 47 'DetermineLinkType': require('./determine-link-type'), 48 'ShowModal': require('./show-modal'), 49 'HideModal': require('./hide-modal') 50} 51},{"./determine-link-type":3,"./hide-modal":4,"./init":6,"./show-modal":7}],6:[function(require,module,exports){ 52module.exports = function() { 53 $("a").each(function () { 54 BrightHorizons.Controls.LeavingSiteModal.DetermineLinkType(this, $(this)); 55 }); 56 57 $("body").on("click", "a.external-link", function (e) { 58 59 // If we're dealing with a tuition link, we need to treat it differently on mobile. 60 if (!$(this).hasClass("tuition-link")) { 61 e.preventDefault(); 62 BrightHorizons.Controls.LeavingSiteModal.ShowModal($(this).attr("href")); 63 return false; 64 } 65 }); 66 67 $("body").on("click", ".leaving-site-modal-close", function (e) { 68 e.preventDefault(); 69 $(this).closest(".leaving-site-modal").removeClass("active"); 70 BrightHorizons.Controls.LeavingSiteModal.HideModal(); 71 return false; 72 }); 73} 74},{}],7:[function(require,module,exports){ 75module.exports = function (url) { 76 77 //Add the active-modal and link-overflow classes to the underlay. 78 // Link overflow allows the darken to appear over any other modals on the page. 79 if ($(".darken-overlay").hasClass("active-modal")) { 80 $(".darken-overlay").addClass("link-overflow"); 81 } else { 82 $(".darken-overlay").addClass("active-modal"); 83 } 84 $(".leaving-site-modal").addClass("active"); 85 $(".leaving-site-modal").find(".copied-external-link-text").attr("href", url).text(url); 86 $(".leaving-site-modal").find(".copied-external-link").attr("href", url); 87}; 88},{}],8:[function(require,module,exports){ 89module.exports = { 90 'Init': require('./init') 91} 92},{"./init":9}],9:[function(require,module,exports){ 93module.exports = function() { 94 //when the mobile menu toggle is clicked
95 $(".mobile-menu-toggle").click(function (e) { 96 // only if the screen is less than 768px 97 if ($(window).width() <= 768) { 98 if ($(this).closest(".nav-inner").hasClass("menu-active")) { 99 $(this).closest(".nav-inner").removeClass("menu-active"); 100 $(this).closest("body").find(".darken-overlay").removeClass("active"); 101 } 102 else { 103 $(this).closest(".nav-inner").addClass("menu-active"); 104 $(this).closest("body").find(".darken-overlay").addClass("active"); 105 } 106 } 107 }); 108 109 //when a nav link is clicked 110 $(".nav-link").click(function (e) { 111 // only if the screen is less than 768px 112 if ($(window).width() <= 768) { 113 $(this).closest(".nav-inner").removeClass("menu-active"); 114 $(this).closest("body").find(".darken-overlay").removeClass("active"); 115 } 116 }); 117 118 //when the overlay is clicked 119 $(".darken-overlay").click(function (e) { 120 if ($(".leaving-site-modal").hasClass("active")) { 121 $(".leaving-site-modal").removeClass("active"); 122 if ($(this).hasClass("link-overflow")) { 123 $(this).removeClass("link-overflow"); 124 } else { 125 $(this).removeClass("active-modal"); 126 } 127 } 128 else if ($(".CM-solution-item").hasClass("active")) { 129 $(".CM-solution-item").removeClass("active"); 130 $(this).removeClass("active-modal"); 131 } 132 else if ($(".nav-inner").hasClass("menu-active")) { 133 $(".nav-inner").removeClass("menu-active"); 134 $(this).removeClass("active"); 135 } 136 else if ($(".edassist-modal").hasClass("active")) { 137 $(".edassist-modal").removeClass("active"); 138 $(this).removeClass("active"); 139 } 140 else if ($(".coupon-modal").hasClass("active")) { 141 $(".coupon-modal").removeClass("active"); 142 $(this).removeClass("active"); 143 } 144 else { 145 $(this).removeClass("active").css("z-index", "2"); 146 } 147 }); 148 149 // Select all links with hashes 150 $('a[href*="#"]') 151 // Remove links that don't actually link to anything 152 .not('[href="#"]') 153 .not('[href="#0"]') 154 .click(function(event) { 155 // On-page links 156 if ( 157 location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 158 && 159 location.hostname == this.hostname 160 ) { 161 // Figure out element to scroll to 162 var target = $(this.hash); 163 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 164 // Does a scroll target exist? 165 if (target.length) { 166 // Only prevent default if animation is actually gonna happen 167 $('html, body').animate({ 168 scrollTop: target.offset().top 169 }, 1000, function() { 170 // Callback after animation 171 // Must change focus! 172 var $target = $(target); 173 $target.focus(); 174 if ($target.is(":focus")) { // Checking if the target was focused 175 return false; 176 } else { 177 $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable 178 $target.focus(); // Set focus again 179 }; 180 }); 181 } 182 } 183 }); 184 185} 186 187 188},{}],10:[function(require,module,exports){ 189module.exports = { 190 'Init': require('./init'), 191 'ReplaceEmployerName': require('./replace-employer-name') 192} 193},{"./init":11,"./replace-employer-name":12}],11:[function(require,module,exports){ 194var initRecursive = function (obj, path) { 195 return function () { 196 var keys = Object.keys(obj); 197 //extra comment 198 var x = 1; 199 for (var i = 0; i < keys.length; i++) { 200 var key = keys[i]; 201 202 if (obj.hasOwnProperty(key)) { 203 var val = obj[key]; 204 205 if (key.toLowerCase() === 'init' && path !== 'BrightHorizons.Core' && val.length === 0) { 206 try { 207 val(); 208 } catch (err) { 209 console.error(err); 210 } 211 } 212 213 if (val != null && typeof val === 'object') { 214 initRecursive(val, path + '.' + key)(); 215 } 216 } 217 } 218 }; 219};
220 221module.exports = function () { 222 $(document).ready(function () { 223 initRecursive(BrightHorizons, 'BrightHorizons')(); 224 window.BrightHorizonsInitiated = true; 225 }); 226}; 227},{}],12:[function(require,module,exports){ 228module.exports = function (element) { 229 var section = element.closest(".container-section"); 230 if (section.length > 0) { 231 if (section.data("employer").length > 0) { 232 element.html(element.html().replace("[[employername]]", section.data("employer"))); 233 } 234 } 235} 236},{}],13:[function(require,module,exports){ 237module.exports = { 238 'Core': require('./core'), 239 'Controls': require('./controls'), 240 'Modules': require('./modules'), 241 'Pages': require('./pages') 242}; 243},{"./controls":2,"./core":10,"./modules":14,"./pages":17}],14:[function(require,module,exports){ 244module.exports = { 245 'Solution': require('./solution') 246} 247},{"./solution":15}],15:[function(require,module,exports){ 248arguments[4][8][0].apply(exports,arguments) 249},{"./init":16,"dup":8}],16:[function(require,module,exports){ 250module.exports = function() { 251//when the SM-solution-card-button is clicked 252 $(".CM-solution-card-link-button").click(function(e) { 253 e.preventDefault(); 254 255 $(this).closest(".CM-solution-item").addClass("active"); 256 $(this).closest("body").find(".darken-overlay").addClass("active-modal"); 257 }); 258 259//when the SM-solution-modal close button is clicked 260 $(".CM-solution-modal-header span").click(function(e) { 261 e.preventDefault(); 262 //remove the active class to the solution item 263 $(this).closest(".CM-solution-item").removeClass("active"); 264 $(this).closest("body").find(".darken-overlay").removeClass("active-modal"); 265 }); 266 267 268 $(".CM-solution-modal-header > h3").click(function(e) { 269 e.stopPropagation(); 270 //if the browser window is less than 768 px 271 if ($(window).width() <= 768) { 272 if ($(this).closest(".CM-solution-item").hasClass("active")) { 273 $(this).closest(".CM-solution-item").removeClass("active"); 274 } else { 275 //$(".CM-solution-item").removeClass("active"); 276 $(this).closest(".CM-solution-item").addClass("active"); 277 } 278 } 279 }); 280} 281},{}],17:[function(require,module,exports){ 282module.exports = { 283 'TuitionAssistance': require('./tuition-assistance'), 284 'PreferredEnrollment': require('./preferred-enrollment'), 285 'TutoringAndHomeworkHelp': require('./tutoring-and-homework-help') 286} 287},{"./preferred-enrollment":26,"./tuition-assistance":30,"./tutoring-and-homework-help":33}],18:[function(require,module,exports){ 288module.exports = function (locations) { 289 var activeInfoWindow = null; 290 //Grab all longitudes and latitudes 291 var long = []; 292 var lat = []; 293 if (locations.length > 0) { 294 $.each(locations, function (key, value) { 295 long.push(value.Longitude); 296 lat.push(value.Latitude); 297 }); 298 } 299 var longMax = Math.max.apply(Math, long); 300 var longMin = Math.min.apply(Math, long); 301 var latMax = Math.max.apply(Math, lat); 302 var latMin = Math.min.apply(Math, lat); 303 304 var newMap = new google.maps.Map(document.getElementById('map'), { 305 zoom: 9 306 }); 307 308 newMap.setCenter(new google.maps.LatLng( 309 ((latMax + latMin) / 2.0), 310 ((longMax + longMin) / 2.0) 311 )); 312 313 $.each(locations, function (key, value) { 314 var latlng = { lat: parseFloat(value.Longitude), lng: parseFloat(value.Latitude) }; 315 316 var infowindow = new google.maps.InfoWindow(); 317 318 new google.maps.Marker({ 319 position: new google.maps.LatLng(value.Latitude, value.Longitude), 320 map: newMap, 321 title: value.PublicName, 322 }).addListener('click', 323 function () { 324 if (activeInfoWindow != null) { 325 activeInfoWindow.close(); 326 } 327 infowindow.setContent(value.PublicName); 328 infowindow.open(map, this); 329 activeInfoWindow = infowindow; 330 }); 331 });
332} 333},{}],19:[function(require,module,exports){ 334module.exports = function (value, url, cb) { 335 $.ajax({ 336 type: "POST", 337 url: url + "/RenderBHLocation", 338 data: JSON.stringify({ 339 location: value 340 }), 341 contentType: "application/json; charset=utf-8", 342 dataType: "json", 343 success: function (data) { 344 if (cb) { 345 cb(data.d.Result); 346 } 347 }, 348 error: function () { 349 } 350 }); 351} 352},{}],20:[function(require,module,exports){ 353module.exports = function (value, url, cb) { 354 $.ajax({ 355 type: "POST", 356 url: url + "/RenderCenterLocation", 357 data: JSON.stringify({ 358 location: value 359 }), 360 contentType: "application/json; charset=utf-8", 361 dataType: "json", 362 success: function (data) { 363 //remove all the pre-existing cities 364 if (cb) { 365 cb(data.d.Result); 366 } 367 }, 368 error: function () { 369 } 370 }); 371} 372},{}],21:[function(require,module,exports){ 373module.exports = function (url) { 374 if ($(".city-uk-dropdown").length) { 375 $.ajax({
376 type: "POST", 377 url: url + "/GetCitiesUK", 378 contentType: "application/json; charset=utf-8", 379 dataType: "json", 380 success: function (data) { 381 //remove all the pre-existing cities 382 $(".city-uk-dropdown").children().remove(); 383 $(".city-uk-dropdown").append('<option value="' + "city" + '">' + "City" + '</option>'); 384 $.each(data.d, 385 function (key, value) { 386 $(".city-uk-dropdown").append('<option data-zip="' + value.Zip + '" data-state="' + "GB" + '" value="' + value.CityName + '">' + value.CityName + '</option>'); 387 }); 388 }, 389 error: function () { 390 }, 391 complete: function() { 392 $(".prefer-enroll-loading").removeClass("active"); 393 } 394 }); 395 } 396} 397},{}],22:[function(require,module,exports){ 398module.exports = function (element, url) { 399 var stateVal = element.val(); 400 if (stateVal.length) { 401 $.ajax({
402 type: "POST", 403 url: url + "/GetCities", 404 data: JSON.stringify({ 405 state: stateVal 406 }), 407 contentType: "application/json; charset=utf-8", 408 dataType: "json", 409 success: function(data) { 410 //remove all the pre-existing cities 411 $(".city-dropdown").children().remove(); 412 $.each(data.d, 413 function (key, value) { 414 var casedValue = 415 $(".city-dropdown").append('<option data-state="' + 416 stateVal + 417 '" data-zip="' + 418 value.Zip + 419 '" value="' + 420 value.CityName + 421 '">' + 422 // Normalize capitalization of city data. 423 value.CityName.replace(/\w\S*/g, function (txt) { 424 return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); 425 }) + 426 '</option>'); 427 }); 428 }, 429 error: function() { 430 }, 431 complete: function() { 432 $(".prefer-enroll-loading").removeClass("active"); 433 } 434 }); 435 } 436} 437},{}],23:[function(require,module,exports){ 438module.exports = function (zip, distance, country, url) { 439 var bhLocations = false; 440 var centerLocations = false; 441 var locations = []; 442 $(".bh-locations-header").hide(); 443 $(".center-locations-header").hide(); 444 $.ajax({
445 type: "POST", 446 url: url + "/GetLocationsByZip", 447 data: JSON.stringify({ 448 zip: zip, 449 distance: distance, 450 country: country 451 }), 452 contentType: "application/json; charset=utf-8", 453 dataType: "json", 454 success: function (data) { 455 $(".prefer-enroll-results").addClass("active-enroll"); 456 BrightHorizons.Pages.PreferredEnrollment.RenderLocations(data, locations, url); 457 }, 458 error: function () { 459 $(".prefer-enroll-results").removeClass("active-enroll"); 460 $(".prefer-enroll-error").addClass("active"); 461 $(".prefer-enroll-error").html("Sorry! Something went wrong. Please reload the page and try again."); 462 }, 463 complete: function () { 464 BrightHorizons.Pages.PreferredEnrollment.DrawMap(locations); 465 $(".prefer-enroll-loading").removeClass("active"); 466 } 467 }); 468} 469},{}],24:[function(require,module,exports){ 470module.exports = function (element, country, url) { 471 if (element.val !== "default") { 472 var city = $(".city-dropdown").val(); 473 var state = $(".city-dropdown").find(":selected").data("state"); 474 var distance = $(".distance-dropdown").val(); 475 if (country === "GBR") { 476 city = $(".city-uk-dropdown").val(); 477 state = $(".city-uk-dropdown").find(":selected").data("state"); 478 } 479 var bhLocations = false; 480 var centerLocations = false; 481 var locations = []; 482 $(".bh-locations-header").hide(); 483 $(".center-locations-header").hide(); 484 $.ajax({
485 type: "POST", 486 url: url + "/GetLocations", 487 data: JSON.stringify({ 488 state: state, 489 city: city, 490 country: country, 491 distance: distance 492 }), 493 contentType: "application/json; charset=utf-8", 494 dataType: "json", 495 success: function (data) { 496 $(".prefer-enroll-results").addClass("active-enroll"); 497 BrightHorizons.Pages.PreferredEnrollment.RenderLocations(data, locations, url); 498 }, 499 error: function () { 500 $(".prefer-enroll-results").removeClass("active-enroll"); 501 $(".prefer-enroll-error").addClass("active"); 502 $(".prefer-enroll-error").html("Sorry! Something went wrong. Please reload the page and try again."); 503 }, 504 complete: function () { 505 BrightHorizons.Pages.PreferredEnrollment.DrawMap(locations); 506 $(".prefer-enroll-loading").removeClass("active"); 507 } 508 }); 509 } 510} 511},{}],25:[function(require,module,exports){ 512module.exports = function(url) { 513 if ($(".state-dropdown").length) { 514 $.ajax({
515 type: "POST", 516 url: url + "/GetStates", 517 contentType: "application/json; charset=utf-8", 518 dataType: "json", 519 success: function (data) { 520 //remove all the pre-existing cities 521 $(".state-dropdown").children().remove(); 522 $(".state-dropdown").append('<option value="' + "state" + '">' + "State" + '</option>'); 523 $.each(data.d, 524 function (key, value) { 525 $(".state-dropdown").append('<option value="' + value + '">' + value + '</option>'); 526 }); 527 }, 528 error: function () { 529 }, 530 complete: function() { 531 $(".prefer-enroll-loading").removeClass("active"); 532 } 533 }); 534 } 535} 536},{}],26:[function(require,module,exports){ 537module.exports = { 538 'Init': require('./init'), 539 'GetLocations': require('./get-locations'), 540 'GetLocationsByZip': require('./get-locations-by-zip'), 541 'GetStates': require('./get-states'), 542 'GetCities': require('./get-cities'), 543 'GetCitiesUK': require('./get-cities-uk'), 544 'GetBHLocation': require('./get-bh-location'), 545 'GetCenterLocation': require('./get-center-location'), 546 'DrawMap': require('./draw-map'), 547 'RenderLocations': require('./render-locations'), 548 'OpenCoupon': require('./open-coupon') 549} 550},{"./draw-map":18,"./get-bh-location":19,"./get-center-location":20,"./get-cities":22,"./get-cities-uk":21,"./get-locations":24,"./get-locations-by-zip":23,"./get-states":25,"./init":27,"./open-coupon":28,"./render-locations":29}],27:[function(require,module,exports){ 551module.exports = function () { 552 //For Preferred Enrollment, we use the CM Locations Web Services. 553 var url = "/API/CMLocations.asmx"; 554 555 //On pageload, load states if its a US company. 556 if ($(".prefer-enroll-outer").data("country") === "USA") { 557 BrightHorizons.Pages.PreferredEnrollment.GetStates(url, false); 558 } 559 560 //On pageload, load cities if its a UK company. 561 if ($(".prefer-enroll-outer").data("country") === "GBR") { 562 BrightHorizons.Pages.PreferredEnrollment.GetCitiesUK(url); 563 } 564 565 //When a state is selected, grab all related cities in that state. 566 $(".state-dropdown").change(function () { 567 if ($(this).val() !== "state") { 568 569 //Reset the ZIP code (as people who are changing the state here will probably want to then search by state) 570 $(".zip-code-input").val(""); 571 BrightHorizons.Pages.PreferredEnrollment.GetCities($(this), url); 572 $(".city-dropdown").prop("disabled", false); 573 } else { 574 575 $(".city-dropdown").children().remove(); 576 $(".city-dropdown").append('<option value="' + "city" + '">' + "City" + '</option>'); 577 $(".city-dropdown").prop("disabled", true); 578 } 579 }); 580 581 //When the city is changed, erase the ZIP code. 582 $(".city-dropdown, .city-uk-dropdown").change(function () { 583 if($(this).val() !== "city") 584 //Reset the ZIP code (as people who are changing the city here will probably want to then search by city) 585 $(".zip-code-input").val(""); 586 }); 587 588 //On Submit... 589 590 $('.state-dropdown, .city-dropdown, .city-uk-dropdown, .zip-code-input, .distance-dropdown, .preferred-enrollment-submit').keypress(function (e) { 591 592 if (event.keyCode == 13) { 593 e.preventDefault(); 594 $('.preferred-enrollment-submit').click(); 595 return false; 596 } 597 }); 598 599 $(".preferred-enrollment-submit").click(function (e) { 600 e.preventDefault(); 601 var cityDropdown = $(".city-dropdown"); 602 if ($(".prefer-enroll-outer").data("country") === "GBR") { 603 cityDropdown = $(".city-uk-dropdown"); 604 } 605 606 if (cityDropdown.val() !== "city" || $(".zip-code-input").val().length > 0) { 607 $(".prefer-enroll-loading").addClass("active"); 608 $(".prefer-enroll-error").removeClass("active");
609 var country = $(".prefer-enroll-outer").data("country"); 610 var distance = $(".distance-dropdown").val(); 611 var zip = ""; 612 if ($(".zip-code-input").val().length) { 613 zip = $(".zip-code-input").val(); 614 } else { 615 if (country === "USA") { 616 zip = $(".city-dropdown").find(":selected").data("zip"); 617 618 } else { 619 zip = $(".city-uk-dropdown").find(":selected").data("zip"); 620 621 } 622 623 } 624 BrightHorizons.Pages.PreferredEnrollment.GetLocationsByZip(zip, distance, country, url); 625 } 626 }); 627 628 //When the coupon is clicked 629 $(".prefer-enroll-results").on('click', '.coupon-label-activate-modal', function (e) { 630 e.preventDefault(); 631 BrightHorizons.Pages.PreferredEnrollment.OpenCoupon($(this)); 632 }); 633 634 //When the coupon close button is clicked 635 $(".prefer-enroll-results").on('click', 'a.close', function (e) { 636 e.preventDefault(); 637 if ($(this).closest(".coupon-modal").hasClass("active")) { 638 $(this).closest(".coupon-modal").removeClass("active"); 639 $(this).closest("body").find(".darken-overlay").removeClass("active").css("z-index", "2"); 640 } 641 }); 642 643 //Print coupon 644 $(".prefer-enroll-results").on('click', 'a.print', function (e) { 645 e.preventDefault(); 646 var divToPrint = $(this).closest(".coupon-modal").find(".coupon-wrapper"); 647 var divContents = divToPrint.html(); 648 var newWin = window.open('', 'Print-Window'); 649 650 newWin.document.open(); 651
652 newWin.document.write('<html>' + 653 '<head>' + 654 '<link href="https://fonts.googleapis.com/css?family=Muli:400,400i,700,800,900" rel="stylesheet">' + 655 '</head>' + 656 '<body onload="window.print()">' + 657 '<style>' + 658 '.coupon-wrapper{border: 5px dashed black;padding: 25px 25px 0; font: 400 16px/1.2 Muli}' + 659 '.coupon-title{font: 400 22px/1.2 Muli;text-transform: uppercase;padding-bottom: 25px;}' + 660 '.coupon-title span{font-weight: 700;}' + 661 '.coupon-disclaimer{font-size: 12px;}' + 662 '' + 663 '</style>' + 664 '<div class="coupon-wrapper">' + 665 divContents + 666 '</div>' + 667 '</body></html>'); 668 669 newWin.document.close(); 670 671 setTimeout(function () { newWin.close(); }, 10); 672 673 }); 674} 675},{}],28:[function(require,module,exports){ 676module.exports = function (element){ 677 if (element.closest(".coupon").find(".coupon-modal").length > 0) { 678 $("body").addClass("print-coupon"); 679 element.closest(".coupon").find(".coupon-modal").addClass("active"); 680 element.closest("body").find(".darken-overlay").addClass("active").css("z-index", "4"); 681 } 682} 683},{}],29:[function(require,module,exports){ 684module.exports = function (data, locations, url) { 685 $(".bh-results").children().remove(); 686 $(".center-results").children().remove(); 687 var discountLink = $(".prefer-enroll-outer").data("discountlink"); 688 689 var discountText = $(".prefer-enroll-outer").data("discounttext"); 690 691 692 var discountTarget = $(".prefer-enroll-outer").data("discounttarget"); 693 694 695 var employer = $(".container-section").data("employer"); 696 if (data.d.length > 0) { 697 $.each(data.d, 698 function (key, value) { 699 //if the location is active 700 if (value.Active) { 701 if (discountLink.length > 0) { 702 703 704 value.Coupon.DiscountLink = discountLink; 705 value.Coupon.DiscountText = discountText; 706 value.Coupon.DiscountTarget = discountTarget; 707 708 } 709 710 locations.push(value); 711 //seperation of preferred enrollment locations and regular ones. 712 if (value.IsPreferredEnrollment) { 713 $(".bh-locations-header").show(); 714 BrightHorizons.Pages.PreferredEnrollment.GetBHLocation(value, url, function (callback) { 715 $(".bh-results").append(callback); 716 }); 717 } else { 718 $(".center-locations-header").show(); 719 BrightHorizons.Pages.PreferredEnrollment.GetCenterLocation(value, url, function (callback2) { 720 $(".center-results").append(callback2.replace("[[employername]]", employer)); 721 $(".center-results a").each(function () { 722 BrightHorizons.Controls.LeavingSiteModal.DetermineLinkType(this, $(this)); 723 }); 724 }); 725 } 726 } 727 }); 728 } else { 729 $(".prefer-enroll-results").removeClass("active-enroll"); 730 $(".prefer-enroll-error").addClass("active"); 731 $(".prefer-enroll-error").html("Sorry! There are no results for this search. Please broaden your search and try again."); 732 } 733} 734},{}],30:[function(require,module,exports){ 735module.exports = { 736 'Init': require('./init'), 737 'TableHeaderScroll': require('./table-header-scroll') 738} 739},{"./init":31,"./table-header-scroll":32}],31:[function(require,module,exports){ 740module.exports = function () { 741 $(".edassist-search-bar").on('keyup paste', 742 function () { 743 setTimeout(function () { 744 var characters = $(".edassist-search-bar").val(); 745 $(".edassist-results").find("tr.edassist-result-entry").each(function () { 746 var exists = false; 747 if ($(this).data("resultname").toLowerCase().match(characters.toLowerCase())) { 748 exists = true; 749 $(this).show(); 750 } else { 751 $(this).hide(); 752 } 753 }); 754 }, 100); 755 }); 756 757 //When you click on col-1....
758 $(".edassist-results .col-1 a").click(function (e) { 759 var result = $(this).closest(".edassist-result-entry"); 760 // on mobile... 761 if ($(window).width() <= 768) { 762 e.preventDefault(); 763 //Apply the correct content. 764 var modal = $(this).closest(".edassist-table").find(".edassist-modal"); 765 var title = result.find(".edassist-result-title").text(); 766 var url = $(this).attr("href"); 767 var target = $(this).attr("target"); 768 769 modal.find(".edassist-modal-title").html(title); 770 modal.find(".edassist-modal-link").attr("href", url); 771 modal.find(".edassist-modal-link").attr("target", target); 772 773 if (result.find(".edassist-result-tuition-reduction").hasClass("checked")) { 774 modal.find(".edassist-modal-tuition-reduction").addClass("checked"); 775 modal.find(".edassist-modal-tuition-reduction").removeClass("not-checked"); 776 } else { 777 modal.find(".edassist-modal-tuition-reduction").addClass("not-checked"); 778 modal.find(".edassist-modal-tuition-reduction").removeClass("checked"); 779 } 780 781 if (result.find(".edassist-result-reduced-waived-fees").hasClass("checked")) { 782 modal.find(".edassist-modal-reduced-waived-fees").addClass("checked"); 783 modal.find(".edassist-modal-reduced-waived-fees").removeClass("not-checked"); 784 } else { 785 modal.find(".edassist-modal-reduced-waived-fees").addClass("not-checked"); 786 modal.find(".edassist-modal-reduced-waived-fees").removeClass("checked"); 787 } 788 789 if (result.find(".edassist-result-immediate-family-member").hasClass("checked")) { 790 modal.find(".edassist-modal-immediate-family-member").addClass("checked"); 791 modal.find(".edassist-modal-immediate-family-member").removeClass("not-checked"); 792 } else { 793 modal.find(".edassist-modal-immediate-family-member").addClass("not-checked"); 794 modal.find(".edassist-modal-immediate-family-member").removeClass("checked"); 795 } 796 797 if (result.find(".edassist-result-dedicated-contact").hasClass("checked")) { 798 modal.find(".edassist-modal-dedicated-contact").addClass("checked"); 799 modal.find(".edassist-modal-dedicated-contact").removeClass("not-checked"); 800 } else { 801 modal.find(".edassist-modal-dedicated-contact").addClass("not-checked"); 802 modal.find(".edassist-modal-dedicated-contact").removeClass("checked"); 803 } 804 805 var locations = result.find(".edassist-result-locations").html(); 806 var accredation = result.find(".edassist-result-accredation").html(); 807 808 //replace the current values with the active result. 809 modal.find(".edassist-modal-locations").html(locations); 810 modal.find(".edassist-modal-accredation").html(accredation); 811 812 $(this).closest(".edassist-table").find(".edassist-modal").addClass("active"); 813 $(this).closest("body").find(".darken-overlay").addClass("active"); 814 815 } else { 816 if ($(this).hasClass("external-link")) { 817 e.preventDefault(); 818 BrightHorizons.Controls.LeavingSiteModal.ShowModal($(this).attr("href")); 819 return false; 820 } 821 } 822 }); 823 824 $(".edassist-modal-close").click(function (e) { 825 e.preventDefault(); 826 // on mobile... 827 $(this).closest(".edassist-table").find(".edassist-modal").removeClass("active"); 828 $(this).closest("body").find(".darken-overlay").removeClass("active"); 829 }); 830 831 if ($(".edassist-outer").length > 0) { 832 BrightHorizons.Pages.TuitionAssistance.TableHeaderScroll(); 833 834 $(window).scroll(function () { 835 BrightHorizons.Pages.TuitionAssistance.TableHeaderScroll(); 836 }); 837 $(window).resize(function () { 838 BrightHorizons.Pages.TuitionAssistance.TableHeaderScroll(); 839 }); 840 } 841} 842},{}],32:[function(require,module,exports){ 843module.exports = function() { 844 if ($(window).width() > 768) { 845 var header = $(".nav-outer").outerHeight(true); 846 var scrollTop = $(window).scrollTop() + header; 847 var headerTop = $(".edassist-table thead").outerHeight(false) + $(".edassist-results").offset().top; 848 if (scrollTop > headerTop && scrollTop <= $(".edassist-results").offset().top + $(".edassist-results").outerHeight(false)) { 849 var tableWidth = $(".edassist-table table").outerWidth(false); 850 $(".edassist-table thead").addClass("sticky").css("top", header).css("width", tableWidth);
851 } else { 852 $(".edassist-table thead").removeClass("sticky").css("top", "auto").css("width", "auto"); 853 } 854 } 855} 856},{}],33:[function(require,module,exports){ 857module.exports = { 858 'Init': require('./init'), 859 'SubmitAndSend': require('./submit-and-send') 860} 861},{"./init":34,"./submit-and-send":35}],34:[function(require,module,exports){ 862module.exports = function () { 863 var url = "/API/CMTutoring.asmx"; 864 865 $(".tutor-help-form input, .tutor-help-form select").focus(function () { 866 $(this).removeClass("error"); 867 }); 868 869 $(".tutor-send-email").click(function(e) { 870 e.preventDefault(); 871 $(".tutor-form-error").removeClass("active"); 872 var invalid = false; 873 var emailReg = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 874 var phoneReg = /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/; 875 876 $(".tutor-help-form textarea, .tutor-help-form input[type=text], .tutor-help-form input[type=number], .tutor-help-form input[type=tel], .tutor-help-form select, .tutor-help-form input[type=email]").each(function() { 877 if ($(this).val().length <= 0) { 878 $(this).addClass("error"); 879 invalid = true; 880 } 881 if ($(this).hasClass("tutor-email")) { 882 if (!emailReg.test($(this).val())) { 883 $(this).addClass("error"); 884 invalid = true; 885 } 886 } 887 if ($(this).hasClass("tutor-phonenumber")) { 888 if (!phoneReg.test($(this).val())) { 889 $(this).addClass("error"); 890 invalid = true; 891 } 892 } 893 894 }); 895 if (invalid) { 896 $(".tutor-form-error").addClass("active"); 897 } else { 898 BrightHorizons.Pages.TutoringAndHomeworkHelp.SubmitAndSend(url); 899 } 900 }); 901} 902},{}],35:[function(require,module,exports){ 903module.exports = function (url) { 904 var firstName = $(".tutor-firstname").val(); 905 var lastName = $(".tutor-lastname").val(); 906 var email = $(".tutor-email").val(); 907 var phoneNumber = $(".tutor-phonenumber").val(); 908 var postalCode = $(".tutor-postalcode").val(); 909 var currentGrade = $(".tutor-currentgrade").val(); 910 var comments = $(".tutor-comments").val(); 911 var studentName = $(".tutor-studentname").val(); 912 var employer = $(".tutor-help-outer").data("employer"); 913 $.ajax({
vendor: 4,151 bytes, lines 914-1057
914 type: "POST", 915 url: url + "/SendEmail", 916 data: JSON.stringify({ 917 firstName: firstName, 918 lastName: lastName, 919 email: email, 920 phoneNumber: phoneNumber, 921 postalCode: postalCode, 922 currentGrade: currentGrade, 923 comments: comments, 924 studentName: studentName, 925 employer: employer 926 }), 927 contentType: "application/json; charset=utf-8", 928 dataType: "json", 929 success: function () { 930 //On a successful submit, hide the form. 931 $(".tutor-help-form").removeClass("active"); 932 $(".tutor-help-thankyou").addClass("active"); 933 }, 934 error: function () { 935 $(".tutor-help-error").addClass("active"); 936 } 937 }); 938} 939},{}],36:[function(require,module,exports){ 940/*! 941 * jQuery JavaScript Library v3.5.1 942 * https://jquery.com/ 943 * 944 * Includes Sizzle.js 945 * https://sizzlejs.com/ 946 * 947 * Copyright JS Foundation and other contributors 948 * Released under the MIT license 949 * https://jquery.org/license 950 * 951 * Date: 2020-05-04T22:49Z 952 */ 953( function( global, factory ) { 954 955 "use strict"; 956 957 if ( typeof module === "object" && typeof module.exports === "object" ) { 958 959 // For CommonJS and CommonJS-like environments where a proper `window` 960 // is present, execute the factory and get jQuery. 961 // For environments that do not have a `window` with a `document` 962 // (such as Node.js), expose a factory as module.exports. 963 // This accentuates the need for the creation of a real `window`. 964 // e.g. var jQuery = require("jquery")(window); 965 // See ticket #14549 for more info. 966 module.exports = global.document ? 967 factory( global, true ) : 968 function( w ) { 969 if ( !w.document ) { 970 throw new Error( "jQuery requires a window with a document" ); 971 } 972 return factory( w ); 973 }; 974 } else { 975 factory( global ); 976 } 977 978// Pass this if window is not defined yet 979} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 980 981// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 982// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 983// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 984// enough that all such attempts are guarded in a try block. 985"use strict"; 986 987var arr = []; 988 989var getProto = Object.getPrototypeOf; 990 991var slice = arr.slice; 992 993var flat = arr.flat ? function( array ) { 994 return arr.flat.call( array ); 995} : function( array ) { 996 return arr.concat.apply( [], array ); 997}; 998 999 1000var push = arr.push; 1001 1002var indexOf = arr.indexOf; 1003 1004var class2type = {}; 1005 1006var toString = class2type.toString; 1007 1008var hasOwn = class2type.hasOwnProperty; 1009 1010var fnToString = hasOwn.toString; 1011 1012var ObjectFunctionString = fnToString.call( Object ); 1013 1014var support = {}; 1015 1016var isFunction = function isFunction( obj ) { 1017 1018 // Support: Chrome <=57, Firefox <=52 1019 // In some browsers, typeof returns "function" for HTML <object> elements 1020 // (i.e., `typeof document.createElement( "object" ) === "function"`). 1021 // We don't want to classify *any* DOM node as a function. 1022 return typeof obj === "function" && typeof obj.nodeType !== "number"; 1023 }; 1024 1025 1026var isWindow = function isWindow( obj ) { 1027 return obj != null && obj === obj.window; 1028 }; 1029 1030 1031var document = window.document; 1032 1033 1034 1035 var preservedScriptAttributes = { 1036 type: true, 1037 src: true, 1038 nonce: true, 1039 noModule: true 1040 }; 1041 1042 function DOMEval( code, node, doc ) { 1043 doc = doc || document; 1044 1045 var i, val, 1046 script = doc.createElement( "script" ); 1047 1048 script.text = code; 1049 if ( node ) { 1050 for ( i in preservedScriptAttributes ) { 1051 1052 // Support: Firefox 64+, Edge 18+ 1053 // Some browsers don't support the "nonce" property on scripts. 1054 // On the other hand, just using `getAttribute` is not enough as 1055 // the `nonce` attribute is reset to an empty string whenever it 1056 // becomes browsing-context connected. 1057 // See https://github.com/whatwg/html/issues/2369
vendor: 4,300 bytes, lines 1058-1229
1058 // See https://html.spec.whatwg.org/#nonce-attributes 1059 // The `node.getAttribute` check was added for the sake of 1060 // `jQuery.globalEval` so that it can fake a nonce-containing node 1061 // via an object. 1062 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 1063 if ( val ) { 1064 script.setAttribute( i, val ); 1065 } 1066 } 1067 } 1068 doc.head.appendChild( script ).parentNode.removeChild( script ); 1069 } 1070 1071 1072function toType( obj ) { 1073 if ( obj == null ) { 1074 return obj + ""; 1075 } 1076 1077 // Support: Android <=2.3 only (functionish RegExp) 1078 return typeof obj === "object" || typeof obj === "function" ? 1079 class2type[ toString.call( obj ) ] || "object" : 1080 typeof obj; 1081} 1082/* global Symbol */ 1083// Defining this global in .eslintrc.json would create a danger of using the global 1084// unguarded in another place, it seems safer to define global only for this module 1085 1086 1087 1088var 1089 version = "3.5.1", 1090 1091 // Define a local copy of jQuery 1092 jQuery = function( selector, context ) { 1093 1094 // The jQuery object is actually just the init constructor 'enhanced' 1095 // Need init if jQuery is called (just allow error to be thrown if not included) 1096 return new jQuery.fn.init( selector, context ); 1097 }; 1098 1099jQuery.fn = jQuery.prototype = { 1100 1101 // The current version of jQuery being used 1102 jquery: version, 1103 1104 constructor: jQuery, 1105 1106 // The default length of a jQuery object is 0 1107 length: 0, 1108 1109 toArray: function() { 1110 return slice.call( this ); 1111 }, 1112 1113 // Get the Nth element in the matched element set OR 1114 // Get the whole matched element set as a clean array 1115 get: function( num ) { 1116 1117 // Return all the elements in a clean array 1118 if ( num == null ) { 1119 return slice.call( this ); 1120 } 1121 1122 // Return just the one element from the set 1123 return num < 0 ? this[ num + this.length ] : this[ num ]; 1124 }, 1125 1126 // Take an array of elements and push it onto the stack 1127 // (returning the new matched element set) 1128 pushStack: function( elems ) { 1129 1130 // Build a new jQuery matched element set 1131 var ret = jQuery.merge( this.constructor(), elems ); 1132 1133 // Add the old object onto the stack (as a reference) 1134 ret.prevObject = this; 1135 1136 // Return the newly-formed element set 1137 return ret; 1138 }, 1139 1140 // Execute a callback for every element in the matched set. 1141 each: function( callback ) { 1142 return jQuery.each( this, callback ); 1143 }, 1144 1145 map: function( callback ) { 1146 return this.pushStack( jQuery.map( this, function( elem, i ) { 1147 return callback.call( elem, i, elem ); 1148 } ) ); 1149 }, 1150 1151 slice: function() { 1152 return this.pushStack( slice.apply( this, arguments ) ); 1153 }, 1154 1155 first: function() { 1156 return this.eq( 0 ); 1157 }, 1158 1159 last: function() { 1160 return this.eq( -1 ); 1161 }, 1162 1163 even: function() { 1164 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 1165 return ( i + 1 ) % 2; 1166 } ) ); 1167 }, 1168 1169 odd: function() { 1170 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 1171 return i % 2; 1172 } ) ); 1173 }, 1174 1175 eq: function( i ) { 1176 var len = this.length, 1177 j = +i + ( i < 0 ? len : 0 ); 1178 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 1179 }, 1180 1181 end: function() { 1182 return this.prevObject || this.constructor(); 1183 }, 1184 1185 // For internal use only. 1186 // Behaves like an Array's method, not like a jQuery method. 1187 push: push, 1188 sort: arr.sort, 1189 splice: arr.splice 1190}; 1191 1192jQuery.extend = jQuery.fn.extend = function() { 1193 var options, name, src, copy, copyIsArray, clone, 1194 target = arguments[ 0 ] || {}, 1195 i = 1, 1196 length = arguments.length, 1197 deep = false; 1198 1199 // Handle a deep copy situation 1200 if ( typeof target === "boolean" ) { 1201 deep = target; 1202 1203 // Skip the boolean and the target 1204 target = arguments[ i ] || {}; 1205 i++; 1206 } 1207 1208 // Handle case when target is a string or something (possible in deep copy) 1209 if ( typeof target !== "object" && !isFunction( target ) ) { 1210 target = {}; 1211 } 1212 1213 // Extend jQuery itself if only one argument is passed 1214 if ( i === length ) { 1215 target = this; 1216 i--; 1217 } 1218 1219 for ( ; i < length; i++ ) { 1220 1221 // Only deal with non-null/undefined values 1222 if ( ( options = arguments[ i ] ) != null ) { 1223 1224 // Extend the base object 1225 for ( name in options ) { 1226 copy = options[ name ]; 1227 1228 // Prevent Object.prototype pollution 1229 // Prevent never-ending loop
vendor: 4,106 bytes, lines 1230-1404
1230 if ( name === "__proto__" || target === copy ) { 1231 continue; 1232 } 1233 1234 // Recurse if we're merging plain objects or arrays 1235 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 1236 ( copyIsArray = Array.isArray( copy ) ) ) ) { 1237 src = target[ name ]; 1238 1239 // Ensure proper type for the source value 1240 if ( copyIsArray && !Array.isArray( src ) ) { 1241 clone = []; 1242 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 1243 clone = {}; 1244 } else { 1245 clone = src; 1246 } 1247 copyIsArray = false; 1248 1249 // Never move original objects, clone them 1250 target[ name ] = jQuery.extend( deep, clone, copy ); 1251 1252 // Don't bring in undefined values 1253 } else if ( copy !== undefined ) { 1254 target[ name ] = copy; 1255 } 1256 } 1257 } 1258 } 1259 1260 // Return the modified object 1261 return target; 1262}; 1263 1264jQuery.extend( { 1265 1266 // Unique for each copy of jQuery on the page 1267 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 1268 1269 // Assume jQuery is ready without the ready module 1270 isReady: true, 1271 1272 error: function( msg ) { 1273 throw new Error( msg ); 1274 }, 1275 1276 noop: function() {}, 1277 1278 isPlainObject: function( obj ) { 1279 var proto, Ctor; 1280 1281 // Detect obvious negatives 1282 // Use toString instead of jQuery.type to catch host objects 1283 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 1284 return false; 1285 } 1286 1287 proto = getProto( obj ); 1288 1289 // Objects with no prototype (e.g., `Object.create( null )`) are plain 1290 if ( !proto ) { 1291 return true; 1292 } 1293 1294 // Objects with prototype are plain iff they were constructed by a global Object function 1295 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 1296 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 1297 }, 1298 1299 isEmptyObject: function( obj ) { 1300 var name; 1301 1302 for ( name in obj ) { 1303 return false; 1304 } 1305 return true; 1306 }, 1307 1308 // Evaluates a script in a provided context; falls back to the global one 1309 // if not specified. 1310 globalEval: function( code, options, doc ) { 1311 DOMEval( code, { nonce: options && options.nonce }, doc ); 1312 }, 1313 1314 each: function( obj, callback ) { 1315 var length, i = 0; 1316 1317 if ( isArrayLike( obj ) ) { 1318 length = obj.length; 1319 for ( ; i < length; i++ ) { 1320 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 1321 break; 1322 } 1323 } 1324 } else { 1325 for ( i in obj ) { 1326 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 1327 break; 1328 } 1329 } 1330 } 1331 1332 return obj; 1333 }, 1334 1335 // results is for internal usage only 1336 makeArray: function( arr, results ) { 1337 var ret = results || []; 1338 1339 if ( arr != null ) { 1340 if ( isArrayLike( Object( arr ) ) ) { 1341 jQuery.merge( ret, 1342 typeof arr === "string" ? 1343 [ arr ] : arr 1344 ); 1345 } else { 1346 push.call( ret, arr ); 1347 } 1348 } 1349 1350 return ret; 1351 }, 1352 1353 inArray: function( elem, arr, i ) { 1354 return arr == null ? -1 : indexOf.call( arr, elem, i ); 1355 }, 1356 1357 // Support: Android <=4.0 only, PhantomJS 1 only 1358 // push.apply(_, arraylike) throws on ancient WebKit 1359 merge: function( first, second ) { 1360 var len = +second.length, 1361 j = 0, 1362 i = first.length; 1363 1364 for ( ; j < len; j++ ) { 1365 first[ i++ ] = second[ j ]; 1366 } 1367 1368 first.length = i; 1369 1370 return first; 1371 }, 1372 1373 grep: function( elems, callback, invert ) { 1374 var callbackInverse, 1375 matches = [], 1376 i = 0, 1377 length = elems.length, 1378 callbackExpect = !invert; 1379 1380 // Go through the array, only saving the items 1381 // that pass the validator function 1382 for ( ; i < length; i++ ) { 1383 callbackInverse = !callback( elems[ i ], i ); 1384 if ( callbackInverse !== callbackExpect ) { 1385 matches.push( elems[ i ] ); 1386 } 1387 } 1388 1389 return matches; 1390 }, 1391 1392 // arg is for internal usage only 1393 map: function( elems, callback, arg ) { 1394 var length, value, 1395 i = 0, 1396 ret = []; 1397 1398 // Go through the array, translating each of the items to their new values 1399 if ( isArrayLike( elems ) ) { 1400 length = elems.length; 1401 for ( ; i < length; i++ ) { 1402 value = callback( elems[ i ], i, arg ); 1403 1404 if ( value != null ) {
vendor: 39,393 bytes, lines 1405-2731
1405 ret.push( value ); 1406 } 1407 } 1408 1409 // Go through every key on the object, 1410 } else { 1411 for ( i in elems ) { 1412 value = callback( elems[ i ], i, arg ); 1413 1414 if ( value != null ) { 1415 ret.push( value ); 1416 } 1417 } 1418 } 1419 1420 // Flatten any nested arrays 1421 return flat( ret ); 1422 }, 1423 1424 // A global GUID counter for objects 1425 guid: 1, 1426 1427 // jQuery.support is not used in Core but other projects attach their 1428 // properties to it so it needs to exist. 1429 support: support 1430} ); 1431 1432if ( typeof Symbol === "function" ) { 1433 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 1434} 1435 1436// Populate the class2type map 1437jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 1438function( _i, name ) { 1439 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 1440} ); 1441 1442function isArrayLike( obj ) { 1443 1444 // Support: real iOS 8.2 only (not reproducible in simulator) 1445 // `in` check used to prevent JIT error (gh-2145) 1446 // hasOwn isn't used here due to false negatives 1447 // regarding Nodelist length in IE 1448 var length = !!obj && "length" in obj && obj.length, 1449 type = toType( obj ); 1450 1451 if ( isFunction( obj ) || isWindow( obj ) ) { 1452 return false; 1453 } 1454 1455 return type === "array" || length === 0 || 1456 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 1457} 1458var Sizzle = 1459/*! 1460 * Sizzle CSS Selector Engine v2.3.5 1461 * https://sizzlejs.com/ 1462 * 1463 * Copyright JS Foundation and other contributors 1464 * Released under the MIT license 1465 * https://js.foundation/ 1466 * 1467 * Date: 2020-03-14 1468 */ 1469( function( window ) { 1470var i, 1471 support, 1472 Expr, 1473 getText, 1474 isXML, 1475 tokenize, 1476 compile, 1477 select, 1478 outermostContext, 1479 sortInput, 1480 hasDuplicate, 1481 1482 // Local document vars 1483 setDocument, 1484 document, 1485 docElem, 1486 documentIsHTML, 1487 rbuggyQSA, 1488 rbuggyMatches, 1489 matches, 1490 contains, 1491 1492 // Instance-specific data 1493 expando = "sizzle" + 1 * new Date(), 1494 preferredDoc = window.document, 1495 dirruns = 0, 1496 done = 0, 1497 classCache = createCache(), 1498 tokenCache = createCache(), 1499 compilerCache = createCache(), 1500 nonnativeSelectorCache = createCache(), 1501 sortOrder = function( a, b ) { 1502 if ( a === b ) { 1503 hasDuplicate = true; 1504 } 1505 return 0; 1506 }, 1507 1508 // Instance methods 1509 hasOwn = ( {} ).hasOwnProperty, 1510 arr = [], 1511 pop = arr.pop, 1512 pushNative = arr.push, 1513 push = arr.push, 1514 slice = arr.slice, 1515 1516 // Use a stripped-down indexOf as it's faster than native 1517 // https://jsperf.com/thor-indexof-vs-for/5 1518 indexOf = function( list, elem ) { 1519 var i = 0, 1520 len = list.length; 1521 for ( ; i < len; i++ ) { 1522 if ( list[ i ] === elem ) { 1523 return i; 1524 } 1525 } 1526 return -1; 1527 }, 1528 1529 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 1530 "ismap|loop|multiple|open|readonly|required|scoped", 1531 1532 // Regular expressions 1533 1534 // http://www.w3.org/TR/css3-selectors/#whitespace 1535 whitespace = "[\\x20\\t\\r\\n\\f]", 1536 1537 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 1538 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 1539 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 1540 1541 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 1542 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 1543 1544 // Operator (capture 2) 1545 "*([*^$|!~]?=)" + whitespace + 1546 1547 // "Attribute values must be CSS identifiers [capture 5] 1548 // or strings [capture 3 or capture 4]" 1549 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 1550 whitespace + "*\\]", 1551 1552 pseudos = ":(" + identifier + ")(?:\\((" + 1553 1554 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 1555 // 1. quoted (capture 3; capture 4 or capture 5) 1556 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 1557 1558 // 2. simple (capture 6) 1559 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 1560 1561 // 3. anything else (capture 2) 1562 ".*" + 1563 ")\\)|)", 1564 1565 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 1566 rwhitespace = new RegExp( whitespace + "+", "g" ), 1567 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 1568 whitespace + "+$", "g" ), 1569 1570 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 1571 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 1572 "*" ), 1573 rdescend = new RegExp( whitespace + "|>" ), 1574 1575 rpseudo = new RegExp( pseudos ), 1576 ridentifier = new RegExp( "^" + identifier + "$" ), 1577 1578 matchExpr = { 1579 "ID": new RegExp( "^#(" + identifier + ")" ), 1580 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 1581 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 1582 "ATTR": new RegExp( "^" + attributes ), 1583 "PSEUDO": new RegExp( "^" + pseudos ), 1584 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 1585 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 1586 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 1587 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 1588 1589 // For use in libraries implementing .is() 1590 // We use this for POS matching in `select` 1591 "needsContext": new RegExp( "^" + whitespace + 1592 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 1593 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 1594 }, 1595 1596 rhtml = /HTML$/i, 1597 rinputs = /^(?:input|select|textarea|button)$/i, 1598 rheader = /^h\d$/i, 1599 1600 rnative = /^[^{]+\{\s*\[native \w/, 1601 1602 // Easily-parseable/retrievable ID or TAG or CLASS selectors 1603 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 1604 1605 rsibling = /[+~]/, 1606 1607 // CSS escapes 1608 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 1609 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 1610 funescape = function( escape, nonHex ) { 1611 var high = "0x" + escape.slice( 1 ) - 0x10000; 1612 1613 return nonHex ? 1614 1615 // Strip the backslash prefix from a non-hex escape sequence 1616 nonHex : 1617 1618 // Replace a hexadecimal escape sequence with the encoded Unicode code point 1619 // Support: IE <=11+ 1620 // For values outside the Basic Multilingual Plane (BMP), manually construct a 1621 // surrogate pair 1622 high < 0 ? 1623 String.fromCharCode( high + 0x10000 ) : 1624 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 1625 }, 1626 1627 // CSS string/identifier serialization 1628 // https://drafts.csswg.org/cssom/#common-serializing-idioms 1629 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 1630 fcssescape = function( ch, asCodePoint ) { 1631 if ( asCodePoint ) { 1632 1633 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 1634 if ( ch === "\0" ) { 1635 return "\uFFFD"; 1636 } 1637 1638 // Control characters and (dependent upon position) numbers get escaped as code points 1639 return ch.slice( 0, -1 ) + "\\" + 1640 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 1641 } 1642 1643 // Other potentially-special ASCII characters get backslash-escaped 1644 return "\\" + ch; 1645 }, 1646 1647 // Used for iframes 1648 // See setDocument() 1649 // Removing the function wrapper causes a "Permission Denied" 1650 // error in IE 1651 unloadHandler = function() { 1652 setDocument(); 1653 }, 1654 1655 inDisabledFieldset = addCombinator( 1656 function( elem ) { 1657 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 1658 }, 1659 { dir: "parentNode", next: "legend" } 1660 ); 1661 1662// Optimize for push.apply( _, NodeList ) 1663try { 1664 push.apply( 1665 ( arr = slice.call( preferredDoc.childNodes ) ), 1666 preferredDoc.childNodes 1667 ); 1668 1669 // Support: Android<4.0 1670 // Detect silently failing push.apply 1671 // eslint-disable-next-line no-unused-expressions 1672 arr[ preferredDoc.childNodes.length ].nodeType; 1673} catch ( e ) { 1674 push = { apply: arr.length ? 1675 1676 // Leverage slice if possible 1677 function( target, els ) { 1678 pushNative.apply( target, slice.call( els ) ); 1679 } : 1680 1681 // Support: IE<9 1682 // Otherwise append directly 1683 function( target, els ) { 1684 var j = target.length, 1685 i = 0; 1686 1687 // Can't trust NodeList.length 1688 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 1689 target.length = j - 1; 1690 } 1691 }; 1692} 1693 1694function Sizzle( selector, context, results, seed ) { 1695 var m, i, elem, nid, match, groups, newSelector, 1696 newContext = context && context.ownerDocument, 1697 1698 // nodeType defaults to 9, since context defaults to document 1699 nodeType = context ? context.nodeType : 9; 1700 1701 results = results || []; 1702 1703 // Return early from calls with invalid selector or context 1704 if ( typeof selector !== "string" || !selector || 1705 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 1706 1707 return results; 1708 } 1709 1710 // Try to shortcut find operations (as opposed to filters) in HTML documents 1711 if ( !seed ) { 1712 setDocument( context ); 1713 context = context || document; 1714 1715 if ( documentIsHTML ) { 1716 1717 // If the selector is sufficiently simple, try using a "get*By*" DOM method 1718 // (excepting DocumentFragment context, where the methods don't exist) 1719 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 1720 1721 // ID selector 1722 if ( ( m = match[ 1 ] ) ) { 1723 1724 // Document context 1725 if ( nodeType === 9 ) { 1726 if ( ( elem = context.getElementById( m ) ) ) { 1727 1728 // Support: IE, Opera, Webkit 1729 // TODO: identify versions 1730 // getElementById can match elements by name instead of ID 1731 if ( elem.id === m ) { 1732 results.push( elem ); 1733 return results; 1734 } 1735 } else { 1736 return results; 1737 } 1738 1739 // Element context 1740 } else { 1741 1742 // Support: IE, Opera, Webkit 1743 // TODO: identify versions 1744 // getElementById can match elements by name instead of ID 1745 if ( newContext && ( elem = newContext.getElementById( m ) ) && 1746 contains( context, elem ) && 1747 elem.id === m ) { 1748 1749 results.push( elem ); 1750 return results; 1751 } 1752 } 1753 1754 // Type selector 1755 } else if ( match[ 2 ] ) { 1756 push.apply( results, context.getElementsByTagName( selector ) ); 1757 return results; 1758 1759 // Class selector 1760 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 1761 context.getElementsByClassName ) { 1762 1763 push.apply( results, context.getElementsByClassName( m ) ); 1764 return results; 1765 } 1766 } 1767 1768 // Take advantage of querySelectorAll 1769 if ( support.qsa && 1770 !nonnativeSelectorCache[ selector + " " ] && 1771 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 1772 1773 // Support: IE 8 only 1774 // Exclude object elements 1775 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 1776 1777 newSelector = selector; 1778 newContext = context; 1779 1780 // qSA considers elements outside a scoping root when evaluating child or 1781 // descendant combinators, which is not what we want. 1782 // In such cases, we work around the behavior by prefixing every selector in the 1783 // list with an ID selector referencing the scope context. 1784 // The technique has to be used as well when a leading combinator is used 1785 // as such selectors are not recognized by querySelectorAll. 1786 // Thanks to Andrew Dupont for this technique. 1787 if ( nodeType === 1 && 1788 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 1789 1790 // Expand context for sibling selectors 1791 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 1792 context; 1793 1794 // We can use :scope instead of the ID hack if the browser 1795 // supports it & if we're not changing the context. 1796 if ( newContext !== context || !support.scope ) { 1797 1798 // Capture the context ID, setting it first if necessary 1799 if ( ( nid = context.getAttribute( "id" ) ) ) { 1800 nid = nid.replace( rcssescape, fcssescape ); 1801 } else { 1802 context.setAttribute( "id", ( nid = expando ) ); 1803 } 1804 } 1805 1806 // Prefix every selector in the list 1807 groups = tokenize( selector ); 1808 i = groups.length; 1809 while ( i-- ) { 1810 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 1811 toSelector( groups[ i ] ); 1812 } 1813 newSelector = groups.join( "," ); 1814 } 1815 1816 try { 1817 push.apply( results, 1818 newContext.querySelectorAll( newSelector ) 1819 ); 1820 return results; 1821 } catch ( qsaError ) { 1822 nonnativeSelectorCache( selector, true ); 1823 } finally { 1824 if ( nid === expando ) { 1825 context.removeAttribute( "id" ); 1826 } 1827 } 1828 } 1829 } 1830 } 1831 1832 // All others 1833 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 1834} 1835 1836/** 1837 * Create key-value caches of limited size 1838 * @returns {function(string, object)} Returns the Object data after storing it on itself with 1839 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 1840 * deleting the oldest entry 1841 */ 1842function createCache() { 1843 var keys = []; 1844 1845 function cache( key, value ) { 1846 1847 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 1848 if ( keys.push( key + " " ) > Expr.cacheLength ) { 1849 1850 // Only keep the most recent entries 1851 delete cache[ keys.shift() ]; 1852 } 1853 return ( cache[ key + " " ] = value ); 1854 } 1855 return cache; 1856} 1857 1858/** 1859 * Mark a function for special use by Sizzle 1860 * @param {Function} fn The function to mark 1861 */ 1862function markFunction( fn ) { 1863 fn[ expando ] = true; 1864 return fn; 1865} 1866 1867/** 1868 * Support testing using an element 1869 * @param {Function} fn Passed the created element and returns a boolean result 1870 */ 1871function assert( fn ) { 1872 var el = document.createElement( "fieldset" ); 1873 1874 try { 1875 return !!fn( el ); 1876 } catch ( e ) { 1877 return false; 1878 } finally { 1879 1880 // Remove from its parent by default 1881 if ( el.parentNode ) { 1882 el.parentNode.removeChild( el ); 1883 } 1884 1885 // release memory in IE 1886 el = null; 1887 } 1888} 1889 1890/** 1891 * Adds the same handler for all of the specified attrs 1892 * @param {String} attrs Pipe-separated list of attributes 1893 * @param {Function} handler The method that will be applied 1894 */ 1895function addHandle( attrs, handler ) { 1896 var arr = attrs.split( "|" ), 1897 i = arr.length; 1898 1899 while ( i-- ) { 1900 Expr.attrHandle[ arr[ i ] ] = handler; 1901 } 1902} 1903 1904/** 1905 * Checks document order of two siblings 1906 * @param {Element} a 1907 * @param {Element} b 1908 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 1909 */ 1910function siblingCheck( a, b ) { 1911 var cur = b && a, 1912 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 1913 a.sourceIndex - b.sourceIndex; 1914 1915 // Use IE sourceIndex if available on both nodes 1916 if ( diff ) { 1917 return diff; 1918 } 1919 1920 // Check if b follows a 1921 if ( cur ) { 1922 while ( ( cur = cur.nextSibling ) ) { 1923 if ( cur === b ) { 1924 return -1; 1925 } 1926 } 1927 } 1928 1929 return a ? 1 : -1; 1930} 1931 1932/** 1933 * Returns a function to use in pseudos for input types 1934 * @param {String} type 1935 */ 1936function createInputPseudo( type ) { 1937 return function( elem ) { 1938 var name = elem.nodeName.toLowerCase(); 1939 return name === "input" && elem.type === type; 1940 }; 1941} 1942 1943/** 1944 * Returns a function to use in pseudos for buttons 1945 * @param {String} type 1946 */ 1947function createButtonPseudo( type ) { 1948 return function( elem ) { 1949 var name = elem.nodeName.toLowerCase(); 1950 return ( name === "input" || name === "button" ) && elem.type === type; 1951 }; 1952} 1953 1954/** 1955 * Returns a function to use in pseudos for :enabled/:disabled 1956 * @param {Boolean} disabled true for :disabled; false for :enabled 1957 */ 1958function createDisabledPseudo( disabled ) { 1959 1960 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 1961 return function( elem ) { 1962 1963 // Only certain elements can match :enabled or :disabled 1964 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 1965 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 1966 if ( "form" in elem ) { 1967 1968 // Check for inherited disabledness on relevant non-disabled elements: 1969 // * listed form-associated elements in a disabled fieldset 1970 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 1971 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 1972 // * option elements in a disabled optgroup 1973 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 1974 // All such elements have a "form" property. 1975 if ( elem.parentNode && elem.disabled === false ) { 1976 1977 // Option elements defer to a parent optgroup if present 1978 if ( "label" in elem ) { 1979 if ( "label" in elem.parentNode ) { 1980 return elem.parentNode.disabled === disabled; 1981 } else { 1982 return elem.disabled === disabled; 1983 } 1984 } 1985 1986 // Support: IE 6 - 11 1987 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 1988 return elem.isDisabled === disabled || 1989 1990 // Where there is no isDisabled, check manually 1991 /* jshint -W018 */ 1992 elem.isDisabled !== !disabled && 1993 inDisabledFieldset( elem ) === disabled; 1994 } 1995 1996 return elem.disabled === disabled; 1997 1998 // Try to winnow out elements that can't be disabled before trusting the disabled property. 1999 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 2000 // even exist on them, let alone have a boolean value. 2001 } else if ( "label" in elem ) { 2002 return elem.disabled === disabled; 2003 } 2004 2005 // Remaining elements are neither :enabled nor :disabled 2006 return false; 2007 }; 2008} 2009 2010/** 2011 * Returns a function to use in pseudos for positionals 2012 * @param {Function} fn 2013 */ 2014function createPositionalPseudo( fn ) { 2015 return markFunction( function( argument ) { 2016 argument = +argument; 2017 return markFunction( function( seed, matches ) { 2018 var j, 2019 matchIndexes = fn( [], seed.length, argument ), 2020 i = matchIndexes.length; 2021 2022 // Match elements found at the specified indexes 2023 while ( i-- ) { 2024 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 2025 seed[ j ] = !( matches[ j ] = seed[ j ] ); 2026 } 2027 } 2028 } ); 2029 } ); 2030} 2031 2032/** 2033 * Checks a node for validity as a Sizzle context 2034 * @param {Element|Object=} context 2035 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 2036 */ 2037function testContext( context ) { 2038 return context && typeof context.getElementsByTagName !== "undefined" && context; 2039} 2040 2041// Expose support vars for convenience 2042support = Sizzle.support = {}; 2043 2044/** 2045 * Detects XML nodes 2046 * @param {Element|Object} elem An element or a document 2047 * @returns {Boolean} True iff elem is a non-HTML XML node 2048 */ 2049isXML = Sizzle.isXML = function( elem ) { 2050 var namespace = elem.namespaceURI, 2051 docElem = ( elem.ownerDocument || elem ).documentElement; 2052 2053 // Support: IE <=8 2054 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 2055 // https://bugs.jquery.com/ticket/4833 2056 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 2057}; 2058 2059/** 2060 * Sets document-related variables once based on the current document 2061 * @param {Element|Object} [doc] An element or document object to use to set the document 2062 * @returns {Object} Returns the current document 2063 */ 2064setDocument = Sizzle.setDocument = function( node ) { 2065 var hasCompare, subWindow, 2066 doc = node ? node.ownerDocument || node : preferredDoc; 2067 2068 // Return early if doc is invalid or already selected 2069 // Support: IE 11+, Edge 17 - 18+ 2070 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2071 // two documents; shallow comparisons work. 2072 // eslint-disable-next-line eqeqeq 2073 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 2074 return document; 2075 } 2076 2077 // Update global variables 2078 document = doc; 2079 docElem = document.documentElement; 2080 documentIsHTML = !isXML( document ); 2081 2082 // Support: IE 9 - 11+, Edge 12 - 18+ 2083 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 2084 // Support: IE 11+, Edge 17 - 18+ 2085 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2086 // two documents; shallow comparisons work. 2087 // eslint-disable-next-line eqeqeq 2088 if ( preferredDoc != document && 2089 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 2090 2091 // Support: IE 11, Edge 2092 if ( subWindow.addEventListener ) { 2093 subWindow.addEventListener( "unload", unloadHandler, false ); 2094 2095 // Support: IE 9 - 10 only 2096 } else if ( subWindow.attachEvent ) { 2097 subWindow.attachEvent( "onunload", unloadHandler ); 2098 } 2099 } 2100 2101 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 2102 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 2103 // IE/Edge & older browsers don't support the :scope pseudo-class. 2104 // Support: Safari 6.0 only 2105 // Safari 6.0 supports :scope but it's an alias of :root there. 2106 support.scope = assert( function( el ) { 2107 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 2108 return typeof el.querySelectorAll !== "undefined" && 2109 !el.querySelectorAll( ":scope fieldset div" ).length; 2110 } ); 2111 2112 /* Attributes 2113 ---------------------------------------------------------------------- */ 2114 2115 // Support: IE<8 2116 // Verify that getAttribute really returns attributes and not properties 2117 // (excepting IE8 booleans) 2118 support.attributes = assert( function( el ) { 2119 el.className = "i"; 2120 return !el.getAttribute( "className" ); 2121 } ); 2122 2123 /* getElement(s)By* 2124 ---------------------------------------------------------------------- */ 2125 2126 // Check if getElementsByTagName("*") returns only elements 2127 support.getElementsByTagName = assert( function( el ) { 2128 el.appendChild( document.createComment( "" ) ); 2129 return !el.getElementsByTagName( "*" ).length; 2130 } ); 2131 2132 // Support: IE<9 2133 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 2134 2135 // Support: IE<10 2136 // Check if getElementById returns elements by name 2137 // The broken getElementById methods don't pick up programmatically-set names, 2138 // so use a roundabout getElementsByName test 2139 support.getById = assert( function( el ) { 2140 docElem.appendChild( el ).id = expando; 2141 return !document.getElementsByName || !document.getElementsByName( expando ).length; 2142 } ); 2143 2144 // ID filter and find 2145 if ( support.getById ) { 2146 Expr.filter[ "ID" ] = function( id ) { 2147 var attrId = id.replace( runescape, funescape ); 2148 return function( elem ) { 2149 return elem.getAttribute( "id" ) === attrId; 2150 }; 2151 }; 2152 Expr.find[ "ID" ] = function( id, context ) { 2153 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 2154 var elem = context.getElementById( id ); 2155 return elem ? [ elem ] : []; 2156 } 2157 }; 2158 } else { 2159 Expr.filter[ "ID" ] = function( id ) { 2160 var attrId = id.replace( runescape, funescape ); 2161 return function( elem ) { 2162 var node = typeof elem.getAttributeNode !== "undefined" && 2163 elem.getAttributeNode( "id" ); 2164 return node && node.value === attrId; 2165 }; 2166 }; 2167 2168 // Support: IE 6 - 7 only 2169 // getElementById is not reliable as a find shortcut 2170 Expr.find[ "ID" ] = function( id, context ) { 2171 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 2172 var node, i, elems, 2173 elem = context.getElementById( id ); 2174 2175 if ( elem ) { 2176 2177 // Verify the id attribute 2178 node = elem.getAttributeNode( "id" ); 2179 if ( node && node.value === id ) { 2180 return [ elem ]; 2181 } 2182 2183 // Fall back on getElementsByName 2184 elems = context.getElementsByName( id ); 2185 i = 0; 2186 while ( ( elem = elems[ i++ ] ) ) { 2187 node = elem.getAttributeNode( "id" ); 2188 if ( node && node.value === id ) { 2189 return [ elem ]; 2190 } 2191 } 2192 } 2193 2194 return []; 2195 } 2196 }; 2197 } 2198 2199 // Tag 2200 Expr.find[ "TAG" ] = support.getElementsByTagName ? 2201 function( tag, context ) { 2202 if ( typeof context.getElementsByTagName !== "undefined" ) { 2203 return context.getElementsByTagName( tag ); 2204 2205 // DocumentFragment nodes don't have gEBTN 2206 } else if ( support.qsa ) { 2207 return context.querySelectorAll( tag ); 2208 } 2209 } : 2210 2211 function( tag, context ) { 2212 var elem, 2213 tmp = [], 2214 i = 0, 2215 2216 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 2217 results = context.getElementsByTagName( tag ); 2218 2219 // Filter out possible comments 2220 if ( tag === "*" ) { 2221 while ( ( elem = results[ i++ ] ) ) { 2222 if ( elem.nodeType === 1 ) { 2223 tmp.push( elem ); 2224 } 2225 } 2226 2227 return tmp; 2228 } 2229 return results; 2230 }; 2231 2232 // Class 2233 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 2234 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 2235 return context.getElementsByClassName( className ); 2236 } 2237 }; 2238 2239 /* QSA/matchesSelector 2240 ---------------------------------------------------------------------- */ 2241 2242 // QSA and matchesSelector support 2243 2244 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 2245 rbuggyMatches = []; 2246 2247 // qSa(:focus) reports false when true (Chrome 21) 2248 // We allow this because of a bug in IE8/9 that throws an error 2249 // whenever `document.activeElement` is accessed on an iframe 2250 // So, we allow :focus to pass through QSA all the time to avoid the IE error 2251 // See https://bugs.jquery.com/ticket/13378 2252 rbuggyQSA = []; 2253 2254 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 2255 2256 // Build QSA regex 2257 // Regex strategy adopted from Diego Perini 2258 assert( function( el ) { 2259 2260 var input; 2261 2262 // Select is set to empty string on purpose 2263 // This is to test IE's treatment of not explicitly 2264 // setting a boolean content attribute, 2265 // since its presence should be enough 2266 // https://bugs.jquery.com/ticket/12359 2267 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 2268 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 2269 "<option selected=''></option></select>"; 2270 2271 // Support: IE8, Opera 11-12.16 2272 // Nothing should be selected when empty strings follow ^= or $= or *= 2273 // The test attribute must be unknown in Opera but "safe" for WinRT 2274 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 2275 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 2276 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 2277 } 2278 2279 // Support: IE8 2280 // Boolean attributes and "value" are not treated correctly 2281 if ( !el.querySelectorAll( "[selected]" ).length ) { 2282 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 2283 } 2284 2285 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 2286 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 2287 rbuggyQSA.push( "~=" ); 2288 } 2289 2290 // Support: IE 11+, Edge 15 - 18+ 2291 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 2292 // Adding a temporary attribute to the document before the selection works 2293 // around the issue. 2294 // Interestingly, IE 10 & older don't seem to have the issue. 2295 input = document.createElement( "input" ); 2296 input.setAttribute( "name", "" ); 2297 el.appendChild( input ); 2298 if ( !el.querySelectorAll( "[name='']" ).length ) { 2299 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 2300 whitespace + "*(?:''|\"\")" ); 2301 } 2302 2303 // Webkit/Opera - :checked should return selected option elements 2304 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 2305 // IE8 throws error here and will not see later tests 2306 if ( !el.querySelectorAll( ":checked" ).length ) { 2307 rbuggyQSA.push( ":checked" ); 2308 } 2309 2310 // Support: Safari 8+, iOS 8+ 2311 // https://bugs.webkit.org/show_bug.cgi?id=136851 2312 // In-page `selector#id sibling-combinator selector` fails 2313 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 2314 rbuggyQSA.push( ".#.+[+~]" ); 2315 } 2316 2317 // Support: Firefox <=3.6 - 5 only 2318 // Old Firefox doesn't throw on a badly-escaped identifier. 2319 el.querySelectorAll( "\\\f" ); 2320 rbuggyQSA.push( "[\\r\\n\\f]" ); 2321 } ); 2322 2323 assert( function( el ) { 2324 el.innerHTML = "<a href='' disabled='disabled'></a>" + 2325 "<select disabled='disabled'><option/></select>"; 2326 2327 // Support: Windows 8 Native Apps 2328 // The type and name attributes are restricted during .innerHTML assignment 2329 var input = document.createElement( "input" ); 2330 input.setAttribute( "type", "hidden" ); 2331 el.appendChild( input ).setAttribute( "name", "D" ); 2332 2333 // Support: IE8 2334 // Enforce case-sensitivity of name attribute 2335 if ( el.querySelectorAll( "[name=d]" ).length ) { 2336 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 2337 } 2338 2339 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 2340 // IE8 throws error here and will not see later tests 2341 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 2342 rbuggyQSA.push( ":enabled", ":disabled" ); 2343 } 2344 2345 // Support: IE9-11+ 2346 // IE's :disabled selector does not pick up the children of disabled fieldsets 2347 docElem.appendChild( el ).disabled = true; 2348 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 2349 rbuggyQSA.push( ":enabled", ":disabled" ); 2350 } 2351 2352 // Support: Opera 10 - 11 only 2353 // Opera 10-11 does not throw on post-comma invalid pseudos 2354 el.querySelectorAll( "*,:x" ); 2355 rbuggyQSA.push( ",.*:" ); 2356 } ); 2357 } 2358 2359 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 2360 docElem.webkitMatchesSelector || 2361 docElem.mozMatchesSelector || 2362 docElem.oMatchesSelector || 2363 docElem.msMatchesSelector ) ) ) ) { 2364 2365 assert( function( el ) { 2366 2367 // Check to see if it's possible to do matchesSelector 2368 // on a disconnected node (IE 9) 2369 support.disconnectedMatch = matches.call( el, "*" ); 2370 2371 // This should fail with an exception 2372 // Gecko does not error, returns false instead 2373 matches.call( el, "[s!='']:x" ); 2374 rbuggyMatches.push( "!=", pseudos ); 2375 } ); 2376 } 2377 2378 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 2379 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 2380 2381 /* Contains 2382 ---------------------------------------------------------------------- */ 2383 hasCompare = rnative.test( docElem.compareDocumentPosition ); 2384 2385 // Element contains another 2386 // Purposefully self-exclusive 2387 // As in, an element does not contain itself 2388 contains = hasCompare || rnative.test( docElem.contains ) ? 2389 function( a, b ) { 2390 var adown = a.nodeType === 9 ? a.documentElement : a, 2391 bup = b && b.parentNode; 2392 return a === bup || !!( bup && bup.nodeType === 1 && ( 2393 adown.contains ? 2394 adown.contains( bup ) : 2395 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 2396 ) ); 2397 } : 2398 function( a, b ) { 2399 if ( b ) { 2400 while ( ( b = b.parentNode ) ) { 2401 if ( b === a ) { 2402 return true; 2403 } 2404 } 2405 } 2406 return false; 2407 }; 2408 2409 /* Sorting 2410 ---------------------------------------------------------------------- */ 2411 2412 // Document order sorting 2413 sortOrder = hasCompare ? 2414 function( a, b ) { 2415 2416 // Flag for duplicate removal 2417 if ( a === b ) { 2418 hasDuplicate = true; 2419 return 0; 2420 } 2421 2422 // Sort on method existence if only one input has compareDocumentPosition 2423 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 2424 if ( compare ) { 2425 return compare; 2426 } 2427 2428 // Calculate position if both inputs belong to the same document 2429 // Support: IE 11+, Edge 17 - 18+ 2430 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2431 // two documents; shallow comparisons work. 2432 // eslint-disable-next-line eqeqeq 2433 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 2434 a.compareDocumentPosition( b ) : 2435 2436 // Otherwise we know they are disconnected 2437 1; 2438 2439 // Disconnected nodes 2440 if ( compare & 1 || 2441 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 2442 2443 // Choose the first element that is related to our preferred document 2444 // Support: IE 11+, Edge 17 - 18+ 2445 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2446 // two documents; shallow comparisons work. 2447 // eslint-disable-next-line eqeqeq 2448 if ( a == document || a.ownerDocument == preferredDoc && 2449 contains( preferredDoc, a ) ) { 2450 return -1; 2451 } 2452 2453 // Support: IE 11+, Edge 17 - 18+ 2454 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2455 // two documents; shallow comparisons work. 2456 // eslint-disable-next-line eqeqeq 2457 if ( b == document || b.ownerDocument == preferredDoc && 2458 contains( preferredDoc, b ) ) { 2459 return 1; 2460 } 2461 2462 // Maintain original order 2463 return sortInput ? 2464 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 2465 0; 2466 } 2467 2468 return compare & 4 ? -1 : 1; 2469 } : 2470 function( a, b ) { 2471 2472 // Exit early if the nodes are identical 2473 if ( a === b ) { 2474 hasDuplicate = true; 2475 return 0; 2476 } 2477 2478 var cur, 2479 i = 0, 2480 aup = a.parentNode, 2481 bup = b.parentNode, 2482 ap = [ a ], 2483 bp = [ b ]; 2484 2485 // Parentless nodes are either documents or disconnected 2486 if ( !aup || !bup ) { 2487 2488 // Support: IE 11+, Edge 17 - 18+ 2489 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2490 // two documents; shallow comparisons work. 2491 /* eslint-disable eqeqeq */ 2492 return a == document ? -1 : 2493 b == document ? 1 : 2494 /* eslint-enable eqeqeq */ 2495 aup ? -1 : 2496 bup ? 1 : 2497 sortInput ? 2498 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 2499 0; 2500 2501 // If the nodes are siblings, we can do a quick check 2502 } else if ( aup === bup ) { 2503 return siblingCheck( a, b ); 2504 } 2505 2506 // Otherwise we need full lists of their ancestors for comparison 2507 cur = a; 2508 while ( ( cur = cur.parentNode ) ) { 2509 ap.unshift( cur ); 2510 } 2511 cur = b; 2512 while ( ( cur = cur.parentNode ) ) { 2513 bp.unshift( cur ); 2514 } 2515 2516 // Walk down the tree looking for a discrepancy 2517 while ( ap[ i ] === bp[ i ] ) { 2518 i++; 2519 } 2520 2521 return i ? 2522 2523 // Do a sibling check if the nodes have a common ancestor 2524 siblingCheck( ap[ i ], bp[ i ] ) : 2525 2526 // Otherwise nodes in our document sort first 2527 // Support: IE 11+, Edge 17 - 18+ 2528 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2529 // two documents; shallow comparisons work. 2530 /* eslint-disable eqeqeq */ 2531 ap[ i ] == preferredDoc ? -1 : 2532 bp[ i ] == preferredDoc ? 1 : 2533 /* eslint-enable eqeqeq */ 2534 0; 2535 }; 2536 2537 return document; 2538}; 2539 2540Sizzle.matches = function( expr, elements ) { 2541 return Sizzle( expr, null, null, elements ); 2542}; 2543 2544Sizzle.matchesSelector = function( elem, expr ) { 2545 setDocument( elem ); 2546 2547 if ( support.matchesSelector && documentIsHTML && 2548 !nonnativeSelectorCache[ expr + " " ] && 2549 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 2550 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 2551 2552 try { 2553 var ret = matches.call( elem, expr ); 2554 2555 // IE 9's matchesSelector returns false on disconnected nodes 2556 if ( ret || support.disconnectedMatch || 2557 2558 // As well, disconnected nodes are said to be in a document 2559 // fragment in IE 9 2560 elem.document && elem.document.nodeType !== 11 ) { 2561 return ret; 2562 } 2563 } catch ( e ) { 2564 nonnativeSelectorCache( expr, true ); 2565 } 2566 } 2567 2568 return Sizzle( expr, document, null, [ elem ] ).length > 0; 2569}; 2570 2571Sizzle.contains = function( context, elem ) { 2572 2573 // Set document vars if needed 2574 // Support: IE 11+, Edge 17 - 18+ 2575 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2576 // two documents; shallow comparisons work. 2577 // eslint-disable-next-line eqeqeq 2578 if ( ( context.ownerDocument || context ) != document ) { 2579 setDocument( context ); 2580 } 2581 return contains( context, elem ); 2582}; 2583 2584Sizzle.attr = function( elem, name ) { 2585 2586 // Set document vars if needed 2587 // Support: IE 11+, Edge 17 - 18+ 2588 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 2589 // two documents; shallow comparisons work. 2590 // eslint-disable-next-line eqeqeq 2591 if ( ( elem.ownerDocument || elem ) != document ) { 2592 setDocument( elem ); 2593 } 2594 2595 var fn = Expr.attrHandle[ name.toLowerCase() ], 2596 2597 // Don't get fooled by Object.prototype properties (jQuery #13807) 2598 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 2599 fn( elem, name, !documentIsHTML ) : 2600 undefined; 2601 2602 return val !== undefined ? 2603 val : 2604 support.attributes || !documentIsHTML ? 2605 elem.getAttribute( name ) : 2606 ( val = elem.getAttributeNode( name ) ) && val.specified ? 2607 val.value : 2608 null; 2609}; 2610 2611Sizzle.escape = function( sel ) { 2612 return ( sel + "" ).replace( rcssescape, fcssescape ); 2613}; 2614 2615Sizzle.error = function( msg ) { 2616 throw new Error( "Syntax error, unrecognized expression: " + msg ); 2617}; 2618 2619/** 2620 * Document sorting and removing duplicates 2621 * @param {ArrayLike} results 2622 */ 2623Sizzle.uniqueSort = function( results ) { 2624 var elem, 2625 duplicates = [], 2626 j = 0, 2627 i = 0; 2628 2629 // Unless we *know* we can detect duplicates, assume their presence 2630 hasDuplicate = !support.detectDuplicates; 2631 sortInput = !support.sortStable && results.slice( 0 ); 2632 results.sort( sortOrder ); 2633 2634 if ( hasDuplicate ) { 2635 while ( ( elem = results[ i++ ] ) ) { 2636 if ( elem === results[ i ] ) { 2637 j = duplicates.push( i ); 2638 } 2639 } 2640 while ( j-- ) { 2641 results.splice( duplicates[ j ], 1 ); 2642 } 2643 } 2644 2645 // Clear input after sorting to release objects 2646 // See https://github.com/jquery/sizzle/pull/225 2647 sortInput = null; 2648 2649 return results; 2650}; 2651 2652/** 2653 * Utility function for retrieving the text value of an array of DOM nodes 2654 * @param {Array|Element} elem 2655 */ 2656getText = Sizzle.getText = function( elem ) { 2657 var node, 2658 ret = "", 2659 i = 0, 2660 nodeType = elem.nodeType; 2661 2662 if ( !nodeType ) { 2663 2664 // If no nodeType, this is expected to be an array 2665 while ( ( node = elem[ i++ ] ) ) { 2666 2667 // Do not traverse comment nodes 2668 ret += getText( node ); 2669 } 2670 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 2671 2672 // Use textContent for elements 2673 // innerText usage removed for consistency of new lines (jQuery #11153) 2674 if ( typeof elem.textContent === "string" ) { 2675 return elem.textContent; 2676 } else { 2677 2678 // Traverse its children 2679 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2680 ret += getText( elem ); 2681 } 2682 } 2683 } else if ( nodeType === 3 || nodeType === 4 ) { 2684 return elem.nodeValue; 2685 } 2686 2687 // Do not include comment or processing instruction nodes 2688 2689 return ret; 2690}; 2691 2692Expr = Sizzle.selectors = { 2693 2694 // Can be adjusted by the user 2695 cacheLength: 50, 2696 2697 createPseudo: markFunction, 2698 2699 match: matchExpr, 2700 2701 attrHandle: {}, 2702 2703 find: {}, 2704 2705 relative: { 2706 ">": { dir: "parentNode", first: true }, 2707 " ": { dir: "parentNode" }, 2708 "+": { dir: "previousSibling", first: true }, 2709 "~": { dir: "previousSibling" } 2710 }, 2711 2712 preFilter: { 2713 "ATTR": function( match ) { 2714 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 2715 2716 // Move the given value to match[3] whether quoted or unquoted 2717 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 2718 match[ 5 ] || "" ).replace( runescape, funescape ); 2719 2720 if ( match[ 2 ] === "~=" ) { 2721 match[ 3 ] = " " + match[ 3 ] + " "; 2722 } 2723 2724 return match.slice( 0, 4 ); 2725 }, 2726 2727 "CHILD": function( match ) { 2728 2729 /* matches from matchExpr["CHILD"] 2730 1 type (only|nth|...) 2731 2 what (child|of-type)
vendor: 9,840 bytes, lines 2732-3061
2732 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 2733 4 xn-component of xn+y argument ([+-]?\d*n|) 2734 5 sign of xn-component 2735 6 x of xn-component 2736 7 sign of y-component 2737 8 y of y-component 2738 */ 2739 match[ 1 ] = match[ 1 ].toLowerCase(); 2740 2741 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 2742 2743 // nth-* requires argument 2744 if ( !match[ 3 ] ) { 2745 Sizzle.error( match[ 0 ] ); 2746 } 2747 2748 // numeric x and y parameters for Expr.filter.CHILD 2749 // remember that false/true cast respectively to 0/1 2750 match[ 4 ] = +( match[ 4 ] ? 2751 match[ 5 ] + ( match[ 6 ] || 1 ) : 2752 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 2753 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 2754 2755 // other types prohibit arguments 2756 } else if ( match[ 3 ] ) { 2757 Sizzle.error( match[ 0 ] ); 2758 } 2759 2760 return match; 2761 }, 2762 2763 "PSEUDO": function( match ) { 2764 var excess, 2765 unquoted = !match[ 6 ] && match[ 2 ]; 2766 2767 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 2768 return null; 2769 } 2770 2771 // Accept quoted arguments as-is 2772 if ( match[ 3 ] ) { 2773 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 2774 2775 // Strip excess characters from unquoted arguments 2776 } else if ( unquoted && rpseudo.test( unquoted ) && 2777 2778 // Get excess from tokenize (recursively) 2779 ( excess = tokenize( unquoted, true ) ) && 2780 2781 // advance to the next closing parenthesis 2782 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 2783 2784 // excess is a negative index 2785 match[ 0 ] = match[ 0 ].slice( 0, excess ); 2786 match[ 2 ] = unquoted.slice( 0, excess ); 2787 } 2788 2789 // Return only captures needed by the pseudo filter method (type and argument) 2790 return match.slice( 0, 3 ); 2791 } 2792 }, 2793 2794 filter: { 2795 2796 "TAG": function( nodeNameSelector ) { 2797 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 2798 return nodeNameSelector === "*" ? 2799 function() { 2800 return true; 2801 } : 2802 function( elem ) { 2803 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 2804 }; 2805 }, 2806 2807 "CLASS": function( className ) { 2808 var pattern = classCache[ className + " " ]; 2809 2810 return pattern || 2811 ( pattern = new RegExp( "(^|" + whitespace + 2812 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 2813 className, function( elem ) { 2814 return pattern.test( 2815 typeof elem.className === "string" && elem.className || 2816 typeof elem.getAttribute !== "undefined" && 2817 elem.getAttribute( "class" ) || 2818 "" 2819 ); 2820 } ); 2821 }, 2822 2823 "ATTR": function( name, operator, check ) { 2824 return function( elem ) { 2825 var result = Sizzle.attr( elem, name ); 2826 2827 if ( result == null ) { 2828 return operator === "!="; 2829 } 2830 if ( !operator ) { 2831 return true; 2832 } 2833 2834 result += ""; 2835 2836 /* eslint-disable max-len */ 2837 2838 return operator === "=" ? result === check : 2839 operator === "!=" ? result !== check : 2840 operator === "^=" ? check && result.indexOf( check ) === 0 : 2841 operator === "*=" ? check && result.indexOf( check ) > -1 : 2842 operator === "$=" ? check && result.slice( -check.length ) === check : 2843 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 2844 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 2845 false; 2846 /* eslint-enable max-len */ 2847 2848 }; 2849 }, 2850 2851 "CHILD": function( type, what, _argument, first, last ) { 2852 var simple = type.slice( 0, 3 ) !== "nth", 2853 forward = type.slice( -4 ) !== "last", 2854 ofType = what === "of-type"; 2855 2856 return first === 1 && last === 0 ? 2857 2858 // Shortcut for :nth-*(n) 2859 function( elem ) { 2860 return !!elem.parentNode; 2861 } : 2862 2863 function( elem, _context, xml ) { 2864 var cache, uniqueCache, outerCache, node, nodeIndex, start, 2865 dir = simple !== forward ? "nextSibling" : "previousSibling", 2866 parent = elem.parentNode, 2867 name = ofType && elem.nodeName.toLowerCase(), 2868 useCache = !xml && !ofType, 2869 diff = false; 2870 2871 if ( parent ) { 2872 2873 // :(first|last|only)-(child|of-type) 2874 if ( simple ) { 2875 while ( dir ) { 2876 node = elem; 2877 while ( ( node = node[ dir ] ) ) { 2878 if ( ofType ? 2879 node.nodeName.toLowerCase() === name : 2880 node.nodeType === 1 ) { 2881 2882 return false; 2883 } 2884 } 2885 2886 // Reverse direction for :only-* (if we haven't yet done so) 2887 start = dir = type === "only" && !start && "nextSibling"; 2888 } 2889 return true; 2890 } 2891 2892 start = [ forward ? parent.firstChild : parent.lastChild ]; 2893 2894 // non-xml :nth-child(...) stores cache data on `parent` 2895 if ( forward && useCache ) { 2896 2897 // Seek `elem` from a previously-cached index 2898 2899 // ...in a gzip-friendly way 2900 node = parent; 2901 outerCache = node[ expando ] || ( node[ expando ] = {} ); 2902 2903 // Support: IE <9 only 2904 // Defend against cloned attroperties (jQuery gh-1709) 2905 uniqueCache = outerCache[ node.uniqueID ] || 2906 ( outerCache[ node.uniqueID ] = {} ); 2907 2908 cache = uniqueCache[ type ] || []; 2909 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 2910 diff = nodeIndex && cache[ 2 ]; 2911 node = nodeIndex && parent.childNodes[ nodeIndex ]; 2912 2913 while ( ( node = ++nodeIndex && node && node[ dir ] || 2914 2915 // Fallback to seeking `elem` from the start 2916 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 2917 2918 // When found, cache indexes on `parent` and break 2919 if ( node.nodeType === 1 && ++diff && node === elem ) { 2920 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 2921 break; 2922 } 2923 } 2924 2925 } else { 2926 2927 // Use previously-cached element index if available 2928 if ( useCache ) { 2929 2930 // ...in a gzip-friendly way 2931 node = elem; 2932 outerCache = node[ expando ] || ( node[ expando ] = {} ); 2933 2934 // Support: IE <9 only 2935 // Defend against cloned attroperties (jQuery gh-1709) 2936 uniqueCache = outerCache[ node.uniqueID ] || 2937 ( outerCache[ node.uniqueID ] = {} ); 2938 2939 cache = uniqueCache[ type ] || []; 2940 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 2941 diff = nodeIndex; 2942 } 2943 2944 // xml :nth-child(...) 2945 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 2946 if ( diff === false ) { 2947 2948 // Use the same loop as above to seek `elem` from the start 2949 while ( ( node = ++nodeIndex && node && node[ dir ] || 2950 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 2951 2952 if ( ( ofType ? 2953 node.nodeName.toLowerCase() === name : 2954 node.nodeType === 1 ) && 2955 ++diff ) { 2956 2957 // Cache the index of each encountered element 2958 if ( useCache ) { 2959 outerCache = node[ expando ] || 2960 ( node[ expando ] = {} ); 2961 2962 // Support: IE <9 only 2963 // Defend against cloned attroperties (jQuery gh-1709) 2964 uniqueCache = outerCache[ node.uniqueID ] || 2965 ( outerCache[ node.uniqueID ] = {} ); 2966 2967 uniqueCache[ type ] = [ dirruns, diff ]; 2968 } 2969 2970 if ( node === elem ) { 2971 break; 2972 } 2973 } 2974 } 2975 } 2976 } 2977 2978 // Incorporate the offset, then check against cycle size 2979 diff -= last; 2980 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 2981 } 2982 }; 2983 }, 2984 2985 "PSEUDO": function( pseudo, argument ) { 2986 2987 // pseudo-class names are case-insensitive 2988 // http://www.w3.org/TR/selectors/#pseudo-classes 2989 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 2990 // Remember that setFilters inherits from pseudos 2991 var args, 2992 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 2993 Sizzle.error( "unsupported pseudo: " + pseudo ); 2994 2995 // The user may use createPseudo to indicate that 2996 // arguments are needed to create the filter function 2997 // just as Sizzle does 2998 if ( fn[ expando ] ) { 2999 return fn( argument ); 3000 } 3001 3002 // But maintain support for old signatures 3003 if ( fn.length > 1 ) { 3004 args = [ pseudo, pseudo, "", argument ]; 3005 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 3006 markFunction( function( seed, matches ) { 3007 var idx, 3008 matched = fn( seed, argument ), 3009 i = matched.length; 3010 while ( i-- ) { 3011 idx = indexOf( seed, matched[ i ] ); 3012 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 3013 } 3014 } ) : 3015 function( elem ) { 3016 return fn( elem, 0, args ); 3017 }; 3018 } 3019 3020 return fn; 3021 } 3022 }, 3023 3024 pseudos: { 3025 3026 // Potentially complex pseudos 3027 "not": markFunction( function( selector ) { 3028 3029 // Trim the selector passed to compile 3030 // to avoid treating leading and trailing 3031 // spaces as combinators 3032 var input = [], 3033 results = [], 3034 matcher = compile( selector.replace( rtrim, "$1" ) ); 3035 3036 return matcher[ expando ] ? 3037 markFunction( function( seed, matches, _context, xml ) { 3038 var elem, 3039 unmatched = matcher( seed, null, xml, [] ), 3040 i = seed.length; 3041 3042 // Match elements unmatched by `matcher` 3043 while ( i-- ) { 3044 if ( ( elem = unmatched[ i ] ) ) { 3045 seed[ i ] = !( matches[ i ] = elem ); 3046 } 3047 } 3048 } ) : 3049 function( elem, _context, xml ) { 3050 input[ 0 ] = elem; 3051 matcher( input, null, xml, results ); 3052 3053 // Don't keep the element (issue #299) 3054 input[ 0 ] = null; 3055 return !results.pop(); 3056 }; 3057 } ), 3058 3059 "has": markFunction( function( selector ) { 3060 return function( elem ) { 3061 return Sizzle( selector, elem ).length > 0;
vendor: 7,131 bytes, lines 3062-3320
3062 }; 3063 } ), 3064 3065 "contains": markFunction( function( text ) { 3066 text = text.replace( runescape, funescape ); 3067 return function( elem ) { 3068 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 3069 }; 3070 } ), 3071 3072 // "Whether an element is represented by a :lang() selector 3073 // is based solely on the element's language value 3074 // being equal to the identifier C, 3075 // or beginning with the identifier C immediately followed by "-". 3076 // The matching of C against the element's language value is performed case-insensitively. 3077 // The identifier C does not have to be a valid language name." 3078 // http://www.w3.org/TR/selectors/#lang-pseudo 3079 "lang": markFunction( function( lang ) { 3080 3081 // lang value must be a valid identifier 3082 if ( !ridentifier.test( lang || "" ) ) { 3083 Sizzle.error( "unsupported lang: " + lang ); 3084 } 3085 lang = lang.replace( runescape, funescape ).toLowerCase(); 3086 return function( elem ) { 3087 var elemLang; 3088 do { 3089 if ( ( elemLang = documentIsHTML ? 3090 elem.lang : 3091 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 3092 3093 elemLang = elemLang.toLowerCase(); 3094 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 3095 } 3096 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 3097 return false; 3098 }; 3099 } ), 3100 3101 // Miscellaneous 3102 "target": function( elem ) { 3103 var hash = window.location && window.location.hash; 3104 return hash && hash.slice( 1 ) === elem.id; 3105 }, 3106 3107 "root": function( elem ) { 3108 return elem === docElem; 3109 }, 3110 3111 "focus": function( elem ) { 3112 return elem === document.activeElement && 3113 ( !document.hasFocus || document.hasFocus() ) && 3114 !!( elem.type || elem.href || ~elem.tabIndex ); 3115 }, 3116 3117 // Boolean properties 3118 "enabled": createDisabledPseudo( false ), 3119 "disabled": createDisabledPseudo( true ), 3120 3121 "checked": function( elem ) { 3122 3123 // In CSS3, :checked should return both checked and selected elements 3124 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 3125 var nodeName = elem.nodeName.toLowerCase(); 3126 return ( nodeName === "input" && !!elem.checked ) || 3127 ( nodeName === "option" && !!elem.selected ); 3128 }, 3129 3130 "selected": function( elem ) { 3131 3132 // Accessing this property makes selected-by-default 3133 // options in Safari work properly 3134 if ( elem.parentNode ) { 3135 // eslint-disable-next-line no-unused-expressions 3136 elem.parentNode.selectedIndex; 3137 } 3138 3139 return elem.selected === true; 3140 }, 3141 3142 // Contents 3143 "empty": function( elem ) { 3144 3145 // http://www.w3.org/TR/selectors/#empty-pseudo 3146 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 3147 // but not by others (comment: 8; processing instruction: 7; etc.) 3148 // nodeType < 6 works because attributes (2) do not appear as children 3149 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 3150 if ( elem.nodeType < 6 ) { 3151 return false; 3152 } 3153 } 3154 return true; 3155 }, 3156 3157 "parent": function( elem ) { 3158 return !Expr.pseudos[ "empty" ]( elem ); 3159 }, 3160 3161 // Element/input types 3162 "header": function( elem ) { 3163 return rheader.test( elem.nodeName ); 3164 }, 3165 3166 "input": function( elem ) { 3167 return rinputs.test( elem.nodeName ); 3168 }, 3169 3170 "button": function( elem ) { 3171 var name = elem.nodeName.toLowerCase(); 3172 return name === "input" && elem.type === "button" || name === "button"; 3173 }, 3174 3175 "text": function( elem ) { 3176 var attr; 3177 return elem.nodeName.toLowerCase() === "input" && 3178 elem.type === "text" && 3179 3180 // Support: IE<8 3181 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 3182 ( ( attr = elem.getAttribute( "type" ) ) == null || 3183 attr.toLowerCase() === "text" ); 3184 }, 3185 3186 // Position-in-collection 3187 "first": createPositionalPseudo( function() { 3188 return [ 0 ]; 3189 } ), 3190 3191 "last": createPositionalPseudo( function( _matchIndexes, length ) { 3192 return [ length - 1 ]; 3193 } ), 3194 3195 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 3196 return [ argument < 0 ? argument + length : argument ]; 3197 } ), 3198 3199 "even": createPositionalPseudo( function( matchIndexes, length ) { 3200 var i = 0; 3201 for ( ; i < length; i += 2 ) { 3202 matchIndexes.push( i ); 3203 } 3204 return matchIndexes; 3205 } ), 3206 3207 "odd": createPositionalPseudo( function( matchIndexes, length ) { 3208 var i = 1; 3209 for ( ; i < length; i += 2 ) { 3210 matchIndexes.push( i ); 3211 } 3212 return matchIndexes; 3213 } ), 3214 3215 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 3216 var i = argument < 0 ? 3217 argument + length : 3218 argument > length ? 3219 length : 3220 argument; 3221 for ( ; --i >= 0; ) { 3222 matchIndexes.push( i ); 3223 } 3224 return matchIndexes; 3225 } ), 3226 3227 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 3228 var i = argument < 0 ? argument + length : argument; 3229 for ( ; ++i < length; ) { 3230 matchIndexes.push( i ); 3231 } 3232 return matchIndexes; 3233 } ) 3234 } 3235}; 3236 3237Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 3238 3239// Add button/input type pseudos 3240for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 3241 Expr.pseudos[ i ] = createInputPseudo( i ); 3242} 3243for ( i in { submit: true, reset: true } ) { 3244 Expr.pseudos[ i ] = createButtonPseudo( i ); 3245} 3246 3247// Easy API for creating new setFilters 3248function setFilters() {} 3249setFilters.prototype = Expr.filters = Expr.pseudos; 3250Expr.setFilters = new setFilters(); 3251 3252tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 3253 var matched, match, tokens, type, 3254 soFar, groups, preFilters, 3255 cached = tokenCache[ selector + " " ]; 3256 3257 if ( cached ) { 3258 return parseOnly ? 0 : cached.slice( 0 ); 3259 } 3260 3261 soFar = selector; 3262 groups = []; 3263 preFilters = Expr.preFilter; 3264 3265 while ( soFar ) { 3266 3267 // Comma and first run 3268 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 3269 if ( match ) { 3270 3271 // Don't consume trailing commas as valid 3272 soFar = soFar.slice( match[ 0 ].length ) || soFar; 3273 } 3274 groups.push( ( tokens = [] ) ); 3275 } 3276 3277 matched = false; 3278 3279 // Combinators 3280 if ( ( match = rcombinators.exec( soFar ) ) ) { 3281 matched = match.shift(); 3282 tokens.push( { 3283 value: matched, 3284 3285 // Cast descendant combinators to space 3286 type: match[ 0 ].replace( rtrim, " " ) 3287 } ); 3288 soFar = soFar.slice( matched.length ); 3289 } 3290 3291 // Filters 3292 for ( type in Expr.filter ) { 3293 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 3294 ( match = preFilters[ type ]( match ) ) ) ) { 3295 matched = match.shift(); 3296 tokens.push( { 3297 value: matched, 3298 type: type, 3299 matches: match 3300 } ); 3301 soFar = soFar.slice( matched.length ); 3302 } 3303 } 3304 3305 if ( !matched ) { 3306 break; 3307 } 3308 } 3309 3310 // Return the length of the invalid excess 3311 // if we're just parsing 3312 // Otherwise, throw an error or return tokens 3313 return parseOnly ? 3314 soFar.length : 3315 soFar ? 3316 Sizzle.error( selector ) : 3317 3318 // Cache the tokens 3319 tokenCache( selector, groups ).slice( 0 ); 3320};
vendor: 6,098 bytes, lines 3321-3546
3321 3322function toSelector( tokens ) { 3323 var i = 0, 3324 len = tokens.length, 3325 selector = ""; 3326 for ( ; i < len; i++ ) { 3327 selector += tokens[ i ].value; 3328 } 3329 return selector; 3330} 3331 3332function addCombinator( matcher, combinator, base ) { 3333 var dir = combinator.dir, 3334 skip = combinator.next, 3335 key = skip || dir, 3336 checkNonElements = base && key === "parentNode", 3337 doneName = done++; 3338 3339 return combinator.first ? 3340 3341 // Check against closest ancestor/preceding element 3342 function( elem, context, xml ) { 3343 while ( ( elem = elem[ dir ] ) ) { 3344 if ( elem.nodeType === 1 || checkNonElements ) { 3345 return matcher( elem, context, xml ); 3346 } 3347 } 3348 return false; 3349 } : 3350 3351 // Check against all ancestor/preceding elements 3352 function( elem, context, xml ) { 3353 var oldCache, uniqueCache, outerCache, 3354 newCache = [ dirruns, doneName ]; 3355 3356 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 3357 if ( xml ) { 3358 while ( ( elem = elem[ dir ] ) ) { 3359 if ( elem.nodeType === 1 || checkNonElements ) { 3360 if ( matcher( elem, context, xml ) ) { 3361 return true; 3362 } 3363 } 3364 } 3365 } else { 3366 while ( ( elem = elem[ dir ] ) ) { 3367 if ( elem.nodeType === 1 || checkNonElements ) { 3368 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 3369 3370 // Support: IE <9 only 3371 // Defend against cloned attroperties (jQuery gh-1709) 3372 uniqueCache = outerCache[ elem.uniqueID ] || 3373 ( outerCache[ elem.uniqueID ] = {} ); 3374 3375 if ( skip && skip === elem.nodeName.toLowerCase() ) { 3376 elem = elem[ dir ] || elem; 3377 } else if ( ( oldCache = uniqueCache[ key ] ) && 3378 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 3379 3380 // Assign to newCache so results back-propagate to previous elements 3381 return ( newCache[ 2 ] = oldCache[ 2 ] ); 3382 } else { 3383 3384 // Reuse newcache so results back-propagate to previous elements 3385 uniqueCache[ key ] = newCache; 3386 3387 // A match means we're done; a fail means we have to keep checking 3388 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 3389 return true; 3390 } 3391 } 3392 } 3393 } 3394 } 3395 return false; 3396 }; 3397} 3398 3399function elementMatcher( matchers ) { 3400 return matchers.length > 1 ? 3401 function( elem, context, xml ) { 3402 var i = matchers.length; 3403 while ( i-- ) { 3404 if ( !matchers[ i ]( elem, context, xml ) ) { 3405 return false; 3406 } 3407 } 3408 return true; 3409 } : 3410 matchers[ 0 ]; 3411} 3412 3413function multipleContexts( selector, contexts, results ) { 3414 var i = 0, 3415 len = contexts.length; 3416 for ( ; i < len; i++ ) { 3417 Sizzle( selector, contexts[ i ], results ); 3418 } 3419 return results; 3420} 3421 3422function condense( unmatched, map, filter, context, xml ) { 3423 var elem, 3424 newUnmatched = [], 3425 i = 0, 3426 len = unmatched.length, 3427 mapped = map != null; 3428 3429 for ( ; i < len; i++ ) { 3430 if ( ( elem = unmatched[ i ] ) ) { 3431 if ( !filter || filter( elem, context, xml ) ) { 3432 newUnmatched.push( elem ); 3433 if ( mapped ) { 3434 map.push( i ); 3435 } 3436 } 3437 } 3438 } 3439 3440 return newUnmatched; 3441} 3442 3443function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 3444 if ( postFilter && !postFilter[ expando ] ) { 3445 postFilter = setMatcher( postFilter ); 3446 } 3447 if ( postFinder && !postFinder[ expando ] ) { 3448 postFinder = setMatcher( postFinder, postSelector ); 3449 } 3450 return markFunction( function( seed, results, context, xml ) { 3451 var temp, i, elem, 3452 preMap = [], 3453 postMap = [], 3454 preexisting = results.length, 3455 3456 // Get initial elements from seed or context 3457 elems = seed || multipleContexts( 3458 selector || "*", 3459 context.nodeType ? [ context ] : context, 3460 [] 3461 ), 3462 3463 // Prefilter to get matcher input, preserving a map for seed-results synchronization 3464 matcherIn = preFilter && ( seed || !selector ) ? 3465 condense( elems, preMap, preFilter, context, xml ) : 3466 elems, 3467 3468 matcherOut = matcher ? 3469 3470 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 3471 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 3472 3473 // ...intermediate processing is necessary 3474 [] : 3475 3476 // ...otherwise use results directly 3477 results : 3478 matcherIn; 3479 3480 // Find primary matches 3481 if ( matcher ) { 3482 matcher( matcherIn, matcherOut, context, xml ); 3483 } 3484 3485 // Apply postFilter 3486 if ( postFilter ) { 3487 temp = condense( matcherOut, postMap ); 3488 postFilter( temp, [], context, xml ); 3489 3490 // Un-match failing elements by moving them back to matcherIn 3491 i = temp.length; 3492 while ( i-- ) { 3493 if ( ( elem = temp[ i ] ) ) { 3494 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 3495 } 3496 } 3497 } 3498 3499 if ( seed ) { 3500 if ( postFinder || preFilter ) { 3501 if ( postFinder ) { 3502 3503 // Get the final matcherOut by condensing this intermediate into postFinder contexts 3504 temp = []; 3505 i = matcherOut.length; 3506 while ( i-- ) { 3507 if ( ( elem = matcherOut[ i ] ) ) { 3508 3509 // Restore matcherIn since elem is not yet a final match 3510 temp.push( ( matcherIn[ i ] = elem ) ); 3511 } 3512 } 3513 postFinder( null, ( matcherOut = [] ), temp, xml ); 3514 } 3515 3516 // Move matched elements from seed to results to keep them synchronized 3517 i = matcherOut.length; 3518 while ( i-- ) { 3519 if ( ( elem = matcherOut[ i ] ) && 3520 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 3521 3522 seed[ temp ] = !( results[ temp ] = elem ); 3523 } 3524 } 3525 } 3526 3527 // Add elements to results, through postFinder if defined 3528 } else { 3529 matcherOut = condense( 3530 matcherOut === results ? 3531 matcherOut.splice( preexisting, matcherOut.length ) : 3532 matcherOut 3533 ); 3534 if ( postFinder ) { 3535 postFinder( null, results, matcherOut, xml ); 3536 } else { 3537 push.apply( results, matcherOut ); 3538 } 3539 } 3540 } ); 3541} 3542 3543function matcherFromTokens( tokens ) { 3544 var checkContext, matcher, j, 3545 len = tokens.length, 3546 leadingRelative = Expr.relative[ tokens[ 0 ].type ],
vendor: 6,762 bytes, lines 3547-3763
3547 implicitRelative = leadingRelative || Expr.relative[ " " ], 3548 i = leadingRelative ? 1 : 0, 3549 3550 // The foundational matcher ensures that elements are reachable from top-level context(s) 3551 matchContext = addCombinator( function( elem ) { 3552 return elem === checkContext; 3553 }, implicitRelative, true ), 3554 matchAnyContext = addCombinator( function( elem ) { 3555 return indexOf( checkContext, elem ) > -1; 3556 }, implicitRelative, true ), 3557 matchers = [ function( elem, context, xml ) { 3558 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 3559 ( checkContext = context ).nodeType ? 3560 matchContext( elem, context, xml ) : 3561 matchAnyContext( elem, context, xml ) ); 3562 3563 // Avoid hanging onto element (issue #299) 3564 checkContext = null; 3565 return ret; 3566 } ]; 3567 3568 for ( ; i < len; i++ ) { 3569 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 3570 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 3571 } else { 3572 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 3573 3574 // Return special upon seeing a positional matcher 3575 if ( matcher[ expando ] ) { 3576 3577 // Find the next relative operator (if any) for proper handling 3578 j = ++i; 3579 for ( ; j < len; j++ ) { 3580 if ( Expr.relative[ tokens[ j ].type ] ) { 3581 break; 3582 } 3583 } 3584 return setMatcher( 3585 i > 1 && elementMatcher( matchers ), 3586 i > 1 && toSelector( 3587 3588 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 3589 tokens 3590 .slice( 0, i - 1 ) 3591 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 3592 ).replace( rtrim, "$1" ), 3593 matcher, 3594 i < j && matcherFromTokens( tokens.slice( i, j ) ), 3595 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 3596 j < len && toSelector( tokens ) 3597 ); 3598 } 3599 matchers.push( matcher ); 3600 } 3601 } 3602 3603 return elementMatcher( matchers ); 3604} 3605 3606function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 3607 var bySet = setMatchers.length > 0, 3608 byElement = elementMatchers.length > 0, 3609 superMatcher = function( seed, context, xml, results, outermost ) { 3610 var elem, j, matcher, 3611 matchedCount = 0, 3612 i = "0", 3613 unmatched = seed && [], 3614 setMatched = [], 3615 contextBackup = outermostContext, 3616 3617 // We must always have either seed elements or outermost context 3618 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 3619 3620 // Use integer dirruns iff this is the outermost matcher 3621 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 3622 len = elems.length; 3623 3624 if ( outermost ) { 3625 3626 // Support: IE 11+, Edge 17 - 18+ 3627 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3628 // two documents; shallow comparisons work. 3629 // eslint-disable-next-line eqeqeq 3630 outermostContext = context == document || context || outermost; 3631 } 3632 3633 // Add elements passing elementMatchers directly to results 3634 // Support: IE<9, Safari 3635 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 3636 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 3637 if ( byElement && elem ) { 3638 j = 0; 3639 3640 // Support: IE 11+, Edge 17 - 18+ 3641 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3642 // two documents; shallow comparisons work. 3643 // eslint-disable-next-line eqeqeq 3644 if ( !context && elem.ownerDocument != document ) { 3645 setDocument( elem ); 3646 xml = !documentIsHTML; 3647 } 3648 while ( ( matcher = elementMatchers[ j++ ] ) ) { 3649 if ( matcher( elem, context || document, xml ) ) { 3650 results.push( elem ); 3651 break; 3652 } 3653 } 3654 if ( outermost ) { 3655 dirruns = dirrunsUnique; 3656 } 3657 } 3658 3659 // Track unmatched elements for set filters 3660 if ( bySet ) { 3661 3662 // They will have gone through all possible matchers 3663 if ( ( elem = !matcher && elem ) ) { 3664 matchedCount--; 3665 } 3666 3667 // Lengthen the array for every element, matched or not 3668 if ( seed ) { 3669 unmatched.push( elem ); 3670 } 3671 } 3672 } 3673 3674 // `i` is now the count of elements visited above, and adding it to `matchedCount` 3675 // makes the latter nonnegative. 3676 matchedCount += i; 3677 3678 // Apply set filters to unmatched elements 3679 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 3680 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 3681 // no element matchers and no seed. 3682 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 3683 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 3684 // numerically zero. 3685 if ( bySet && i !== matchedCount ) { 3686 j = 0; 3687 while ( ( matcher = setMatchers[ j++ ] ) ) { 3688 matcher( unmatched, setMatched, context, xml ); 3689 } 3690 3691 if ( seed ) { 3692 3693 // Reintegrate element matches to eliminate the need for sorting 3694 if ( matchedCount > 0 ) { 3695 while ( i-- ) { 3696 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 3697 setMatched[ i ] = pop.call( results ); 3698 } 3699 } 3700 } 3701 3702 // Discard index placeholder values to get only actual matches 3703 setMatched = condense( setMatched ); 3704 } 3705 3706 // Add matches to results 3707 push.apply( results, setMatched ); 3708 3709 // Seedless set matches succeeding multiple successful matchers stipulate sorting 3710 if ( outermost && !seed && setMatched.length > 0 && 3711 ( matchedCount + setMatchers.length ) > 1 ) { 3712 3713 Sizzle.uniqueSort( results ); 3714 } 3715 } 3716 3717 // Override manipulation of globals by nested matchers 3718 if ( outermost ) { 3719 dirruns = dirrunsUnique; 3720 outermostContext = contextBackup; 3721 } 3722 3723 return unmatched; 3724 }; 3725 3726 return bySet ? 3727 markFunction( superMatcher ) : 3728 superMatcher; 3729} 3730 3731compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 3732 var i, 3733 setMatchers = [], 3734 elementMatchers = [], 3735 cached = compilerCache[ selector + " " ]; 3736 3737 if ( !cached ) { 3738 3739 // Generate a function of recursive functions that can be used to check each element 3740 if ( !match ) { 3741 match = tokenize( selector ); 3742 } 3743 i = match.length; 3744 while ( i-- ) { 3745 cached = matcherFromTokens( match[ i ] ); 3746 if ( cached[ expando ] ) { 3747 setMatchers.push( cached ); 3748 } else { 3749 elementMatchers.push( cached ); 3750 } 3751 } 3752 3753 // Cache the compiled function 3754 cached = compilerCache( 3755 selector, 3756 matcherFromGroupMatchers( elementMatchers, setMatchers ) 3757 ); 3758 3759 // Save selector and tokenization 3760 cached.selector = selector; 3761 } 3762 return cached; 3763};
vendor: 8,645 bytes, lines 3764-4080
3764 3765/** 3766 * A low-level selection function that works with Sizzle's compiled 3767 * selector functions 3768 * @param {String|Function} selector A selector or a pre-compiled 3769 * selector function built with Sizzle.compile 3770 * @param {Element} context 3771 * @param {Array} [results] 3772 * @param {Array} [seed] A set of elements to match against 3773 */ 3774select = Sizzle.select = function( selector, context, results, seed ) { 3775 var i, tokens, token, type, find, 3776 compiled = typeof selector === "function" && selector, 3777 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 3778 3779 results = results || []; 3780 3781 // Try to minimize operations if there is only one selector in the list and no seed 3782 // (the latter of which guarantees us context) 3783 if ( match.length === 1 ) { 3784 3785 // Reduce context if the leading compound selector is an ID 3786 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 3787 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 3788 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 3789 3790 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 3791 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 3792 if ( !context ) { 3793 return results; 3794 3795 // Precompiled matchers will still verify ancestry, so step up a level 3796 } else if ( compiled ) { 3797 context = context.parentNode; 3798 } 3799 3800 selector = selector.slice( tokens.shift().value.length ); 3801 } 3802 3803 // Fetch a seed set for right-to-left matching 3804 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 3805 while ( i-- ) { 3806 token = tokens[ i ]; 3807 3808 // Abort if we hit a combinator 3809 if ( Expr.relative[ ( type = token.type ) ] ) { 3810 break; 3811 } 3812 if ( ( find = Expr.find[ type ] ) ) { 3813 3814 // Search, expanding context for leading sibling combinators 3815 if ( ( seed = find( 3816 token.matches[ 0 ].replace( runescape, funescape ), 3817 rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || 3818 context 3819 ) ) ) { 3820 3821 // If seed is empty or no tokens remain, we can return early 3822 tokens.splice( i, 1 ); 3823 selector = seed.length && toSelector( tokens ); 3824 if ( !selector ) { 3825 push.apply( results, seed ); 3826 return results; 3827 } 3828 3829 break; 3830 } 3831 } 3832 } 3833 } 3834 3835 // Compile and execute a filtering function if one is not provided 3836 // Provide `match` to avoid retokenization if we modified the selector above 3837 ( compiled || compile( selector, match ) )( 3838 seed, 3839 context, 3840 !documentIsHTML, 3841 results, 3842 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 3843 ); 3844 return results; 3845}; 3846 3847// One-time assignments 3848 3849// Sort stability 3850support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 3851 3852// Support: Chrome 14-35+ 3853// Always assume duplicates if they aren't passed to the comparison function 3854support.detectDuplicates = !!hasDuplicate; 3855 3856// Initialize against the default document 3857setDocument(); 3858 3859// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 3860// Detached nodes confoundingly follow *each other* 3861support.sortDetached = assert( function( el ) { 3862 3863 // Should return 1, but returns 4 (following) 3864 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 3865} ); 3866 3867// Support: IE<8 3868// Prevent attribute/property "interpolation" 3869// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 3870if ( !assert( function( el ) { 3871 el.innerHTML = "<a href='#'></a>"; 3872 return el.firstChild.getAttribute( "href" ) === "#"; 3873} ) ) { 3874 addHandle( "type|href|height|width", function( elem, name, isXML ) { 3875 if ( !isXML ) { 3876 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 3877 } 3878 } ); 3879} 3880 3881// Support: IE<9 3882// Use defaultValue in place of getAttribute("value") 3883if ( !support.attributes || !assert( function( el ) { 3884 el.innerHTML = "<input/>"; 3885 el.firstChild.setAttribute( "value", "" ); 3886 return el.firstChild.getAttribute( "value" ) === ""; 3887} ) ) { 3888 addHandle( "value", function( elem, _name, isXML ) { 3889 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 3890 return elem.defaultValue; 3891 } 3892 } ); 3893} 3894 3895// Support: IE<9 3896// Use getAttributeNode to fetch booleans when getAttribute lies 3897if ( !assert( function( el ) { 3898 return el.getAttribute( "disabled" ) == null; 3899} ) ) { 3900 addHandle( booleans, function( elem, name, isXML ) { 3901 var val; 3902 if ( !isXML ) { 3903 return elem[ name ] === true ? name.toLowerCase() : 3904 ( val = elem.getAttributeNode( name ) ) && val.specified ? 3905 val.value : 3906 null; 3907 } 3908 } ); 3909} 3910 3911return Sizzle; 3912 3913} )( window ); 3914 3915 3916 3917jQuery.find = Sizzle; 3918jQuery.expr = Sizzle.selectors; 3919 3920// Deprecated 3921jQuery.expr[ ":" ] = jQuery.expr.pseudos; 3922jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 3923jQuery.text = Sizzle.getText; 3924jQuery.isXMLDoc = Sizzle.isXML; 3925jQuery.contains = Sizzle.contains; 3926jQuery.escapeSelector = Sizzle.escape; 3927 3928 3929 3930 3931var dir = function( elem, dir, until ) { 3932 var matched = [], 3933 truncate = until !== undefined; 3934 3935 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 3936 if ( elem.nodeType === 1 ) { 3937 if ( truncate && jQuery( elem ).is( until ) ) { 3938 break; 3939 } 3940 matched.push( elem ); 3941 } 3942 } 3943 return matched; 3944}; 3945 3946 3947var siblings = function( n, elem ) { 3948 var matched = []; 3949 3950 for ( ; n; n = n.nextSibling ) { 3951 if ( n.nodeType === 1 && n !== elem ) { 3952 matched.push( n ); 3953 } 3954 } 3955 3956 return matched; 3957}; 3958 3959 3960var rneedsContext = jQuery.expr.match.needsContext; 3961 3962 3963 3964function nodeName( elem, name ) { 3965 3966 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 3967 3968}; 3969var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 3970 3971 3972 3973// Implement the identical functionality for filter and not 3974function winnow( elements, qualifier, not ) { 3975 if ( isFunction( qualifier ) ) { 3976 return jQuery.grep( elements, function( elem, i ) { 3977 return !!qualifier.call( elem, i, elem ) !== not; 3978 } ); 3979 } 3980 3981 // Single element 3982 if ( qualifier.nodeType ) { 3983 return jQuery.grep( elements, function( elem ) { 3984 return ( elem === qualifier ) !== not; 3985 } ); 3986 } 3987 3988 // Arraylike of elements (jQuery, arguments, Array) 3989 if ( typeof qualifier !== "string" ) { 3990 return jQuery.grep( elements, function( elem ) { 3991 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 3992 } ); 3993 } 3994 3995 // Filtered directly for both simple and complex selectors 3996 return jQuery.filter( qualifier, elements, not ); 3997} 3998 3999jQuery.filter = function( expr, elems, not ) { 4000 var elem = elems[ 0 ]; 4001 4002 if ( not ) { 4003 expr = ":not(" + expr + ")"; 4004 } 4005 4006 if ( elems.length === 1 && elem.nodeType === 1 ) { 4007 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 4008 } 4009 4010 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 4011 return elem.nodeType === 1; 4012 } ) ); 4013}; 4014 4015jQuery.fn.extend( { 4016 find: function( selector ) { 4017 var i, ret, 4018 len = this.length, 4019 self = this; 4020 4021 if ( typeof selector !== "string" ) { 4022 return this.pushStack( jQuery( selector ).filter( function() { 4023 for ( i = 0; i < len; i++ ) { 4024 if ( jQuery.contains( self[ i ], this ) ) { 4025 return true; 4026 } 4027 } 4028 } ) ); 4029 } 4030 4031 ret = this.pushStack( [] ); 4032 4033 for ( i = 0; i < len; i++ ) { 4034 jQuery.find( selector, self[ i ], ret ); 4035 } 4036 4037 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 4038 }, 4039 filter: function( selector ) { 4040 return this.pushStack( winnow( this, selector || [], false ) ); 4041 }, 4042 not: function( selector ) { 4043 return this.pushStack( winnow( this, selector || [], true ) ); 4044 }, 4045 is: function( selector ) { 4046 return !!winnow( 4047 this, 4048 4049 // If this is a positional/relative selector, check membership in the returned set 4050 // so $("p:first").is("p:last") won't return true for a doc with two "p". 4051 typeof selector === "string" && rneedsContext.test( selector ) ? 4052 jQuery( selector ) : 4053 selector || [], 4054 false 4055 ).length; 4056 } 4057} ); 4058 4059 4060// Initialize a jQuery object 4061 4062 4063// A central reference to the root jQuery(document) 4064var rootjQuery, 4065 4066 // A simple way to check for HTML strings 4067 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 4068 // Strict HTML recognition (#11290: must start with <) 4069 // Shortcut simple #id case for speed 4070 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 4071 4072 init = jQuery.fn.init = function( selector, context, root ) { 4073 var match, elem; 4074 4075 // HANDLE: $(""), $(null), $(undefined), $(false) 4076 if ( !selector ) { 4077 return this; 4078 } 4079 4080 // Method init() accepts an alternate rootjQuery
vendor: 32,101 bytes, lines 4081-5302
4081 // so migrate can support jQuery.sub (gh-2101) 4082 root = root || rootjQuery; 4083 4084 // Handle HTML strings 4085 if ( typeof selector === "string" ) { 4086 if ( selector[ 0 ] === "<" && 4087 selector[ selector.length - 1 ] === ">" && 4088 selector.length >= 3 ) { 4089 4090 // Assume that strings that start and end with <> are HTML and skip the regex check 4091 match = [ null, selector, null ]; 4092 4093 } else { 4094 match = rquickExpr.exec( selector ); 4095 } 4096 4097 // Match html or make sure no context is specified for #id 4098 if ( match && ( match[ 1 ] || !context ) ) { 4099 4100 // HANDLE: $(html) -> $(array) 4101 if ( match[ 1 ] ) { 4102 context = context instanceof jQuery ? context[ 0 ] : context; 4103 4104 // Option to run scripts is true for back-compat 4105 // Intentionally let the error be thrown if parseHTML is not present 4106 jQuery.merge( this, jQuery.parseHTML( 4107 match[ 1 ], 4108 context && context.nodeType ? context.ownerDocument || context : document, 4109 true 4110 ) ); 4111 4112 // HANDLE: $(html, props) 4113 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 4114 for ( match in context ) { 4115 4116 // Properties of context are called as methods if possible 4117 if ( isFunction( this[ match ] ) ) { 4118 this[ match ]( context[ match ] ); 4119 4120 // ...and otherwise set as attributes 4121 } else { 4122 this.attr( match, context[ match ] ); 4123 } 4124 } 4125 } 4126 4127 return this; 4128 4129 // HANDLE: $(#id) 4130 } else { 4131 elem = document.getElementById( match[ 2 ] ); 4132 4133 if ( elem ) { 4134 4135 // Inject the element directly into the jQuery object 4136 this[ 0 ] = elem; 4137 this.length = 1; 4138 } 4139 return this; 4140 } 4141 4142 // HANDLE: $(expr, $(...)) 4143 } else if ( !context || context.jquery ) { 4144 return ( context || root ).find( selector ); 4145 4146 // HANDLE: $(expr, context) 4147 // (which is just equivalent to: $(context).find(expr) 4148 } else { 4149 return this.constructor( context ).find( selector ); 4150 } 4151 4152 // HANDLE: $(DOMElement) 4153 } else if ( selector.nodeType ) { 4154 this[ 0 ] = selector; 4155 this.length = 1; 4156 return this; 4157 4158 // HANDLE: $(function) 4159 // Shortcut for document ready 4160 } else if ( isFunction( selector ) ) { 4161 return root.ready !== undefined ? 4162 root.ready( selector ) : 4163 4164 // Execute immediately if ready is not present 4165 selector( jQuery ); 4166 } 4167 4168 return jQuery.makeArray( selector, this ); 4169 }; 4170 4171// Give the init function the jQuery prototype for later instantiation 4172init.prototype = jQuery.fn; 4173 4174// Initialize central reference 4175rootjQuery = jQuery( document ); 4176 4177 4178var rparentsprev = /^(?:parents|prev(?:Until|All))/, 4179 4180 // Methods guaranteed to produce a unique set when starting from a unique set 4181 guaranteedUnique = { 4182 children: true, 4183 contents: true, 4184 next: true, 4185 prev: true 4186 }; 4187 4188jQuery.fn.extend( { 4189 has: function( target ) { 4190 var targets = jQuery( target, this ), 4191 l = targets.length; 4192 4193 return this.filter( function() { 4194 var i = 0; 4195 for ( ; i < l; i++ ) { 4196 if ( jQuery.contains( this, targets[ i ] ) ) { 4197 return true; 4198 } 4199 } 4200 } ); 4201 }, 4202 4203 closest: function( selectors, context ) { 4204 var cur, 4205 i = 0, 4206 l = this.length, 4207 matched = [], 4208 targets = typeof selectors !== "string" && jQuery( selectors ); 4209 4210 // Positional selectors never match, since there's no _selection_ context 4211 if ( !rneedsContext.test( selectors ) ) { 4212 for ( ; i < l; i++ ) { 4213 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 4214 4215 // Always skip document fragments 4216 if ( cur.nodeType < 11 && ( targets ? 4217 targets.index( cur ) > -1 : 4218 4219 // Don't pass non-elements to Sizzle 4220 cur.nodeType === 1 && 4221 jQuery.find.matchesSelector( cur, selectors ) ) ) { 4222 4223 matched.push( cur ); 4224 break; 4225 } 4226 } 4227 } 4228 } 4229 4230 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 4231 }, 4232 4233 // Determine the position of an element within the set 4234 index: function( elem ) { 4235 4236 // No argument, return index in parent 4237 if ( !elem ) { 4238 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 4239 } 4240 4241 // Index in selector 4242 if ( typeof elem === "string" ) { 4243 return indexOf.call( jQuery( elem ), this[ 0 ] ); 4244 } 4245 4246 // Locate the position of the desired element 4247 return indexOf.call( this, 4248 4249 // If it receives a jQuery object, the first element is used 4250 elem.jquery ? elem[ 0 ] : elem 4251 ); 4252 }, 4253 4254 add: function( selector, context ) { 4255 return this.pushStack( 4256 jQuery.uniqueSort( 4257 jQuery.merge( this.get(), jQuery( selector, context ) ) 4258 ) 4259 ); 4260 }, 4261 4262 addBack: function( selector ) { 4263 return this.add( selector == null ? 4264 this.prevObject : this.prevObject.filter( selector ) 4265 ); 4266 } 4267} ); 4268 4269function sibling( cur, dir ) { 4270 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 4271 return cur; 4272} 4273 4274jQuery.each( { 4275 parent: function( elem ) { 4276 var parent = elem.parentNode; 4277 return parent && parent.nodeType !== 11 ? parent : null; 4278 }, 4279 parents: function( elem ) { 4280 return dir( elem, "parentNode" ); 4281 }, 4282 parentsUntil: function( elem, _i, until ) { 4283 return dir( elem, "parentNode", until ); 4284 }, 4285 next: function( elem ) { 4286 return sibling( elem, "nextSibling" ); 4287 }, 4288 prev: function( elem ) { 4289 return sibling( elem, "previousSibling" ); 4290 }, 4291 nextAll: function( elem ) { 4292 return dir( elem, "nextSibling" ); 4293 }, 4294 prevAll: function( elem ) { 4295 return dir( elem, "previousSibling" ); 4296 }, 4297 nextUntil: function( elem, _i, until ) { 4298 return dir( elem, "nextSibling", until ); 4299 }, 4300 prevUntil: function( elem, _i, until ) { 4301 return dir( elem, "previousSibling", until ); 4302 }, 4303 siblings: function( elem ) { 4304 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 4305 }, 4306 children: function( elem ) { 4307 return siblings( elem.firstChild ); 4308 }, 4309 contents: function( elem ) { 4310 if ( elem.contentDocument != null && 4311 4312 // Support: IE 11+ 4313 // <object> elements with no `data` attribute has an object 4314 // `contentDocument` with a `null` prototype. 4315 getProto( elem.contentDocument ) ) { 4316 4317 return elem.contentDocument; 4318 } 4319 4320 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 4321 // Treat the template element as a regular one in browsers that 4322 // don't support it. 4323 if ( nodeName( elem, "template" ) ) { 4324 elem = elem.content || elem; 4325 } 4326 4327 return jQuery.merge( [], elem.childNodes ); 4328 } 4329}, function( name, fn ) { 4330 jQuery.fn[ name ] = function( until, selector ) { 4331 var matched = jQuery.map( this, fn, until ); 4332 4333 if ( name.slice( -5 ) !== "Until" ) { 4334 selector = until; 4335 } 4336 4337 if ( selector && typeof selector === "string" ) { 4338 matched = jQuery.filter( selector, matched ); 4339 } 4340 4341 if ( this.length > 1 ) { 4342 4343 // Remove duplicates 4344 if ( !guaranteedUnique[ name ] ) { 4345 jQuery.uniqueSort( matched ); 4346 } 4347 4348 // Reverse order for parents* and prev-derivatives 4349 if ( rparentsprev.test( name ) ) { 4350 matched.reverse(); 4351 } 4352 } 4353 4354 return this.pushStack( matched ); 4355 }; 4356} ); 4357var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 4358 4359 4360 4361// Convert String-formatted options into Object-formatted ones 4362function createOptions( options ) { 4363 var object = {}; 4364 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 4365 object[ flag ] = true; 4366 } ); 4367 return object; 4368} 4369 4370/* 4371 * Create a callback list using the following parameters: 4372 * 4373 * options: an optional list of space-separated options that will change how 4374 * the callback list behaves or a more traditional option object 4375 * 4376 * By default a callback list will act like an event callback list and can be 4377 * "fired" multiple times. 4378 * 4379 * Possible options: 4380 * 4381 * once: will ensure the callback list can only be fired once (like a Deferred) 4382 * 4383 * memory: will keep track of previous values and will call any callback added 4384 * after the list has been fired right away with the latest "memorized" 4385 * values (like a Deferred) 4386 * 4387 * unique: will ensure a callback can only be added once (no duplicate in the list) 4388 * 4389 * stopOnFalse: interrupt callings when a callback returns false 4390 * 4391 */ 4392jQuery.Callbacks = function( options ) { 4393 4394 // Convert options from String-formatted to Object-formatted if needed 4395 // (we check in cache first) 4396 options = typeof options === "string" ? 4397 createOptions( options ) : 4398 jQuery.extend( {}, options ); 4399 4400 var // Flag to know if list is currently firing 4401 firing, 4402 4403 // Last fire value for non-forgettable lists 4404 memory, 4405 4406 // Flag to know if list was already fired 4407 fired, 4408 4409 // Flag to prevent firing 4410 locked, 4411 4412 // Actual callback list 4413 list = [], 4414 4415 // Queue of execution data for repeatable lists 4416 queue = [], 4417 4418 // Index of currently firing callback (modified by add/remove as needed) 4419 firingIndex = -1, 4420 4421 // Fire callbacks 4422 fire = function() { 4423 4424 // Enforce single-firing 4425 locked = locked || options.once; 4426 4427 // Execute callbacks for all pending executions, 4428 // respecting firingIndex overrides and runtime changes 4429 fired = firing = true; 4430 for ( ; queue.length; firingIndex = -1 ) { 4431 memory = queue.shift(); 4432 while ( ++firingIndex < list.length ) { 4433 4434 // Run callback and check for early termination 4435 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 4436 options.stopOnFalse ) { 4437 4438 // Jump to end and forget the data so .add doesn't re-fire 4439 firingIndex = list.length; 4440 memory = false; 4441 } 4442 } 4443 } 4444 4445 // Forget the data if we're done with it 4446 if ( !options.memory ) { 4447 memory = false; 4448 } 4449 4450 firing = false; 4451 4452 // Clean up if we're done firing for good 4453 if ( locked ) { 4454 4455 // Keep an empty list if we have data for future add calls 4456 if ( memory ) { 4457 list = []; 4458 4459 // Otherwise, this object is spent 4460 } else { 4461 list = ""; 4462 } 4463 } 4464 }, 4465 4466 // Actual Callbacks object 4467 self = { 4468 4469 // Add a callback or a collection of callbacks to the list 4470 add: function() { 4471 if ( list ) { 4472 4473 // If we have memory from a past run, we should fire after adding 4474 if ( memory && !firing ) { 4475 firingIndex = list.length - 1; 4476 queue.push( memory ); 4477 } 4478 4479 ( function add( args ) { 4480 jQuery.each( args, function( _, arg ) { 4481 if ( isFunction( arg ) ) { 4482 if ( !options.unique || !self.has( arg ) ) { 4483 list.push( arg ); 4484 } 4485 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 4486 4487 // Inspect recursively 4488 add( arg ); 4489 } 4490 } ); 4491 } )( arguments ); 4492 4493 if ( memory && !firing ) { 4494 fire(); 4495 } 4496 } 4497 return this; 4498 }, 4499 4500 // Remove a callback from the list 4501 remove: function() { 4502 jQuery.each( arguments, function( _, arg ) { 4503 var index; 4504 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 4505 list.splice( index, 1 ); 4506 4507 // Handle firing indexes 4508 if ( index <= firingIndex ) { 4509 firingIndex--; 4510 } 4511 } 4512 } ); 4513 return this; 4514 }, 4515 4516 // Check if a given callback is in the list. 4517 // If no argument is given, return whether or not list has callbacks attached. 4518 has: function( fn ) { 4519 return fn ? 4520 jQuery.inArray( fn, list ) > -1 : 4521 list.length > 0; 4522 }, 4523 4524 // Remove all callbacks from the list 4525 empty: function() { 4526 if ( list ) { 4527 list = []; 4528 } 4529 return this; 4530 }, 4531 4532 // Disable .fire and .add 4533 // Abort any current/pending executions 4534 // Clear all callbacks and values 4535 disable: function() { 4536 locked = queue = []; 4537 list = memory = ""; 4538 return this; 4539 }, 4540 disabled: function() { 4541 return !list; 4542 }, 4543 4544 // Disable .fire 4545 // Also disable .add unless we have memory (since it would have no effect) 4546 // Abort any pending executions 4547 lock: function() { 4548 locked = queue = []; 4549 if ( !memory && !firing ) { 4550 list = memory = ""; 4551 } 4552 return this; 4553 }, 4554 locked: function() { 4555 return !!locked; 4556 }, 4557 4558 // Call all callbacks with the given context and arguments 4559 fireWith: function( context, args ) { 4560 if ( !locked ) { 4561 args = args || []; 4562 args = [ context, args.slice ? args.slice() : args ]; 4563 queue.push( args ); 4564 if ( !firing ) { 4565 fire(); 4566 } 4567 } 4568 return this; 4569 }, 4570 4571 // Call all the callbacks with the given arguments 4572 fire: function() { 4573 self.fireWith( this, arguments ); 4574 return this; 4575 }, 4576 4577 // To know if the callbacks have already been called at least once 4578 fired: function() { 4579 return !!fired; 4580 } 4581 }; 4582 4583 return self; 4584}; 4585 4586 4587function Identity( v ) { 4588 return v; 4589} 4590function Thrower( ex ) { 4591 throw ex; 4592} 4593 4594function adoptValue( value, resolve, reject, noValue ) { 4595 var method; 4596 4597 try { 4598 4599 // Check for promise aspect first to privilege synchronous behavior 4600 if ( value && isFunction( ( method = value.promise ) ) ) { 4601 method.call( value ).done( resolve ).fail( reject ); 4602 4603 // Other thenables 4604 } else if ( value && isFunction( ( method = value.then ) ) ) { 4605 method.call( value, resolve, reject ); 4606 4607 // Other non-thenables 4608 } else { 4609 4610 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 4611 // * false: [ value ].slice( 0 ) => resolve( value ) 4612 // * true: [ value ].slice( 1 ) => resolve() 4613 resolve.apply( undefined, [ value ].slice( noValue ) ); 4614 } 4615 4616 // For Promises/A+, convert exceptions into rejections 4617 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 4618 // Deferred#then to conditionally suppress rejection. 4619 } catch ( value ) { 4620 4621 // Support: Android 4.0 only 4622 // Strict mode functions invoked without .call/.apply get global-object context 4623 reject.apply( undefined, [ value ] ); 4624 } 4625} 4626 4627jQuery.extend( { 4628 4629 Deferred: function( func ) { 4630 var tuples = [ 4631 4632 // action, add listener, callbacks, 4633 // ... .then handlers, argument index, [final state] 4634 [ "notify", "progress", jQuery.Callbacks( "memory" ), 4635 jQuery.Callbacks( "memory" ), 2 ], 4636 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 4637 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 4638 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 4639 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 4640 ], 4641 state = "pending", 4642 promise = { 4643 state: function() { 4644 return state; 4645 }, 4646 always: function() { 4647 deferred.done( arguments ).fail( arguments ); 4648 return this; 4649 }, 4650 "catch": function( fn ) { 4651 return promise.then( null, fn ); 4652 }, 4653 4654 // Keep pipe for back-compat 4655 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 4656 var fns = arguments; 4657 4658 return jQuery.Deferred( function( newDefer ) { 4659 jQuery.each( tuples, function( _i, tuple ) { 4660 4661 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 4662 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 4663 4664 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 4665 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 4666 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 4667 deferred[ tuple[ 1 ] ]( function() { 4668 var returned = fn && fn.apply( this, arguments ); 4669 if ( returned && isFunction( returned.promise ) ) { 4670 returned.promise() 4671 .progress( newDefer.notify ) 4672 .done( newDefer.resolve ) 4673 .fail( newDefer.reject ); 4674 } else { 4675 newDefer[ tuple[ 0 ] + "With" ]( 4676 this, 4677 fn ? [ returned ] : arguments 4678 ); 4679 } 4680 } ); 4681 } ); 4682 fns = null; 4683 } ).promise(); 4684 }, 4685 then: function( onFulfilled, onRejected, onProgress ) { 4686 var maxDepth = 0; 4687 function resolve( depth, deferred, handler, special ) { 4688 return function() { 4689 var that = this, 4690 args = arguments, 4691 mightThrow = function() { 4692 var returned, then; 4693 4694 // Support: Promises/A+ section 2.3.3.3.3 4695 // https://promisesaplus.com/#point-59 4696 // Ignore double-resolution attempts 4697 if ( depth < maxDepth ) { 4698 return; 4699 } 4700 4701 returned = handler.apply( that, args ); 4702 4703 // Support: Promises/A+ section 2.3.1 4704 // https://promisesaplus.com/#point-48 4705 if ( returned === deferred.promise() ) { 4706 throw new TypeError( "Thenable self-resolution" ); 4707 } 4708 4709 // Support: Promises/A+ sections 2.3.3.1, 3.5 4710 // https://promisesaplus.com/#point-54 4711 // https://promisesaplus.com/#point-75 4712 // Retrieve `then` only once 4713 then = returned && 4714 4715 // Support: Promises/A+ section 2.3.4 4716 // https://promisesaplus.com/#point-64 4717 // Only check objects and functions for thenability 4718 ( typeof returned === "object" || 4719 typeof returned === "function" ) && 4720 returned.then; 4721 4722 // Handle a returned thenable 4723 if ( isFunction( then ) ) { 4724 4725 // Special processors (notify) just wait for resolution 4726 if ( special ) { 4727 then.call( 4728 returned, 4729 resolve( maxDepth, deferred, Identity, special ), 4730 resolve( maxDepth, deferred, Thrower, special ) 4731 ); 4732 4733 // Normal processors (resolve) also hook into progress 4734 } else { 4735 4736 // ...and disregard older resolution values 4737 maxDepth++; 4738 4739 then.call( 4740 returned, 4741 resolve( maxDepth, deferred, Identity, special ), 4742 resolve( maxDepth, deferred, Thrower, special ), 4743 resolve( maxDepth, deferred, Identity, 4744 deferred.notifyWith ) 4745 ); 4746 } 4747 4748 // Handle all other returned values 4749 } else { 4750 4751 // Only substitute handlers pass on context 4752 // and multiple values (non-spec behavior) 4753 if ( handler !== Identity ) { 4754 that = undefined; 4755 args = [ returned ]; 4756 } 4757 4758 // Process the value(s) 4759 // Default process is resolve 4760 ( special || deferred.resolveWith )( that, args ); 4761 } 4762 }, 4763 4764 // Only normal processors (resolve) catch and reject exceptions 4765 process = special ? 4766 mightThrow : 4767 function() { 4768 try { 4769 mightThrow(); 4770 } catch ( e ) { 4771 4772 if ( jQuery.Deferred.exceptionHook ) { 4773 jQuery.Deferred.exceptionHook( e, 4774 process.stackTrace ); 4775 } 4776 4777 // Support: Promises/A+ section 2.3.3.3.4.1 4778 // https://promisesaplus.com/#point-61 4779 // Ignore post-resolution exceptions 4780 if ( depth + 1 >= maxDepth ) { 4781 4782 // Only substitute handlers pass on context 4783 // and multiple values (non-spec behavior) 4784 if ( handler !== Thrower ) { 4785 that = undefined; 4786 args = [ e ]; 4787 } 4788 4789 deferred.rejectWith( that, args ); 4790 } 4791 } 4792 }; 4793 4794 // Support: Promises/A+ section 2.3.3.3.1 4795 // https://promisesaplus.com/#point-57 4796 // Re-resolve promises immediately to dodge false rejection from 4797 // subsequent errors 4798 if ( depth ) { 4799 process(); 4800 } else { 4801 4802 // Call an optional hook to record the stack, in case of exception 4803 // since it's otherwise lost when execution goes async 4804 if ( jQuery.Deferred.getStackHook ) { 4805 process.stackTrace = jQuery.Deferred.getStackHook(); 4806 } 4807 window.setTimeout( process ); 4808 } 4809 }; 4810 } 4811 4812 return jQuery.Deferred( function( newDefer ) { 4813 4814 // progress_handlers.add( ... ) 4815 tuples[ 0 ][ 3 ].add( 4816 resolve( 4817 0, 4818 newDefer, 4819 isFunction( onProgress ) ? 4820 onProgress : 4821 Identity, 4822 newDefer.notifyWith 4823 ) 4824 ); 4825 4826 // fulfilled_handlers.add( ... ) 4827 tuples[ 1 ][ 3 ].add( 4828 resolve( 4829 0, 4830 newDefer, 4831 isFunction( onFulfilled ) ? 4832 onFulfilled : 4833 Identity 4834 ) 4835 ); 4836 4837 // rejected_handlers.add( ... ) 4838 tuples[ 2 ][ 3 ].add( 4839 resolve( 4840 0, 4841 newDefer, 4842 isFunction( onRejected ) ? 4843 onRejected : 4844 Thrower 4845 ) 4846 ); 4847 } ).promise(); 4848 }, 4849 4850 // Get a promise for this deferred 4851 // If obj is provided, the promise aspect is added to the object 4852 promise: function( obj ) { 4853 return obj != null ? jQuery.extend( obj, promise ) : promise; 4854 } 4855 }, 4856 deferred = {}; 4857 4858 // Add list-specific methods 4859 jQuery.each( tuples, function( i, tuple ) { 4860 var list = tuple[ 2 ], 4861 stateString = tuple[ 5 ]; 4862 4863 // promise.progress = list.add 4864 // promise.done = list.add 4865 // promise.fail = list.add 4866 promise[ tuple[ 1 ] ] = list.add; 4867 4868 // Handle state 4869 if ( stateString ) { 4870 list.add( 4871 function() { 4872 4873 // state = "resolved" (i.e., fulfilled) 4874 // state = "rejected" 4875 state = stateString; 4876 }, 4877 4878 // rejected_callbacks.disable 4879 // fulfilled_callbacks.disable 4880 tuples[ 3 - i ][ 2 ].disable, 4881 4882 // rejected_handlers.disable 4883 // fulfilled_handlers.disable 4884 tuples[ 3 - i ][ 3 ].disable, 4885 4886 // progress_callbacks.lock 4887 tuples[ 0 ][ 2 ].lock, 4888 4889 // progress_handlers.lock 4890 tuples[ 0 ][ 3 ].lock 4891 ); 4892 } 4893 4894 // progress_handlers.fire 4895 // fulfilled_handlers.fire 4896 // rejected_handlers.fire 4897 list.add( tuple[ 3 ].fire ); 4898 4899 // deferred.notify = function() { deferred.notifyWith(...) } 4900 // deferred.resolve = function() { deferred.resolveWith(...) } 4901 // deferred.reject = function() { deferred.rejectWith(...) } 4902 deferred[ tuple[ 0 ] ] = function() { 4903 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 4904 return this; 4905 }; 4906 4907 // deferred.notifyWith = list.fireWith 4908 // deferred.resolveWith = list.fireWith 4909 // deferred.rejectWith = list.fireWith 4910 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 4911 } ); 4912 4913 // Make the deferred a promise 4914 promise.promise( deferred ); 4915 4916 // Call given func if any 4917 if ( func ) { 4918 func.call( deferred, deferred ); 4919 } 4920 4921 // All done! 4922 return deferred; 4923 }, 4924 4925 // Deferred helper 4926 when: function( singleValue ) { 4927 var 4928 4929 // count of uncompleted subordinates 4930 remaining = arguments.length, 4931 4932 // count of unprocessed arguments 4933 i = remaining, 4934 4935 // subordinate fulfillment data 4936 resolveContexts = Array( i ), 4937 resolveValues = slice.call( arguments ), 4938 4939 // the master Deferred 4940 master = jQuery.Deferred(), 4941 4942 // subordinate callback factory 4943 updateFunc = function( i ) { 4944 return function( value ) { 4945 resolveContexts[ i ] = this; 4946 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 4947 if ( !( --remaining ) ) { 4948 master.resolveWith( resolveContexts, resolveValues ); 4949 } 4950 }; 4951 }; 4952 4953 // Single- and empty arguments are adopted like Promise.resolve 4954 if ( remaining <= 1 ) { 4955 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 4956 !remaining ); 4957 4958 // Use .then() to unwrap secondary thenables (cf. gh-3000) 4959 if ( master.state() === "pending" || 4960 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 4961 4962 return master.then(); 4963 } 4964 } 4965 4966 // Multiple arguments are aggregated like Promise.all array elements 4967 while ( i-- ) { 4968 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 4969 } 4970 4971 return master.promise(); 4972 } 4973} ); 4974 4975 4976// These usually indicate a programmer mistake during development, 4977// warn about them ASAP rather than swallowing them by default. 4978var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 4979 4980jQuery.Deferred.exceptionHook = function( error, stack ) { 4981 4982 // Support: IE 8 - 9 only 4983 // Console exists when dev tools are open, which can happen at any time 4984 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 4985 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 4986 } 4987}; 4988 4989 4990 4991 4992jQuery.readyException = function( error ) { 4993 window.setTimeout( function() { 4994 throw error; 4995 } ); 4996}; 4997 4998 4999 5000 5001// The deferred used on DOM ready 5002var readyList = jQuery.Deferred(); 5003 5004jQuery.fn.ready = function( fn ) { 5005 5006 readyList 5007 .then( fn ) 5008 5009 // Wrap jQuery.readyException in a function so that the lookup 5010 // happens at the time of error handling instead of callback 5011 // registration. 5012 .catch( function( error ) { 5013 jQuery.readyException( error ); 5014 } ); 5015 5016 return this; 5017}; 5018 5019jQuery.extend( { 5020 5021 // Is the DOM ready to be used? Set to true once it occurs. 5022 isReady: false, 5023 5024 // A counter to track how many items to wait for before 5025 // the ready event fires. See #6781 5026 readyWait: 1, 5027 5028 // Handle when the DOM is ready 5029 ready: function( wait ) { 5030 5031 // Abort if there are pending holds or we're already ready 5032 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 5033 return; 5034 } 5035 5036 // Remember that the DOM is ready 5037 jQuery.isReady = true; 5038 5039 // If a normal DOM Ready event fired, decrement, and wait if need be 5040 if ( wait !== true && --jQuery.readyWait > 0 ) { 5041 return; 5042 } 5043 5044 // If there are functions bound, to execute 5045 readyList.resolveWith( document, [ jQuery ] ); 5046 } 5047} ); 5048 5049jQuery.ready.then = readyList.then; 5050 5051// The ready event handler and self cleanup method 5052function completed() { 5053 document.removeEventListener( "DOMContentLoaded", completed ); 5054 window.removeEventListener( "load", completed ); 5055 jQuery.ready(); 5056} 5057 5058// Catch cases where $(document).ready() is called 5059// after the browser event has already occurred. 5060// Support: IE <=9 - 10 only 5061// Older IE sometimes signals "interactive" too soon 5062if ( document.readyState === "complete" || 5063 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 5064 5065 // Handle it asynchronously to allow scripts the opportunity to delay ready 5066 window.setTimeout( jQuery.ready ); 5067 5068} else { 5069 5070 // Use the handy event callback 5071 document.addEventListener( "DOMContentLoaded", completed ); 5072 5073 // A fallback to window.onload, that will always work 5074 window.addEventListener( "load", completed ); 5075} 5076 5077 5078 5079 5080// Multifunctional method to get and set values of a collection 5081// The value/s can optionally be executed if it's a function 5082var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 5083 var i = 0, 5084 len = elems.length, 5085 bulk = key == null; 5086 5087 // Sets many values 5088 if ( toType( key ) === "object" ) { 5089 chainable = true; 5090 for ( i in key ) { 5091 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 5092 } 5093 5094 // Sets one value 5095 } else if ( value !== undefined ) { 5096 chainable = true; 5097 5098 if ( !isFunction( value ) ) { 5099 raw = true; 5100 } 5101 5102 if ( bulk ) { 5103 5104 // Bulk operations run against the entire set 5105 if ( raw ) { 5106 fn.call( elems, value ); 5107 fn = null; 5108 5109 // ...except when executing function values 5110 } else { 5111 bulk = fn; 5112 fn = function( elem, _key, value ) { 5113 return bulk.call( jQuery( elem ), value ); 5114 }; 5115 } 5116 } 5117 5118 if ( fn ) { 5119 for ( ; i < len; i++ ) { 5120 fn( 5121 elems[ i ], key, raw ? 5122 value : 5123 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 5124 ); 5125 } 5126 } 5127 } 5128 5129 if ( chainable ) { 5130 return elems; 5131 } 5132 5133 // Gets 5134 if ( bulk ) { 5135 return fn.call( elems ); 5136 } 5137 5138 return len ? fn( elems[ 0 ], key ) : emptyGet; 5139}; 5140 5141 5142// Matches dashed string for camelizing 5143var rmsPrefix = /^-ms-/, 5144 rdashAlpha = /-([a-z])/g; 5145 5146// Used by camelCase as callback to replace() 5147function fcamelCase( _all, letter ) { 5148 return letter.toUpperCase(); 5149} 5150 5151// Convert dashed to camelCase; used by the css and data modules 5152// Support: IE <=9 - 11, Edge 12 - 15 5153// Microsoft forgot to hump their vendor prefix (#9572) 5154function camelCase( string ) { 5155 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 5156} 5157var acceptData = function( owner ) { 5158 5159 // Accepts only: 5160 // - Node 5161 // - Node.ELEMENT_NODE 5162 // - Node.DOCUMENT_NODE 5163 // - Object 5164 // - Any 5165 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 5166}; 5167 5168 5169 5170 5171function Data() { 5172 this.expando = jQuery.expando + Data.uid++; 5173} 5174 5175Data.uid = 1; 5176 5177Data.prototype = { 5178 5179 cache: function( owner ) { 5180 5181 // Check if the owner object already has a cache 5182 var value = owner[ this.expando ]; 5183 5184 // If not, create one 5185 if ( !value ) { 5186 value = {}; 5187 5188 // We can accept data for non-element nodes in modern browsers, 5189 // but we should not, see #8335. 5190 // Always return an empty object. 5191 if ( acceptData( owner ) ) { 5192 5193 // If it is a node unlikely to be stringify-ed or looped over 5194 // use plain assignment 5195 if ( owner.nodeType ) { 5196 owner[ this.expando ] = value; 5197 5198 // Otherwise secure it in a non-enumerable property 5199 // configurable must be true to allow the property to be 5200 // deleted when data is removed 5201 } else { 5202 Object.defineProperty( owner, this.expando, { 5203 value: value, 5204 configurable: true 5205 } ); 5206 } 5207 } 5208 } 5209 5210 return value; 5211 }, 5212 set: function( owner, data, value ) { 5213 var prop, 5214 cache = this.cache( owner ); 5215 5216 // Handle: [ owner, key, value ] args 5217 // Always use camelCase key (gh-2257) 5218 if ( typeof data === "string" ) { 5219 cache[ camelCase( data ) ] = value; 5220 5221 // Handle: [ owner, { properties } ] args 5222 } else { 5223 5224 // Copy the properties one-by-one to the cache object 5225 for ( prop in data ) { 5226 cache[ camelCase( prop ) ] = data[ prop ]; 5227 } 5228 } 5229 return cache; 5230 }, 5231 get: function( owner, key ) { 5232 return key === undefined ? 5233 this.cache( owner ) : 5234 5235 // Always use camelCase key (gh-2257) 5236 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 5237 }, 5238 access: function( owner, key, value ) { 5239 5240 // In cases where either: 5241 // 5242 // 1. No key was specified 5243 // 2. A string key was specified, but no value provided 5244 // 5245 // Take the "read" path and allow the get method to determine 5246 // which value to return, respectively either: 5247 // 5248 // 1. The entire cache object 5249 // 2. The data stored at the key 5250 // 5251 if ( key === undefined || 5252 ( ( key && typeof key === "string" ) && value === undefined ) ) { 5253 5254 return this.get( owner, key ); 5255 } 5256 5257 // When the key is not a string, or both a key and value 5258 // are specified, set or extend (existing objects) with either: 5259 // 5260 // 1. An object of properties 5261 // 2. A key and value 5262 // 5263 this.set( owner, key, value ); 5264 5265 // Since the "set" path can have two possible entry points 5266 // return the expected data based on which path was taken[*] 5267 return value !== undefined ? value : key; 5268 }, 5269 remove: function( owner, key ) { 5270 var i, 5271 cache = owner[ this.expando ]; 5272 5273 if ( cache === undefined ) { 5274 return; 5275 } 5276 5277 if ( key !== undefined ) { 5278 5279 // Support array or space separated string of keys 5280 if ( Array.isArray( key ) ) { 5281 5282 // If key is an array of keys... 5283 // We always set camelCase keys, so remove that. 5284 key = key.map( camelCase ); 5285 } else { 5286 key = camelCase( key ); 5287 5288 // If a key with the spaces exists, use it. 5289 // Otherwise, create an array by matching non-whitespace 5290 key = key in cache ? 5291 [ key ] : 5292 ( key.match( rnothtmlwhite ) || [] ); 5293 } 5294 5295 i = key.length; 5296 5297 while ( i-- ) { 5298 delete cache[ key[ i ] ]; 5299 } 5300 } 5301 5302 // Remove the expando if there's no more data
vendor: 4,195 bytes, lines 5303-5461
5303 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 5304 5305 // Support: Chrome <=35 - 45 5306 // Webkit & Blink performance suffers when deleting properties 5307 // from DOM nodes, so set to undefined instead 5308 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 5309 if ( owner.nodeType ) { 5310 owner[ this.expando ] = undefined; 5311 } else { 5312 delete owner[ this.expando ]; 5313 } 5314 } 5315 }, 5316 hasData: function( owner ) { 5317 var cache = owner[ this.expando ]; 5318 return cache !== undefined && !jQuery.isEmptyObject( cache ); 5319 } 5320}; 5321var dataPriv = new Data(); 5322 5323var dataUser = new Data(); 5324 5325 5326 5327// Implementation Summary 5328// 5329// 1. Enforce API surface and semantic compatibility with 1.9.x branch 5330// 2. Improve the module's maintainability by reducing the storage 5331// paths to a single mechanism. 5332// 3. Use the same single mechanism to support "private" and "user" data. 5333// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 5334// 5. Avoid exposing implementation details on user objects (eg. expando properties) 5335// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 5336 5337var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 5338 rmultiDash = /[A-Z]/g; 5339 5340function getData( data ) { 5341 if ( data === "true" ) { 5342 return true; 5343 } 5344 5345 if ( data === "false" ) { 5346 return false; 5347 } 5348 5349 if ( data === "null" ) { 5350 return null; 5351 } 5352 5353 // Only convert to a number if it doesn't change the string 5354 if ( data === +data + "" ) { 5355 return +data; 5356 } 5357 5358 if ( rbrace.test( data ) ) { 5359 return JSON.parse( data ); 5360 } 5361 5362 return data; 5363} 5364 5365function dataAttr( elem, key, data ) { 5366 var name; 5367 5368 // If nothing was found internally, try to fetch any 5369 // data from the HTML5 data-* attribute 5370 if ( data === undefined && elem.nodeType === 1 ) { 5371 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 5372 data = elem.getAttribute( name ); 5373 5374 if ( typeof data === "string" ) { 5375 try { 5376 data = getData( data ); 5377 } catch ( e ) {} 5378 5379 // Make sure we set the data so it isn't changed later 5380 dataUser.set( elem, key, data ); 5381 } else { 5382 data = undefined; 5383 } 5384 } 5385 return data; 5386} 5387 5388jQuery.extend( { 5389 hasData: function( elem ) { 5390 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 5391 }, 5392 5393 data: function( elem, name, data ) { 5394 return dataUser.access( elem, name, data ); 5395 }, 5396 5397 removeData: function( elem, name ) { 5398 dataUser.remove( elem, name ); 5399 }, 5400 5401 // TODO: Now that all calls to _data and _removeData have been replaced 5402 // with direct calls to dataPriv methods, these can be deprecated. 5403 _data: function( elem, name, data ) { 5404 return dataPriv.access( elem, name, data ); 5405 }, 5406 5407 _removeData: function( elem, name ) { 5408 dataPriv.remove( elem, name ); 5409 } 5410} ); 5411 5412jQuery.fn.extend( { 5413 data: function( key, value ) { 5414 var i, name, data, 5415 elem = this[ 0 ], 5416 attrs = elem && elem.attributes; 5417 5418 // Gets all values 5419 if ( key === undefined ) { 5420 if ( this.length ) { 5421 data = dataUser.get( elem ); 5422 5423 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 5424 i = attrs.length; 5425 while ( i-- ) { 5426 5427 // Support: IE 11 only 5428 // The attrs elements can be null (#14894) 5429 if ( attrs[ i ] ) { 5430 name = attrs[ i ].name; 5431 if ( name.indexOf( "data-" ) === 0 ) { 5432 name = camelCase( name.slice( 5 ) ); 5433 dataAttr( elem, name, data[ name ] ); 5434 } 5435 } 5436 } 5437 dataPriv.set( elem, "hasDataAttrs", true ); 5438 } 5439 } 5440 5441 return data; 5442 } 5443 5444 // Sets multiple values 5445 if ( typeof key === "object" ) { 5446 return this.each( function() { 5447 dataUser.set( this, key ); 5448 } ); 5449 } 5450 5451 return access( this, function( value ) { 5452 var data; 5453 5454 // The calling jQuery object (element matches) is not empty 5455 // (and therefore has an element appears at this[ 0 ]) and the 5456 // `value` parameter was not undefined. An empty jQuery object 5457 // will result in `undefined` for elem = this[ 0 ] which will 5458 // throw an exception if an attempt to read a data cache is made. 5459 if ( elem && value === undefined ) { 5460 5461 // Attempt to get data from the cache
vendor: 10,196 bytes, lines 5462-5860
5462 // The key will always be camelCased in Data 5463 data = dataUser.get( elem, key ); 5464 if ( data !== undefined ) { 5465 return data; 5466 } 5467 5468 // Attempt to "discover" the data in 5469 // HTML5 custom data-* attrs 5470 data = dataAttr( elem, key ); 5471 if ( data !== undefined ) { 5472 return data; 5473 } 5474 5475 // We tried really hard, but the data doesn't exist. 5476 return; 5477 } 5478 5479 // Set the data... 5480 this.each( function() { 5481 5482 // We always store the camelCased key 5483 dataUser.set( this, key, value ); 5484 } ); 5485 }, null, value, arguments.length > 1, null, true ); 5486 }, 5487 5488 removeData: function( key ) { 5489 return this.each( function() { 5490 dataUser.remove( this, key ); 5491 } ); 5492 } 5493} ); 5494 5495 5496jQuery.extend( { 5497 queue: function( elem, type, data ) { 5498 var queue; 5499 5500 if ( elem ) { 5501 type = ( type || "fx" ) + "queue"; 5502 queue = dataPriv.get( elem, type ); 5503 5504 // Speed up dequeue by getting out quickly if this is just a lookup 5505 if ( data ) { 5506 if ( !queue || Array.isArray( data ) ) { 5507 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 5508 } else { 5509 queue.push( data ); 5510 } 5511 } 5512 return queue || []; 5513 } 5514 }, 5515 5516 dequeue: function( elem, type ) { 5517 type = type || "fx"; 5518 5519 var queue = jQuery.queue( elem, type ), 5520 startLength = queue.length, 5521 fn = queue.shift(), 5522 hooks = jQuery._queueHooks( elem, type ), 5523 next = function() { 5524 jQuery.dequeue( elem, type ); 5525 }; 5526 5527 // If the fx queue is dequeued, always remove the progress sentinel 5528 if ( fn === "inprogress" ) { 5529 fn = queue.shift(); 5530 startLength--; 5531 } 5532 5533 if ( fn ) { 5534 5535 // Add a progress sentinel to prevent the fx queue from being 5536 // automatically dequeued 5537 if ( type === "fx" ) { 5538 queue.unshift( "inprogress" ); 5539 } 5540 5541 // Clear up the last queue stop function 5542 delete hooks.stop; 5543 fn.call( elem, next, hooks ); 5544 } 5545 5546 if ( !startLength && hooks ) { 5547 hooks.empty.fire(); 5548 } 5549 }, 5550 5551 // Not public - generate a queueHooks object, or return the current one 5552 _queueHooks: function( elem, type ) { 5553 var key = type + "queueHooks"; 5554 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 5555 empty: jQuery.Callbacks( "once memory" ).add( function() { 5556 dataPriv.remove( elem, [ type + "queue", key ] ); 5557 } ) 5558 } ); 5559 } 5560} ); 5561 5562jQuery.fn.extend( { 5563 queue: function( type, data ) { 5564 var setter = 2; 5565 5566 if ( typeof type !== "string" ) { 5567 data = type; 5568 type = "fx"; 5569 setter--; 5570 } 5571 5572 if ( arguments.length < setter ) { 5573 return jQuery.queue( this[ 0 ], type ); 5574 } 5575 5576 return data === undefined ? 5577 this : 5578 this.each( function() { 5579 var queue = jQuery.queue( this, type, data ); 5580 5581 // Ensure a hooks for this queue 5582 jQuery._queueHooks( this, type ); 5583 5584 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 5585 jQuery.dequeue( this, type ); 5586 } 5587 } ); 5588 }, 5589 dequeue: function( type ) { 5590 return this.each( function() { 5591 jQuery.dequeue( this, type ); 5592 } ); 5593 }, 5594 clearQueue: function( type ) { 5595 return this.queue( type || "fx", [] ); 5596 }, 5597 5598 // Get a promise resolved when queues of a certain type 5599 // are emptied (fx is the type by default) 5600 promise: function( type, obj ) { 5601 var tmp, 5602 count = 1, 5603 defer = jQuery.Deferred(), 5604 elements = this, 5605 i = this.length, 5606 resolve = function() { 5607 if ( !( --count ) ) { 5608 defer.resolveWith( elements, [ elements ] ); 5609 } 5610 }; 5611 5612 if ( typeof type !== "string" ) { 5613 obj = type; 5614 type = undefined; 5615 } 5616 type = type || "fx"; 5617 5618 while ( i-- ) { 5619 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 5620 if ( tmp && tmp.empty ) { 5621 count++; 5622 tmp.empty.add( resolve ); 5623 } 5624 } 5625 resolve(); 5626 return defer.promise( obj ); 5627 } 5628} ); 5629var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 5630 5631var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 5632 5633 5634var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 5635 5636var documentElement = document.documentElement; 5637 5638 5639 5640 var isAttached = function( elem ) { 5641 return jQuery.contains( elem.ownerDocument, elem ); 5642 }, 5643 composed = { composed: true }; 5644 5645 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 5646 // Check attachment across shadow DOM boundaries when possible (gh-3504) 5647 // Support: iOS 10.0-10.2 only 5648 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 5649 // leading to errors. We need to check for `getRootNode`. 5650 if ( documentElement.getRootNode ) { 5651 isAttached = function( elem ) { 5652 return jQuery.contains( elem.ownerDocument, elem ) || 5653 elem.getRootNode( composed ) === elem.ownerDocument; 5654 }; 5655 } 5656var isHiddenWithinTree = function( elem, el ) { 5657 5658 // isHiddenWithinTree might be called from jQuery#filter function; 5659 // in that case, element will be second argument 5660 elem = el || elem; 5661 5662 // Inline style trumps all 5663 return elem.style.display === "none" || 5664 elem.style.display === "" && 5665 5666 // Otherwise, check computed style 5667 // Support: Firefox <=43 - 45 5668 // Disconnected elements can have computed display: none, so first confirm that elem is 5669 // in the document. 5670 isAttached( elem ) && 5671 5672 jQuery.css( elem, "display" ) === "none"; 5673 }; 5674 5675 5676 5677function adjustCSS( elem, prop, valueParts, tween ) { 5678 var adjusted, scale, 5679 maxIterations = 20, 5680 currentValue = tween ? 5681 function() { 5682 return tween.cur(); 5683 } : 5684 function() { 5685 return jQuery.css( elem, prop, "" ); 5686 }, 5687 initial = currentValue(), 5688 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 5689 5690 // Starting value computation is required for potential unit mismatches 5691 initialInUnit = elem.nodeType && 5692 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 5693 rcssNum.exec( jQuery.css( elem, prop ) ); 5694 5695 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 5696 5697 // Support: Firefox <=54 5698 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 5699 initial = initial / 2; 5700 5701 // Trust units reported by jQuery.css 5702 unit = unit || initialInUnit[ 3 ]; 5703 5704 // Iteratively approximate from a nonzero starting point 5705 initialInUnit = +initial || 1; 5706 5707 while ( maxIterations-- ) { 5708 5709 // Evaluate and update our best guess (doubling guesses that zero out). 5710 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 5711 jQuery.style( elem, prop, initialInUnit + unit ); 5712 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 5713 maxIterations = 0; 5714 } 5715 initialInUnit = initialInUnit / scale; 5716 5717 } 5718 5719 initialInUnit = initialInUnit * 2; 5720 jQuery.style( elem, prop, initialInUnit + unit ); 5721 5722 // Make sure we update the tween properties later on 5723 valueParts = valueParts || []; 5724 } 5725 5726 if ( valueParts ) { 5727 initialInUnit = +initialInUnit || +initial || 0; 5728 5729 // Apply relative offset (+=/-=) if specified 5730 adjusted = valueParts[ 1 ] ? 5731 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 5732 +valueParts[ 2 ]; 5733 if ( tween ) { 5734 tween.unit = unit; 5735 tween.start = initialInUnit; 5736 tween.end = adjusted; 5737 } 5738 } 5739 return adjusted; 5740} 5741 5742 5743var defaultDisplayMap = {}; 5744 5745function getDefaultDisplay( elem ) { 5746 var temp, 5747 doc = elem.ownerDocument, 5748 nodeName = elem.nodeName, 5749 display = defaultDisplayMap[ nodeName ]; 5750 5751 if ( display ) { 5752 return display; 5753 } 5754 5755 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 5756 display = jQuery.css( temp, "display" ); 5757 5758 temp.parentNode.removeChild( temp ); 5759 5760 if ( display === "none" ) { 5761 display = "block"; 5762 } 5763 defaultDisplayMap[ nodeName ] = display; 5764 5765 return display; 5766} 5767 5768function showHide( elements, show ) { 5769 var display, elem, 5770 values = [], 5771 index = 0, 5772 length = elements.length; 5773 5774 // Determine new display value for elements that need to change 5775 for ( ; index < length; index++ ) { 5776 elem = elements[ index ]; 5777 if ( !elem.style ) { 5778 continue; 5779 } 5780 5781 display = elem.style.display; 5782 if ( show ) { 5783 5784 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 5785 // check is required in this first loop unless we have a nonempty display value (either 5786 // inline or about-to-be-restored) 5787 if ( display === "none" ) { 5788 values[ index ] = dataPriv.get( elem, "display" ) || null; 5789 if ( !values[ index ] ) { 5790 elem.style.display = ""; 5791 } 5792 } 5793 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 5794 values[ index ] = getDefaultDisplay( elem ); 5795 } 5796 } else { 5797 if ( display !== "none" ) { 5798 values[ index ] = "none"; 5799 5800 // Remember what we're overwriting 5801 dataPriv.set( elem, "display", display ); 5802 } 5803 } 5804 } 5805 5806 // Set the display of the elements in a second loop to avoid constant reflow 5807 for ( index = 0; index < length; index++ ) { 5808 if ( values[ index ] != null ) { 5809 elements[ index ].style.display = values[ index ]; 5810 } 5811 } 5812 5813 return elements; 5814} 5815 5816jQuery.fn.extend( { 5817 show: function() { 5818 return showHide( this, true ); 5819 }, 5820 hide: function() { 5821 return showHide( this ); 5822 }, 5823 toggle: function( state ) { 5824 if ( typeof state === "boolean" ) { 5825 return state ? this.show() : this.hide(); 5826 } 5827 5828 return this.each( function() { 5829 if ( isHiddenWithinTree( this ) ) { 5830 jQuery( this ).show(); 5831 } else { 5832 jQuery( this ).hide(); 5833 } 5834 } ); 5835 } 5836} ); 5837var rcheckableType = ( /^(?:checkbox|radio)$/i ); 5838 5839var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 5840 5841var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 5842 5843 5844 5845( function() { 5846 var fragment = document.createDocumentFragment(), 5847 div = fragment.appendChild( document.createElement( "div" ) ), 5848 input = document.createElement( "input" ); 5849 5850 // Support: Android 4.0 - 4.3 only 5851 // Check state lost if the name is set (#11217) 5852 // Support: Windows Web Apps (WWA) 5853 // `name` and `type` must use .setAttribute for WWA (#14901) 5854 input.setAttribute( "type", "radio" ); 5855 input.setAttribute( "checked", "checked" ); 5856 input.setAttribute( "name", "t" ); 5857 5858 div.appendChild( input ); 5859 5860 // Support: Android <=4.1 only
vendor: 10,905 bytes, lines 5861-6257
5861 // Older WebKit doesn't clone checked state correctly in fragments 5862 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 5863 5864 // Support: IE <=11 only 5865 // Make sure textarea (and checkbox) defaultValue is properly cloned 5866 div.innerHTML = "<textarea>x</textarea>"; 5867 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 5868 5869 // Support: IE <=9 only 5870 // IE <=9 replaces <option> tags with their contents when inserted outside of 5871 // the select element. 5872 div.innerHTML = "<option></option>"; 5873 support.option = !!div.lastChild; 5874} )(); 5875 5876 5877// We have to close these tags to support XHTML (#13200) 5878var wrapMap = { 5879 5880 // XHTML parsers do not magically insert elements in the 5881 // same way that tag soup parsers do. So we cannot shorten 5882 // this by omitting <tbody> or other required elements. 5883 thead: [ 1, "<table>", "</table>" ], 5884 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 5885 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 5886 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 5887 5888 _default: [ 0, "", "" ] 5889}; 5890 5891wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 5892wrapMap.th = wrapMap.td; 5893 5894// Support: IE <=9 only 5895if ( !support.option ) { 5896 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 5897} 5898 5899 5900function getAll( context, tag ) { 5901 5902 // Support: IE <=9 - 11 only 5903 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 5904 var ret; 5905 5906 if ( typeof context.getElementsByTagName !== "undefined" ) { 5907 ret = context.getElementsByTagName( tag || "*" ); 5908 5909 } else if ( typeof context.querySelectorAll !== "undefined" ) { 5910 ret = context.querySelectorAll( tag || "*" ); 5911 5912 } else { 5913 ret = []; 5914 } 5915 5916 if ( tag === undefined || tag && nodeName( context, tag ) ) { 5917 return jQuery.merge( [ context ], ret ); 5918 } 5919 5920 return ret; 5921} 5922 5923 5924// Mark scripts as having already been evaluated 5925function setGlobalEval( elems, refElements ) { 5926 var i = 0, 5927 l = elems.length; 5928 5929 for ( ; i < l; i++ ) { 5930 dataPriv.set( 5931 elems[ i ], 5932 "globalEval", 5933 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 5934 ); 5935 } 5936} 5937 5938 5939var rhtml = /<|&#?\w+;/; 5940 5941function buildFragment( elems, context, scripts, selection, ignored ) { 5942 var elem, tmp, tag, wrap, attached, j, 5943 fragment = context.createDocumentFragment(), 5944 nodes = [], 5945 i = 0, 5946 l = elems.length; 5947 5948 for ( ; i < l; i++ ) { 5949 elem = elems[ i ]; 5950 5951 if ( elem || elem === 0 ) { 5952 5953 // Add nodes directly 5954 if ( toType( elem ) === "object" ) { 5955 5956 // Support: Android <=4.0 only, PhantomJS 1 only 5957 // push.apply(_, arraylike) throws on ancient WebKit 5958 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 5959 5960 // Convert non-html into a text node 5961 } else if ( !rhtml.test( elem ) ) { 5962 nodes.push( context.createTextNode( elem ) ); 5963 5964 // Convert html into DOM nodes 5965 } else { 5966 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 5967 5968 // Deserialize a standard representation 5969 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 5970 wrap = wrapMap[ tag ] || wrapMap._default; 5971 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 5972 5973 // Descend through wrappers to the right content 5974 j = wrap[ 0 ]; 5975 while ( j-- ) { 5976 tmp = tmp.lastChild; 5977 } 5978 5979 // Support: Android <=4.0 only, PhantomJS 1 only 5980 // push.apply(_, arraylike) throws on ancient WebKit 5981 jQuery.merge( nodes, tmp.childNodes ); 5982 5983 // Remember the top-level container 5984 tmp = fragment.firstChild; 5985 5986 // Ensure the created nodes are orphaned (#12392) 5987 tmp.textContent = ""; 5988 } 5989 } 5990 } 5991 5992 // Remove wrapper from fragment 5993 fragment.textContent = ""; 5994 5995 i = 0; 5996 while ( ( elem = nodes[ i++ ] ) ) { 5997 5998 // Skip elements already in the context collection (trac-4087) 5999 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 6000 if ( ignored ) { 6001 ignored.push( elem ); 6002 } 6003 continue; 6004 } 6005 6006 attached = isAttached( elem ); 6007 6008 // Append to fragment 6009 tmp = getAll( fragment.appendChild( elem ), "script" ); 6010 6011 // Preserve script evaluation history 6012 if ( attached ) { 6013 setGlobalEval( tmp ); 6014 } 6015 6016 // Capture executables 6017 if ( scripts ) { 6018 j = 0; 6019 while ( ( elem = tmp[ j++ ] ) ) { 6020 if ( rscriptType.test( elem.type || "" ) ) { 6021 scripts.push( elem ); 6022 } 6023 } 6024 } 6025 } 6026 6027 return fragment; 6028} 6029 6030 6031var 6032 rkeyEvent = /^key/, 6033 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 6034 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 6035 6036function returnTrue() { 6037 return true; 6038} 6039 6040function returnFalse() { 6041 return false; 6042} 6043 6044// Support: IE <=9 - 11+ 6045// focus() and blur() are asynchronous, except when they are no-op. 6046// So expect focus to be synchronous when the element is already active, 6047// and blur to be synchronous when the element is not already active. 6048// (focus and blur are always synchronous in other supported browsers, 6049// this just defines when we can count on it). 6050function expectSync( elem, type ) { 6051 return ( elem === safeActiveElement() ) === ( type === "focus" ); 6052} 6053 6054// Support: IE <=9 only 6055// Accessing document.activeElement can throw unexpectedly 6056// https://bugs.jquery.com/ticket/13393 6057function safeActiveElement() { 6058 try { 6059 return document.activeElement; 6060 } catch ( err ) { } 6061} 6062 6063function on( elem, types, selector, data, fn, one ) { 6064 var origFn, type; 6065 6066 // Types can be a map of types/handlers 6067 if ( typeof types === "object" ) { 6068 6069 // ( types-Object, selector, data ) 6070 if ( typeof selector !== "string" ) { 6071 6072 // ( types-Object, data ) 6073 data = data || selector; 6074 selector = undefined; 6075 } 6076 for ( type in types ) { 6077 on( elem, type, selector, data, types[ type ], one ); 6078 } 6079 return elem; 6080 } 6081 6082 if ( data == null && fn == null ) { 6083 6084 // ( types, fn ) 6085 fn = selector; 6086 data = selector = undefined; 6087 } else if ( fn == null ) { 6088 if ( typeof selector === "string" ) { 6089 6090 // ( types, selector, fn ) 6091 fn = data; 6092 data = undefined; 6093 } else { 6094 6095 // ( types, data, fn ) 6096 fn = data; 6097 data = selector; 6098 selector = undefined; 6099 } 6100 } 6101 if ( fn === false ) { 6102 fn = returnFalse; 6103 } else if ( !fn ) { 6104 return elem; 6105 } 6106 6107 if ( one === 1 ) { 6108 origFn = fn; 6109 fn = function( event ) { 6110 6111 // Can use an empty set, since event contains the info 6112 jQuery().off( event ); 6113 return origFn.apply( this, arguments ); 6114 }; 6115 6116 // Use same guid so caller can remove using origFn 6117 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 6118 } 6119 return elem.each( function() { 6120 jQuery.event.add( this, types, fn, data, selector ); 6121 } ); 6122} 6123 6124/* 6125 * Helper functions for managing events -- not part of the public interface. 6126 * Props to Dean Edwards' addEvent library for many of the ideas. 6127 */ 6128jQuery.event = { 6129 6130 global: {}, 6131 6132 add: function( elem, types, handler, data, selector ) { 6133 6134 var handleObjIn, eventHandle, tmp, 6135 events, t, handleObj, 6136 special, handlers, type, namespaces, origType, 6137 elemData = dataPriv.get( elem ); 6138 6139 // Only attach events to objects that accept data 6140 if ( !acceptData( elem ) ) { 6141 return; 6142 } 6143 6144 // Caller can pass in an object of custom data in lieu of the handler 6145 if ( handler.handler ) { 6146 handleObjIn = handler; 6147 handler = handleObjIn.handler; 6148 selector = handleObjIn.selector; 6149 } 6150 6151 // Ensure that invalid selectors throw exceptions at attach time 6152 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 6153 if ( selector ) { 6154 jQuery.find.matchesSelector( documentElement, selector ); 6155 } 6156 6157 // Make sure that the handler has a unique ID, used to find/remove it later 6158 if ( !handler.guid ) { 6159 handler.guid = jQuery.guid++; 6160 } 6161 6162 // Init the element's event structure and main handler, if this is the first 6163 if ( !( events = elemData.events ) ) { 6164 events = elemData.events = Object.create( null ); 6165 } 6166 if ( !( eventHandle = elemData.handle ) ) { 6167 eventHandle = elemData.handle = function( e ) { 6168 6169 // Discard the second event of a jQuery.event.trigger() and 6170 // when an event is called after a page has unloaded 6171 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 6172 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 6173 }; 6174 } 6175 6176 // Handle multiple events separated by a space 6177 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 6178 t = types.length; 6179 while ( t-- ) { 6180 tmp = rtypenamespace.exec( types[ t ] ) || []; 6181 type = origType = tmp[ 1 ]; 6182 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 6183 6184 // There *must* be a type, no attaching namespace-only handlers 6185 if ( !type ) { 6186 continue; 6187 } 6188 6189 // If event changes its type, use the special event handlers for the changed type 6190 special = jQuery.event.special[ type ] || {}; 6191 6192 // If selector defined, determine special event api type, otherwise given type 6193 type = ( selector ? special.delegateType : special.bindType ) || type; 6194 6195 // Update special based on newly reset type 6196 special = jQuery.event.special[ type ] || {}; 6197 6198 // handleObj is passed to all event handlers 6199 handleObj = jQuery.extend( { 6200 type: type, 6201 origType: origType, 6202 data: data, 6203 handler: handler, 6204 guid: handler.guid, 6205 selector: selector, 6206 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 6207 namespace: namespaces.join( "." ) 6208 }, handleObjIn ); 6209 6210 // Init the event handler queue if we're the first 6211 if ( !( handlers = events[ type ] ) ) { 6212 handlers = events[ type ] = []; 6213 handlers.delegateCount = 0; 6214 6215 // Only use addEventListener if the special events handler returns false 6216 if ( !special.setup || 6217 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 6218 6219 if ( elem.addEventListener ) { 6220 elem.addEventListener( type, eventHandle ); 6221 } 6222 } 6223 } 6224 6225 if ( special.add ) { 6226 special.add.call( elem, handleObj ); 6227 6228 if ( !handleObj.handler.guid ) { 6229 handleObj.handler.guid = handler.guid; 6230 } 6231 } 6232 6233 // Add to the element's handler list, delegates in front 6234 if ( selector ) { 6235 handlers.splice( handlers.delegateCount++, 0, handleObj ); 6236 } else { 6237 handlers.push( handleObj ); 6238 } 6239 6240 // Keep track of which events have ever been used, for event optimization 6241 jQuery.event.global[ type ] = true; 6242 } 6243 6244 }, 6245 6246 // Detach an event or set of events from an element 6247 remove: function( elem, types, handler, selector, mappedTypes ) { 6248 6249 var j, origCount, tmp, 6250 events, t, handleObj, 6251 special, handlers, type, namespaces, origType, 6252 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 6253 6254 if ( !elemData || !( events = elemData.events ) ) { 6255 return; 6256 } 6257
vendor: 4,338 bytes, lines 6258-6396
6258 // Once for each type.namespace in types; type may be omitted 6259 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 6260 t = types.length; 6261 while ( t-- ) { 6262 tmp = rtypenamespace.exec( types[ t ] ) || []; 6263 type = origType = tmp[ 1 ]; 6264 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 6265 6266 // Unbind all events (on this namespace, if provided) for the element 6267 if ( !type ) { 6268 for ( type in events ) { 6269 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 6270 } 6271 continue; 6272 } 6273 6274 special = jQuery.event.special[ type ] || {}; 6275 type = ( selector ? special.delegateType : special.bindType ) || type; 6276 handlers = events[ type ] || []; 6277 tmp = tmp[ 2 ] && 6278 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 6279 6280 // Remove matching events 6281 origCount = j = handlers.length; 6282 while ( j-- ) { 6283 handleObj = handlers[ j ]; 6284 6285 if ( ( mappedTypes || origType === handleObj.origType ) && 6286 ( !handler || handler.guid === handleObj.guid ) && 6287 ( !tmp || tmp.test( handleObj.namespace ) ) && 6288 ( !selector || selector === handleObj.selector || 6289 selector === "**" && handleObj.selector ) ) { 6290 handlers.splice( j, 1 ); 6291 6292 if ( handleObj.selector ) { 6293 handlers.delegateCount--; 6294 } 6295 if ( special.remove ) { 6296 special.remove.call( elem, handleObj ); 6297 } 6298 } 6299 } 6300 6301 // Remove generic event handler if we removed something and no more handlers exist 6302 // (avoids potential for endless recursion during removal of special event handlers) 6303 if ( origCount && !handlers.length ) { 6304 if ( !special.teardown || 6305 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 6306 6307 jQuery.removeEvent( elem, type, elemData.handle ); 6308 } 6309 6310 delete events[ type ]; 6311 } 6312 } 6313 6314 // Remove data and the expando if it's no longer used 6315 if ( jQuery.isEmptyObject( events ) ) { 6316 dataPriv.remove( elem, "handle events" ); 6317 } 6318 }, 6319 6320 dispatch: function( nativeEvent ) { 6321 6322 var i, j, ret, matched, handleObj, handlerQueue, 6323 args = new Array( arguments.length ), 6324 6325 // Make a writable jQuery.Event from the native event object 6326 event = jQuery.event.fix( nativeEvent ), 6327 6328 handlers = ( 6329 dataPriv.get( this, "events" ) || Object.create( null ) 6330 )[ event.type ] || [], 6331 special = jQuery.event.special[ event.type ] || {}; 6332 6333 // Use the fix-ed jQuery.Event rather than the (read-only) native event 6334 args[ 0 ] = event; 6335 6336 for ( i = 1; i < arguments.length; i++ ) { 6337 args[ i ] = arguments[ i ]; 6338 } 6339 6340 event.delegateTarget = this; 6341 6342 // Call the preDispatch hook for the mapped type, and let it bail if desired 6343 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 6344 return; 6345 } 6346 6347 // Determine handlers 6348 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 6349 6350 // Run delegates first; they may want to stop propagation beneath us 6351 i = 0; 6352 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 6353 event.currentTarget = matched.elem; 6354 6355 j = 0; 6356 while ( ( handleObj = matched.handlers[ j++ ] ) && 6357 !event.isImmediatePropagationStopped() ) { 6358 6359 // If the event is namespaced, then each handler is only invoked if it is 6360 // specially universal or its namespaces are a superset of the event's. 6361 if ( !event.rnamespace || handleObj.namespace === false || 6362 event.rnamespace.test( handleObj.namespace ) ) { 6363 6364 event.handleObj = handleObj; 6365 event.data = handleObj.data; 6366 6367 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 6368 handleObj.handler ).apply( matched.elem, args ); 6369 6370 if ( ret !== undefined ) { 6371 if ( ( event.result = ret ) === false ) { 6372 event.preventDefault(); 6373 event.stopPropagation(); 6374 } 6375 } 6376 } 6377 } 6378 } 6379 6380 // Call the postDispatch hook for the mapped type 6381 if ( special.postDispatch ) { 6382 special.postDispatch.call( this, event ); 6383 } 6384 6385 return event.result; 6386 }, 6387 6388 handlers: function( event, handlers ) { 6389 var i, handleObj, sel, matchedHandlers, matchedSelectors, 6390 handlerQueue = [], 6391 delegateCount = handlers.delegateCount, 6392 cur = event.target; 6393 6394 // Find delegate handlers 6395 if ( delegateCount && 6396
vendor: 8,294 bytes, lines 6397-6658
6397 // Support: IE <=9 6398 // Black-hole SVG <use> instance trees (trac-13180) 6399 cur.nodeType && 6400 6401 // Support: Firefox <=42 6402 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 6403 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 6404 // Support: IE 11 only 6405 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 6406 !( event.type === "click" && event.button >= 1 ) ) { 6407 6408 for ( ; cur !== this; cur = cur.parentNode || this ) { 6409 6410 // Don't check non-elements (#13208) 6411 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 6412 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 6413 matchedHandlers = []; 6414 matchedSelectors = {}; 6415 for ( i = 0; i < delegateCount; i++ ) { 6416 handleObj = handlers[ i ]; 6417 6418 // Don't conflict with Object.prototype properties (#13203) 6419 sel = handleObj.selector + " "; 6420 6421 if ( matchedSelectors[ sel ] === undefined ) { 6422 matchedSelectors[ sel ] = handleObj.needsContext ? 6423 jQuery( sel, this ).index( cur ) > -1 : 6424 jQuery.find( sel, this, null, [ cur ] ).length; 6425 } 6426 if ( matchedSelectors[ sel ] ) { 6427 matchedHandlers.push( handleObj ); 6428 } 6429 } 6430 if ( matchedHandlers.length ) { 6431 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 6432 } 6433 } 6434 } 6435 } 6436 6437 // Add the remaining (directly-bound) handlers 6438 cur = this; 6439 if ( delegateCount < handlers.length ) { 6440 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 6441 } 6442 6443 return handlerQueue; 6444 }, 6445 6446 addProp: function( name, hook ) { 6447 Object.defineProperty( jQuery.Event.prototype, name, { 6448 enumerable: true, 6449 configurable: true, 6450 6451 get: isFunction( hook ) ? 6452 function() { 6453 if ( this.originalEvent ) { 6454 return hook( this.originalEvent ); 6455 } 6456 } : 6457 function() { 6458 if ( this.originalEvent ) { 6459 return this.originalEvent[ name ]; 6460 } 6461 }, 6462 6463 set: function( value ) { 6464 Object.defineProperty( this, name, { 6465 enumerable: true, 6466 configurable: true, 6467 writable: true, 6468 value: value 6469 } ); 6470 } 6471 } ); 6472 }, 6473 6474 fix: function( originalEvent ) { 6475 return originalEvent[ jQuery.expando ] ? 6476 originalEvent : 6477 new jQuery.Event( originalEvent ); 6478 }, 6479 6480 special: { 6481 load: { 6482 6483 // Prevent triggered image.load events from bubbling to window.load 6484 noBubble: true 6485 }, 6486 click: { 6487 6488 // Utilize native event to ensure correct state for checkable inputs 6489 setup: function( data ) { 6490 6491 // For mutual compressibility with _default, replace `this` access with a local var. 6492 // `|| data` is dead code meant only to preserve the variable through minification. 6493 var el = this || data; 6494 6495 // Claim the first handler 6496 if ( rcheckableType.test( el.type ) && 6497 el.click && nodeName( el, "input" ) ) { 6498 6499 // dataPriv.set( el, "click", ... ) 6500 leverageNative( el, "click", returnTrue ); 6501 } 6502 6503 // Return false to allow normal processing in the caller 6504 return false; 6505 }, 6506 trigger: function( data ) { 6507 6508 // For mutual compressibility with _default, replace `this` access with a local var. 6509 // `|| data` is dead code meant only to preserve the variable through minification. 6510 var el = this || data; 6511 6512 // Force setup before triggering a click 6513 if ( rcheckableType.test( el.type ) && 6514 el.click && nodeName( el, "input" ) ) { 6515 6516 leverageNative( el, "click" ); 6517 } 6518 6519 // Return non-false to allow normal event-path propagation 6520 return true; 6521 }, 6522 6523 // For cross-browser consistency, suppress native .click() on links 6524 // Also prevent it if we're currently inside a leveraged native-event stack 6525 _default: function( event ) { 6526 var target = event.target; 6527 return rcheckableType.test( target.type ) && 6528 target.click && nodeName( target, "input" ) && 6529 dataPriv.get( target, "click" ) || 6530 nodeName( target, "a" ); 6531 } 6532 }, 6533 6534 beforeunload: { 6535 postDispatch: function( event ) { 6536 6537 // Support: Firefox 20+ 6538 // Firefox doesn't alert if the returnValue field is not set. 6539 if ( event.result !== undefined && event.originalEvent ) { 6540 event.originalEvent.returnValue = event.result; 6541 } 6542 } 6543 } 6544 } 6545}; 6546 6547// Ensure the presence of an event listener that handles manually-triggered 6548// synthetic events by interrupting progress until reinvoked in response to 6549// *native* events that it fires directly, ensuring that state changes have 6550// already occurred before other listeners are invoked. 6551function leverageNative( el, type, expectSync ) { 6552 6553 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 6554 if ( !expectSync ) { 6555 if ( dataPriv.get( el, type ) === undefined ) { 6556 jQuery.event.add( el, type, returnTrue ); 6557 } 6558 return; 6559 } 6560 6561 // Register the controller as a special universal handler for all event namespaces 6562 dataPriv.set( el, type, false ); 6563 jQuery.event.add( el, type, { 6564 namespace: false, 6565 handler: function( event ) { 6566 var notAsync, result, 6567 saved = dataPriv.get( this, type ); 6568 6569 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 6570 6571 // Interrupt processing of the outer synthetic .trigger()ed event 6572 // Saved data should be false in such cases, but might be a leftover capture object 6573 // from an async native handler (gh-4350) 6574 if ( !saved.length ) { 6575 6576 // Store arguments for use when handling the inner native event 6577 // There will always be at least one argument (an event object), so this array 6578 // will not be confused with a leftover capture object. 6579 saved = slice.call( arguments ); 6580 dataPriv.set( this, type, saved ); 6581 6582 // Trigger the native event and capture its result 6583 // Support: IE <=9 - 11+ 6584 // focus() and blur() are asynchronous 6585 notAsync = expectSync( this, type ); 6586 this[ type ](); 6587 result = dataPriv.get( this, type ); 6588 if ( saved !== result || notAsync ) { 6589 dataPriv.set( this, type, false ); 6590 } else { 6591 result = {}; 6592 } 6593 if ( saved !== result ) { 6594 6595 // Cancel the outer synthetic event 6596 event.stopImmediatePropagation(); 6597 event.preventDefault(); 6598 return result.value; 6599 } 6600 6601 // If this is an inner synthetic event for an event with a bubbling surrogate 6602 // (focus or blur), assume that the surrogate already propagated from triggering the 6603 // native event and prevent that from happening again here. 6604 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 6605 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 6606 // less bad than duplication. 6607 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 6608 event.stopPropagation(); 6609 } 6610 6611 // If this is a native event triggered above, everything is now in order 6612 // Fire an inner synthetic event with the original arguments 6613 } else if ( saved.length ) { 6614 6615 // ...and capture the result 6616 dataPriv.set( this, type, { 6617 value: jQuery.event.trigger( 6618 6619 // Support: IE <=9 - 11+ 6620 // Extend with the prototype to reset the above stopImmediatePropagation() 6621 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 6622 saved.slice( 1 ), 6623 this 6624 ) 6625 } ); 6626 6627 // Abort handling of the native event 6628 event.stopImmediatePropagation(); 6629 } 6630 } 6631 } ); 6632} 6633 6634jQuery.removeEvent = function( elem, type, handle ) { 6635 6636 // This "if" is needed for plain objects 6637 if ( elem.removeEventListener ) { 6638 elem.removeEventListener( type, handle ); 6639 } 6640}; 6641 6642jQuery.Event = function( src, props ) { 6643 6644 // Allow instantiation without the 'new' keyword 6645 if ( !( this instanceof jQuery.Event ) ) { 6646 return new jQuery.Event( src, props ); 6647 } 6648 6649 // Event object 6650 if ( src && src.type ) { 6651 this.originalEvent = src; 6652 this.type = src.type; 6653 6654 // Events bubbling up the document may have been marked as prevented 6655 // by a handler lower down the tree; reflect the correct value. 6656 this.isDefaultPrevented = src.defaultPrevented || 6657 src.defaultPrevented === undefined && 6658
vendor: 7,184 bytes, lines 6659-6942
6659 // Support: Android <=2.3 only 6660 src.returnValue === false ? 6661 returnTrue : 6662 returnFalse; 6663 6664 // Create target properties 6665 // Support: Safari <=6 - 7 only 6666 // Target should not be a text node (#504, #13143) 6667 this.target = ( src.target && src.target.nodeType === 3 ) ? 6668 src.target.parentNode : 6669 src.target; 6670 6671 this.currentTarget = src.currentTarget; 6672 this.relatedTarget = src.relatedTarget; 6673 6674 // Event type 6675 } else { 6676 this.type = src; 6677 } 6678 6679 // Put explicitly provided properties onto the event object 6680 if ( props ) { 6681 jQuery.extend( this, props ); 6682 } 6683 6684 // Create a timestamp if incoming event doesn't have one 6685 this.timeStamp = src && src.timeStamp || Date.now(); 6686 6687 // Mark it as fixed 6688 this[ jQuery.expando ] = true; 6689}; 6690 6691// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 6692// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 6693jQuery.Event.prototype = { 6694 constructor: jQuery.Event, 6695 isDefaultPrevented: returnFalse, 6696 isPropagationStopped: returnFalse, 6697 isImmediatePropagationStopped: returnFalse, 6698 isSimulated: false, 6699 6700 preventDefault: function() { 6701 var e = this.originalEvent; 6702 6703 this.isDefaultPrevented = returnTrue; 6704 6705 if ( e && !this.isSimulated ) { 6706 e.preventDefault(); 6707 } 6708 }, 6709 stopPropagation: function() { 6710 var e = this.originalEvent; 6711 6712 this.isPropagationStopped = returnTrue; 6713 6714 if ( e && !this.isSimulated ) { 6715 e.stopPropagation(); 6716 } 6717 }, 6718 stopImmediatePropagation: function() { 6719 var e = this.originalEvent; 6720 6721 this.isImmediatePropagationStopped = returnTrue; 6722 6723 if ( e && !this.isSimulated ) { 6724 e.stopImmediatePropagation(); 6725 } 6726 6727 this.stopPropagation(); 6728 } 6729}; 6730 6731// Includes all common event props including KeyEvent and MouseEvent specific props 6732jQuery.each( { 6733 altKey: true, 6734 bubbles: true, 6735 cancelable: true, 6736 changedTouches: true, 6737 ctrlKey: true, 6738 detail: true, 6739 eventPhase: true, 6740 metaKey: true, 6741 pageX: true, 6742 pageY: true, 6743 shiftKey: true, 6744 view: true, 6745 "char": true, 6746 code: true, 6747 charCode: true, 6748 key: true, 6749 keyCode: true, 6750 button: true, 6751 buttons: true, 6752 clientX: true, 6753 clientY: true, 6754 offsetX: true, 6755 offsetY: true, 6756 pointerId: true, 6757 pointerType: true, 6758 screenX: true, 6759 screenY: true, 6760 targetTouches: true, 6761 toElement: true, 6762 touches: true, 6763 6764 which: function( event ) { 6765 var button = event.button; 6766 6767 // Add which for key events 6768 if ( event.which == null && rkeyEvent.test( event.type ) ) { 6769 return event.charCode != null ? event.charCode : event.keyCode; 6770 } 6771 6772 // Add which for click: 1 === left; 2 === middle; 3 === right 6773 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 6774 if ( button & 1 ) { 6775 return 1; 6776 } 6777 6778 if ( button & 2 ) { 6779 return 3; 6780 } 6781 6782 if ( button & 4 ) { 6783 return 2; 6784 } 6785 6786 return 0; 6787 } 6788 6789 return event.which; 6790 } 6791}, jQuery.event.addProp ); 6792 6793jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 6794 jQuery.event.special[ type ] = { 6795 6796 // Utilize native event if possible so blur/focus sequence is correct 6797 setup: function() { 6798 6799 // Claim the first handler 6800 // dataPriv.set( this, "focus", ... ) 6801 // dataPriv.set( this, "blur", ... ) 6802 leverageNative( this, type, expectSync ); 6803 6804 // Return false to allow normal processing in the caller 6805 return false; 6806 }, 6807 trigger: function() { 6808 6809 // Force setup before trigger 6810 leverageNative( this, type ); 6811 6812 // Return non-false to allow normal event-path propagation 6813 return true; 6814 }, 6815 6816 delegateType: delegateType 6817 }; 6818} ); 6819 6820// Create mouseenter/leave events using mouseover/out and event-time checks 6821// so that event delegation works in jQuery. 6822// Do the same for pointerenter/pointerleave and pointerover/pointerout 6823// 6824// Support: Safari 7 only 6825// Safari sends mouseenter too often; see: 6826// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 6827// for the description of the bug (it existed in older Chrome versions as well). 6828jQuery.each( { 6829 mouseenter: "mouseover", 6830 mouseleave: "mouseout", 6831 pointerenter: "pointerover", 6832 pointerleave: "pointerout" 6833}, function( orig, fix ) { 6834 jQuery.event.special[ orig ] = { 6835 delegateType: fix, 6836 bindType: fix, 6837 6838 handle: function( event ) { 6839 var ret, 6840 target = this, 6841 related = event.relatedTarget, 6842 handleObj = event.handleObj; 6843 6844 // For mouseenter/leave call the handler if related is outside the target. 6845 // NB: No relatedTarget if the mouse left/entered the browser window 6846 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 6847 event.type = handleObj.origType; 6848 ret = handleObj.handler.apply( this, arguments ); 6849 event.type = fix; 6850 } 6851 return ret; 6852 } 6853 }; 6854} ); 6855 6856jQuery.fn.extend( { 6857 6858 on: function( types, selector, data, fn ) { 6859 return on( this, types, selector, data, fn ); 6860 }, 6861 one: function( types, selector, data, fn ) { 6862 return on( this, types, selector, data, fn, 1 ); 6863 }, 6864 off: function( types, selector, fn ) { 6865 var handleObj, type; 6866 if ( types && types.preventDefault && types.handleObj ) { 6867 6868 // ( event ) dispatched jQuery.Event 6869 handleObj = types.handleObj; 6870 jQuery( types.delegateTarget ).off( 6871 handleObj.namespace ? 6872 handleObj.origType + "." + handleObj.namespace : 6873 handleObj.origType, 6874 handleObj.selector, 6875 handleObj.handler 6876 ); 6877 return this; 6878 } 6879 if ( typeof types === "object" ) { 6880 6881 // ( types-object [, selector] ) 6882 for ( type in types ) { 6883 this.off( type, selector, types[ type ] ); 6884 } 6885 return this; 6886 } 6887 if ( selector === false || typeof selector === "function" ) { 6888 6889 // ( types [, fn] ) 6890 fn = selector; 6891 selector = undefined; 6892 } 6893 if ( fn === false ) { 6894 fn = returnFalse; 6895 } 6896 return this.each( function() { 6897 jQuery.event.remove( this, types, fn, selector ); 6898 } ); 6899 } 6900} ); 6901 6902 6903var 6904 6905 // Support: IE <=10 - 11, Edge 12 - 13 only 6906 // In IE/Edge using regex groups here causes severe slowdowns. 6907 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 6908 rnoInnerhtml = /<script|<style|<link/i, 6909 6910 // checked="checked" or checked 6911 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 6912 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 6913 6914// Prefer a tbody over its parent table for containing new rows 6915function manipulationTarget( elem, content ) { 6916 if ( nodeName( elem, "table" ) && 6917 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 6918 6919 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 6920 } 6921 6922 return elem; 6923} 6924 6925// Replace/restore the type attribute of script elements for safe DOM manipulation 6926function disableScript( elem ) { 6927 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 6928 return elem; 6929} 6930function restoreScript( elem ) { 6931 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 6932 elem.type = elem.type.slice( 5 ); 6933 } else { 6934 elem.removeAttribute( "type" ); 6935 } 6936 6937 return elem; 6938} 6939 6940function cloneCopyEvent( src, dest ) { 6941 var i, l, type, pdataOld, udataOld, udataCur, events; 6942
vendor: 6,224 bytes, lines 6943-7165
6943 if ( dest.nodeType !== 1 ) { 6944 return; 6945 } 6946 6947 // 1. Copy private data: events, handlers, etc. 6948 if ( dataPriv.hasData( src ) ) { 6949 pdataOld = dataPriv.get( src ); 6950 events = pdataOld.events; 6951 6952 if ( events ) { 6953 dataPriv.remove( dest, "handle events" ); 6954 6955 for ( type in events ) { 6956 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 6957 jQuery.event.add( dest, type, events[ type ][ i ] ); 6958 } 6959 } 6960 } 6961 } 6962 6963 // 2. Copy user data 6964 if ( dataUser.hasData( src ) ) { 6965 udataOld = dataUser.access( src ); 6966 udataCur = jQuery.extend( {}, udataOld ); 6967 6968 dataUser.set( dest, udataCur ); 6969 } 6970} 6971 6972// Fix IE bugs, see support tests 6973function fixInput( src, dest ) { 6974 var nodeName = dest.nodeName.toLowerCase(); 6975 6976 // Fails to persist the checked state of a cloned checkbox or radio button. 6977 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 6978 dest.checked = src.checked; 6979 6980 // Fails to return the selected option to the default selected state when cloning options 6981 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6982 dest.defaultValue = src.defaultValue; 6983 } 6984} 6985 6986function domManip( collection, args, callback, ignored ) { 6987 6988 // Flatten any nested arrays 6989 args = flat( args ); 6990 6991 var fragment, first, scripts, hasScripts, node, doc, 6992 i = 0, 6993 l = collection.length, 6994 iNoClone = l - 1, 6995 value = args[ 0 ], 6996 valueIsFunction = isFunction( value ); 6997 6998 // We can't cloneNode fragments that contain checked, in WebKit 6999 if ( valueIsFunction || 7000 ( l > 1 && typeof value === "string" && 7001 !support.checkClone && rchecked.test( value ) ) ) { 7002 return collection.each( function( index ) { 7003 var self = collection.eq( index ); 7004 if ( valueIsFunction ) { 7005 args[ 0 ] = value.call( this, index, self.html() ); 7006 } 7007 domManip( self, args, callback, ignored ); 7008 } ); 7009 } 7010 7011 if ( l ) { 7012 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 7013 first = fragment.firstChild; 7014 7015 if ( fragment.childNodes.length === 1 ) { 7016 fragment = first; 7017 } 7018 7019 // Require either new content or an interest in ignored elements to invoke the callback 7020 if ( first || ignored ) { 7021 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 7022 hasScripts = scripts.length; 7023 7024 // Use the original fragment for the last item 7025 // instead of the first because it can end up 7026 // being emptied incorrectly in certain situations (#8070). 7027 for ( ; i < l; i++ ) { 7028 node = fragment; 7029 7030 if ( i !== iNoClone ) { 7031 node = jQuery.clone( node, true, true ); 7032 7033 // Keep references to cloned scripts for later restoration 7034 if ( hasScripts ) { 7035 7036 // Support: Android <=4.0 only, PhantomJS 1 only 7037 // push.apply(_, arraylike) throws on ancient WebKit 7038 jQuery.merge( scripts, getAll( node, "script" ) ); 7039 } 7040 } 7041 7042 callback.call( collection[ i ], node, i ); 7043 } 7044 7045 if ( hasScripts ) { 7046 doc = scripts[ scripts.length - 1 ].ownerDocument; 7047 7048 // Reenable scripts 7049 jQuery.map( scripts, restoreScript ); 7050 7051 // Evaluate executable scripts on first document insertion 7052 for ( i = 0; i < hasScripts; i++ ) { 7053 node = scripts[ i ]; 7054 if ( rscriptType.test( node.type || "" ) && 7055 !dataPriv.access( node, "globalEval" ) && 7056 jQuery.contains( doc, node ) ) { 7057 7058 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 7059 7060 // Optional AJAX dependency, but won't run scripts if not present 7061 if ( jQuery._evalUrl && !node.noModule ) { 7062 jQuery._evalUrl( node.src, { 7063 nonce: node.nonce || node.getAttribute( "nonce" ) 7064 }, doc ); 7065 } 7066 } else { 7067 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 7068 } 7069 } 7070 } 7071 } 7072 } 7073 } 7074 7075 return collection; 7076} 7077 7078function remove( elem, selector, keepData ) { 7079 var node, 7080 nodes = selector ? jQuery.filter( selector, elem ) : elem, 7081 i = 0; 7082 7083 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 7084 if ( !keepData && node.nodeType === 1 ) { 7085 jQuery.cleanData( getAll( node ) ); 7086 } 7087 7088 if ( node.parentNode ) { 7089 if ( keepData && isAttached( node ) ) { 7090 setGlobalEval( getAll( node, "script" ) ); 7091 } 7092 node.parentNode.removeChild( node ); 7093 } 7094 } 7095 7096 return elem; 7097} 7098 7099jQuery.extend( { 7100 htmlPrefilter: function( html ) { 7101 return html; 7102 }, 7103 7104 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 7105 var i, l, srcElements, destElements, 7106 clone = elem.cloneNode( true ), 7107 inPage = isAttached( elem ); 7108 7109 // Fix IE cloning issues 7110 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 7111 !jQuery.isXMLDoc( elem ) ) { 7112 7113 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 7114 destElements = getAll( clone ); 7115 srcElements = getAll( elem ); 7116 7117 for ( i = 0, l = srcElements.length; i < l; i++ ) { 7118 fixInput( srcElements[ i ], destElements[ i ] ); 7119 } 7120 } 7121 7122 // Copy the events from the original to the clone 7123 if ( dataAndEvents ) { 7124 if ( deepDataAndEvents ) { 7125 srcElements = srcElements || getAll( elem ); 7126 destElements = destElements || getAll( clone ); 7127 7128 for ( i = 0, l = srcElements.length; i < l; i++ ) { 7129 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 7130 } 7131 } else { 7132 cloneCopyEvent( elem, clone ); 7133 } 7134 } 7135 7136 // Preserve script evaluation history 7137 destElements = getAll( clone, "script" ); 7138 if ( destElements.length > 0 ) { 7139 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 7140 } 7141 7142 // Return the cloned set 7143 return clone; 7144 }, 7145 7146 cleanData: function( elems ) { 7147 var data, elem, type, 7148 special = jQuery.event.special, 7149 i = 0; 7150 7151 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 7152 if ( acceptData( elem ) ) { 7153 if ( ( data = elem[ dataPriv.expando ] ) ) { 7154 if ( data.events ) { 7155 for ( type in data.events ) { 7156 if ( special[ type ] ) { 7157 jQuery.event.remove( elem, type ); 7158 7159 // This is a shortcut to avoid jQuery.event.remove's overhead 7160 } else { 7161 jQuery.removeEvent( elem, type, data.handle ); 7162 } 7163 } 7164 } 7165
vendor: 4,139 bytes, lines 7166-7330
7166 // Support: Chrome <=35 - 45+ 7167 // Assign undefined instead of using delete, see Data#remove 7168 elem[ dataPriv.expando ] = undefined; 7169 } 7170 if ( elem[ dataUser.expando ] ) { 7171 7172 // Support: Chrome <=35 - 45+ 7173 // Assign undefined instead of using delete, see Data#remove 7174 elem[ dataUser.expando ] = undefined; 7175 } 7176 } 7177 } 7178 } 7179} ); 7180 7181jQuery.fn.extend( { 7182 detach: function( selector ) { 7183 return remove( this, selector, true ); 7184 }, 7185 7186 remove: function( selector ) { 7187 return remove( this, selector ); 7188 }, 7189 7190 text: function( value ) { 7191 return access( this, function( value ) { 7192 return value === undefined ? 7193 jQuery.text( this ) : 7194 this.empty().each( function() { 7195 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 7196 this.textContent = value; 7197 } 7198 } ); 7199 }, null, value, arguments.length ); 7200 }, 7201 7202 append: function() { 7203 return domManip( this, arguments, function( elem ) { 7204 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 7205 var target = manipulationTarget( this, elem ); 7206 target.appendChild( elem ); 7207 } 7208 } ); 7209 }, 7210 7211 prepend: function() { 7212 return domManip( this, arguments, function( elem ) { 7213 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 7214 var target = manipulationTarget( this, elem ); 7215 target.insertBefore( elem, target.firstChild ); 7216 } 7217 } ); 7218 }, 7219 7220 before: function() { 7221 return domManip( this, arguments, function( elem ) { 7222 if ( this.parentNode ) { 7223 this.parentNode.insertBefore( elem, this ); 7224 } 7225 } ); 7226 }, 7227 7228 after: function() { 7229 return domManip( this, arguments, function( elem ) { 7230 if ( this.parentNode ) { 7231 this.parentNode.insertBefore( elem, this.nextSibling ); 7232 } 7233 } ); 7234 }, 7235 7236 empty: function() { 7237 var elem, 7238 i = 0; 7239 7240 for ( ; ( elem = this[ i ] ) != null; i++ ) { 7241 if ( elem.nodeType === 1 ) { 7242 7243 // Prevent memory leaks 7244 jQuery.cleanData( getAll( elem, false ) ); 7245 7246 // Remove any remaining nodes 7247 elem.textContent = ""; 7248 } 7249 } 7250 7251 return this; 7252 }, 7253 7254 clone: function( dataAndEvents, deepDataAndEvents ) { 7255 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 7256 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 7257 7258 return this.map( function() { 7259 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 7260 } ); 7261 }, 7262 7263 html: function( value ) { 7264 return access( this, function( value ) { 7265 var elem = this[ 0 ] || {}, 7266 i = 0, 7267 l = this.length; 7268 7269 if ( value === undefined && elem.nodeType === 1 ) { 7270 return elem.innerHTML; 7271 } 7272 7273 // See if we can take a shortcut and just use innerHTML 7274 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 7275 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 7276 7277 value = jQuery.htmlPrefilter( value ); 7278 7279 try { 7280 for ( ; i < l; i++ ) { 7281 elem = this[ i ] || {}; 7282 7283 // Remove element nodes and prevent memory leaks 7284 if ( elem.nodeType === 1 ) { 7285 jQuery.cleanData( getAll( elem, false ) ); 7286 elem.innerHTML = value; 7287 } 7288 } 7289 7290 elem = 0; 7291 7292 // If using innerHTML throws an exception, use the fallback method 7293 } catch ( e ) {} 7294 } 7295 7296 if ( elem ) { 7297 this.empty().append( value ); 7298 } 7299 }, null, value, arguments.length ); 7300 }, 7301 7302 replaceWith: function() { 7303 var ignored = []; 7304 7305 // Make the changes, replacing each non-ignored context element with the new content 7306 return domManip( this, arguments, function( elem ) { 7307 var parent = this.parentNode; 7308 7309 if ( jQuery.inArray( this, ignored ) < 0 ) { 7310 jQuery.cleanData( getAll( this ) ); 7311 if ( parent ) { 7312 parent.replaceChild( elem, this ); 7313 } 7314 } 7315 7316 // Force callback invocation 7317 }, ignored ); 7318 } 7319} ); 7320 7321jQuery.each( { 7322 appendTo: "append", 7323 prependTo: "prepend", 7324 insertBefore: "before", 7325 insertAfter: "after", 7326 replaceAll: "replaceWith" 7327}, function( name, original ) { 7328 jQuery.fn[ name ] = function( selector ) { 7329 var elems, 7330 ret = [],
vendor: 8,653 bytes, lines 7331-7631
7331 insert = jQuery( selector ), 7332 last = insert.length - 1, 7333 i = 0; 7334 7335 for ( ; i <= last; i++ ) { 7336 elems = i === last ? this : this.clone( true ); 7337 jQuery( insert[ i ] )[ original ]( elems ); 7338 7339 // Support: Android <=4.0 only, PhantomJS 1 only 7340 // .get() because push.apply(_, arraylike) throws on ancient WebKit 7341 push.apply( ret, elems.get() ); 7342 } 7343 7344 return this.pushStack( ret ); 7345 }; 7346} ); 7347var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 7348 7349var getStyles = function( elem ) { 7350 7351 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 7352 // IE throws on elements created in popups 7353 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 7354 var view = elem.ownerDocument.defaultView; 7355 7356 if ( !view || !view.opener ) { 7357 view = window; 7358 } 7359 7360 return view.getComputedStyle( elem ); 7361 }; 7362 7363var swap = function( elem, options, callback ) { 7364 var ret, name, 7365 old = {}; 7366 7367 // Remember the old values, and insert the new ones 7368 for ( name in options ) { 7369 old[ name ] = elem.style[ name ]; 7370 elem.style[ name ] = options[ name ]; 7371 } 7372 7373 ret = callback.call( elem ); 7374 7375 // Revert the old values 7376 for ( name in options ) { 7377 elem.style[ name ] = old[ name ]; 7378 } 7379 7380 return ret; 7381}; 7382 7383 7384var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 7385 7386 7387 7388( function() { 7389 7390 // Executing both pixelPosition & boxSizingReliable tests require only one layout 7391 // so they're executed at the same time to save the second computation. 7392 function computeStyleTests() { 7393 7394 // This is a singleton, we need to execute it only once 7395 if ( !div ) { 7396 return; 7397 } 7398 7399 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 7400 "margin-top:1px;padding:0;border:0"; 7401 div.style.cssText = 7402 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 7403 "margin:auto;border:1px;padding:1px;" + 7404 "width:60%;top:1%"; 7405 documentElement.appendChild( container ).appendChild( div ); 7406 7407 var divStyle = window.getComputedStyle( div ); 7408 pixelPositionVal = divStyle.top !== "1%"; 7409 7410 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 7411 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 7412 7413 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 7414 // Some styles come back with percentage values, even though they shouldn't 7415 div.style.right = "60%"; 7416 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 7417 7418 // Support: IE 9 - 11 only 7419 // Detect misreporting of content dimensions for box-sizing:border-box elements 7420 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 7421 7422 // Support: IE 9 only 7423 // Detect overflow:scroll screwiness (gh-3699) 7424 // Support: Chrome <=64 7425 // Don't get tricked when zoom affects offsetWidth (gh-4029) 7426 div.style.position = "absolute"; 7427 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 7428 7429 documentElement.removeChild( container ); 7430 7431 // Nullify the div so it wouldn't be stored in the memory and 7432 // it will also be a sign that checks already performed 7433 div = null; 7434 } 7435 7436 function roundPixelMeasures( measure ) { 7437 return Math.round( parseFloat( measure ) ); 7438 } 7439 7440 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 7441 reliableTrDimensionsVal, reliableMarginLeftVal, 7442 container = document.createElement( "div" ), 7443 div = document.createElement( "div" ); 7444 7445 // Finish early in limited (non-browser) environments 7446 if ( !div.style ) { 7447 return; 7448 } 7449 7450 // Support: IE <=9 - 11 only 7451 // Style of cloned element affects source element cloned (#8908) 7452 div.style.backgroundClip = "content-box"; 7453 div.cloneNode( true ).style.backgroundClip = ""; 7454 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 7455 7456 jQuery.extend( support, { 7457 boxSizingReliable: function() { 7458 computeStyleTests(); 7459 return boxSizingReliableVal; 7460 }, 7461 pixelBoxStyles: function() { 7462 computeStyleTests(); 7463 return pixelBoxStylesVal; 7464 }, 7465 pixelPosition: function() { 7466 computeStyleTests(); 7467 return pixelPositionVal; 7468 }, 7469 reliableMarginLeft: function() { 7470 computeStyleTests(); 7471 return reliableMarginLeftVal; 7472 }, 7473 scrollboxSize: function() { 7474 computeStyleTests(); 7475 return scrollboxSizeVal; 7476 }, 7477 7478 // Support: IE 9 - 11+, Edge 15 - 18+ 7479 // IE/Edge misreport `getComputedStyle` of table rows with width/height 7480 // set in CSS while `offset*` properties report correct values. 7481 // Behavior in IE 9 is more subtle than in newer versions & it passes 7482 // some versions of this test; make sure not to make it pass there! 7483 reliableTrDimensions: function() { 7484 var table, tr, trChild, trStyle; 7485 if ( reliableTrDimensionsVal == null ) { 7486 table = document.createElement( "table" ); 7487 tr = document.createElement( "tr" ); 7488 trChild = document.createElement( "div" ); 7489 7490 table.style.cssText = "position:absolute;left:-11111px"; 7491 tr.style.height = "1px"; 7492 trChild.style.height = "9px"; 7493 7494 documentElement 7495 .appendChild( table ) 7496 .appendChild( tr ) 7497 .appendChild( trChild ); 7498 7499 trStyle = window.getComputedStyle( tr ); 7500 reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; 7501 7502 documentElement.removeChild( table ); 7503 } 7504 return reliableTrDimensionsVal; 7505 } 7506 } ); 7507} )(); 7508 7509 7510function curCSS( elem, name, computed ) { 7511 var width, minWidth, maxWidth, ret, 7512 7513 // Support: Firefox 51+ 7514 // Retrieving style before computed somehow 7515 // fixes an issue with getting wrong values 7516 // on detached elements 7517 style = elem.style; 7518 7519 computed = computed || getStyles( elem ); 7520 7521 // getPropertyValue is needed for: 7522 // .css('filter') (IE 9 only, #12537) 7523 // .css('--customProperty) (#3144) 7524 if ( computed ) { 7525 ret = computed.getPropertyValue( name ) || computed[ name ]; 7526 7527 if ( ret === "" && !isAttached( elem ) ) { 7528 ret = jQuery.style( elem, name ); 7529 } 7530 7531 // A tribute to the "awesome hack by Dean Edwards" 7532 // Android Browser returns percentage for some values, 7533 // but width seems to be reliably pixels. 7534 // This is against the CSSOM draft spec: 7535 // https://drafts.csswg.org/cssom/#resolved-values 7536 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 7537 7538 // Remember the original values 7539 width = style.width; 7540 minWidth = style.minWidth; 7541 maxWidth = style.maxWidth; 7542 7543 // Put in the new values to get a computed value out 7544 style.minWidth = style.maxWidth = style.width = ret; 7545 ret = computed.width; 7546 7547 // Revert the changed values 7548 style.width = width; 7549 style.minWidth = minWidth; 7550 style.maxWidth = maxWidth; 7551 } 7552 } 7553 7554 return ret !== undefined ? 7555 7556 // Support: IE <=9 - 11 only 7557 // IE returns zIndex value as an integer. 7558 ret + "" : 7559 ret; 7560} 7561 7562 7563function addGetHookIf( conditionFn, hookFn ) { 7564 7565 // Define the hook, we'll check on the first run if it's really needed. 7566 return { 7567 get: function() { 7568 if ( conditionFn() ) { 7569 7570 // Hook not needed (or it's not possible to use it due 7571 // to missing dependency), remove it. 7572 delete this.get; 7573 return; 7574 } 7575 7576 // Hook needed; redefine it so that the support test is not executed again. 7577 return ( this.get = hookFn ).apply( this, arguments ); 7578 } 7579 }; 7580} 7581 7582 7583var cssPrefixes = [ "Webkit", "Moz", "ms" ], 7584 emptyStyle = document.createElement( "div" ).style, 7585 vendorProps = {}; 7586 7587// Return a vendor-prefixed property or undefined 7588function vendorPropName( name ) { 7589 7590 // Check for vendor prefixed names 7591 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 7592 i = cssPrefixes.length; 7593 7594 while ( i-- ) { 7595 name = cssPrefixes[ i ] + capName; 7596 if ( name in emptyStyle ) { 7597 return name; 7598 } 7599 } 7600} 7601 7602// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 7603function finalPropName( name ) { 7604 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 7605 7606 if ( final ) { 7607 return final; 7608 } 7609 if ( name in emptyStyle ) { 7610 return name; 7611 } 7612 return vendorProps[ name ] = vendorPropName( name ) || name; 7613} 7614 7615 7616var 7617 7618 // Swappable if display is none or starts with table 7619 // except "table", "table-cell", or "table-caption" 7620 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 7621 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 7622 rcustomProp = /^--/, 7623 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 7624 cssNormalTransform = { 7625 letterSpacing: "0", 7626 fontWeight: "400" 7627 }; 7628 7629function setPositiveNumber( _elem, value, subtract ) { 7630 7631 // Any relative (+/-) values have already been
vendor: 7,884 bytes, lines 7632-7883
7632 // normalized at this point 7633 var matches = rcssNum.exec( value ); 7634 return matches ? 7635 7636 // Guard against undefined "subtract", e.g., when used as in cssHooks 7637 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 7638 value; 7639} 7640 7641function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 7642 var i = dimension === "width" ? 1 : 0, 7643 extra = 0, 7644 delta = 0; 7645 7646 // Adjustment may not be necessary 7647 if ( box === ( isBorderBox ? "border" : "content" ) ) { 7648 return 0; 7649 } 7650 7651 for ( ; i < 4; i += 2 ) { 7652 7653 // Both box models exclude margin 7654 if ( box === "margin" ) { 7655 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 7656 } 7657 7658 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 7659 if ( !isBorderBox ) { 7660 7661 // Add padding 7662 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 7663 7664 // For "border" or "margin", add border 7665 if ( box !== "padding" ) { 7666 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 7667 7668 // But still keep track of it otherwise 7669 } else { 7670 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 7671 } 7672 7673 // If we get here with a border-box (content + padding + border), we're seeking "content" or 7674 // "padding" or "margin" 7675 } else { 7676 7677 // For "content", subtract padding 7678 if ( box === "content" ) { 7679 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 7680 } 7681 7682 // For "content" or "padding", subtract border 7683 if ( box !== "margin" ) { 7684 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 7685 } 7686 } 7687 } 7688 7689 // Account for positive content-box scroll gutter when requested by providing computedVal 7690 if ( !isBorderBox && computedVal >= 0 ) { 7691 7692 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 7693 // Assuming integer scroll gutter, subtract the rest and round down 7694 delta += Math.max( 0, Math.ceil( 7695 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 7696 computedVal - 7697 delta - 7698 extra - 7699 0.5 7700 7701 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 7702 // Use an explicit zero to avoid NaN (gh-3964) 7703 ) ) || 0; 7704 } 7705 7706 return delta; 7707} 7708 7709function getWidthOrHeight( elem, dimension, extra ) { 7710 7711 // Start with computed style 7712 var styles = getStyles( elem ), 7713 7714 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 7715 // Fake content-box until we know it's needed to know the true value. 7716 boxSizingNeeded = !support.boxSizingReliable() || extra, 7717 isBorderBox = boxSizingNeeded && 7718 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 7719 valueIsBorderBox = isBorderBox, 7720 7721 val = curCSS( elem, dimension, styles ), 7722 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 7723 7724 // Support: Firefox <=54 7725 // Return a confounding non-pixel value or feign ignorance, as appropriate. 7726 if ( rnumnonpx.test( val ) ) { 7727 if ( !extra ) { 7728 return val; 7729 } 7730 val = "auto"; 7731 } 7732 7733 7734 // Support: IE 9 - 11 only 7735 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 7736 // In those cases, the computed value can be trusted to be border-box. 7737 if ( ( !support.boxSizingReliable() && isBorderBox || 7738 7739 // Support: IE 10 - 11+, Edge 15 - 18+ 7740 // IE/Edge misreport `getComputedStyle` of table rows with width/height 7741 // set in CSS while `offset*` properties report correct values. 7742 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 7743 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 7744 7745 // Fall back to offsetWidth/offsetHeight when value is "auto" 7746 // This happens for inline elements with no explicit setting (gh-3571) 7747 val === "auto" || 7748 7749 // Support: Android <=4.1 - 4.3 only 7750 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 7751 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 7752 7753 // Make sure the element is visible & connected 7754 elem.getClientRects().length ) { 7755 7756 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 7757 7758 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 7759 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 7760 // retrieved value as a content box dimension. 7761 valueIsBorderBox = offsetProp in elem; 7762 if ( valueIsBorderBox ) { 7763 val = elem[ offsetProp ]; 7764 } 7765 } 7766 7767 // Normalize "" and auto 7768 val = parseFloat( val ) || 0; 7769 7770 // Adjust for the element's box model 7771 return ( val + 7772 boxModelAdjustment( 7773 elem, 7774 dimension, 7775 extra || ( isBorderBox ? "border" : "content" ), 7776 valueIsBorderBox, 7777 styles, 7778 7779 // Provide the current computed size to request scroll gutter calculation (gh-3589) 7780 val 7781 ) 7782 ) + "px"; 7783} 7784 7785jQuery.extend( { 7786 7787 // Add in style property hooks for overriding the default 7788 // behavior of getting and setting a style property 7789 cssHooks: { 7790 opacity: { 7791 get: function( elem, computed ) { 7792 if ( computed ) { 7793 7794 // We should always get a number back from opacity 7795 var ret = curCSS( elem, "opacity" ); 7796 return ret === "" ? "1" : ret; 7797 } 7798 } 7799 } 7800 }, 7801 7802 // Don't automatically add "px" to these possibly-unitless properties 7803 cssNumber: { 7804 "animationIterationCount": true, 7805 "columnCount": true, 7806 "fillOpacity": true, 7807 "flexGrow": true, 7808 "flexShrink": true, 7809 "fontWeight": true, 7810 "gridArea": true, 7811 "gridColumn": true, 7812 "gridColumnEnd": true, 7813 "gridColumnStart": true, 7814 "gridRow": true, 7815 "gridRowEnd": true, 7816 "gridRowStart": true, 7817 "lineHeight": true, 7818 "opacity": true, 7819 "order": true, 7820 "orphans": true, 7821 "widows": true, 7822 "zIndex": true, 7823 "zoom": true 7824 }, 7825 7826 // Add in properties whose names you wish to fix before 7827 // setting or getting the value 7828 cssProps: {}, 7829 7830 // Get and set the style property on a DOM Node 7831 style: function( elem, name, value, extra ) { 7832 7833 // Don't set styles on text and comment nodes 7834 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 7835 return; 7836 } 7837 7838 // Make sure that we're working with the right name 7839 var ret, type, hooks, 7840 origName = camelCase( name ), 7841 isCustomProp = rcustomProp.test( name ), 7842 style = elem.style; 7843 7844 // Make sure that we're working with the right name. We don't 7845 // want to query the value if it is a CSS custom property 7846 // since they are user-defined. 7847 if ( !isCustomProp ) { 7848 name = finalPropName( origName ); 7849 } 7850 7851 // Gets hook for the prefixed version, then unprefixed version 7852 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7853 7854 // Check if we're setting a value 7855 if ( value !== undefined ) { 7856 type = typeof value; 7857 7858 // Convert "+=" or "-=" to relative numbers (#7345) 7859 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 7860 value = adjustCSS( elem, name, ret ); 7861 7862 // Fixes bug #9237 7863 type = "number"; 7864 } 7865 7866 // Make sure that null and NaN values aren't set (#7116) 7867 if ( value == null || value !== value ) { 7868 return; 7869 } 7870 7871 // If a number was passed in, add the unit (except for certain CSS properties) 7872 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 7873 // "px" to a few hardcoded values. 7874 if ( type === "number" && !isCustomProp ) { 7875 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 7876 } 7877 7878 // background-* props affect original clone's values 7879 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 7880 style[ name ] = "inherit"; 7881 } 7882 7883 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 12,282 bytes, lines 7884-8328
7884 if ( !hooks || !( "set" in hooks ) || 7885 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 7886 7887 if ( isCustomProp ) { 7888 style.setProperty( name, value ); 7889 } else { 7890 style[ name ] = value; 7891 } 7892 } 7893 7894 } else { 7895 7896 // If a hook was provided get the non-computed value from there 7897 if ( hooks && "get" in hooks && 7898 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 7899 7900 return ret; 7901 } 7902 7903 // Otherwise just get the value from the style object 7904 return style[ name ]; 7905 } 7906 }, 7907 7908 css: function( elem, name, extra, styles ) { 7909 var val, num, hooks, 7910 origName = camelCase( name ), 7911 isCustomProp = rcustomProp.test( name ); 7912 7913 // Make sure that we're working with the right name. We don't 7914 // want to modify the value if it is a CSS custom property 7915 // since they are user-defined. 7916 if ( !isCustomProp ) { 7917 name = finalPropName( origName ); 7918 } 7919 7920 // Try prefixed name followed by the unprefixed name 7921 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7922 7923 // If a hook was provided get the computed value from there 7924 if ( hooks && "get" in hooks ) { 7925 val = hooks.get( elem, true, extra ); 7926 } 7927 7928 // Otherwise, if a way to get the computed value exists, use that 7929 if ( val === undefined ) { 7930 val = curCSS( elem, name, styles ); 7931 } 7932 7933 // Convert "normal" to computed value 7934 if ( val === "normal" && name in cssNormalTransform ) { 7935 val = cssNormalTransform[ name ]; 7936 } 7937 7938 // Make numeric if forced or a qualifier was provided and val looks numeric 7939 if ( extra === "" || extra ) { 7940 num = parseFloat( val ); 7941 return extra === true || isFinite( num ) ? num || 0 : val; 7942 } 7943 7944 return val; 7945 } 7946} ); 7947 7948jQuery.each( [ "height", "width" ], function( _i, dimension ) { 7949 jQuery.cssHooks[ dimension ] = { 7950 get: function( elem, computed, extra ) { 7951 if ( computed ) { 7952 7953 // Certain elements can have dimension info if we invisibly show them 7954 // but it must have a current display style that would benefit 7955 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 7956 7957 // Support: Safari 8+ 7958 // Table columns in Safari have non-zero offsetWidth & zero 7959 // getBoundingClientRect().width unless display is changed. 7960 // Support: IE <=11 only 7961 // Running getBoundingClientRect on a disconnected node 7962 // in IE throws an error. 7963 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 7964 swap( elem, cssShow, function() { 7965 return getWidthOrHeight( elem, dimension, extra ); 7966 } ) : 7967 getWidthOrHeight( elem, dimension, extra ); 7968 } 7969 }, 7970 7971 set: function( elem, value, extra ) { 7972 var matches, 7973 styles = getStyles( elem ), 7974 7975 // Only read styles.position if the test has a chance to fail 7976 // to avoid forcing a reflow. 7977 scrollboxSizeBuggy = !support.scrollboxSize() && 7978 styles.position === "absolute", 7979 7980 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 7981 boxSizingNeeded = scrollboxSizeBuggy || extra, 7982 isBorderBox = boxSizingNeeded && 7983 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 7984 subtract = extra ? 7985 boxModelAdjustment( 7986 elem, 7987 dimension, 7988 extra, 7989 isBorderBox, 7990 styles 7991 ) : 7992 0; 7993 7994 // Account for unreliable border-box dimensions by comparing offset* to computed and 7995 // faking a content-box to get border and padding (gh-3699) 7996 if ( isBorderBox && scrollboxSizeBuggy ) { 7997 subtract -= Math.ceil( 7998 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 7999 parseFloat( styles[ dimension ] ) - 8000 boxModelAdjustment( elem, dimension, "border", false, styles ) - 8001 0.5 8002 ); 8003 } 8004 8005 // Convert to pixels if value adjustment is needed 8006 if ( subtract && ( matches = rcssNum.exec( value ) ) && 8007 ( matches[ 3 ] || "px" ) !== "px" ) { 8008 8009 elem.style[ dimension ] = value; 8010 value = jQuery.css( elem, dimension ); 8011 } 8012 8013 return setPositiveNumber( elem, value, subtract ); 8014 } 8015 }; 8016} ); 8017 8018jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 8019 function( elem, computed ) { 8020 if ( computed ) { 8021 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 8022 elem.getBoundingClientRect().left - 8023 swap( elem, { marginLeft: 0 }, function() { 8024 return elem.getBoundingClientRect().left; 8025 } ) 8026 ) + "px"; 8027 } 8028 } 8029); 8030 8031// These hooks are used by animate to expand properties 8032jQuery.each( { 8033 margin: "", 8034 padding: "", 8035 border: "Width" 8036}, function( prefix, suffix ) { 8037 jQuery.cssHooks[ prefix + suffix ] = { 8038 expand: function( value ) { 8039 var i = 0, 8040 expanded = {}, 8041 8042 // Assumes a single number if not a string 8043 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 8044 8045 for ( ; i < 4; i++ ) { 8046 expanded[ prefix + cssExpand[ i ] + suffix ] = 8047 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 8048 } 8049 8050 return expanded; 8051 } 8052 }; 8053 8054 if ( prefix !== "margin" ) { 8055 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 8056 } 8057} ); 8058 8059jQuery.fn.extend( { 8060 css: function( name, value ) { 8061 return access( this, function( elem, name, value ) { 8062 var styles, len, 8063 map = {}, 8064 i = 0; 8065 8066 if ( Array.isArray( name ) ) { 8067 styles = getStyles( elem ); 8068 len = name.length; 8069 8070 for ( ; i < len; i++ ) { 8071 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 8072 } 8073 8074 return map; 8075 } 8076 8077 return value !== undefined ? 8078 jQuery.style( elem, name, value ) : 8079 jQuery.css( elem, name ); 8080 }, name, value, arguments.length > 1 ); 8081 } 8082} ); 8083 8084 8085function Tween( elem, options, prop, end, easing ) { 8086 return new Tween.prototype.init( elem, options, prop, end, easing ); 8087} 8088jQuery.Tween = Tween; 8089 8090Tween.prototype = { 8091 constructor: Tween, 8092 init: function( elem, options, prop, end, easing, unit ) { 8093 this.elem = elem; 8094 this.prop = prop; 8095 this.easing = easing || jQuery.easing._default; 8096 this.options = options; 8097 this.start = this.now = this.cur(); 8098 this.end = end; 8099 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 8100 }, 8101 cur: function() { 8102 var hooks = Tween.propHooks[ this.prop ]; 8103 8104 return hooks && hooks.get ? 8105 hooks.get( this ) : 8106 Tween.propHooks._default.get( this ); 8107 }, 8108 run: function( percent ) { 8109 var eased, 8110 hooks = Tween.propHooks[ this.prop ]; 8111 8112 if ( this.options.duration ) { 8113 this.pos = eased = jQuery.easing[ this.easing ]( 8114 percent, this.options.duration * percent, 0, 1, this.options.duration 8115 ); 8116 } else { 8117 this.pos = eased = percent; 8118 } 8119 this.now = ( this.end - this.start ) * eased + this.start; 8120 8121 if ( this.options.step ) { 8122 this.options.step.call( this.elem, this.now, this ); 8123 } 8124 8125 if ( hooks && hooks.set ) { 8126 hooks.set( this ); 8127 } else { 8128 Tween.propHooks._default.set( this ); 8129 } 8130 return this; 8131 } 8132}; 8133 8134Tween.prototype.init.prototype = Tween.prototype; 8135 8136Tween.propHooks = { 8137 _default: { 8138 get: function( tween ) { 8139 var result; 8140 8141 // Use a property on the element directly when it is not a DOM element, 8142 // or when there is no matching style property that exists. 8143 if ( tween.elem.nodeType !== 1 || 8144 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 8145 return tween.elem[ tween.prop ]; 8146 } 8147 8148 // Passing an empty string as a 3rd parameter to .css will automatically 8149 // attempt a parseFloat and fallback to a string if the parse fails. 8150 // Simple values such as "10px" are parsed to Float; 8151 // complex values such as "rotate(1rad)" are returned as-is. 8152 result = jQuery.css( tween.elem, tween.prop, "" ); 8153 8154 // Empty strings, null, undefined and "auto" are converted to 0. 8155 return !result || result === "auto" ? 0 : result; 8156 }, 8157 set: function( tween ) { 8158 8159 // Use step hook for back compat. 8160 // Use cssHook if its there. 8161 // Use .style if available and use plain properties where available. 8162 if ( jQuery.fx.step[ tween.prop ] ) { 8163 jQuery.fx.step[ tween.prop ]( tween ); 8164 } else if ( tween.elem.nodeType === 1 && ( 8165 jQuery.cssHooks[ tween.prop ] || 8166 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 8167 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 8168 } else { 8169 tween.elem[ tween.prop ] = tween.now; 8170 } 8171 } 8172 } 8173}; 8174 8175// Support: IE <=9 only 8176// Panic based approach to setting things on disconnected nodes 8177Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 8178 set: function( tween ) { 8179 if ( tween.elem.nodeType && tween.elem.parentNode ) { 8180 tween.elem[ tween.prop ] = tween.now; 8181 } 8182 } 8183}; 8184 8185jQuery.easing = { 8186 linear: function( p ) { 8187 return p; 8188 }, 8189 swing: function( p ) { 8190 return 0.5 - Math.cos( p * Math.PI ) / 2; 8191 }, 8192 _default: "swing" 8193}; 8194 8195jQuery.fx = Tween.prototype.init; 8196 8197// Back compat <1.8 extension point 8198jQuery.fx.step = {}; 8199 8200 8201 8202 8203var 8204 fxNow, inProgress, 8205 rfxtypes = /^(?:toggle|show|hide)$/, 8206 rrun = /queueHooks$/; 8207 8208function schedule() { 8209 if ( inProgress ) { 8210 if ( document.hidden === false && window.requestAnimationFrame ) { 8211 window.requestAnimationFrame( schedule ); 8212 } else { 8213 window.setTimeout( schedule, jQuery.fx.interval ); 8214 } 8215 8216 jQuery.fx.tick(); 8217 } 8218} 8219 8220// Animations created synchronously will run synchronously 8221function createFxNow() { 8222 window.setTimeout( function() { 8223 fxNow = undefined; 8224 } ); 8225 return ( fxNow = Date.now() ); 8226} 8227 8228// Generate parameters to create a standard animation 8229function genFx( type, includeWidth ) { 8230 var which, 8231 i = 0, 8232 attrs = { height: type }; 8233 8234 // If we include width, step value is 1 to do all cssExpand values, 8235 // otherwise step value is 2 to skip over Left and Right 8236 includeWidth = includeWidth ? 1 : 0; 8237 for ( ; i < 4; i += 2 - includeWidth ) { 8238 which = cssExpand[ i ]; 8239 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 8240 } 8241 8242 if ( includeWidth ) { 8243 attrs.opacity = attrs.width = type; 8244 } 8245 8246 return attrs; 8247} 8248 8249function createTween( value, prop, animation ) { 8250 var tween, 8251 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 8252 index = 0, 8253 length = collection.length; 8254 for ( ; index < length; index++ ) { 8255 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 8256 8257 // We're done with this property 8258 return tween; 8259 } 8260 } 8261} 8262 8263function defaultPrefilter( elem, props, opts ) { 8264 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 8265 isBox = "width" in props || "height" in props, 8266 anim = this, 8267 orig = {}, 8268 style = elem.style, 8269 hidden = elem.nodeType && isHiddenWithinTree( elem ), 8270 dataShow = dataPriv.get( elem, "fxshow" ); 8271 8272 // Queue-skipping animations hijack the fx hooks 8273 if ( !opts.queue ) { 8274 hooks = jQuery._queueHooks( elem, "fx" ); 8275 if ( hooks.unqueued == null ) { 8276 hooks.unqueued = 0; 8277 oldfire = hooks.empty.fire; 8278 hooks.empty.fire = function() { 8279 if ( !hooks.unqueued ) { 8280 oldfire(); 8281 } 8282 }; 8283 } 8284 hooks.unqueued++; 8285 8286 anim.always( function() { 8287 8288 // Ensure the complete handler is called before this completes 8289 anim.always( function() { 8290 hooks.unqueued--; 8291 if ( !jQuery.queue( elem, "fx" ).length ) { 8292 hooks.empty.fire(); 8293 } 8294 } ); 8295 } ); 8296 } 8297 8298 // Detect show/hide animations 8299 for ( prop in props ) { 8300 value = props[ prop ]; 8301 if ( rfxtypes.test( value ) ) { 8302 delete props[ prop ]; 8303 toggle = toggle || value === "toggle"; 8304 if ( value === ( hidden ? "hide" : "show" ) ) { 8305 8306 // Pretend to be hidden if this is a "show" and 8307 // there is still data from a stopped show/hide 8308 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 8309 hidden = true; 8310 8311 // Ignore all other no-op show/hide data 8312 } else { 8313 continue; 8314 } 8315 } 8316 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 8317 } 8318 } 8319 8320 // Bail out if this is a no-op like .hide().hide() 8321 propTween = !jQuery.isEmptyObject( props ); 8322 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 8323 return; 8324 } 8325 8326 // Restrict "overflow" and "display" styles during box animations 8327 if ( isBox && elem.nodeType === 1 ) { 8328
vendor: 4,380 bytes, lines 8329-8488
8329 // Support: IE <=9 - 11, Edge 12 - 15 8330 // Record all 3 overflow attributes because IE does not infer the shorthand 8331 // from identically-valued overflowX and overflowY and Edge just mirrors 8332 // the overflowX value there. 8333 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 8334 8335 // Identify a display type, preferring old show/hide data over the CSS cascade 8336 restoreDisplay = dataShow && dataShow.display; 8337 if ( restoreDisplay == null ) { 8338 restoreDisplay = dataPriv.get( elem, "display" ); 8339 } 8340 display = jQuery.css( elem, "display" ); 8341 if ( display === "none" ) { 8342 if ( restoreDisplay ) { 8343 display = restoreDisplay; 8344 } else { 8345 8346 // Get nonempty value(s) by temporarily forcing visibility 8347 showHide( [ elem ], true ); 8348 restoreDisplay = elem.style.display || restoreDisplay; 8349 display = jQuery.css( elem, "display" ); 8350 showHide( [ elem ] ); 8351 } 8352 } 8353 8354 // Animate inline elements as inline-block 8355 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 8356 if ( jQuery.css( elem, "float" ) === "none" ) { 8357 8358 // Restore the original display value at the end of pure show/hide animations 8359 if ( !propTween ) { 8360 anim.done( function() { 8361 style.display = restoreDisplay; 8362 } ); 8363 if ( restoreDisplay == null ) { 8364 display = style.display; 8365 restoreDisplay = display === "none" ? "" : display; 8366 } 8367 } 8368 style.display = "inline-block"; 8369 } 8370 } 8371 } 8372 8373 if ( opts.overflow ) { 8374 style.overflow = "hidden"; 8375 anim.always( function() { 8376 style.overflow = opts.overflow[ 0 ]; 8377 style.overflowX = opts.overflow[ 1 ]; 8378 style.overflowY = opts.overflow[ 2 ]; 8379 } ); 8380 } 8381 8382 // Implement show/hide animations 8383 propTween = false; 8384 for ( prop in orig ) { 8385 8386 // General show/hide setup for this element animation 8387 if ( !propTween ) { 8388 if ( dataShow ) { 8389 if ( "hidden" in dataShow ) { 8390 hidden = dataShow.hidden; 8391 } 8392 } else { 8393 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 8394 } 8395 8396 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 8397 if ( toggle ) { 8398 dataShow.hidden = !hidden; 8399 } 8400 8401 // Show elements before animating them 8402 if ( hidden ) { 8403 showHide( [ elem ], true ); 8404 } 8405 8406 /* eslint-disable no-loop-func */ 8407 8408 anim.done( function() { 8409 8410 /* eslint-enable no-loop-func */ 8411 8412 // The final step of a "hide" animation is actually hiding the element 8413 if ( !hidden ) { 8414 showHide( [ elem ] ); 8415 } 8416 dataPriv.remove( elem, "fxshow" ); 8417 for ( prop in orig ) { 8418 jQuery.style( elem, prop, orig[ prop ] ); 8419 } 8420 } ); 8421 } 8422 8423 // Per-property setup 8424 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 8425 if ( !( prop in dataShow ) ) { 8426 dataShow[ prop ] = propTween.start; 8427 if ( hidden ) { 8428 propTween.end = propTween.start; 8429 propTween.start = 0; 8430 } 8431 } 8432 } 8433} 8434 8435function propFilter( props, specialEasing ) { 8436 var index, name, easing, value, hooks; 8437 8438 // camelCase, specialEasing and expand cssHook pass 8439 for ( index in props ) { 8440 name = camelCase( index ); 8441 easing = specialEasing[ name ]; 8442 value = props[ index ]; 8443 if ( Array.isArray( value ) ) { 8444 easing = value[ 1 ]; 8445 value = props[ index ] = value[ 0 ]; 8446 } 8447 8448 if ( index !== name ) { 8449 props[ name ] = value; 8450 delete props[ index ]; 8451 } 8452 8453 hooks = jQuery.cssHooks[ name ]; 8454 if ( hooks && "expand" in hooks ) { 8455 value = hooks.expand( value ); 8456 delete props[ name ]; 8457 8458 // Not quite $.extend, this won't overwrite existing keys. 8459 // Reusing 'index' because we have the correct "name" 8460 for ( index in value ) { 8461 if ( !( index in props ) ) { 8462 props[ index ] = value[ index ]; 8463 specialEasing[ index ] = easing; 8464 } 8465 } 8466 } else { 8467 specialEasing[ name ] = easing; 8468 } 8469 } 8470} 8471 8472function Animation( elem, properties, options ) { 8473 var result, 8474 stopped, 8475 index = 0, 8476 length = Animation.prefilters.length, 8477 deferred = jQuery.Deferred().always( function() { 8478 8479 // Don't match elem in the :animated selector 8480 delete tick.elem; 8481 } ), 8482 tick = function() { 8483 if ( stopped ) { 8484 return false; 8485 } 8486 var currentTime = fxNow || createFxNow(), 8487 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 8488
vendor: 17,315 bytes, lines 8489-9185
8489 // Support: Android 2.3 only 8490 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 8491 temp = remaining / animation.duration || 0, 8492 percent = 1 - temp, 8493 index = 0, 8494 length = animation.tweens.length; 8495 8496 for ( ; index < length; index++ ) { 8497 animation.tweens[ index ].run( percent ); 8498 } 8499 8500 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 8501 8502 // If there's more to do, yield 8503 if ( percent < 1 && length ) { 8504 return remaining; 8505 } 8506 8507 // If this was an empty animation, synthesize a final progress notification 8508 if ( !length ) { 8509 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 8510 } 8511 8512 // Resolve the animation and report its conclusion 8513 deferred.resolveWith( elem, [ animation ] ); 8514 return false; 8515 }, 8516 animation = deferred.promise( { 8517 elem: elem, 8518 props: jQuery.extend( {}, properties ), 8519 opts: jQuery.extend( true, { 8520 specialEasing: {}, 8521 easing: jQuery.easing._default 8522 }, options ), 8523 originalProperties: properties, 8524 originalOptions: options, 8525 startTime: fxNow || createFxNow(), 8526 duration: options.duration, 8527 tweens: [], 8528 createTween: function( prop, end ) { 8529 var tween = jQuery.Tween( elem, animation.opts, prop, end, 8530 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 8531 animation.tweens.push( tween ); 8532 return tween; 8533 }, 8534 stop: function( gotoEnd ) { 8535 var index = 0, 8536 8537 // If we are going to the end, we want to run all the tweens 8538 // otherwise we skip this part 8539 length = gotoEnd ? animation.tweens.length : 0; 8540 if ( stopped ) { 8541 return this; 8542 } 8543 stopped = true; 8544 for ( ; index < length; index++ ) { 8545 animation.tweens[ index ].run( 1 ); 8546 } 8547 8548 // Resolve when we played the last frame; otherwise, reject 8549 if ( gotoEnd ) { 8550 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 8551 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 8552 } else { 8553 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 8554 } 8555 return this; 8556 } 8557 } ), 8558 props = animation.props; 8559 8560 propFilter( props, animation.opts.specialEasing ); 8561 8562 for ( ; index < length; index++ ) { 8563 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 8564 if ( result ) { 8565 if ( isFunction( result.stop ) ) { 8566 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 8567 result.stop.bind( result ); 8568 } 8569 return result; 8570 } 8571 } 8572 8573 jQuery.map( props, createTween, animation ); 8574 8575 if ( isFunction( animation.opts.start ) ) { 8576 animation.opts.start.call( elem, animation ); 8577 } 8578 8579 // Attach callbacks from options 8580 animation 8581 .progress( animation.opts.progress ) 8582 .done( animation.opts.done, animation.opts.complete ) 8583 .fail( animation.opts.fail ) 8584 .always( animation.opts.always ); 8585 8586 jQuery.fx.timer( 8587 jQuery.extend( tick, { 8588 elem: elem, 8589 anim: animation, 8590 queue: animation.opts.queue 8591 } ) 8592 ); 8593 8594 return animation; 8595} 8596 8597jQuery.Animation = jQuery.extend( Animation, { 8598 8599 tweeners: { 8600 "*": [ function( prop, value ) { 8601 var tween = this.createTween( prop, value ); 8602 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 8603 return tween; 8604 } ] 8605 }, 8606 8607 tweener: function( props, callback ) { 8608 if ( isFunction( props ) ) { 8609 callback = props; 8610 props = [ "*" ]; 8611 } else { 8612 props = props.match( rnothtmlwhite ); 8613 } 8614 8615 var prop, 8616 index = 0, 8617 length = props.length; 8618 8619 for ( ; index < length; index++ ) { 8620 prop = props[ index ]; 8621 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 8622 Animation.tweeners[ prop ].unshift( callback ); 8623 } 8624 }, 8625 8626 prefilters: [ defaultPrefilter ], 8627 8628 prefilter: function( callback, prepend ) { 8629 if ( prepend ) { 8630 Animation.prefilters.unshift( callback ); 8631 } else { 8632 Animation.prefilters.push( callback ); 8633 } 8634 } 8635} ); 8636 8637jQuery.speed = function( speed, easing, fn ) { 8638 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 8639 complete: fn || !fn && easing || 8640 isFunction( speed ) && speed, 8641 duration: speed, 8642 easing: fn && easing || easing && !isFunction( easing ) && easing 8643 }; 8644 8645 // Go to the end state if fx are off 8646 if ( jQuery.fx.off ) { 8647 opt.duration = 0; 8648 8649 } else { 8650 if ( typeof opt.duration !== "number" ) { 8651 if ( opt.duration in jQuery.fx.speeds ) { 8652 opt.duration = jQuery.fx.speeds[ opt.duration ]; 8653 8654 } else { 8655 opt.duration = jQuery.fx.speeds._default; 8656 } 8657 } 8658 } 8659 8660 // Normalize opt.queue - true/undefined/null -> "fx" 8661 if ( opt.queue == null || opt.queue === true ) { 8662 opt.queue = "fx"; 8663 } 8664 8665 // Queueing 8666 opt.old = opt.complete; 8667 8668 opt.complete = function() { 8669 if ( isFunction( opt.old ) ) { 8670 opt.old.call( this ); 8671 } 8672 8673 if ( opt.queue ) { 8674 jQuery.dequeue( this, opt.queue ); 8675 } 8676 }; 8677 8678 return opt; 8679}; 8680 8681jQuery.fn.extend( { 8682 fadeTo: function( speed, to, easing, callback ) { 8683 8684 // Show any hidden elements after setting opacity to 0 8685 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 8686 8687 // Animate to the value specified 8688 .end().animate( { opacity: to }, speed, easing, callback ); 8689 }, 8690 animate: function( prop, speed, easing, callback ) { 8691 var empty = jQuery.isEmptyObject( prop ), 8692 optall = jQuery.speed( speed, easing, callback ), 8693 doAnimation = function() { 8694 8695 // Operate on a copy of prop so per-property easing won't be lost 8696 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 8697 8698 // Empty animations, or finishing resolves immediately 8699 if ( empty || dataPriv.get( this, "finish" ) ) { 8700 anim.stop( true ); 8701 } 8702 }; 8703 doAnimation.finish = doAnimation; 8704 8705 return empty || optall.queue === false ? 8706 this.each( doAnimation ) : 8707 this.queue( optall.queue, doAnimation ); 8708 }, 8709 stop: function( type, clearQueue, gotoEnd ) { 8710 var stopQueue = function( hooks ) { 8711 var stop = hooks.stop; 8712 delete hooks.stop; 8713 stop( gotoEnd ); 8714 }; 8715 8716 if ( typeof type !== "string" ) { 8717 gotoEnd = clearQueue; 8718 clearQueue = type; 8719 type = undefined; 8720 } 8721 if ( clearQueue ) { 8722 this.queue( type || "fx", [] ); 8723 } 8724 8725 return this.each( function() { 8726 var dequeue = true, 8727 index = type != null && type + "queueHooks", 8728 timers = jQuery.timers, 8729 data = dataPriv.get( this ); 8730 8731 if ( index ) { 8732 if ( data[ index ] && data[ index ].stop ) { 8733 stopQueue( data[ index ] ); 8734 } 8735 } else { 8736 for ( index in data ) { 8737 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 8738 stopQueue( data[ index ] ); 8739 } 8740 } 8741 } 8742 8743 for ( index = timers.length; index--; ) { 8744 if ( timers[ index ].elem === this && 8745 ( type == null || timers[ index ].queue === type ) ) { 8746 8747 timers[ index ].anim.stop( gotoEnd ); 8748 dequeue = false; 8749 timers.splice( index, 1 ); 8750 } 8751 } 8752 8753 // Start the next in the queue if the last step wasn't forced. 8754 // Timers currently will call their complete callbacks, which 8755 // will dequeue but only if they were gotoEnd. 8756 if ( dequeue || !gotoEnd ) { 8757 jQuery.dequeue( this, type ); 8758 } 8759 } ); 8760 }, 8761 finish: function( type ) { 8762 if ( type !== false ) { 8763 type = type || "fx"; 8764 } 8765 return this.each( function() { 8766 var index, 8767 data = dataPriv.get( this ), 8768 queue = data[ type + "queue" ], 8769 hooks = data[ type + "queueHooks" ], 8770 timers = jQuery.timers, 8771 length = queue ? queue.length : 0; 8772 8773 // Enable finishing flag on private data 8774 data.finish = true; 8775 8776 // Empty the queue first 8777 jQuery.queue( this, type, [] ); 8778 8779 if ( hooks && hooks.stop ) { 8780 hooks.stop.call( this, true ); 8781 } 8782 8783 // Look for any active animations, and finish them 8784 for ( index = timers.length; index--; ) { 8785 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 8786 timers[ index ].anim.stop( true ); 8787 timers.splice( index, 1 ); 8788 } 8789 } 8790 8791 // Look for any animations in the old queue and finish them 8792 for ( index = 0; index < length; index++ ) { 8793 if ( queue[ index ] && queue[ index ].finish ) { 8794 queue[ index ].finish.call( this ); 8795 } 8796 } 8797 8798 // Turn off finishing flag 8799 delete data.finish; 8800 } ); 8801 } 8802} ); 8803 8804jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 8805 var cssFn = jQuery.fn[ name ]; 8806 jQuery.fn[ name ] = function( speed, easing, callback ) { 8807 return speed == null || typeof speed === "boolean" ? 8808 cssFn.apply( this, arguments ) : 8809 this.animate( genFx( name, true ), speed, easing, callback ); 8810 }; 8811} ); 8812 8813// Generate shortcuts for custom animations 8814jQuery.each( { 8815 slideDown: genFx( "show" ), 8816 slideUp: genFx( "hide" ), 8817 slideToggle: genFx( "toggle" ), 8818 fadeIn: { opacity: "show" }, 8819 fadeOut: { opacity: "hide" }, 8820 fadeToggle: { opacity: "toggle" } 8821}, function( name, props ) { 8822 jQuery.fn[ name ] = function( speed, easing, callback ) { 8823 return this.animate( props, speed, easing, callback ); 8824 }; 8825} ); 8826 8827jQuery.timers = []; 8828jQuery.fx.tick = function() { 8829 var timer, 8830 i = 0, 8831 timers = jQuery.timers; 8832 8833 fxNow = Date.now(); 8834 8835 for ( ; i < timers.length; i++ ) { 8836 timer = timers[ i ]; 8837 8838 // Run the timer and safely remove it when done (allowing for external removal) 8839 if ( !timer() && timers[ i ] === timer ) { 8840 timers.splice( i--, 1 ); 8841 } 8842 } 8843 8844 if ( !timers.length ) { 8845 jQuery.fx.stop(); 8846 } 8847 fxNow = undefined; 8848}; 8849 8850jQuery.fx.timer = function( timer ) { 8851 jQuery.timers.push( timer ); 8852 jQuery.fx.start(); 8853}; 8854 8855jQuery.fx.interval = 13; 8856jQuery.fx.start = function() { 8857 if ( inProgress ) { 8858 return; 8859 } 8860 8861 inProgress = true; 8862 schedule(); 8863}; 8864 8865jQuery.fx.stop = function() { 8866 inProgress = null; 8867}; 8868 8869jQuery.fx.speeds = { 8870 slow: 600, 8871 fast: 200, 8872 8873 // Default speed 8874 _default: 400 8875}; 8876 8877 8878// Based off of the plugin by Clint Helfers, with permission. 8879// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 8880jQuery.fn.delay = function( time, type ) { 8881 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 8882 type = type || "fx"; 8883 8884 return this.queue( type, function( next, hooks ) { 8885 var timeout = window.setTimeout( next, time ); 8886 hooks.stop = function() { 8887 window.clearTimeout( timeout ); 8888 }; 8889 } ); 8890}; 8891 8892 8893( function() { 8894 var input = document.createElement( "input" ), 8895 select = document.createElement( "select" ), 8896 opt = select.appendChild( document.createElement( "option" ) ); 8897 8898 input.type = "checkbox"; 8899 8900 // Support: Android <=4.3 only 8901 // Default value for a checkbox should be "on" 8902 support.checkOn = input.value !== ""; 8903 8904 // Support: IE <=11 only 8905 // Must access selectedIndex to make default options select 8906 support.optSelected = opt.selected; 8907 8908 // Support: IE <=11 only 8909 // An input loses its value after becoming a radio 8910 input = document.createElement( "input" ); 8911 input.value = "t"; 8912 input.type = "radio"; 8913 support.radioValue = input.value === "t"; 8914} )(); 8915 8916 8917var boolHook, 8918 attrHandle = jQuery.expr.attrHandle; 8919 8920jQuery.fn.extend( { 8921 attr: function( name, value ) { 8922 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 8923 }, 8924 8925 removeAttr: function( name ) { 8926 return this.each( function() { 8927 jQuery.removeAttr( this, name ); 8928 } ); 8929 } 8930} ); 8931 8932jQuery.extend( { 8933 attr: function( elem, name, value ) { 8934 var ret, hooks, 8935 nType = elem.nodeType; 8936 8937 // Don't get/set attributes on text, comment and attribute nodes 8938 if ( nType === 3 || nType === 8 || nType === 2 ) { 8939 return; 8940 } 8941 8942 // Fallback to prop when attributes are not supported 8943 if ( typeof elem.getAttribute === "undefined" ) { 8944 return jQuery.prop( elem, name, value ); 8945 } 8946 8947 // Attribute hooks are determined by the lowercase version 8948 // Grab necessary hook if one is defined 8949 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8950 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 8951 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 8952 } 8953 8954 if ( value !== undefined ) { 8955 if ( value === null ) { 8956 jQuery.removeAttr( elem, name ); 8957 return; 8958 } 8959 8960 if ( hooks && "set" in hooks && 8961 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8962 return ret; 8963 } 8964 8965 elem.setAttribute( name, value + "" ); 8966 return value; 8967 } 8968 8969 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8970 return ret; 8971 } 8972 8973 ret = jQuery.find.attr( elem, name ); 8974 8975 // Non-existent attributes return null, we normalize to undefined 8976 return ret == null ? undefined : ret; 8977 }, 8978 8979 attrHooks: { 8980 type: { 8981 set: function( elem, value ) { 8982 if ( !support.radioValue && value === "radio" && 8983 nodeName( elem, "input" ) ) { 8984 var val = elem.value; 8985 elem.setAttribute( "type", value ); 8986 if ( val ) { 8987 elem.value = val; 8988 } 8989 return value; 8990 } 8991 } 8992 } 8993 }, 8994 8995 removeAttr: function( elem, value ) { 8996 var name, 8997 i = 0, 8998 8999 // Attribute names can contain non-HTML whitespace characters 9000 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 9001 attrNames = value && value.match( rnothtmlwhite ); 9002 9003 if ( attrNames && elem.nodeType === 1 ) { 9004 while ( ( name = attrNames[ i++ ] ) ) { 9005 elem.removeAttribute( name ); 9006 } 9007 } 9008 } 9009} ); 9010 9011// Hooks for boolean attributes 9012boolHook = { 9013 set: function( elem, value, name ) { 9014 if ( value === false ) { 9015 9016 // Remove boolean attributes when set to false 9017 jQuery.removeAttr( elem, name ); 9018 } else { 9019 elem.setAttribute( name, name ); 9020 } 9021 return name; 9022 } 9023}; 9024 9025jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 9026 var getter = attrHandle[ name ] || jQuery.find.attr; 9027 9028 attrHandle[ name ] = function( elem, name, isXML ) { 9029 var ret, handle, 9030 lowercaseName = name.toLowerCase(); 9031 9032 if ( !isXML ) { 9033 9034 // Avoid an infinite loop by temporarily removing this function from the getter 9035 handle = attrHandle[ lowercaseName ]; 9036 attrHandle[ lowercaseName ] = ret; 9037 ret = getter( elem, name, isXML ) != null ? 9038 lowercaseName : 9039 null; 9040 attrHandle[ lowercaseName ] = handle; 9041 } 9042 return ret; 9043 }; 9044} ); 9045 9046 9047 9048 9049var rfocusable = /^(?:input|select|textarea|button)$/i, 9050 rclickable = /^(?:a|area)$/i; 9051 9052jQuery.fn.extend( { 9053 prop: function( name, value ) { 9054 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 9055 }, 9056 9057 removeProp: function( name ) { 9058 return this.each( function() { 9059 delete this[ jQuery.propFix[ name ] || name ]; 9060 } ); 9061 } 9062} ); 9063 9064jQuery.extend( { 9065 prop: function( elem, name, value ) { 9066 var ret, hooks, 9067 nType = elem.nodeType; 9068 9069 // Don't get/set properties on text, comment and attribute nodes 9070 if ( nType === 3 || nType === 8 || nType === 2 ) { 9071 return; 9072 } 9073 9074 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 9075 9076 // Fix name and attach hooks 9077 name = jQuery.propFix[ name ] || name; 9078 hooks = jQuery.propHooks[ name ]; 9079 } 9080 9081 if ( value !== undefined ) { 9082 if ( hooks && "set" in hooks && 9083 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 9084 return ret; 9085 } 9086 9087 return ( elem[ name ] = value ); 9088 } 9089 9090 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 9091 return ret; 9092 } 9093 9094 return elem[ name ]; 9095 }, 9096 9097 propHooks: { 9098 tabIndex: { 9099 get: function( elem ) { 9100 9101 // Support: IE <=9 - 11 only 9102 // elem.tabIndex doesn't always return the 9103 // correct value when it hasn't been explicitly set 9104 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 9105 // Use proper attribute retrieval(#12072) 9106 var tabindex = jQuery.find.attr( elem, "tabindex" ); 9107 9108 if ( tabindex ) { 9109 return parseInt( tabindex, 10 ); 9110 } 9111 9112 if ( 9113 rfocusable.test( elem.nodeName ) || 9114 rclickable.test( elem.nodeName ) && 9115 elem.href 9116 ) { 9117 return 0; 9118 } 9119 9120 return -1; 9121 } 9122 } 9123 }, 9124 9125 propFix: { 9126 "for": "htmlFor", 9127 "class": "className" 9128 } 9129} ); 9130 9131// Support: IE <=11 only 9132// Accessing the selectedIndex property 9133// forces the browser to respect setting selected 9134// on the option 9135// The getter ensures a default option is selected 9136// when in an optgroup 9137// eslint rule "no-unused-expressions" is disabled for this code 9138// since it considers such accessions noop 9139if ( !support.optSelected ) { 9140 jQuery.propHooks.selected = { 9141 get: function( elem ) { 9142 9143 /* eslint no-unused-expressions: "off" */ 9144 9145 var parent = elem.parentNode; 9146 if ( parent && parent.parentNode ) { 9147 parent.parentNode.selectedIndex; 9148 } 9149 return null; 9150 }, 9151 set: function( elem ) { 9152 9153 /* eslint no-unused-expressions: "off" */ 9154 9155 var parent = elem.parentNode; 9156 if ( parent ) { 9157 parent.selectedIndex; 9158 9159 if ( parent.parentNode ) { 9160 parent.parentNode.selectedIndex; 9161 } 9162 } 9163 } 9164 }; 9165} 9166 9167jQuery.each( [ 9168 "tabIndex", 9169 "readOnly", 9170 "maxLength", 9171 "cellSpacing", 9172 "cellPadding", 9173 "rowSpan", 9174 "colSpan", 9175 "useMap", 9176 "frameBorder", 9177 "contentEditable" 9178], function() { 9179 jQuery.propFix[ this.toLowerCase() ] = this; 9180} ); 9181 9182 9183 9184 9185 // Strip and collapse whitespace according to HTML spec
vendor: 9,930 bytes, lines 9186-9589
9186 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 9187 function stripAndCollapse( value ) { 9188 var tokens = value.match( rnothtmlwhite ) || []; 9189 return tokens.join( " " ); 9190 } 9191 9192 9193function getClass( elem ) { 9194 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 9195} 9196 9197function classesToArray( value ) { 9198 if ( Array.isArray( value ) ) { 9199 return value; 9200 } 9201 if ( typeof value === "string" ) { 9202 return value.match( rnothtmlwhite ) || []; 9203 } 9204 return []; 9205} 9206 9207jQuery.fn.extend( { 9208 addClass: function( value ) { 9209 var classes, elem, cur, curValue, clazz, j, finalValue, 9210 i = 0; 9211 9212 if ( isFunction( value ) ) { 9213 return this.each( function( j ) { 9214 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 9215 } ); 9216 } 9217 9218 classes = classesToArray( value ); 9219 9220 if ( classes.length ) { 9221 while ( ( elem = this[ i++ ] ) ) { 9222 curValue = getClass( elem ); 9223 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 9224 9225 if ( cur ) { 9226 j = 0; 9227 while ( ( clazz = classes[ j++ ] ) ) { 9228 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 9229 cur += clazz + " "; 9230 } 9231 } 9232 9233 // Only assign if different to avoid unneeded rendering. 9234 finalValue = stripAndCollapse( cur ); 9235 if ( curValue !== finalValue ) { 9236 elem.setAttribute( "class", finalValue ); 9237 } 9238 } 9239 } 9240 } 9241 9242 return this; 9243 }, 9244 9245 removeClass: function( value ) { 9246 var classes, elem, cur, curValue, clazz, j, finalValue, 9247 i = 0; 9248 9249 if ( isFunction( value ) ) { 9250 return this.each( function( j ) { 9251 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 9252 } ); 9253 } 9254 9255 if ( !arguments.length ) { 9256 return this.attr( "class", "" ); 9257 } 9258 9259 classes = classesToArray( value ); 9260 9261 if ( classes.length ) { 9262 while ( ( elem = this[ i++ ] ) ) { 9263 curValue = getClass( elem ); 9264 9265 // This expression is here for better compressibility (see addClass) 9266 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 9267 9268 if ( cur ) { 9269 j = 0; 9270 while ( ( clazz = classes[ j++ ] ) ) { 9271 9272 // Remove *all* instances 9273 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 9274 cur = cur.replace( " " + clazz + " ", " " ); 9275 } 9276 } 9277 9278 // Only assign if different to avoid unneeded rendering. 9279 finalValue = stripAndCollapse( cur ); 9280 if ( curValue !== finalValue ) { 9281 elem.setAttribute( "class", finalValue ); 9282 } 9283 } 9284 } 9285 } 9286 9287 return this; 9288 }, 9289 9290 toggleClass: function( value, stateVal ) { 9291 var type = typeof value, 9292 isValidValue = type === "string" || Array.isArray( value ); 9293 9294 if ( typeof stateVal === "boolean" && isValidValue ) { 9295 return stateVal ? this.addClass( value ) : this.removeClass( value ); 9296 } 9297 9298 if ( isFunction( value ) ) { 9299 return this.each( function( i ) { 9300 jQuery( this ).toggleClass( 9301 value.call( this, i, getClass( this ), stateVal ), 9302 stateVal 9303 ); 9304 } ); 9305 } 9306 9307 return this.each( function() { 9308 var className, i, self, classNames; 9309 9310 if ( isValidValue ) { 9311 9312 // Toggle individual class names 9313 i = 0; 9314 self = jQuery( this ); 9315 classNames = classesToArray( value ); 9316 9317 while ( ( className = classNames[ i++ ] ) ) { 9318 9319 // Check each className given, space separated list 9320 if ( self.hasClass( className ) ) { 9321 self.removeClass( className ); 9322 } else { 9323 self.addClass( className ); 9324 } 9325 } 9326 9327 // Toggle whole class name 9328 } else if ( value === undefined || type === "boolean" ) { 9329 className = getClass( this ); 9330 if ( className ) { 9331 9332 // Store className if set 9333 dataPriv.set( this, "__className__", className ); 9334 } 9335 9336 // If the element has a class name or if we're passed `false`, 9337 // then remove the whole classname (if there was one, the above saved it). 9338 // Otherwise bring back whatever was previously saved (if anything), 9339 // falling back to the empty string if nothing was stored. 9340 if ( this.setAttribute ) { 9341 this.setAttribute( "class", 9342 className || value === false ? 9343 "" : 9344 dataPriv.get( this, "__className__" ) || "" 9345 ); 9346 } 9347 } 9348 } ); 9349 }, 9350 9351 hasClass: function( selector ) { 9352 var className, elem, 9353 i = 0; 9354 9355 className = " " + selector + " "; 9356 while ( ( elem = this[ i++ ] ) ) { 9357 if ( elem.nodeType === 1 && 9358 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 9359 return true; 9360 } 9361 } 9362 9363 return false; 9364 } 9365} ); 9366 9367 9368 9369 9370var rreturn = /\r/g; 9371 9372jQuery.fn.extend( { 9373 val: function( value ) { 9374 var hooks, ret, valueIsFunction, 9375 elem = this[ 0 ]; 9376 9377 if ( !arguments.length ) { 9378 if ( elem ) { 9379 hooks = jQuery.valHooks[ elem.type ] || 9380 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 9381 9382 if ( hooks && 9383 "get" in hooks && 9384 ( ret = hooks.get( elem, "value" ) ) !== undefined 9385 ) { 9386 return ret; 9387 } 9388 9389 ret = elem.value; 9390 9391 // Handle most common string cases 9392 if ( typeof ret === "string" ) { 9393 return ret.replace( rreturn, "" ); 9394 } 9395 9396 // Handle cases where value is null/undef or number 9397 return ret == null ? "" : ret; 9398 } 9399 9400 return; 9401 } 9402 9403 valueIsFunction = isFunction( value ); 9404 9405 return this.each( function( i ) { 9406 var val; 9407 9408 if ( this.nodeType !== 1 ) { 9409 return; 9410 } 9411 9412 if ( valueIsFunction ) { 9413 val = value.call( this, i, jQuery( this ).val() ); 9414 } else { 9415 val = value; 9416 } 9417 9418 // Treat null/undefined as ""; convert numbers to string 9419 if ( val == null ) { 9420 val = ""; 9421 9422 } else if ( typeof val === "number" ) { 9423 val += ""; 9424 9425 } else if ( Array.isArray( val ) ) { 9426 val = jQuery.map( val, function( value ) { 9427 return value == null ? "" : value + ""; 9428 } ); 9429 } 9430 9431 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 9432 9433 // If set returns undefined, fall back to normal setting 9434 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 9435 this.value = val; 9436 } 9437 } ); 9438 } 9439} ); 9440 9441jQuery.extend( { 9442 valHooks: { 9443 option: { 9444 get: function( elem ) { 9445 9446 var val = jQuery.find.attr( elem, "value" ); 9447 return val != null ? 9448 val : 9449 9450 // Support: IE <=10 - 11 only 9451 // option.text throws exceptions (#14686, #14858) 9452 // Strip and collapse whitespace 9453 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 9454 stripAndCollapse( jQuery.text( elem ) ); 9455 } 9456 }, 9457 select: { 9458 get: function( elem ) { 9459 var value, option, i, 9460 options = elem.options, 9461 index = elem.selectedIndex, 9462 one = elem.type === "select-one", 9463 values = one ? null : [], 9464 max = one ? index + 1 : options.length; 9465 9466 if ( index < 0 ) { 9467 i = max; 9468 9469 } else { 9470 i = one ? index : 0; 9471 } 9472 9473 // Loop through all the selected options 9474 for ( ; i < max; i++ ) { 9475 option = options[ i ]; 9476 9477 // Support: IE <=9 only 9478 // IE8-9 doesn't update selected after form reset (#2551) 9479 if ( ( option.selected || i === index ) && 9480 9481 // Don't return options that are disabled or in a disabled optgroup 9482 !option.disabled && 9483 ( !option.parentNode.disabled || 9484 !nodeName( option.parentNode, "optgroup" ) ) ) { 9485 9486 // Get the specific value for the option 9487 value = jQuery( option ).val(); 9488 9489 // We don't need an array for one selects 9490 if ( one ) { 9491 return value; 9492 } 9493 9494 // Multi-Selects return an array 9495 values.push( value ); 9496 } 9497 } 9498 9499 return values; 9500 }, 9501 9502 set: function( elem, value ) { 9503 var optionSet, option, 9504 options = elem.options, 9505 values = jQuery.makeArray( value ), 9506 i = options.length; 9507 9508 while ( i-- ) { 9509 option = options[ i ]; 9510 9511 /* eslint-disable no-cond-assign */ 9512 9513 if ( option.selected = 9514 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 9515 ) { 9516 optionSet = true; 9517 } 9518 9519 /* eslint-enable no-cond-assign */ 9520 } 9521 9522 // Force browsers to behave consistently when non-matching value is set 9523 if ( !optionSet ) { 9524 elem.selectedIndex = -1; 9525 } 9526 return values; 9527 } 9528 } 9529 } 9530} ); 9531 9532// Radios and checkboxes getter/setter 9533jQuery.each( [ "radio", "checkbox" ], function() { 9534 jQuery.valHooks[ this ] = { 9535 set: function( elem, value ) { 9536 if ( Array.isArray( value ) ) { 9537 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 9538 } 9539 } 9540 }; 9541 if ( !support.checkOn ) { 9542 jQuery.valHooks[ this ].get = function( elem ) { 9543 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 9544 }; 9545 } 9546} ); 9547 9548 9549 9550 9551// Return jQuery for attributes-only inclusion 9552 9553 9554support.focusin = "onfocusin" in window; 9555 9556 9557var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 9558 stopPropagationCallback = function( e ) { 9559 e.stopPropagation(); 9560 }; 9561 9562jQuery.extend( jQuery.event, { 9563 9564 trigger: function( event, data, elem, onlyHandlers ) { 9565 9566 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 9567 eventPath = [ elem || document ], 9568 type = hasOwn.call( event, "type" ) ? event.type : event, 9569 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 9570 9571 cur = lastElement = tmp = elem = elem || document; 9572 9573 // Don't do events on text and comment nodes 9574 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 9575 return; 9576 } 9577 9578 // focus/blur morphs to focusin/out; ensure we're not firing them right now 9579 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 9580 return; 9581 } 9582 9583 if ( type.indexOf( "." ) > -1 ) { 9584 9585 // Namespaced trigger; create a regexp to match event type in handle() 9586 namespaces = type.split( "." ); 9587 type = namespaces.shift(); 9588 namespaces.sort(); 9589 }
vendor: 4,380 bytes, lines 9590-9745
9590 ontype = type.indexOf( ":" ) < 0 && "on" + type; 9591 9592 // Caller can pass in a jQuery.Event object, Object, or just an event type string 9593 event = event[ jQuery.expando ] ? 9594 event : 9595 new jQuery.Event( type, typeof event === "object" && event ); 9596 9597 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 9598 event.isTrigger = onlyHandlers ? 2 : 3; 9599 event.namespace = namespaces.join( "." ); 9600 event.rnamespace = event.namespace ? 9601 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 9602 null; 9603 9604 // Clean up the event in case it is being reused 9605 event.result = undefined; 9606 if ( !event.target ) { 9607 event.target = elem; 9608 } 9609 9610 // Clone any incoming data and prepend the event, creating the handler arg list 9611 data = data == null ? 9612 [ event ] : 9613 jQuery.makeArray( data, [ event ] ); 9614 9615 // Allow special events to draw outside the lines 9616 special = jQuery.event.special[ type ] || {}; 9617 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 9618 return; 9619 } 9620 9621 // Determine event propagation path in advance, per W3C events spec (#9951) 9622 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 9623 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 9624 9625 bubbleType = special.delegateType || type; 9626 if ( !rfocusMorph.test( bubbleType + type ) ) { 9627 cur = cur.parentNode; 9628 } 9629 for ( ; cur; cur = cur.parentNode ) { 9630 eventPath.push( cur ); 9631 tmp = cur; 9632 } 9633 9634 // Only add window if we got to document (e.g., not plain obj or detached DOM) 9635 if ( tmp === ( elem.ownerDocument || document ) ) { 9636 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 9637 } 9638 } 9639 9640 // Fire handlers on the event path 9641 i = 0; 9642 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 9643 lastElement = cur; 9644 event.type = i > 1 ? 9645 bubbleType : 9646 special.bindType || type; 9647 9648 // jQuery handler 9649 handle = ( 9650 dataPriv.get( cur, "events" ) || Object.create( null ) 9651 )[ event.type ] && 9652 dataPriv.get( cur, "handle" ); 9653 if ( handle ) { 9654 handle.apply( cur, data ); 9655 } 9656 9657 // Native handler 9658 handle = ontype && cur[ ontype ]; 9659 if ( handle && handle.apply && acceptData( cur ) ) { 9660 event.result = handle.apply( cur, data ); 9661 if ( event.result === false ) { 9662 event.preventDefault(); 9663 } 9664 } 9665 } 9666 event.type = type; 9667 9668 // If nobody prevented the default action, do it now 9669 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 9670 9671 if ( ( !special._default || 9672 special._default.apply( eventPath.pop(), data ) === false ) && 9673 acceptData( elem ) ) { 9674 9675 // Call a native DOM method on the target with the same name as the event. 9676 // Don't do default actions on window, that's where global variables be (#6170) 9677 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 9678 9679 // Don't re-trigger an onFOO event when we call its FOO() method 9680 tmp = elem[ ontype ]; 9681 9682 if ( tmp ) { 9683 elem[ ontype ] = null; 9684 } 9685 9686 // Prevent re-triggering of the same event, since we already bubbled it above 9687 jQuery.event.triggered = type; 9688 9689 if ( event.isPropagationStopped() ) { 9690 lastElement.addEventListener( type, stopPropagationCallback ); 9691 } 9692 9693 elem[ type ](); 9694 9695 if ( event.isPropagationStopped() ) { 9696 lastElement.removeEventListener( type, stopPropagationCallback ); 9697 } 9698 9699 jQuery.event.triggered = undefined; 9700 9701 if ( tmp ) { 9702 elem[ ontype ] = tmp; 9703 } 9704 } 9705 } 9706 } 9707 9708 return event.result; 9709 }, 9710 9711 // Piggyback on a donor event to simulate a different one 9712 // Used only for `focus(in | out)` events 9713 simulate: function( type, elem, event ) { 9714 var e = jQuery.extend( 9715 new jQuery.Event(), 9716 event, 9717 { 9718 type: type, 9719 isSimulated: true 9720 } 9721 ); 9722 9723 jQuery.event.trigger( e, null, elem ); 9724 } 9725 9726} ); 9727 9728jQuery.fn.extend( { 9729 9730 trigger: function( type, data ) { 9731 return this.each( function() { 9732 jQuery.event.trigger( type, data, this ); 9733 } ); 9734 }, 9735 triggerHandler: function( type, data ) { 9736 var elem = this[ 0 ]; 9737 if ( elem ) { 9738 return jQuery.event.trigger( type, data, elem, true ); 9739 } 9740 } 9741} ); 9742 9743 9744// Support: Firefox <=44 9745// Firefox doesn't have focus(in | out) events
vendor: 4,531 bytes, lines 9746-9916
9746// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 9747// 9748// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 9749// focus(in | out) events fire after focus & blur events, 9750// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 9751// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 9752if ( !support.focusin ) { 9753 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 9754 9755 // Attach a single capturing handler on the document while someone wants focusin/focusout 9756 var handler = function( event ) { 9757 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 9758 }; 9759 9760 jQuery.event.special[ fix ] = { 9761 setup: function() { 9762 9763 // Handle: regular nodes (via `this.ownerDocument`), window 9764 // (via `this.document`) & document (via `this`). 9765 var doc = this.ownerDocument || this.document || this, 9766 attaches = dataPriv.access( doc, fix ); 9767 9768 if ( !attaches ) { 9769 doc.addEventListener( orig, handler, true ); 9770 } 9771 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 9772 }, 9773 teardown: function() { 9774 var doc = this.ownerDocument || this.document || this, 9775 attaches = dataPriv.access( doc, fix ) - 1; 9776 9777 if ( !attaches ) { 9778 doc.removeEventListener( orig, handler, true ); 9779 dataPriv.remove( doc, fix ); 9780 9781 } else { 9782 dataPriv.access( doc, fix, attaches ); 9783 } 9784 } 9785 }; 9786 } ); 9787} 9788var location = window.location; 9789 9790var nonce = { guid: Date.now() }; 9791 9792var rquery = ( /\?/ ); 9793 9794 9795 9796// Cross-browser xml parsing 9797jQuery.parseXML = function( data ) { 9798 var xml; 9799 if ( !data || typeof data !== "string" ) { 9800 return null; 9801 } 9802 9803 // Support: IE 9 - 11 only 9804 // IE throws on parseFromString with invalid input. 9805 try { 9806 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 9807 } catch ( e ) { 9808 xml = undefined; 9809 } 9810 9811 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 9812 jQuery.error( "Invalid XML: " + data ); 9813 } 9814 return xml; 9815}; 9816 9817 9818var 9819 rbracket = /\[\]$/, 9820 rCRLF = /\r?\n/g, 9821 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 9822 rsubmittable = /^(?:input|select|textarea|keygen)/i; 9823 9824function buildParams( prefix, obj, traditional, add ) { 9825 var name; 9826 9827 if ( Array.isArray( obj ) ) { 9828 9829 // Serialize array item. 9830 jQuery.each( obj, function( i, v ) { 9831 if ( traditional || rbracket.test( prefix ) ) { 9832 9833 // Treat each array item as a scalar. 9834 add( prefix, v ); 9835 9836 } else { 9837 9838 // Item is non-scalar (array or object), encode its numeric index. 9839 buildParams( 9840 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 9841 v, 9842 traditional, 9843 add 9844 ); 9845 } 9846 } ); 9847 9848 } else if ( !traditional && toType( obj ) === "object" ) { 9849 9850 // Serialize object item. 9851 for ( name in obj ) { 9852 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 9853 } 9854 9855 } else { 9856 9857 // Serialize scalar item. 9858 add( prefix, obj ); 9859 } 9860} 9861 9862// Serialize an array of form elements or a set of 9863// key/values into a query string 9864jQuery.param = function( a, traditional ) { 9865 var prefix, 9866 s = [], 9867 add = function( key, valueOrFunction ) { 9868 9869 // If value is a function, invoke it and use its return value 9870 var value = isFunction( valueOrFunction ) ? 9871 valueOrFunction() : 9872 valueOrFunction; 9873 9874 s[ s.length ] = encodeURIComponent( key ) + "=" + 9875 encodeURIComponent( value == null ? "" : value ); 9876 }; 9877 9878 if ( a == null ) { 9879 return ""; 9880 } 9881 9882 // If an array was passed in, assume that it is an array of form elements. 9883 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 9884 9885 // Serialize the form elements 9886 jQuery.each( a, function() { 9887 add( this.name, this.value ); 9888 } ); 9889 9890 } else { 9891 9892 // If traditional, encode the "old" way (the way 1.3.2 or older 9893 // did it), otherwise encode params recursively. 9894 for ( prefix in a ) { 9895 buildParams( prefix, a[ prefix ], traditional, add ); 9896 } 9897 } 9898 9899 // Return the resulting serialization 9900 return s.join( "&" ); 9901}; 9902 9903jQuery.fn.extend( { 9904 serialize: function() { 9905 return jQuery.param( this.serializeArray() ); 9906 }, 9907 serializeArray: function() { 9908 return this.map( function() { 9909 9910 // Can add propHook for "elements" to filter or add form elements 9911 var elements = jQuery.prop( this, "elements" ); 9912 return elements ? jQuery.makeArray( elements ) : this; 9913 } ) 9914 .filter( function() { 9915 var type = this.type; 9916
vendor: 5,106 bytes, lines 9917-10089
9917 // Use .is( ":disabled" ) so that fieldset[disabled] works 9918 return this.name && !jQuery( this ).is( ":disabled" ) && 9919 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 9920 ( this.checked || !rcheckableType.test( type ) ); 9921 } ) 9922 .map( function( _i, elem ) { 9923 var val = jQuery( this ).val(); 9924 9925 if ( val == null ) { 9926 return null; 9927 } 9928 9929 if ( Array.isArray( val ) ) { 9930 return jQuery.map( val, function( val ) { 9931 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9932 } ); 9933 } 9934 9935 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9936 } ).get(); 9937 } 9938} ); 9939 9940 9941var 9942 r20 = /%20/g, 9943 rhash = /#.*$/, 9944 rantiCache = /([?&])_=[^&]*/, 9945 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 9946 9947 // #7653, #8125, #8152: local protocol detection 9948 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 9949 rnoContent = /^(?:GET|HEAD)$/, 9950 rprotocol = /^\/\//, 9951 9952 /* Prefilters 9953 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 9954 * 2) These are called: 9955 * - BEFORE asking for a transport 9956 * - AFTER param serialization (s.data is a string if s.processData is true) 9957 * 3) key is the dataType 9958 * 4) the catchall symbol "*" can be used 9959 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 9960 */ 9961 prefilters = {}, 9962 9963 /* Transports bindings 9964 * 1) key is the dataType 9965 * 2) the catchall symbol "*" can be used 9966 * 3) selection will start with transport dataType and THEN go to "*" if needed 9967 */ 9968 transports = {}, 9969 9970 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 9971 allTypes = "*/".concat( "*" ), 9972 9973 // Anchor tag for parsing the document origin 9974 originAnchor = document.createElement( "a" ); 9975 originAnchor.href = location.href; 9976 9977// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 9978function addToPrefiltersOrTransports( structure ) { 9979 9980 // dataTypeExpression is optional and defaults to "*" 9981 return function( dataTypeExpression, func ) { 9982 9983 if ( typeof dataTypeExpression !== "string" ) { 9984 func = dataTypeExpression; 9985 dataTypeExpression = "*"; 9986 } 9987 9988 var dataType, 9989 i = 0, 9990 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 9991 9992 if ( isFunction( func ) ) { 9993 9994 // For each dataType in the dataTypeExpression 9995 while ( ( dataType = dataTypes[ i++ ] ) ) { 9996 9997 // Prepend if requested 9998 if ( dataType[ 0 ] === "+" ) { 9999 dataType = dataType.slice( 1 ) || "*"; 10000 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 10001 10002 // Otherwise append 10003 } else { 10004 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 10005 } 10006 } 10007 } 10008 }; 10009} 10010 10011// Base inspection function for prefilters and transports 10012function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 10013 10014 var inspected = {}, 10015 seekingTransport = ( structure === transports ); 10016 10017 function inspect( dataType ) { 10018 var selected; 10019 inspected[ dataType ] = true; 10020 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 10021 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 10022 if ( typeof dataTypeOrTransport === "string" && 10023 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 10024 10025 options.dataTypes.unshift( dataTypeOrTransport ); 10026 inspect( dataTypeOrTransport ); 10027 return false; 10028 } else if ( seekingTransport ) { 10029 return !( selected = dataTypeOrTransport ); 10030 } 10031 } ); 10032 return selected; 10033 } 10034 10035 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 10036} 10037 10038// A special extend for ajax options 10039// that takes "flat" options (not to be deep extended) 10040// Fixes #9887 10041function ajaxExtend( target, src ) { 10042 var key, deep, 10043 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 10044 10045 for ( key in src ) { 10046 if ( src[ key ] !== undefined ) { 10047 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 10048 } 10049 } 10050 if ( deep ) { 10051 jQuery.extend( true, target, deep ); 10052 } 10053 10054 return target; 10055} 10056 10057/* Handles responses to an ajax request: 10058 * - finds the right dataType (mediates between content-type and expected dataType) 10059 * - returns the corresponding response 10060 */ 10061function ajaxHandleResponses( s, jqXHR, responses ) { 10062 10063 var ct, type, finalDataType, firstDataType, 10064 contents = s.contents, 10065 dataTypes = s.dataTypes; 10066 10067 // Remove auto dataType and get content-type in the process 10068 while ( dataTypes[ 0 ] === "*" ) { 10069 dataTypes.shift(); 10070 if ( ct === undefined ) { 10071 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 10072 } 10073 } 10074 10075 // Check if we're dealing with a known content-type 10076 if ( ct ) { 10077 for ( type in contents ) { 10078 if ( contents[ type ] && contents[ type ].test( ct ) ) { 10079 dataTypes.unshift( type ); 10080 break; 10081 } 10082 } 10083 } 10084 10085 // Check to see if we have a response for the expected dataType 10086 if ( dataTypes[ 0 ] in responses ) { 10087 finalDataType = dataTypes[ 0 ]; 10088 } else { 10089
vendor: 9,521 bytes, lines 10090-10465
10090 // Try convertible dataTypes 10091 for ( type in responses ) { 10092 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 10093 finalDataType = type; 10094 break; 10095 } 10096 if ( !firstDataType ) { 10097 firstDataType = type; 10098 } 10099 } 10100 10101 // Or just use first one 10102 finalDataType = finalDataType || firstDataType; 10103 } 10104 10105 // If we found a dataType 10106 // We add the dataType to the list if needed 10107 // and return the corresponding response 10108 if ( finalDataType ) { 10109 if ( finalDataType !== dataTypes[ 0 ] ) { 10110 dataTypes.unshift( finalDataType ); 10111 } 10112 return responses[ finalDataType ]; 10113 } 10114} 10115 10116/* Chain conversions given the request and the original response 10117 * Also sets the responseXXX fields on the jqXHR instance 10118 */ 10119function ajaxConvert( s, response, jqXHR, isSuccess ) { 10120 var conv2, current, conv, tmp, prev, 10121 converters = {}, 10122 10123 // Work with a copy of dataTypes in case we need to modify it for conversion 10124 dataTypes = s.dataTypes.slice(); 10125 10126 // Create converters map with lowercased keys 10127 if ( dataTypes[ 1 ] ) { 10128 for ( conv in s.converters ) { 10129 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 10130 } 10131 } 10132 10133 current = dataTypes.shift(); 10134 10135 // Convert to each sequential dataType 10136 while ( current ) { 10137 10138 if ( s.responseFields[ current ] ) { 10139 jqXHR[ s.responseFields[ current ] ] = response; 10140 } 10141 10142 // Apply the dataFilter if provided 10143 if ( !prev && isSuccess && s.dataFilter ) { 10144 response = s.dataFilter( response, s.dataType ); 10145 } 10146 10147 prev = current; 10148 current = dataTypes.shift(); 10149 10150 if ( current ) { 10151 10152 // There's only work to do if current dataType is non-auto 10153 if ( current === "*" ) { 10154 10155 current = prev; 10156 10157 // Convert response if prev dataType is non-auto and differs from current 10158 } else if ( prev !== "*" && prev !== current ) { 10159 10160 // Seek a direct converter 10161 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 10162 10163 // If none found, seek a pair 10164 if ( !conv ) { 10165 for ( conv2 in converters ) { 10166 10167 // If conv2 outputs current 10168 tmp = conv2.split( " " ); 10169 if ( tmp[ 1 ] === current ) { 10170 10171 // If prev can be converted to accepted input 10172 conv = converters[ prev + " " + tmp[ 0 ] ] || 10173 converters[ "* " + tmp[ 0 ] ]; 10174 if ( conv ) { 10175 10176 // Condense equivalence converters 10177 if ( conv === true ) { 10178 conv = converters[ conv2 ]; 10179 10180 // Otherwise, insert the intermediate dataType 10181 } else if ( converters[ conv2 ] !== true ) { 10182 current = tmp[ 0 ]; 10183 dataTypes.unshift( tmp[ 1 ] ); 10184 } 10185 break; 10186 } 10187 } 10188 } 10189 } 10190 10191 // Apply converter (if not an equivalence) 10192 if ( conv !== true ) { 10193 10194 // Unless errors are allowed to bubble, catch and return them 10195 if ( conv && s.throws ) { 10196 response = conv( response ); 10197 } else { 10198 try { 10199 response = conv( response ); 10200 } catch ( e ) { 10201 return { 10202 state: "parsererror", 10203 error: conv ? e : "No conversion from " + prev + " to " + current 10204 }; 10205 } 10206 } 10207 } 10208 } 10209 } 10210 } 10211 10212 return { state: "success", data: response }; 10213} 10214 10215jQuery.extend( { 10216 10217 // Counter for holding the number of active queries 10218 active: 0, 10219 10220 // Last-Modified header cache for next request 10221 lastModified: {}, 10222 etag: {}, 10223 10224 ajaxSettings: { 10225 url: location.href, 10226 type: "GET", 10227 isLocal: rlocalProtocol.test( location.protocol ), 10228 global: true, 10229 processData: true, 10230 async: true, 10231 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 10232 10233 /* 10234 timeout: 0, 10235 data: null, 10236 dataType: null, 10237 username: null, 10238 password: null, 10239 cache: null, 10240 throws: false, 10241 traditional: false, 10242 headers: {}, 10243 */ 10244 10245 accepts: { 10246 "*": allTypes, 10247 text: "text/plain", 10248 html: "text/html", 10249 xml: "application/xml, text/xml", 10250 json: "application/json, text/javascript" 10251 }, 10252 10253 contents: { 10254 xml: /\bxml\b/, 10255 html: /\bhtml/, 10256 json: /\bjson\b/ 10257 }, 10258 10259 responseFields: { 10260 xml: "responseXML", 10261 text: "responseText", 10262 json: "responseJSON" 10263 }, 10264 10265 // Data converters 10266 // Keys separate source (or catchall "*") and destination types with a single space 10267 converters: { 10268 10269 // Convert anything to text 10270 "* text": String, 10271 10272 // Text to html (true = no transformation) 10273 "text html": true, 10274 10275 // Evaluate text as a json expression 10276 "text json": JSON.parse, 10277 10278 // Parse text as xml 10279 "text xml": jQuery.parseXML 10280 }, 10281 10282 // For options that shouldn't be deep extended: 10283 // you can add your own custom options here if 10284 // and when you create one that shouldn't be 10285 // deep extended (see ajaxExtend) 10286 flatOptions: { 10287 url: true, 10288 context: true 10289 } 10290 }, 10291 10292 // Creates a full fledged settings object into target 10293 // with both ajaxSettings and settings fields. 10294 // If target is omitted, writes into ajaxSettings. 10295 ajaxSetup: function( target, settings ) { 10296 return settings ? 10297 10298 // Building a settings object 10299 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 10300 10301 // Extending ajaxSettings 10302 ajaxExtend( jQuery.ajaxSettings, target ); 10303 }, 10304 10305 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 10306 ajaxTransport: addToPrefiltersOrTransports( transports ), 10307 10308 // Main method 10309 ajax: function( url, options ) { 10310 10311 // If url is an object, simulate pre-1.5 signature 10312 if ( typeof url === "object" ) { 10313 options = url; 10314 url = undefined; 10315 } 10316 10317 // Force options to be an object 10318 options = options || {}; 10319 10320 var transport, 10321 10322 // URL without anti-cache param 10323 cacheURL, 10324 10325 // Response headers 10326 responseHeadersString, 10327 responseHeaders, 10328 10329 // timeout handle 10330 timeoutTimer, 10331 10332 // Url cleanup var 10333 urlAnchor, 10334 10335 // Request state (becomes false upon send and true upon completion) 10336 completed, 10337 10338 // To know if global events are to be dispatched 10339 fireGlobals, 10340 10341 // Loop variable 10342 i, 10343 10344 // uncached part of the url 10345 uncached, 10346 10347 // Create the final options object 10348 s = jQuery.ajaxSetup( {}, options ), 10349 10350 // Callbacks context 10351 callbackContext = s.context || s, 10352 10353 // Context for global events is callbackContext if it is a DOM node or jQuery collection 10354 globalEventContext = s.context && 10355 ( callbackContext.nodeType || callbackContext.jquery ) ? 10356 jQuery( callbackContext ) : 10357 jQuery.event, 10358 10359 // Deferreds 10360 deferred = jQuery.Deferred(), 10361 completeDeferred = jQuery.Callbacks( "once memory" ), 10362 10363 // Status-dependent callbacks 10364 statusCode = s.statusCode || {}, 10365 10366 // Headers (they are sent all at once) 10367 requestHeaders = {}, 10368 requestHeadersNames = {}, 10369 10370 // Default abort message 10371 strAbort = "canceled", 10372 10373 // Fake xhr 10374 jqXHR = { 10375 readyState: 0, 10376 10377 // Builds headers hashtable if needed 10378 getResponseHeader: function( key ) { 10379 var match; 10380 if ( completed ) { 10381 if ( !responseHeaders ) { 10382 responseHeaders = {}; 10383 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 10384 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 10385 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 10386 .concat( match[ 2 ] ); 10387 } 10388 } 10389 match = responseHeaders[ key.toLowerCase() + " " ]; 10390 } 10391 return match == null ? null : match.join( ", " ); 10392 }, 10393 10394 // Raw string 10395 getAllResponseHeaders: function() { 10396 return completed ? responseHeadersString : null; 10397 }, 10398 10399 // Caches the header 10400 setRequestHeader: function( name, value ) { 10401 if ( completed == null ) { 10402 name = requestHeadersNames[ name.toLowerCase() ] = 10403 requestHeadersNames[ name.toLowerCase() ] || name; 10404 requestHeaders[ name ] = value; 10405 } 10406 return this; 10407 }, 10408 10409 // Overrides response content-type header 10410 overrideMimeType: function( type ) { 10411 if ( completed == null ) { 10412 s.mimeType = type; 10413 } 10414 return this; 10415 }, 10416 10417 // Status-dependent callbacks 10418 statusCode: function( map ) { 10419 var code; 10420 if ( map ) { 10421 if ( completed ) { 10422 10423 // Execute the appropriate callbacks 10424 jqXHR.always( map[ jqXHR.status ] ); 10425 } else { 10426 10427 // Lazy-add the new callbacks in a way that preserves old ones 10428 for ( code in map ) { 10429 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 10430 } 10431 } 10432 } 10433 return this; 10434 }, 10435 10436 // Cancel the request 10437 abort: function( statusText ) { 10438 var finalText = statusText || strAbort; 10439 if ( transport ) { 10440 transport.abort( finalText ); 10441 } 10442 done( 0, finalText ); 10443 return this; 10444 } 10445 }; 10446 10447 // Attach deferreds 10448 deferred.promise( jqXHR ); 10449 10450 // Add protocol if not provided (prefilters might expect it) 10451 // Handle falsy url in the settings object (#10093: consistency with old signature) 10452 // We also use the url parameter if available 10453 s.url = ( ( url || s.url || location.href ) + "" ) 10454 .replace( rprotocol, location.protocol + "//" ); 10455 10456 // Alias method option to type as per ticket #12004 10457 s.type = options.method || options.type || s.method || s.type; 10458 10459 // Extract dataTypes list 10460 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 10461 10462 // A cross-domain request is in order when the origin doesn't match the current origin. 10463 if ( s.crossDomain == null ) { 10464 urlAnchor = document.createElement( "a" ); 10465
vendor: 22,038 bytes, lines 10466-11278
10466 // Support: IE <=8 - 11, Edge 12 - 15 10467 // IE throws exception on accessing the href property if url is malformed, 10468 // e.g. http://example.com:80x/ 10469 try { 10470 urlAnchor.href = s.url; 10471 10472 // Support: IE <=8 - 11 only 10473 // Anchor's host property isn't correctly set when s.url is relative 10474 urlAnchor.href = urlAnchor.href; 10475 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 10476 urlAnchor.protocol + "//" + urlAnchor.host; 10477 } catch ( e ) { 10478 10479 // If there is an error parsing the URL, assume it is crossDomain, 10480 // it can be rejected by the transport if it is invalid 10481 s.crossDomain = true; 10482 } 10483 } 10484 10485 // Convert data if not already a string 10486 if ( s.data && s.processData && typeof s.data !== "string" ) { 10487 s.data = jQuery.param( s.data, s.traditional ); 10488 } 10489 10490 // Apply prefilters 10491 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 10492 10493 // If request was aborted inside a prefilter, stop there 10494 if ( completed ) { 10495 return jqXHR; 10496 } 10497 10498 // We can fire global events as of now if asked to 10499 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 10500 fireGlobals = jQuery.event && s.global; 10501 10502 // Watch for a new set of requests 10503 if ( fireGlobals && jQuery.active++ === 0 ) { 10504 jQuery.event.trigger( "ajaxStart" ); 10505 } 10506 10507 // Uppercase the type 10508 s.type = s.type.toUpperCase(); 10509 10510 // Determine if request has content 10511 s.hasContent = !rnoContent.test( s.type ); 10512 10513 // Save the URL in case we're toying with the If-Modified-Since 10514 // and/or If-None-Match header later on 10515 // Remove hash to simplify url manipulation 10516 cacheURL = s.url.replace( rhash, "" ); 10517 10518 // More options handling for requests with no content 10519 if ( !s.hasContent ) { 10520 10521 // Remember the hash so we can put it back 10522 uncached = s.url.slice( cacheURL.length ); 10523 10524 // If data is available and should be processed, append data to url 10525 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 10526 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 10527 10528 // #9682: remove data so that it's not used in an eventual retry 10529 delete s.data; 10530 } 10531 10532 // Add or update anti-cache param if needed 10533 if ( s.cache === false ) { 10534 cacheURL = cacheURL.replace( rantiCache, "$1" ); 10535 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 10536 uncached; 10537 } 10538 10539 // Put hash and anti-cache on the URL that will be requested (gh-1732) 10540 s.url = cacheURL + uncached; 10541 10542 // Change '%20' to '+' if this is encoded form body content (gh-2658) 10543 } else if ( s.data && s.processData && 10544 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 10545 s.data = s.data.replace( r20, "+" ); 10546 } 10547 10548 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 10549 if ( s.ifModified ) { 10550 if ( jQuery.lastModified[ cacheURL ] ) { 10551 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 10552 } 10553 if ( jQuery.etag[ cacheURL ] ) { 10554 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 10555 } 10556 } 10557 10558 // Set the correct header, if data is being sent 10559 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 10560 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 10561 } 10562 10563 // Set the Accepts header for the server, depending on the dataType 10564 jqXHR.setRequestHeader( 10565 "Accept", 10566 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 10567 s.accepts[ s.dataTypes[ 0 ] ] + 10568 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 10569 s.accepts[ "*" ] 10570 ); 10571 10572 // Check for headers option 10573 for ( i in s.headers ) { 10574 jqXHR.setRequestHeader( i, s.headers[ i ] ); 10575 } 10576 10577 // Allow custom headers/mimetypes and early abort 10578 if ( s.beforeSend && 10579 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 10580 10581 // Abort if not done already and return 10582 return jqXHR.abort(); 10583 } 10584 10585 // Aborting is no longer a cancellation 10586 strAbort = "abort"; 10587 10588 // Install callbacks on deferreds 10589 completeDeferred.add( s.complete ); 10590 jqXHR.done( s.success ); 10591 jqXHR.fail( s.error ); 10592 10593 // Get transport 10594 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 10595 10596 // If no transport, we auto-abort 10597 if ( !transport ) { 10598 done( -1, "No Transport" ); 10599 } else { 10600 jqXHR.readyState = 1; 10601 10602 // Send global event 10603 if ( fireGlobals ) { 10604 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 10605 } 10606 10607 // If request was aborted inside ajaxSend, stop there 10608 if ( completed ) { 10609 return jqXHR; 10610 } 10611 10612 // Timeout 10613 if ( s.async && s.timeout > 0 ) { 10614 timeoutTimer = window.setTimeout( function() { 10615 jqXHR.abort( "timeout" ); 10616 }, s.timeout ); 10617 } 10618 10619 try { 10620 completed = false; 10621 transport.send( requestHeaders, done ); 10622 } catch ( e ) { 10623 10624 // Rethrow post-completion exceptions 10625 if ( completed ) { 10626 throw e; 10627 } 10628 10629 // Propagate others as results 10630 done( -1, e ); 10631 } 10632 } 10633 10634 // Callback for when everything is done 10635 function done( status, nativeStatusText, responses, headers ) { 10636 var isSuccess, success, error, response, modified, 10637 statusText = nativeStatusText; 10638 10639 // Ignore repeat invocations 10640 if ( completed ) { 10641 return; 10642 } 10643 10644 completed = true; 10645 10646 // Clear timeout if it exists 10647 if ( timeoutTimer ) { 10648 window.clearTimeout( timeoutTimer ); 10649 } 10650 10651 // Dereference transport for early garbage collection 10652 // (no matter how long the jqXHR object will be used) 10653 transport = undefined; 10654 10655 // Cache response headers 10656 responseHeadersString = headers || ""; 10657 10658 // Set readyState 10659 jqXHR.readyState = status > 0 ? 4 : 0; 10660 10661 // Determine if successful 10662 isSuccess = status >= 200 && status < 300 || status === 304; 10663 10664 // Get response data 10665 if ( responses ) { 10666 response = ajaxHandleResponses( s, jqXHR, responses ); 10667 } 10668 10669 // Use a noop converter for missing script 10670 if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { 10671 s.converters[ "text script" ] = function() {}; 10672 } 10673 10674 // Convert no matter what (that way responseXXX fields are always set) 10675 response = ajaxConvert( s, response, jqXHR, isSuccess ); 10676 10677 // If successful, handle type chaining 10678 if ( isSuccess ) { 10679 10680 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 10681 if ( s.ifModified ) { 10682 modified = jqXHR.getResponseHeader( "Last-Modified" ); 10683 if ( modified ) { 10684 jQuery.lastModified[ cacheURL ] = modified; 10685 } 10686 modified = jqXHR.getResponseHeader( "etag" ); 10687 if ( modified ) { 10688 jQuery.etag[ cacheURL ] = modified; 10689 } 10690 } 10691 10692 // if no content 10693 if ( status === 204 || s.type === "HEAD" ) { 10694 statusText = "nocontent"; 10695 10696 // if not modified 10697 } else if ( status === 304 ) { 10698 statusText = "notmodified"; 10699 10700 // If we have data, let's convert it 10701 } else { 10702 statusText = response.state; 10703 success = response.data; 10704 error = response.error; 10705 isSuccess = !error; 10706 } 10707 } else { 10708 10709 // Extract error from statusText and normalize for non-aborts 10710 error = statusText; 10711 if ( status || !statusText ) { 10712 statusText = "error"; 10713 if ( status < 0 ) { 10714 status = 0; 10715 } 10716 } 10717 } 10718 10719 // Set data for the fake xhr object 10720 jqXHR.status = status; 10721 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 10722 10723 // Success/Error 10724 if ( isSuccess ) { 10725 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 10726 } else { 10727 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 10728 } 10729 10730 // Status-dependent callbacks 10731 jqXHR.statusCode( statusCode ); 10732 statusCode = undefined; 10733 10734 if ( fireGlobals ) { 10735 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 10736 [ jqXHR, s, isSuccess ? success : error ] ); 10737 } 10738 10739 // Complete 10740 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 10741 10742 if ( fireGlobals ) { 10743 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 10744 10745 // Handle the global AJAX counter 10746 if ( !( --jQuery.active ) ) { 10747 jQuery.event.trigger( "ajaxStop" ); 10748 } 10749 } 10750 } 10751 10752 return jqXHR; 10753 }, 10754 10755 getJSON: function( url, data, callback ) { 10756 return jQuery.get( url, data, callback, "json" ); 10757 }, 10758 10759 getScript: function( url, callback ) { 10760 return jQuery.get( url, undefined, callback, "script" ); 10761 } 10762} ); 10763 10764jQuery.each( [ "get", "post" ], function( _i, method ) { 10765 jQuery[ method ] = function( url, data, callback, type ) { 10766 10767 // Shift arguments if data argument was omitted 10768 if ( isFunction( data ) ) { 10769 type = type || callback; 10770 callback = data; 10771 data = undefined; 10772 } 10773 10774 // The url can be an options object (which then must have .url) 10775 return jQuery.ajax( jQuery.extend( { 10776 url: url, 10777 type: method, 10778 dataType: type, 10779 data: data, 10780 success: callback 10781 }, jQuery.isPlainObject( url ) && url ) ); 10782 }; 10783} ); 10784 10785jQuery.ajaxPrefilter( function( s ) { 10786 var i; 10787 for ( i in s.headers ) { 10788 if ( i.toLowerCase() === "content-type" ) { 10789 s.contentType = s.headers[ i ] || ""; 10790 } 10791 } 10792} ); 10793 10794 10795jQuery._evalUrl = function( url, options, doc ) { 10796 return jQuery.ajax( { 10797 url: url, 10798 10799 // Make this explicit, since user can override this through ajaxSetup (#11264) 10800 type: "GET", 10801 dataType: "script", 10802 cache: true, 10803 async: false, 10804 global: false, 10805 10806 // Only evaluate the response if it is successful (gh-4126) 10807 // dataFilter is not invoked for failure responses, so using it instead 10808 // of the default converter is kludgy but it works. 10809 converters: { 10810 "text script": function() {} 10811 }, 10812 dataFilter: function( response ) { 10813 jQuery.globalEval( response, options, doc ); 10814 } 10815 } ); 10816}; 10817 10818 10819jQuery.fn.extend( { 10820 wrapAll: function( html ) { 10821 var wrap; 10822 10823 if ( this[ 0 ] ) { 10824 if ( isFunction( html ) ) { 10825 html = html.call( this[ 0 ] ); 10826 } 10827 10828 // The elements to wrap the target around 10829 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 10830 10831 if ( this[ 0 ].parentNode ) { 10832 wrap.insertBefore( this[ 0 ] ); 10833 } 10834 10835 wrap.map( function() { 10836 var elem = this; 10837 10838 while ( elem.firstElementChild ) { 10839 elem = elem.firstElementChild; 10840 } 10841 10842 return elem; 10843 } ).append( this ); 10844 } 10845 10846 return this; 10847 }, 10848 10849 wrapInner: function( html ) { 10850 if ( isFunction( html ) ) { 10851 return this.each( function( i ) { 10852 jQuery( this ).wrapInner( html.call( this, i ) ); 10853 } ); 10854 } 10855 10856 return this.each( function() { 10857 var self = jQuery( this ), 10858 contents = self.contents(); 10859 10860 if ( contents.length ) { 10861 contents.wrapAll( html ); 10862 10863 } else { 10864 self.append( html ); 10865 } 10866 } ); 10867 }, 10868 10869 wrap: function( html ) { 10870 var htmlIsFunction = isFunction( html ); 10871 10872 return this.each( function( i ) { 10873 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 10874 } ); 10875 }, 10876 10877 unwrap: function( selector ) { 10878 this.parent( selector ).not( "body" ).each( function() { 10879 jQuery( this ).replaceWith( this.childNodes ); 10880 } ); 10881 return this; 10882 } 10883} ); 10884 10885 10886jQuery.expr.pseudos.hidden = function( elem ) { 10887 return !jQuery.expr.pseudos.visible( elem ); 10888}; 10889jQuery.expr.pseudos.visible = function( elem ) { 10890 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 10891}; 10892 10893 10894 10895 10896jQuery.ajaxSettings.xhr = function() { 10897 try { 10898 return new window.XMLHttpRequest(); 10899 } catch ( e ) {} 10900}; 10901 10902var xhrSuccessStatus = { 10903 10904 // File protocol always yields status code 0, assume 200 10905 0: 200, 10906 10907 // Support: IE <=9 only 10908 // #1450: sometimes IE returns 1223 when it should be 204 10909 1223: 204 10910 }, 10911 xhrSupported = jQuery.ajaxSettings.xhr(); 10912 10913support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 10914support.ajax = xhrSupported = !!xhrSupported; 10915 10916jQuery.ajaxTransport( function( options ) { 10917 var callback, errorCallback; 10918 10919 // Cross domain only allowed if supported through XMLHttpRequest 10920 if ( support.cors || xhrSupported && !options.crossDomain ) { 10921 return { 10922 send: function( headers, complete ) { 10923 var i, 10924 xhr = options.xhr(); 10925 10926 xhr.open( 10927 options.type, 10928 options.url, 10929 options.async, 10930 options.username, 10931 options.password 10932 ); 10933 10934 // Apply custom fields if provided 10935 if ( options.xhrFields ) { 10936 for ( i in options.xhrFields ) { 10937 xhr[ i ] = options.xhrFields[ i ]; 10938 } 10939 } 10940 10941 // Override mime type if needed 10942 if ( options.mimeType && xhr.overrideMimeType ) { 10943 xhr.overrideMimeType( options.mimeType ); 10944 } 10945 10946 // X-Requested-With header 10947 // For cross-domain requests, seeing as conditions for a preflight are 10948 // akin to a jigsaw puzzle, we simply never set it to be sure. 10949 // (it can always be set on a per-request basis or even using ajaxSetup) 10950 // For same-domain requests, won't change header if already provided. 10951 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 10952 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 10953 } 10954 10955 // Set headers 10956 for ( i in headers ) { 10957 xhr.setRequestHeader( i, headers[ i ] ); 10958 } 10959 10960 // Callback 10961 callback = function( type ) { 10962 return function() { 10963 if ( callback ) { 10964 callback = errorCallback = xhr.onload = 10965 xhr.onerror = xhr.onabort = xhr.ontimeout = 10966 xhr.onreadystatechange = null; 10967 10968 if ( type === "abort" ) { 10969 xhr.abort(); 10970 } else if ( type === "error" ) { 10971 10972 // Support: IE <=9 only 10973 // On a manual native abort, IE9 throws 10974 // errors on any property access that is not readyState 10975 if ( typeof xhr.status !== "number" ) { 10976 complete( 0, "error" ); 10977 } else { 10978 complete( 10979 10980 // File: protocol always yields status 0; see #8605, #14207 10981 xhr.status, 10982 xhr.statusText 10983 ); 10984 } 10985 } else { 10986 complete( 10987 xhrSuccessStatus[ xhr.status ] || xhr.status, 10988 xhr.statusText, 10989 10990 // Support: IE <=9 only 10991 // IE9 has no XHR2 but throws on binary (trac-11426) 10992 // For XHR2 non-text, let the caller handle it (gh-2498) 10993 ( xhr.responseType || "text" ) !== "text" || 10994 typeof xhr.responseText !== "string" ? 10995 { binary: xhr.response } : 10996 { text: xhr.responseText }, 10997 xhr.getAllResponseHeaders() 10998 ); 10999 } 11000 } 11001 }; 11002 }; 11003 11004 // Listen to events 11005 xhr.onload = callback(); 11006 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 11007 11008 // Support: IE 9 only 11009 // Use onreadystatechange to replace onabort 11010 // to handle uncaught aborts 11011 if ( xhr.onabort !== undefined ) { 11012 xhr.onabort = errorCallback; 11013 } else { 11014 xhr.onreadystatechange = function() { 11015 11016 // Check readyState before timeout as it changes 11017 if ( xhr.readyState === 4 ) { 11018 11019 // Allow onerror to be called first, 11020 // but that will not handle a native abort 11021 // Also, save errorCallback to a variable 11022 // as xhr.onerror cannot be accessed 11023 window.setTimeout( function() { 11024 if ( callback ) { 11025 errorCallback(); 11026 } 11027 } ); 11028 } 11029 }; 11030 } 11031 11032 // Create the abort callback 11033 callback = callback( "abort" ); 11034 11035 try { 11036 11037 // Do send the request (this may raise an exception) 11038 xhr.send( options.hasContent && options.data || null ); 11039 } catch ( e ) { 11040 11041 // #14683: Only rethrow if this hasn't been notified as an error yet 11042 if ( callback ) { 11043 throw e; 11044 } 11045 } 11046 }, 11047 11048 abort: function() { 11049 if ( callback ) { 11050 callback(); 11051 } 11052 } 11053 }; 11054 } 11055} ); 11056 11057 11058 11059 11060// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 11061jQuery.ajaxPrefilter( function( s ) { 11062 if ( s.crossDomain ) { 11063 s.contents.script = false; 11064 } 11065} ); 11066 11067// Install script dataType 11068jQuery.ajaxSetup( { 11069 accepts: { 11070 script: "text/javascript, application/javascript, " + 11071 "application/ecmascript, application/x-ecmascript" 11072 }, 11073 contents: { 11074 script: /\b(?:java|ecma)script\b/ 11075 }, 11076 converters: { 11077 "text script": function( text ) { 11078 jQuery.globalEval( text ); 11079 return text; 11080 } 11081 } 11082} ); 11083 11084// Handle cache's special case and crossDomain 11085jQuery.ajaxPrefilter( "script", function( s ) { 11086 if ( s.cache === undefined ) { 11087 s.cache = false; 11088 } 11089 if ( s.crossDomain ) { 11090 s.type = "GET"; 11091 } 11092} ); 11093 11094// Bind script tag hack transport 11095jQuery.ajaxTransport( "script", function( s ) { 11096 11097 // This transport only deals with cross domain or forced-by-attrs requests 11098 if ( s.crossDomain || s.scriptAttrs ) { 11099 var script, callback; 11100 return { 11101 send: function( _, complete ) { 11102 script = jQuery( "<script>" ) 11103 .attr( s.scriptAttrs || {} ) 11104 .prop( { charset: s.scriptCharset, src: s.url } ) 11105 .on( "load error", callback = function( evt ) { 11106 script.remove(); 11107 callback = null; 11108 if ( evt ) { 11109 complete( evt.type === "error" ? 404 : 200, evt.type ); 11110 } 11111 } ); 11112 11113 // Use native DOM manipulation to avoid our domManip AJAX trickery 11114 document.head.appendChild( script[ 0 ] ); 11115 }, 11116 abort: function() { 11117 if ( callback ) { 11118 callback(); 11119 } 11120 } 11121 }; 11122 } 11123} ); 11124 11125 11126 11127 11128var oldCallbacks = [], 11129 rjsonp = /(=)\?(?=&|$)|\?\?/; 11130 11131// Default jsonp settings 11132jQuery.ajaxSetup( { 11133 jsonp: "callback", 11134 jsonpCallback: function() { 11135 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 11136 this[ callback ] = true; 11137 return callback; 11138 } 11139} ); 11140 11141// Detect, normalize options and install callbacks for jsonp requests 11142jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 11143 11144 var callbackName, overwritten, responseContainer, 11145 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 11146 "url" : 11147 typeof s.data === "string" && 11148 ( s.contentType || "" ) 11149 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 11150 rjsonp.test( s.data ) && "data" 11151 ); 11152 11153 // Handle iff the expected data type is "jsonp" or we have a parameter to set 11154 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 11155 11156 // Get callback name, remembering preexisting value associated with it 11157 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 11158 s.jsonpCallback() : 11159 s.jsonpCallback; 11160 11161 // Insert callback into url or form data 11162 if ( jsonProp ) { 11163 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 11164 } else if ( s.jsonp !== false ) { 11165 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 11166 } 11167 11168 // Use data converter to retrieve json after script execution 11169 s.converters[ "script json" ] = function() { 11170 if ( !responseContainer ) { 11171 jQuery.error( callbackName + " was not called" ); 11172 } 11173 return responseContainer[ 0 ]; 11174 }; 11175 11176 // Force json dataType 11177 s.dataTypes[ 0 ] = "json"; 11178 11179 // Install callback 11180 overwritten = window[ callbackName ]; 11181 window[ callbackName ] = function() { 11182 responseContainer = arguments; 11183 }; 11184 11185 // Clean-up function (fires after converters) 11186 jqXHR.always( function() { 11187 11188 // If previous value didn't exist - remove it 11189 if ( overwritten === undefined ) { 11190 jQuery( window ).removeProp( callbackName ); 11191 11192 // Otherwise restore preexisting value 11193 } else { 11194 window[ callbackName ] = overwritten; 11195 } 11196 11197 // Save back as free 11198 if ( s[ callbackName ] ) { 11199 11200 // Make sure that re-using the options doesn't screw things around 11201 s.jsonpCallback = originalSettings.jsonpCallback; 11202 11203 // Save the callback name for future use 11204 oldCallbacks.push( callbackName ); 11205 } 11206 11207 // Call if it was a function and we have a response 11208 if ( responseContainer && isFunction( overwritten ) ) { 11209 overwritten( responseContainer[ 0 ] ); 11210 } 11211 11212 responseContainer = overwritten = undefined; 11213 } ); 11214 11215 // Delegate to script 11216 return "script"; 11217 } 11218} ); 11219 11220 11221 11222 11223// Support: Safari 8 only 11224// In Safari 8 documents created via document.implementation.createHTMLDocument 11225// collapse sibling forms: the second one becomes a child of the first one. 11226// Because of that, this security measure has to be disabled in Safari 8. 11227// https://bugs.webkit.org/show_bug.cgi?id=137337 11228support.createHTMLDocument = ( function() { 11229 var body = document.implementation.createHTMLDocument( "" ).body; 11230 body.innerHTML = "<form></form><form></form>"; 11231 return body.childNodes.length === 2; 11232} )(); 11233 11234 11235// Argument "data" should be string of html 11236// context (optional): If specified, the fragment will be created in this context, 11237// defaults to document 11238// keepScripts (optional): If true, will include scripts passed in the html string 11239jQuery.parseHTML = function( data, context, keepScripts ) { 11240 if ( typeof data !== "string" ) { 11241 return []; 11242 } 11243 if ( typeof context === "boolean" ) { 11244 keepScripts = context; 11245 context = false; 11246 } 11247 11248 var base, parsed, scripts; 11249 11250 if ( !context ) { 11251 11252 // Stop scripts or inline event handlers from being executed immediately 11253 // by using document.implementation 11254 if ( support.createHTMLDocument ) { 11255 context = document.implementation.createHTMLDocument( "" ); 11256 11257 // Set the base href for the created document 11258 // so any parsed elements with URLs 11259 // are based on the document's URL (gh-2965) 11260 base = context.createElement( "base" ); 11261 base.href = document.location.href; 11262 context.head.appendChild( base ); 11263 } else { 11264 context = document; 11265 } 11266 } 11267 11268 parsed = rsingleTag.exec( data ); 11269 scripts = !keepScripts && []; 11270 11271 // Single tag 11272 if ( parsed ) { 11273 return [ context.createElement( parsed[ 1 ] ) ]; 11274 } 11275 11276 parsed = buildFragment( [ data ], context, scripts ); 11277 11278 if ( scripts && scripts.length ) {
vendor: 4,170 bytes, lines 11279-11440
11279 jQuery( scripts ).remove(); 11280 } 11281 11282 return jQuery.merge( [], parsed.childNodes ); 11283}; 11284 11285 11286/** 11287 * Load a url into a page 11288 */ 11289jQuery.fn.load = function( url, params, callback ) { 11290 var selector, type, response, 11291 self = this, 11292 off = url.indexOf( " " ); 11293 11294 if ( off > -1 ) { 11295 selector = stripAndCollapse( url.slice( off ) ); 11296 url = url.slice( 0, off ); 11297 } 11298 11299 // If it's a function 11300 if ( isFunction( params ) ) { 11301 11302 // We assume that it's the callback 11303 callback = params; 11304 params = undefined; 11305 11306 // Otherwise, build a param string 11307 } else if ( params && typeof params === "object" ) { 11308 type = "POST"; 11309 } 11310 11311 // If we have elements to modify, make the request 11312 if ( self.length > 0 ) { 11313 jQuery.ajax( { 11314 url: url, 11315 11316 // If "type" variable is undefined, then "GET" method will be used. 11317 // Make value of this field explicit since 11318 // user can override it through ajaxSetup method 11319 type: type || "GET", 11320 dataType: "html", 11321 data: params 11322 } ).done( function( responseText ) { 11323 11324 // Save response for use in complete callback 11325 response = arguments; 11326 11327 self.html( selector ? 11328 11329 // If a selector was specified, locate the right elements in a dummy div 11330 // Exclude scripts to avoid IE 'Permission Denied' errors 11331 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 11332 11333 // Otherwise use the full result 11334 responseText ); 11335 11336 // If the request succeeds, this function gets "data", "status", "jqXHR" 11337 // but they are ignored because response was set above. 11338 // If it fails, this function gets "jqXHR", "status", "error" 11339 } ).always( callback && function( jqXHR, status ) { 11340 self.each( function() { 11341 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 11342 } ); 11343 } ); 11344 } 11345 11346 return this; 11347}; 11348 11349 11350 11351 11352jQuery.expr.pseudos.animated = function( elem ) { 11353 return jQuery.grep( jQuery.timers, function( fn ) { 11354 return elem === fn.elem; 11355 } ).length; 11356}; 11357 11358 11359 11360 11361jQuery.offset = { 11362 setOffset: function( elem, options, i ) { 11363 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 11364 position = jQuery.css( elem, "position" ), 11365 curElem = jQuery( elem ), 11366 props = {}; 11367 11368 // Set position first, in-case top/left are set even on static elem 11369 if ( position === "static" ) { 11370 elem.style.position = "relative"; 11371 } 11372 11373 curOffset = curElem.offset(); 11374 curCSSTop = jQuery.css( elem, "top" ); 11375 curCSSLeft = jQuery.css( elem, "left" ); 11376 calculatePosition = ( position === "absolute" || position === "fixed" ) && 11377 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 11378 11379 // Need to be able to calculate position if either 11380 // top or left is auto and position is either absolute or fixed 11381 if ( calculatePosition ) { 11382 curPosition = curElem.position(); 11383 curTop = curPosition.top; 11384 curLeft = curPosition.left; 11385 11386 } else { 11387 curTop = parseFloat( curCSSTop ) || 0; 11388 curLeft = parseFloat( curCSSLeft ) || 0; 11389 } 11390 11391 if ( isFunction( options ) ) { 11392 11393 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 11394 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 11395 } 11396 11397 if ( options.top != null ) { 11398 props.top = ( options.top - curOffset.top ) + curTop; 11399 } 11400 if ( options.left != null ) { 11401 props.left = ( options.left - curOffset.left ) + curLeft; 11402 } 11403 11404 if ( "using" in options ) { 11405 options.using.call( elem, props ); 11406 11407 } else { 11408 if ( typeof props.top === "number" ) { 11409 props.top += "px"; 11410 } 11411 if ( typeof props.left === "number" ) { 11412 props.left += "px"; 11413 } 11414 curElem.css( props ); 11415 } 11416 } 11417}; 11418 11419jQuery.fn.extend( { 11420 11421 // offset() relates an element's border box to the document origin 11422 offset: function( options ) { 11423 11424 // Preserve chaining for setter 11425 if ( arguments.length ) { 11426 return options === undefined ? 11427 this : 11428 this.each( function( i ) { 11429 jQuery.offset.setOffset( this, options, i ); 11430 } ); 11431 } 11432 11433 var rect, win, 11434 elem = this[ 0 ]; 11435 11436 if ( !elem ) { 11437 return; 11438 } 11439 11440 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
vendor: 4,784 bytes, lines 11441-11581
11441 // Support: IE <=11 only 11442 // Running getBoundingClientRect on a 11443 // disconnected node in IE throws an error 11444 if ( !elem.getClientRects().length ) { 11445 return { top: 0, left: 0 }; 11446 } 11447 11448 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 11449 rect = elem.getBoundingClientRect(); 11450 win = elem.ownerDocument.defaultView; 11451 return { 11452 top: rect.top + win.pageYOffset, 11453 left: rect.left + win.pageXOffset 11454 }; 11455 }, 11456 11457 // position() relates an element's margin box to its offset parent's padding box 11458 // This corresponds to the behavior of CSS absolute positioning 11459 position: function() { 11460 if ( !this[ 0 ] ) { 11461 return; 11462 } 11463 11464 var offsetParent, offset, doc, 11465 elem = this[ 0 ], 11466 parentOffset = { top: 0, left: 0 }; 11467 11468 // position:fixed elements are offset from the viewport, which itself always has zero offset 11469 if ( jQuery.css( elem, "position" ) === "fixed" ) { 11470 11471 // Assume position:fixed implies availability of getBoundingClientRect 11472 offset = elem.getBoundingClientRect(); 11473 11474 } else { 11475 offset = this.offset(); 11476 11477 // Account for the *real* offset parent, which can be the document or its root element 11478 // when a statically positioned element is identified 11479 doc = elem.ownerDocument; 11480 offsetParent = elem.offsetParent || doc.documentElement; 11481 while ( offsetParent && 11482 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 11483 jQuery.css( offsetParent, "position" ) === "static" ) { 11484 11485 offsetParent = offsetParent.parentNode; 11486 } 11487 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 11488 11489 // Incorporate borders into its offset, since they are outside its content origin 11490 parentOffset = jQuery( offsetParent ).offset(); 11491 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 11492 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 11493 } 11494 } 11495 11496 // Subtract parent offsets and element margins 11497 return { 11498 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 11499 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 11500 }; 11501 }, 11502 11503 // This method will return documentElement in the following cases: 11504 // 1) For the element inside the iframe without offsetParent, this method will return 11505 // documentElement of the parent window 11506 // 2) For the hidden or detached element 11507 // 3) For body or html element, i.e. in case of the html node - it will return itself 11508 // 11509 // but those exceptions were never presented as a real life use-cases 11510 // and might be considered as more preferable results. 11511 // 11512 // This logic, however, is not guaranteed and can change at any point in the future 11513 offsetParent: function() { 11514 return this.map( function() { 11515 var offsetParent = this.offsetParent; 11516 11517 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 11518 offsetParent = offsetParent.offsetParent; 11519 } 11520 11521 return offsetParent || documentElement; 11522 } ); 11523 } 11524} ); 11525 11526// Create scrollLeft and scrollTop methods 11527jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 11528 var top = "pageYOffset" === prop; 11529 11530 jQuery.fn[ method ] = function( val ) { 11531 return access( this, function( elem, method, val ) { 11532 11533 // Coalesce documents and windows 11534 var win; 11535 if ( isWindow( elem ) ) { 11536 win = elem; 11537 } else if ( elem.nodeType === 9 ) { 11538 win = elem.defaultView; 11539 } 11540 11541 if ( val === undefined ) { 11542 return win ? win[ prop ] : elem[ method ]; 11543 } 11544 11545 if ( win ) { 11546 win.scrollTo( 11547 !top ? val : win.pageXOffset, 11548 top ? val : win.pageYOffset 11549 ); 11550 11551 } else { 11552 elem[ method ] = val; 11553 } 11554 }, method, val, arguments.length ); 11555 }; 11556} ); 11557 11558// Support: Safari <=7 - 9.1, Chrome <=37 - 49 11559// Add the top/left cssHooks using jQuery.fn.position 11560// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 11561// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 11562// getComputedStyle returns percent when specified for top/left/bottom/right; 11563// rather than make the css module depend on the offset module, just check for it here 11564jQuery.each( [ "top", "left" ], function( _i, prop ) { 11565 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 11566 function( elem, computed ) { 11567 if ( computed ) { 11568 computed = curCSS( elem, prop ); 11569 11570 // If curCSS returns percentage, fallback to offset 11571 return rnumnonpx.test( computed ) ? 11572 jQuery( elem ).position()[ prop ] + "px" : 11573 computed; 11574 } 11575 } 11576 ); 11577} ); 11578 11579 11580// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 11581jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
vendor: 4,688 bytes, lines 11582-11748
11582 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 11583 function( defaultExtra, funcName ) { 11584 11585 // Margin is only for outerHeight, outerWidth 11586 jQuery.fn[ funcName ] = function( margin, value ) { 11587 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 11588 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 11589 11590 return access( this, function( elem, type, value ) { 11591 var doc; 11592 11593 if ( isWindow( elem ) ) { 11594 11595 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 11596 return funcName.indexOf( "outer" ) === 0 ? 11597 elem[ "inner" + name ] : 11598 elem.document.documentElement[ "client" + name ]; 11599 } 11600 11601 // Get document width or height 11602 if ( elem.nodeType === 9 ) { 11603 doc = elem.documentElement; 11604 11605 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 11606 // whichever is greatest 11607 return Math.max( 11608 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 11609 elem.body[ "offset" + name ], doc[ "offset" + name ], 11610 doc[ "client" + name ] 11611 ); 11612 } 11613 11614 return value === undefined ? 11615 11616 // Get width or height on the element, requesting but not forcing parseFloat 11617 jQuery.css( elem, type, extra ) : 11618 11619 // Set width or height on the element 11620 jQuery.style( elem, type, value, extra ); 11621 }, type, chainable ? margin : undefined, chainable ); 11622 }; 11623 } ); 11624} ); 11625 11626 11627jQuery.each( [ 11628 "ajaxStart", 11629 "ajaxStop", 11630 "ajaxComplete", 11631 "ajaxError", 11632 "ajaxSuccess", 11633 "ajaxSend" 11634], function( _i, type ) { 11635 jQuery.fn[ type ] = function( fn ) { 11636 return this.on( type, fn ); 11637 }; 11638} ); 11639 11640 11641 11642 11643jQuery.fn.extend( { 11644 11645 bind: function( types, data, fn ) { 11646 return this.on( types, null, data, fn ); 11647 }, 11648 unbind: function( types, fn ) { 11649 return this.off( types, null, fn ); 11650 }, 11651 11652 delegate: function( selector, types, data, fn ) { 11653 return this.on( types, selector, data, fn ); 11654 }, 11655 undelegate: function( selector, types, fn ) { 11656 11657 // ( namespace ) or ( selector, types [, fn] ) 11658 return arguments.length === 1 ? 11659 this.off( selector, "**" ) : 11660 this.off( types, selector || "**", fn ); 11661 }, 11662 11663 hover: function( fnOver, fnOut ) { 11664 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 11665 } 11666} ); 11667 11668jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 11669 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 11670 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 11671 function( _i, name ) { 11672 11673 // Handle event binding 11674 jQuery.fn[ name ] = function( data, fn ) { 11675 return arguments.length > 0 ? 11676 this.on( name, null, data, fn ) : 11677 this.trigger( name ); 11678 }; 11679 } ); 11680 11681 11682 11683 11684// Support: Android <=4.0 only 11685// Make sure we trim BOM and NBSP 11686var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 11687 11688// Bind a function to a context, optionally partially applying any 11689// arguments. 11690// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 11691// However, it is not slated for removal any time soon 11692jQuery.proxy = function( fn, context ) { 11693 var tmp, args, proxy; 11694 11695 if ( typeof context === "string" ) { 11696 tmp = fn[ context ]; 11697 context = fn; 11698 fn = tmp; 11699 } 11700 11701 // Quick check to determine if target is callable, in the spec 11702 // this throws a TypeError, but we will just return undefined. 11703 if ( !isFunction( fn ) ) { 11704 return undefined; 11705 } 11706 11707 // Simulated bind 11708 args = slice.call( arguments, 2 ); 11709 proxy = function() { 11710 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 11711 }; 11712 11713 // Set the guid of unique handler to the same of original handler, so it can be removed 11714 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 11715 11716 return proxy; 11717}; 11718 11719jQuery.holdReady = function( hold ) { 11720 if ( hold ) { 11721 jQuery.readyWait++; 11722 } else { 11723 jQuery.ready( true ); 11724 } 11725}; 11726jQuery.isArray = Array.isArray; 11727jQuery.parseJSON = JSON.parse; 11728jQuery.nodeName = nodeName; 11729jQuery.isFunction = isFunction; 11730jQuery.isWindow = isWindow; 11731jQuery.camelCase = camelCase; 11732jQuery.type = toType; 11733 11734jQuery.now = Date.now; 11735 11736jQuery.isNumeric = function( obj ) { 11737 11738 // As of jQuery 3.0, isNumeric is limited to 11739 // strings and numbers (primitives or objects) 11740 // that can be coerced to finite numbers (gh-2662) 11741 var type = jQuery.type( obj ); 11742 return ( type === "number" || type === "string" ) && 11743 11744 // parseFloat NaNs numeric-cast false positives ("") 11745 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 11746 // subtraction forces infinities to NaN 11747 !isNaN( obj - parseFloat( obj ) ); 11748};
11749 11750jQuery.trim = function( text ) { 11751 return text == null ? 11752 "" : 11753 ( text + "" ).replace( rtrim, "" ); 11754}; 11755 11756 11757 11758// Register as a named AMD module, since jQuery can be concatenated with other 11759// files that may use define, but not via a proper concatenation script that 11760// understands anonymous AMD modules. A named AMD is safest and most robust 11761// way to register. Lowercase jquery is used because AMD module names are 11762// derived from file names, and jQuery is normally delivered in a lowercase 11763// file name. Do this after creating the global so that if an AMD module wants 11764// to call noConflict to hide this version of jQuery, it will work. 11765 11766// Note that for maximum portability, libraries that are not jQuery should 11767// declare themselves as anonymous modules, and avoid setting a global if an 11768// AMD loader is present. jQuery is a special case. For more information, see 11769// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 11770 11771if ( typeof define === "function" && define.amd ) { 11772 define( "jquery", [], function() { 11773 return jQuery; 11774 } ); 11775} 11776 11777 11778 11779 11780var 11781 11782 // Map over jQuery in case of overwrite 11783 _jQuery = window.jQuery, 11784 11785 // Map over the $ in case of overwrite 11786 _$ = window.$; 11787 11788jQuery.noConflict = function( deep ) { 11789 if ( window.$ === jQuery ) { 11790 window.$ = _$; 11791 } 11792 11793 if ( deep && window.jQuery === jQuery ) { 11794 window.jQuery = _jQuery; 11795 } 11796 11797 return jQuery; 11798}; 11799 11800// Expose jQuery and $ identifiers, even in AMD 11801// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 11802// and CommonJS for browser emulators (#13566) 11803if ( typeof noGlobal === "undefined" ) { 11804 window.jQuery = window.$ = jQuery; 11805} 11806 11807 11808 11809 11810return jQuery; 11811} ); 11812 11813},{}]},{},[1])(1) 11814}); 11815 11816//# sourceMappingURL=brighthorizons.js.map
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.